simple-table-core 2.6.5 → 2.6.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/Animate-6dc785ab.js +2 -0
- package/dist/Animate-6dc785ab.js.map +1 -0
- package/dist/{DatePicker-e6470cae.js → DatePicker-f0d8a106.js} +2 -2
- package/dist/DatePicker-f0d8a106.js.map +1 -0
- package/dist/cjs/Animate-a380c5a3.js +2 -0
- package/dist/cjs/Animate-a380c5a3.js.map +1 -0
- package/dist/cjs/{DatePicker-1cf6e858.js → DatePicker-8df3046a.js} +2 -2
- package/dist/cjs/DatePicker-8df3046a.js.map +1 -0
- package/dist/cjs/components/simple-table/RenderCells.d.ts +3 -1
- package/dist/cjs/components/simple-table/TableCell.d.ts +1 -1
- package/dist/cjs/components/simple-table/TableRow.d.ts +3 -1
- package/dist/cjs/components/simple-table/TableSection.d.ts +3 -0
- package/dist/cjs/context/TableContext.d.ts +8 -2
- package/dist/cjs/hooks/resizeCoalescing.d.ts +18 -0
- package/dist/cjs/index-3314cbd8.js +2 -0
- package/dist/cjs/index-3314cbd8.js.map +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/types/TableCellProps.d.ts +6 -0
- package/dist/cjs/utils/cellScrollUtils.d.ts +0 -6
- package/dist/cjs/utils/columnUtils.d.ts +13 -0
- package/dist/cjs/utils/columnVirtualizationUtils.d.ts +86 -0
- package/dist/components/simple-table/RenderCells.d.ts +3 -1
- package/dist/components/simple-table/TableCell.d.ts +1 -1
- package/dist/components/simple-table/TableRow.d.ts +3 -1
- package/dist/components/simple-table/TableSection.d.ts +3 -0
- package/dist/context/TableContext.d.ts +8 -2
- package/dist/hooks/resizeCoalescing.d.ts +18 -0
- package/dist/index-0c9bc958.js +2 -0
- package/dist/index-0c9bc958.js.map +1 -0
- package/dist/index.es.js +1 -1
- package/dist/types/TableCellProps.d.ts +6 -0
- package/dist/utils/cellScrollUtils.d.ts +0 -6
- package/dist/utils/columnUtils.d.ts +13 -0
- package/dist/utils/columnVirtualizationUtils.d.ts +86 -0
- package/package.json +1 -1
- package/dist/Animate-b61353fd.js +0 -2
- package/dist/Animate-b61353fd.js.map +0 -1
- package/dist/DatePicker-e6470cae.js.map +0 -1
- package/dist/cjs/Animate-30972772.js +0 -2
- package/dist/cjs/Animate-30972772.js.map +0 -1
- package/dist/cjs/DatePicker-1cf6e858.js.map +0 -1
- package/dist/cjs/index-3774ef93.js +0 -2
- package/dist/cjs/index-3774ef93.js.map +0 -1
- package/dist/index-7f257ce7.js +0 -2
- package/dist/index-7f257ce7.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as n,u as i,a as t,b as e,c as o,d as a,A as r,e as l,f as d,R as u}from"./index-0c9bc958.js";import{jsx as s}from"react/jsx-runtime";import{useRef as f,useMemo as v,useLayoutEffect as m}from"react";var p=function(p){var h=p.children,c=p.id,M=p.parentRef,Y=p.tableRow,C=n(p,["children","id","parentRef","tableRow"]),g=i(),b=g.allowAnimations,x=g.isResizing,R=g.rowHeight,j=t().isScrolling,A=f(null),B=f(null),w=e(j),_=e(x),k=v(function(){return o(R)},[R]);return m(function(){var n,i,t,e;if(b&&A.current&&!x){var o=A.current.getBoundingClientRect(),s=B.current;if(!j)if(!w||j)if(!_||x){if(B.current=o,s){var f=o.x-s.x,v=o.y-s.y;if((Math.abs(f)>=50||Math.abs(v)>5)&&(Math.abs(f)>5||Math.abs(v)>5)){var m=a(a({},r.ROW_REORDER),{onComplete:function(){A.current&&(A.current.style.zIndex="",A.current.style.position="",A.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,c=null===(t=null==M?void 0:M.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==p&&void 0!==h&&void 0!==c){var C=k*(R+u),g=p-C,q=p+h+C,y=s.y>g&&q>s.y,z=o.y>g&&q>o.y,D=p>o.y,E=null!==(e=null==Y?void 0:Y.position)&&void 0!==e?e:0,F=.6*R,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&&o.y>p+h){var H=G(o.y,p,p+h);return void l({element:A.current,options:{startY:s.y,endY:p+h+H+E%15*F*2.5+E%7*.4*R,finalY:o.y,duration:m.duration,easing:m.easing,onComplete:m.onComplete}})}if(y&&!z&&D)return H=G(o.y,p,p+h),void l({element:A.current,options:{startY:s.y,endY:p-H-E%15*F*2.5-E%7*.4*R,finalY:o.y,duration:m.duration,easing:m.easing,onComplete:m.onComplete}});if(!y&&z&&s.y>p+h)return H=G(s.y,p,p+h),void l({element:A.current,options:{startY:p+h+H+E%10*F*1,endY:o.y,duration:m.duration,easing:m.easing,onComplete:m.onComplete}});if(!y&&z&&p>s.y)return H=G(s.y,p,p+h),void l({element:A.current,options:{startY:p-H-E%10*F*1,endY:o.y,duration:m.duration,easing:m.easing,onComplete:m.onComplete}})}d({element:A.current,fromBounds:s,toBounds:o,finalConfig:m})}}}else B.current=o;else B.current=o}},[b,k,x,j,M,w,_,R,null==Y?void 0:Y.position,Y]),s("div",a({ref:A,"data-animate-id":c,id:c+""},C,{children:h}))};p.displayName="Animate";export{p as Animate,p as default};
|
|
2
|
+
//# sourceMappingURL=Animate-6dc785ab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Animate-6dc785ab.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as e,
|
|
2
|
-
//# sourceMappingURL=DatePicker-
|
|
1
|
+
import{u as e,d as n}from"./index-0c9bc958.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().icons,h=c(u||new Date),m=h[0],v=h[1],k=c("days"),p=k[0],w=k[1],y=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"===p&&t(a,{children:[r("button",n({onClick:function(){v(new Date(m.getFullYear(),m.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:f.prev})),t("div",n({className:"st-datepicker-header-label",onClick:function(){return w("months")}},{children:[(o=m,o.toLocaleString("default",{month:"long"}))," ",m.getFullYear()]})),r("button",n({onClick:function(){v(new Date(m.getFullYear(),m.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:f.next}))]}),"months"===p&&r("div",n({className:"st-datepicker-header-label",onClick:function(){return w("years")}},{children:m.getFullYear()})),"years"===p&&r("div",n({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),t("div",n({className:"st-datepicker-grid st-datepicker-".concat(p,"-grid")},{children:["days"===p&&function(){var e=[],t=m.getFullYear(),a=m.getMonth(),c=y(t,a),i=function(e,n){return new Date(e,n,1).getDay()}(t,a),d=y(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(m.getFullYear(),m.getMonth()-1,e,12,0,0);v(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=m.getFullYear(),t=m.getMonth(),a=new Date(n,t,e,12,0,0);v(a),s(a),null==l||l()}(c)}},{children:c}),"day-".concat(c)))},k=1;c>=k;k++)h(k);var p=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(m.getFullYear(),m.getMonth()+1,e,12,0,0);v(n),s(n),null==l||l()}(t)}},{children:t}),"next-".concat(t)))};for(k=1;p>=k;k++)w(k);return e}(),"months"===p&&(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===m.getMonth();d.push(r("div",n({className:"st-datepicker-month ".concat(a?"selected":""),onClick:function(){return function(e){v(new Date(m.getFullYear(),e,1)),w("days")}(t)}},{children:e}),"month-".concat(t)))}),d),"years"===p&&function(){for(var e=[],t=m.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){v(new Date(e,m.getMonth(),1)),w("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);v(n),s(n),null==l||l()}},{children:"Today"}))}))]}))};export{i as default};
|
|
2
|
+
//# sourceMappingURL=DatePicker-f0d8a106.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker-f0d8a106.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var n=require("./index-3314cbd8.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.rowHeight,m=n.useScrollState().isScrolling,h=i.useRef(null),p=i.useRef(null),c=n.usePrevious(m),M=n.usePrevious(f),Y=i.useMemo(function(){return n.calculateBufferRowCount(s)},[s]);return i.useLayoutEffect(function(){var e,i,t,o;if(v&&h.current&&!f){var r=h.current.getBoundingClientRect(),d=p.current;if(!m)if(!c||m)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*(s+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*s,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*s,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*s,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,m,a,c,M,s,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-a380c5a3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Animate-a380c5a3.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-3314cbd8.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().icons,o=t.useState(s||new Date),u=o[0],h=o[1],f=t.useState("days"),v=f[0],k=f[1],m=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"===v&&n.jsxs(n.Fragment,{children:[n.jsx("button",e.__assign({onClick:function(){h(new Date(u.getFullYear(),u.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:l.prev})),n.jsxs("div",e.__assign({className:"st-datepicker-header-label",onClick:function(){return k("months")}},{children:[(c=u,c.toLocaleString("default",{month:"long"}))," ",u.getFullYear()]})),n.jsx("button",e.__assign({onClick:function(){h(new Date(u.getFullYear(),u.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:l.next}))]}),"months"===v&&n.jsx("div",e.__assign({className:"st-datepicker-header-label",onClick:function(){return k("years")}},{children:u.getFullYear()})),"years"===v&&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(v,"-grid")},{children:["days"===v&&function(){var t=[],a=u.getFullYear(),r=u.getMonth(),c=m(a,r),l=function(e,n){return new Date(e,n,1).getDay()}(a,r),o=m(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 f=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(u.getFullYear(),u.getMonth()-1,e,12,0,0);h(n),i(n),null==d||d()}(r)}},{children:r}),"prev-".concat(r)))},v=0;l>v;v++)f(v);for(var k=function(c){var l=c===(new Date).getDate()&&r===(new Date).getMonth()&&a===(new Date).getFullYear(),o=new Date(s),f=c===o.getDate()&&r===o.getMonth()&&a===o.getFullYear();t.push(n.jsx("div",e.__assign({className:"st-datepicker-day ".concat(l?"today":""," ").concat(f?"selected":""),onClick:function(){return function(e){var n=u.getFullYear(),t=u.getMonth(),a=new Date(n,t,e,12,0,0);h(a),i(a),null==d||d()}(c)}},{children:c}),"day-".concat(c)))},p=1;c>=p;p++)k(p);var w=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(u.getFullYear(),u.getMonth()+1,e,12,0,0);h(n),i(n),null==d||d()}(a)}},{children:a}),"next-".concat(a)))};for(p=1;w>=p;p++)y(p);return t}(),"months"===v&&(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===u.getMonth();r.push(n.jsx("div",e.__assign({className:"st-datepicker-month ".concat(c?"selected":""),onClick:function(){return function(e){h(new Date(u.getFullYear(),e,1)),k("days")}(a)}},{children:t}),"month-".concat(a)))}),r),"years"===v&&function(){for(var t=[],a=u.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){h(new Date(e,u.getMonth(),1)),k("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);h(n),i(n),null==d||d()}},{children:"Today"}))}))]}))};
|
|
2
|
+
//# sourceMappingURL=DatePicker-8df3046a.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker-8df3046a.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -4,9 +4,11 @@ import type TableRowType from "../../types/TableRow";
|
|
|
4
4
|
import { Pinned } from "../../types/Pinned";
|
|
5
5
|
import RowIndices from "../../types/RowIndices";
|
|
6
6
|
import ColumnIndices from "../../types/ColumnIndices";
|
|
7
|
+
import { ColumnWindow } from "../../utils/columnVirtualizationUtils";
|
|
7
8
|
interface RenderCellsProps {
|
|
8
9
|
columnIndexStart?: number;
|
|
9
10
|
columnIndices: ColumnIndices;
|
|
11
|
+
columnWindow?: ColumnWindow | null;
|
|
10
12
|
headers: HeaderObject[];
|
|
11
13
|
pinned?: Pinned;
|
|
12
14
|
rowIndex: number;
|
|
@@ -14,5 +16,5 @@ interface RenderCellsProps {
|
|
|
14
16
|
rowIndices: RowIndices;
|
|
15
17
|
tableRow: TableRowType;
|
|
16
18
|
}
|
|
17
|
-
declare const _default: React.MemoExoticComponent<({ columnIndexStart, columnIndices, headers, pinned, rowIndex, displayRowNumber, rowIndices, tableRow, }: RenderCellsProps) => import("react/jsx-runtime").JSX.Element>;
|
|
19
|
+
declare const _default: React.MemoExoticComponent<({ columnIndexStart, columnIndices, columnWindow, headers, pinned, rowIndex, displayRowNumber, rowIndices, tableRow, }: RenderCellsProps) => import("react/jsx-runtime").JSX.Element>;
|
|
18
20
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import TableCellProps from "../../types/TableCellProps";
|
|
3
|
-
declare const _default: React.MemoExoticComponent<({ borderClass, colIndex, displayRowNumber, header, isHighlighted, isInitialFocused, nestedIndex, parentHeader, rowIndex, tableRow, }: TableCellProps) => import("react/jsx-runtime").JSX.Element>;
|
|
3
|
+
declare const _default: React.MemoExoticComponent<({ borderClass, colIndex, displayRowNumber, gridColumnStart, header, isHighlighted, isInitialFocused, nestedIndex, parentHeader, rowIndex, tableRow, }: TableCellProps) => import("react/jsx-runtime").JSX.Element>;
|
|
4
4
|
export default _default;
|
|
@@ -4,9 +4,11 @@ import { Pinned } from "../../types/Pinned";
|
|
|
4
4
|
import HeaderObject from "../../types/HeaderObject";
|
|
5
5
|
import ColumnIndices from "../../types/ColumnIndices";
|
|
6
6
|
import RowIndices from "../../types/RowIndices";
|
|
7
|
+
import { ColumnWindow } from "../../utils/columnVirtualizationUtils";
|
|
7
8
|
interface TableRowProps {
|
|
8
9
|
columnIndexStart?: number;
|
|
9
10
|
columnIndices: ColumnIndices;
|
|
11
|
+
columnWindow?: ColumnWindow | null;
|
|
10
12
|
gridTemplateColumns: string;
|
|
11
13
|
headers: HeaderObject[];
|
|
12
14
|
index: number;
|
|
@@ -20,5 +22,5 @@ interface TableRowProps {
|
|
|
20
22
|
stickyOffset?: number;
|
|
21
23
|
stickyZIndex?: number;
|
|
22
24
|
}
|
|
23
|
-
declare const _default: React.MemoExoticComponent<({ columnIndices, columnIndexStart, gridTemplateColumns, headers, index, pinned, rowHeight, rowIndices, setHoveredIndex, tableRow, isSticky, stickyIndex, stickyOffset, stickyZIndex, }: TableRowProps) => import("react/jsx-runtime").JSX.Element>;
|
|
25
|
+
declare const _default: React.MemoExoticComponent<({ columnIndices, columnIndexStart, columnWindow, gridTemplateColumns, headers, index, pinned, rowHeight, rowIndices, setHoveredIndex, tableRow, isSticky, stickyIndex, stickyOffset, stickyZIndex, }: TableRowProps) => import("react/jsx-runtime").JSX.Element>;
|
|
24
26
|
export default _default;
|
|
@@ -4,9 +4,12 @@ import { Pinned } from "../../types/Pinned";
|
|
|
4
4
|
import HeaderObject from "../../types/HeaderObject";
|
|
5
5
|
import ColumnIndices from "../../types/ColumnIndices";
|
|
6
6
|
import RowIndices from "../../types/RowIndices";
|
|
7
|
+
import { ColumnWindow } from "../../utils/columnVirtualizationUtils";
|
|
7
8
|
interface TableSectionProps {
|
|
8
9
|
columnIndexStart?: number;
|
|
9
10
|
columnIndices: ColumnIndices;
|
|
11
|
+
/** Visible-column window for this section, or null/undefined to render all columns (pinned sections). */
|
|
12
|
+
columnWindow?: ColumnWindow | null;
|
|
10
13
|
headers: HeaderObject[];
|
|
11
14
|
pinned?: Pinned;
|
|
12
15
|
regularRows: TableRowType[];
|
|
@@ -79,7 +79,6 @@ interface TableContextType {
|
|
|
79
79
|
isLoading?: boolean;
|
|
80
80
|
isResizing: boolean;
|
|
81
81
|
isRowSelected?: (rowId: string) => boolean;
|
|
82
|
-
isScrolling: boolean;
|
|
83
82
|
isSelected: (cell: Cell) => boolean;
|
|
84
83
|
isWarningFlashing: (cell: Cell) => boolean;
|
|
85
84
|
mainBodyRef: RefObject<HTMLDivElement | null>;
|
|
@@ -115,7 +114,6 @@ interface TableContextType {
|
|
|
115
114
|
setHeaders: Dispatch<SetStateAction<HeaderObject[]>>;
|
|
116
115
|
setInitialFocusedCell: Dispatch<SetStateAction<Cell | null>>;
|
|
117
116
|
setIsResizing: Dispatch<SetStateAction<boolean>>;
|
|
118
|
-
setIsScrolling: Dispatch<SetStateAction<boolean>>;
|
|
119
117
|
setSelectedCells: Dispatch<SetStateAction<Set<string>>>;
|
|
120
118
|
setSelectedColumns: Dispatch<SetStateAction<Set<number>>>;
|
|
121
119
|
setSelectedRows?: Dispatch<SetStateAction<Set<string>>>;
|
|
@@ -140,4 +138,12 @@ export declare const TableProvider: ({ children, value, }: {
|
|
|
140
138
|
value: TableContextType;
|
|
141
139
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
142
140
|
export declare const useTableContext: () => TableContextType;
|
|
141
|
+
interface ScrollStateContextType {
|
|
142
|
+
isScrolling: boolean;
|
|
143
|
+
setIsScrolling: Dispatch<SetStateAction<boolean>>;
|
|
144
|
+
}
|
|
145
|
+
export declare const ScrollStateProvider: ({ children }: {
|
|
146
|
+
children: ReactNode;
|
|
147
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
148
|
+
export declare const useScrollState: () => ScrollStateContextType;
|
|
143
149
|
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Quiet period after the last ResizeObserver tick before publishing a settled value. */
|
|
2
|
+
export declare const CONTAINER_RESIZE_SETTLE_MS = 150;
|
|
3
|
+
export interface SettledResizePublisher {
|
|
4
|
+
/** Queue a value for publication after {@link CONTAINER_RESIZE_SETTLE_MS}. */
|
|
5
|
+
notify: (value: number) => void;
|
|
6
|
+
/** Read from DOM on the next animation frame, then queue for settled publication. */
|
|
7
|
+
notifyFromObserver: (read: () => number) => void;
|
|
8
|
+
/** Publish immediately, cancelling any pending settled notification. */
|
|
9
|
+
publishImmediately: (value: number) => void;
|
|
10
|
+
destroy: () => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Coalesce a stream of resize measurements into a single publication once layout
|
|
14
|
+
* stops changing (e.g. after a nav expand/collapse CSS transition ends).
|
|
15
|
+
*/
|
|
16
|
+
export declare const createSettledResizePublisher: (publish: (value: number) => void, settleMs?: number) => SettledResizePublisher;
|
|
17
|
+
/** Optional perf hook used by the container-resize Storybook benchmark. */
|
|
18
|
+
export declare const recordContainerWidthStateUpdate: () => void;
|