@infinite-table/infinite-react 0.4.13 → 0.5.0
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/.vscode/settings.json +3 -0
- package/API.md +0 -0
- package/build/buildPackageJson.js +43 -0
- package/build/scripts/test.js +37 -0
- package/bundler.config.js +25 -0
- package/globals.d.ts +7 -0
- package/package.json +95 -3
- package/rollup.config.js +15 -0
- package/run-build-deepmap.js +47 -0
- package/run-build.js +45 -0
- package/run-dts-concat.js +21 -0
- package/src/components/CSSVariableWatch.tsx +82 -0
- package/src/components/DataSource/BooleanCollectionState.ts +214 -0
- package/src/components/DataSource/BooleanDeepCollectionState.ts +208 -0
- package/src/components/DataSource/DataSourceContext.ts +20 -0
- package/src/components/DataSource/GroupRowsState.ts +74 -0
- package/src/components/DataSource/Indexer.ts +27 -0
- package/src/components/DataSource/RowSelectionState.ts +763 -0
- package/src/components/DataSource/defaultFilterTypes.ts +64 -0
- package/src/components/DataSource/index.tsx +108 -0
- package/src/components/DataSource/privateHooks/getChangeDetect.ts +7 -0
- package/src/components/DataSource/privateHooks/useLoadData.ts +783 -0
- package/src/components/DataSource/publicHooks/useDataSource.ts +19 -0
- package/src/components/DataSource/publicHooks/useDataSourceActions.ts +14 -0
- package/src/components/DataSource/state/getInitialState.ts +494 -0
- package/src/components/DataSource/state/normalizeSortInfo.ts +35 -0
- package/src/components/DataSource/state/reducer.ts +466 -0
- package/src/components/DataSource/state/rowInfoStatus.ts +27 -0
- package/src/components/DataSource/types.ts +548 -0
- package/src/components/HeadlessTable/HeadlessTableWithPinnedContainers.tsx +142 -0
- package/src/components/HeadlessTable/MappedCells.ts +251 -0
- package/src/components/HeadlessTable/RawTable.tsx +98 -0
- package/src/components/HeadlessTable/ReactHeadlessTableRenderer.tsx +1516 -0
- package/src/components/HeadlessTable/index.tsx +234 -0
- package/src/components/InfiniteTable/InfiniteCls.css.ts +164 -0
- package/src/components/InfiniteTable/InfiniteTableContext.ts +16 -0
- package/src/components/InfiniteTable/api/getImperativeApi.ts +391 -0
- package/src/components/InfiniteTable/api/getSelectionApi.ts +364 -0
- package/src/components/InfiniteTable/api/type.ts +11 -0
- package/src/components/InfiniteTable/components/ActiveCellIndicator.css.ts +51 -0
- package/src/components/InfiniteTable/components/ActiveCellIndicator.tsx +116 -0
- package/src/components/InfiniteTable/components/ActiveRowIndicator.css.ts +56 -0
- package/src/components/InfiniteTable/components/ActiveRowIndicator.tsx +94 -0
- package/src/components/InfiniteTable/components/CheckBox.css.ts +13 -0
- package/src/components/InfiniteTable/components/CheckBox.tsx +96 -0
- package/src/components/InfiniteTable/components/FilterEditors.tsx +52 -0
- package/src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx +27 -0
- package/src/components/InfiniteTable/components/InfiniteTableBody/index.tsx +1 -0
- package/src/components/InfiniteTable/components/InfiniteTableFooter/InfiniteTableFooter.tsx +31 -0
- package/src/components/InfiniteTable/components/InfiniteTableFooter/index.tsx +1 -0
- package/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableColumnHeaderFilter.tsx +102 -0
- package/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx +163 -0
- package/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx +574 -0
- package/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx +79 -0
- package/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderTypes.tsx +25 -0
- package/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx +185 -0
- package/src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/GroupResizeHandle.tsx +159 -0
- package/src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/ResizeHandle.css.ts +124 -0
- package/src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/columnResizer.ts +166 -0
- package/src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx +146 -0
- package/src/components/InfiniteTable/components/InfiniteTableHeader/buildColumnAndGroupTree.ts +240 -0
- package/src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts +358 -0
- package/src/components/InfiniteTable/components/InfiniteTableHeader/index.tsx +1 -0
- package/src/components/InfiniteTable/components/InfiniteTableHeader/useColumnGroupResizeHandle.tsx +114 -0
- package/src/components/InfiniteTable/components/InfiniteTableHeader/useColumnResizeHandle.tsx +146 -0
- package/src/components/InfiniteTable/components/InfiniteTableLicenseFooter/footer.css.ts +7 -0
- package/src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx +110 -0
- package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx +120 -0
- package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCellTypes.ts +74 -0
- package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx +457 -0
- package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRow.tsx +107 -0
- package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowClassName.ts +6 -0
- package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowTypes.ts +32 -0
- package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowUnvirtualized.tsx +75 -0
- package/src/components/InfiniteTable/components/InfiniteTableRow/columnRendering.tsx +263 -0
- package/src/components/InfiniteTable/components/InfiniteTableRow/index.tsx +1 -0
- package/src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts +74 -0
- package/src/components/InfiniteTable/components/InfiniteTableRow/useRowDOMProps.ts +199 -0
- package/src/components/InfiniteTable/components/LoadMask.css.ts +34 -0
- package/src/components/InfiniteTable/components/LoadMask.tsx +27 -0
- package/src/components/InfiniteTable/components/ScrollbarPlaceholder.tsx +56 -0
- package/src/components/InfiniteTable/components/cell.css.ts +192 -0
- package/src/components/InfiniteTable/components/icons/ArrowDown.tsx +14 -0
- package/src/components/InfiniteTable/components/icons/ArrowUp.tsx +14 -0
- package/src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts +31 -0
- package/src/components/InfiniteTable/components/icons/ExpanderIcon.tsx +63 -0
- package/src/components/InfiniteTable/components/icons/Icon.tsx +18 -0
- package/src/components/InfiniteTable/components/icons/InfiniteTableIconClassName.ts +1 -0
- package/src/components/InfiniteTable/components/icons/LoadingIcon.css.ts +8 -0
- package/src/components/InfiniteTable/components/icons/LoadingIcon.tsx +45 -0
- package/src/components/InfiniteTable/components/icons/MenuIcon.tsx +50 -0
- package/src/components/InfiniteTable/components/icons/SortIcon.tsx +113 -0
- package/src/components/InfiniteTable/eventHandlers/eventHandlerTypes.ts +57 -0
- package/src/components/InfiniteTable/eventHandlers/index.ts +95 -0
- package/src/components/InfiniteTable/eventHandlers/keyboardNavigation.ts +232 -0
- package/src/components/InfiniteTable/eventHandlers/keyboardSelection.ts +110 -0
- package/src/components/InfiniteTable/eventHandlers/onCellClick.ts +94 -0
- package/src/components/InfiniteTable/eventHandlers/onKeyDown.ts +25 -0
- package/src/components/InfiniteTable/hooks/adjustColumnOrderForAllColumns.ts +70 -0
- package/src/components/InfiniteTable/hooks/reorderColumnsOnDrag.ts +476 -0
- package/src/components/InfiniteTable/hooks/useAutoSizeColumns.ts +206 -0
- package/src/components/InfiniteTable/hooks/useCellClassName.ts +80 -0
- package/src/components/InfiniteTable/hooks/useCellRendering.tsx +217 -0
- package/src/components/InfiniteTable/hooks/useColumnGroups.ts +71 -0
- package/src/components/InfiniteTable/hooks/useColumnMenu.ts +72 -0
- package/src/components/InfiniteTable/hooks/useColumnPointerEvents.ts +258 -0
- package/src/components/InfiniteTable/hooks/useColumnRowspan.ts +43 -0
- package/src/components/InfiniteTable/hooks/useColumnSizeFn.ts +24 -0
- package/src/components/InfiniteTable/hooks/useColumnsWhen.ts +582 -0
- package/src/components/InfiniteTable/hooks/useComputed.ts +186 -0
- package/src/components/InfiniteTable/hooks/useComputedVisibleColumns.ts +219 -0
- package/src/components/InfiniteTable/hooks/useDOMProps.ts +306 -0
- package/src/components/InfiniteTable/hooks/useEffectWithRaf.ts +47 -0
- package/src/components/InfiniteTable/hooks/useInfiniteTable.ts +10 -0
- package/src/components/InfiniteTable/hooks/useInfiniteTableState.ts +11 -0
- package/src/components/InfiniteTable/hooks/useInternalProps.ts +8 -0
- package/src/components/InfiniteTable/hooks/useLicense/LicenseDetails.ts +13 -0
- package/src/components/InfiniteTable/hooks/useLicense/crc32.ts +56 -0
- package/src/components/InfiniteTable/hooks/useLicense/decode.ts +147 -0
- package/src/components/InfiniteTable/hooks/useLicense/useLicense.ts +39 -0
- package/src/components/InfiniteTable/hooks/useRerenderOnKeyChange.ts +21 -0
- package/src/components/InfiniteTable/hooks/useRowHover.ts +18 -0
- package/src/components/InfiniteTable/hooks/useScrollToActiveCell.ts +48 -0
- package/src/components/InfiniteTable/hooks/useScrollToActiveRow.ts +44 -0
- package/src/components/InfiniteTable/hooks/useScrollbars.ts +51 -0
- package/src/components/InfiniteTable/hooks/useToggleGroupRow.ts +56 -0
- package/src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx +165 -0
- package/src/components/InfiniteTable/hooks/useYourBrain.ts +55 -0
- package/src/components/InfiniteTable/index.tsx +352 -0
- package/src/components/InfiniteTable/internalProps.ts +4 -0
- package/src/components/InfiniteTable/state/computeColumnGroupsDepths.ts +29 -0
- package/src/components/InfiniteTable/state/getColumnVisibilityForHideEmptyGroupColumns.ts +127 -0
- package/src/components/InfiniteTable/state/getInitialState.ts +375 -0
- package/src/components/InfiniteTable/theme.css.ts +556 -0
- package/src/components/InfiniteTable/types/InfiniteTableAction.ts +6 -0
- package/src/components/InfiniteTable/types/InfiniteTableActionType.ts +12 -0
- package/src/components/InfiniteTable/types/InfiniteTableColumn.ts +478 -0
- package/src/components/InfiniteTable/types/InfiniteTableComputedValues.ts +43 -0
- package/src/components/InfiniteTable/types/InfiniteTableContextValue.ts +12 -0
- package/src/components/InfiniteTable/types/InfiniteTableInternalProps.ts +3 -0
- package/src/components/InfiniteTable/types/InfiniteTableProps.ts +511 -0
- package/src/components/InfiniteTable/types/InfiniteTableState.ts +195 -0
- package/src/components/InfiniteTable/types/Utility.ts +35 -0
- package/src/components/InfiniteTable/types/index.ts +96 -0
- package/src/components/InfiniteTable/utilities.css.ts +179 -0
- package/src/components/InfiniteTable/utils/MultiRowSelector.ts +111 -0
- package/src/components/InfiniteTable/utils/RenderHookComponentForInfinite.tsx +52 -0
- package/src/components/InfiniteTable/utils/adjustColumnOrderForPinning.ts +33 -0
- package/src/components/InfiniteTable/utils/assignFiltered.ts +29 -0
- package/src/components/InfiniteTable/utils/defaultGetColumContextMenuItems.tsx +108 -0
- package/src/components/InfiniteTable/utils/getColumnComputedType.ts +33 -0
- package/src/components/InfiniteTable/utils/getColumnForGroupBy.tsx +313 -0
- package/src/components/InfiniteTable/utils/getComputedVisibleColumns.ts +773 -0
- package/src/components/InfiniteTable/utils/getContextMenuForColumn.tsx +72 -0
- package/src/components/InfiniteTable/utils/infiniteDOMUtils.ts +189 -0
- package/src/components/InfiniteTable/utils/mapToObject.ts +20 -0
- package/src/components/InfiniteTable/utils/moveXatY.ts +25 -0
- package/src/components/InfiniteTable/utils/objectValuesExcept.ts +9 -0
- package/src/components/InfiniteTable/utils/progressiveSpeedScroller.ts +158 -0
- package/src/components/InfiniteTable/utils/rafFn.ts +13 -0
- package/src/components/InfiniteTable/utils/toCSSVarName.ts +1 -0
- package/src/components/InfiniteTable/utils/toMap.ts +24 -0
- package/src/components/Menu/Menu.tsx +750 -0
- package/src/components/Menu/MenuCls.css.ts +139 -0
- package/src/components/Menu/MenuContext.ts +10 -0
- package/src/components/Menu/MenuContextValue.ts +15 -0
- package/src/components/Menu/MenuProps.ts +98 -0
- package/src/components/Menu/MenuState.ts +56 -0
- package/src/components/Menu/MenuTriangleContext.ts +352 -0
- package/src/components/Menu/childrenToRuntimeItems.tsx +103 -0
- package/src/components/Menu/getMenuState.tsx +119 -0
- package/src/components/Menu/index.tsx +88 -0
- package/src/components/Menu/propToIdentifyMenu.ts +1 -0
- package/src/components/RawList/AvoidReactDiff.tsx +48 -0
- package/src/components/RawList/MappedItems.ts +143 -0
- package/src/components/RawList/ReactVirtualRenderer.tsx +307 -0
- package/src/components/RawList/index.tsx +42 -0
- package/src/components/RawList/types.ts +23 -0
- package/src/components/RawList/useVirtualRenderer.ts +36 -0
- package/src/components/RenderHookComponent.tsx +10 -0
- package/src/components/ResizeObserver/index.tsx +170 -0
- package/src/components/VirtualBrain/MatrixBrain.ts +1621 -0
- package/src/components/VirtualBrain/ScrollListener.ts +39 -0
- package/src/components/VirtualBrain/index.ts +664 -0
- package/src/components/VirtualList/ColumnListWithExternalScrolling.tsx +78 -0
- package/src/components/VirtualList/InfiniteListRootClassName.ts +1 -0
- package/src/components/VirtualList/RowListWithExternalScrolling.tsx +120 -0
- package/src/components/VirtualList/SpacePlaceholder.tsx +32 -0
- package/src/components/VirtualList/VirtualList.css.ts +29 -0
- package/src/components/VirtualList/VirtualList.tsx +141 -0
- package/src/components/VirtualList/VirtualRowList.tsx +34 -0
- package/src/components/VirtualList/types.ts +56 -0
- package/src/components/VirtualList/useCorrectHeightForRowElements.ts +14 -0
- package/src/components/VirtualScrollContainer/VirtualScrollContainer.css.ts +51 -0
- package/src/components/VirtualScrollContainer/getScrollableClassName.ts +30 -0
- package/src/components/VirtualScrollContainer/index.tsx +63 -0
- package/src/components/flexbox/index.ts +562 -0
- package/src/components/hooks/useComponentState/index.tsx +562 -0
- package/src/components/hooks/useComponentState/types.ts +32 -0
- package/src/components/hooks/useEffectOnceWithProperUnmount.ts +33 -0
- package/src/components/hooks/useEffectWithChanges.ts +56 -0
- package/src/components/hooks/useImmutableRef.ts +7 -0
- package/src/components/hooks/useInterceptedMap.ts +71 -0
- package/src/components/hooks/useLatest.tsx +8 -0
- package/src/components/hooks/useLazyLatest.ts +23 -0
- package/src/components/hooks/useMemoShallowObjectMerge.ts +16 -0
- package/src/components/hooks/useMounted.ts +18 -0
- package/src/components/hooks/useOnMount.ts +21 -0
- package/src/components/hooks/useOnScroll.ts +34 -0
- package/src/components/hooks/useOnce.ts +10 -0
- package/src/components/hooks/useOverlay/index.tsx +418 -0
- package/src/components/hooks/usePrevious.ts +8 -0
- package/src/components/hooks/usePropertyOld.ts +168 -0
- package/src/components/hooks/useRerender.ts +12 -0
- package/src/components/hooks/xuseProperty.ts +165 -0
- package/src/components/types/CellPosition.ts +4 -0
- package/src/components/types/NonUndefined.ts +1 -0
- package/src/components/types/RemoveObject.ts +22 -0
- package/src/components/types/Renderable.ts +3 -0
- package/src/components/types/ScrollPosition.ts +7 -0
- package/src/components/types/Setter.ts +2 -0
- package/src/components/types/Size.ts +6 -0
- package/src/components/types/SubscriptionCallback.ts +10 -0
- package/src/components/types/VoidFn.ts +1 -0
- package/src/components/utils/buildSubscriptionCallback.tsx +60 -0
- package/src/components/utils/clamp.ts +3 -0
- package/src/components/utils/debounce.ts +16 -0
- package/src/components/utils/decamelize.ts +11 -0
- package/src/components/utils/discardCallsWithEqualArg.ts +42 -0
- package/src/components/utils/getRenderIndexes.ts +33 -0
- package/src/components/utils/getScrollbarWidth.ts +31 -0
- package/src/components/utils/getVirtualRenderCount.ts +21 -0
- package/src/components/utils/isControlled.ts +12 -0
- package/src/components/utils/isControlledValue.ts +5 -0
- package/src/index.tsx +34 -0
- package/src/test.tsx +18 -0
- package/src/utils/DeepMap/index.ts +588 -0
- package/src/utils/DeepMap/once.ts +16 -0
- package/src/utils/DeepMap/sortAscending.ts +1 -0
- package/src/utils/DeepMap/tsconfig.deepmap.json +17 -0
- package/src/utils/DeepMap/xpackage.json +26 -0
- package/src/utils/debug.ts +40 -0
- package/src/utils/deepClone.ts +38 -0
- package/src/utils/getGlobal.ts +3 -0
- package/src/utils/groupAndPivot/defaultToKey.ts +3 -0
- package/src/utils/groupAndPivot/getGroupKeysForDataItem.ts +19 -0
- package/src/utils/groupAndPivot/getPivotColumnsAndColumnGroups.ts +361 -0
- package/src/utils/groupAndPivot/index.ts +1229 -0
- package/src/utils/groupAndPivot/types.ts +10 -0
- package/src/utils/join.ts +4 -0
- package/src/utils/mathIntersection.ts +21 -0
- package/src/utils/minified.d.ts +2 -0
- package/src/utils/minified.js +6 -0
- package/src/utils/multisort/index.ts +151 -0
- package/src/utils/multisort/sortTypes.ts +25 -0
- package/src/utils/notes-status.md +92 -0
- package/src/utils/pageGeometry/ConvexPoly.ts +34 -0
- package/src/utils/pageGeometry/Point.ts +51 -0
- package/src/utils/pageGeometry/PolyWithPoints.ts +52 -0
- package/src/utils/pageGeometry/Rectangle.ts +98 -0
- package/src/utils/pageGeometry/Triangle.ts +16 -0
- package/src/utils/pageGeometry/alignment/index.ts +221 -0
- package/src/utils/pageGeometry/polyContainsPoint.ts +182 -0
- package/src/utils/pageGeometry/types.ts +3 -0
- package/src/utils/proxyFnCall.ts +46 -0
- package/src/utils/raf.ts +13 -0
- package/src/utils/selectParent.ts +18 -0
- package/src/utils/shallowEqualObjects.ts +49 -0
- package/src/utils/stripVar.ts +3 -0
- package/src/utils/toUpperFirst.ts +5 -0
- package/todo.md +2 -0
- package/tsconfig.build.json +8 -0
- package/tsconfig.dev.json +7 -0
- package/tsconfig.json +30 -0
- package/tsconfig.typebundler.json +13 -0
- package/typedoc.json +4 -0
- package/README.md +0 -104
- package/index.css +0 -857
- package/index.d.ts +0 -2111
- package/index.esm.css +0 -857
- package/index.esm.js +0 -13695
- package/index.js +0 -13565
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
AggregationReducer,
|
|
5
|
+
InfiniteTableRowInfoDataDiscriminator,
|
|
6
|
+
} from '../../../utils/groupAndPivot';
|
|
7
|
+
import {
|
|
8
|
+
DataSourceGroupBy,
|
|
9
|
+
DataSourcePivotBy,
|
|
10
|
+
DataSourcePropGroupBy,
|
|
11
|
+
DataSourcePropPivotBy,
|
|
12
|
+
DataSourcePropSelectionMode,
|
|
13
|
+
DataSourceSingleSortInfo,
|
|
14
|
+
DataSourceState,
|
|
15
|
+
} from '../../DataSource/types';
|
|
16
|
+
import { Renderable } from '../../types/Renderable';
|
|
17
|
+
|
|
18
|
+
import type {
|
|
19
|
+
InfiniteTableColumn,
|
|
20
|
+
InfiniteTableColumnRenderFunction,
|
|
21
|
+
InfiniteTableColumnRenderFunctionForGroupRows,
|
|
22
|
+
InfiniteTableComputedColumn,
|
|
23
|
+
InfiniteTableComputedPivotFinalColumn,
|
|
24
|
+
InfiniteTableDataTypeNames,
|
|
25
|
+
InfiniteTablePivotColumn,
|
|
26
|
+
InfiniteTablePivotFinalColumn,
|
|
27
|
+
} from './InfiniteTableColumn';
|
|
28
|
+
import {
|
|
29
|
+
InfiniteTableActions,
|
|
30
|
+
InfiniteTablePropPivotGrandTotalColumnPosition,
|
|
31
|
+
InfiniteTablePropPivotTotalColumnPosition,
|
|
32
|
+
} from './InfiniteTableState';
|
|
33
|
+
|
|
34
|
+
import { InfiniteTableState } from '.';
|
|
35
|
+
import { InfiniteTableComputedValues } from './InfiniteTableComputedValues';
|
|
36
|
+
import { InfiniteCheckBoxProps } from '../components/CheckBox';
|
|
37
|
+
import { InfiniteTableSelectionApi } from '../api/getSelectionApi';
|
|
38
|
+
import { MenuProps } from '../../Menu/MenuProps';
|
|
39
|
+
import { SortDir } from '../../../utils/multisort';
|
|
40
|
+
import { KeyOfNoSymbol } from './Utility';
|
|
41
|
+
|
|
42
|
+
export type LoadMaskProps = {
|
|
43
|
+
visible: boolean;
|
|
44
|
+
children: Renderable;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// export type TablePropColumnOrderItem = string | { id: string; visible: boolean };
|
|
48
|
+
export type InfiniteTablePropColumnOrderNormalized = string[];
|
|
49
|
+
export type InfiniteTablePropColumnOrder =
|
|
50
|
+
| InfiniteTablePropColumnOrderNormalized
|
|
51
|
+
| true;
|
|
52
|
+
|
|
53
|
+
export type InfiniteTablePropColumnVisibility = Record<string, false>;
|
|
54
|
+
|
|
55
|
+
export type InfiniteTableColumnPinnedValues = false | 'start' | 'end';
|
|
56
|
+
|
|
57
|
+
export type InfiniteTablePropColumnPinning = Record<
|
|
58
|
+
string,
|
|
59
|
+
true | 'start' | 'end'
|
|
60
|
+
>;
|
|
61
|
+
|
|
62
|
+
export type InfiniteTableRowStyleFnParams<T> = {
|
|
63
|
+
rowIndex: number;
|
|
64
|
+
} & InfiniteTableRowInfoDataDiscriminator<T>;
|
|
65
|
+
export type InfiniteTableRowStyleFn<T> = (
|
|
66
|
+
params: InfiniteTableRowStyleFnParams<T>,
|
|
67
|
+
) => undefined | React.CSSProperties;
|
|
68
|
+
export type InfiniteTableRowClassNameFn<T> = (
|
|
69
|
+
params: InfiniteTableRowStyleFnParams<T>,
|
|
70
|
+
) => string | undefined;
|
|
71
|
+
export type InfiniteTablePropRowStyle<T> =
|
|
72
|
+
| React.CSSProperties
|
|
73
|
+
| InfiniteTableRowStyleFn<T>;
|
|
74
|
+
export type InfiniteTablePropRowClassName<T> =
|
|
75
|
+
| string
|
|
76
|
+
| InfiniteTableRowClassNameFn<T>;
|
|
77
|
+
|
|
78
|
+
export type InfiniteTableColumnAggregator<T, AggregationResultType> = Omit<
|
|
79
|
+
AggregationReducer<T, AggregationResultType>,
|
|
80
|
+
'getter' | 'id'
|
|
81
|
+
> & {
|
|
82
|
+
getter?: AggregationReducer<T, AggregationResultType>['getter'];
|
|
83
|
+
field?: keyof T;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export type InfiniteTableColumnType<T> = {
|
|
87
|
+
minWidth?: number;
|
|
88
|
+
maxWidth?: number;
|
|
89
|
+
|
|
90
|
+
filterType?: string;
|
|
91
|
+
sortType?: string;
|
|
92
|
+
dataType?: InfiniteTableDataTypeNames;
|
|
93
|
+
|
|
94
|
+
defaultWidth?: number;
|
|
95
|
+
defaultFlex?: number;
|
|
96
|
+
defaultPinned?: InfiniteTableColumnPinnedValues;
|
|
97
|
+
defaultFilterable?: boolean;
|
|
98
|
+
defaultHiddenWhenGroupedBy?: InfiniteTableColumn<T>['defaultHiddenWhenGroupedBy'];
|
|
99
|
+
|
|
100
|
+
header?: InfiniteTableColumn<T>['header'];
|
|
101
|
+
comparer?: InfiniteTableColumn<T>['comparer'];
|
|
102
|
+
draggable?: InfiniteTableColumn<T>['draggable'];
|
|
103
|
+
sortable?: InfiniteTableColumn<T>['sortable'];
|
|
104
|
+
resizable?: InfiniteTableColumn<T>['resizable'];
|
|
105
|
+
align?: InfiniteTableColumn<T>['align'];
|
|
106
|
+
verticalAlign?: InfiniteTableColumn<T>['verticalAlign'];
|
|
107
|
+
|
|
108
|
+
columnGroup?: string;
|
|
109
|
+
|
|
110
|
+
cssEllipsis?: boolean;
|
|
111
|
+
headerCssEllipsis?: boolean;
|
|
112
|
+
field?: KeyOfNoSymbol<T>;
|
|
113
|
+
|
|
114
|
+
components?: InfiniteTableColumn<T>['components'];
|
|
115
|
+
renderMenuIcon?: InfiniteTableColumn<T>['renderMenuIcon'];
|
|
116
|
+
renderSortIcon?: InfiniteTableColumn<T>['renderSortIcon'];
|
|
117
|
+
renderSelectionCheckBox?: InfiniteTableColumn<T>['renderSelectionCheckBox'];
|
|
118
|
+
renderHeaderSelectionCheckBox?: InfiniteTableColumn<T>['renderHeaderSelectionCheckBox'];
|
|
119
|
+
renderValue?: InfiniteTableColumn<T>['renderValue'];
|
|
120
|
+
render?: InfiniteTableColumn<T>['render'];
|
|
121
|
+
valueGetter?: InfiniteTableColumn<T>['valueGetter'];
|
|
122
|
+
valueFormatter?: InfiniteTableColumn<T>['valueFormatter'];
|
|
123
|
+
style?: InfiniteTableColumn<T>['style'];
|
|
124
|
+
headerStyle?: InfiniteTableColumn<T>['headerStyle'];
|
|
125
|
+
headerClassName?: InfiniteTableColumn<T>['headerClassName'];
|
|
126
|
+
};
|
|
127
|
+
export type InfiniteTablePropColumnTypesMap<T> = Map<
|
|
128
|
+
'default' | string,
|
|
129
|
+
InfiniteTableColumnType<T>
|
|
130
|
+
>;
|
|
131
|
+
export type InfiniteTablePropColumnTypes<T> = Record<
|
|
132
|
+
'default' | string,
|
|
133
|
+
InfiniteTableColumnType<T>
|
|
134
|
+
>;
|
|
135
|
+
|
|
136
|
+
export type InfiniteTableColumnSizingOptions = {
|
|
137
|
+
flex?: number;
|
|
138
|
+
width?: number;
|
|
139
|
+
minWidth?: number;
|
|
140
|
+
maxWidth?: number;
|
|
141
|
+
};
|
|
142
|
+
export type InfiniteTablePropColumnSizing = Record<
|
|
143
|
+
string,
|
|
144
|
+
InfiniteTableColumnSizingOptions
|
|
145
|
+
>;
|
|
146
|
+
|
|
147
|
+
export type InfiniteTableStateGetter<T> = () => InfiniteTableState<T>;
|
|
148
|
+
export type InfiniteTableComputedValuesGetter<T> =
|
|
149
|
+
() => InfiniteTableComputedValues<T>;
|
|
150
|
+
export type InfiniteTableActionsGetter<T> = () => InfiniteTableActions<T>;
|
|
151
|
+
export type DataSourceStateGetter<T> = () => DataSourceState<T>;
|
|
152
|
+
|
|
153
|
+
export type InfiniteTableApi<T> = {
|
|
154
|
+
get selectionApi(): InfiniteTableSelectionApi;
|
|
155
|
+
setColumnOrder: (columnOrder: InfiniteTablePropColumnOrder) => void;
|
|
156
|
+
setColumnVisibility: (
|
|
157
|
+
columnVisibility: InfiniteTablePropColumnVisibility,
|
|
158
|
+
) => void;
|
|
159
|
+
x?: T;
|
|
160
|
+
|
|
161
|
+
get scrollLeft(): number;
|
|
162
|
+
set scrollLeft(value: number);
|
|
163
|
+
|
|
164
|
+
get scrollTop(): number;
|
|
165
|
+
set scrollTop(value: number);
|
|
166
|
+
|
|
167
|
+
toggleGroupRow: (groupKeys: any[]) => void;
|
|
168
|
+
collapseGroupRow: (groupKeys: any[]) => boolean;
|
|
169
|
+
expandGroupRow: (groupKeys: any[]) => boolean;
|
|
170
|
+
|
|
171
|
+
setSortInfoForColumn: (
|
|
172
|
+
columnId: string,
|
|
173
|
+
sortInfo: DataSourceSingleSortInfo<T> | null,
|
|
174
|
+
) => void;
|
|
175
|
+
|
|
176
|
+
setPinningForColumn: (
|
|
177
|
+
columnId: string,
|
|
178
|
+
pinning: InfiniteTableColumnPinnedValues,
|
|
179
|
+
) => void;
|
|
180
|
+
|
|
181
|
+
setSortingForColumn: (columnId: string, dir: SortDir | null) => void;
|
|
182
|
+
|
|
183
|
+
setVisibilityForColumn: (columnId: string, visible: boolean) => void;
|
|
184
|
+
getVisibleColumnsCount: () => number;
|
|
185
|
+
|
|
186
|
+
scrollRowIntoView: (
|
|
187
|
+
rowIndex: number,
|
|
188
|
+
config?: {
|
|
189
|
+
scrollAdjustPosition?: ScrollAdjustPosition;
|
|
190
|
+
offset?: number;
|
|
191
|
+
},
|
|
192
|
+
) => boolean;
|
|
193
|
+
scrollColumnIntoView: (
|
|
194
|
+
colId: string,
|
|
195
|
+
config?: {
|
|
196
|
+
scrollAdjustPosition?: ScrollAdjustPosition;
|
|
197
|
+
offset?: number;
|
|
198
|
+
},
|
|
199
|
+
) => boolean;
|
|
200
|
+
scrollCellIntoView: (
|
|
201
|
+
rowIndex: number,
|
|
202
|
+
colIdOrIndex: string | number,
|
|
203
|
+
config?: {
|
|
204
|
+
scrollAdjustPosition?: ScrollAdjustPosition;
|
|
205
|
+
offset?: number;
|
|
206
|
+
},
|
|
207
|
+
) => boolean;
|
|
208
|
+
|
|
209
|
+
getState: () => InfiniteTableState<T>;
|
|
210
|
+
getDataSourceState: () => DataSourceState<T>;
|
|
211
|
+
};
|
|
212
|
+
export type InfiniteTablePropVirtualizeColumns<T> =
|
|
213
|
+
| boolean
|
|
214
|
+
| ((columns: InfiniteTableComputedColumn<T>[]) => boolean);
|
|
215
|
+
|
|
216
|
+
export type InfiniteTableInternalProps<T> = {
|
|
217
|
+
rowHeight: number;
|
|
218
|
+
___t?: T;
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export type InfiniteTableColumnsMap<
|
|
222
|
+
T,
|
|
223
|
+
ColumnType = InfiniteTableColumn<T>,
|
|
224
|
+
> = Map<string, ColumnType>;
|
|
225
|
+
|
|
226
|
+
export type InfiniteTablePropColumns<T, ColumnType = InfiniteTableColumn<T>> =
|
|
227
|
+
| Record<string, ColumnType>
|
|
228
|
+
| InfiniteTableColumnsMap<T, ColumnType>;
|
|
229
|
+
|
|
230
|
+
export type InfiniteTableColumns<T> = InfiniteTablePropColumns<T>;
|
|
231
|
+
|
|
232
|
+
export type InfiniteTablePropColumnGroupsMap = Map<
|
|
233
|
+
string,
|
|
234
|
+
InfiniteTableColumnGroup
|
|
235
|
+
>;
|
|
236
|
+
export type InfiniteTablePropColumnGroupsRecord = Record<
|
|
237
|
+
string,
|
|
238
|
+
InfiniteTableColumnGroup
|
|
239
|
+
>;
|
|
240
|
+
export type InfiniteTablePropColumnGroups =
|
|
241
|
+
| InfiniteTablePropColumnGroupsRecord
|
|
242
|
+
| InfiniteTablePropColumnGroupsMap;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* the keys is an array of strings: first string in the array is the column group id, next strings are the ids of all columns in the group
|
|
246
|
+
* the value is the id of the column to leave as visible
|
|
247
|
+
*/
|
|
248
|
+
export type InfiniteTablePropCollapsedColumnGroupsMap = Map<string[], string>;
|
|
249
|
+
export type InfiniteTablePropCollapsedColumnGroups = Map<string[], string>;
|
|
250
|
+
|
|
251
|
+
export type InfiniteTableColumnGroupHeaderRenderParams = {
|
|
252
|
+
columnGroup: InfiniteTableComputedColumnGroup;
|
|
253
|
+
};
|
|
254
|
+
export type InfiniteTableColumnGroupHeaderRenderFunction = (
|
|
255
|
+
params: InfiniteTableColumnGroupHeaderRenderParams,
|
|
256
|
+
) => Renderable;
|
|
257
|
+
|
|
258
|
+
export type InfiniteTableColumnGroup = {
|
|
259
|
+
columnGroup?: string;
|
|
260
|
+
header?: Renderable | InfiniteTableColumnGroupHeaderRenderFunction;
|
|
261
|
+
};
|
|
262
|
+
export type InfiniteTableComputedColumnGroup = InfiniteTableColumnGroup & {
|
|
263
|
+
id: string;
|
|
264
|
+
groupOffset: number;
|
|
265
|
+
computedWidth: number;
|
|
266
|
+
uniqueGroupId: string[];
|
|
267
|
+
columns: string[];
|
|
268
|
+
depth: number;
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
export type InfiniteTableGroupColumnGetterOptions<T> = {
|
|
272
|
+
groupIndexForColumn?: number;
|
|
273
|
+
groupByForColumn?: DataSourceGroupBy<T>;
|
|
274
|
+
selectionMode: DataSourcePropSelectionMode;
|
|
275
|
+
groupRenderStrategy: InfiniteTablePropGroupRenderStrategy;
|
|
276
|
+
groupCount: number;
|
|
277
|
+
groupBy: DataSourceGroupBy<T>[];
|
|
278
|
+
pivotBy?: DataSourcePivotBy<T>[];
|
|
279
|
+
sortable?: boolean;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
export type InfiniteTablePivotColumnGetterOptions<
|
|
283
|
+
T,
|
|
284
|
+
COL_TYPE = InfiniteTableColumn<T>,
|
|
285
|
+
> = {
|
|
286
|
+
column: COL_TYPE;
|
|
287
|
+
groupBy: DataSourcePropGroupBy<T>;
|
|
288
|
+
pivotBy: DataSourcePropPivotBy<T>;
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
export type InfiniteTablePropGroupRenderStrategy =
|
|
292
|
+
| 'single-column'
|
|
293
|
+
// | 'single-column-extended'
|
|
294
|
+
| 'multi-column'
|
|
295
|
+
| 'inline';
|
|
296
|
+
export type InfiniteTableGroupColumnBase<T> = Partial<
|
|
297
|
+
InfiniteTableColumn<T>
|
|
298
|
+
> & {
|
|
299
|
+
renderGroupIcon?: InfiniteTableColumnRenderFunctionForGroupRows<T>;
|
|
300
|
+
id?: string;
|
|
301
|
+
};
|
|
302
|
+
export type InfiniteTablePivotColumnBase<T> = InfiniteTableColumn<T> & {
|
|
303
|
+
renderValue?: InfiniteTableColumnRenderFunction<
|
|
304
|
+
T,
|
|
305
|
+
InfiniteTableComputedPivotFinalColumn<T>
|
|
306
|
+
>;
|
|
307
|
+
// id?: string;
|
|
308
|
+
};
|
|
309
|
+
export type InfiniteTablePropGroupColumn<T> =
|
|
310
|
+
| InfiniteTableGroupColumnBase<T>
|
|
311
|
+
| InfiniteTableGroupColumnFunction<T>;
|
|
312
|
+
|
|
313
|
+
export type InfiniteTableGroupColumnFunction<T> = (
|
|
314
|
+
options: InfiniteTableGroupColumnGetterOptions<T>,
|
|
315
|
+
toggleGroupRow: (groupKeys: any[]) => void,
|
|
316
|
+
) => Partial<InfiniteTableGroupColumnBase<T>>;
|
|
317
|
+
export type InfiniteTablePropPivotColumn<
|
|
318
|
+
T,
|
|
319
|
+
COL_TYPE = InfiniteTableColumn<T>,
|
|
320
|
+
> =
|
|
321
|
+
| Partial<InfiniteTablePivotColumnBase<T>>
|
|
322
|
+
| ((
|
|
323
|
+
options: InfiniteTablePivotColumnGetterOptions<T, COL_TYPE>,
|
|
324
|
+
) => InfiniteTablePivotColumnBase<T>);
|
|
325
|
+
|
|
326
|
+
export type InfiniteTablePropComponents = {
|
|
327
|
+
LoadMask?: React.FC<React.PropsWithChildren<LoadMaskProps>>;
|
|
328
|
+
CheckBox?: React.FC<InfiniteCheckBoxProps>;
|
|
329
|
+
Menu?: React.FC<React.PropsWithChildren<MenuProps>>;
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
export type ScrollStopInfo = {
|
|
333
|
+
scrollTop: number;
|
|
334
|
+
firstVisibleRowIndex: number;
|
|
335
|
+
lastVisibleRowIndex: number;
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
export type InfiniteTablePropFilterEditors<T> = Record<
|
|
339
|
+
string,
|
|
340
|
+
React.FC<InfiniteTableFilterEditorProps<T>>
|
|
341
|
+
>;
|
|
342
|
+
|
|
343
|
+
export type InfiniteTableFilterEditorProps<T extends any> = {
|
|
344
|
+
filterType: string;
|
|
345
|
+
operator: string;
|
|
346
|
+
ariaLabel: string;
|
|
347
|
+
filterValue: T;
|
|
348
|
+
className: string;
|
|
349
|
+
onChange: (value: T | undefined) => void;
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
export interface InfiniteTableProps<T> {
|
|
353
|
+
columns: InfiniteTablePropColumns<T>;
|
|
354
|
+
pivotColumns?: InfiniteTableColumnsMap<T, InfiniteTablePivotColumn<T>>;
|
|
355
|
+
|
|
356
|
+
loadingText?: Renderable;
|
|
357
|
+
components?: InfiniteTablePropComponents;
|
|
358
|
+
|
|
359
|
+
viewportReservedWidth?: number;
|
|
360
|
+
onViewportReservedWidthChange?: (viewportReservedWidth: number) => void;
|
|
361
|
+
|
|
362
|
+
pivotColumn?: InfiniteTablePropPivotColumn<
|
|
363
|
+
T,
|
|
364
|
+
InfiniteTableColumn<T> & InfiniteTablePivotFinalColumn<T>
|
|
365
|
+
>;
|
|
366
|
+
|
|
367
|
+
pivotTotalColumnPosition?: InfiniteTablePropPivotTotalColumnPosition;
|
|
368
|
+
pivotGrandTotalColumnPosition?: InfiniteTablePropPivotGrandTotalColumnPosition;
|
|
369
|
+
|
|
370
|
+
groupColumn?: Partial<InfiniteTablePropGroupColumn<T>>;
|
|
371
|
+
groupRenderStrategy?: InfiniteTablePropGroupRenderStrategy;
|
|
372
|
+
hideEmptyGroupColumns?: boolean;
|
|
373
|
+
|
|
374
|
+
columnVisibility?: InfiniteTablePropColumnVisibility;
|
|
375
|
+
defaultColumnVisibility?: InfiniteTablePropColumnVisibility;
|
|
376
|
+
|
|
377
|
+
pinnedStartMaxWidth?: number;
|
|
378
|
+
pinnedEndMaxWidth?: number;
|
|
379
|
+
|
|
380
|
+
// filterableColumns?: Record<string, boolean>;
|
|
381
|
+
|
|
382
|
+
columnPinning?: InfiniteTablePropColumnPinning;
|
|
383
|
+
defaultColumnPinning?: InfiniteTablePropColumnPinning;
|
|
384
|
+
|
|
385
|
+
columnSizing?: InfiniteTablePropColumnSizing;
|
|
386
|
+
defaultColumnSizing?: InfiniteTablePropColumnSizing;
|
|
387
|
+
onColumnSizingChange?: (columnSizing: InfiniteTablePropColumnSizing) => void;
|
|
388
|
+
|
|
389
|
+
pivotColumnGroups?: InfiniteTablePropColumnGroups;
|
|
390
|
+
columnGroups?: InfiniteTablePropColumnGroups;
|
|
391
|
+
defaultColumnGroups?: InfiniteTablePropColumnGroups;
|
|
392
|
+
|
|
393
|
+
defaultCollapsedColumnGroups?: InfiniteTablePropCollapsedColumnGroups;
|
|
394
|
+
collapsedColumnGroups?: InfiniteTablePropCollapsedColumnGroups;
|
|
395
|
+
|
|
396
|
+
onScrollbarsChange?: (scrollbars: Scrollbars) => void;
|
|
397
|
+
|
|
398
|
+
// TODO P1 clarify columnVisibility as object only
|
|
399
|
+
onColumnVisibilityChange?: (
|
|
400
|
+
columnVisibility: InfiniteTablePropColumnVisibility,
|
|
401
|
+
) => void;
|
|
402
|
+
columnTypes?: InfiniteTablePropColumnTypes<T>;
|
|
403
|
+
// columnVisibilityAssumeVisible?: boolean;
|
|
404
|
+
|
|
405
|
+
showSeparatePivotColumnForSingleAggregation?: boolean;
|
|
406
|
+
|
|
407
|
+
rowHeight: number | string;
|
|
408
|
+
rowStyle?: InfiniteTablePropRowStyle<T>;
|
|
409
|
+
rowClassName?: InfiniteTablePropRowClassName<T>;
|
|
410
|
+
columnHeaderHeight: number | string;
|
|
411
|
+
domProps?: React.HTMLProps<HTMLDivElement>;
|
|
412
|
+
/**
|
|
413
|
+
* A unique identifier for the table instance. Will not be passed to the DOM.
|
|
414
|
+
*/
|
|
415
|
+
id?: string;
|
|
416
|
+
showZebraRows?: boolean;
|
|
417
|
+
showHoverRows?: boolean;
|
|
418
|
+
sortable?: boolean;
|
|
419
|
+
|
|
420
|
+
keyboardNavigation?: InfiniteTablePropKeyboardNavigation;
|
|
421
|
+
keyboardSelection?: InfiniteTablePropKeyboardSelection;
|
|
422
|
+
defaultActiveRowIndex?: number | null;
|
|
423
|
+
activeRowIndex?: number | null;
|
|
424
|
+
onActiveRowIndexChange?: (activeRowIndex: number) => void;
|
|
425
|
+
onActiveCellIndexChange?: (activeCellIndex: [number, number]) => void;
|
|
426
|
+
activeCellIndex?: [number, number] | null;
|
|
427
|
+
defaultActiveCellIndex?: [number, number] | null;
|
|
428
|
+
draggableColumns?: boolean;
|
|
429
|
+
header?: boolean;
|
|
430
|
+
headerOptions?: InfiniteTablePropHeaderOptions;
|
|
431
|
+
focusedClassName?: string;
|
|
432
|
+
focusedWithinClassName?: string;
|
|
433
|
+
focusedStyle?: React.CSSProperties;
|
|
434
|
+
focusedWithinStyle?: React.CSSProperties;
|
|
435
|
+
columnCssEllipsis?: boolean;
|
|
436
|
+
columnHeaderCssEllipsis?: boolean;
|
|
437
|
+
columnDefaultWidth?: number;
|
|
438
|
+
columnMinWidth?: number;
|
|
439
|
+
columnMaxWidth?: number;
|
|
440
|
+
|
|
441
|
+
hideColumnWhenGrouped?: boolean;
|
|
442
|
+
|
|
443
|
+
resizableColumns?: boolean;
|
|
444
|
+
virtualizeColumns?: InfiniteTablePropVirtualizeColumns<T>;
|
|
445
|
+
virtualizeRows?: boolean;
|
|
446
|
+
|
|
447
|
+
onSelfFocus?: (event: React.FocusEvent<HTMLDivElement>) => void;
|
|
448
|
+
onSelfBlur?: (event: React.FocusEvent<HTMLDivElement>) => void;
|
|
449
|
+
onFocusWithin?: (event: React.FocusEvent<HTMLDivElement>) => void;
|
|
450
|
+
onBlurWithin?: (event: React.FocusEvent<HTMLDivElement>) => void;
|
|
451
|
+
|
|
452
|
+
onScrollToTop?: () => void;
|
|
453
|
+
onScrollToBottom?: () => void;
|
|
454
|
+
scrollStopDelay?: number;
|
|
455
|
+
onScrollStop?: (param: ScrollStopInfo) => void;
|
|
456
|
+
scrollToBottomOffset?: number;
|
|
457
|
+
|
|
458
|
+
defaultColumnOrder?: InfiniteTablePropColumnOrder;
|
|
459
|
+
columnOrder?: InfiniteTablePropColumnOrder;
|
|
460
|
+
onColumnOrderChange?: (
|
|
461
|
+
columnOrder: InfiniteTablePropColumnOrderNormalized,
|
|
462
|
+
) => void;
|
|
463
|
+
onRowHeightChange?: (rowHeight: number) => void;
|
|
464
|
+
|
|
465
|
+
filterEditors?: InfiniteTablePropFilterEditors<T>;
|
|
466
|
+
|
|
467
|
+
onReady?: (api: InfiniteTableApi<T>) => void;
|
|
468
|
+
|
|
469
|
+
rowProps?:
|
|
470
|
+
| React.HTMLProps<HTMLDivElement>
|
|
471
|
+
| ((
|
|
472
|
+
rowArgs: InfiniteTableRowStyleFnParams<T>,
|
|
473
|
+
) => React.HTMLProps<HTMLDivElement>);
|
|
474
|
+
|
|
475
|
+
licenseKey?: string;
|
|
476
|
+
|
|
477
|
+
scrollTopKey?: string | number;
|
|
478
|
+
autoSizeColumnsKey?: InfiniteTablePropAutoSizeColumnsKey;
|
|
479
|
+
|
|
480
|
+
getColumContextMenuItems?: (params: {
|
|
481
|
+
column: InfiniteTableComputedColumn<T>;
|
|
482
|
+
api: InfiniteTableApi<T>;
|
|
483
|
+
getState: () => InfiniteTableState<T>;
|
|
484
|
+
getComputed: () => InfiniteTableComputedValues<T>;
|
|
485
|
+
actions: InfiniteTableActions<T>;
|
|
486
|
+
}) => MenuProps['items'];
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
export type InfiniteTablePropKeyboardNavigation = 'cell' | 'row' | false;
|
|
490
|
+
export type InfiniteTablePropKeyboardSelection = boolean;
|
|
491
|
+
|
|
492
|
+
export type InfiniteTablePropHeaderOptions = {
|
|
493
|
+
alwaysReserveSpaceForSortIcon: boolean;
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
export type InfiniteTablePropAutoSizeColumnsKey =
|
|
497
|
+
| string
|
|
498
|
+
| number
|
|
499
|
+
| {
|
|
500
|
+
key: string | number;
|
|
501
|
+
columnsToSkip?: string[];
|
|
502
|
+
columnsToResize?: string[];
|
|
503
|
+
includeHeader?: boolean;
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
export type Scrollbars = {
|
|
507
|
+
vertical: boolean;
|
|
508
|
+
horizontal: boolean;
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
export type ScrollAdjustPosition = 'start' | 'end' | 'center';
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import type { KeyboardEvent, MouseEvent, MutableRefObject } from 'react';
|
|
2
|
+
import { DataSourceGroupBy, DataSourceProps } from '../../DataSource/types';
|
|
3
|
+
import { ReactHeadlessTableRenderer } from '../../HeadlessTable/ReactHeadlessTableRenderer';
|
|
4
|
+
import { ComponentStateActions } from '../../hooks/useComponentState/types';
|
|
5
|
+
import { CellPosition } from '../../types/CellPosition';
|
|
6
|
+
import type { NonUndefined } from '../../types/NonUndefined';
|
|
7
|
+
import { Renderable } from '../../types/Renderable';
|
|
8
|
+
import type { ScrollPosition } from '../../types/ScrollPosition';
|
|
9
|
+
import type { Size } from '../../types/Size';
|
|
10
|
+
import { SubscriptionCallback } from '../../types/SubscriptionCallback';
|
|
11
|
+
|
|
12
|
+
import { MatrixBrain } from '../../VirtualBrain/MatrixBrain';
|
|
13
|
+
import { ScrollListener } from '../../VirtualBrain/ScrollListener';
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
InfiniteTableColumn,
|
|
17
|
+
InfiniteTableComputedColumn,
|
|
18
|
+
} from './InfiniteTableColumn';
|
|
19
|
+
import type {
|
|
20
|
+
InfiniteTableColumnGroup,
|
|
21
|
+
InfiniteTablePropColumnGroupsMap,
|
|
22
|
+
InfiniteTablePropColumnPinning,
|
|
23
|
+
InfiniteTablePropColumnSizing,
|
|
24
|
+
InfiniteTableColumnsMap,
|
|
25
|
+
InfiniteTablePropColumnTypes,
|
|
26
|
+
InfiniteTablePropColumnVisibility,
|
|
27
|
+
InfiniteTableProps,
|
|
28
|
+
} from './InfiniteTableProps';
|
|
29
|
+
|
|
30
|
+
export type GroupByMap<T> = Map<
|
|
31
|
+
keyof T,
|
|
32
|
+
{ groupBy: DataSourceGroupBy<T>; groupIndex: number }
|
|
33
|
+
>;
|
|
34
|
+
|
|
35
|
+
export interface InfiniteTableSetupState<T> {
|
|
36
|
+
renderer: ReactHeadlessTableRenderer;
|
|
37
|
+
onRenderUpdater: SubscriptionCallback<Renderable>;
|
|
38
|
+
propsCache: Map<keyof InfiniteTableProps<T>, WeakMap<any, any>>;
|
|
39
|
+
columnsWhenInlineGroupRenderStrategy?: Map<string, InfiniteTableColumn<T>>;
|
|
40
|
+
domRef: MutableRefObject<HTMLDivElement | null>;
|
|
41
|
+
scrollerDOMRef: MutableRefObject<HTMLDivElement | null>;
|
|
42
|
+
portalDOMRef: MutableRefObject<HTMLDivElement | null>;
|
|
43
|
+
activeCellIndicatorDOMRef: MutableRefObject<HTMLDivElement | null>;
|
|
44
|
+
onRowHeightCSSVarChange: SubscriptionCallback<number>;
|
|
45
|
+
onColumnMenuClick: SubscriptionCallback<{
|
|
46
|
+
target: HTMLElement;
|
|
47
|
+
column: InfiniteTableComputedColumn<T>;
|
|
48
|
+
}>;
|
|
49
|
+
columnContextMenuVisibleForColumnId: string | null;
|
|
50
|
+
onColumnHeaderHeightCSSVarChange: SubscriptionCallback<number>;
|
|
51
|
+
cellClick: SubscriptionCallback<CellPosition & { event: MouseEvent }>;
|
|
52
|
+
cellMouseDown: SubscriptionCallback<CellPosition & { event: MouseEvent }>;
|
|
53
|
+
keyDown: SubscriptionCallback<KeyboardEvent>;
|
|
54
|
+
columnsWhenGrouping?: InfiniteTableColumnsMap<T>;
|
|
55
|
+
bodySize: Size;
|
|
56
|
+
brain: MatrixBrain;
|
|
57
|
+
headerBrain: MatrixBrain;
|
|
58
|
+
focused: boolean;
|
|
59
|
+
ready: boolean;
|
|
60
|
+
columnReorderDragColumnId: false | string;
|
|
61
|
+
columnVisibilityForGrouping: Record<string, false>;
|
|
62
|
+
focusedWithin: boolean;
|
|
63
|
+
scrollPosition: ScrollPosition;
|
|
64
|
+
pinnedStartScrollListener: ScrollListener;
|
|
65
|
+
pinnedEndScrollListener: ScrollListener;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type InfiniteTableColumnGroupWithDepth = InfiniteTableColumnGroup & {
|
|
69
|
+
depth: number;
|
|
70
|
+
};
|
|
71
|
+
export type InfiniteTableColumnGroupsDepthsMap = Map<string, number>;
|
|
72
|
+
|
|
73
|
+
export type InfiniteTablePropPivotTotalColumnPosition = false | 'start' | 'end';
|
|
74
|
+
export type InfiniteTablePropPivotGrandTotalColumnPosition =
|
|
75
|
+
InfiniteTablePropPivotTotalColumnPosition;
|
|
76
|
+
|
|
77
|
+
export interface InfiniteTableMappedState<T> {
|
|
78
|
+
id: InfiniteTableProps<T>['id'];
|
|
79
|
+
scrollTopKey: InfiniteTableProps<T>['scrollTopKey'];
|
|
80
|
+
viewportReservedWidth: InfiniteTableProps<T>['viewportReservedWidth'];
|
|
81
|
+
resizableColumns: InfiniteTableProps<T>['resizableColumns'];
|
|
82
|
+
groupColumn: InfiniteTableProps<T>['groupColumn'];
|
|
83
|
+
headerOptions: NonUndefined<InfiniteTableProps<T>['headerOptions']>;
|
|
84
|
+
|
|
85
|
+
onScrollbarsChange: InfiniteTableProps<T>['onScrollbarsChange'];
|
|
86
|
+
|
|
87
|
+
getColumContextMenuItems: InfiniteTableProps<T>['getColumContextMenuItems'];
|
|
88
|
+
|
|
89
|
+
columnPinning: InfiniteTablePropColumnPinning;
|
|
90
|
+
|
|
91
|
+
loadingText: InfiniteTableProps<T>['loadingText'];
|
|
92
|
+
components: InfiniteTableProps<T>['components'];
|
|
93
|
+
columns: InfiniteTableColumnsMap<T>;
|
|
94
|
+
pivotColumns: InfiniteTableProps<T>['pivotColumns'];
|
|
95
|
+
onReady: InfiniteTableProps<T>['onReady'];
|
|
96
|
+
|
|
97
|
+
onSelfFocus: InfiniteTableProps<T>['onSelfFocus'];
|
|
98
|
+
onSelfBlur: InfiniteTableProps<T>['onSelfBlur'];
|
|
99
|
+
onFocusWithin: InfiniteTableProps<T>['onFocusWithin'];
|
|
100
|
+
onBlurWithin: InfiniteTableProps<T>['onBlurWithin'];
|
|
101
|
+
|
|
102
|
+
autoSizeColumnsKey: InfiniteTableProps<T>['autoSizeColumnsKey'];
|
|
103
|
+
|
|
104
|
+
activeRowIndex: InfiniteTableProps<T>['activeRowIndex'];
|
|
105
|
+
activeCellIndex: InfiniteTableProps<T>['activeCellIndex'];
|
|
106
|
+
scrollStopDelay: NonUndefined<InfiniteTableProps<T>['scrollStopDelay']>;
|
|
107
|
+
onScrollToTop: InfiniteTableProps<T>['onScrollToTop'];
|
|
108
|
+
onScrollToBottom: InfiniteTableProps<T>['onScrollToBottom'];
|
|
109
|
+
onScrollStop: InfiniteTableProps<T>['onScrollStop'];
|
|
110
|
+
scrollToBottomOffset: InfiniteTableProps<T>['scrollToBottomOffset'];
|
|
111
|
+
|
|
112
|
+
filterEditors: NonUndefined<InfiniteTableProps<T>['filterEditors']>;
|
|
113
|
+
|
|
114
|
+
focusedClassName: InfiniteTableProps<T>['focusedClassName'];
|
|
115
|
+
focusedWithinClassName: InfiniteTableProps<T>['focusedWithinClassName'];
|
|
116
|
+
focusedStyle: InfiniteTableProps<T>['focusedStyle'];
|
|
117
|
+
focusedWithinStyle: InfiniteTableProps<T>['focusedWithinStyle'];
|
|
118
|
+
showSeparatePivotColumnForSingleAggregation: NonUndefined<
|
|
119
|
+
InfiniteTableProps<T>['showSeparatePivotColumnForSingleAggregation']
|
|
120
|
+
>;
|
|
121
|
+
domProps: InfiniteTableProps<T>['domProps'];
|
|
122
|
+
rowStyle: InfiniteTableProps<T>['rowStyle'];
|
|
123
|
+
rowProps: InfiniteTableProps<T>['rowProps'];
|
|
124
|
+
rowClassName: InfiniteTableProps<T>['rowClassName'];
|
|
125
|
+
pinnedStartMaxWidth: InfiniteTableProps<T>['pinnedStartMaxWidth'];
|
|
126
|
+
pinnedEndMaxWidth: InfiniteTableProps<T>['pinnedEndMaxWidth'];
|
|
127
|
+
pivotColumn: InfiniteTableProps<T>['pivotColumn'];
|
|
128
|
+
pivotColumnGroups: InfiniteTablePropColumnGroupsMap;
|
|
129
|
+
|
|
130
|
+
columnMinWidth: NonUndefined<InfiniteTableProps<T>['columnMinWidth']>;
|
|
131
|
+
columnMaxWidth: NonUndefined<InfiniteTableProps<T>['columnMaxWidth']>;
|
|
132
|
+
columnDefaultWidth: NonUndefined<InfiniteTableProps<T>['columnDefaultWidth']>;
|
|
133
|
+
columnCssEllipsis: NonUndefined<InfiniteTableProps<T>['columnCssEllipsis']>;
|
|
134
|
+
|
|
135
|
+
draggableColumns: NonUndefined<InfiniteTableProps<T>['draggableColumns']>;
|
|
136
|
+
sortable: NonUndefined<InfiniteTableProps<T>['sortable']>;
|
|
137
|
+
hideEmptyGroupColumns: NonUndefined<
|
|
138
|
+
InfiniteTableProps<T>['hideEmptyGroupColumns']
|
|
139
|
+
>;
|
|
140
|
+
hideColumnWhenGrouped: NonUndefined<
|
|
141
|
+
InfiniteTableProps<T>['hideColumnWhenGrouped']
|
|
142
|
+
>;
|
|
143
|
+
keyboardSelection: NonUndefined<InfiniteTableProps<T>['keyboardSelection']>;
|
|
144
|
+
columnOrder: NonUndefined<InfiniteTableProps<T>['columnOrder']>;
|
|
145
|
+
showZebraRows: NonUndefined<InfiniteTableProps<T>['showZebraRows']>;
|
|
146
|
+
showHoverRows: NonUndefined<InfiniteTableProps<T>['showHoverRows']>;
|
|
147
|
+
header: NonUndefined<InfiniteTableProps<T>['header']>;
|
|
148
|
+
virtualizeColumns: NonUndefined<InfiniteTableProps<T>['virtualizeColumns']>;
|
|
149
|
+
rowHeight: number;
|
|
150
|
+
columnHeaderHeight: number;
|
|
151
|
+
licenseKey: NonUndefined<InfiniteTableProps<T>['licenseKey']>;
|
|
152
|
+
columnVisibility: InfiniteTablePropColumnVisibility;
|
|
153
|
+
|
|
154
|
+
columnSizing: InfiniteTablePropColumnSizing;
|
|
155
|
+
columnTypes: InfiniteTablePropColumnTypes<T>;
|
|
156
|
+
columnGroups: InfiniteTablePropColumnGroupsMap;
|
|
157
|
+
collapsedColumnGroups: NonUndefined<
|
|
158
|
+
InfiniteTableProps<T>['collapsedColumnGroups']
|
|
159
|
+
>;
|
|
160
|
+
pivotTotalColumnPosition: NonUndefined<
|
|
161
|
+
InfiniteTableProps<T>['pivotTotalColumnPosition']
|
|
162
|
+
>;
|
|
163
|
+
pivotGrandTotalColumnPosition: InfiniteTableProps<T>['pivotGrandTotalColumnPosition'];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface InfiniteTableDerivedState<T> {
|
|
167
|
+
groupBy: DataSourceProps<T>['groupBy'];
|
|
168
|
+
computedColumns: Map<string, InfiniteTableColumn<T>>;
|
|
169
|
+
initialColumns: InfiniteTableProps<T>['columns'];
|
|
170
|
+
|
|
171
|
+
groupRenderStrategy: NonUndefined<
|
|
172
|
+
InfiniteTableProps<T>['groupRenderStrategy']
|
|
173
|
+
>;
|
|
174
|
+
|
|
175
|
+
columnHeaderCssEllipsis: NonUndefined<
|
|
176
|
+
InfiniteTableProps<T>['columnHeaderCssEllipsis']
|
|
177
|
+
>;
|
|
178
|
+
keyboardNavigation: NonUndefined<InfiniteTableProps<T>['keyboardNavigation']>;
|
|
179
|
+
|
|
180
|
+
columnGroupsDepthsMap: InfiniteTableColumnGroupsDepthsMap;
|
|
181
|
+
columnGroupsMaxDepth: number;
|
|
182
|
+
computedColumnGroups: InfiniteTablePropColumnGroupsMap;
|
|
183
|
+
|
|
184
|
+
rowHeightCSSVar: string;
|
|
185
|
+
columnHeaderHeightCSSVar: string;
|
|
186
|
+
controlledColumnVisibility: boolean;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export type InfiniteTableActions<T> = ComponentStateActions<
|
|
190
|
+
InfiniteTableState<T>
|
|
191
|
+
>;
|
|
192
|
+
export interface InfiniteTableState<T>
|
|
193
|
+
extends InfiniteTableMappedState<T>,
|
|
194
|
+
InfiniteTableDerivedState<T>,
|
|
195
|
+
InfiniteTableSetupState<T> {}
|