diff --git a/examples/src/pages/tests/table/master-detail/default.page.tsx b/examples/src/pages/tests/table/master-detail/default.page.tsx index 1cc6590a..98ed182f 100644 --- a/examples/src/pages/tests/table/master-detail/default.page.tsx +++ b/examples/src/pages/tests/table/master-detail/default.page.tsx @@ -74,10 +74,12 @@ const dataSource = () => { const detailDataSource: DataSourceProps['data'] = ({ sortInfo, filterValue, + masterRowInfo, }) => { if (sortInfo && !Array.isArray(sortInfo)) { sortInfo = [sortInfo]; } + console.log(masterRowInfo?.data, 'master'); const args = [ filterValue @@ -157,7 +159,7 @@ export default function DataTestPage() { collapsedRows: true, }} rowDetailHeight={400} - rowDetailsCache={3} + rowDetailsCache={false} rowDetailRenderer={( rowInfo: InfiniteTableRowInfo, _cache, @@ -174,12 +176,19 @@ export default function DataTestPage() { >
diff --git a/source/src/components/DataSource/DataSourceContext.ts b/source/src/components/DataSource/DataSourceContext.ts index bfb18b21..594301cc 100644 --- a/source/src/components/DataSource/DataSourceContext.ts +++ b/source/src/components/DataSource/DataSourceContext.ts @@ -16,6 +16,7 @@ export function getDataSourceContext(): React.Context< api: null as any as DataSourceApi, getState: () => null as any as DataSourceState, assignState: () => null as any as DataSourceState, + getDataSourceMasterContext: () => undefined, componentState: null as any as DataSourceState, componentActions: null as any as DataSourceComponentActions, })); diff --git a/source/src/components/DataSource/index.tsx b/source/src/components/DataSource/index.tsx index 4ff9f104..b012ba06 100644 --- a/source/src/components/DataSource/index.tsx +++ b/source/src/components/DataSource/index.tsx @@ -85,10 +85,14 @@ function DataSourceCmp({ const DataSourceContext = getDataSourceContext(); const masterContext = useMasterDetailContext(); + const getDataSourceMasterContext = useLatest(masterContext); const { componentState, componentActions, assignState } = useComponentState>(); + componentState.getDataSourceMasterContextRef.current = + getDataSourceMasterContext; + const getState = useLatest(componentState); const [api] = React.useState(() => { @@ -97,6 +101,7 @@ function DataSourceCmp({ const contextValue: DataSourceContextValue = { componentState, componentActions, + getDataSourceMasterContext, getState, assignState, api, diff --git a/source/src/components/DataSource/privateHooks/useLoadData.ts b/source/src/components/DataSource/privateHooks/useLoadData.ts index fd3f6f46..1f0dc615 100644 --- a/source/src/components/DataSource/privateHooks/useLoadData.ts +++ b/source/src/components/DataSource/privateHooks/useLoadData.ts @@ -1,12 +1,17 @@ import { useEffect, useMemo, useRef, useState } from 'react'; -import { LazyGroupDataItem, LazyRowInfoGroup } from '..'; +import { + DataSourceMasterDetailContextValue, + LazyGroupDataItem, + LazyRowInfoGroup, +} from '..'; import { DeepMap } from '../../../utils/DeepMap'; import { LAZY_ROOT_KEY_FOR_GROUPS } from '../../../utils/groupAndPivot'; import { raf } from '../../../utils/raf'; import { useComponentState } from '../../hooks/useComponentState'; import { ComponentStateGeneratedActions } from '../../hooks/useComponentState/types'; import { useEffectWithChanges } from '../../hooks/useEffectWithChanges'; +import { useLatest } from '../../hooks/useLatest'; import { Scrollbars } from '../../InfiniteTable'; import { assignExcept } from '../../InfiniteTable/utils/assignFiltered'; import { debounce } from '../../utils/debounce'; @@ -50,6 +55,7 @@ const DATA_CHANGES_COMPARE_FUNCTIONS: Record< export function buildDataSourceDataParams( componentState: DataSourceState, overrides?: Partial>, + masterContext?: DataSourceMasterDetailContextValue, ): DataSourceDataParams { const sortInfo = componentState.multiSort ? componentState.sortInfo @@ -66,6 +72,10 @@ export function buildDataSourceDataParams( aggregationReducers: componentState.aggregationReducers, }; + if (masterContext) { + dataSourceParams.masterRowInfo = masterContext.masterRowInfo; + } + if (dataSourceParams.groupBy) { dataSourceParams.groupRowsState = componentState.groupRowsState.getState(); } @@ -135,8 +145,13 @@ export function loadData( componentState: DataSourceState, actions: ComponentStateGeneratedActions>, overrides?: Partial>, + masterContext?: DataSourceMasterDetailContextValue | undefined, ) { - const dataParams = buildDataSourceDataParams(componentState, overrides); + const dataParams = buildDataSourceDataParams( + componentState, + overrides, + masterContext, + ); const append = dataParams.append; if (componentState.lazyLoad) { @@ -396,6 +411,26 @@ function computeFilterValueForRemote( ); } +function getDetailReady( + masterContext: DataSourceMasterDetailContextValue | undefined, + getDataSourceState: () => DataSourceState, +) { + const isDetail = !!masterContext; + + const { stateReadyAsDetails } = getDataSourceState(); + + const isDetailReady = isDetail + ? masterContext.shouldRestoreState + ? stateReadyAsDetails + : true + : true; + + return { + isDetail, + isDetailReady, + }; +} + export function useLoadData() { const { getComponentState, @@ -418,7 +453,6 @@ export function useLoadData() { livePaginationCursor, filterTypes, cursorId: stateCursorId, - stateReadyAsDetails, } = componentState; const [scrollbars, setScrollbars] = useState({ @@ -527,29 +561,30 @@ export function useLoadData() { useLazyLoadRange(); - const masterContext = useMasterDetailContext(); - - const isDetail = !!masterContext; - const isDetailRef = useRef(!!masterContext); - isDetailRef.current = isDetail; - - const isDetailReady = isDetail - ? masterContext.shouldRestoreState - ? stateReadyAsDetails - : true - : true; - const isDetailReadyRef = useRef(isDetailReady); - isDetailReadyRef.current = isDetailReady; + const getMasterContext = useLatest(useMasterDetailContext()); useEffectWithChanges( () => { const componentState = getComponentState(); - if (isDetailRef.current && !isDetailReadyRef.current) { + + const masterContext = getMasterContext(); + + const { isDetail, isDetailReady } = getDetailReady( + masterContext, + getComponentState, + ); + if (isDetail && !isDetailReady) { return; } if (typeof componentState.data !== 'function') { - loadData(componentState.data, componentState, actions); + loadData( + componentState.data, + componentState, + actions, + undefined, + masterContext, + ); } }, { data }, @@ -570,15 +605,27 @@ export function useLoadData() { } } - if (isDetailRef.current && !isDetailReadyRef.current) { + const masterContext = getMasterContext(); + const { isDetail, isDetailReady } = getDetailReady( + masterContext, + getComponentState, + ); + + if (isDetail && !isDetailReady) { return; } const componentState = getComponentState(); if (typeof componentState.data === 'function') { - loadData(componentState.data, componentState, actions, { - append: appendWhenLivePagination, - }); + loadData( + componentState.data, + componentState, + actions, + { + append: appendWhenLivePagination, + }, + masterContext, + ); } }, { ...depsObject, data }, @@ -590,7 +637,11 @@ export function useLoadData() { if (initialRef.current) { initialRef.current = false; - const dataParams = buildDataSourceDataParams(componentState); + const dataParams = buildDataSourceDataParams( + componentState, + undefined, + getMasterContext(), + ); actions.dataParams = dataParams; } }, depsObject); diff --git a/source/src/components/DataSource/state/getInitialState.ts b/source/src/components/DataSource/state/getInitialState.ts index 0532530c..8444ebbb 100644 --- a/source/src/components/DataSource/state/getInitialState.ts +++ b/source/src/components/DataSource/state/getInitialState.ts @@ -68,6 +68,8 @@ export function initSetupState(): DataSourceSetupState { idToIndexMap: new Map(), + getDataSourceMasterContextRef: { current: () => undefined }, + // TODO: cleanup cache on unmount cache: undefined, detailDataSourcesStateToRestore: new Map(), @@ -498,10 +500,16 @@ export function getInterceptActions(): ComponentInterceptedActions< > { return { sortInfo: (sortInfo, { actions, state }) => { - const dataParams = buildDataSourceDataParams(state, { - sortInfo, - livePaginationCursor: null, - }); + const getDataSourceMasterContext = + state.getDataSourceMasterContextRef.current; + const dataParams = buildDataSourceDataParams( + state, + { + sortInfo, + livePaginationCursor: null, + }, + getDataSourceMasterContext(), + ); actions.dataParams = dataParams; @@ -515,10 +523,16 @@ export function getInterceptActions(): ComponentInterceptedActions< } }, groupBy: (groupBy, { actions, state }) => { - const dataParams = buildDataSourceDataParams(state, { - groupBy, - livePaginationCursor: null, - }); + const getDataSourceMasterContext = + state.getDataSourceMasterContextRef.current; + const dataParams = buildDataSourceDataParams( + state, + { + groupBy, + livePaginationCursor: null, + }, + getDataSourceMasterContext(), + ); actions.dataParams = dataParams; @@ -531,10 +545,16 @@ export function getInterceptActions(): ComponentInterceptedActions< } }, pivotBy: (pivotBy, { actions, state }) => { - const dataParams = buildDataSourceDataParams(state, { - pivotBy, - livePaginationCursor: null, - }); + const getDataSourceMasterContext = + state.getDataSourceMasterContextRef.current; + const dataParams = buildDataSourceDataParams( + state, + { + pivotBy, + livePaginationCursor: null, + }, + getDataSourceMasterContext(), + ); actions.dataParams = dataParams; @@ -547,10 +567,16 @@ export function getInterceptActions(): ComponentInterceptedActions< } }, filterValue: (filterValue, { actions, state }) => { - const dataParams = buildDataSourceDataParams(state, { - filterValue, - livePaginationCursor: null, - }); + const getDataSourceMasterContext = + state.getDataSourceMasterContextRef.current; + const dataParams = buildDataSourceDataParams( + state, + { + filterValue, + livePaginationCursor: null, + }, + getDataSourceMasterContext(), + ); actions.dataParams = dataParams; @@ -563,15 +589,27 @@ export function getInterceptActions(): ComponentInterceptedActions< } }, cursorId: (cursorId, { actions, state }) => { - const dataParams = buildDataSourceDataParams(state, { - __cursorId: cursorId, - }); + const getDataSourceMasterContext = + state.getDataSourceMasterContextRef.current; + const dataParams = buildDataSourceDataParams( + state, + { + __cursorId: cursorId, + }, + getDataSourceMasterContext(), + ); actions.dataParams = dataParams; }, livePaginationCursor: (livePaginationCursor, { actions, state }) => { - const dataParams = buildDataSourceDataParams(state, { - livePaginationCursor, - }); + const getDataSourceMasterContext = + state.getDataSourceMasterContextRef.current; + const dataParams = buildDataSourceDataParams( + state, + { + livePaginationCursor, + }, + getDataSourceMasterContext(), + ); actions.dataParams = dataParams; }, @@ -583,6 +621,7 @@ export function getInterceptActions(): ComponentInterceptedActions< new Set>([ 'changes', 'originalDataArray', + 'masterRowInfo', ]), ) ) { diff --git a/source/src/components/DataSource/types.ts b/source/src/components/DataSource/types.ts index 2534a709..31f6c88a 100644 --- a/source/src/components/DataSource/types.ts +++ b/source/src/components/DataSource/types.ts @@ -49,6 +49,7 @@ import { DataSourceStateRestoreForDetails } from './state/getInitialState'; export interface DataSourceDataParams { originalDataArray: T[]; + masterRowInfo?: InfiniteTableRowInfo; sortInfo?: DataSourceSortInfo; groupBy?: DataSourcePropGroupBy; pivotBy?: DataSourcePropPivotBy; @@ -237,6 +238,9 @@ export type LazyGroupDataDeepMap = DeepMap< export interface DataSourceSetupState { indexer: Indexer; + getDataSourceMasterContextRef: React.MutableRefObject< + () => DataSourceMasterDetailContextValue | undefined + >; destroyedRef: React.MutableRefObject; idToIndexMap: Map; detailDataSourcesStateToRestore: Map< @@ -736,6 +740,9 @@ export interface DataSourceContextValue { api: DataSourceApi; getState: () => DataSourceState; assignState: (state: Partial>) => void; + getDataSourceMasterContext: () => + | DataSourceMasterDetailContextValue + | undefined; componentState: DataSourceState; componentActions: DataSourceComponentActions; } @@ -743,6 +750,7 @@ export interface DataSourceContextValue { export interface DataSourceMasterDetailContextValue { registerDetail: (detail: DataSourceContextValue) => void; shouldRestoreState: boolean; + masterRowInfo: InfiniteTableRowInfo; } export enum DataSourceActionType { diff --git a/source/src/components/InfiniteTable/api/getImperativeApi.ts b/source/src/components/InfiniteTable/api/getImperativeApi.ts index 61d43489..0e6c7734 100644 --- a/source/src/components/InfiniteTable/api/getImperativeApi.ts +++ b/source/src/components/InfiniteTable/api/getImperativeApi.ts @@ -624,9 +624,15 @@ class InfiniteTableApiImpl implements InfiniteTableApi { if (newState.isGroupRowExpanded(groupKeys)) { if (!currentData?.cache) { - loadData(state.data, state, this.dataSourceActions, { - groupKeys, - }); + loadData( + state.data, + state, + this.dataSourceActions, + { + groupKeys, + }, + this.context.getDataSourceMasterContext(), + ); } } else { if (!currentData?.cache) { diff --git a/source/src/components/InfiniteTable/api/type.ts b/source/src/components/InfiniteTable/api/type.ts index 0954dc82..a9c5e9a4 100644 --- a/source/src/components/InfiniteTable/api/type.ts +++ b/source/src/components/InfiniteTable/api/type.ts @@ -2,6 +2,7 @@ import { DataSourceState, DataSourceComponentActions, DataSourceApi, + DataSourceMasterDetailContextValue, } from '../../DataSource'; import { InfiniteTableComputedValues, InfiniteTableState } from '../types'; import { InfiniteTableActions } from '../types/InfiniteTableState'; @@ -10,6 +11,9 @@ export type GetImperativeApiParam = { getComputed: () => InfiniteTableComputedValues; getState: () => InfiniteTableState; getDataSourceState: () => DataSourceState; + getDataSourceMasterContext: () => + | DataSourceMasterDetailContextValue + | undefined; actions: InfiniteTableActions; dataSourceActions: DataSourceComponentActions; dataSourceApi: DataSourceApi; diff --git a/source/src/components/InfiniteTable/components/FocusDetect.tsx b/source/src/components/InfiniteTable/components/FocusDetect.tsx index b24f5ba7..6359697a 100644 --- a/source/src/components/InfiniteTable/components/FocusDetect.tsx +++ b/source/src/components/InfiniteTable/components/FocusDetect.tsx @@ -24,7 +24,8 @@ export function FocusDetect() { dataSourceApi, dataSourceActions, } = useInfiniteTable(); - const { getState: getDataSourceState } = useDataSourceContextValue(); + const { getState: getDataSourceState, getDataSourceMasterContext } = + useDataSourceContextValue(); const { focusDetectDOMRef } = getState(); @@ -34,6 +35,7 @@ export function FocusDetect() { const context = { getDataSourceState, + getDataSourceMasterContext, getComputed, actions, dataSourceActions, diff --git a/source/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx b/source/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx index 653da796..423e5c05 100644 --- a/source/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx +++ b/source/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx @@ -155,6 +155,7 @@ export function InfiniteTableHeaderCell( columnReorderDragColumnId, columnMenuVisibleForColumnId, }, + getDataSourceMasterContext, } = useInfiniteTable(); const { @@ -203,6 +204,7 @@ export function InfiniteTableHeaderCell( dataSourceApi, getComputed, getDataSourceState, + getDataSourceMasterContext, getState, })!; diff --git a/source/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx b/source/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx index c0691e60..af2cb1a3 100644 --- a/source/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx +++ b/source/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx @@ -176,6 +176,7 @@ function InfiniteTableColumnCellFn(props: InfiniteTableColumnCellProps) { actions: componentActions, computed, api: imperativeApi, + getDataSourceMasterContext, } = useInfiniteTable(); const { componentState: dataSourceState, @@ -190,6 +191,7 @@ function InfiniteTableColumnCellFn(props: InfiniteTableColumnCellProps) { const renderingContext: InfiniteTableColumnRenderingContext = { getState, getDataSourceState, + getDataSourceMasterContext, actions: componentActions, dataSourceActions, api: imperativeApi, diff --git a/source/src/components/InfiniteTable/components/InfiniteTableRow/columnRenderingContextType.ts b/source/src/components/InfiniteTable/components/InfiniteTableRow/columnRenderingContextType.ts index 68ac0d83..db9209a3 100644 --- a/source/src/components/InfiniteTable/components/InfiniteTableRow/columnRenderingContextType.ts +++ b/source/src/components/InfiniteTable/components/InfiniteTableRow/columnRenderingContextType.ts @@ -1,6 +1,7 @@ import { DataSourceApi, DataSourceComponentActions, + DataSourceMasterDetailContextValue, DataSourceState, } from '../../../DataSource'; import { InfiniteTableApi, InfiniteTableState } from '../../types'; @@ -9,6 +10,9 @@ import { InfiniteTableActions } from '../../types/InfiniteTableState'; export type InfiniteTableColumnRenderingContext = { getState: () => InfiniteTableState; getDataSourceState: () => DataSourceState; + getDataSourceMasterContext: () => + | DataSourceMasterDetailContextValue + | undefined; actions: InfiniteTableActions; dataSourceActions: DataSourceComponentActions; api: InfiniteTableApi; diff --git a/source/src/components/InfiniteTable/components/InfiniteTableRow/useRegisterDetail.ts b/source/src/components/InfiniteTable/components/InfiniteTableRow/useRegisterDetail.ts index 3432300e..6e47f047 100644 --- a/source/src/components/InfiniteTable/components/InfiniteTableRow/useRegisterDetail.ts +++ b/source/src/components/InfiniteTable/components/InfiniteTableRow/useRegisterDetail.ts @@ -182,8 +182,10 @@ export function useRegisterDetail(props: UseRegisterDetailProps) { return { registerDetail, shouldRestoreState, - }; + } as DataSourceMasterDetailContextValue; }, [rowInfo.id, currentRowCache]); + masterDetailContextValue.masterRowInfo = rowInfo as InfiniteTableRowInfo; + return { masterDetailContextValue, currentRowCache }; } diff --git a/source/src/components/InfiniteTable/eventHandlers/eventHandlerTypes.ts b/source/src/components/InfiniteTable/eventHandlers/eventHandlerTypes.ts index c41be585..75200da4 100644 --- a/source/src/components/InfiniteTable/eventHandlers/eventHandlerTypes.ts +++ b/source/src/components/InfiniteTable/eventHandlers/eventHandlerTypes.ts @@ -3,6 +3,7 @@ import { DataSourceComponentActions, RowSelectionState, DataSourceApi, + DataSourceMasterDetailContextValue, } from '../../DataSource'; import { InfiniteTableCellSelectionApi } from '../api/getCellSelectionApi'; import { InfiniteTableRowSelectionApi } from '../api/getRowSelectionApi'; @@ -50,6 +51,9 @@ export type InfiniteTableEventHandlerContext = { rowSelection: RowSelectionState, ) => RowSelectionState; getDataSourceState: () => DataSourceState; + getDataSourceMasterContext: () => + | DataSourceMasterDetailContextValue + | undefined; dataSourceActions: DataSourceComponentActions; api: InfiniteTableApi; dataSourceApi: DataSourceApi; diff --git a/source/src/components/InfiniteTable/eventHandlers/index.ts b/source/src/components/InfiniteTable/eventHandlers/index.ts index 98442f91..00d760f2 100644 --- a/source/src/components/InfiniteTable/eventHandlers/index.ts +++ b/source/src/components/InfiniteTable/eventHandlers/index.ts @@ -16,6 +16,7 @@ function useEventHandlersContext() { actions: actions, api, getComputed, + getDataSourceMasterContext, } = useInfiniteTable(); const { getState: getDataSourceState, @@ -26,6 +27,7 @@ function useEventHandlersContext() { const context = useMemo(() => { const context: InfiniteTableEventHandlerContext = { getComputed, + getDataSourceMasterContext, dataSourceApi, api, getState, diff --git a/source/src/components/InfiniteTable/hooks/useToggleGroupRow.ts b/source/src/components/InfiniteTable/hooks/useToggleGroupRow.ts index 75b6d2a4..d9426f61 100644 --- a/source/src/components/InfiniteTable/hooks/useToggleGroupRow.ts +++ b/source/src/components/InfiniteTable/hooks/useToggleGroupRow.ts @@ -10,8 +10,11 @@ import { useDataSourceContextValue } from '../../DataSource/publicHooks/useDataS export type ToggleGroupRowFn = (groupKeys: any[]) => void; export function useToggleGroupRow() { - const { getState: getDataSourceState, componentActions: dataSourceActions } = - useDataSourceContextValue(); + const { + getState: getDataSourceState, + componentActions: dataSourceActions, + getDataSourceMasterContext, + } = useDataSourceContextValue(); const toggleGroupRow = useCallback((groupKeys: any[]) => { // todo this is duplicated in imperative api @@ -27,9 +30,15 @@ export function useToggleGroupRow() { if (newState.isGroupRowExpanded(groupKeys)) { if (!currentData?.cache) { - loadData(state.data, state, dataSourceActions, { - groupKeys, - }); + loadData( + state.data, + state, + dataSourceActions, + { + groupKeys, + }, + getDataSourceMasterContext(), + ); } } else { if (!currentData?.cache) { diff --git a/source/src/components/InfiniteTable/index.tsx b/source/src/components/InfiniteTable/index.tsx index 2f72de56..e28a9771 100644 --- a/source/src/components/InfiniteTable/index.tsx +++ b/source/src/components/InfiniteTable/index.tsx @@ -359,6 +359,7 @@ function InfiniteTableContextProvider() { const { getState: getDataSourceState, componentActions: dataSourceActions, + getDataSourceMasterContext, api: dataSourceApi, } = useDataSourceContextValue(); @@ -367,6 +368,7 @@ function InfiniteTableContextProvider() { getComputed, getState, getDataSourceState, + getDataSourceMasterContext, dataSourceApi, actions: componentActions, dataSourceActions, @@ -378,6 +380,7 @@ function InfiniteTableContextProvider() { state: componentState, computed, dataSourceActions, + getDataSourceMasterContext, getDataSourceState, getComputed, getState, diff --git a/source/src/components/InfiniteTable/types/InfiniteTableContextValue.ts b/source/src/components/InfiniteTable/types/InfiniteTableContextValue.ts index 7aafc34c..af75f117 100644 --- a/source/src/components/InfiniteTable/types/InfiniteTableContextValue.ts +++ b/source/src/components/InfiniteTable/types/InfiniteTableContextValue.ts @@ -4,6 +4,7 @@ import { InfiniteTableApi, InfiniteTableColumnApi } from './InfiniteTableProps'; import { DataSourceApi, DataSourceComponentActions, + DataSourceMasterDetailContextValue, DataSourceState, } from '../../DataSource'; import { OnCellClickContext } from '../eventHandlers/onCellClick'; @@ -19,6 +20,9 @@ export interface InfiniteTableContextValue { getComputed: () => InfiniteTableComputedValues; getState: () => InfiniteTableState; getDataSourceState: () => DataSourceState; + getDataSourceMasterContext: () => + | DataSourceMasterDetailContextValue + | undefined; } export interface InfiniteTablePublicContext { diff --git a/source/src/components/InfiniteTable/utils/defaultGetColumnMenuItems.tsx b/source/src/components/InfiniteTable/utils/defaultGetColumnMenuItems.tsx index 8822f973..2ae111da 100644 --- a/source/src/components/InfiniteTable/utils/defaultGetColumnMenuItems.tsx +++ b/source/src/components/InfiniteTable/utils/defaultGetColumnMenuItems.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import { DataSourceApi, DataSourceComponentActions, + DataSourceMasterDetailContextValue, DataSourceState, } from '../../DataSource'; import { MenuItemObject, MenuProps } from '../../Menu/MenuProps'; @@ -27,6 +28,9 @@ export function defaultGetColumnMenuItems( getState: () => InfiniteTableState; getDataSourceState: () => DataSourceState; getComputed: () => InfiniteTableComputedValues; + getDataSourceMasterContext: () => + | DataSourceMasterDetailContextValue + | undefined; actions: InfiniteTableActions; dataSourceActions: DataSourceComponentActions;