@infinite-table/infinite-react 4.3.5 → 4.3.6
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 +6 -1
- package/index.dev.js +63 -13
- package/index.dev.mjs +63 -13
- package/index.js +63 -13
- package/index.mjs +63 -13
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1400,6 +1400,7 @@ interface InfiniteTableMappedState<T> {
|
|
|
1400
1400
|
onCellClick: InfiniteTableProps<T>['onCellClick'];
|
|
1401
1401
|
rowDetailCache: RowDetailCache<RowDetailCacheKey, RowDetailCacheEntry>;
|
|
1402
1402
|
headerOptions: NonUndefined<InfiniteTableProps<T>['headerOptions']>;
|
|
1403
|
+
draggableColumnsRestrictTo: NonUndefined<InfiniteTableProps<T>['draggableColumnsRestrictTo']>;
|
|
1403
1404
|
onScrollbarsChange: InfiniteTableProps<T>['onScrollbarsChange'];
|
|
1404
1405
|
getContextMenuItems: InfiniteTableProps<T>['getContextMenuItems'];
|
|
1405
1406
|
getCellContextMenuItems: InfiniteTableProps<T>['getCellContextMenuItems'];
|
|
@@ -1474,6 +1475,7 @@ interface InfiniteTableMappedState<T> {
|
|
|
1474
1475
|
columnHeaderHeight: number;
|
|
1475
1476
|
licenseKey: NonUndefined<InfiniteTableProps<T>['licenseKey']>;
|
|
1476
1477
|
columnVisibility: InfiniteTablePropColumnVisibility;
|
|
1478
|
+
columnGroupVisibility: NonUndefined<InfiniteTableProps<T>['columnGroupVisibility']>;
|
|
1477
1479
|
columnSizing: InfiniteTablePropColumnSizing;
|
|
1478
1480
|
columnTypes: InfiniteTablePropColumnTypes<T>;
|
|
1479
1481
|
columnGroups: InfiniteTablePropColumnGroups;
|
|
@@ -4749,6 +4751,7 @@ declare type LoadMaskProps = {
|
|
|
4749
4751
|
declare type InfiniteTablePropColumnOrderNormalized = string[];
|
|
4750
4752
|
declare type InfiniteTablePropColumnOrder = InfiniteTablePropColumnOrderNormalized | true;
|
|
4751
4753
|
declare type InfiniteTablePropColumnVisibility = Record<string, false>;
|
|
4754
|
+
declare type InfiniteTablePropColumnGroupVisibility = Record<string, boolean>;
|
|
4752
4755
|
declare type InfiniteTableColumnPinnedValues = false | 'start' | 'end';
|
|
4753
4756
|
declare type InfiniteTablePropColumnPinning = Record<string, true | 'start' | 'end'>;
|
|
4754
4757
|
declare type InfiniteTableRowStylingFnParams<T> = {
|
|
@@ -5091,6 +5094,7 @@ interface InfiniteTableProps<T> {
|
|
|
5091
5094
|
groupRenderStrategy?: InfiniteTablePropGroupRenderStrategy;
|
|
5092
5095
|
hideEmptyGroupColumns?: boolean;
|
|
5093
5096
|
columnVisibility?: InfiniteTablePropColumnVisibility;
|
|
5097
|
+
columnGroupVisibility?: InfiniteTablePropColumnGroupVisibility;
|
|
5094
5098
|
defaultColumnVisibility?: InfiniteTablePropColumnVisibility;
|
|
5095
5099
|
pinnedStartMaxWidth?: number;
|
|
5096
5100
|
pinnedEndMaxWidth?: number;
|
|
@@ -5169,6 +5173,7 @@ interface InfiniteTableProps<T> {
|
|
|
5169
5173
|
activeCellIndex?: [number, number] | null;
|
|
5170
5174
|
defaultActiveCellIndex?: [number, number] | null;
|
|
5171
5175
|
draggableColumns?: boolean;
|
|
5176
|
+
draggableColumnsRestrictTo?: false | 'group';
|
|
5172
5177
|
header?: boolean;
|
|
5173
5178
|
headerOptions?: InfiniteTablePropHeaderOptions;
|
|
5174
5179
|
focusedClassName?: string;
|
|
@@ -5402,4 +5407,4 @@ declare const components: {
|
|
|
5402
5407
|
NumberFilterEditor: typeof NumberFilterEditor;
|
|
5403
5408
|
};
|
|
5404
5409
|
|
|
5405
|
-
export { AdvancedAlignable, CellSelectionState, CellSelectionStateObject, ColumnTypeWithInherit, DataClient, DataSource, DataSourceAction, DataSourceActionType, DataSourceAggregationReducer, DataSourceApi, DataSourceCRUDParam, DataSourceComponentActions, DataSourceContextValue, DataSourceData, DataSourceDataParams, DataSourceDataParamsChanges, DataSourceDerivedState, DataSourceFilterFunctionParam, DataSourceFilterOperator, DataSourceFilterOperatorFunction, DataSourceFilterOperatorFunctionParam, DataSourceFilterType, DataSourceFilterValueItem, DataSourceFilterValueItemValueGetter, DataSourceGroupBy, DataSourceGroupRowsList, DataSourceInsertParam, DataSourceLivePaginationCursorFn, DataSourceLivePaginationCursorParams, DataSourceLivePaginationCursorValue, DataSourceMappedState, DataSourceMappings, DataSourceMasterDetailContextValue, DataSourcePivotBy, DataSourcePropAggregationReducers, DataSourcePropCellSelection, DataSourcePropCellSelection_MultiCell, DataSourcePropCellSelection_SingleCell, DataSourcePropFilterFunction, DataSourcePropFilterTypes, DataSourcePropFilterValue, DataSourcePropGroupBy, DataSourcePropGroupRowsStateObject, DataSourcePropIsRowSelected, DataSourcePropLivePaginationCursor, DataSourcePropMultiRowSelectionChangeParamType, DataSourcePropOnCellSelectionChange, DataSourcePropOnCellSelectionChange_MultiCell, DataSourcePropOnCellSelectionChange_SingleCell, DataSourcePropOnRowSelectionChange, DataSourcePropOnRowSelectionChange_MultiRow, DataSourcePropOnRowSelectionChange_SingleRow, DataSourcePropPivotBy, DataSourcePropRowInfoReducers, DataSourcePropRowSelection, DataSourcePropRowSelection_MultiRow, DataSourcePropRowSelection_SingleRow, DataSourcePropSelectionMode, DataSourcePropShouldReloadData, DataSourcePropShouldReloadDataObject, DataSourcePropSortFn, DataSourcePropSortInfo, DataSourcePropSortTypes, DataSourceProps, DataSourcePropsWithChildren, DataSourceRawReducer, DataSourceRemoteData, DataSourceRowInfoReducer, DataSourceSetupState, DataSourceSingleSortInfo, DataSourceSortInfo, DataSourceState, DebugLogger, DeepMap, ElementContainerGetter, FixedSizeSet, GroupRowsState, InfiniteColumnEditorContextType, InfiniteTable, InfiniteTableAction, InfiniteTableActionType, InfiniteTableApi, InfiniteTableClassName, InfiniteTableColumn, InfiniteTableColumnAggregator, InfiniteTableColumnApi, InfiniteTableColumnCellContextType, InfiniteTableColumnComparer, InfiniteTableColumnGroup, InfiniteTableColumnRenderFunctionForGroupRows, InfiniteTableColumnRenderFunctionForNormalRows, InfiniteTableColumnRenderValueParam, InfiniteTableColumnRowspanParam, InfiniteTableColumnSizingOptions, InfiniteTableColumnValueFormatterParams, InfiniteTableColumnValueGetterParams, InfiniteTableComponent, InfiniteTableComputedColumn, InfiniteTableComputedValues, InfiniteTableContextValue, InfiniteTableGroupColumnBase, InfiniteTableGroupColumnFunction, InfiniteTableGroupColumnGetterOptions, InfiniteTablePivotColumn, InfiniteTablePropAutoSizeColumnsKey, InfiniteTablePropColumnGroups, InfiniteTablePropColumnOrder, InfiniteTablePropColumnPinning, InfiniteTablePropColumnSizing, InfiniteTablePropColumnTypes, InfiniteTablePropColumnVisibility, InfiniteTablePropColumns, InfiniteTablePropComponents, InfiniteTablePropGetCellContextMenuItems, InfiniteTablePropGetColumnMenuItems, InfiniteTablePropGroupColumn, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropHeaderOptions, InfiniteTablePropKeyboardNavigation, InfiniteTablePropKeyboardShorcut, InfiniteTablePropMultiSortBehavior, InfiniteTablePropRowClassName, InfiniteTablePropRowStyle, InfiniteTableProps, InfiniteTableRowClassNameFn, InfiniteTableRowInfo, InfiniteTableRowStyleFn, InfiniteTableState, InfiniteTable_HasGrouping_RowInfoGroup, InfiniteTable_HasGrouping_RowInfoNormal, LazyGroupDataDeepMap, LazyGroupDataItem, LazyRowInfoGroup, Menu, MenuChildrenFnParam, MenuColumn, MenuColumnRenderParam, MenuDecoration, MenuIconProps, MenuItemActionContext, MenuItemDefinition, MenuItemObject, MenuProps, MenuRenderable, MenuRuntimeItem, MenuRuntimeItemSelectable, MenuSeparator, OverlayShowParams, RowDetailCache, RowDetailState, RowDetailStateObject, RowSelectionState, ScrollStopInfo, Scrollbars, ShowOverlayFn, TableRenderRange, WeakFixedSizeSet, components, debounce, debug, defaultFilterTypes, eventMatchesKeyboardShortcut, defaultFilterTypes as filterTypes, flatten, buildManagedComponent as getComponentStateRoot, group, interceptMap, keyboardShortcuts, multisort, queryKeyToCacheKey, useManagedComponentState as useComponentState, useDataSourceInternal, useDataSourceState, useEffectWithChanges, useEffectWithObject, useGridScroll, useInfiniteColumnCell, useInfiniteColumnEditor, useInfiniteColumnFilterEditor, useInfiniteHeaderCell, useManagedDataSource, useMasterRowInfo, useOverlay, useOverlayPortal, useRowInfoReducers, useVisibleColumnSizes };
|
|
5410
|
+
export { AdvancedAlignable, CellSelectionState, CellSelectionStateObject, ColumnTypeWithInherit, DataClient, DataSource, DataSourceAction, DataSourceActionType, DataSourceAggregationReducer, DataSourceApi, DataSourceCRUDParam, DataSourceComponentActions, DataSourceContextValue, DataSourceData, DataSourceDataParams, DataSourceDataParamsChanges, DataSourceDerivedState, DataSourceFilterFunctionParam, DataSourceFilterOperator, DataSourceFilterOperatorFunction, DataSourceFilterOperatorFunctionParam, DataSourceFilterType, DataSourceFilterValueItem, DataSourceFilterValueItemValueGetter, DataSourceGroupBy, DataSourceGroupRowsList, DataSourceInsertParam, DataSourceLivePaginationCursorFn, DataSourceLivePaginationCursorParams, DataSourceLivePaginationCursorValue, DataSourceMappedState, DataSourceMappings, DataSourceMasterDetailContextValue, DataSourcePivotBy, DataSourcePropAggregationReducers, DataSourcePropCellSelection, DataSourcePropCellSelection_MultiCell, DataSourcePropCellSelection_SingleCell, DataSourcePropFilterFunction, DataSourcePropFilterTypes, DataSourcePropFilterValue, DataSourcePropGroupBy, DataSourcePropGroupRowsStateObject, DataSourcePropIsRowSelected, DataSourcePropLivePaginationCursor, DataSourcePropMultiRowSelectionChangeParamType, DataSourcePropOnCellSelectionChange, DataSourcePropOnCellSelectionChange_MultiCell, DataSourcePropOnCellSelectionChange_SingleCell, DataSourcePropOnRowSelectionChange, DataSourcePropOnRowSelectionChange_MultiRow, DataSourcePropOnRowSelectionChange_SingleRow, DataSourcePropPivotBy, DataSourcePropRowInfoReducers, DataSourcePropRowSelection, DataSourcePropRowSelection_MultiRow, DataSourcePropRowSelection_SingleRow, DataSourcePropSelectionMode, DataSourcePropShouldReloadData, DataSourcePropShouldReloadDataObject, DataSourcePropSortFn, DataSourcePropSortInfo, DataSourcePropSortTypes, DataSourceProps, DataSourcePropsWithChildren, DataSourceRawReducer, DataSourceRemoteData, DataSourceRowInfoReducer, DataSourceSetupState, DataSourceSingleSortInfo, DataSourceSortInfo, DataSourceState, DebugLogger, DeepMap, ElementContainerGetter, FixedSizeSet, GroupRowsState, InfiniteColumnEditorContextType, InfiniteTable, InfiniteTableAction, InfiniteTableActionType, InfiniteTableApi, InfiniteTableClassName, InfiniteTableColumn, InfiniteTableColumnAggregator, InfiniteTableColumnApi, InfiniteTableColumnCellContextType, InfiniteTableColumnComparer, InfiniteTableColumnGroup, InfiniteTableColumnRenderFunctionForGroupRows, InfiniteTableColumnRenderFunctionForNormalRows, InfiniteTableColumnRenderValueParam, InfiniteTableColumnRowspanParam, InfiniteTableColumnSizingOptions, InfiniteTableColumnValueFormatterParams, InfiniteTableColumnValueGetterParams, InfiniteTableComponent, InfiniteTableComputedColumn, InfiniteTableComputedValues, InfiniteTableContextValue, InfiniteTableGroupColumnBase, InfiniteTableGroupColumnFunction, InfiniteTableGroupColumnGetterOptions, InfiniteTablePivotColumn, InfiniteTablePropAutoSizeColumnsKey, InfiniteTablePropColumnGroupVisibility, InfiniteTablePropColumnGroups, InfiniteTablePropColumnOrder, InfiniteTablePropColumnPinning, InfiniteTablePropColumnSizing, InfiniteTablePropColumnTypes, InfiniteTablePropColumnVisibility, InfiniteTablePropColumns, InfiniteTablePropComponents, InfiniteTablePropGetCellContextMenuItems, InfiniteTablePropGetColumnMenuItems, InfiniteTablePropGroupColumn, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropHeaderOptions, InfiniteTablePropKeyboardNavigation, InfiniteTablePropKeyboardShorcut, InfiniteTablePropMultiSortBehavior, InfiniteTablePropRowClassName, InfiniteTablePropRowStyle, InfiniteTableProps, InfiniteTableRowClassNameFn, InfiniteTableRowInfo, InfiniteTableRowStyleFn, InfiniteTableState, InfiniteTable_HasGrouping_RowInfoGroup, InfiniteTable_HasGrouping_RowInfoNormal, LazyGroupDataDeepMap, LazyGroupDataItem, LazyRowInfoGroup, Menu, MenuChildrenFnParam, MenuColumn, MenuColumnRenderParam, MenuDecoration, MenuIconProps, MenuItemActionContext, MenuItemDefinition, MenuItemObject, MenuProps, MenuRenderable, MenuRuntimeItem, MenuRuntimeItemSelectable, MenuSeparator, OverlayShowParams, RowDetailCache, RowDetailState, RowDetailStateObject, RowSelectionState, ScrollStopInfo, Scrollbars, ShowOverlayFn, TableRenderRange, WeakFixedSizeSet, components, debounce, debug, defaultFilterTypes, eventMatchesKeyboardShortcut, defaultFilterTypes as filterTypes, flatten, buildManagedComponent as getComponentStateRoot, group, interceptMap, keyboardShortcuts, multisort, queryKeyToCacheKey, useManagedComponentState as useComponentState, useDataSourceInternal, useDataSourceState, useEffectWithChanges, useEffectWithObject, useGridScroll, useInfiniteColumnCell, useInfiniteColumnEditor, useInfiniteColumnFilterEditor, useInfiniteHeaderCell, useManagedDataSource, useMasterRowInfo, useOverlay, useOverlayPortal, useRowInfoReducers, useVisibleColumnSizes };
|
package/index.dev.js
CHANGED
|
@@ -6950,6 +6950,7 @@ function reorderColumnsOnDrag(params) {
|
|
|
6950
6950
|
infiniteDOMNode,
|
|
6951
6951
|
brain,
|
|
6952
6952
|
dragColumnHeaderTargetRect,
|
|
6953
|
+
draggableColumnsRestrictTo,
|
|
6953
6954
|
tableRect,
|
|
6954
6955
|
setProxyPosition,
|
|
6955
6956
|
api: imperativeApi
|
|
@@ -6978,8 +6979,9 @@ function reorderColumnsOnDrag(params) {
|
|
|
6978
6979
|
const scrollLeft2 = brain.getScrollPosition().scrollLeft;
|
|
6979
6980
|
return col.computedOffset >= scrollLeft2 + getCurrentPinnedWidth("start") && col.computedOffset + col.computedWidth < scrollLeft2 + tableRect.width - getCurrentPinnedWidth("end");
|
|
6980
6981
|
}
|
|
6981
|
-
const getBreakPoints = (columns) => {
|
|
6982
|
-
const
|
|
6982
|
+
const getBreakPoints = (columns, options) => {
|
|
6983
|
+
const { restrictToParentGroup, dragColumn: dragColumn2 } = options;
|
|
6984
|
+
let breakpoints = [];
|
|
6983
6985
|
columns.forEach((c) => {
|
|
6984
6986
|
const b = {
|
|
6985
6987
|
columnId: c.id,
|
|
@@ -6993,6 +6995,26 @@ function reorderColumnsOnDrag(params) {
|
|
|
6993
6995
|
breakpoints.push(b);
|
|
6994
6996
|
}
|
|
6995
6997
|
});
|
|
6998
|
+
if (restrictToParentGroup) {
|
|
6999
|
+
let checkAllowedColumnsInDirection2 = function(colIndex, dir2, disallowedTargets2) {
|
|
7000
|
+
const col = columns[colIndex];
|
|
7001
|
+
if (!col) {
|
|
7002
|
+
return;
|
|
7003
|
+
}
|
|
7004
|
+
if (col.columnGroup !== dragColumn2.columnGroup) {
|
|
7005
|
+
disallowedTargets2.add(col.id);
|
|
7006
|
+
}
|
|
7007
|
+
checkAllowedColumnsInDirection2(colIndex + dir2, dir2, disallowedTargets2);
|
|
7008
|
+
};
|
|
7009
|
+
var checkAllowedColumnsInDirection = checkAllowedColumnsInDirection2;
|
|
7010
|
+
const dragColIndex = dragColumn2.computedVisibleIndex;
|
|
7011
|
+
const disallowedTargets = /* @__PURE__ */ new Set();
|
|
7012
|
+
checkAllowedColumnsInDirection2(dragColIndex - 1, -1, disallowedTargets);
|
|
7013
|
+
checkAllowedColumnsInDirection2(dragColIndex + 1, 1, disallowedTargets);
|
|
7014
|
+
breakpoints = breakpoints.filter((b) => {
|
|
7015
|
+
return !disallowedTargets.has(b.columnId);
|
|
7016
|
+
});
|
|
7017
|
+
}
|
|
6996
7018
|
return breakpoints;
|
|
6997
7019
|
};
|
|
6998
7020
|
const initialPinnedStartCount = computedPinnedStartColumns.length;
|
|
@@ -7171,7 +7193,10 @@ function reorderColumnsOnDrag(params) {
|
|
|
7171
7193
|
imperativeApi.scrollLeft = value;
|
|
7172
7194
|
}
|
|
7173
7195
|
});
|
|
7174
|
-
const breakpoints = getBreakPoints(computedVisibleColumns
|
|
7196
|
+
const breakpoints = getBreakPoints(computedVisibleColumns, {
|
|
7197
|
+
dragColumn,
|
|
7198
|
+
restrictToParentGroup: draggableColumnsRestrictTo === "group"
|
|
7199
|
+
});
|
|
7175
7200
|
let currentPos = dir === -1 ? dragColumn.computedOffset + diffX : dragColumn.computedOffset + dragColumn.computedWidth + diffX;
|
|
7176
7201
|
let idx = (0, import_binary_search2.default)(
|
|
7177
7202
|
breakpoints,
|
|
@@ -7330,7 +7355,7 @@ var useColumnPointerEvents = ({
|
|
|
7330
7355
|
if (((_a2 = e.target) == null ? void 0 : _a2.tagName) === "INPUT") {
|
|
7331
7356
|
return;
|
|
7332
7357
|
}
|
|
7333
|
-
const { brain } = getState();
|
|
7358
|
+
const { brain, draggableColumnsRestrictTo } = getState();
|
|
7334
7359
|
const {
|
|
7335
7360
|
computedVisibleColumns,
|
|
7336
7361
|
computedVisibleColumnsMap,
|
|
@@ -7352,6 +7377,7 @@ var useColumnPointerEvents = ({
|
|
|
7352
7377
|
let didDragAtLeastOnce = false;
|
|
7353
7378
|
const dragger = reorderColumnsOnDrag({
|
|
7354
7379
|
brain,
|
|
7380
|
+
draggableColumnsRestrictTo,
|
|
7355
7381
|
columnOffsetAtIndexCSSVar: columnOffsetAtIndex4,
|
|
7356
7382
|
columnWidthAtIndexCSSVar: columnWidthAtIndex3,
|
|
7357
7383
|
computedPinnedEndColumns,
|
|
@@ -9960,6 +9986,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
9960
9986
|
} = props;
|
|
9961
9987
|
const {
|
|
9962
9988
|
computed,
|
|
9989
|
+
getState,
|
|
9963
9990
|
state: { headerBrain, headerOptions, showColumnFilters }
|
|
9964
9991
|
} = useInfiniteTable();
|
|
9965
9992
|
const { computedColumnsMap } = computed;
|
|
@@ -10012,7 +10039,8 @@ function InfiniteTableHeaderFn(props) {
|
|
|
10012
10039
|
computedWidth: colGroupItem.computedWidth,
|
|
10013
10040
|
groupOffset: colGroupItem.groupOffset
|
|
10014
10041
|
});
|
|
10015
|
-
|
|
10042
|
+
const visible = getState().columnGroupVisibility[colGroupItem.id] !== false;
|
|
10043
|
+
return visible ? /* @__PURE__ */ React46.createElement(
|
|
10016
10044
|
InfiniteTableHeaderGroup,
|
|
10017
10045
|
{
|
|
10018
10046
|
bodyBrain,
|
|
@@ -10023,7 +10051,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
10023
10051
|
height,
|
|
10024
10052
|
columnGroup: computedColumnGroup
|
|
10025
10053
|
}
|
|
10026
|
-
);
|
|
10054
|
+
) : null;
|
|
10027
10055
|
}
|
|
10028
10056
|
return /* @__PURE__ */ React46.createElement(
|
|
10029
10057
|
InfiniteTableHeaderCell,
|
|
@@ -17333,12 +17361,18 @@ var ScrollListener = class {
|
|
|
17333
17361
|
};
|
|
17334
17362
|
|
|
17335
17363
|
// src/components/InfiniteTable/state/computeColumnGroupsDepths.ts
|
|
17336
|
-
function computeColumnGroupsDepths(columnGroups) {
|
|
17364
|
+
function computeColumnGroupsDepths(columnGroups, columnGroupVisibility) {
|
|
17337
17365
|
const map2 = /* @__PURE__ */ new Map();
|
|
17366
|
+
function isVisible(colGroupId) {
|
|
17367
|
+
return columnGroupVisibility[colGroupId] !== false;
|
|
17368
|
+
}
|
|
17338
17369
|
Object.keys(columnGroups).forEach((colGroupId) => {
|
|
17339
17370
|
const colGroup = columnGroups[colGroupId];
|
|
17340
17371
|
let parentGroupId = colGroup.columnGroup;
|
|
17341
17372
|
let depth = 0;
|
|
17373
|
+
if (!isVisible(colGroupId)) {
|
|
17374
|
+
depth = -1;
|
|
17375
|
+
}
|
|
17342
17376
|
while (parentGroupId) {
|
|
17343
17377
|
const parent = columnGroups[parentGroupId];
|
|
17344
17378
|
if (!parent) {
|
|
@@ -17347,7 +17381,9 @@ function computeColumnGroupsDepths(columnGroups) {
|
|
|
17347
17381
|
}
|
|
17348
17382
|
break;
|
|
17349
17383
|
}
|
|
17350
|
-
|
|
17384
|
+
if (isVisible(parentGroupId)) {
|
|
17385
|
+
depth++;
|
|
17386
|
+
}
|
|
17351
17387
|
parentGroupId = parent.columnGroup;
|
|
17352
17388
|
}
|
|
17353
17389
|
map2.set(colGroupId, depth);
|
|
@@ -17364,6 +17400,7 @@ function getRowDetailRendererFromComponent(RowDetail) {
|
|
|
17364
17400
|
}
|
|
17365
17401
|
|
|
17366
17402
|
// src/components/InfiniteTable/state/getInitialState.ts
|
|
17403
|
+
var EMPTY_OBJECT = {};
|
|
17367
17404
|
function createRenderer2(brain) {
|
|
17368
17405
|
const renderer = new ReactHeadlessTableRenderer(brain);
|
|
17369
17406
|
const onRenderUpdater = buildSubscriptionCallback();
|
|
@@ -17511,6 +17548,7 @@ var forwardProps4 = (_setupState) => {
|
|
|
17511
17548
|
onScrollbarsChange: 1,
|
|
17512
17549
|
autoSizeColumnsKey: 1,
|
|
17513
17550
|
columnDefaultFlex: 1,
|
|
17551
|
+
draggableColumnsRestrictTo: (draggableColumnsRestrictTo) => draggableColumnsRestrictTo != null ? draggableColumnsRestrictTo : false,
|
|
17514
17552
|
columnMenuRealignDelay: (columnMenuRealignDelay) => columnMenuRealignDelay != null ? columnMenuRealignDelay : 50,
|
|
17515
17553
|
scrollStopDelay: (scrollStopDelay) => scrollStopDelay != null ? scrollStopDelay : 250,
|
|
17516
17554
|
viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
|
|
@@ -17549,7 +17587,8 @@ var forwardProps4 = (_setupState) => {
|
|
|
17549
17587
|
rowDetailHeight: (rowDetailHeight) => typeof rowDetailHeight === "number" || typeof rowDetailHeight === "function" ? rowDetailHeight : 300,
|
|
17550
17588
|
columnHeaderHeight: (columnHeaderHeight) => typeof columnHeaderHeight === "number" ? columnHeaderHeight : 30,
|
|
17551
17589
|
columns: 1,
|
|
17552
|
-
columnVisibility: (columnVisibility) => columnVisibility != null ? columnVisibility :
|
|
17590
|
+
columnVisibility: (columnVisibility) => columnVisibility != null ? columnVisibility : EMPTY_OBJECT,
|
|
17591
|
+
columnGroupVisibility: (columnGroupVisibility) => columnGroupVisibility != null ? columnGroupVisibility : EMPTY_OBJECT,
|
|
17553
17592
|
// TODO check if columnPinning works when the value for a pinned col is `true` instead of `"start"`
|
|
17554
17593
|
columnSizing: (columnSizing) => columnSizing || {},
|
|
17555
17594
|
columnTypes: (columnTypes) => columnTypes || {},
|
|
@@ -17630,7 +17669,10 @@ var mapPropsToState = (params) => {
|
|
|
17630
17669
|
var _a, _b, _c, _d, _e;
|
|
17631
17670
|
const { props, state, oldState, parentState } = params;
|
|
17632
17671
|
const computedColumnGroups = state.pivotColumnGroups || state.columnGroups;
|
|
17633
|
-
const columnGroupsDepthsMap = state.columnGroups && state.columnGroups != (oldState == null ? void 0 : oldState.columnGroups) || state.pivotColumnGroups && state.pivotColumnGroups != (oldState == null ? void 0 : oldState.pivotColumnGroups) ? computeColumnGroupsDepths(
|
|
17672
|
+
const columnGroupsDepthsMap = state.columnGroups && state.columnGroups != (oldState == null ? void 0 : oldState.columnGroups) || state.columnGroups && state.columnGroupVisibility != (oldState == null ? void 0 : oldState.columnGroupVisibility) || state.pivotColumnGroups && state.pivotColumnGroups != (oldState == null ? void 0 : oldState.pivotColumnGroups) ? computeColumnGroupsDepths(
|
|
17673
|
+
computedColumnGroups,
|
|
17674
|
+
state.columnGroupVisibility
|
|
17675
|
+
) : state.columnGroupsDepthsMap;
|
|
17634
17676
|
const groupBy = parentState == null ? void 0 : parentState.groupBy;
|
|
17635
17677
|
const groupRenderStrategy = getGroupRenderStrategy({
|
|
17636
17678
|
groupRenderStrategy: props.groupRenderStrategy,
|
|
@@ -17685,7 +17727,11 @@ var mapPropsToState = (params) => {
|
|
|
17685
17727
|
keyboardNavigation: (_c = props.keyboardNavigation) != null ? _c : state.activeCellIndex != null ? "cell" : state.activeRowIndex != null ? "row" : "cell",
|
|
17686
17728
|
columnHeaderCssEllipsis: (_e = (_d = props.columnHeaderCssEllipsis) != null ? _d : props.columnCssEllipsis) != null ? _e : true,
|
|
17687
17729
|
columnGroupsDepthsMap,
|
|
17688
|
-
columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ?
|
|
17730
|
+
columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ? (
|
|
17731
|
+
// was 0, but after implementing columnGroupVisibility
|
|
17732
|
+
// it can be -1, to denote that no column group is visible
|
|
17733
|
+
Math.max(...columnGroupsDepthsMap.values(), -1)
|
|
17734
|
+
) : state.columnGroupsMaxDepth,
|
|
17689
17735
|
computedColumnGroups,
|
|
17690
17736
|
rowHeightCSSVar: typeof props.rowHeight === "string" ? props.rowHeight : "",
|
|
17691
17737
|
rowDetailHeightCSSVar: typeof props.rowDetailHeight === "string" ? props.rowDetailHeight : "",
|
|
@@ -18611,7 +18657,11 @@ function useComputed() {
|
|
|
18611
18657
|
const computedPinnedEndOverflow = computedPinnedEndWidth ? computedPinnedEndColumnsWidth > computedPinnedEndWidth : false;
|
|
18612
18658
|
const [multiRowSelector] = (0, import_react49.useState)(() => {
|
|
18613
18659
|
const multiRowSelector2 = new MultiRowSelector({
|
|
18614
|
-
getIdForIndex: (index) =>
|
|
18660
|
+
getIdForIndex: (index) => {
|
|
18661
|
+
var _a2;
|
|
18662
|
+
const dataItem = getDataSourceState().dataArray[index];
|
|
18663
|
+
return (_a2 = dataItem == null ? void 0 : dataItem.id) != null ? _a2 : -1;
|
|
18664
|
+
}
|
|
18615
18665
|
});
|
|
18616
18666
|
return multiRowSelector2;
|
|
18617
18667
|
});
|
|
@@ -18843,7 +18893,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
18843
18893
|
}
|
|
18844
18894
|
let valid2 = isValidLicense(licenseKey, {
|
|
18845
18895
|
publishedAt: 1624970570587,
|
|
18846
|
-
version: "4.3.
|
|
18896
|
+
version: "4.3.6"
|
|
18847
18897
|
});
|
|
18848
18898
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
18849
18899
|
return true;
|
package/index.dev.mjs
CHANGED
|
@@ -6913,6 +6913,7 @@ function reorderColumnsOnDrag(params) {
|
|
|
6913
6913
|
infiniteDOMNode,
|
|
6914
6914
|
brain,
|
|
6915
6915
|
dragColumnHeaderTargetRect,
|
|
6916
|
+
draggableColumnsRestrictTo,
|
|
6916
6917
|
tableRect,
|
|
6917
6918
|
setProxyPosition,
|
|
6918
6919
|
api: imperativeApi
|
|
@@ -6941,8 +6942,9 @@ function reorderColumnsOnDrag(params) {
|
|
|
6941
6942
|
const scrollLeft2 = brain.getScrollPosition().scrollLeft;
|
|
6942
6943
|
return col.computedOffset >= scrollLeft2 + getCurrentPinnedWidth("start") && col.computedOffset + col.computedWidth < scrollLeft2 + tableRect.width - getCurrentPinnedWidth("end");
|
|
6943
6944
|
}
|
|
6944
|
-
const getBreakPoints = (columns) => {
|
|
6945
|
-
const
|
|
6945
|
+
const getBreakPoints = (columns, options) => {
|
|
6946
|
+
const { restrictToParentGroup, dragColumn: dragColumn2 } = options;
|
|
6947
|
+
let breakpoints = [];
|
|
6946
6948
|
columns.forEach((c) => {
|
|
6947
6949
|
const b = {
|
|
6948
6950
|
columnId: c.id,
|
|
@@ -6956,6 +6958,26 @@ function reorderColumnsOnDrag(params) {
|
|
|
6956
6958
|
breakpoints.push(b);
|
|
6957
6959
|
}
|
|
6958
6960
|
});
|
|
6961
|
+
if (restrictToParentGroup) {
|
|
6962
|
+
let checkAllowedColumnsInDirection2 = function(colIndex, dir2, disallowedTargets2) {
|
|
6963
|
+
const col = columns[colIndex];
|
|
6964
|
+
if (!col) {
|
|
6965
|
+
return;
|
|
6966
|
+
}
|
|
6967
|
+
if (col.columnGroup !== dragColumn2.columnGroup) {
|
|
6968
|
+
disallowedTargets2.add(col.id);
|
|
6969
|
+
}
|
|
6970
|
+
checkAllowedColumnsInDirection2(colIndex + dir2, dir2, disallowedTargets2);
|
|
6971
|
+
};
|
|
6972
|
+
var checkAllowedColumnsInDirection = checkAllowedColumnsInDirection2;
|
|
6973
|
+
const dragColIndex = dragColumn2.computedVisibleIndex;
|
|
6974
|
+
const disallowedTargets = /* @__PURE__ */ new Set();
|
|
6975
|
+
checkAllowedColumnsInDirection2(dragColIndex - 1, -1, disallowedTargets);
|
|
6976
|
+
checkAllowedColumnsInDirection2(dragColIndex + 1, 1, disallowedTargets);
|
|
6977
|
+
breakpoints = breakpoints.filter((b) => {
|
|
6978
|
+
return !disallowedTargets.has(b.columnId);
|
|
6979
|
+
});
|
|
6980
|
+
}
|
|
6959
6981
|
return breakpoints;
|
|
6960
6982
|
};
|
|
6961
6983
|
const initialPinnedStartCount = computedPinnedStartColumns.length;
|
|
@@ -7134,7 +7156,10 @@ function reorderColumnsOnDrag(params) {
|
|
|
7134
7156
|
imperativeApi.scrollLeft = value;
|
|
7135
7157
|
}
|
|
7136
7158
|
});
|
|
7137
|
-
const breakpoints = getBreakPoints(computedVisibleColumns
|
|
7159
|
+
const breakpoints = getBreakPoints(computedVisibleColumns, {
|
|
7160
|
+
dragColumn,
|
|
7161
|
+
restrictToParentGroup: draggableColumnsRestrictTo === "group"
|
|
7162
|
+
});
|
|
7138
7163
|
let currentPos = dir === -1 ? dragColumn.computedOffset + diffX : dragColumn.computedOffset + dragColumn.computedWidth + diffX;
|
|
7139
7164
|
let idx = (0, import_binary_search2.default)(
|
|
7140
7165
|
breakpoints,
|
|
@@ -7293,7 +7318,7 @@ var useColumnPointerEvents = ({
|
|
|
7293
7318
|
if (((_a2 = e.target) == null ? void 0 : _a2.tagName) === "INPUT") {
|
|
7294
7319
|
return;
|
|
7295
7320
|
}
|
|
7296
|
-
const { brain } = getState();
|
|
7321
|
+
const { brain, draggableColumnsRestrictTo } = getState();
|
|
7297
7322
|
const {
|
|
7298
7323
|
computedVisibleColumns,
|
|
7299
7324
|
computedVisibleColumnsMap,
|
|
@@ -7315,6 +7340,7 @@ var useColumnPointerEvents = ({
|
|
|
7315
7340
|
let didDragAtLeastOnce = false;
|
|
7316
7341
|
const dragger = reorderColumnsOnDrag({
|
|
7317
7342
|
brain,
|
|
7343
|
+
draggableColumnsRestrictTo,
|
|
7318
7344
|
columnOffsetAtIndexCSSVar: columnOffsetAtIndex4,
|
|
7319
7345
|
columnWidthAtIndexCSSVar: columnWidthAtIndex3,
|
|
7320
7346
|
computedPinnedEndColumns,
|
|
@@ -9923,6 +9949,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
9923
9949
|
} = props;
|
|
9924
9950
|
const {
|
|
9925
9951
|
computed,
|
|
9952
|
+
getState,
|
|
9926
9953
|
state: { headerBrain, headerOptions, showColumnFilters }
|
|
9927
9954
|
} = useInfiniteTable();
|
|
9928
9955
|
const { computedColumnsMap } = computed;
|
|
@@ -9975,7 +10002,8 @@ function InfiniteTableHeaderFn(props) {
|
|
|
9975
10002
|
computedWidth: colGroupItem.computedWidth,
|
|
9976
10003
|
groupOffset: colGroupItem.groupOffset
|
|
9977
10004
|
});
|
|
9978
|
-
|
|
10005
|
+
const visible = getState().columnGroupVisibility[colGroupItem.id] !== false;
|
|
10006
|
+
return visible ? /* @__PURE__ */ React46.createElement(
|
|
9979
10007
|
InfiniteTableHeaderGroup,
|
|
9980
10008
|
{
|
|
9981
10009
|
bodyBrain,
|
|
@@ -9986,7 +10014,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
9986
10014
|
height,
|
|
9987
10015
|
columnGroup: computedColumnGroup
|
|
9988
10016
|
}
|
|
9989
|
-
);
|
|
10017
|
+
) : null;
|
|
9990
10018
|
}
|
|
9991
10019
|
return /* @__PURE__ */ React46.createElement(
|
|
9992
10020
|
InfiniteTableHeaderCell,
|
|
@@ -17305,12 +17333,18 @@ var ScrollListener = class {
|
|
|
17305
17333
|
};
|
|
17306
17334
|
|
|
17307
17335
|
// src/components/InfiniteTable/state/computeColumnGroupsDepths.ts
|
|
17308
|
-
function computeColumnGroupsDepths(columnGroups) {
|
|
17336
|
+
function computeColumnGroupsDepths(columnGroups, columnGroupVisibility) {
|
|
17309
17337
|
const map2 = /* @__PURE__ */ new Map();
|
|
17338
|
+
function isVisible(colGroupId) {
|
|
17339
|
+
return columnGroupVisibility[colGroupId] !== false;
|
|
17340
|
+
}
|
|
17310
17341
|
Object.keys(columnGroups).forEach((colGroupId) => {
|
|
17311
17342
|
const colGroup = columnGroups[colGroupId];
|
|
17312
17343
|
let parentGroupId = colGroup.columnGroup;
|
|
17313
17344
|
let depth = 0;
|
|
17345
|
+
if (!isVisible(colGroupId)) {
|
|
17346
|
+
depth = -1;
|
|
17347
|
+
}
|
|
17314
17348
|
while (parentGroupId) {
|
|
17315
17349
|
const parent = columnGroups[parentGroupId];
|
|
17316
17350
|
if (!parent) {
|
|
@@ -17319,7 +17353,9 @@ function computeColumnGroupsDepths(columnGroups) {
|
|
|
17319
17353
|
}
|
|
17320
17354
|
break;
|
|
17321
17355
|
}
|
|
17322
|
-
|
|
17356
|
+
if (isVisible(parentGroupId)) {
|
|
17357
|
+
depth++;
|
|
17358
|
+
}
|
|
17323
17359
|
parentGroupId = parent.columnGroup;
|
|
17324
17360
|
}
|
|
17325
17361
|
map2.set(colGroupId, depth);
|
|
@@ -17336,6 +17372,7 @@ function getRowDetailRendererFromComponent(RowDetail) {
|
|
|
17336
17372
|
}
|
|
17337
17373
|
|
|
17338
17374
|
// src/components/InfiniteTable/state/getInitialState.ts
|
|
17375
|
+
var EMPTY_OBJECT = {};
|
|
17339
17376
|
function createRenderer2(brain) {
|
|
17340
17377
|
const renderer = new ReactHeadlessTableRenderer(brain);
|
|
17341
17378
|
const onRenderUpdater = buildSubscriptionCallback();
|
|
@@ -17483,6 +17520,7 @@ var forwardProps4 = (_setupState) => {
|
|
|
17483
17520
|
onScrollbarsChange: 1,
|
|
17484
17521
|
autoSizeColumnsKey: 1,
|
|
17485
17522
|
columnDefaultFlex: 1,
|
|
17523
|
+
draggableColumnsRestrictTo: (draggableColumnsRestrictTo) => draggableColumnsRestrictTo != null ? draggableColumnsRestrictTo : false,
|
|
17486
17524
|
columnMenuRealignDelay: (columnMenuRealignDelay) => columnMenuRealignDelay != null ? columnMenuRealignDelay : 50,
|
|
17487
17525
|
scrollStopDelay: (scrollStopDelay) => scrollStopDelay != null ? scrollStopDelay : 250,
|
|
17488
17526
|
viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
|
|
@@ -17521,7 +17559,8 @@ var forwardProps4 = (_setupState) => {
|
|
|
17521
17559
|
rowDetailHeight: (rowDetailHeight) => typeof rowDetailHeight === "number" || typeof rowDetailHeight === "function" ? rowDetailHeight : 300,
|
|
17522
17560
|
columnHeaderHeight: (columnHeaderHeight) => typeof columnHeaderHeight === "number" ? columnHeaderHeight : 30,
|
|
17523
17561
|
columns: 1,
|
|
17524
|
-
columnVisibility: (columnVisibility) => columnVisibility != null ? columnVisibility :
|
|
17562
|
+
columnVisibility: (columnVisibility) => columnVisibility != null ? columnVisibility : EMPTY_OBJECT,
|
|
17563
|
+
columnGroupVisibility: (columnGroupVisibility) => columnGroupVisibility != null ? columnGroupVisibility : EMPTY_OBJECT,
|
|
17525
17564
|
// TODO check if columnPinning works when the value for a pinned col is `true` instead of `"start"`
|
|
17526
17565
|
columnSizing: (columnSizing) => columnSizing || {},
|
|
17527
17566
|
columnTypes: (columnTypes) => columnTypes || {},
|
|
@@ -17602,7 +17641,10 @@ var mapPropsToState = (params) => {
|
|
|
17602
17641
|
var _a, _b, _c, _d, _e;
|
|
17603
17642
|
const { props, state, oldState, parentState } = params;
|
|
17604
17643
|
const computedColumnGroups = state.pivotColumnGroups || state.columnGroups;
|
|
17605
|
-
const columnGroupsDepthsMap = state.columnGroups && state.columnGroups != (oldState == null ? void 0 : oldState.columnGroups) || state.pivotColumnGroups && state.pivotColumnGroups != (oldState == null ? void 0 : oldState.pivotColumnGroups) ? computeColumnGroupsDepths(
|
|
17644
|
+
const columnGroupsDepthsMap = state.columnGroups && state.columnGroups != (oldState == null ? void 0 : oldState.columnGroups) || state.columnGroups && state.columnGroupVisibility != (oldState == null ? void 0 : oldState.columnGroupVisibility) || state.pivotColumnGroups && state.pivotColumnGroups != (oldState == null ? void 0 : oldState.pivotColumnGroups) ? computeColumnGroupsDepths(
|
|
17645
|
+
computedColumnGroups,
|
|
17646
|
+
state.columnGroupVisibility
|
|
17647
|
+
) : state.columnGroupsDepthsMap;
|
|
17606
17648
|
const groupBy = parentState == null ? void 0 : parentState.groupBy;
|
|
17607
17649
|
const groupRenderStrategy = getGroupRenderStrategy({
|
|
17608
17650
|
groupRenderStrategy: props.groupRenderStrategy,
|
|
@@ -17657,7 +17699,11 @@ var mapPropsToState = (params) => {
|
|
|
17657
17699
|
keyboardNavigation: (_c = props.keyboardNavigation) != null ? _c : state.activeCellIndex != null ? "cell" : state.activeRowIndex != null ? "row" : "cell",
|
|
17658
17700
|
columnHeaderCssEllipsis: (_e = (_d = props.columnHeaderCssEllipsis) != null ? _d : props.columnCssEllipsis) != null ? _e : true,
|
|
17659
17701
|
columnGroupsDepthsMap,
|
|
17660
|
-
columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ?
|
|
17702
|
+
columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ? (
|
|
17703
|
+
// was 0, but after implementing columnGroupVisibility
|
|
17704
|
+
// it can be -1, to denote that no column group is visible
|
|
17705
|
+
Math.max(...columnGroupsDepthsMap.values(), -1)
|
|
17706
|
+
) : state.columnGroupsMaxDepth,
|
|
17661
17707
|
computedColumnGroups,
|
|
17662
17708
|
rowHeightCSSVar: typeof props.rowHeight === "string" ? props.rowHeight : "",
|
|
17663
17709
|
rowDetailHeightCSSVar: typeof props.rowDetailHeight === "string" ? props.rowDetailHeight : "",
|
|
@@ -18583,7 +18629,11 @@ function useComputed() {
|
|
|
18583
18629
|
const computedPinnedEndOverflow = computedPinnedEndWidth ? computedPinnedEndColumnsWidth > computedPinnedEndWidth : false;
|
|
18584
18630
|
const [multiRowSelector] = useState17(() => {
|
|
18585
18631
|
const multiRowSelector2 = new MultiRowSelector({
|
|
18586
|
-
getIdForIndex: (index) =>
|
|
18632
|
+
getIdForIndex: (index) => {
|
|
18633
|
+
var _a2;
|
|
18634
|
+
const dataItem = getDataSourceState().dataArray[index];
|
|
18635
|
+
return (_a2 = dataItem == null ? void 0 : dataItem.id) != null ? _a2 : -1;
|
|
18636
|
+
}
|
|
18587
18637
|
});
|
|
18588
18638
|
return multiRowSelector2;
|
|
18589
18639
|
});
|
|
@@ -18815,7 +18865,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
18815
18865
|
}
|
|
18816
18866
|
let valid2 = isValidLicense(licenseKey, {
|
|
18817
18867
|
publishedAt: 1624970570587,
|
|
18818
|
-
version: "4.3.
|
|
18868
|
+
version: "4.3.6"
|
|
18819
18869
|
});
|
|
18820
18870
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
18821
18871
|
return true;
|
package/index.js
CHANGED
|
@@ -6950,6 +6950,7 @@ function reorderColumnsOnDrag(params) {
|
|
|
6950
6950
|
infiniteDOMNode,
|
|
6951
6951
|
brain,
|
|
6952
6952
|
dragColumnHeaderTargetRect,
|
|
6953
|
+
draggableColumnsRestrictTo,
|
|
6953
6954
|
tableRect,
|
|
6954
6955
|
setProxyPosition,
|
|
6955
6956
|
api: imperativeApi
|
|
@@ -6978,8 +6979,9 @@ function reorderColumnsOnDrag(params) {
|
|
|
6978
6979
|
const scrollLeft2 = brain.getScrollPosition().scrollLeft;
|
|
6979
6980
|
return col.computedOffset >= scrollLeft2 + getCurrentPinnedWidth("start") && col.computedOffset + col.computedWidth < scrollLeft2 + tableRect.width - getCurrentPinnedWidth("end");
|
|
6980
6981
|
}
|
|
6981
|
-
const getBreakPoints = (columns) => {
|
|
6982
|
-
const
|
|
6982
|
+
const getBreakPoints = (columns, options) => {
|
|
6983
|
+
const { restrictToParentGroup, dragColumn: dragColumn2 } = options;
|
|
6984
|
+
let breakpoints = [];
|
|
6983
6985
|
columns.forEach((c) => {
|
|
6984
6986
|
const b = {
|
|
6985
6987
|
columnId: c.id,
|
|
@@ -6993,6 +6995,26 @@ function reorderColumnsOnDrag(params) {
|
|
|
6993
6995
|
breakpoints.push(b);
|
|
6994
6996
|
}
|
|
6995
6997
|
});
|
|
6998
|
+
if (restrictToParentGroup) {
|
|
6999
|
+
let checkAllowedColumnsInDirection2 = function(colIndex, dir2, disallowedTargets2) {
|
|
7000
|
+
const col = columns[colIndex];
|
|
7001
|
+
if (!col) {
|
|
7002
|
+
return;
|
|
7003
|
+
}
|
|
7004
|
+
if (col.columnGroup !== dragColumn2.columnGroup) {
|
|
7005
|
+
disallowedTargets2.add(col.id);
|
|
7006
|
+
}
|
|
7007
|
+
checkAllowedColumnsInDirection2(colIndex + dir2, dir2, disallowedTargets2);
|
|
7008
|
+
};
|
|
7009
|
+
var checkAllowedColumnsInDirection = checkAllowedColumnsInDirection2;
|
|
7010
|
+
const dragColIndex = dragColumn2.computedVisibleIndex;
|
|
7011
|
+
const disallowedTargets = /* @__PURE__ */ new Set();
|
|
7012
|
+
checkAllowedColumnsInDirection2(dragColIndex - 1, -1, disallowedTargets);
|
|
7013
|
+
checkAllowedColumnsInDirection2(dragColIndex + 1, 1, disallowedTargets);
|
|
7014
|
+
breakpoints = breakpoints.filter((b) => {
|
|
7015
|
+
return !disallowedTargets.has(b.columnId);
|
|
7016
|
+
});
|
|
7017
|
+
}
|
|
6996
7018
|
return breakpoints;
|
|
6997
7019
|
};
|
|
6998
7020
|
const initialPinnedStartCount = computedPinnedStartColumns.length;
|
|
@@ -7171,7 +7193,10 @@ function reorderColumnsOnDrag(params) {
|
|
|
7171
7193
|
imperativeApi.scrollLeft = value;
|
|
7172
7194
|
}
|
|
7173
7195
|
});
|
|
7174
|
-
const breakpoints = getBreakPoints(computedVisibleColumns
|
|
7196
|
+
const breakpoints = getBreakPoints(computedVisibleColumns, {
|
|
7197
|
+
dragColumn,
|
|
7198
|
+
restrictToParentGroup: draggableColumnsRestrictTo === "group"
|
|
7199
|
+
});
|
|
7175
7200
|
let currentPos = dir === -1 ? dragColumn.computedOffset + diffX : dragColumn.computedOffset + dragColumn.computedWidth + diffX;
|
|
7176
7201
|
let idx = (0, import_binary_search2.default)(
|
|
7177
7202
|
breakpoints,
|
|
@@ -7330,7 +7355,7 @@ var useColumnPointerEvents = ({
|
|
|
7330
7355
|
if (((_a2 = e.target) == null ? void 0 : _a2.tagName) === "INPUT") {
|
|
7331
7356
|
return;
|
|
7332
7357
|
}
|
|
7333
|
-
const { brain } = getState();
|
|
7358
|
+
const { brain, draggableColumnsRestrictTo } = getState();
|
|
7334
7359
|
const {
|
|
7335
7360
|
computedVisibleColumns,
|
|
7336
7361
|
computedVisibleColumnsMap,
|
|
@@ -7352,6 +7377,7 @@ var useColumnPointerEvents = ({
|
|
|
7352
7377
|
let didDragAtLeastOnce = false;
|
|
7353
7378
|
const dragger = reorderColumnsOnDrag({
|
|
7354
7379
|
brain,
|
|
7380
|
+
draggableColumnsRestrictTo,
|
|
7355
7381
|
columnOffsetAtIndexCSSVar: columnOffsetAtIndex4,
|
|
7356
7382
|
columnWidthAtIndexCSSVar: columnWidthAtIndex3,
|
|
7357
7383
|
computedPinnedEndColumns,
|
|
@@ -9960,6 +9986,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
9960
9986
|
} = props;
|
|
9961
9987
|
const {
|
|
9962
9988
|
computed,
|
|
9989
|
+
getState,
|
|
9963
9990
|
state: { headerBrain, headerOptions, showColumnFilters }
|
|
9964
9991
|
} = useInfiniteTable();
|
|
9965
9992
|
const { computedColumnsMap } = computed;
|
|
@@ -10012,7 +10039,8 @@ function InfiniteTableHeaderFn(props) {
|
|
|
10012
10039
|
computedWidth: colGroupItem.computedWidth,
|
|
10013
10040
|
groupOffset: colGroupItem.groupOffset
|
|
10014
10041
|
});
|
|
10015
|
-
|
|
10042
|
+
const visible = getState().columnGroupVisibility[colGroupItem.id] !== false;
|
|
10043
|
+
return visible ? /* @__PURE__ */ React46.createElement(
|
|
10016
10044
|
InfiniteTableHeaderGroup,
|
|
10017
10045
|
{
|
|
10018
10046
|
bodyBrain,
|
|
@@ -10023,7 +10051,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
10023
10051
|
height,
|
|
10024
10052
|
columnGroup: computedColumnGroup
|
|
10025
10053
|
}
|
|
10026
|
-
);
|
|
10054
|
+
) : null;
|
|
10027
10055
|
}
|
|
10028
10056
|
return /* @__PURE__ */ React46.createElement(
|
|
10029
10057
|
InfiniteTableHeaderCell,
|
|
@@ -17333,12 +17361,18 @@ var ScrollListener = class {
|
|
|
17333
17361
|
};
|
|
17334
17362
|
|
|
17335
17363
|
// src/components/InfiniteTable/state/computeColumnGroupsDepths.ts
|
|
17336
|
-
function computeColumnGroupsDepths(columnGroups) {
|
|
17364
|
+
function computeColumnGroupsDepths(columnGroups, columnGroupVisibility) {
|
|
17337
17365
|
const map2 = /* @__PURE__ */ new Map();
|
|
17366
|
+
function isVisible(colGroupId) {
|
|
17367
|
+
return columnGroupVisibility[colGroupId] !== false;
|
|
17368
|
+
}
|
|
17338
17369
|
Object.keys(columnGroups).forEach((colGroupId) => {
|
|
17339
17370
|
const colGroup = columnGroups[colGroupId];
|
|
17340
17371
|
let parentGroupId = colGroup.columnGroup;
|
|
17341
17372
|
let depth = 0;
|
|
17373
|
+
if (!isVisible(colGroupId)) {
|
|
17374
|
+
depth = -1;
|
|
17375
|
+
}
|
|
17342
17376
|
while (parentGroupId) {
|
|
17343
17377
|
const parent = columnGroups[parentGroupId];
|
|
17344
17378
|
if (!parent) {
|
|
@@ -17347,7 +17381,9 @@ function computeColumnGroupsDepths(columnGroups) {
|
|
|
17347
17381
|
}
|
|
17348
17382
|
break;
|
|
17349
17383
|
}
|
|
17350
|
-
|
|
17384
|
+
if (isVisible(parentGroupId)) {
|
|
17385
|
+
depth++;
|
|
17386
|
+
}
|
|
17351
17387
|
parentGroupId = parent.columnGroup;
|
|
17352
17388
|
}
|
|
17353
17389
|
map2.set(colGroupId, depth);
|
|
@@ -17364,6 +17400,7 @@ function getRowDetailRendererFromComponent(RowDetail) {
|
|
|
17364
17400
|
}
|
|
17365
17401
|
|
|
17366
17402
|
// src/components/InfiniteTable/state/getInitialState.ts
|
|
17403
|
+
var EMPTY_OBJECT = {};
|
|
17367
17404
|
function createRenderer2(brain) {
|
|
17368
17405
|
const renderer = new ReactHeadlessTableRenderer(brain);
|
|
17369
17406
|
const onRenderUpdater = buildSubscriptionCallback();
|
|
@@ -17511,6 +17548,7 @@ var forwardProps4 = (_setupState) => {
|
|
|
17511
17548
|
onScrollbarsChange: 1,
|
|
17512
17549
|
autoSizeColumnsKey: 1,
|
|
17513
17550
|
columnDefaultFlex: 1,
|
|
17551
|
+
draggableColumnsRestrictTo: (draggableColumnsRestrictTo) => draggableColumnsRestrictTo != null ? draggableColumnsRestrictTo : false,
|
|
17514
17552
|
columnMenuRealignDelay: (columnMenuRealignDelay) => columnMenuRealignDelay != null ? columnMenuRealignDelay : 50,
|
|
17515
17553
|
scrollStopDelay: (scrollStopDelay) => scrollStopDelay != null ? scrollStopDelay : 250,
|
|
17516
17554
|
viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
|
|
@@ -17549,7 +17587,8 @@ var forwardProps4 = (_setupState) => {
|
|
|
17549
17587
|
rowDetailHeight: (rowDetailHeight) => typeof rowDetailHeight === "number" || typeof rowDetailHeight === "function" ? rowDetailHeight : 300,
|
|
17550
17588
|
columnHeaderHeight: (columnHeaderHeight) => typeof columnHeaderHeight === "number" ? columnHeaderHeight : 30,
|
|
17551
17589
|
columns: 1,
|
|
17552
|
-
columnVisibility: (columnVisibility) => columnVisibility != null ? columnVisibility :
|
|
17590
|
+
columnVisibility: (columnVisibility) => columnVisibility != null ? columnVisibility : EMPTY_OBJECT,
|
|
17591
|
+
columnGroupVisibility: (columnGroupVisibility) => columnGroupVisibility != null ? columnGroupVisibility : EMPTY_OBJECT,
|
|
17553
17592
|
// TODO check if columnPinning works when the value for a pinned col is `true` instead of `"start"`
|
|
17554
17593
|
columnSizing: (columnSizing) => columnSizing || {},
|
|
17555
17594
|
columnTypes: (columnTypes) => columnTypes || {},
|
|
@@ -17630,7 +17669,10 @@ var mapPropsToState = (params) => {
|
|
|
17630
17669
|
var _a, _b, _c, _d, _e;
|
|
17631
17670
|
const { props, state, oldState, parentState } = params;
|
|
17632
17671
|
const computedColumnGroups = state.pivotColumnGroups || state.columnGroups;
|
|
17633
|
-
const columnGroupsDepthsMap = state.columnGroups && state.columnGroups != (oldState == null ? void 0 : oldState.columnGroups) || state.pivotColumnGroups && state.pivotColumnGroups != (oldState == null ? void 0 : oldState.pivotColumnGroups) ? computeColumnGroupsDepths(
|
|
17672
|
+
const columnGroupsDepthsMap = state.columnGroups && state.columnGroups != (oldState == null ? void 0 : oldState.columnGroups) || state.columnGroups && state.columnGroupVisibility != (oldState == null ? void 0 : oldState.columnGroupVisibility) || state.pivotColumnGroups && state.pivotColumnGroups != (oldState == null ? void 0 : oldState.pivotColumnGroups) ? computeColumnGroupsDepths(
|
|
17673
|
+
computedColumnGroups,
|
|
17674
|
+
state.columnGroupVisibility
|
|
17675
|
+
) : state.columnGroupsDepthsMap;
|
|
17634
17676
|
const groupBy = parentState == null ? void 0 : parentState.groupBy;
|
|
17635
17677
|
const groupRenderStrategy = getGroupRenderStrategy({
|
|
17636
17678
|
groupRenderStrategy: props.groupRenderStrategy,
|
|
@@ -17685,7 +17727,11 @@ var mapPropsToState = (params) => {
|
|
|
17685
17727
|
keyboardNavigation: (_c = props.keyboardNavigation) != null ? _c : state.activeCellIndex != null ? "cell" : state.activeRowIndex != null ? "row" : "cell",
|
|
17686
17728
|
columnHeaderCssEllipsis: (_e = (_d = props.columnHeaderCssEllipsis) != null ? _d : props.columnCssEllipsis) != null ? _e : true,
|
|
17687
17729
|
columnGroupsDepthsMap,
|
|
17688
|
-
columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ?
|
|
17730
|
+
columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ? (
|
|
17731
|
+
// was 0, but after implementing columnGroupVisibility
|
|
17732
|
+
// it can be -1, to denote that no column group is visible
|
|
17733
|
+
Math.max(...columnGroupsDepthsMap.values(), -1)
|
|
17734
|
+
) : state.columnGroupsMaxDepth,
|
|
17689
17735
|
computedColumnGroups,
|
|
17690
17736
|
rowHeightCSSVar: typeof props.rowHeight === "string" ? props.rowHeight : "",
|
|
17691
17737
|
rowDetailHeightCSSVar: typeof props.rowDetailHeight === "string" ? props.rowDetailHeight : "",
|
|
@@ -18611,7 +18657,11 @@ function useComputed() {
|
|
|
18611
18657
|
const computedPinnedEndOverflow = computedPinnedEndWidth ? computedPinnedEndColumnsWidth > computedPinnedEndWidth : false;
|
|
18612
18658
|
const [multiRowSelector] = (0, import_react49.useState)(() => {
|
|
18613
18659
|
const multiRowSelector2 = new MultiRowSelector({
|
|
18614
|
-
getIdForIndex: (index) =>
|
|
18660
|
+
getIdForIndex: (index) => {
|
|
18661
|
+
var _a2;
|
|
18662
|
+
const dataItem = getDataSourceState().dataArray[index];
|
|
18663
|
+
return (_a2 = dataItem == null ? void 0 : dataItem.id) != null ? _a2 : -1;
|
|
18664
|
+
}
|
|
18615
18665
|
});
|
|
18616
18666
|
return multiRowSelector2;
|
|
18617
18667
|
});
|
|
@@ -18843,7 +18893,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
18843
18893
|
}
|
|
18844
18894
|
let valid2 = isValidLicense(licenseKey, {
|
|
18845
18895
|
publishedAt: 1624970570587,
|
|
18846
|
-
version: "4.3.
|
|
18896
|
+
version: "4.3.6"
|
|
18847
18897
|
});
|
|
18848
18898
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
18849
18899
|
return true;
|
package/index.mjs
CHANGED
|
@@ -6913,6 +6913,7 @@ function reorderColumnsOnDrag(params) {
|
|
|
6913
6913
|
infiniteDOMNode,
|
|
6914
6914
|
brain,
|
|
6915
6915
|
dragColumnHeaderTargetRect,
|
|
6916
|
+
draggableColumnsRestrictTo,
|
|
6916
6917
|
tableRect,
|
|
6917
6918
|
setProxyPosition,
|
|
6918
6919
|
api: imperativeApi
|
|
@@ -6941,8 +6942,9 @@ function reorderColumnsOnDrag(params) {
|
|
|
6941
6942
|
const scrollLeft2 = brain.getScrollPosition().scrollLeft;
|
|
6942
6943
|
return col.computedOffset >= scrollLeft2 + getCurrentPinnedWidth("start") && col.computedOffset + col.computedWidth < scrollLeft2 + tableRect.width - getCurrentPinnedWidth("end");
|
|
6943
6944
|
}
|
|
6944
|
-
const getBreakPoints = (columns) => {
|
|
6945
|
-
const
|
|
6945
|
+
const getBreakPoints = (columns, options) => {
|
|
6946
|
+
const { restrictToParentGroup, dragColumn: dragColumn2 } = options;
|
|
6947
|
+
let breakpoints = [];
|
|
6946
6948
|
columns.forEach((c) => {
|
|
6947
6949
|
const b = {
|
|
6948
6950
|
columnId: c.id,
|
|
@@ -6956,6 +6958,26 @@ function reorderColumnsOnDrag(params) {
|
|
|
6956
6958
|
breakpoints.push(b);
|
|
6957
6959
|
}
|
|
6958
6960
|
});
|
|
6961
|
+
if (restrictToParentGroup) {
|
|
6962
|
+
let checkAllowedColumnsInDirection2 = function(colIndex, dir2, disallowedTargets2) {
|
|
6963
|
+
const col = columns[colIndex];
|
|
6964
|
+
if (!col) {
|
|
6965
|
+
return;
|
|
6966
|
+
}
|
|
6967
|
+
if (col.columnGroup !== dragColumn2.columnGroup) {
|
|
6968
|
+
disallowedTargets2.add(col.id);
|
|
6969
|
+
}
|
|
6970
|
+
checkAllowedColumnsInDirection2(colIndex + dir2, dir2, disallowedTargets2);
|
|
6971
|
+
};
|
|
6972
|
+
var checkAllowedColumnsInDirection = checkAllowedColumnsInDirection2;
|
|
6973
|
+
const dragColIndex = dragColumn2.computedVisibleIndex;
|
|
6974
|
+
const disallowedTargets = /* @__PURE__ */ new Set();
|
|
6975
|
+
checkAllowedColumnsInDirection2(dragColIndex - 1, -1, disallowedTargets);
|
|
6976
|
+
checkAllowedColumnsInDirection2(dragColIndex + 1, 1, disallowedTargets);
|
|
6977
|
+
breakpoints = breakpoints.filter((b) => {
|
|
6978
|
+
return !disallowedTargets.has(b.columnId);
|
|
6979
|
+
});
|
|
6980
|
+
}
|
|
6959
6981
|
return breakpoints;
|
|
6960
6982
|
};
|
|
6961
6983
|
const initialPinnedStartCount = computedPinnedStartColumns.length;
|
|
@@ -7134,7 +7156,10 @@ function reorderColumnsOnDrag(params) {
|
|
|
7134
7156
|
imperativeApi.scrollLeft = value;
|
|
7135
7157
|
}
|
|
7136
7158
|
});
|
|
7137
|
-
const breakpoints = getBreakPoints(computedVisibleColumns
|
|
7159
|
+
const breakpoints = getBreakPoints(computedVisibleColumns, {
|
|
7160
|
+
dragColumn,
|
|
7161
|
+
restrictToParentGroup: draggableColumnsRestrictTo === "group"
|
|
7162
|
+
});
|
|
7138
7163
|
let currentPos = dir === -1 ? dragColumn.computedOffset + diffX : dragColumn.computedOffset + dragColumn.computedWidth + diffX;
|
|
7139
7164
|
let idx = (0, import_binary_search2.default)(
|
|
7140
7165
|
breakpoints,
|
|
@@ -7293,7 +7318,7 @@ var useColumnPointerEvents = ({
|
|
|
7293
7318
|
if (((_a2 = e.target) == null ? void 0 : _a2.tagName) === "INPUT") {
|
|
7294
7319
|
return;
|
|
7295
7320
|
}
|
|
7296
|
-
const { brain } = getState();
|
|
7321
|
+
const { brain, draggableColumnsRestrictTo } = getState();
|
|
7297
7322
|
const {
|
|
7298
7323
|
computedVisibleColumns,
|
|
7299
7324
|
computedVisibleColumnsMap,
|
|
@@ -7315,6 +7340,7 @@ var useColumnPointerEvents = ({
|
|
|
7315
7340
|
let didDragAtLeastOnce = false;
|
|
7316
7341
|
const dragger = reorderColumnsOnDrag({
|
|
7317
7342
|
brain,
|
|
7343
|
+
draggableColumnsRestrictTo,
|
|
7318
7344
|
columnOffsetAtIndexCSSVar: columnOffsetAtIndex4,
|
|
7319
7345
|
columnWidthAtIndexCSSVar: columnWidthAtIndex3,
|
|
7320
7346
|
computedPinnedEndColumns,
|
|
@@ -9923,6 +9949,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
9923
9949
|
} = props;
|
|
9924
9950
|
const {
|
|
9925
9951
|
computed,
|
|
9952
|
+
getState,
|
|
9926
9953
|
state: { headerBrain, headerOptions, showColumnFilters }
|
|
9927
9954
|
} = useInfiniteTable();
|
|
9928
9955
|
const { computedColumnsMap } = computed;
|
|
@@ -9975,7 +10002,8 @@ function InfiniteTableHeaderFn(props) {
|
|
|
9975
10002
|
computedWidth: colGroupItem.computedWidth,
|
|
9976
10003
|
groupOffset: colGroupItem.groupOffset
|
|
9977
10004
|
});
|
|
9978
|
-
|
|
10005
|
+
const visible = getState().columnGroupVisibility[colGroupItem.id] !== false;
|
|
10006
|
+
return visible ? /* @__PURE__ */ React46.createElement(
|
|
9979
10007
|
InfiniteTableHeaderGroup,
|
|
9980
10008
|
{
|
|
9981
10009
|
bodyBrain,
|
|
@@ -9986,7 +10014,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
9986
10014
|
height,
|
|
9987
10015
|
columnGroup: computedColumnGroup
|
|
9988
10016
|
}
|
|
9989
|
-
);
|
|
10017
|
+
) : null;
|
|
9990
10018
|
}
|
|
9991
10019
|
return /* @__PURE__ */ React46.createElement(
|
|
9992
10020
|
InfiniteTableHeaderCell,
|
|
@@ -17305,12 +17333,18 @@ var ScrollListener = class {
|
|
|
17305
17333
|
};
|
|
17306
17334
|
|
|
17307
17335
|
// src/components/InfiniteTable/state/computeColumnGroupsDepths.ts
|
|
17308
|
-
function computeColumnGroupsDepths(columnGroups) {
|
|
17336
|
+
function computeColumnGroupsDepths(columnGroups, columnGroupVisibility) {
|
|
17309
17337
|
const map2 = /* @__PURE__ */ new Map();
|
|
17338
|
+
function isVisible(colGroupId) {
|
|
17339
|
+
return columnGroupVisibility[colGroupId] !== false;
|
|
17340
|
+
}
|
|
17310
17341
|
Object.keys(columnGroups).forEach((colGroupId) => {
|
|
17311
17342
|
const colGroup = columnGroups[colGroupId];
|
|
17312
17343
|
let parentGroupId = colGroup.columnGroup;
|
|
17313
17344
|
let depth = 0;
|
|
17345
|
+
if (!isVisible(colGroupId)) {
|
|
17346
|
+
depth = -1;
|
|
17347
|
+
}
|
|
17314
17348
|
while (parentGroupId) {
|
|
17315
17349
|
const parent = columnGroups[parentGroupId];
|
|
17316
17350
|
if (!parent) {
|
|
@@ -17319,7 +17353,9 @@ function computeColumnGroupsDepths(columnGroups) {
|
|
|
17319
17353
|
}
|
|
17320
17354
|
break;
|
|
17321
17355
|
}
|
|
17322
|
-
|
|
17356
|
+
if (isVisible(parentGroupId)) {
|
|
17357
|
+
depth++;
|
|
17358
|
+
}
|
|
17323
17359
|
parentGroupId = parent.columnGroup;
|
|
17324
17360
|
}
|
|
17325
17361
|
map2.set(colGroupId, depth);
|
|
@@ -17336,6 +17372,7 @@ function getRowDetailRendererFromComponent(RowDetail) {
|
|
|
17336
17372
|
}
|
|
17337
17373
|
|
|
17338
17374
|
// src/components/InfiniteTable/state/getInitialState.ts
|
|
17375
|
+
var EMPTY_OBJECT = {};
|
|
17339
17376
|
function createRenderer2(brain) {
|
|
17340
17377
|
const renderer = new ReactHeadlessTableRenderer(brain);
|
|
17341
17378
|
const onRenderUpdater = buildSubscriptionCallback();
|
|
@@ -17483,6 +17520,7 @@ var forwardProps4 = (_setupState) => {
|
|
|
17483
17520
|
onScrollbarsChange: 1,
|
|
17484
17521
|
autoSizeColumnsKey: 1,
|
|
17485
17522
|
columnDefaultFlex: 1,
|
|
17523
|
+
draggableColumnsRestrictTo: (draggableColumnsRestrictTo) => draggableColumnsRestrictTo != null ? draggableColumnsRestrictTo : false,
|
|
17486
17524
|
columnMenuRealignDelay: (columnMenuRealignDelay) => columnMenuRealignDelay != null ? columnMenuRealignDelay : 50,
|
|
17487
17525
|
scrollStopDelay: (scrollStopDelay) => scrollStopDelay != null ? scrollStopDelay : 250,
|
|
17488
17526
|
viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
|
|
@@ -17521,7 +17559,8 @@ var forwardProps4 = (_setupState) => {
|
|
|
17521
17559
|
rowDetailHeight: (rowDetailHeight) => typeof rowDetailHeight === "number" || typeof rowDetailHeight === "function" ? rowDetailHeight : 300,
|
|
17522
17560
|
columnHeaderHeight: (columnHeaderHeight) => typeof columnHeaderHeight === "number" ? columnHeaderHeight : 30,
|
|
17523
17561
|
columns: 1,
|
|
17524
|
-
columnVisibility: (columnVisibility) => columnVisibility != null ? columnVisibility :
|
|
17562
|
+
columnVisibility: (columnVisibility) => columnVisibility != null ? columnVisibility : EMPTY_OBJECT,
|
|
17563
|
+
columnGroupVisibility: (columnGroupVisibility) => columnGroupVisibility != null ? columnGroupVisibility : EMPTY_OBJECT,
|
|
17525
17564
|
// TODO check if columnPinning works when the value for a pinned col is `true` instead of `"start"`
|
|
17526
17565
|
columnSizing: (columnSizing) => columnSizing || {},
|
|
17527
17566
|
columnTypes: (columnTypes) => columnTypes || {},
|
|
@@ -17602,7 +17641,10 @@ var mapPropsToState = (params) => {
|
|
|
17602
17641
|
var _a, _b, _c, _d, _e;
|
|
17603
17642
|
const { props, state, oldState, parentState } = params;
|
|
17604
17643
|
const computedColumnGroups = state.pivotColumnGroups || state.columnGroups;
|
|
17605
|
-
const columnGroupsDepthsMap = state.columnGroups && state.columnGroups != (oldState == null ? void 0 : oldState.columnGroups) || state.pivotColumnGroups && state.pivotColumnGroups != (oldState == null ? void 0 : oldState.pivotColumnGroups) ? computeColumnGroupsDepths(
|
|
17644
|
+
const columnGroupsDepthsMap = state.columnGroups && state.columnGroups != (oldState == null ? void 0 : oldState.columnGroups) || state.columnGroups && state.columnGroupVisibility != (oldState == null ? void 0 : oldState.columnGroupVisibility) || state.pivotColumnGroups && state.pivotColumnGroups != (oldState == null ? void 0 : oldState.pivotColumnGroups) ? computeColumnGroupsDepths(
|
|
17645
|
+
computedColumnGroups,
|
|
17646
|
+
state.columnGroupVisibility
|
|
17647
|
+
) : state.columnGroupsDepthsMap;
|
|
17606
17648
|
const groupBy = parentState == null ? void 0 : parentState.groupBy;
|
|
17607
17649
|
const groupRenderStrategy = getGroupRenderStrategy({
|
|
17608
17650
|
groupRenderStrategy: props.groupRenderStrategy,
|
|
@@ -17657,7 +17699,11 @@ var mapPropsToState = (params) => {
|
|
|
17657
17699
|
keyboardNavigation: (_c = props.keyboardNavigation) != null ? _c : state.activeCellIndex != null ? "cell" : state.activeRowIndex != null ? "row" : "cell",
|
|
17658
17700
|
columnHeaderCssEllipsis: (_e = (_d = props.columnHeaderCssEllipsis) != null ? _d : props.columnCssEllipsis) != null ? _e : true,
|
|
17659
17701
|
columnGroupsDepthsMap,
|
|
17660
|
-
columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ?
|
|
17702
|
+
columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ? (
|
|
17703
|
+
// was 0, but after implementing columnGroupVisibility
|
|
17704
|
+
// it can be -1, to denote that no column group is visible
|
|
17705
|
+
Math.max(...columnGroupsDepthsMap.values(), -1)
|
|
17706
|
+
) : state.columnGroupsMaxDepth,
|
|
17661
17707
|
computedColumnGroups,
|
|
17662
17708
|
rowHeightCSSVar: typeof props.rowHeight === "string" ? props.rowHeight : "",
|
|
17663
17709
|
rowDetailHeightCSSVar: typeof props.rowDetailHeight === "string" ? props.rowDetailHeight : "",
|
|
@@ -18583,7 +18629,11 @@ function useComputed() {
|
|
|
18583
18629
|
const computedPinnedEndOverflow = computedPinnedEndWidth ? computedPinnedEndColumnsWidth > computedPinnedEndWidth : false;
|
|
18584
18630
|
const [multiRowSelector] = useState17(() => {
|
|
18585
18631
|
const multiRowSelector2 = new MultiRowSelector({
|
|
18586
|
-
getIdForIndex: (index) =>
|
|
18632
|
+
getIdForIndex: (index) => {
|
|
18633
|
+
var _a2;
|
|
18634
|
+
const dataItem = getDataSourceState().dataArray[index];
|
|
18635
|
+
return (_a2 = dataItem == null ? void 0 : dataItem.id) != null ? _a2 : -1;
|
|
18636
|
+
}
|
|
18587
18637
|
});
|
|
18588
18638
|
return multiRowSelector2;
|
|
18589
18639
|
});
|
|
@@ -18815,7 +18865,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
18815
18865
|
}
|
|
18816
18866
|
let valid2 = isValidLicense(licenseKey, {
|
|
18817
18867
|
publishedAt: 1624970570587,
|
|
18818
|
-
version: "4.3.
|
|
18868
|
+
version: "4.3.6"
|
|
18819
18869
|
});
|
|
18820
18870
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
18821
18871
|
return true;
|
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"bugs": {
|
|
26
26
|
"url": "https://github.com/infinite-table/infinite-react/issues"
|
|
27
27
|
},
|
|
28
|
-
"version": "4.3.
|
|
28
|
+
"version": "4.3.6",
|
|
29
29
|
"main": "index.js",
|
|
30
30
|
"module": "index.mjs",
|
|
31
31
|
"typings": "index.d.ts",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
},
|
|
35
35
|
"license": "Commercial & Open Source",
|
|
36
36
|
"//": "will be updated at build time",
|
|
37
|
-
"publishedAt":
|
|
37
|
+
"publishedAt": 1723632776523
|
|
38
38
|
}
|