@infinite-table/infinite-react 6.2.9 → 6.2.11
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/index.css +1 -1
- package/index.d.ts +433 -433
- package/index.dev.js +32 -22
- package/index.dev.mjs +109 -99
- package/index.js +6 -6
- package/index.mjs +6 -6
- package/package.json +2 -2
package/index.dev.js
CHANGED
|
@@ -1453,7 +1453,7 @@ var internalProps = {
|
|
|
1453
1453
|
};
|
|
1454
1454
|
|
|
1455
1455
|
// src/components/InfiniteTable/internalVars.css.ts
|
|
1456
|
-
var InternalVars = { currentColumnTransformX: "var(--_16hkbkc0)", y: "var(--_16hkbkc1)", currentFlashingBackground: "var(--_16hkbkc2)", currentFlashingDuration: "var(--_16hkbkc3)", activeCellRowOffset: "var(--_16hkbkc4)", activeCellRowOffsetX: "var(--_16hkbkc5)", activeCellRowHeight: "var(--_16hkbkc6)", activeCellOffsetX: "var(--_16hkbkc7)", activeCellOffsetY: "var(--_16hkbkc8)", scrollTopForActiveRow: "var(--_16hkbkc9)", scrollLeftForActiveRowWhenHorizontalLayout: "var(--_16hkbkca)", activeCellColWidth: "var(--_16hkbkcb)", activeCellColOffset: "var(--_16hkbkcc)", columnReorderEffectDurationAtIndex: "var(--_16hkbkcd)", columnWidthAtIndex: "var(--_16hkbkce)", columnOffsetAtIndex: "var(--_16hkbkcf)", columnOffsetAtIndexWhileReordering: "var(--_16hkbkcg)", columnZIndexAtIndex: "var(--_16hkbkch)", pinnedStartWidth: "var(--_16hkbkci)", pinnedEndWidth: "var(--_16hkbkcj)", pinnedEndOffset: "var(--_16hkbkck)", computedVisibleColumnsCount: "var(--_16hkbkcl)", baseZIndexForCells: "var(--_16hkbkcm)", bodyWidth: "var(--_16hkbkcn)", bodyHeight: "var(--_16hkbkco)", scrollbarWidthHorizontal: "var(--_16hkbkcp)", scrollbarWidthVertical: "var(--_16hkbkcq)", scrollLeft: "var(--_16hkbkcr)", scrollTop: "var(--_16hkbkcs)"
|
|
1456
|
+
var InternalVars = { currentColumnTransformX: "var(--_16hkbkc0)", y: "var(--_16hkbkc1)", currentFlashingBackground: "var(--_16hkbkc2)", currentFlashingDuration: "var(--_16hkbkc3)", activeCellRowOffset: "var(--_16hkbkc4)", activeCellRowOffsetX: "var(--_16hkbkc5)", activeCellRowHeight: "var(--_16hkbkc6)", activeCellOffsetX: "var(--_16hkbkc7)", activeCellOffsetY: "var(--_16hkbkc8)", scrollTopForActiveRow: "var(--_16hkbkc9)", scrollLeftForActiveRowWhenHorizontalLayout: "var(--_16hkbkca)", activeCellColWidth: "var(--_16hkbkcb)", activeCellColOffset: "var(--_16hkbkcc)", columnReorderEffectDurationAtIndex: "var(--_16hkbkcd)", columnWidthAtIndex: "var(--_16hkbkce)", columnOffsetAtIndex: "var(--_16hkbkcf)", columnOffsetAtIndexWhileReordering: "var(--_16hkbkcg)", columnZIndexAtIndex: "var(--_16hkbkch)", pinnedStartWidth: "var(--_16hkbkci)", pinnedEndWidth: "var(--_16hkbkcj)", pinnedEndOffset: "var(--_16hkbkck)", computedVisibleColumnsCount: "var(--_16hkbkcl)", baseZIndexForCells: "var(--_16hkbkcm)", bodyWidth: "var(--_16hkbkcn)", bodyHeight: "var(--_16hkbkco)", scrollbarWidthHorizontal: "var(--_16hkbkcp)", scrollbarWidthVertical: "var(--_16hkbkcq)", scrollLeft: "var(--_16hkbkcr)", scrollTop: "var(--_16hkbkcs)" };
|
|
1457
1457
|
|
|
1458
1458
|
// src/components/InfiniteTable/vars.css.ts
|
|
1459
1459
|
var CSS_LOADED_VALUE = "true";
|
|
@@ -5407,8 +5407,6 @@ var CELL_DETACHED_CLASSNAMES = [
|
|
|
5407
5407
|
];
|
|
5408
5408
|
|
|
5409
5409
|
// src/components/HeadlessTable/index.tsx
|
|
5410
|
-
var virtualScrollLeftOffset = stripVar(InternalVars.virtualScrollLeftOffset);
|
|
5411
|
-
var virtualScrollTopOffset = stripVar(InternalVars.virtualScrollTopOffset);
|
|
5412
5410
|
function useMatrixBrain(brain, brainOptions, fixedCellsInfo) {
|
|
5413
5411
|
if (fixedCellsInfo && (fixedCellsInfo.fixedColsStart || fixedCellsInfo.fixedColsEnd || fixedCellsInfo.fixedRowsStart || fixedCellsInfo.fixedRowsEnd)) {
|
|
5414
5412
|
brain.updateFixedCells({
|
|
@@ -5482,25 +5480,14 @@ function HeadlessTable(props) {
|
|
|
5482
5480
|
}, [wrapRowsHorizontally, brain]);
|
|
5483
5481
|
const updateDOMTransform = (0, import_react10.useCallback)((scrollPos) => {
|
|
5484
5482
|
requestAnimationFrame(() => {
|
|
5485
|
-
|
|
5486
|
-
if (!scrollVarHost) {
|
|
5487
|
-
if (!domRef.current) {
|
|
5488
|
-
return;
|
|
5489
|
-
}
|
|
5490
|
-
domRef.current.style.setProperty(
|
|
5491
|
-
"transform",
|
|
5492
|
-
`translate3d(${-scrollPos.scrollLeft}px, ${-scrollPos.scrollTop}px, 0px)`
|
|
5493
|
-
);
|
|
5483
|
+
if (!domRef.current) {
|
|
5494
5484
|
return;
|
|
5495
5485
|
}
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
);
|
|
5500
|
-
scrollVarHost.style.setProperty(
|
|
5501
|
-
virtualScrollTopOffset,
|
|
5502
|
-
`-${scrollPos.scrollTop}px`
|
|
5486
|
+
domRef.current.style.setProperty(
|
|
5487
|
+
"transform",
|
|
5488
|
+
`translate3d(${-scrollPos.scrollLeft}px, ${-scrollPos.scrollTop}px, 0px)`
|
|
5503
5489
|
);
|
|
5490
|
+
return;
|
|
5504
5491
|
});
|
|
5505
5492
|
}, []);
|
|
5506
5493
|
const onContainerScroll = (0, import_react10.useCallback)(
|
|
@@ -9409,7 +9396,10 @@ function getRawValueForCell(column, rowInfo) {
|
|
|
9409
9396
|
const groupBy = dataSourceHasGrouping ? rowInfo.groupBy : void 0;
|
|
9410
9397
|
let value = isGroupRow && groupBy && column.groupByForColumn && // if this is a multi-group column we're good
|
|
9411
9398
|
(Array.isArray(column.groupByForColumn) || // or it has to be a group column for the current group row
|
|
9412
|
-
column.groupByForColumn === groupBy[groupBy.length - 1]) ? rowInfo.value : isColumnWithField(column) ?
|
|
9399
|
+
column.groupByForColumn === groupBy[groupBy.length - 1]) ? rowInfo.value : isColumnWithField(column) ? (
|
|
9400
|
+
// @ts-ignore
|
|
9401
|
+
data?.[column.field]
|
|
9402
|
+
) : null;
|
|
9413
9403
|
if (column.field && rowInfo.isGroupRow && rowInfo.reducerData && rowInfo.reducerData[column.field] != null) {
|
|
9414
9404
|
value = rowInfo.reducerData[column.field];
|
|
9415
9405
|
}
|
|
@@ -11540,6 +11530,18 @@ function InfiniteTableHeaderFn(props) {
|
|
|
11540
11530
|
} = useInfiniteTable();
|
|
11541
11531
|
const { computedColumnsMap } = computed;
|
|
11542
11532
|
const domRef = (0, import_react31.useRef)(null);
|
|
11533
|
+
const updateDOMTransform = (0, import_react31.useCallback)((scrollPosition) => {
|
|
11534
|
+
if (domRef.current) {
|
|
11535
|
+
domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
|
|
11536
|
+
}
|
|
11537
|
+
}, []);
|
|
11538
|
+
(0, import_react31.useEffect)(() => {
|
|
11539
|
+
const removeOnScroll = headerBrain.onScroll(updateDOMTransform);
|
|
11540
|
+
updateDOMTransform(
|
|
11541
|
+
headerBrain.getScrollPosition() || { scrollLeft: 0, scrollTop: 0 }
|
|
11542
|
+
);
|
|
11543
|
+
return removeOnScroll;
|
|
11544
|
+
}, [headerBrain]);
|
|
11543
11545
|
const domProps = {
|
|
11544
11546
|
ref: domRef,
|
|
11545
11547
|
className: join(
|
|
@@ -23600,7 +23602,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
23600
23602
|
}
|
|
23601
23603
|
let valid2 = isValidLicense(licenseKey, {
|
|
23602
23604
|
publishedAt: 1624970570587,
|
|
23603
|
-
version: "6.2.
|
|
23605
|
+
version: "6.2.11"
|
|
23604
23606
|
});
|
|
23605
23607
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
23606
23608
|
return true;
|
|
@@ -27112,9 +27114,17 @@ var import_react65 = require("react");
|
|
|
27112
27114
|
function useHorizontalLayout() {
|
|
27113
27115
|
const { getState, actions, dataSourceActions, getDataSourceState } = useInfiniteTable();
|
|
27114
27116
|
const { groupBy, isTree } = getDataSourceState();
|
|
27115
|
-
const
|
|
27117
|
+
const state = getState();
|
|
27118
|
+
const { brain, wrapRowsHorizontally } = state;
|
|
27119
|
+
let repeatWrappedGroupRows = state.repeatWrappedGroupRows;
|
|
27120
|
+
if (!wrapRowsHorizontally) {
|
|
27121
|
+
repeatWrappedGroupRows = false;
|
|
27122
|
+
}
|
|
27116
27123
|
(0, import_react65.useEffect)(() => {
|
|
27117
27124
|
if (!wrapRowsHorizontally) {
|
|
27125
|
+
if (getDataSourceState().repeatWrappedGroupRows) {
|
|
27126
|
+
dataSourceActions.repeatWrappedGroupRows = false;
|
|
27127
|
+
}
|
|
27118
27128
|
return;
|
|
27119
27129
|
}
|
|
27120
27130
|
const onVerticalRenderRangeChange = () => {
|