@infinite-table/infinite-react 0.2.4 → 0.2.8
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.d.ts +19 -10
- package/index.esm.js +154 -69
- package/index.js +138 -53
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -611,10 +611,9 @@ declare module "components/InfiniteTable/types/InfiniteTableColumn" {
|
|
|
611
611
|
groupIcon: Renderable;
|
|
612
612
|
};
|
|
613
613
|
export type InfiniteTableColumnRenderValueParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>;
|
|
614
|
-
export type
|
|
614
|
+
export type InfiniteTableColumnRowspanParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
|
|
615
615
|
rowInfo: InfiniteTableRowInfo<DATA_TYPE>;
|
|
616
616
|
data: DATA_TYPE | Partial<DATA_TYPE> | null;
|
|
617
|
-
groupRowInfo: InfiniteTableRowInfo<DATA_TYPE> | null;
|
|
618
617
|
dataArray: InfiniteTableRowInfo<DATA_TYPE>[];
|
|
619
618
|
rowIndex: number;
|
|
620
619
|
column: COL_TYPE;
|
|
@@ -668,14 +667,16 @@ declare module "components/InfiniteTable/types/InfiniteTableColumn" {
|
|
|
668
667
|
rowInfo: InfiniteTableRowInfoGroup<T>;
|
|
669
668
|
};
|
|
670
669
|
export type InfiniteTableColumnValueGetter<T, VALUE_GETTER_TYPE = Renderable> = (params: InfiniteTableColumnValueGetterParams<T>) => VALUE_GETTER_TYPE;
|
|
671
|
-
export type InfiniteTableColumnRowspanFn<T> = (params:
|
|
670
|
+
export type InfiniteTableColumnRowspanFn<T> = (params: InfiniteTableColumnRowspanParam<T>) => number;
|
|
672
671
|
export type InfiniteTableColumnComparer<T> = (a: T, b: T) => number;
|
|
673
672
|
export type InfiniteTableBaseColumn<T> = {
|
|
674
673
|
sortable?: boolean;
|
|
675
674
|
draggable?: boolean;
|
|
676
675
|
resizable?: boolean;
|
|
677
676
|
comparer?: InfiniteTableColumnComparer<T>;
|
|
678
|
-
|
|
677
|
+
defaultHiddenWhenGroupedBy?: '*' | keyof T | {
|
|
678
|
+
[k in keyof Partial<T>]: true;
|
|
679
|
+
};
|
|
679
680
|
align?: InfiniteTableColumnAlign;
|
|
680
681
|
verticalAlign?: InfiniteTableColumnVerticalAlign;
|
|
681
682
|
columnGroup?: string;
|
|
@@ -837,6 +838,7 @@ declare module "utils/groupAndPivot/index" {
|
|
|
837
838
|
collapsedGroupsCount?: number;
|
|
838
839
|
groupNesting?: number;
|
|
839
840
|
groupKeys?: any[];
|
|
841
|
+
flatRowInfoList?: (InfiniteTableRowInfo<T> | InfiniteTableEnhancedGroupInfo<T>)[];
|
|
840
842
|
parents?: InfiniteTableEnhancedGroupInfo<T>[];
|
|
841
843
|
indexInParentGroups?: number[];
|
|
842
844
|
indexInGroup: number;
|
|
@@ -850,6 +852,7 @@ declare module "utils/groupAndPivot/index" {
|
|
|
850
852
|
export type InfiniteTableEnhancedGroupInfo<T> = InfiniteTableRowInfo<T> & {
|
|
851
853
|
data: Partial<T> | null;
|
|
852
854
|
groupData: T[];
|
|
855
|
+
flatRowInfoList: (InfiniteTableRowInfo<T> | InfiniteTableEnhancedGroupInfo<T>)[];
|
|
853
856
|
value: any;
|
|
854
857
|
isGroupRow: true;
|
|
855
858
|
collapsedChildrenCount: number;
|
|
@@ -1136,6 +1139,7 @@ declare module "components/InfiniteTable/types/InfiniteTableProps" {
|
|
|
1136
1139
|
defaultWidth?: number;
|
|
1137
1140
|
defaultFlex?: number;
|
|
1138
1141
|
defaultPinned?: InfiniteTableColumnPinnedValues;
|
|
1142
|
+
defaultHiddenWhenGroupedBy?: InfiniteTableColumn<T>['defaultHiddenWhenGroupedBy'];
|
|
1139
1143
|
header?: InfiniteTableColumn<T>['header'];
|
|
1140
1144
|
comparer?: InfiniteTableColumn<T>['comparer'];
|
|
1141
1145
|
draggable?: InfiniteTableColumn<T>['draggable'];
|
|
@@ -1418,6 +1422,7 @@ declare module "components/InfiniteTable/types/InfiniteTableState" {
|
|
|
1418
1422
|
computedColumnGroups: InfiniteTablePropColumnGroupsMap;
|
|
1419
1423
|
rowHeightCSSVar: string;
|
|
1420
1424
|
headerHeightCSSVar: string;
|
|
1425
|
+
controlledColumnVisibility: boolean;
|
|
1421
1426
|
}
|
|
1422
1427
|
export type InfiniteTableActions<T> = ComponentStateActions<InfiniteTableState<T>>;
|
|
1423
1428
|
export interface InfiniteTableState<T> extends InfiniteTableMappedState<T>, InfiniteTableDerivedState<T>, InfiniteTableSetupState<T> {
|
|
@@ -1444,9 +1449,11 @@ declare module "components/InfiniteTable/types/InfiniteTableAction" {
|
|
|
1444
1449
|
};
|
|
1445
1450
|
}
|
|
1446
1451
|
declare module "components/InfiniteTable/types/InfiniteTableComputedValues" {
|
|
1452
|
+
import type { VirtualBrainOptions } from "components/VirtualBrain/index";
|
|
1447
1453
|
import type { InfiniteTableComputedColumn } from "components/InfiniteTable/types/InfiniteTableColumn";
|
|
1448
1454
|
import type { InfiniteTablePropColumnOrderNormalized, InfiniteTablePropColumnVisibility } from "components/InfiniteTable/types/InfiniteTableProps";
|
|
1449
1455
|
export interface InfiniteTableComputedValues<T> {
|
|
1456
|
+
rowSpan?: VirtualBrainOptions['itemSpan'];
|
|
1450
1457
|
computedPinnedStartOverflow: boolean;
|
|
1451
1458
|
computedPinnedEndOverflow: boolean;
|
|
1452
1459
|
computedPinnedStartColumns: InfiniteTableComputedColumn<T>[];
|
|
@@ -1485,11 +1492,11 @@ declare module "components/InfiniteTable/types/index" {
|
|
|
1485
1492
|
import type { InfiniteTableAction } from "components/InfiniteTable/types/InfiniteTableAction";
|
|
1486
1493
|
import type { InfiniteTableActionType } from "components/InfiniteTable/types/InfiniteTableActionType";
|
|
1487
1494
|
import type { InfiniteTableProps, InfiniteTableImperativeApi, InfiniteTablePropColumnOrder, InfiniteTablePropColumnVisibility, InfiniteTablePropColumnPinning, InfiniteTableColumnAggregator, InfiniteTableColumnGroup, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropColumnGroups, InfiniteTablePropRowStyle, InfiniteTableRowStyleFn, InfiniteTableRowClassNameFn, InfiniteTablePropRowClassName, InfiniteTablePropColumns, InfiniteTablePropColumnsMap, InfiniteTablePropComponents, InfiniteTableGroupColumnFunction, InfiniteTableGroupColumnGetterOptions, InfiniteTablePropColumnSizingMap, InfiniteTablePropColumnSizing, InfiniteTablePropColumnTypes, InfiniteTablePropColumnTypesMap, InfiniteTableColumnSizingOptions, Scrollbars, InfiniteTableGroupColumnBase, InfiniteTablePropGroupColumn } from "components/InfiniteTable/types/InfiniteTableProps";
|
|
1488
|
-
import type { InfiniteTableColumn, InfiniteTableColumnComparer, InfiniteTableComputedColumn, InfiniteTableColumnRenderParam, InfiniteTableColumnRenderValueParam } from "components/InfiniteTable/types/InfiniteTableColumn";
|
|
1495
|
+
import type { InfiniteTableColumn, InfiniteTableColumnComparer, InfiniteTableComputedColumn, InfiniteTableColumnRenderParam, InfiniteTableColumnRenderValueParam, InfiniteTableColumnRowspanParam } from "components/InfiniteTable/types/InfiniteTableColumn";
|
|
1489
1496
|
import type { InfiniteTableComputedValues } from "components/InfiniteTable/types/InfiniteTableComputedValues";
|
|
1490
1497
|
import type { InfiniteTableContextValue } from "components/InfiniteTable/types/InfiniteTableContextValue";
|
|
1491
1498
|
import type { InfiniteTableRowInfo } from "utils/groupAndPivot/index";
|
|
1492
|
-
export type { Scrollbars, InfiniteTableColumnAggregator, InfiniteTableComputedValues, InfiniteTablePropColumns, InfiniteTablePropGroupColumn, InfiniteTablePropColumnsMap, InfiniteTableRowInfo, InfiniteTableGroupColumnFunction, InfiniteTableGroupColumnBase, InfiniteTablePropColumnOrder, InfiniteTablePropComponents, InfiniteTablePropColumnVisibility as InfiniteTablePropColumnVisibility, InfiniteTablePropColumnPinning, InfiniteTableColumnGroup, InfiniteTableColumn, InfiniteTableColumnComparer, InfiniteTableComputedColumn, InfiniteTableColumnRenderParam, InfiniteTableColumnRenderValueParam, InfiniteTableContextValue, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropColumnGroups, InfiniteTablePropColumnSizing, InfiniteTablePropColumnSizingMap, InfiniteTableColumnSizingOptions, InfiniteTableState, InfiniteTableAction, InfiniteTableProps, InfiniteTablePropColumnTypes, InfiniteTablePropColumnTypesMap, InfiniteTableImperativeApi, InfiniteTableActionType, InfiniteTablePropRowStyle, InfiniteTablePropRowClassName, InfiniteTableRowStyleFn, InfiniteTableRowClassNameFn, InfiniteTableGroupColumnGetterOptions, };
|
|
1499
|
+
export type { Scrollbars, InfiniteTableColumnAggregator, InfiniteTableComputedValues, InfiniteTableColumnRowspanParam, InfiniteTablePropColumns, InfiniteTablePropGroupColumn, InfiniteTablePropColumnsMap, InfiniteTableRowInfo, InfiniteTableGroupColumnFunction, InfiniteTableGroupColumnBase, InfiniteTablePropColumnOrder, InfiniteTablePropComponents, InfiniteTablePropColumnVisibility as InfiniteTablePropColumnVisibility, InfiniteTablePropColumnPinning, InfiniteTableColumnGroup, InfiniteTableColumn, InfiniteTableColumnComparer, InfiniteTableComputedColumn, InfiniteTableColumnRenderParam, InfiniteTableColumnRenderValueParam, InfiniteTableContextValue, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropColumnGroups, InfiniteTablePropColumnSizing, InfiniteTablePropColumnSizingMap, InfiniteTableColumnSizingOptions, InfiniteTableState, InfiniteTableAction, InfiniteTableProps, InfiniteTablePropColumnTypes, InfiniteTablePropColumnTypesMap, InfiniteTableImperativeApi, InfiniteTableActionType, InfiniteTablePropRowStyle, InfiniteTablePropRowClassName, InfiniteTableRowStyleFn, InfiniteTableRowClassNameFn, InfiniteTableGroupColumnGetterOptions, };
|
|
1493
1500
|
}
|
|
1494
1501
|
declare module "components/InfiniteTable/InfiniteTableContext" {
|
|
1495
1502
|
import { InfiniteTableContextValue } from "components/InfiniteTable/types/InfiniteTableContextValue";
|
|
@@ -1666,7 +1673,6 @@ declare module "components/InfiniteTable/utils/getComputedVisibleColumns" {
|
|
|
1666
1673
|
index: number;
|
|
1667
1674
|
};
|
|
1668
1675
|
};
|
|
1669
|
-
export const IS_GROUP_COLUMN_ID: (columnId: string) => boolean;
|
|
1670
1676
|
export type GetComputedVisibleColumnsResult<T> = {
|
|
1671
1677
|
computedRemainingSpace: number;
|
|
1672
1678
|
computedPinnedStartColumnsWidth: number;
|
|
@@ -2529,7 +2535,7 @@ declare module "components/VirtualList/VirtualRowList" {
|
|
|
2529
2535
|
export const VirtualRowList: (props: VirtualRowListProps & HTMLProps<HTMLDivElement>) => JSX.Element;
|
|
2530
2536
|
}
|
|
2531
2537
|
declare module "components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowTypes" {
|
|
2532
|
-
import type { VirtualBrain } from "components/VirtualBrain/index";
|
|
2538
|
+
import type { VirtualBrain, VirtualBrainOptions } from "components/VirtualBrain/index";
|
|
2533
2539
|
import type { ScrollPosition } from "components/types/ScrollPosition";
|
|
2534
2540
|
import type { InfiniteTableComputedColumn, InfiniteTableRowInfo } from "components/InfiniteTable/types/index";
|
|
2535
2541
|
import { InfiniteTableToggleGroupRowFn } from "components/InfiniteTable/types/InfiniteTableColumn";
|
|
@@ -2544,6 +2550,7 @@ declare module "components/InfiniteTable/components/InfiniteTableRow/InfiniteTab
|
|
|
2544
2550
|
getData: () => InfiniteTableRowInfo<T>[];
|
|
2545
2551
|
toggleGroupRow: InfiniteTableToggleGroupRowFn;
|
|
2546
2552
|
repaintId?: number | string;
|
|
2553
|
+
rowSpan?: VirtualBrainOptions['itemSpan'];
|
|
2547
2554
|
virtualizeColumns: boolean;
|
|
2548
2555
|
showZebraRows?: boolean;
|
|
2549
2556
|
showHoverRows?: boolean;
|
|
@@ -2603,7 +2610,7 @@ declare module "components/InfiniteTable/components/InfiniteTableRow/InfiniteTab
|
|
|
2603
2610
|
export const TableRowUnvirtualized: typeof TableRowUnvirtualizedFn;
|
|
2604
2611
|
}
|
|
2605
2612
|
declare module "components/InfiniteTable/hooks/useUnpinnedRendering" {
|
|
2606
|
-
import type { VirtualBrain } from "components/VirtualBrain/index";
|
|
2613
|
+
import type { VirtualBrain, VirtualBrainOptions } from "components/VirtualBrain/index";
|
|
2607
2614
|
import type { Size } from "components/types/Size";
|
|
2608
2615
|
import type { InfiniteTableComputedColumn, InfiniteTableRowInfo } from "components/InfiniteTable/types/index";
|
|
2609
2616
|
import { InfiniteTableState } from "components/InfiniteTable/types/InfiniteTableState";
|
|
@@ -2625,6 +2632,7 @@ declare module "components/InfiniteTable/hooks/useUnpinnedRendering" {
|
|
|
2625
2632
|
computedUnpinnedColumnsWidth: number;
|
|
2626
2633
|
computedPinnedStartWidth: number;
|
|
2627
2634
|
computedPinnedEndWidth: number;
|
|
2635
|
+
rowSpan?: VirtualBrainOptions['itemSpan'];
|
|
2628
2636
|
getState: () => InfiniteTableState<T>;
|
|
2629
2637
|
};
|
|
2630
2638
|
export function useUnpinnedRendering<T>(params: UnpinnedRenderingParams<T>): JSX.Element | null;
|
|
@@ -2672,7 +2680,7 @@ declare module "components/VirtualList/RowListWithExternalScrolling" {
|
|
|
2672
2680
|
export const RowListWithExternalScrolling: (props: RowListWithExternalScrollingListProps) => JSX.Element;
|
|
2673
2681
|
}
|
|
2674
2682
|
declare module "components/InfiniteTable/hooks/usePinnedRendering" {
|
|
2675
|
-
import { VirtualBrain } from "components/VirtualBrain/index";
|
|
2683
|
+
import { VirtualBrain, VirtualBrainOptions } from "components/VirtualBrain/index";
|
|
2676
2684
|
import type { InfiniteTableComputedColumn, InfiniteTableRowInfo, Scrollbars } from "components/InfiniteTable/types/index";
|
|
2677
2685
|
import type { Size } from "components/types/Size";
|
|
2678
2686
|
import type { RenderRow } from "components/VirtualList/types";
|
|
@@ -2698,6 +2706,7 @@ declare module "components/InfiniteTable/hooks/usePinnedRendering" {
|
|
|
2698
2706
|
toggleGroupRow: InfiniteTableToggleGroupRowFn;
|
|
2699
2707
|
computedPinnedStartColumnsWidth: number;
|
|
2700
2708
|
computedPinnedStartColumns: InfiniteTableComputedColumn<T>[];
|
|
2709
|
+
rowSpan?: VirtualBrainOptions['itemSpan'];
|
|
2701
2710
|
};
|
|
2702
2711
|
export function usePinnedRenderingForSide<T>(side: 'start' | 'end', params: UsePinnedParams<T>): {
|
|
2703
2712
|
renderRowPinned: RenderRow;
|
package/index.esm.js
CHANGED
|
@@ -856,6 +856,7 @@ var mapPropsToState = (params) => {
|
|
|
856
856
|
});
|
|
857
857
|
const computedColumns = state.columnsWhenGrouping || state.columnsWhenInlineGroupRenderStrategy || state.columns;
|
|
858
858
|
return {
|
|
859
|
+
controlledColumnVisibility: !!props.columnVisibility,
|
|
859
860
|
groupRenderStrategy,
|
|
860
861
|
groupBy,
|
|
861
862
|
computedColumns,
|
|
@@ -1389,6 +1390,7 @@ var getComputedVisibleColumns = ({
|
|
|
1389
1390
|
const result2 = __spreadProps(__spreadValues({
|
|
1390
1391
|
align: colType.align,
|
|
1391
1392
|
verticalAlign: colType.verticalAlign,
|
|
1393
|
+
defaultHiddenWhenGroupedBy: colType.defaultHiddenWhenGroupedBy,
|
|
1392
1394
|
valueGetter: colType.valueGetter,
|
|
1393
1395
|
renderValue: colType.renderValue,
|
|
1394
1396
|
render: colType.render
|
|
@@ -1647,7 +1649,7 @@ var useComputedVisibleColumns = ({
|
|
|
1647
1649
|
var sortAscending = (a, b) => a - b;
|
|
1648
1650
|
|
|
1649
1651
|
// src/components/InfiniteTable/hooks/useComputed.ts
|
|
1650
|
-
import { useCallback as useCallback5, useEffect as useEffect10, useState as useState5 } from "react";
|
|
1652
|
+
import { useCallback as useCallback5, useEffect as useEffect10, useMemo as useMemo6, useState as useState5 } from "react";
|
|
1651
1653
|
|
|
1652
1654
|
// src/components/hooks/useComponentState.tsx
|
|
1653
1655
|
import {
|
|
@@ -2855,6 +2857,7 @@ function getEnhancedGroupData(options, deepMapValue) {
|
|
|
2855
2857
|
id: `${groupKeys}`,
|
|
2856
2858
|
collapsed,
|
|
2857
2859
|
parents,
|
|
2860
|
+
flatRowInfoList: [],
|
|
2858
2861
|
collapsedChildrenCount: 0,
|
|
2859
2862
|
collapsedGroupsCount: 0,
|
|
2860
2863
|
indexInParentGroups: options.indexInParentGroups,
|
|
@@ -2917,9 +2920,14 @@ function enhancedFlatten(param) {
|
|
|
2917
2920
|
}
|
|
2918
2921
|
if (collapsed) {
|
|
2919
2922
|
parents.forEach((parent) => {
|
|
2923
|
+
parent.flatRowInfoList.push(enhancedGroupData);
|
|
2920
2924
|
parent.collapsedChildrenCount += enhancedGroupData.groupCount;
|
|
2921
2925
|
parent.collapsedGroupsCount += 1;
|
|
2922
2926
|
});
|
|
2927
|
+
} else {
|
|
2928
|
+
parents.forEach((parent) => {
|
|
2929
|
+
parent.flatRowInfoList.push(enhancedGroupData);
|
|
2930
|
+
});
|
|
2923
2931
|
}
|
|
2924
2932
|
indexInParentGroups.push(indexInGroup);
|
|
2925
2933
|
parents.push(enhancedGroupData);
|
|
@@ -2928,7 +2936,7 @@ function enhancedFlatten(param) {
|
|
|
2928
2936
|
if (!pivot) {
|
|
2929
2937
|
const startIndex = result.length;
|
|
2930
2938
|
result.push(...items.map((item, index) => {
|
|
2931
|
-
|
|
2939
|
+
const rowInfo = {
|
|
2932
2940
|
id: item ? toPrimaryKey(item) : `${groupKeys}-${index}`,
|
|
2933
2941
|
data: item,
|
|
2934
2942
|
isGroupRow: false,
|
|
@@ -2942,6 +2950,10 @@ function enhancedFlatten(param) {
|
|
|
2942
2950
|
groupNesting,
|
|
2943
2951
|
groupCount: enhancedGroupData.groupCount
|
|
2944
2952
|
};
|
|
2953
|
+
parents.forEach((parent) => {
|
|
2954
|
+
parent.flatRowInfoList.push(rowInfo);
|
|
2955
|
+
});
|
|
2956
|
+
return rowInfo;
|
|
2945
2957
|
}));
|
|
2946
2958
|
}
|
|
2947
2959
|
} else {
|
|
@@ -3971,7 +3983,7 @@ function concludeReducer(params) {
|
|
|
3971
3983
|
state.groupDeepMap = void 0;
|
|
3972
3984
|
state.pivotColumns = void 0;
|
|
3973
3985
|
const arrayDifferentAfterSortStep = previousState.postSortDataArray != state.postSortDataArray;
|
|
3974
|
-
if (arrayDifferentAfterSortStep) {
|
|
3986
|
+
if (arrayDifferentAfterSortStep || groupsDepsChanged) {
|
|
3975
3987
|
rowInfoDataArray = dataArray.map((data, index) => toRowInfo(data, data ? toPrimaryKey(data) : index, index));
|
|
3976
3988
|
}
|
|
3977
3989
|
}
|
|
@@ -4082,7 +4094,7 @@ function useColumnsWhen() {
|
|
|
4082
4094
|
}, [pivotTotalColumnPosition]);
|
|
4083
4095
|
useColumnsWhenInlineGroupRenderStrategy(groupByMap);
|
|
4084
4096
|
const { toggleGroupRow } = useColumnsWhenGrouping();
|
|
4085
|
-
|
|
4097
|
+
useHideColumns(groupByMap);
|
|
4086
4098
|
return { toggleGroupRow };
|
|
4087
4099
|
}
|
|
4088
4100
|
function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
@@ -4204,9 +4216,10 @@ function useColumnsWhenGrouping() {
|
|
|
4204
4216
|
]);
|
|
4205
4217
|
return { toggleGroupRow };
|
|
4206
4218
|
}
|
|
4207
|
-
function
|
|
4219
|
+
function useHideColumns(groupByMap) {
|
|
4208
4220
|
const {
|
|
4209
4221
|
componentState: {
|
|
4222
|
+
dataArray,
|
|
4210
4223
|
groupBy,
|
|
4211
4224
|
groupRowsState,
|
|
4212
4225
|
originalLazyGroupDataChangeDetect
|
|
@@ -4217,18 +4230,49 @@ function useHideEmptyGroupColumns() {
|
|
|
4217
4230
|
getComponentState,
|
|
4218
4231
|
componentActions,
|
|
4219
4232
|
componentState: {
|
|
4220
|
-
|
|
4233
|
+
columnTypes,
|
|
4234
|
+
computedColumns,
|
|
4221
4235
|
hideEmptyGroupColumns,
|
|
4222
4236
|
groupRenderStrategy
|
|
4223
4237
|
}
|
|
4224
4238
|
} = useComponentState();
|
|
4239
|
+
const prevHideEmptyGroupColumns = usePrevious(hideEmptyGroupColumns);
|
|
4225
4240
|
useEffect9(() => {
|
|
4226
4241
|
if (groupRenderStrategy !== "multi-column") {
|
|
4227
4242
|
return;
|
|
4228
4243
|
}
|
|
4244
|
+
const currentState = getComponentState();
|
|
4245
|
+
const computedGroupColumns = new Map();
|
|
4246
|
+
computedColumns.forEach((column, colId) => {
|
|
4247
|
+
if (typeof column.groupByField !== "string") {
|
|
4248
|
+
return;
|
|
4249
|
+
}
|
|
4250
|
+
const { groupByField } = column;
|
|
4251
|
+
const field = groupByField;
|
|
4252
|
+
const groupInfoForColumn = groupByMap.get(field);
|
|
4253
|
+
if (!groupInfoForColumn) {
|
|
4254
|
+
return;
|
|
4255
|
+
}
|
|
4256
|
+
computedGroupColumns.set(colId, column);
|
|
4257
|
+
});
|
|
4258
|
+
if (!hideEmptyGroupColumns) {
|
|
4259
|
+
if (prevHideEmptyGroupColumns) {
|
|
4260
|
+
let updated2 = false;
|
|
4261
|
+
const columnVisibility2 = __spreadValues({}, currentState.columnVisibility);
|
|
4262
|
+
computedGroupColumns.forEach((_column, colId) => {
|
|
4263
|
+
if (columnVisibility2[colId] === false) {
|
|
4264
|
+
updated2 = true;
|
|
4265
|
+
delete columnVisibility2[colId];
|
|
4266
|
+
}
|
|
4267
|
+
});
|
|
4268
|
+
if (updated2) {
|
|
4269
|
+
componentActions.columnVisibility = columnVisibility2;
|
|
4270
|
+
}
|
|
4271
|
+
}
|
|
4272
|
+
return;
|
|
4273
|
+
}
|
|
4229
4274
|
const groupsLength = groupBy.length;
|
|
4230
4275
|
let expandedGroupsLevel = 0;
|
|
4231
|
-
const { dataArray } = getDataSourceState();
|
|
4232
4276
|
const len = dataArray.length;
|
|
4233
4277
|
for (let i = 0; i < len; i++) {
|
|
4234
4278
|
const data = dataArray[i];
|
|
@@ -4237,23 +4281,24 @@ function useHideEmptyGroupColumns() {
|
|
|
4237
4281
|
break;
|
|
4238
4282
|
}
|
|
4239
4283
|
}
|
|
4240
|
-
const currentState = getComponentState();
|
|
4241
|
-
const { computedColumns } = currentState;
|
|
4242
4284
|
let updated = false;
|
|
4243
4285
|
const columnVisibility = __spreadValues({}, currentState.columnVisibility);
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
const
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
return;
|
|
4250
|
-
}
|
|
4286
|
+
computedGroupColumns.forEach((column, colId) => {
|
|
4287
|
+
const { groupByField } = column;
|
|
4288
|
+
const field = groupByField;
|
|
4289
|
+
const groupInfoForColumn = groupByMap.get(field);
|
|
4290
|
+
const index = groupInfoForColumn.groupIndex;
|
|
4251
4291
|
const shouldBeHidden = index > expandedGroupsLevel && hideEmptyGroupColumns;
|
|
4252
|
-
updated = true;
|
|
4253
4292
|
if (shouldBeHidden) {
|
|
4254
|
-
columnVisibility[colId]
|
|
4293
|
+
if (columnVisibility[colId] !== false) {
|
|
4294
|
+
updated = true;
|
|
4295
|
+
columnVisibility[colId] = false;
|
|
4296
|
+
}
|
|
4255
4297
|
} else {
|
|
4256
|
-
|
|
4298
|
+
if (columnVisibility.hasOwnProperty(colId)) {
|
|
4299
|
+
updated = true;
|
|
4300
|
+
delete columnVisibility[colId];
|
|
4301
|
+
}
|
|
4257
4302
|
}
|
|
4258
4303
|
});
|
|
4259
4304
|
if (updated) {
|
|
@@ -4262,12 +4307,41 @@ function useHideEmptyGroupColumns() {
|
|
|
4262
4307
|
}, [
|
|
4263
4308
|
getDataSourceState,
|
|
4264
4309
|
groupRenderStrategy,
|
|
4265
|
-
generatedColumns,
|
|
4266
4310
|
originalLazyGroupDataChangeDetect,
|
|
4267
4311
|
groupBy,
|
|
4312
|
+
groupByMap,
|
|
4313
|
+
computedColumns,
|
|
4314
|
+
hideEmptyGroupColumns ? dataArray : null,
|
|
4268
4315
|
hideEmptyGroupColumns ? groupRowsState : null,
|
|
4269
4316
|
hideEmptyGroupColumns
|
|
4270
4317
|
]);
|
|
4318
|
+
useEffect9(() => {
|
|
4319
|
+
const isGrouped = groupBy.length > 0;
|
|
4320
|
+
const currentState = getComponentState();
|
|
4321
|
+
const { controlledColumnVisibility, columnVisibility } = currentState;
|
|
4322
|
+
if (controlledColumnVisibility) {
|
|
4323
|
+
return;
|
|
4324
|
+
}
|
|
4325
|
+
const newColumnVisibility = __spreadValues({}, columnVisibility);
|
|
4326
|
+
let updated = false;
|
|
4327
|
+
computedColumns.forEach((col, id) => {
|
|
4328
|
+
if (col.defaultHiddenWhenGroupedBy) {
|
|
4329
|
+
const nowHidden = columnVisibility[id] === false;
|
|
4330
|
+
const shouldBeHidden = col.defaultHiddenWhenGroupedBy === "*" && isGrouped || typeof col.defaultHiddenWhenGroupedBy === "string" && groupByMap.get(col.defaultHiddenWhenGroupedBy) || typeof col.defaultHiddenWhenGroupedBy === "object" && Object.keys(col.defaultHiddenWhenGroupedBy).reduce((acc, field) => acc || groupByMap.has(field), false);
|
|
4331
|
+
if (nowHidden !== shouldBeHidden) {
|
|
4332
|
+
updated = true;
|
|
4333
|
+
if (shouldBeHidden) {
|
|
4334
|
+
newColumnVisibility[id] = false;
|
|
4335
|
+
} else {
|
|
4336
|
+
delete newColumnVisibility[id];
|
|
4337
|
+
}
|
|
4338
|
+
}
|
|
4339
|
+
}
|
|
4340
|
+
});
|
|
4341
|
+
if (updated) {
|
|
4342
|
+
componentActions.columnVisibility = newColumnVisibility;
|
|
4343
|
+
}
|
|
4344
|
+
}, [computedColumns, columnTypes, groupBy, groupByMap]);
|
|
4271
4345
|
}
|
|
4272
4346
|
function getColumnsWhenGrouping(params) {
|
|
4273
4347
|
const {
|
|
@@ -4416,6 +4490,31 @@ function useComputed() {
|
|
|
4416
4490
|
columnSizing,
|
|
4417
4491
|
columnTypes
|
|
4418
4492
|
});
|
|
4493
|
+
const rowSpan = useMemo6(() => {
|
|
4494
|
+
const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
|
|
4495
|
+
return colsWithRowspan.length ? ({ itemIndex }) => {
|
|
4496
|
+
let maxSpan = 1;
|
|
4497
|
+
const dataArray = getDataSourceState().dataArray;
|
|
4498
|
+
const rowInfo = dataArray[itemIndex];
|
|
4499
|
+
const data = rowInfo.data;
|
|
4500
|
+
colsWithRowspan.forEach((column) => {
|
|
4501
|
+
if (!column.rowspan) {
|
|
4502
|
+
return;
|
|
4503
|
+
}
|
|
4504
|
+
const span = column.rowspan({
|
|
4505
|
+
column,
|
|
4506
|
+
data,
|
|
4507
|
+
dataArray,
|
|
4508
|
+
rowInfo,
|
|
4509
|
+
rowIndex: itemIndex
|
|
4510
|
+
});
|
|
4511
|
+
if (span > maxSpan) {
|
|
4512
|
+
maxSpan = span;
|
|
4513
|
+
}
|
|
4514
|
+
});
|
|
4515
|
+
return maxSpan;
|
|
4516
|
+
} : void 0;
|
|
4517
|
+
}, [computedVisibleColumns]);
|
|
4419
4518
|
const unpinnedColumnWidths = computedUnpinnedColumns.map((c) => c.computedWidth);
|
|
4420
4519
|
let sortedUnpinnedColumnWidths = [...unpinnedColumnWidths].sort(sortAscending);
|
|
4421
4520
|
let unpinnedColumnRenderCount = 0;
|
|
@@ -4442,6 +4541,7 @@ function useComputed() {
|
|
|
4442
4541
|
const computedPinnedStartOverflow = computedPinnedStartWidth ? computedPinnedStartColumnsWidth > computedPinnedStartWidth : false;
|
|
4443
4542
|
const computedPinnedEndOverflow = computedPinnedEndWidth ? computedPinnedEndColumnsWidth > computedPinnedEndWidth : false;
|
|
4444
4543
|
return {
|
|
4544
|
+
rowSpan,
|
|
4445
4545
|
toggleGroupRow,
|
|
4446
4546
|
computedPinnedStartOverflow,
|
|
4447
4547
|
computedPinnedEndOverflow,
|
|
@@ -4633,7 +4733,7 @@ var InfiniteTableCell = memo3(InfiniteTableCellFn);
|
|
|
4633
4733
|
var import_binary_search = __toModule(require_binary_search());
|
|
4634
4734
|
import {
|
|
4635
4735
|
useCallback as useCallback6,
|
|
4636
|
-
useMemo as
|
|
4736
|
+
useMemo as useMemo7,
|
|
4637
4737
|
useRef as useRef7,
|
|
4638
4738
|
useState as useState6
|
|
4639
4739
|
} from "react";
|
|
@@ -4680,8 +4780,8 @@ var useColumnPointerEvents = ({
|
|
|
4680
4780
|
const dragging = draggingDiff != null;
|
|
4681
4781
|
const { componentActions, computed } = useInfiniteTable();
|
|
4682
4782
|
const { computedColumnOrder } = computed;
|
|
4683
|
-
const column =
|
|
4684
|
-
const { columnIndex, columnWidth, columnsArray } =
|
|
4783
|
+
const column = useMemo7(() => columns.get(columnId), [columnId, columns]);
|
|
4784
|
+
const { columnIndex, columnWidth, columnsArray } = useMemo7(() => {
|
|
4685
4785
|
const columnsArray2 = Array.from(columns.values());
|
|
4686
4786
|
return {
|
|
4687
4787
|
columnsArray: columnsArray2,
|
|
@@ -5018,7 +5118,7 @@ function AvoidReactDiffFn(props) {
|
|
|
5018
5118
|
var AvoidReactDiff = memo4(AvoidReactDiffFn);
|
|
5019
5119
|
|
|
5020
5120
|
// src/components/RawList/useVirtualRenderer.ts
|
|
5021
|
-
import { useMemo as
|
|
5121
|
+
import { useMemo as useMemo8 } from "react";
|
|
5022
5122
|
|
|
5023
5123
|
// src/components/RawList/ReactVirtualRenderer.tsx
|
|
5024
5124
|
import {
|
|
@@ -5334,7 +5434,7 @@ function createRenderer(brain) {
|
|
|
5334
5434
|
function useVirtualRenderer({
|
|
5335
5435
|
brain
|
|
5336
5436
|
}) {
|
|
5337
|
-
return
|
|
5437
|
+
return useMemo8(() => {
|
|
5338
5438
|
return createRenderer(brain);
|
|
5339
5439
|
}, [brain]);
|
|
5340
5440
|
}
|
|
@@ -5426,7 +5526,7 @@ var InfiniteTableHeader = memo6(InfiniteTableHeaderFn);
|
|
|
5426
5526
|
import {
|
|
5427
5527
|
createElement as createElement17,
|
|
5428
5528
|
memo as memo7,
|
|
5429
|
-
useMemo as
|
|
5529
|
+
useMemo as useMemo9,
|
|
5430
5530
|
useRef as useRef10
|
|
5431
5531
|
} from "react";
|
|
5432
5532
|
|
|
@@ -5640,7 +5740,7 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
5640
5740
|
} = useInfiniteTable();
|
|
5641
5741
|
const domRef = useRef10(null);
|
|
5642
5742
|
const hasColumnGroups = computedColumnGroups.size > 0;
|
|
5643
|
-
const columnHeaderGroups =
|
|
5743
|
+
const columnHeaderGroups = useMemo9(() => {
|
|
5644
5744
|
return hasColumnGroups ? renderColumnHeaderGroups({
|
|
5645
5745
|
columnGroups: computedColumnGroups,
|
|
5646
5746
|
columnGroupsDepthsMap,
|
|
@@ -5877,7 +5977,7 @@ function SpacePlaceholderFn(props) {
|
|
|
5877
5977
|
var SpacePlaceholder = memo8(SpacePlaceholderFn);
|
|
5878
5978
|
|
|
5879
5979
|
// src/components/InfiniteTable/hooks/useListRendering.tsx
|
|
5880
|
-
import { useEffect as useEffect22, useMemo as
|
|
5980
|
+
import { useEffect as useEffect22, useMemo as useMemo12, useRef as useRef17 } from "react";
|
|
5881
5981
|
|
|
5882
5982
|
// src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx
|
|
5883
5983
|
import {
|
|
@@ -6109,7 +6209,6 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6109
6209
|
dataArray: getData(),
|
|
6110
6210
|
column,
|
|
6111
6211
|
rowInfo,
|
|
6112
|
-
groupRowInfo,
|
|
6113
6212
|
rowIndex,
|
|
6114
6213
|
data: rowInfo.data
|
|
6115
6214
|
});
|
|
@@ -6160,7 +6259,8 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
|
|
|
6160
6259
|
showHoverRows = false,
|
|
6161
6260
|
rowIndex,
|
|
6162
6261
|
domRef: domRefFromProps,
|
|
6163
|
-
rowInfo
|
|
6262
|
+
rowInfo,
|
|
6263
|
+
rowSpan
|
|
6164
6264
|
} = props;
|
|
6165
6265
|
const domRef = useRef13(null);
|
|
6166
6266
|
const rowDOMRef = useCallback10((node) => {
|
|
@@ -6180,7 +6280,7 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
|
|
|
6180
6280
|
if (rowStyle) {
|
|
6181
6281
|
style = typeof rowStyle === "function" ? __spreadValues(__spreadValues({}, style), rowStyle(rowPropsAndStyleArgs)) : __spreadValues(__spreadValues({}, style), rowStyle);
|
|
6182
6282
|
}
|
|
6183
|
-
if (inlineGroupRoot) {
|
|
6283
|
+
if (inlineGroupRoot || rowSpan) {
|
|
6184
6284
|
style = style || {};
|
|
6185
6285
|
style.zIndex = 2e6 - rowInfo.indexInAll;
|
|
6186
6286
|
}
|
|
@@ -6367,6 +6467,7 @@ function useUnpinnedRendering(params) {
|
|
|
6367
6467
|
computedPinnedStartWidth,
|
|
6368
6468
|
computedPinnedEndWidth,
|
|
6369
6469
|
computedUnpinnedColumns,
|
|
6470
|
+
rowSpan,
|
|
6370
6471
|
getState
|
|
6371
6472
|
} = params;
|
|
6372
6473
|
const { virtualizeColumns } = getState();
|
|
@@ -6380,6 +6481,7 @@ function useUnpinnedRendering(params) {
|
|
|
6380
6481
|
showZebraRows,
|
|
6381
6482
|
showHoverRows,
|
|
6382
6483
|
getData,
|
|
6484
|
+
rowSpan,
|
|
6383
6485
|
toggleGroupRow,
|
|
6384
6486
|
virtualizeColumns: shouldVirtualizeColumns,
|
|
6385
6487
|
brain: null,
|
|
@@ -6396,6 +6498,7 @@ function useUnpinnedRendering(params) {
|
|
|
6396
6498
|
}, [
|
|
6397
6499
|
repaintId,
|
|
6398
6500
|
rowHeight,
|
|
6501
|
+
rowSpan,
|
|
6399
6502
|
computedUnpinnedColumns,
|
|
6400
6503
|
computedUnpinnedColumnsWidth,
|
|
6401
6504
|
shouldVirtualizeColumns,
|
|
@@ -6561,7 +6664,7 @@ var useOnContainerScroll = ({
|
|
|
6561
6664
|
// src/components/InfiniteTable/hooks/usePinnedRendering.tsx
|
|
6562
6665
|
import {
|
|
6563
6666
|
createElement as createElement28,
|
|
6564
|
-
useMemo as
|
|
6667
|
+
useMemo as useMemo10
|
|
6565
6668
|
} from "react";
|
|
6566
6669
|
import { useCallback as useCallback15 } from "react";
|
|
6567
6670
|
|
|
@@ -6667,7 +6770,7 @@ function PinnedRowsContainer(props) {
|
|
|
6667
6770
|
brain,
|
|
6668
6771
|
renderRow
|
|
6669
6772
|
} = props;
|
|
6670
|
-
const style =
|
|
6773
|
+
const style = useMemo10(() => {
|
|
6671
6774
|
const result = pinning === "end" ? {
|
|
6672
6775
|
width: rowWidth,
|
|
6673
6776
|
height,
|
|
@@ -6723,7 +6826,7 @@ function PinnedRowsContainer(props) {
|
|
|
6723
6826
|
return /* @__PURE__ */ createElement28(RowListWithExternalScrolling, __spreadValues({}, rowListProps));
|
|
6724
6827
|
}
|
|
6725
6828
|
function useRenderPinnedRow(params) {
|
|
6726
|
-
const { getData, getState, columnsWidth, columns, verticalBrain } = params;
|
|
6829
|
+
const { getData, getState, columnsWidth, columns, rowSpan, verticalBrain } = params;
|
|
6727
6830
|
const renderPinnedRow = useCallback15((rowParams) => {
|
|
6728
6831
|
const dataArray = getData();
|
|
6729
6832
|
const rowInfo = dataArray[rowParams.rowIndex];
|
|
@@ -6737,6 +6840,7 @@ function useRenderPinnedRow(params) {
|
|
|
6737
6840
|
virtualizeColumns: false,
|
|
6738
6841
|
verticalBrain,
|
|
6739
6842
|
brain: null,
|
|
6843
|
+
rowSpan,
|
|
6740
6844
|
rowWidth: columnsWidth,
|
|
6741
6845
|
columns
|
|
6742
6846
|
}, rowParams);
|
|
@@ -6761,6 +6865,7 @@ function usePinnedRenderingForSide(side, params) {
|
|
|
6761
6865
|
computedPinnedStartOverflow,
|
|
6762
6866
|
pinnedStartScrollListener,
|
|
6763
6867
|
pinnedEndScrollListener,
|
|
6868
|
+
rowSpan,
|
|
6764
6869
|
repaintId,
|
|
6765
6870
|
toggleGroupRow,
|
|
6766
6871
|
scrollbars: {
|
|
@@ -6779,6 +6884,7 @@ function usePinnedRenderingForSide(side, params) {
|
|
|
6779
6884
|
getData,
|
|
6780
6885
|
getState,
|
|
6781
6886
|
toggleGroupRow,
|
|
6887
|
+
rowSpan,
|
|
6782
6888
|
verticalBrain: verticalVirtualBrain,
|
|
6783
6889
|
columns,
|
|
6784
6890
|
columnsWidth
|
|
@@ -6841,9 +6947,9 @@ function usePinnedStartRendering(params) {
|
|
|
6841
6947
|
import { useEffect as useEffect21 } from "react";
|
|
6842
6948
|
|
|
6843
6949
|
// src/components/hooks/useOnce.ts
|
|
6844
|
-
import { useMemo as
|
|
6950
|
+
import { useMemo as useMemo11 } from "react";
|
|
6845
6951
|
function useOnce(fn) {
|
|
6846
|
-
const onceFn =
|
|
6952
|
+
const onceFn = useMemo11(() => {
|
|
6847
6953
|
return once(fn);
|
|
6848
6954
|
}, []);
|
|
6849
6955
|
return onceFn();
|
|
@@ -7142,7 +7248,7 @@ var VirtualBrain = class extends Logger {
|
|
|
7142
7248
|
this.computeCacheFor(lastSizeIndex);
|
|
7143
7249
|
_prev = lastOffset;
|
|
7144
7250
|
lastOffset = this.itemOffsetCache[lastSizeIndex];
|
|
7145
|
-
if (_prev === lastOffset) {
|
|
7251
|
+
if (_prev === lastOffset && _prev != 0) {
|
|
7146
7252
|
return count - 1;
|
|
7147
7253
|
}
|
|
7148
7254
|
}
|
|
@@ -7334,6 +7440,10 @@ function useYourBrain(param) {
|
|
|
7334
7440
|
}, []);
|
|
7335
7441
|
horizontalVirtualBrain.update(computedUnpinnedColumns.length, columnSize);
|
|
7336
7442
|
verticalVirtualBrain.update(dataArray.length, rowHeight, rowSpan);
|
|
7443
|
+
if (true) {
|
|
7444
|
+
globalThis.verticalVirtualBrain = verticalVirtualBrain;
|
|
7445
|
+
globalThis.horizontalVirtualBrain = horizontalVirtualBrain;
|
|
7446
|
+
}
|
|
7337
7447
|
useEffect21(() => {
|
|
7338
7448
|
verticalVirtualBrain.setAvailableSize({
|
|
7339
7449
|
height: bodySize.height,
|
|
@@ -7365,7 +7475,7 @@ function useListRendering(param) {
|
|
|
7365
7475
|
computedUnpinnedColumnsWidth,
|
|
7366
7476
|
computedPinnedStartOverflow,
|
|
7367
7477
|
computedPinnedEndOverflow,
|
|
7368
|
-
|
|
7478
|
+
rowSpan,
|
|
7369
7479
|
toggleGroupRow
|
|
7370
7480
|
} = computed;
|
|
7371
7481
|
const { componentState: dataSourceState, getState: getDataSourceState } = useDataSourceContextValue();
|
|
@@ -7384,32 +7494,6 @@ function useListRendering(param) {
|
|
|
7384
7494
|
repaintIdRef.current++;
|
|
7385
7495
|
}
|
|
7386
7496
|
const repaintId = repaintIdRef.current;
|
|
7387
|
-
const rowSpan = useMemo11(() => {
|
|
7388
|
-
const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
|
|
7389
|
-
return colsWithRowspan.length ? ({ itemIndex }) => {
|
|
7390
|
-
let maxSpan = 1;
|
|
7391
|
-
const dataArray2 = getData();
|
|
7392
|
-
const rowInfo = dataArray2[itemIndex];
|
|
7393
|
-
const data = rowInfo.data;
|
|
7394
|
-
colsWithRowspan.forEach((column) => {
|
|
7395
|
-
if (!column.rowspan) {
|
|
7396
|
-
return;
|
|
7397
|
-
}
|
|
7398
|
-
const span = column.rowspan({
|
|
7399
|
-
column,
|
|
7400
|
-
data,
|
|
7401
|
-
dataArray: dataArray2,
|
|
7402
|
-
groupRowInfo: null,
|
|
7403
|
-
rowInfo,
|
|
7404
|
-
rowIndex: itemIndex
|
|
7405
|
-
});
|
|
7406
|
-
if (span > maxSpan) {
|
|
7407
|
-
maxSpan = span;
|
|
7408
|
-
}
|
|
7409
|
-
});
|
|
7410
|
-
return maxSpan;
|
|
7411
|
-
} : void 0;
|
|
7412
|
-
}, [computedVisibleColumns]);
|
|
7413
7497
|
const { horizontalVirtualBrain, verticalVirtualBrain } = useYourBrain({
|
|
7414
7498
|
computedPinnedStartWidth: computed.computedPinnedStartWidth,
|
|
7415
7499
|
computedPinnedEndWidth: computed.computedPinnedEndWidth,
|
|
@@ -7422,7 +7506,7 @@ function useListRendering(param) {
|
|
|
7422
7506
|
const hasHorizontalScrollbar = computedUnpinnedColumnsWidth > bodySize.width - computedPinnedStartColumnsWidth - computedPinnedEndColumnsWidth;
|
|
7423
7507
|
const reservedContentHeight = verticalVirtualBrain.getTotalSize() + (hasHorizontalScrollbar ? getScrollbarWidth() : 0);
|
|
7424
7508
|
const hasVerticalScrollbar = bodySize.height > 0 && bodySize.height < reservedContentHeight;
|
|
7425
|
-
const scrollbars =
|
|
7509
|
+
const scrollbars = useMemo12(() => ({
|
|
7426
7510
|
vertical: hasVerticalScrollbar,
|
|
7427
7511
|
horizontal: hasHorizontalScrollbar
|
|
7428
7512
|
}), [hasVerticalScrollbar, hasHorizontalScrollbar]);
|
|
@@ -7470,7 +7554,8 @@ function useListRendering(param) {
|
|
|
7470
7554
|
rowHeight,
|
|
7471
7555
|
verticalVirtualBrain,
|
|
7472
7556
|
pinnedStartScrollListener,
|
|
7473
|
-
pinnedEndScrollListener
|
|
7557
|
+
pinnedEndScrollListener,
|
|
7558
|
+
rowSpan
|
|
7474
7559
|
};
|
|
7475
7560
|
const centerRenderingParams = __spreadProps(__spreadValues({}, pinnedRenderingParams), {
|
|
7476
7561
|
columnShifts,
|
|
@@ -7586,7 +7671,7 @@ var InfiniteTableLicenseFooter = forwardRef3(function InfiniteTableLicenseFooter
|
|
|
7586
7671
|
});
|
|
7587
7672
|
|
|
7588
7673
|
// src/components/InfiniteTable/hooks/useLicense/useLicense.ts
|
|
7589
|
-
import { useMemo as
|
|
7674
|
+
import { useMemo as useMemo13 } from "react";
|
|
7590
7675
|
|
|
7591
7676
|
// src/components/InfiniteTable/hooks/useLicense/crc32.ts
|
|
7592
7677
|
var DEFAULT_ReversedPolynomial = 3988292384;
|
|
@@ -7736,10 +7821,10 @@ var origin = typeof window !== "undefined" ? window.location.origin : "";
|
|
|
7736
7821
|
var [_fullUrl, protocol, sandboxUrl] = Array.from(SANDBOX_REGEX.exec(origin) || []);
|
|
7737
7822
|
var isInsideSandbox = protocol === "https" && sandboxUrl === "sandpack.codesandbox.io";
|
|
7738
7823
|
var useLicense = (licenseKey = "") => {
|
|
7739
|
-
const valid =
|
|
7824
|
+
const valid = useMemo13(() => {
|
|
7740
7825
|
let valid2 = isValidLicense(licenseKey, {
|
|
7741
7826
|
publishedAt: 1624970570587,
|
|
7742
|
-
version: "0.2.
|
|
7827
|
+
version: "0.2.8"
|
|
7743
7828
|
});
|
|
7744
7829
|
if (!licenseKey && !valid2 && isInsideSandbox) {
|
|
7745
7830
|
return true;
|
package/index.js
CHANGED
|
@@ -873,6 +873,7 @@ var mapPropsToState = (params) => {
|
|
|
873
873
|
});
|
|
874
874
|
const computedColumns = state.columnsWhenGrouping || state.columnsWhenInlineGroupRenderStrategy || state.columns;
|
|
875
875
|
return {
|
|
876
|
+
controlledColumnVisibility: !!props.columnVisibility,
|
|
876
877
|
groupRenderStrategy,
|
|
877
878
|
groupBy,
|
|
878
879
|
computedColumns,
|
|
@@ -1398,6 +1399,7 @@ var getComputedVisibleColumns = ({
|
|
|
1398
1399
|
const result2 = __spreadProps(__spreadValues({
|
|
1399
1400
|
align: colType.align,
|
|
1400
1401
|
verticalAlign: colType.verticalAlign,
|
|
1402
|
+
defaultHiddenWhenGroupedBy: colType.defaultHiddenWhenGroupedBy,
|
|
1401
1403
|
valueGetter: colType.valueGetter,
|
|
1402
1404
|
renderValue: colType.renderValue,
|
|
1403
1405
|
render: colType.render
|
|
@@ -2841,6 +2843,7 @@ function getEnhancedGroupData(options, deepMapValue) {
|
|
|
2841
2843
|
id: `${groupKeys}`,
|
|
2842
2844
|
collapsed,
|
|
2843
2845
|
parents,
|
|
2846
|
+
flatRowInfoList: [],
|
|
2844
2847
|
collapsedChildrenCount: 0,
|
|
2845
2848
|
collapsedGroupsCount: 0,
|
|
2846
2849
|
indexInParentGroups: options.indexInParentGroups,
|
|
@@ -2903,9 +2906,14 @@ function enhancedFlatten(param) {
|
|
|
2903
2906
|
}
|
|
2904
2907
|
if (collapsed) {
|
|
2905
2908
|
parents.forEach((parent) => {
|
|
2909
|
+
parent.flatRowInfoList.push(enhancedGroupData);
|
|
2906
2910
|
parent.collapsedChildrenCount += enhancedGroupData.groupCount;
|
|
2907
2911
|
parent.collapsedGroupsCount += 1;
|
|
2908
2912
|
});
|
|
2913
|
+
} else {
|
|
2914
|
+
parents.forEach((parent) => {
|
|
2915
|
+
parent.flatRowInfoList.push(enhancedGroupData);
|
|
2916
|
+
});
|
|
2909
2917
|
}
|
|
2910
2918
|
indexInParentGroups.push(indexInGroup);
|
|
2911
2919
|
parents.push(enhancedGroupData);
|
|
@@ -2914,7 +2922,7 @@ function enhancedFlatten(param) {
|
|
|
2914
2922
|
if (!pivot) {
|
|
2915
2923
|
const startIndex = result.length;
|
|
2916
2924
|
result.push(...items.map((item, index) => {
|
|
2917
|
-
|
|
2925
|
+
const rowInfo = {
|
|
2918
2926
|
id: item ? toPrimaryKey(item) : `${groupKeys}-${index}`,
|
|
2919
2927
|
data: item,
|
|
2920
2928
|
isGroupRow: false,
|
|
@@ -2928,6 +2936,10 @@ function enhancedFlatten(param) {
|
|
|
2928
2936
|
groupNesting,
|
|
2929
2937
|
groupCount: enhancedGroupData.groupCount
|
|
2930
2938
|
};
|
|
2939
|
+
parents.forEach((parent) => {
|
|
2940
|
+
parent.flatRowInfoList.push(rowInfo);
|
|
2941
|
+
});
|
|
2942
|
+
return rowInfo;
|
|
2931
2943
|
}));
|
|
2932
2944
|
}
|
|
2933
2945
|
} else {
|
|
@@ -3957,7 +3969,7 @@ function concludeReducer(params) {
|
|
|
3957
3969
|
state.groupDeepMap = void 0;
|
|
3958
3970
|
state.pivotColumns = void 0;
|
|
3959
3971
|
const arrayDifferentAfterSortStep = previousState.postSortDataArray != state.postSortDataArray;
|
|
3960
|
-
if (arrayDifferentAfterSortStep) {
|
|
3972
|
+
if (arrayDifferentAfterSortStep || groupsDepsChanged) {
|
|
3961
3973
|
rowInfoDataArray = dataArray.map((data, index) => toRowInfo(data, data ? toPrimaryKey(data) : index, index));
|
|
3962
3974
|
}
|
|
3963
3975
|
}
|
|
@@ -4068,7 +4080,7 @@ function useColumnsWhen() {
|
|
|
4068
4080
|
}, [pivotTotalColumnPosition]);
|
|
4069
4081
|
useColumnsWhenInlineGroupRenderStrategy(groupByMap);
|
|
4070
4082
|
const { toggleGroupRow } = useColumnsWhenGrouping();
|
|
4071
|
-
|
|
4083
|
+
useHideColumns(groupByMap);
|
|
4072
4084
|
return { toggleGroupRow };
|
|
4073
4085
|
}
|
|
4074
4086
|
function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
@@ -4190,9 +4202,10 @@ function useColumnsWhenGrouping() {
|
|
|
4190
4202
|
]);
|
|
4191
4203
|
return { toggleGroupRow };
|
|
4192
4204
|
}
|
|
4193
|
-
function
|
|
4205
|
+
function useHideColumns(groupByMap) {
|
|
4194
4206
|
const {
|
|
4195
4207
|
componentState: {
|
|
4208
|
+
dataArray,
|
|
4196
4209
|
groupBy,
|
|
4197
4210
|
groupRowsState,
|
|
4198
4211
|
originalLazyGroupDataChangeDetect
|
|
@@ -4203,18 +4216,49 @@ function useHideEmptyGroupColumns() {
|
|
|
4203
4216
|
getComponentState,
|
|
4204
4217
|
componentActions,
|
|
4205
4218
|
componentState: {
|
|
4206
|
-
|
|
4219
|
+
columnTypes,
|
|
4220
|
+
computedColumns,
|
|
4207
4221
|
hideEmptyGroupColumns,
|
|
4208
4222
|
groupRenderStrategy
|
|
4209
4223
|
}
|
|
4210
4224
|
} = useComponentState();
|
|
4225
|
+
const prevHideEmptyGroupColumns = usePrevious(hideEmptyGroupColumns);
|
|
4211
4226
|
(0, import_react17.useEffect)(() => {
|
|
4212
4227
|
if (groupRenderStrategy !== "multi-column") {
|
|
4213
4228
|
return;
|
|
4214
4229
|
}
|
|
4230
|
+
const currentState = getComponentState();
|
|
4231
|
+
const computedGroupColumns = new Map();
|
|
4232
|
+
computedColumns.forEach((column, colId) => {
|
|
4233
|
+
if (typeof column.groupByField !== "string") {
|
|
4234
|
+
return;
|
|
4235
|
+
}
|
|
4236
|
+
const { groupByField } = column;
|
|
4237
|
+
const field = groupByField;
|
|
4238
|
+
const groupInfoForColumn = groupByMap.get(field);
|
|
4239
|
+
if (!groupInfoForColumn) {
|
|
4240
|
+
return;
|
|
4241
|
+
}
|
|
4242
|
+
computedGroupColumns.set(colId, column);
|
|
4243
|
+
});
|
|
4244
|
+
if (!hideEmptyGroupColumns) {
|
|
4245
|
+
if (prevHideEmptyGroupColumns) {
|
|
4246
|
+
let updated2 = false;
|
|
4247
|
+
const columnVisibility2 = __spreadValues({}, currentState.columnVisibility);
|
|
4248
|
+
computedGroupColumns.forEach((_column, colId) => {
|
|
4249
|
+
if (columnVisibility2[colId] === false) {
|
|
4250
|
+
updated2 = true;
|
|
4251
|
+
delete columnVisibility2[colId];
|
|
4252
|
+
}
|
|
4253
|
+
});
|
|
4254
|
+
if (updated2) {
|
|
4255
|
+
componentActions.columnVisibility = columnVisibility2;
|
|
4256
|
+
}
|
|
4257
|
+
}
|
|
4258
|
+
return;
|
|
4259
|
+
}
|
|
4215
4260
|
const groupsLength = groupBy.length;
|
|
4216
4261
|
let expandedGroupsLevel = 0;
|
|
4217
|
-
const { dataArray } = getDataSourceState();
|
|
4218
4262
|
const len = dataArray.length;
|
|
4219
4263
|
for (let i = 0; i < len; i++) {
|
|
4220
4264
|
const data = dataArray[i];
|
|
@@ -4223,23 +4267,24 @@ function useHideEmptyGroupColumns() {
|
|
|
4223
4267
|
break;
|
|
4224
4268
|
}
|
|
4225
4269
|
}
|
|
4226
|
-
const currentState = getComponentState();
|
|
4227
|
-
const { computedColumns } = currentState;
|
|
4228
4270
|
let updated = false;
|
|
4229
4271
|
const columnVisibility = __spreadValues({}, currentState.columnVisibility);
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
const
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
return;
|
|
4236
|
-
}
|
|
4272
|
+
computedGroupColumns.forEach((column, colId) => {
|
|
4273
|
+
const { groupByField } = column;
|
|
4274
|
+
const field = groupByField;
|
|
4275
|
+
const groupInfoForColumn = groupByMap.get(field);
|
|
4276
|
+
const index = groupInfoForColumn.groupIndex;
|
|
4237
4277
|
const shouldBeHidden = index > expandedGroupsLevel && hideEmptyGroupColumns;
|
|
4238
|
-
updated = true;
|
|
4239
4278
|
if (shouldBeHidden) {
|
|
4240
|
-
columnVisibility[colId]
|
|
4279
|
+
if (columnVisibility[colId] !== false) {
|
|
4280
|
+
updated = true;
|
|
4281
|
+
columnVisibility[colId] = false;
|
|
4282
|
+
}
|
|
4241
4283
|
} else {
|
|
4242
|
-
|
|
4284
|
+
if (columnVisibility.hasOwnProperty(colId)) {
|
|
4285
|
+
updated = true;
|
|
4286
|
+
delete columnVisibility[colId];
|
|
4287
|
+
}
|
|
4243
4288
|
}
|
|
4244
4289
|
});
|
|
4245
4290
|
if (updated) {
|
|
@@ -4248,12 +4293,41 @@ function useHideEmptyGroupColumns() {
|
|
|
4248
4293
|
}, [
|
|
4249
4294
|
getDataSourceState,
|
|
4250
4295
|
groupRenderStrategy,
|
|
4251
|
-
generatedColumns,
|
|
4252
4296
|
originalLazyGroupDataChangeDetect,
|
|
4253
4297
|
groupBy,
|
|
4298
|
+
groupByMap,
|
|
4299
|
+
computedColumns,
|
|
4300
|
+
hideEmptyGroupColumns ? dataArray : null,
|
|
4254
4301
|
hideEmptyGroupColumns ? groupRowsState : null,
|
|
4255
4302
|
hideEmptyGroupColumns
|
|
4256
4303
|
]);
|
|
4304
|
+
(0, import_react17.useEffect)(() => {
|
|
4305
|
+
const isGrouped = groupBy.length > 0;
|
|
4306
|
+
const currentState = getComponentState();
|
|
4307
|
+
const { controlledColumnVisibility, columnVisibility } = currentState;
|
|
4308
|
+
if (controlledColumnVisibility) {
|
|
4309
|
+
return;
|
|
4310
|
+
}
|
|
4311
|
+
const newColumnVisibility = __spreadValues({}, columnVisibility);
|
|
4312
|
+
let updated = false;
|
|
4313
|
+
computedColumns.forEach((col, id) => {
|
|
4314
|
+
if (col.defaultHiddenWhenGroupedBy) {
|
|
4315
|
+
const nowHidden = columnVisibility[id] === false;
|
|
4316
|
+
const shouldBeHidden = col.defaultHiddenWhenGroupedBy === "*" && isGrouped || typeof col.defaultHiddenWhenGroupedBy === "string" && groupByMap.get(col.defaultHiddenWhenGroupedBy) || typeof col.defaultHiddenWhenGroupedBy === "object" && Object.keys(col.defaultHiddenWhenGroupedBy).reduce((acc, field) => acc || groupByMap.has(field), false);
|
|
4317
|
+
if (nowHidden !== shouldBeHidden) {
|
|
4318
|
+
updated = true;
|
|
4319
|
+
if (shouldBeHidden) {
|
|
4320
|
+
newColumnVisibility[id] = false;
|
|
4321
|
+
} else {
|
|
4322
|
+
delete newColumnVisibility[id];
|
|
4323
|
+
}
|
|
4324
|
+
}
|
|
4325
|
+
}
|
|
4326
|
+
});
|
|
4327
|
+
if (updated) {
|
|
4328
|
+
componentActions.columnVisibility = newColumnVisibility;
|
|
4329
|
+
}
|
|
4330
|
+
}, [computedColumns, columnTypes, groupBy, groupByMap]);
|
|
4257
4331
|
}
|
|
4258
4332
|
function getColumnsWhenGrouping(params) {
|
|
4259
4333
|
const {
|
|
@@ -4402,6 +4476,31 @@ function useComputed() {
|
|
|
4402
4476
|
columnSizing,
|
|
4403
4477
|
columnTypes
|
|
4404
4478
|
});
|
|
4479
|
+
const rowSpan = (0, import_react18.useMemo)(() => {
|
|
4480
|
+
const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
|
|
4481
|
+
return colsWithRowspan.length ? ({ itemIndex }) => {
|
|
4482
|
+
let maxSpan = 1;
|
|
4483
|
+
const dataArray = getDataSourceState().dataArray;
|
|
4484
|
+
const rowInfo = dataArray[itemIndex];
|
|
4485
|
+
const data = rowInfo.data;
|
|
4486
|
+
colsWithRowspan.forEach((column) => {
|
|
4487
|
+
if (!column.rowspan) {
|
|
4488
|
+
return;
|
|
4489
|
+
}
|
|
4490
|
+
const span = column.rowspan({
|
|
4491
|
+
column,
|
|
4492
|
+
data,
|
|
4493
|
+
dataArray,
|
|
4494
|
+
rowInfo,
|
|
4495
|
+
rowIndex: itemIndex
|
|
4496
|
+
});
|
|
4497
|
+
if (span > maxSpan) {
|
|
4498
|
+
maxSpan = span;
|
|
4499
|
+
}
|
|
4500
|
+
});
|
|
4501
|
+
return maxSpan;
|
|
4502
|
+
} : void 0;
|
|
4503
|
+
}, [computedVisibleColumns]);
|
|
4405
4504
|
const unpinnedColumnWidths = computedUnpinnedColumns.map((c) => c.computedWidth);
|
|
4406
4505
|
let sortedUnpinnedColumnWidths = [...unpinnedColumnWidths].sort(sortAscending);
|
|
4407
4506
|
let unpinnedColumnRenderCount = 0;
|
|
@@ -4428,6 +4527,7 @@ function useComputed() {
|
|
|
4428
4527
|
const computedPinnedStartOverflow = computedPinnedStartWidth ? computedPinnedStartColumnsWidth > computedPinnedStartWidth : false;
|
|
4429
4528
|
const computedPinnedEndOverflow = computedPinnedEndWidth ? computedPinnedEndColumnsWidth > computedPinnedEndWidth : false;
|
|
4430
4529
|
return {
|
|
4530
|
+
rowSpan,
|
|
4431
4531
|
toggleGroupRow,
|
|
4432
4532
|
computedPinnedStartOverflow,
|
|
4433
4533
|
computedPinnedEndOverflow,
|
|
@@ -6032,7 +6132,6 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6032
6132
|
dataArray: getData(),
|
|
6033
6133
|
column,
|
|
6034
6134
|
rowInfo,
|
|
6035
|
-
groupRowInfo,
|
|
6036
6135
|
rowIndex,
|
|
6037
6136
|
data: rowInfo.data
|
|
6038
6137
|
});
|
|
@@ -6080,7 +6179,8 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
|
|
|
6080
6179
|
showHoverRows = false,
|
|
6081
6180
|
rowIndex,
|
|
6082
6181
|
domRef: domRefFromProps,
|
|
6083
|
-
rowInfo
|
|
6182
|
+
rowInfo,
|
|
6183
|
+
rowSpan
|
|
6084
6184
|
} = props;
|
|
6085
6185
|
const domRef = (0, import_react31.useRef)(null);
|
|
6086
6186
|
const rowDOMRef = (0, import_react31.useCallback)((node) => {
|
|
@@ -6100,7 +6200,7 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
|
|
|
6100
6200
|
if (rowStyle) {
|
|
6101
6201
|
style = typeof rowStyle === "function" ? __spreadValues(__spreadValues({}, style), rowStyle(rowPropsAndStyleArgs)) : __spreadValues(__spreadValues({}, style), rowStyle);
|
|
6102
6202
|
}
|
|
6103
|
-
if (inlineGroupRoot) {
|
|
6203
|
+
if (inlineGroupRoot || rowSpan) {
|
|
6104
6204
|
style = style || {};
|
|
6105
6205
|
style.zIndex = 2e6 - rowInfo.indexInAll;
|
|
6106
6206
|
}
|
|
@@ -6284,6 +6384,7 @@ function useUnpinnedRendering(params) {
|
|
|
6284
6384
|
computedPinnedStartWidth,
|
|
6285
6385
|
computedPinnedEndWidth,
|
|
6286
6386
|
computedUnpinnedColumns,
|
|
6387
|
+
rowSpan,
|
|
6287
6388
|
getState
|
|
6288
6389
|
} = params;
|
|
6289
6390
|
const { virtualizeColumns } = getState();
|
|
@@ -6297,6 +6398,7 @@ function useUnpinnedRendering(params) {
|
|
|
6297
6398
|
showZebraRows,
|
|
6298
6399
|
showHoverRows,
|
|
6299
6400
|
getData,
|
|
6401
|
+
rowSpan,
|
|
6300
6402
|
toggleGroupRow,
|
|
6301
6403
|
virtualizeColumns: shouldVirtualizeColumns,
|
|
6302
6404
|
brain: null,
|
|
@@ -6313,6 +6415,7 @@ function useUnpinnedRendering(params) {
|
|
|
6313
6415
|
}, [
|
|
6314
6416
|
repaintId,
|
|
6315
6417
|
rowHeight,
|
|
6418
|
+
rowSpan,
|
|
6316
6419
|
computedUnpinnedColumns,
|
|
6317
6420
|
computedUnpinnedColumnsWidth,
|
|
6318
6421
|
shouldVirtualizeColumns,
|
|
@@ -6635,7 +6738,7 @@ function PinnedRowsContainer(props) {
|
|
|
6635
6738
|
return /* @__PURE__ */ React30.createElement(RowListWithExternalScrolling, __spreadValues({}, rowListProps));
|
|
6636
6739
|
}
|
|
6637
6740
|
function useRenderPinnedRow(params) {
|
|
6638
|
-
const { getData, getState, columnsWidth, columns, verticalBrain } = params;
|
|
6741
|
+
const { getData, getState, columnsWidth, columns, rowSpan, verticalBrain } = params;
|
|
6639
6742
|
const renderPinnedRow = (0, import_react37.useCallback)((rowParams) => {
|
|
6640
6743
|
const dataArray = getData();
|
|
6641
6744
|
const rowInfo = dataArray[rowParams.rowIndex];
|
|
@@ -6649,6 +6752,7 @@ function useRenderPinnedRow(params) {
|
|
|
6649
6752
|
virtualizeColumns: false,
|
|
6650
6753
|
verticalBrain,
|
|
6651
6754
|
brain: null,
|
|
6755
|
+
rowSpan,
|
|
6652
6756
|
rowWidth: columnsWidth,
|
|
6653
6757
|
columns
|
|
6654
6758
|
}, rowParams);
|
|
@@ -6673,6 +6777,7 @@ function usePinnedRenderingForSide(side, params) {
|
|
|
6673
6777
|
computedPinnedStartOverflow,
|
|
6674
6778
|
pinnedStartScrollListener,
|
|
6675
6779
|
pinnedEndScrollListener,
|
|
6780
|
+
rowSpan,
|
|
6676
6781
|
repaintId,
|
|
6677
6782
|
toggleGroupRow,
|
|
6678
6783
|
scrollbars: {
|
|
@@ -6691,6 +6796,7 @@ function usePinnedRenderingForSide(side, params) {
|
|
|
6691
6796
|
getData,
|
|
6692
6797
|
getState,
|
|
6693
6798
|
toggleGroupRow,
|
|
6799
|
+
rowSpan,
|
|
6694
6800
|
verticalBrain: verticalVirtualBrain,
|
|
6695
6801
|
columns,
|
|
6696
6802
|
columnsWidth
|
|
@@ -7054,7 +7160,7 @@ var VirtualBrain = class extends Logger {
|
|
|
7054
7160
|
this.computeCacheFor(lastSizeIndex);
|
|
7055
7161
|
_prev = lastOffset;
|
|
7056
7162
|
lastOffset = this.itemOffsetCache[lastSizeIndex];
|
|
7057
|
-
if (_prev === lastOffset) {
|
|
7163
|
+
if (_prev === lastOffset && _prev != 0) {
|
|
7058
7164
|
return count - 1;
|
|
7059
7165
|
}
|
|
7060
7166
|
}
|
|
@@ -7246,6 +7352,10 @@ function useYourBrain(param) {
|
|
|
7246
7352
|
}, []);
|
|
7247
7353
|
horizontalVirtualBrain.update(computedUnpinnedColumns.length, columnSize);
|
|
7248
7354
|
verticalVirtualBrain.update(dataArray.length, rowHeight, rowSpan);
|
|
7355
|
+
if (true) {
|
|
7356
|
+
globalThis.verticalVirtualBrain = verticalVirtualBrain;
|
|
7357
|
+
globalThis.horizontalVirtualBrain = horizontalVirtualBrain;
|
|
7358
|
+
}
|
|
7249
7359
|
(0, import_react40.useEffect)(() => {
|
|
7250
7360
|
verticalVirtualBrain.setAvailableSize({
|
|
7251
7361
|
height: bodySize.height,
|
|
@@ -7277,7 +7387,7 @@ function useListRendering(param) {
|
|
|
7277
7387
|
computedUnpinnedColumnsWidth,
|
|
7278
7388
|
computedPinnedStartOverflow,
|
|
7279
7389
|
computedPinnedEndOverflow,
|
|
7280
|
-
|
|
7390
|
+
rowSpan,
|
|
7281
7391
|
toggleGroupRow
|
|
7282
7392
|
} = computed;
|
|
7283
7393
|
const { componentState: dataSourceState, getState: getDataSourceState } = useDataSourceContextValue();
|
|
@@ -7296,32 +7406,6 @@ function useListRendering(param) {
|
|
|
7296
7406
|
repaintIdRef.current++;
|
|
7297
7407
|
}
|
|
7298
7408
|
const repaintId = repaintIdRef.current;
|
|
7299
|
-
const rowSpan = (0, import_react41.useMemo)(() => {
|
|
7300
|
-
const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
|
|
7301
|
-
return colsWithRowspan.length ? ({ itemIndex }) => {
|
|
7302
|
-
let maxSpan = 1;
|
|
7303
|
-
const dataArray2 = getData();
|
|
7304
|
-
const rowInfo = dataArray2[itemIndex];
|
|
7305
|
-
const data = rowInfo.data;
|
|
7306
|
-
colsWithRowspan.forEach((column) => {
|
|
7307
|
-
if (!column.rowspan) {
|
|
7308
|
-
return;
|
|
7309
|
-
}
|
|
7310
|
-
const span = column.rowspan({
|
|
7311
|
-
column,
|
|
7312
|
-
data,
|
|
7313
|
-
dataArray: dataArray2,
|
|
7314
|
-
groupRowInfo: null,
|
|
7315
|
-
rowInfo,
|
|
7316
|
-
rowIndex: itemIndex
|
|
7317
|
-
});
|
|
7318
|
-
if (span > maxSpan) {
|
|
7319
|
-
maxSpan = span;
|
|
7320
|
-
}
|
|
7321
|
-
});
|
|
7322
|
-
return maxSpan;
|
|
7323
|
-
} : void 0;
|
|
7324
|
-
}, [computedVisibleColumns]);
|
|
7325
7409
|
const { horizontalVirtualBrain, verticalVirtualBrain } = useYourBrain({
|
|
7326
7410
|
computedPinnedStartWidth: computed.computedPinnedStartWidth,
|
|
7327
7411
|
computedPinnedEndWidth: computed.computedPinnedEndWidth,
|
|
@@ -7382,7 +7466,8 @@ function useListRendering(param) {
|
|
|
7382
7466
|
rowHeight,
|
|
7383
7467
|
verticalVirtualBrain,
|
|
7384
7468
|
pinnedStartScrollListener,
|
|
7385
|
-
pinnedEndScrollListener
|
|
7469
|
+
pinnedEndScrollListener,
|
|
7470
|
+
rowSpan
|
|
7386
7471
|
};
|
|
7387
7472
|
const centerRenderingParams = __spreadProps(__spreadValues({}, pinnedRenderingParams), {
|
|
7388
7473
|
columnShifts,
|
|
@@ -7646,7 +7731,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
7646
7731
|
const valid = (0, import_react43.useMemo)(() => {
|
|
7647
7732
|
let valid2 = isValidLicense(licenseKey, {
|
|
7648
7733
|
publishedAt: 1624970570587,
|
|
7649
|
-
version: "0.2.
|
|
7734
|
+
version: "0.2.8"
|
|
7650
7735
|
});
|
|
7651
7736
|
if (!licenseKey && !valid2 && isInsideSandbox) {
|
|
7652
7737
|
return true;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infinite-table/infinite-react",
|
|
3
3
|
"description": "Infinite Table for React",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.8",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.esm.js",
|
|
7
7
|
"typings": "index.d.ts",
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
},
|
|
15
15
|
"license": "Commercial & Open Source",
|
|
16
16
|
"//": "will be updated at build time",
|
|
17
|
-
"publishedAt":
|
|
17
|
+
"publishedAt": 1645485108085
|
|
18
18
|
}
|