@infinite-table/infinite-react 0.4.13 → 0.5.1
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 +102 -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,478 @@
|
|
|
1
|
+
import { CSSProperties, HTMLProps } from 'react';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
AggregationReducer,
|
|
5
|
+
InfiniteTableRowInfo,
|
|
6
|
+
InfiniteTableRowInfoDataDiscriminator,
|
|
7
|
+
InfiniteTable_HasGrouping_RowInfoGroup,
|
|
8
|
+
PivotBy,
|
|
9
|
+
} from '../../../utils/groupAndPivot';
|
|
10
|
+
import type {
|
|
11
|
+
ColumnTypeWithInherit,
|
|
12
|
+
DataSourceFilterValueItem,
|
|
13
|
+
DataSourcePivotBy,
|
|
14
|
+
DataSourcePropSelectionMode,
|
|
15
|
+
DataSourceSingleSortInfo,
|
|
16
|
+
DataSourceState,
|
|
17
|
+
} from '../../DataSource/types';
|
|
18
|
+
import type { Renderable } from '../../types/Renderable';
|
|
19
|
+
import { InfiniteTableCellProps } from '../components/InfiniteTableRow/InfiniteTableCellTypes';
|
|
20
|
+
|
|
21
|
+
import {
|
|
22
|
+
InfiniteTableColumnPinnedValues,
|
|
23
|
+
InfiniteTableColumnType,
|
|
24
|
+
} from './InfiniteTableProps';
|
|
25
|
+
import type {
|
|
26
|
+
DiscriminatedUnion,
|
|
27
|
+
KeyOfNoSymbol,
|
|
28
|
+
RequireAtLeastOne,
|
|
29
|
+
} from './Utility';
|
|
30
|
+
|
|
31
|
+
import type { InfiniteTableApi, InfiniteTableColumnGroup } from '.';
|
|
32
|
+
|
|
33
|
+
export type { DiscriminatedUnion, RequireAtLeastOne };
|
|
34
|
+
|
|
35
|
+
export type InfiniteTableToggleGroupRowFn = (groupKeys: any[]) => void;
|
|
36
|
+
export type InfiniteTableSelectRowFn = (id: any) => void;
|
|
37
|
+
export type InfiniteTableIsRowSelectedFn = (id: any) => boolean;
|
|
38
|
+
export type InfiniteTableIsGroupRowSelectedFn = (groupKeys: any[]) => boolean;
|
|
39
|
+
|
|
40
|
+
export type InfiniteTableColumnHeaderParam<
|
|
41
|
+
DATA_TYPE,
|
|
42
|
+
COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>,
|
|
43
|
+
> = {
|
|
44
|
+
domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
|
|
45
|
+
dragging: boolean;
|
|
46
|
+
column: COL_TYPE;
|
|
47
|
+
columnsMap: Map<string, COL_TYPE>;
|
|
48
|
+
columnSortInfo: DataSourceSingleSortInfo<DATA_TYPE> | null;
|
|
49
|
+
columnFilterValue: DataSourceFilterValueItem<DATA_TYPE> | null;
|
|
50
|
+
selectionMode: DataSourcePropSelectionMode;
|
|
51
|
+
allRowsSelected: boolean;
|
|
52
|
+
someRowsSelected: boolean;
|
|
53
|
+
api: InfiniteTableApi<DATA_TYPE>;
|
|
54
|
+
|
|
55
|
+
renderBag: {
|
|
56
|
+
header: string | number | Renderable;
|
|
57
|
+
sortIcon?: Renderable;
|
|
58
|
+
menuIcon?: Renderable;
|
|
59
|
+
selectionCheckBox?: Renderable;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export type InfiniteTableColumnRenderBag = {
|
|
64
|
+
value: string | number | Renderable;
|
|
65
|
+
groupIcon?: Renderable;
|
|
66
|
+
selectionCheckBox?: Renderable;
|
|
67
|
+
};
|
|
68
|
+
export type InfiniteTableColumnRenderParamBase<
|
|
69
|
+
DATA_TYPE,
|
|
70
|
+
COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>,
|
|
71
|
+
> = {
|
|
72
|
+
domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
|
|
73
|
+
|
|
74
|
+
// TODO type this to be the type of DATA_TYPE[column.field] if possible
|
|
75
|
+
value: string | number | Renderable;
|
|
76
|
+
|
|
77
|
+
renderBag: InfiniteTableColumnRenderBag;
|
|
78
|
+
rowIndex: number;
|
|
79
|
+
rowActive: boolean;
|
|
80
|
+
|
|
81
|
+
api: InfiniteTableApi<DATA_TYPE>;
|
|
82
|
+
|
|
83
|
+
column: COL_TYPE;
|
|
84
|
+
columnsMap: Map<string, COL_TYPE>;
|
|
85
|
+
fieldsToColumn: Map<keyof DATA_TYPE, COL_TYPE>;
|
|
86
|
+
groupByColumn?: InfiniteTableComputedColumn<DATA_TYPE>;
|
|
87
|
+
toggleCurrentGroupRow: () => void;
|
|
88
|
+
toggleGroupRow: InfiniteTableToggleGroupRowFn;
|
|
89
|
+
toggleCurrentGroupRowSelection: () => void;
|
|
90
|
+
toggleCurrentRowSelection: () => void;
|
|
91
|
+
|
|
92
|
+
selectCurrentRow: () => void;
|
|
93
|
+
selectRow: InfiniteTableSelectRowFn;
|
|
94
|
+
deselectRow: InfiniteTableSelectRowFn;
|
|
95
|
+
deselectCurrentRow: () => void;
|
|
96
|
+
|
|
97
|
+
toggleRowSelection: InfiniteTableSelectRowFn;
|
|
98
|
+
toggleGroupRowSelection: InfiniteTableToggleGroupRowFn;
|
|
99
|
+
selectionMode: DataSourcePropSelectionMode | undefined;
|
|
100
|
+
rootGroupBy: DataSourceState<DATA_TYPE>['groupBy'];
|
|
101
|
+
pivotBy?: DataSourceState<DATA_TYPE>['pivotBy'];
|
|
102
|
+
};
|
|
103
|
+
export type InfiniteTableColumnRenderParam<
|
|
104
|
+
DATA_TYPE,
|
|
105
|
+
COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>,
|
|
106
|
+
> = InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE> &
|
|
107
|
+
InfiniteTableRowInfoDataDiscriminator<DATA_TYPE>;
|
|
108
|
+
|
|
109
|
+
export type InfiniteTableGroupColumnRenderParams<
|
|
110
|
+
DATA_TYPE,
|
|
111
|
+
COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>,
|
|
112
|
+
> = InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE> & {
|
|
113
|
+
rowInfo: InfiniteTable_HasGrouping_RowInfoGroup<DATA_TYPE>;
|
|
114
|
+
isGroupRow: true;
|
|
115
|
+
data: Partial<DATA_TYPE> | null;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export type InfiniteTableColumnCellContextType<DATA_TYPE> =
|
|
119
|
+
InfiniteTableColumnRenderParam<DATA_TYPE> & {};
|
|
120
|
+
export type InfiniteTableHeaderCellContextType<DATA_TYPE> =
|
|
121
|
+
InfiniteTableColumnHeaderParam<DATA_TYPE> & {};
|
|
122
|
+
|
|
123
|
+
export type InfiniteTableGroupColumnRenderIconParam<
|
|
124
|
+
DATA_TYPE,
|
|
125
|
+
COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>,
|
|
126
|
+
> = InfiniteTableGroupColumnRenderParams<DATA_TYPE, COL_TYPE> & {
|
|
127
|
+
collapsed: boolean;
|
|
128
|
+
groupIcon: Renderable;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export type InfiniteTableColumnRenderValueParam<
|
|
132
|
+
DATA_TYPE,
|
|
133
|
+
COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>,
|
|
134
|
+
> = InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>;
|
|
135
|
+
|
|
136
|
+
export type InfiniteTableColumnRowspanParam<
|
|
137
|
+
DATA_TYPE,
|
|
138
|
+
COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>,
|
|
139
|
+
> = {
|
|
140
|
+
rowInfo: InfiniteTableRowInfo<DATA_TYPE>;
|
|
141
|
+
data: DATA_TYPE | Partial<DATA_TYPE> | null;
|
|
142
|
+
dataArray: InfiniteTableRowInfo<DATA_TYPE>[];
|
|
143
|
+
rowIndex: number;
|
|
144
|
+
column: COL_TYPE;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export type InfiniteTableColumnColspanParam<
|
|
148
|
+
DATA_TYPE,
|
|
149
|
+
COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>,
|
|
150
|
+
> = {
|
|
151
|
+
rowInfo: InfiniteTableRowInfo<DATA_TYPE>;
|
|
152
|
+
data: DATA_TYPE | Partial<DATA_TYPE> | null;
|
|
153
|
+
dataArray: InfiniteTableRowInfo<DATA_TYPE>[];
|
|
154
|
+
rowIndex: number;
|
|
155
|
+
column: COL_TYPE;
|
|
156
|
+
computedVisibleIndex: number;
|
|
157
|
+
computedVisibleColumns: COL_TYPE[];
|
|
158
|
+
computedPinnedStartColumns: COL_TYPE[];
|
|
159
|
+
computedPinnedEndColumns: COL_TYPE[];
|
|
160
|
+
computedUnpinnedColumns: COL_TYPE[];
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export type InfiniteTableColumnRenderFunctionForGroupRows<
|
|
164
|
+
DATA_TYPE,
|
|
165
|
+
COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>,
|
|
166
|
+
> = (
|
|
167
|
+
renderParams: InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE> & {
|
|
168
|
+
isGroupRow: true;
|
|
169
|
+
},
|
|
170
|
+
) => Renderable | null;
|
|
171
|
+
|
|
172
|
+
export type InfiniteTableColumnRenderFunctionForNormalRows<
|
|
173
|
+
DATA_TYPE,
|
|
174
|
+
COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>,
|
|
175
|
+
> = (
|
|
176
|
+
renderParams: InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE> & {
|
|
177
|
+
isGroupRow: false;
|
|
178
|
+
},
|
|
179
|
+
) => Renderable | null;
|
|
180
|
+
export type InfiniteTableColumnRenderFunction<
|
|
181
|
+
DATA_TYPE,
|
|
182
|
+
COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>,
|
|
183
|
+
> = (
|
|
184
|
+
renderParams: InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>,
|
|
185
|
+
) => Renderable | null;
|
|
186
|
+
|
|
187
|
+
export type InfiniteTableGroupColumnRenderFunction<
|
|
188
|
+
DATA_TYPE,
|
|
189
|
+
COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>,
|
|
190
|
+
> = (
|
|
191
|
+
renderParams: InfiniteTableGroupColumnRenderParams<DATA_TYPE, COL_TYPE>,
|
|
192
|
+
) => Renderable | null;
|
|
193
|
+
|
|
194
|
+
export type InfiniteTableColumnRenderValueFunction<
|
|
195
|
+
DATA_TYPE,
|
|
196
|
+
COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>,
|
|
197
|
+
> = InfiniteTableColumnRenderFunction<DATA_TYPE, COL_TYPE>;
|
|
198
|
+
|
|
199
|
+
export type InfiniteTableColumnHeaderRenderFunction<T> = (
|
|
200
|
+
headerParams: InfiniteTableColumnHeaderParam<T>,
|
|
201
|
+
) => Renderable;
|
|
202
|
+
|
|
203
|
+
export type InfiniteTableColumnWithField<T> = {
|
|
204
|
+
field: keyof T;
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
export type InfiniteTableColumnWithRender<T> = {
|
|
208
|
+
render: InfiniteTableColumnRenderFunction<T>;
|
|
209
|
+
};
|
|
210
|
+
export type InfiniteTableColumnWithRenderValue<T> = {
|
|
211
|
+
renderValue: InfiniteTableColumnRenderFunction<T>;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
export type InfiniteTableColumnAlign = 'start' | 'center' | 'end';
|
|
215
|
+
export type InfiniteTableColumnVerticalAlign = 'start' | 'center' | 'end';
|
|
216
|
+
|
|
217
|
+
export type InfiniteTableColumnHeader<T> =
|
|
218
|
+
| Renderable
|
|
219
|
+
| InfiniteTableColumnHeaderRenderFunction<T>;
|
|
220
|
+
|
|
221
|
+
export type InfiniteTableDataTypeNames = 'string' | 'number' | 'date' | string;
|
|
222
|
+
|
|
223
|
+
export type InfiniteTableColumnTypeNames =
|
|
224
|
+
| 'string'
|
|
225
|
+
| 'number'
|
|
226
|
+
| 'date'
|
|
227
|
+
| string;
|
|
228
|
+
|
|
229
|
+
// field|valueGetter => THE_VALUE
|
|
230
|
+
// |
|
|
231
|
+
// \/
|
|
232
|
+
export type InfiniteTableColumnWithRenderDescriptor<T> = RequireAtLeastOne<
|
|
233
|
+
{
|
|
234
|
+
/**
|
|
235
|
+
* Determines the field property of the column.
|
|
236
|
+
*/
|
|
237
|
+
field?: keyof T;
|
|
238
|
+
render?: InfiniteTableColumnRenderFunction<T>;
|
|
239
|
+
renderValue?: InfiniteTableColumnRenderFunction<T>;
|
|
240
|
+
valueGetter?: InfiniteTableColumnValueGetter<T>;
|
|
241
|
+
valueFormatter?: InfiniteTableColumnValueFormatter<T>;
|
|
242
|
+
},
|
|
243
|
+
'render' | 'renderValue' | 'field' | 'valueGetter' | 'valueFormatter'
|
|
244
|
+
>;
|
|
245
|
+
|
|
246
|
+
export type InfiniteTableColumnStyleFnParams<T> = {
|
|
247
|
+
value: Renderable;
|
|
248
|
+
column: InfiniteTableComputedColumn<T>;
|
|
249
|
+
} & InfiniteTableRowInfoDataDiscriminator<T>;
|
|
250
|
+
|
|
251
|
+
export type InfiniteTableColumnStyleFn<T> = (
|
|
252
|
+
params: InfiniteTableColumnStyleFnParams<T>,
|
|
253
|
+
) => undefined | React.CSSProperties;
|
|
254
|
+
|
|
255
|
+
export type InfiniteTableColumnHeaderClassNameFn<T> = (
|
|
256
|
+
params: InfiniteTableColumnHeaderParam<T>,
|
|
257
|
+
) => undefined | string;
|
|
258
|
+
|
|
259
|
+
export type InfiniteTableColumnHeaderStyleFn<T> = (
|
|
260
|
+
params: InfiniteTableColumnHeaderParam<T>,
|
|
261
|
+
) => undefined | React.CSSProperties;
|
|
262
|
+
|
|
263
|
+
export type InfiniteTableColumnClassNameFn<T> = (
|
|
264
|
+
params: InfiniteTableColumnStyleFnParams<T>,
|
|
265
|
+
) => undefined | string;
|
|
266
|
+
|
|
267
|
+
export type InfiniteTableColumnStyle<T> =
|
|
268
|
+
| CSSProperties
|
|
269
|
+
| InfiniteTableColumnStyleFn<T>;
|
|
270
|
+
|
|
271
|
+
export type InfiniteTableColumnHeaderStyle<T> =
|
|
272
|
+
| CSSProperties
|
|
273
|
+
| InfiniteTableColumnHeaderStyleFn<T>;
|
|
274
|
+
export type InfiniteTableColumnClassName<T> =
|
|
275
|
+
| string
|
|
276
|
+
| InfiniteTableColumnClassNameFn<T>;
|
|
277
|
+
export type InfiniteTableColumnHeaderClassName<T> =
|
|
278
|
+
| string
|
|
279
|
+
| InfiniteTableColumnHeaderClassNameFn<T>;
|
|
280
|
+
|
|
281
|
+
export type InfiniteTableColumnValueGetterParams<T> = {
|
|
282
|
+
data: T;
|
|
283
|
+
field?: keyof T;
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
export type InfiniteTableColumnValueFormatterParams<T> =
|
|
287
|
+
InfiniteTableRowInfoDataDiscriminator<T>;
|
|
288
|
+
|
|
289
|
+
export type InfiniteTableColumnValueGetter<
|
|
290
|
+
T,
|
|
291
|
+
VALUE_GETTER_TYPE = string | number | boolean | Date | null | undefined,
|
|
292
|
+
> = (params: InfiniteTableColumnValueGetterParams<T>) => VALUE_GETTER_TYPE;
|
|
293
|
+
export type InfiniteTableColumnValueFormatter<
|
|
294
|
+
T,
|
|
295
|
+
VALUE_FORMATTER_TYPE = string | number | boolean | Date | null | undefined,
|
|
296
|
+
> = (
|
|
297
|
+
params: InfiniteTableColumnValueFormatterParams<T>,
|
|
298
|
+
) => VALUE_FORMATTER_TYPE;
|
|
299
|
+
|
|
300
|
+
export type InfiniteTableColumnRowspanFn<T> = (
|
|
301
|
+
params: InfiniteTableColumnRowspanParam<T>,
|
|
302
|
+
) => number;
|
|
303
|
+
export type InfiniteTableColumnColspanFn<T> = (
|
|
304
|
+
params: InfiniteTableColumnColspanParam<T>,
|
|
305
|
+
) => number;
|
|
306
|
+
|
|
307
|
+
export type InfiniteTableColumnComparer<T> = (a: T, b: T) => number;
|
|
308
|
+
|
|
309
|
+
export type InfiniteTableColumnSortableFn<T> = (context: {
|
|
310
|
+
column: InfiniteTableComputedColumn<T>;
|
|
311
|
+
columns: Map<string, InfiniteTableComputedColumn<T>>;
|
|
312
|
+
}) => boolean;
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Defines a column in the table.
|
|
316
|
+
*
|
|
317
|
+
* @typeParam DATA_TYPE The type of the data in the table.
|
|
318
|
+
*
|
|
319
|
+
* Can be bound to a field which is a `keyof DATA_TYPE`.
|
|
320
|
+
*/
|
|
321
|
+
export type InfiniteTableColumn<DATA_TYPE> = {
|
|
322
|
+
sortable?: boolean;
|
|
323
|
+
draggable?: boolean;
|
|
324
|
+
resizable?: boolean;
|
|
325
|
+
|
|
326
|
+
comparer?: InfiniteTableColumnComparer<DATA_TYPE>;
|
|
327
|
+
defaultHiddenWhenGroupedBy?:
|
|
328
|
+
| '*'
|
|
329
|
+
| true
|
|
330
|
+
| keyof DATA_TYPE
|
|
331
|
+
| { [k in keyof Partial<DATA_TYPE>]: true };
|
|
332
|
+
|
|
333
|
+
align?: InfiniteTableColumnAlign;
|
|
334
|
+
verticalAlign?: InfiniteTableColumnVerticalAlign;
|
|
335
|
+
columnGroup?: string;
|
|
336
|
+
|
|
337
|
+
header?: InfiniteTableColumnHeader<DATA_TYPE>;
|
|
338
|
+
renderHeader?: InfiniteTableColumnHeaderRenderFunction<DATA_TYPE>;
|
|
339
|
+
name?: Renderable;
|
|
340
|
+
cssEllipsis?: boolean;
|
|
341
|
+
headerCssEllipsis?: boolean;
|
|
342
|
+
type?: InfiniteTableColumnTypeNames | InfiniteTableColumnTypeNames[] | null;
|
|
343
|
+
dataType?: InfiniteTableDataTypeNames;
|
|
344
|
+
sortType?: string;
|
|
345
|
+
filterType?: string;
|
|
346
|
+
|
|
347
|
+
style?: InfiniteTableColumnStyle<DATA_TYPE>;
|
|
348
|
+
headerStyle?: InfiniteTableColumnHeaderStyle<DATA_TYPE>;
|
|
349
|
+
headerClassName?: InfiniteTableColumnHeaderClassName<DATA_TYPE>;
|
|
350
|
+
className?: InfiniteTableColumnClassName<DATA_TYPE>;
|
|
351
|
+
|
|
352
|
+
rowspan?: InfiniteTableColumnRowspanFn<DATA_TYPE>;
|
|
353
|
+
// colspan?: InfiniteTableColumnColspanFn<T>;
|
|
354
|
+
|
|
355
|
+
field?: KeyOfNoSymbol<DATA_TYPE>;
|
|
356
|
+
render?: InfiniteTableColumnRenderFunction<DATA_TYPE>;
|
|
357
|
+
renderValue?: InfiniteTableColumnRenderFunction<DATA_TYPE>;
|
|
358
|
+
renderGroupValue?: InfiniteTableColumnRenderFunctionForGroupRows<DATA_TYPE>;
|
|
359
|
+
renderLeafValue?: InfiniteTableColumnRenderFunctionForNormalRows<DATA_TYPE>;
|
|
360
|
+
valueGetter?: InfiniteTableColumnValueGetter<DATA_TYPE>;
|
|
361
|
+
valueFormatter?: InfiniteTableColumnValueFormatter<DATA_TYPE, Renderable>;
|
|
362
|
+
|
|
363
|
+
defaultWidth?: number;
|
|
364
|
+
defaultFlex?: number;
|
|
365
|
+
defaultFilterable?: boolean;
|
|
366
|
+
|
|
367
|
+
minWidth?: number;
|
|
368
|
+
maxWidth?: number;
|
|
369
|
+
|
|
370
|
+
renderGroupIcon?: InfiniteTableColumnRenderFunctionForGroupRows<DATA_TYPE>;
|
|
371
|
+
renderSortIcon?: InfiniteTableColumnHeaderRenderFunction<DATA_TYPE>;
|
|
372
|
+
renderSelectionCheckBox?:
|
|
373
|
+
| boolean
|
|
374
|
+
| InfiniteTableColumnRenderFunction<DATA_TYPE>;
|
|
375
|
+
renderMenuIcon?: boolean | InfiniteTableColumnRenderFunction<DATA_TYPE>;
|
|
376
|
+
renderHeaderSelectionCheckBox?:
|
|
377
|
+
| boolean
|
|
378
|
+
| InfiniteTableColumnHeaderRenderFunction<DATA_TYPE>;
|
|
379
|
+
|
|
380
|
+
components?: {
|
|
381
|
+
ColumnCell?: React.FunctionComponent<HTMLProps<HTMLDivElement>>;
|
|
382
|
+
HeaderCell?: React.FunctionComponent<HTMLProps<HTMLDivElement>>;
|
|
383
|
+
};
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
export type InfiniteTableGeneratedGroupColumn<T> = Omit<
|
|
387
|
+
InfiniteTableColumn<T>,
|
|
388
|
+
'sortable'
|
|
389
|
+
> & {
|
|
390
|
+
groupByField: string | string[];
|
|
391
|
+
id?: string;
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
export type InfiniteTablePivotColumn<T> = InfiniteTableColumn<T> &
|
|
395
|
+
ColumnTypeWithInherit<Partial<InfiniteTablePivotFinalColumnVariant<T, any>>>;
|
|
396
|
+
|
|
397
|
+
export type InfiniteTablePivotFinalColumnGroup<
|
|
398
|
+
DataType,
|
|
399
|
+
KeyType extends any = any,
|
|
400
|
+
> = InfiniteTableColumnGroup & {
|
|
401
|
+
pivotBy: DataSourcePivotBy<DataType>[];
|
|
402
|
+
pivotTotalColumnGroup?: true;
|
|
403
|
+
pivotGroupKeys: KeyType[];
|
|
404
|
+
pivotByAtIndex: PivotBy<DataType, KeyType>;
|
|
405
|
+
pivotGroupKey: KeyType;
|
|
406
|
+
pivotIndex: number;
|
|
407
|
+
};
|
|
408
|
+
export type InfiniteTablePivotFinalColumn<
|
|
409
|
+
DataType,
|
|
410
|
+
KeyType extends any = any,
|
|
411
|
+
> = InfiniteTableColumn<DataType> & {
|
|
412
|
+
pivotBy: DataSourcePivotBy<DataType>[];
|
|
413
|
+
pivotColumn: true;
|
|
414
|
+
pivotTotalColumn: boolean;
|
|
415
|
+
pivotAggregator: AggregationReducer<DataType, any>;
|
|
416
|
+
pivotAggregatorIndex: number;
|
|
417
|
+
|
|
418
|
+
pivotGroupKeys: KeyType[];
|
|
419
|
+
pivotByAtIndex?: PivotBy<DataType, KeyType>;
|
|
420
|
+
pivotIndex: number;
|
|
421
|
+
pivotGroupKey: KeyType;
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
export type InfiniteTablePivotFinalColumnVariant<
|
|
425
|
+
DataType,
|
|
426
|
+
KeyType extends any = any,
|
|
427
|
+
> = InfiniteTablePivotFinalColumn<DataType, KeyType>;
|
|
428
|
+
// export type InfiniteTablePivotFinalColumnVariant<
|
|
429
|
+
// DataType,
|
|
430
|
+
// KeyType extends any = any,
|
|
431
|
+
// > = Omit<InfiniteTablePivotFinalColumn<DataType, KeyType>, 'pivotByAtIndex'> & {
|
|
432
|
+
// pivotByAtIndex?: PivotBy<DataType, KeyType>;
|
|
433
|
+
// };
|
|
434
|
+
|
|
435
|
+
type InfiniteTableComputedColumnBase<T> = {
|
|
436
|
+
computedFilterType: string;
|
|
437
|
+
computedSortType: string;
|
|
438
|
+
computedDataType: string;
|
|
439
|
+
computedWidth: number;
|
|
440
|
+
computedFlex: number | null;
|
|
441
|
+
computedMinWidth: number;
|
|
442
|
+
computedMaxWidth: number;
|
|
443
|
+
computedOffset: number;
|
|
444
|
+
computedPinningOffset: number;
|
|
445
|
+
computedAbsoluteOffset: number;
|
|
446
|
+
computedSortable: boolean;
|
|
447
|
+
computedSortInfo: DataSourceSingleSortInfo<T> | null;
|
|
448
|
+
computedSorted: boolean;
|
|
449
|
+
computedSortedAsc: boolean;
|
|
450
|
+
computedSortedDesc: boolean;
|
|
451
|
+
computedSortIndex: number;
|
|
452
|
+
computedVisible: boolean;
|
|
453
|
+
computedVisibleIndex: number;
|
|
454
|
+
computedVisibleIndexInCategory: number;
|
|
455
|
+
computedMultiSort: boolean;
|
|
456
|
+
computedFiltered: boolean;
|
|
457
|
+
computedFilterable: boolean;
|
|
458
|
+
computedFilterValue: DataSourceFilterValueItem<T> | null;
|
|
459
|
+
|
|
460
|
+
computedPinned: InfiniteTableColumnPinnedValues;
|
|
461
|
+
computedDraggable: boolean;
|
|
462
|
+
computedResizable: boolean;
|
|
463
|
+
computedFirstInCategory: boolean;
|
|
464
|
+
computedLastInCategory: boolean;
|
|
465
|
+
computedFirst: boolean;
|
|
466
|
+
computedLast: boolean;
|
|
467
|
+
toggleSort: () => void;
|
|
468
|
+
colType: InfiniteTableColumnType<T>;
|
|
469
|
+
id: string;
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
export type InfiniteTableComputedColumn<T> = InfiniteTableColumn<T> &
|
|
473
|
+
InfiniteTableComputedColumnBase<T> &
|
|
474
|
+
Partial<InfiniteTablePivotFinalColumn<T>> &
|
|
475
|
+
Partial<InfiniteTableGeneratedGroupColumn<T>>;
|
|
476
|
+
|
|
477
|
+
export type InfiniteTableComputedPivotFinalColumn<T> =
|
|
478
|
+
InfiniteTableComputedColumn<T> & InfiniteTablePivotFinalColumn<T>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { MatrixBrainOptions } from '../../VirtualBrain/MatrixBrain';
|
|
2
|
+
import { MultiRowSelector } from '../utils/MultiRowSelector';
|
|
3
|
+
|
|
4
|
+
import type { InfiniteTableComputedColumn } from './InfiniteTableColumn';
|
|
5
|
+
import type { InfiniteTablePropColumnOrderNormalized } from './InfiniteTableProps';
|
|
6
|
+
|
|
7
|
+
export interface InfiniteTableComputedValues<T> {
|
|
8
|
+
scrollbars: {
|
|
9
|
+
vertical: boolean;
|
|
10
|
+
horizontal: boolean;
|
|
11
|
+
};
|
|
12
|
+
multiRowSelector: MultiRowSelector;
|
|
13
|
+
showColumnFilters: boolean;
|
|
14
|
+
renderSelectionCheckBox: boolean;
|
|
15
|
+
rowspan?: MatrixBrainOptions['rowspan'];
|
|
16
|
+
computedPinnedStartOverflow: boolean;
|
|
17
|
+
computedPinnedEndOverflow: boolean;
|
|
18
|
+
computedPinnedStartColumns: InfiniteTableComputedColumn<T>[];
|
|
19
|
+
computedPinnedEndColumns: InfiniteTableComputedColumn<T>[];
|
|
20
|
+
computedUnpinnedColumns: InfiniteTableComputedColumn<T>[];
|
|
21
|
+
computedVisibleColumns: InfiniteTableComputedColumn<T>[];
|
|
22
|
+
computedVisibleColumnsMap: Map<string, InfiniteTableComputedColumn<T>>;
|
|
23
|
+
computedColumnsMap: Map<string, InfiniteTableComputedColumn<T>>;
|
|
24
|
+
computedColumnsMapInInitialOrder: Map<string, InfiniteTableComputedColumn<T>>;
|
|
25
|
+
// computedColumnVisibility: InfiniteTablePropColumnVisibility;
|
|
26
|
+
computedColumnOrder: InfiniteTablePropColumnOrderNormalized;
|
|
27
|
+
computedPinnedStartColumnsWidth: number;
|
|
28
|
+
computedPinnedStartWidth: number;
|
|
29
|
+
computedPinnedEndColumnsWidth: number;
|
|
30
|
+
computedPinnedEndWidth: number;
|
|
31
|
+
computedUnpinnedColumnsWidth: number;
|
|
32
|
+
computedUnpinnedOffset: number;
|
|
33
|
+
computedPinnedEndOffset: number;
|
|
34
|
+
computedRemainingSpace: number;
|
|
35
|
+
fieldsToColumn: Map<keyof T, InfiniteTableComputedColumn<T>>;
|
|
36
|
+
toggleGroupRow: (groupKeys: any[]) => void;
|
|
37
|
+
columnSize: (colIndex: number) => number;
|
|
38
|
+
// setColumnPinning: (columnPinning: InfiniteTablePropColumnPinning) => void;
|
|
39
|
+
// setColumnOrder: (columnOrder: InfiniteTablePropColumnOrder) => void;
|
|
40
|
+
// setColumnVisibility: (
|
|
41
|
+
// columnVisibility: InfiniteTablePropColumnVisibility,
|
|
42
|
+
// ) => void;
|
|
43
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InfiniteTableActions, InfiniteTableState } from './InfiniteTableState';
|
|
2
|
+
import { InfiniteTableComputedValues } from './InfiniteTableComputedValues';
|
|
3
|
+
import { InfiniteTableApi } from './InfiniteTableProps';
|
|
4
|
+
|
|
5
|
+
export interface InfiniteTableContextValue<T> {
|
|
6
|
+
imperativeApi: InfiniteTableApi<T>;
|
|
7
|
+
componentState: InfiniteTableState<T>;
|
|
8
|
+
componentActions: InfiniteTableActions<T>;
|
|
9
|
+
computed: InfiniteTableComputedValues<T>;
|
|
10
|
+
getComputed: () => InfiniteTableComputedValues<T>;
|
|
11
|
+
getState: () => InfiniteTableState<T>;
|
|
12
|
+
}
|