simple-table-core 2.2.1 → 2.2.4
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/{Animate-81ce6277.js → Animate-7b64ed41.js} +2 -2
- package/dist/Animate-7b64ed41.js.map +1 -0
- package/dist/{DatePicker-02d1164f.js → DatePicker-fb52a6ab.js} +2 -2
- package/dist/DatePicker-fb52a6ab.js.map +1 -0
- package/dist/cjs/{Animate-2c6424db.js → Animate-336b250f.js} +2 -2
- package/dist/cjs/Animate-336b250f.js.map +1 -0
- package/dist/cjs/{DatePicker-bf4341b1.js → DatePicker-61c4dd6d.js} +2 -2
- package/dist/cjs/DatePicker-61c4dd6d.js.map +1 -0
- package/dist/cjs/components/simple-table/NestedGridRow.d.ts +17 -0
- package/dist/cjs/components/simple-table/SimpleTable.d.ts +1 -93
- package/dist/cjs/context/TableContext.d.ts +4 -0
- package/dist/cjs/hooks/useFlattenedRows.d.ts +13 -2
- package/dist/cjs/hooks/useSelection.d.ts +3 -1
- package/dist/cjs/hooks/useTableAPI.d.ts +3 -1
- package/dist/cjs/hooks/useTableRowProcessing.d.ts +8 -1
- package/dist/cjs/index-7e05cbd8.js +2 -0
- package/dist/cjs/index-7e05cbd8.js.map +1 -0
- package/dist/cjs/index.d.ts +3 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/cjs/types/CustomTheme.d.ts +26 -0
- package/dist/cjs/types/HeaderObject.d.ts +2 -0
- package/dist/cjs/types/SimpleTableProps.d.ts +91 -0
- package/dist/cjs/types/TableRefType.d.ts +2 -0
- package/dist/cjs/types/TableRow.d.ts +7 -0
- package/dist/cjs/utils/cellScrollUtils.d.ts +2 -1
- package/dist/cjs/utils/infiniteScrollUtils.d.ts +71 -5
- package/dist/cjs/utils/rowUtils.d.ts +22 -2
- package/dist/components/simple-table/NestedGridRow.d.ts +17 -0
- package/dist/components/simple-table/SimpleTable.d.ts +1 -93
- package/dist/context/TableContext.d.ts +4 -0
- package/dist/hooks/useFlattenedRows.d.ts +13 -2
- package/dist/hooks/useSelection.d.ts +3 -1
- package/dist/hooks/useTableAPI.d.ts +3 -1
- package/dist/hooks/useTableRowProcessing.d.ts +8 -1
- package/dist/index-32d48d9a.js +2 -0
- package/dist/index-32d48d9a.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.es.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/CustomTheme.d.ts +26 -0
- package/dist/types/HeaderObject.d.ts +2 -0
- package/dist/types/SimpleTableProps.d.ts +91 -0
- package/dist/types/TableRefType.d.ts +2 -0
- package/dist/types/TableRow.d.ts +7 -0
- package/dist/utils/cellScrollUtils.d.ts +2 -1
- package/dist/utils/infiniteScrollUtils.d.ts +71 -5
- package/dist/utils/rowUtils.d.ts +22 -2
- package/package.json +1 -1
- package/src/styles/base.css +7 -0
- package/dist/Animate-81ce6277.js.map +0 -1
- package/dist/DatePicker-02d1164f.js.map +0 -1
- package/dist/cjs/Animate-2c6424db.js.map +0 -1
- package/dist/cjs/DatePicker-bf4341b1.js.map +0 -1
- package/dist/cjs/index-c51c0467.js +0 -2
- package/dist/cjs/index-c51c0467.js.map +0 -1
- package/dist/index-a6a9e1f1.js +0 -2
- package/dist/index-a6a9e1f1.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as n,u as i,a as t,c as
|
|
2
|
-
//# sourceMappingURL=Animate-
|
|
1
|
+
import{_ as n,u as i,a as t,c as o,b as e,A as a,d as r,f as d,R as l}from"./index-32d48d9a.js";import{jsx as u}from"react/jsx-runtime";import{useRef as f,useMemo as s,useLayoutEffect as v}from"react";var m=function(m){var p=m.children,h=m.id,M=m.parentRef,c=m.tableRow,Y=n(m,["children","id","parentRef","tableRow"]),C=i(),g=C.allowAnimations,x=C.isResizing,R=C.isScrolling,b=C.rowHeight,j=f(null),A=f(null),B=t(R),w=t(x),_=s(function(){return o(b)},[b]);return v(function(){var n,i,t,o;if(g&&j.current&&!x){var u=j.current.getBoundingClientRect(),f=A.current;if(!R)if(!B||R)if(!w||x){if(A.current=u,f){var s=u.x-f.x,v=u.y-f.y;if((Math.abs(s)>=50||Math.abs(v)>5)&&(Math.abs(s)>5||Math.abs(v)>5)){var m=e(e({},a.ROW_REORDER),{onComplete:function(){j.current&&(j.current.style.zIndex="",j.current.style.position="",j.current.style.top="")}}),p=null===(n=null==M?void 0:M.current)||void 0===n?void 0:n.scrollTop,h=null===(i=null==M?void 0:M.current)||void 0===i?void 0:i.clientHeight,Y=null===(t=null==M?void 0:M.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==p&&void 0!==h&&void 0!==Y){var C=_*(b+l),k=p-C,q=p+h+C,y=f.y>k&&q>f.y,z=u.y>k&&q>u.y,D=p>u.y,E=null!==(o=null==c?void 0:c.position)&&void 0!==o?o:0,F=.6*b,G=function(n,i,t){return Math.min(900,Math.max(100,100+80*Math.log10(Math.max(1,Math.min(Math.abs(n-i),Math.abs(n-t))))))};if(y&&!z&&u.y>p+h){var H=G(u.y,p,p+h);return void r({element:j.current,options:{startY:f.y,endY:p+h+H+E%15*F*2.5+E%7*.4*b,finalY:u.y,duration:m.duration,easing:m.easing,onComplete:m.onComplete}})}if(y&&!z&&D)return H=G(u.y,p,p+h),void r({element:j.current,options:{startY:f.y,endY:p-H-E%15*F*2.5-E%7*.4*b,finalY:u.y,duration:m.duration,easing:m.easing,onComplete:m.onComplete}});if(!y&&z&&f.y>p+h)return H=G(f.y,p,p+h),void r({element:j.current,options:{startY:p+h+H+E%10*F*1,endY:u.y,duration:m.duration,easing:m.easing,onComplete:m.onComplete}});if(!y&&z&&p>f.y)return H=G(f.y,p,p+h),void r({element:j.current,options:{startY:p-H-E%10*F*1,endY:u.y,duration:m.duration,easing:m.easing,onComplete:m.onComplete}})}d({element:j.current,fromBounds:f,toBounds:u,finalConfig:m})}}}else A.current=u;else A.current=u}},[g,_,x,R,M,B,w,b,null==c?void 0:c.position,c]),u("div",e({ref:j,"data-animate-id":h,id:h+""},Y,{children:p}))};m.displayName="Animate";export{m as Animate,m as default};
|
|
2
|
+
//# sourceMappingURL=Animate-7b64ed41.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Animate-7b64ed41.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as e,b as n}from"./index-
|
|
2
|
-
//# sourceMappingURL=DatePicker-
|
|
1
|
+
import{u as e,b as n}from"./index-32d48d9a.js";import{jsxs as t,Fragment as a,jsx as r}from"react/jsx-runtime";import{useState as c}from"react";var i=function(i){var d,o,s=i.onChange,l=i.onClose,u=i.value,f=e(),h=f.nextIcon,m=f.prevIcon,v=c(u||new Date),k=v[0],p=v[1],w=c("days"),y=w[0],D=w[1],N=function(e,n){return new Date(e,n+1,0).getDate()};return t("div",n({className:"st-datepicker"},{children:[t("div",n({className:"st-datepicker-header"},{children:["days"===y&&t(a,{children:[r("button",n({onClick:function(){p(new Date(k.getFullYear(),k.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:m})),t("div",n({className:"st-datepicker-header-label",onClick:function(){return D("months")}},{children:[(o=k,o.toLocaleString("default",{month:"long"}))," ",k.getFullYear()]})),r("button",n({onClick:function(){p(new Date(k.getFullYear(),k.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:h}))]}),"months"===y&&r("div",n({className:"st-datepicker-header-label",onClick:function(){return D("years")}},{children:k.getFullYear()})),"years"===y&&r("div",n({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),t("div",n({className:"st-datepicker-grid st-datepicker-".concat(y,"-grid")},{children:["days"===y&&function(){var e=[],t=k.getFullYear(),a=k.getMonth(),c=N(t,a),i=function(e,n){return new Date(e,n,1).getDay()}(t,a),d=N(t,a-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,a){e.push(r("div",n({className:"st-datepicker-weekday"},{children:t}),"header-".concat(a)))});for(var o=function(t){var a=d-i+t+1;e.push(r("div",n({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(k.getFullYear(),k.getMonth()-1,e,12,0,0);p(n),s(n),null==l||l()}(a)}},{children:a}),"prev-".concat(a)))},f=0;i>f;f++)o(f);for(var h=function(c){var i=c===(new Date).getDate()&&a===(new Date).getMonth()&&t===(new Date).getFullYear(),d=new Date(u),o=c===d.getDate()&&a===d.getMonth()&&t===d.getFullYear();e.push(r("div",n({className:"st-datepicker-day ".concat(i?"today":""," ").concat(o?"selected":""),onClick:function(){return function(e){var n=k.getFullYear(),t=k.getMonth(),a=new Date(n,t,e,12,0,0);p(a),s(a),null==l||l()}(c)}},{children:c}),"day-".concat(c)))},m=1;c>=m;m++)h(m);var v=35-(i+c),w=function(t){e.push(r("div",n({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(k.getFullYear(),k.getMonth()+1,e,12,0,0);p(n),s(n),null==l||l()}(t)}},{children:t}),"next-".concat(t)))};for(m=1;v>=m;m++)w(m);return e}(),"months"===y&&(d=[],Array.from({length:12},function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})}).forEach(function(e,t){var a=t===k.getMonth();d.push(r("div",n({className:"st-datepicker-month ".concat(a?"selected":""),onClick:function(){return function(e){p(new Date(k.getFullYear(),e,1)),D("days")}(t)}},{children:e}),"month-".concat(t)))}),d),"years"===y&&function(){for(var e=[],t=k.getFullYear(),a=t-6,c=function(a){e.push(r("div",n({className:"st-datepicker-year ".concat(a===t?"selected":""),onClick:function(){return function(e){p(new Date(e,k.getMonth(),1)),D("months")}(a)}},{children:a}),"year-".concat(a)))},i=a;a+12>i;i++)c(i);return e}()]})),r("div",n({className:"st-datepicker-footer"},{children:r("button",n({className:"st-datepicker-today-btn",onClick:function(){var e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0);p(n),s(n),null==l||l()}},{children:"Today"}))}))]}))};export{i as default};
|
|
2
|
+
//# sourceMappingURL=DatePicker-fb52a6ab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker-fb52a6ab.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var n=require("./index-
|
|
2
|
-
//# sourceMappingURL=Animate-
|
|
1
|
+
"use strict";var n=require("./index-7e05cbd8.js"),e=require("react/jsx-runtime"),i=require("react"),t=function(t){var o=t.children,r=t.id,a=t.parentRef,l=t.tableRow,d=n.__rest(t,["children","id","parentRef","tableRow"]),u=n.useTableContext(),v=u.allowAnimations,f=u.isResizing,s=u.isScrolling,m=u.rowHeight,h=i.useRef(null),p=i.useRef(null),c=n.usePrevious(s),M=n.usePrevious(f),Y=i.useMemo(function(){return n.calculateBufferRowCount(m)},[m]);return i.useLayoutEffect(function(){var e,i,t,o;if(v&&h.current&&!f){var r=h.current.getBoundingClientRect(),d=p.current;if(!s)if(!c||s)if(!M||f){if(p.current=r,d){var u=r.x-d.x,C=r.y-d.y;if((Math.abs(u)>=50||Math.abs(C)>5)&&(Math.abs(u)>5||Math.abs(C)>5)){var g=n.__assign(n.__assign({},n.ANIMATION_CONFIGS.ROW_REORDER),{onComplete:function(){h.current&&(h.current.style.zIndex="",h.current.style.position="",h.current.style.top="")}}),x=null===(e=null==a?void 0:a.current)||void 0===e?void 0:e.scrollTop,q=null===(i=null==a?void 0:a.current)||void 0===i?void 0:i.clientHeight,b=null===(t=null==a?void 0:a.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==x&&void 0!==q&&void 0!==b){var j=Y*(m+n.ROW_SEPARATOR_WIDTH),B=x-j,R=x+q+j,w=d.y>B&&R>d.y,A=r.y>B&&R>r.y,k=x>r.y,y=null!==(o=null==l?void 0:l.position)&&void 0!==o?o:0,z=.6*m,D=function(n,e,i){return Math.min(900,Math.max(100,100+80*Math.log10(Math.max(1,Math.min(Math.abs(n-e),Math.abs(n-i))))))};if(w&&!A&&r.y>x+q){var E=D(r.y,x,x+q);return void n.animateWithCustomCoordinates({element:h.current,options:{startY:d.y,endY:x+q+E+y%15*z*2.5+y%7*.4*m,finalY:r.y,duration:g.duration,easing:g.easing,onComplete:g.onComplete}})}if(w&&!A&&k)return E=D(r.y,x,x+q),void n.animateWithCustomCoordinates({element:h.current,options:{startY:d.y,endY:x-E-y%15*z*2.5-y%7*.4*m,finalY:r.y,duration:g.duration,easing:g.easing,onComplete:g.onComplete}});if(!w&&A&&d.y>x+q)return E=D(d.y,x,x+q),void n.animateWithCustomCoordinates({element:h.current,options:{startY:x+q+E+y%10*z*1,endY:r.y,duration:g.duration,easing:g.easing,onComplete:g.onComplete}});if(!w&&A&&x>d.y)return E=D(d.y,x,x+q),void n.animateWithCustomCoordinates({element:h.current,options:{startY:x-E-y%10*z*1,endY:r.y,duration:g.duration,easing:g.easing,onComplete:g.onComplete}})}n.flipElement({element:h.current,fromBounds:d,toBounds:r,finalConfig:g})}}}else p.current=r;else p.current=r}},[v,Y,f,s,a,c,M,m,null==l?void 0:l.position,l]),e.jsx("div",n.__assign({ref:h,"data-animate-id":r,id:r+""},d,{children:o}))};t.displayName="Animate",exports.Animate=t,exports.default=t;
|
|
2
|
+
//# sourceMappingURL=Animate-336b250f.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Animate-336b250f.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("./index-
|
|
2
|
-
//# sourceMappingURL=DatePicker-
|
|
1
|
+
"use strict";var e=require("./index-7e05cbd8.js"),n=require("react/jsx-runtime"),t=require("react");exports.default=function(a){var r,c,i=a.onChange,d=a.onClose,s=a.value,l=e.useTableContext(),o=l.nextIcon,u=l.prevIcon,h=t.useState(s||new Date),f=h[0],v=h[1],k=t.useState("days"),m=k[0],p=k[1],w=function(e,n){return new Date(e,n+1,0).getDate()};return n.jsxs("div",e.__assign({className:"st-datepicker"},{children:[n.jsxs("div",e.__assign({className:"st-datepicker-header"},{children:["days"===m&&n.jsxs(n.Fragment,{children:[n.jsx("button",e.__assign({onClick:function(){v(new Date(f.getFullYear(),f.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:u})),n.jsxs("div",e.__assign({className:"st-datepicker-header-label",onClick:function(){return p("months")}},{children:[(c=f,c.toLocaleString("default",{month:"long"}))," ",f.getFullYear()]})),n.jsx("button",e.__assign({onClick:function(){v(new Date(f.getFullYear(),f.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:o}))]}),"months"===m&&n.jsx("div",e.__assign({className:"st-datepicker-header-label",onClick:function(){return p("years")}},{children:f.getFullYear()})),"years"===m&&n.jsx("div",e.__assign({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),n.jsxs("div",e.__assign({className:"st-datepicker-grid st-datepicker-".concat(m,"-grid")},{children:["days"===m&&function(){var t=[],a=f.getFullYear(),r=f.getMonth(),c=w(a,r),l=function(e,n){return new Date(e,n,1).getDay()}(a,r),o=w(a,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(a,r){t.push(n.jsx("div",e.__assign({className:"st-datepicker-weekday"},{children:a}),"header-".concat(r)))});for(var u=function(a){var r=o-l+a+1;t.push(n.jsx("div",e.__assign({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(f.getFullYear(),f.getMonth()-1,e,12,0,0);v(n),i(n),null==d||d()}(r)}},{children:r}),"prev-".concat(r)))},h=0;l>h;h++)u(h);for(var k=function(c){var l=c===(new Date).getDate()&&r===(new Date).getMonth()&&a===(new Date).getFullYear(),o=new Date(s),u=c===o.getDate()&&r===o.getMonth()&&a===o.getFullYear();t.push(n.jsx("div",e.__assign({className:"st-datepicker-day ".concat(l?"today":""," ").concat(u?"selected":""),onClick:function(){return function(e){var n=f.getFullYear(),t=f.getMonth(),a=new Date(n,t,e,12,0,0);v(a),i(a),null==d||d()}(c)}},{children:c}),"day-".concat(c)))},m=1;c>=m;m++)k(m);var p=35-(l+c),y=function(a){t.push(n.jsx("div",e.__assign({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(f.getFullYear(),f.getMonth()+1,e,12,0,0);v(n),i(n),null==d||d()}(a)}},{children:a}),"next-".concat(a)))};for(m=1;p>=m;m++)y(m);return t}(),"months"===m&&(r=[],Array.from({length:12},function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})}).forEach(function(t,a){var c=a===f.getMonth();r.push(n.jsx("div",e.__assign({className:"st-datepicker-month ".concat(c?"selected":""),onClick:function(){return function(e){v(new Date(f.getFullYear(),e,1)),p("days")}(a)}},{children:t}),"month-".concat(a)))}),r),"years"===m&&function(){for(var t=[],a=f.getFullYear(),r=a-6,c=function(r){t.push(n.jsx("div",e.__assign({className:"st-datepicker-year ".concat(r===a?"selected":""),onClick:function(){return function(e){v(new Date(e,f.getMonth(),1)),p("months")}(r)}},{children:r}),"year-".concat(r)))},i=r;r+12>i;i++)c(i);return t}()]})),n.jsx("div",e.__assign({className:"st-datepicker-footer"},{children:n.jsx("button",e.__assign({className:"st-datepicker-today-btn",onClick:function(){var e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0);v(n),i(n),null==d||d()}},{children:"Today"}))}))]}))};
|
|
2
|
+
//# sourceMappingURL=DatePicker-61c4dd6d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker-61c4dd6d.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Row from "../../types/Row";
|
|
2
|
+
import HeaderObject, { Accessor } from "../../types/HeaderObject";
|
|
3
|
+
interface NestedGridRowProps {
|
|
4
|
+
calculatedHeight: number;
|
|
5
|
+
childAccessor: Accessor;
|
|
6
|
+
depth: number;
|
|
7
|
+
expandableHeader: HeaderObject;
|
|
8
|
+
index: number;
|
|
9
|
+
parentRow: Row;
|
|
10
|
+
position: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Component that renders a nested SimpleTable inside an expanded row
|
|
14
|
+
* Spans the full width of the parent table (grid column 1 / -1)
|
|
15
|
+
*/
|
|
16
|
+
declare const NestedGridRow: ({ calculatedHeight, childAccessor, depth, expandableHeader, index, parentRow, position, }: NestedGridRowProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
export default NestedGridRow;
|
|
@@ -1,96 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import HeaderObject, { Accessor } from "../../types/HeaderObject";
|
|
3
|
-
import CellChangeProps from "../../types/CellChangeProps";
|
|
4
|
-
import Theme from "../../types/Theme";
|
|
5
|
-
import Row from "../../types/Row";
|
|
6
|
-
import ColumnEditorPosition from "../../types/ColumnEditorPosition";
|
|
7
|
-
import TableRefType from "../../types/TableRefType";
|
|
8
|
-
import OnNextPage from "../../types/OnNextPage";
|
|
1
|
+
import { SimpleTableProps } from "../../types/SimpleTableProps";
|
|
9
2
|
import "../../styles/all-themes.css";
|
|
10
|
-
import { TableFilterState } from "../../types/FilterTypes";
|
|
11
|
-
import { ColumnVisibilityState } from "../../types/ColumnVisibilityTypes";
|
|
12
|
-
import SortColumn, { SortDirection } from "../../types/SortColumn";
|
|
13
|
-
import RowSelectionChangeProps from "../../types/RowSelectionChangeProps";
|
|
14
|
-
import CellClickProps from "../../types/CellClickProps";
|
|
15
|
-
import { RowButton } from "../../types/RowButton";
|
|
16
|
-
import { HeaderDropdown } from "../../types/HeaderDropdownProps";
|
|
17
|
-
import FooterRendererProps from "../../types/FooterRendererProps";
|
|
18
|
-
import OnRowGroupExpandProps from "../../types/OnRowGroupExpandProps";
|
|
19
|
-
import { LoadingStateRenderer, ErrorStateRenderer, EmptyStateRenderer } from "../../types/RowStateRendererProps";
|
|
20
|
-
interface SimpleTableProps {
|
|
21
|
-
allowAnimations?: boolean;
|
|
22
|
-
autoExpandColumns?: boolean;
|
|
23
|
-
canExpandRowGroup?: (row: Row) => boolean;
|
|
24
|
-
cellUpdateFlash?: boolean;
|
|
25
|
-
className?: string;
|
|
26
|
-
columnBorders?: boolean;
|
|
27
|
-
columnEditorPosition?: ColumnEditorPosition;
|
|
28
|
-
columnEditorText?: string;
|
|
29
|
-
columnReordering?: boolean;
|
|
30
|
-
columnResizing?: boolean;
|
|
31
|
-
copyHeadersToClipboard?: boolean;
|
|
32
|
-
defaultHeaders: HeaderObject[];
|
|
33
|
-
editColumns?: boolean;
|
|
34
|
-
editColumnsInitOpen?: boolean;
|
|
35
|
-
emptyStateRenderer?: EmptyStateRenderer;
|
|
36
|
-
enableHeaderEditing?: boolean;
|
|
37
|
-
enableRowSelection?: boolean;
|
|
38
|
-
errorStateRenderer?: ErrorStateRenderer;
|
|
39
|
-
expandAll?: boolean;
|
|
40
|
-
expandIcon?: ReactNode;
|
|
41
|
-
externalFilterHandling?: boolean;
|
|
42
|
-
externalSortHandling?: boolean;
|
|
43
|
-
filterIcon?: ReactNode;
|
|
44
|
-
footerHeight?: number;
|
|
45
|
-
footerRenderer?: (props: FooterRendererProps) => ReactNode;
|
|
46
|
-
headerCollapseIcon?: ReactNode;
|
|
47
|
-
headerDropdown?: HeaderDropdown;
|
|
48
|
-
headerExpandIcon?: ReactNode;
|
|
49
|
-
headerHeight?: number;
|
|
50
|
-
height?: string | number;
|
|
51
|
-
hideFooter?: boolean;
|
|
52
|
-
hideHeader?: boolean;
|
|
53
|
-
includeHeadersInCSVExport?: boolean;
|
|
54
|
-
initialSortColumn?: string;
|
|
55
|
-
initialSortDirection?: SortDirection;
|
|
56
|
-
isLoading?: boolean;
|
|
57
|
-
loadingStateRenderer?: LoadingStateRenderer;
|
|
58
|
-
maxHeight?: string | number;
|
|
59
|
-
nextIcon?: ReactNode;
|
|
60
|
-
onCellClick?: (props: CellClickProps) => void;
|
|
61
|
-
onCellEdit?: (props: CellChangeProps) => void;
|
|
62
|
-
onColumnOrderChange?: (newHeaders: HeaderObject[]) => void;
|
|
63
|
-
onColumnSelect?: (header: HeaderObject) => void;
|
|
64
|
-
onColumnVisibilityChange?: (visibilityState: ColumnVisibilityState) => void;
|
|
65
|
-
onFilterChange?: (filters: TableFilterState) => void;
|
|
66
|
-
onGridReady?: () => void;
|
|
67
|
-
onHeaderEdit?: (header: HeaderObject, newLabel: string) => void;
|
|
68
|
-
onLoadMore?: () => void;
|
|
69
|
-
onNextPage?: OnNextPage;
|
|
70
|
-
onPageChange?: (page: number) => void | Promise<void>;
|
|
71
|
-
onRowGroupExpand?: (props: OnRowGroupExpandProps) => void | Promise<void>;
|
|
72
|
-
onRowSelectionChange?: (props: RowSelectionChangeProps) => void;
|
|
73
|
-
onSortChange?: (sort: SortColumn | null) => void;
|
|
74
|
-
prevIcon?: ReactNode;
|
|
75
|
-
rowButtons?: RowButton[];
|
|
76
|
-
rowGrouping?: Accessor[];
|
|
77
|
-
rowHeight?: number;
|
|
78
|
-
rows: Row[];
|
|
79
|
-
rowsPerPage?: number;
|
|
80
|
-
selectableCells?: boolean;
|
|
81
|
-
selectableColumns?: boolean;
|
|
82
|
-
selectionColumnWidth?: number;
|
|
83
|
-
serverSidePagination?: boolean;
|
|
84
|
-
shouldPaginate?: boolean;
|
|
85
|
-
sortDownIcon?: ReactNode;
|
|
86
|
-
sortUpIcon?: ReactNode;
|
|
87
|
-
tableEmptyStateRenderer?: ReactNode;
|
|
88
|
-
tableRef?: MutableRefObject<TableRefType | null>;
|
|
89
|
-
theme?: Theme;
|
|
90
|
-
totalRowCount?: number;
|
|
91
|
-
useHoverRowBackground?: boolean;
|
|
92
|
-
useOddColumnBackground?: boolean;
|
|
93
|
-
useOddEvenRowBackground?: boolean;
|
|
94
|
-
}
|
|
95
3
|
declare const SimpleTable: (props: SimpleTableProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
96
4
|
export default SimpleTable;
|
|
@@ -14,6 +14,8 @@ import OnRowGroupExpandProps from "../types/OnRowGroupExpandProps";
|
|
|
14
14
|
import RowState from "../types/RowState";
|
|
15
15
|
import Row from "../types/Row";
|
|
16
16
|
import { LoadingStateRenderer, ErrorStateRenderer, EmptyStateRenderer } from "../types/RowStateRendererProps";
|
|
17
|
+
import { HeightOffsets } from "../utils/infiniteScrollUtils";
|
|
18
|
+
import { CustomTheme } from "../types/CustomTheme";
|
|
17
19
|
export interface CellRegistryEntry {
|
|
18
20
|
updateContent: (newValue: CellValue) => void;
|
|
19
21
|
}
|
|
@@ -65,6 +67,7 @@ interface TableContextType {
|
|
|
65
67
|
headerExpandIcon?: ReactNode;
|
|
66
68
|
headerRegistry?: Map<string, HeaderRegistryEntry>;
|
|
67
69
|
headers: HeaderObject[];
|
|
70
|
+
heightOffsets?: HeightOffsets;
|
|
68
71
|
hoveredHeaderRef: MutableRefObject<HeaderObject | null>;
|
|
69
72
|
maxHeaderDepth: number;
|
|
70
73
|
isAnimating: boolean;
|
|
@@ -123,6 +126,7 @@ interface TableContextType {
|
|
|
123
126
|
tableEmptyStateRenderer?: ReactNode;
|
|
124
127
|
tableRows: TableRow[];
|
|
125
128
|
theme: Theme;
|
|
129
|
+
customTheme: CustomTheme;
|
|
126
130
|
expandedRows: Map<string, number>;
|
|
127
131
|
collapsedRows: Map<string, number>;
|
|
128
132
|
useHoverRowBackground: boolean;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { Accessor } from "../types/HeaderObject";
|
|
1
|
+
import HeaderObject, { Accessor } from "../types/HeaderObject";
|
|
2
2
|
import Row from "../types/Row";
|
|
3
3
|
import RowState from "../types/RowState";
|
|
4
4
|
import TableRow from "../types/TableRow";
|
|
5
|
+
import { HeightOffsets } from "../utils/infiniteScrollUtils";
|
|
6
|
+
import { CustomTheme } from "../types/CustomTheme";
|
|
5
7
|
interface UseFlattenedRowsProps {
|
|
6
8
|
rows: Row[];
|
|
7
9
|
rowGrouping?: Accessor[];
|
|
@@ -12,6 +14,15 @@ interface UseFlattenedRowsProps {
|
|
|
12
14
|
hasLoadingRenderer: boolean;
|
|
13
15
|
hasErrorRenderer: boolean;
|
|
14
16
|
hasEmptyRenderer: boolean;
|
|
17
|
+
headers: HeaderObject[];
|
|
18
|
+
rowHeight: number;
|
|
19
|
+
headerHeight: number;
|
|
20
|
+
customTheme: CustomTheme;
|
|
21
|
+
}
|
|
22
|
+
interface UseFlattenedRowsResult {
|
|
23
|
+
flattenedRows: TableRow[];
|
|
24
|
+
heightOffsets: HeightOffsets;
|
|
25
|
+
paginatableRows: TableRow[];
|
|
15
26
|
}
|
|
16
27
|
/**
|
|
17
28
|
* Hook that flattens nested row data into a flat array of TableRow objects.
|
|
@@ -19,5 +30,5 @@ interface UseFlattenedRowsProps {
|
|
|
19
30
|
* can all operate on the flat structure, fixing issues where rowsPerPage
|
|
20
31
|
* didn't account for nested children.
|
|
21
32
|
*/
|
|
22
|
-
declare const useFlattenedRows: ({ rows, rowGrouping, expandedRows, collapsedRows, expandedDepths, rowStateMap, hasLoadingRenderer, hasErrorRenderer, hasEmptyRenderer, }: UseFlattenedRowsProps) =>
|
|
33
|
+
declare const useFlattenedRows: ({ rows, rowGrouping, expandedRows, collapsedRows, expandedDepths, rowStateMap, hasLoadingRenderer, hasErrorRenderer, hasEmptyRenderer, headers, rowHeight, headerHeight, customTheme, }: UseFlattenedRowsProps) => UseFlattenedRowsResult;
|
|
23
34
|
export default useFlattenedRows;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import HeaderObject, { Accessor } from "../types/HeaderObject";
|
|
3
3
|
import type TableRowType from "../types/TableRow";
|
|
4
4
|
import Cell from "../types/Cell";
|
|
5
|
+
import { CustomTheme } from "../types/CustomTheme";
|
|
5
6
|
export declare const createSetString: ({ rowIndex, colIndex, rowId }: Cell) => string;
|
|
6
7
|
interface UseSelectionProps {
|
|
7
8
|
selectableCells: boolean;
|
|
@@ -13,8 +14,9 @@ interface UseSelectionProps {
|
|
|
13
14
|
rowHeight: number;
|
|
14
15
|
enableRowSelection?: boolean;
|
|
15
16
|
copyHeadersToClipboard?: boolean;
|
|
17
|
+
customTheme: CustomTheme;
|
|
16
18
|
}
|
|
17
|
-
declare const useSelection: ({ selectableCells, headers, tableRows, onCellEdit, cellRegistry, collapsedHeaders, rowHeight, enableRowSelection, copyHeadersToClipboard, }: UseSelectionProps) => {
|
|
19
|
+
declare const useSelection: ({ selectableCells, headers, tableRows, onCellEdit, cellRegistry, collapsedHeaders, rowHeight, enableRowSelection, copyHeadersToClipboard, customTheme, }: UseSelectionProps) => {
|
|
18
20
|
getBorderClass: ({ colIndex, rowIndex, rowId }: Cell) => string;
|
|
19
21
|
handleMouseDown: ({ colIndex, rowIndex, rowId }: Cell) => void;
|
|
20
22
|
handleMouseOver: ({ colIndex, rowIndex, rowId }: Cell) => void;
|
|
@@ -6,7 +6,7 @@ import TableRow from "../types/TableRow";
|
|
|
6
6
|
import HeaderObject from "../types/HeaderObject";
|
|
7
7
|
import { TableFilterState, FilterCondition } from "../types/FilterTypes";
|
|
8
8
|
import { SortDirection } from "../types/SortColumn";
|
|
9
|
-
declare const useTableAPI: ({ cellRegistryRef, clearAllFilters, clearFilter, currentPage, expandedDepths, filters, flattenedRows, headerRegistryRef, headers, includeHeadersInCSVExport, rowGrouping, rowIndexMap, rows, rowsPerPage, serverSidePagination, setCollapsedRows, setCurrentPage, setExpandedDepths, setExpandedRows, setRows, shouldPaginate, sort, tableRef, updateFilter, updateSort, visibleRows, }: {
|
|
9
|
+
declare const useTableAPI: ({ cellRegistryRef, clearAllFilters, clearFilter, currentPage, expandedDepths, filters, flattenedRows, headerRegistryRef, headers, includeHeadersInCSVExport, paginatableRows, rowGrouping, rowIndexMap, rows, rowsPerPage, serverSidePagination, setCollapsedRows, setCurrentPage, setExpandedDepths, setExpandedRows, setRows, shouldPaginate, sort, tableRef, totalRowCount, updateFilter, updateSort, visibleRows, }: {
|
|
10
10
|
cellRegistryRef: MutableRefObject<Map<string, CellRegistryEntry>>;
|
|
11
11
|
clearAllFilters: () => void;
|
|
12
12
|
clearFilter: (accessor: Accessor) => void;
|
|
@@ -17,6 +17,7 @@ declare const useTableAPI: ({ cellRegistryRef, clearAllFilters, clearFilter, cur
|
|
|
17
17
|
headerRegistryRef: MutableRefObject<Map<string, HeaderRegistryEntry>>;
|
|
18
18
|
headers: HeaderObject[];
|
|
19
19
|
includeHeadersInCSVExport: boolean;
|
|
20
|
+
paginatableRows: TableRow[];
|
|
20
21
|
rowGrouping?: string[] | undefined;
|
|
21
22
|
rowIndexMap: MutableRefObject<Map<string | number, number>>;
|
|
22
23
|
rows: Row[];
|
|
@@ -30,6 +31,7 @@ declare const useTableAPI: ({ cellRegistryRef, clearAllFilters, clearFilter, cur
|
|
|
30
31
|
shouldPaginate: boolean;
|
|
31
32
|
sort: SortColumn | null;
|
|
32
33
|
tableRef?: MutableRefObject<TableRefType | null> | undefined;
|
|
34
|
+
totalRowCount?: number | undefined;
|
|
33
35
|
updateFilter: (filter: FilterCondition) => void;
|
|
34
36
|
updateSort: (props?: {
|
|
35
37
|
accessor: Accessor;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { Accessor } from "../types/HeaderObject";
|
|
2
2
|
import { FilterCondition } from "../types/FilterTypes";
|
|
3
3
|
import TableRow from "../types/TableRow";
|
|
4
|
+
import { HeightOffsets } from "../utils/infiniteScrollUtils";
|
|
5
|
+
import { CustomTheme } from "../types/CustomTheme";
|
|
4
6
|
interface UseTableRowProcessingProps {
|
|
5
7
|
allowAnimations: boolean;
|
|
6
8
|
/** Already flattened rows from useFlattenedRows */
|
|
7
9
|
flattenedRows: TableRow[];
|
|
8
10
|
/** Original flattened rows for establishing baseline positions */
|
|
9
11
|
originalFlattenedRows: TableRow[];
|
|
12
|
+
/** Rows that should count towards pagination (excludes nested grids, state indicators) */
|
|
13
|
+
paginatableRows: TableRow[];
|
|
10
14
|
currentPage: number;
|
|
11
15
|
rowsPerPage: number;
|
|
12
16
|
shouldPaginate: boolean;
|
|
@@ -15,15 +19,18 @@ interface UseTableRowProcessingProps {
|
|
|
15
19
|
rowHeight: number;
|
|
16
20
|
scrollTop: number;
|
|
17
21
|
scrollDirection?: "up" | "down" | "none";
|
|
22
|
+
heightOffsets?: HeightOffsets;
|
|
23
|
+
customTheme: CustomTheme;
|
|
18
24
|
computeFilteredRowsPreview: (filter: FilterCondition) => TableRow[];
|
|
19
25
|
computeSortedRowsPreview: (accessor: Accessor) => TableRow[];
|
|
20
26
|
}
|
|
21
|
-
declare const useTableRowProcessing: ({ allowAnimations, flattenedRows, originalFlattenedRows, currentPage, rowsPerPage, shouldPaginate, serverSidePagination, contentHeight, rowHeight, scrollTop, scrollDirection, computeFilteredRowsPreview, computeSortedRowsPreview, }: UseTableRowProcessingProps) => {
|
|
27
|
+
declare const useTableRowProcessing: ({ allowAnimations, flattenedRows, originalFlattenedRows, paginatableRows, currentPage, rowsPerPage, shouldPaginate, serverSidePagination, contentHeight, rowHeight, scrollTop, scrollDirection, heightOffsets, customTheme, computeFilteredRowsPreview, computeSortedRowsPreview, }: UseTableRowProcessingProps) => {
|
|
22
28
|
currentTableRows: TableRow[];
|
|
23
29
|
currentVisibleRows: TableRow[];
|
|
24
30
|
isAnimating: boolean;
|
|
25
31
|
prepareForFilterChange: (filter: FilterCondition) => void;
|
|
26
32
|
prepareForSortChange: (accessor: Accessor) => void;
|
|
27
33
|
rowsToRender: TableRow[];
|
|
34
|
+
paginatedHeightOffsets: HeightOffsets | undefined;
|
|
28
35
|
};
|
|
29
36
|
export default useTableRowProcessing;
|