@infinite-table/infinite-react 0.4.12 โ 0.4.13
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/README.md +1 -1
- package/index.d.ts +1 -1
- package/index.esm.js +42 -36
- package/index.js +7 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
|
|
38
38
|
* [๐ sorting](https://infinite-table.com/docs/latest/learn/working-with-data/sorting)
|
|
39
39
|
* [๐ช row grouping](https://infinite-table.com/docs/latest/learn/grouping-and-pivoting/grouping-rows) - both server-side and client-side
|
|
40
|
-
* [๐ข pivoting](https://infinite-table.com/docs/latest/learn/grouping-and-pivoting/pivoting) - both server-side and client-side
|
|
40
|
+
* [๐ข pivoting](https://infinite-table.com/docs/latest/learn/grouping-and-pivoting/pivoting/overview) - both server-side and client-side
|
|
41
41
|
* [๐งช aggregations](https://infinite-table.com/docs/latest/learn/grouping-and-pivoting/grouping-rows#aggregations)
|
|
42
42
|
* [๐ช๏ธ live pagination](https://infinite-table.com/docs/latest/learn/working-with-data/live-pagination)
|
|
43
43
|
* [๐ด lazy loading](https://infinite-table.com/docs/latest/learn/working-with-data/lazy-loading)
|
package/index.d.ts
CHANGED
|
@@ -271,7 +271,7 @@ declare type InfiniteTableColumn<DATA_TYPE> = {
|
|
|
271
271
|
renderGroupValue?: InfiniteTableColumnRenderFunctionForGroupRows<DATA_TYPE>;
|
|
272
272
|
renderLeafValue?: InfiniteTableColumnRenderFunctionForNormalRows<DATA_TYPE>;
|
|
273
273
|
valueGetter?: InfiniteTableColumnValueGetter<DATA_TYPE>;
|
|
274
|
-
valueFormatter?: InfiniteTableColumnValueFormatter<DATA_TYPE>;
|
|
274
|
+
valueFormatter?: InfiniteTableColumnValueFormatter<DATA_TYPE, Renderable>;
|
|
275
275
|
defaultWidth?: number;
|
|
276
276
|
defaultFlex?: number;
|
|
277
277
|
defaultFilterable?: boolean;
|
package/index.esm.js
CHANGED
|
@@ -4261,7 +4261,7 @@ import {
|
|
|
4261
4261
|
createElement as createElement25,
|
|
4262
4262
|
useMemo as useMemo5
|
|
4263
4263
|
} from "react";
|
|
4264
|
-
import { useCallback as useCallback9, useContext as useContext5, useEffect as useEffect13, useRef as
|
|
4264
|
+
import { useCallback as useCallback9, useContext as useContext5, useEffect as useEffect13, useRef as useRef14 } from "react";
|
|
4265
4265
|
import { createPortal } from "react-dom";
|
|
4266
4266
|
|
|
4267
4267
|
// src/components/DataSource/defaultFilterTypes.ts
|
|
@@ -5147,7 +5147,8 @@ import {
|
|
|
5147
5147
|
Fragment as Fragment2,
|
|
5148
5148
|
createContext as createContext4,
|
|
5149
5149
|
createElement as createElement18,
|
|
5150
|
-
memo as memo8
|
|
5150
|
+
memo as memo8,
|
|
5151
|
+
useRef as useRef12
|
|
5151
5152
|
} from "react";
|
|
5152
5153
|
import { useCallback as useCallback7, useContext as useContext4, useMemo as useMemo4 } from "react";
|
|
5153
5154
|
|
|
@@ -5771,6 +5772,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5771
5772
|
context: renderingContext
|
|
5772
5773
|
});
|
|
5773
5774
|
const renderParam = renderParams;
|
|
5775
|
+
const renderParamRef = useRef12(renderParam);
|
|
5774
5776
|
const onClick = useCallback7((event) => {
|
|
5775
5777
|
const colIndex = column.computedVisibleIndex;
|
|
5776
5778
|
getState().cellClick({
|
|
@@ -5854,6 +5856,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5854
5856
|
})
|
|
5855
5857
|
});
|
|
5856
5858
|
}
|
|
5859
|
+
renderParamRef.current = renderParam;
|
|
5857
5860
|
if (column.render) {
|
|
5858
5861
|
return /* @__PURE__ */ createElement18(RenderCellHookComponent, {
|
|
5859
5862
|
render: column.render,
|
|
@@ -5920,7 +5923,10 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5920
5923
|
}), colClassName, rowComputedClassName),
|
|
5921
5924
|
renderChildren
|
|
5922
5925
|
};
|
|
5923
|
-
|
|
5926
|
+
const ContextProvider = InfiniteTableColumnCellContext.Provider;
|
|
5927
|
+
return /* @__PURE__ */ createElement18(ContextProvider, {
|
|
5928
|
+
value: renderParamRef.current
|
|
5929
|
+
}, /* @__PURE__ */ createElement18(InfiniteTableCell, __spreadValues({}, cellProps)));
|
|
5924
5930
|
}
|
|
5925
5931
|
var InfiniteTableColumnCell = memo8(InfiniteTableColumnCellFn);
|
|
5926
5932
|
function useInfiniteColumnCell() {
|
|
@@ -6486,7 +6492,7 @@ var computeGroupResize = (params) => {
|
|
|
6486
6492
|
};
|
|
6487
6493
|
|
|
6488
6494
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
|
|
6489
|
-
import { useRef as
|
|
6495
|
+
import { useRef as useRef13, useState as useState9 } from "react";
|
|
6490
6496
|
import {
|
|
6491
6497
|
createElement as createElement23,
|
|
6492
6498
|
memo as memo9
|
|
@@ -6590,9 +6596,9 @@ var ResizeHandleRecipeCls = (0, import_createRuntimeFn6.createRuntimeFn)({ defau
|
|
|
6590
6596
|
var { rootClassName: rootClassName8 } = internalProps;
|
|
6591
6597
|
var InfiniteTableHeaderCellResizeHandleCls = `${rootClassName8}HeaderCell_ResizeHandle`;
|
|
6592
6598
|
function ResizeHandleFn(props) {
|
|
6593
|
-
const domRef =
|
|
6599
|
+
const domRef = useRef13(null);
|
|
6594
6600
|
const [constrained, setConstrained] = useState9(false);
|
|
6595
|
-
const constrainedRef =
|
|
6601
|
+
const constrainedRef = useRef13(constrained);
|
|
6596
6602
|
constrainedRef.current = constrained;
|
|
6597
6603
|
const col = props.columns[props.columnIndex];
|
|
6598
6604
|
if (!col) {
|
|
@@ -6838,7 +6844,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6838
6844
|
}
|
|
6839
6845
|
return /* @__PURE__ */ createElement25(Fragment3, null, align !== "end" ? renderParam.renderBag.selectionCheckBox : null, align === "end" ? renderParam.renderBag.sortIcon : null, renderParam.renderBag.header, align !== "end" ? renderParam.renderBag.sortIcon : null, align === "end" ? renderParam.renderBag.selectionCheckBox : null);
|
|
6840
6846
|
};
|
|
6841
|
-
const domRef =
|
|
6847
|
+
const domRef = useRef14(null);
|
|
6842
6848
|
const {
|
|
6843
6849
|
componentActions: dataSourceActions,
|
|
6844
6850
|
getState: getDataSourceState,
|
|
@@ -7101,7 +7107,7 @@ import {
|
|
|
7101
7107
|
createElement as createElement29,
|
|
7102
7108
|
memo as memo11
|
|
7103
7109
|
} from "react";
|
|
7104
|
-
import { useCallback as useCallback11, useEffect as useEffect14, useRef as
|
|
7110
|
+
import { useCallback as useCallback11, useEffect as useEffect14, useRef as useRef16 } from "react";
|
|
7105
7111
|
|
|
7106
7112
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
7107
7113
|
import {
|
|
@@ -7115,7 +7121,7 @@ import {
|
|
|
7115
7121
|
import { useCallback as useCallback10 } from "react";
|
|
7116
7122
|
|
|
7117
7123
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/GroupResizeHandle.tsx
|
|
7118
|
-
import { useRef as
|
|
7124
|
+
import { useRef as useRef15, useState as useState10 } from "react";
|
|
7119
7125
|
import {
|
|
7120
7126
|
createElement as createElement26,
|
|
7121
7127
|
memo as memo10
|
|
@@ -7123,9 +7129,9 @@ import {
|
|
|
7123
7129
|
var { rootClassName: rootClassName10 } = internalProps;
|
|
7124
7130
|
var InfiniteTableHeaderCellResizeHandleCls2 = `${rootClassName10}HeaderCell_ResizeHandle`;
|
|
7125
7131
|
function GroupResizeHandleFn(props) {
|
|
7126
|
-
const domRef =
|
|
7132
|
+
const domRef = useRef15(null);
|
|
7127
7133
|
const [constrained, setConstrained] = useState10(false);
|
|
7128
|
-
const constrainedRef =
|
|
7134
|
+
const constrainedRef = useRef15(constrained);
|
|
7129
7135
|
constrainedRef.current = constrained;
|
|
7130
7136
|
const col = props.groupColumns[0];
|
|
7131
7137
|
if (!col) {
|
|
@@ -7324,7 +7330,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
7324
7330
|
const removeOnScroll = brain.onScroll(onScroll);
|
|
7325
7331
|
return removeOnScroll;
|
|
7326
7332
|
}, [brain]);
|
|
7327
|
-
const domRef =
|
|
7333
|
+
const domRef = useRef16(null);
|
|
7328
7334
|
const headerCls = HeaderClsRecipe({
|
|
7329
7335
|
overflow: false
|
|
7330
7336
|
});
|
|
@@ -7498,7 +7504,7 @@ import {
|
|
|
7498
7504
|
createElement as createElement31,
|
|
7499
7505
|
forwardRef as forwardRef4,
|
|
7500
7506
|
useCallback as useCallback13,
|
|
7501
|
-
useRef as
|
|
7507
|
+
useRef as useRef17
|
|
7502
7508
|
} from "react";
|
|
7503
7509
|
import { useEffect as useEffect15 } from "react";
|
|
7504
7510
|
|
|
@@ -7537,7 +7543,7 @@ var enforceStyle = (node, style) => {
|
|
|
7537
7543
|
};
|
|
7538
7544
|
var InfiniteTableLicenseFooter = forwardRef4(function InfiniteTableLicenseFooter2(props, ref) {
|
|
7539
7545
|
const { rootClassName: rootClassName13 } = useInternalProps();
|
|
7540
|
-
const domRef =
|
|
7546
|
+
const domRef = useRef17(null);
|
|
7541
7547
|
const domCallback = useCallback13((node) => {
|
|
7542
7548
|
domRef.current = node;
|
|
7543
7549
|
if (!ref) {
|
|
@@ -8377,15 +8383,15 @@ var GroupRowsState = class extends BooleanDeepCollectionState {
|
|
|
8377
8383
|
};
|
|
8378
8384
|
|
|
8379
8385
|
// src/components/DataSource/privateHooks/useLoadData.ts
|
|
8380
|
-
import { useEffect as useEffect17, useMemo as useMemo7, useRef as
|
|
8386
|
+
import { useEffect as useEffect17, useMemo as useMemo7, useRef as useRef19, useState as useState11 } from "react";
|
|
8381
8387
|
|
|
8382
8388
|
// src/components/hooks/useEffectWithChanges.ts
|
|
8383
|
-
import { useEffect as useEffect16, useRef as
|
|
8389
|
+
import { useEffect as useEffect16, useRef as useRef18 } from "react";
|
|
8384
8390
|
function useEffectWithChanges(fn, deps) {
|
|
8385
|
-
const prevRef =
|
|
8386
|
-
const oldValuesRef =
|
|
8391
|
+
const prevRef = useRef18({});
|
|
8392
|
+
const oldValuesRef = useRef18({});
|
|
8387
8393
|
const oldValues = oldValuesRef.current;
|
|
8388
|
-
const changesRef =
|
|
8394
|
+
const changesRef = useRef18({});
|
|
8389
8395
|
const changes = changesRef.current;
|
|
8390
8396
|
const useEffectDeps = [];
|
|
8391
8397
|
for (const k in deps) {
|
|
@@ -8668,7 +8674,7 @@ function useLoadData() {
|
|
|
8668
8674
|
vertical: false,
|
|
8669
8675
|
horizontal: false
|
|
8670
8676
|
});
|
|
8671
|
-
const scrollbarsRef =
|
|
8677
|
+
const scrollbarsRef = useRef19(scrollbars);
|
|
8672
8678
|
useEffect17(() => {
|
|
8673
8679
|
notifyScrollbarsChange.onChange((scrollbars2) => {
|
|
8674
8680
|
if (!scrollbars2) {
|
|
@@ -8725,7 +8731,7 @@ function useLoadData() {
|
|
|
8725
8731
|
filterValue,
|
|
8726
8732
|
cursorId: livePagination ? stateCursorId : null
|
|
8727
8733
|
};
|
|
8728
|
-
const initialRef =
|
|
8734
|
+
const initialRef = useRef19(true);
|
|
8729
8735
|
useLazyLoadRange();
|
|
8730
8736
|
useEffectWithChanges(() => {
|
|
8731
8737
|
const componentState2 = getComponentState();
|
|
@@ -8769,7 +8775,7 @@ function useLazyLoadRange() {
|
|
|
8769
8775
|
groupRowsState,
|
|
8770
8776
|
scrollStopDelayUpdatedByTable
|
|
8771
8777
|
} = componentState;
|
|
8772
|
-
const latestRenderRangeRef =
|
|
8778
|
+
const latestRenderRangeRef = useRef19(null);
|
|
8773
8779
|
const loadRange = (renderRange, cache = getComponentState().lazyLoadCacheOfLoadedBatches) => {
|
|
8774
8780
|
const componentState2 = getComponentState();
|
|
8775
8781
|
renderRange = renderRange || latestRenderRangeRef.current;
|
|
@@ -10589,7 +10595,7 @@ function getImperativeApi(param) {
|
|
|
10589
10595
|
// src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
|
|
10590
10596
|
import {
|
|
10591
10597
|
useEffect as useEffect18,
|
|
10592
|
-
useRef as
|
|
10598
|
+
useRef as useRef20,
|
|
10593
10599
|
useState as useState12
|
|
10594
10600
|
} from "react";
|
|
10595
10601
|
var OFFSET = 10;
|
|
@@ -10660,7 +10666,7 @@ function useAutoSizeColumns() {
|
|
|
10660
10666
|
const [refreshId, setRefreshId] = useState12(0);
|
|
10661
10667
|
const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
|
|
10662
10668
|
const getTheKey = useLatest(theKey);
|
|
10663
|
-
const lastExecutedIdentifierRef =
|
|
10669
|
+
const lastExecutedIdentifierRef = useRef20(null);
|
|
10664
10670
|
useEffect18(() => {
|
|
10665
10671
|
const key = getTheKey();
|
|
10666
10672
|
if (key == null) {
|
|
@@ -10719,7 +10725,7 @@ function useAutoSizeColumns() {
|
|
|
10719
10725
|
}
|
|
10720
10726
|
|
|
10721
10727
|
// src/components/InfiniteTable/hooks/useCellRendering.tsx
|
|
10722
|
-
import { useCallback as useCallback14, useEffect as useEffect19, useRef as
|
|
10728
|
+
import { useCallback as useCallback14, useEffect as useEffect19, useRef as useRef21 } from "react";
|
|
10723
10729
|
import {
|
|
10724
10730
|
createElement as createElement34
|
|
10725
10731
|
} from "react";
|
|
@@ -10795,7 +10801,7 @@ function useCellRendering(param) {
|
|
|
10795
10801
|
bodySize,
|
|
10796
10802
|
rowspan
|
|
10797
10803
|
});
|
|
10798
|
-
const scrollTopMaxRef =
|
|
10804
|
+
const scrollTopMaxRef = useRef21(0);
|
|
10799
10805
|
useEffect19(() => {
|
|
10800
10806
|
return brain.onRenderCountChange(() => {
|
|
10801
10807
|
scrollTopMaxRef.current = brain.scrollTopMax;
|
|
@@ -11135,10 +11141,10 @@ function useColumnSizeFn(columns) {
|
|
|
11135
11141
|
import { useEffect as useEffect23, useMemo as useMemo9 } from "react";
|
|
11136
11142
|
|
|
11137
11143
|
// src/components/InfiniteTable/hooks/useEffectWithRaf.ts
|
|
11138
|
-
import { useEffect as useEffect22, useRef as
|
|
11144
|
+
import { useEffect as useEffect22, useRef as useRef22 } from "react";
|
|
11139
11145
|
function useEffectWithRaf(fn, deps) {
|
|
11140
|
-
const rafId =
|
|
11141
|
-
const removeFnRaf =
|
|
11146
|
+
const rafId = useRef22(0);
|
|
11147
|
+
const removeFnRaf = useRef22();
|
|
11142
11148
|
useEffect22(() => {
|
|
11143
11149
|
rafId.current = requestAnimationFrame(() => {
|
|
11144
11150
|
removeFnRaf.current = fn();
|
|
@@ -12523,7 +12529,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
12523
12529
|
const valid = useMemo11(() => {
|
|
12524
12530
|
let valid2 = isValidLicense(licenseKey, {
|
|
12525
12531
|
publishedAt: 1624970570587,
|
|
12526
|
-
version: "0.4.
|
|
12532
|
+
version: "0.4.13"
|
|
12527
12533
|
});
|
|
12528
12534
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
12529
12535
|
return true;
|
|
@@ -12534,11 +12540,11 @@ var useLicense = (licenseKey = "") => {
|
|
|
12534
12540
|
};
|
|
12535
12541
|
|
|
12536
12542
|
// src/components/InfiniteTable/hooks/useScrollToActiveCell.ts
|
|
12537
|
-
import { useRef as
|
|
12543
|
+
import { useRef as useRef23, useEffect as useEffect27 } from "react";
|
|
12538
12544
|
var RETRIES = 10;
|
|
12539
12545
|
function useScrollToActiveCell(activeCellIndex, dataCount, imperativeApi) {
|
|
12540
|
-
const didScrollRef =
|
|
12541
|
-
const rafId =
|
|
12546
|
+
const didScrollRef = useRef23(false);
|
|
12547
|
+
const rafId = useRef23(null);
|
|
12542
12548
|
useEffect27(() => {
|
|
12543
12549
|
if (activeCellIndex != null) {
|
|
12544
12550
|
didScrollRef.current = false;
|
|
@@ -12568,11 +12574,11 @@ function useScrollToActiveCell(activeCellIndex, dataCount, imperativeApi) {
|
|
|
12568
12574
|
}
|
|
12569
12575
|
|
|
12570
12576
|
// src/components/InfiniteTable/hooks/useScrollToActiveRow.ts
|
|
12571
|
-
import { useRef as
|
|
12577
|
+
import { useRef as useRef24, useEffect as useEffect28 } from "react";
|
|
12572
12578
|
var RETRIES2 = 10;
|
|
12573
12579
|
function useScrollToActiveRow(activeRowIndex, dataCount, imperativeApi) {
|
|
12574
|
-
const didScrollRef =
|
|
12575
|
-
const rafId =
|
|
12580
|
+
const didScrollRef = useRef24(false);
|
|
12581
|
+
const rafId = useRef24(null);
|
|
12576
12582
|
useEffect28(() => {
|
|
12577
12583
|
if (activeRowIndex != null) {
|
|
12578
12584
|
didScrollRef.current = false;
|
package/index.js
CHANGED
|
@@ -5716,6 +5716,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5716
5716
|
context: renderingContext
|
|
5717
5717
|
});
|
|
5718
5718
|
const renderParam = renderParams;
|
|
5719
|
+
const renderParamRef = React21.useRef(renderParam);
|
|
5719
5720
|
const onClick = (0, import_react19.useCallback)((event) => {
|
|
5720
5721
|
const colIndex = column.computedVisibleIndex;
|
|
5721
5722
|
getState().cellClick({
|
|
@@ -5799,6 +5800,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5799
5800
|
})
|
|
5800
5801
|
});
|
|
5801
5802
|
}
|
|
5803
|
+
renderParamRef.current = renderParam;
|
|
5802
5804
|
if (column.render) {
|
|
5803
5805
|
return /* @__PURE__ */ React21.createElement(RenderCellHookComponent, {
|
|
5804
5806
|
render: column.render,
|
|
@@ -5865,7 +5867,10 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5865
5867
|
}), colClassName, rowComputedClassName),
|
|
5866
5868
|
renderChildren
|
|
5867
5869
|
};
|
|
5868
|
-
|
|
5870
|
+
const ContextProvider = InfiniteTableColumnCellContext.Provider;
|
|
5871
|
+
return /* @__PURE__ */ React21.createElement(ContextProvider, {
|
|
5872
|
+
value: renderParamRef.current
|
|
5873
|
+
}, /* @__PURE__ */ React21.createElement(InfiniteTableCell, __spreadValues({}, cellProps)));
|
|
5869
5874
|
}
|
|
5870
5875
|
var InfiniteTableColumnCell = React21.memo(InfiniteTableColumnCellFn);
|
|
5871
5876
|
function useInfiniteColumnCell() {
|
|
@@ -12426,7 +12431,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
12426
12431
|
const valid = (0, import_react44.useMemo)(() => {
|
|
12427
12432
|
let valid2 = isValidLicense(licenseKey, {
|
|
12428
12433
|
publishedAt: 1624970570587,
|
|
12429
|
-
version: "0.4.
|
|
12434
|
+
version: "0.4.13"
|
|
12430
12435
|
});
|
|
12431
12436
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
12432
12437
|
return true;
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"react-datagrid",
|
|
11
11
|
"react-infinite"
|
|
12
12
|
],
|
|
13
|
-
"version": "0.4.
|
|
13
|
+
"version": "0.4.13",
|
|
14
14
|
"main": "index.js",
|
|
15
15
|
"module": "index.esm.js",
|
|
16
16
|
"typings": "index.d.ts",
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "Commercial & Open Source",
|
|
25
25
|
"//": "will be updated at build time",
|
|
26
|
-
"publishedAt":
|
|
26
|
+
"publishedAt": 1662407924032
|
|
27
27
|
}
|