@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.
Files changed (282) hide show
  1. package/.vscode/settings.json +3 -0
  2. package/API.md +0 -0
  3. package/build/buildPackageJson.js +43 -0
  4. package/build/scripts/test.js +37 -0
  5. package/bundler.config.js +25 -0
  6. package/globals.d.ts +7 -0
  7. package/package.json +102 -3
  8. package/rollup.config.js +15 -0
  9. package/run-build-deepmap.js +47 -0
  10. package/run-build.js +45 -0
  11. package/run-dts-concat.js +21 -0
  12. package/src/components/CSSVariableWatch.tsx +82 -0
  13. package/src/components/DataSource/BooleanCollectionState.ts +214 -0
  14. package/src/components/DataSource/BooleanDeepCollectionState.ts +208 -0
  15. package/src/components/DataSource/DataSourceContext.ts +20 -0
  16. package/src/components/DataSource/GroupRowsState.ts +74 -0
  17. package/src/components/DataSource/Indexer.ts +27 -0
  18. package/src/components/DataSource/RowSelectionState.ts +763 -0
  19. package/src/components/DataSource/defaultFilterTypes.ts +64 -0
  20. package/src/components/DataSource/index.tsx +108 -0
  21. package/src/components/DataSource/privateHooks/getChangeDetect.ts +7 -0
  22. package/src/components/DataSource/privateHooks/useLoadData.ts +783 -0
  23. package/src/components/DataSource/publicHooks/useDataSource.ts +19 -0
  24. package/src/components/DataSource/publicHooks/useDataSourceActions.ts +14 -0
  25. package/src/components/DataSource/state/getInitialState.ts +494 -0
  26. package/src/components/DataSource/state/normalizeSortInfo.ts +35 -0
  27. package/src/components/DataSource/state/reducer.ts +466 -0
  28. package/src/components/DataSource/state/rowInfoStatus.ts +27 -0
  29. package/src/components/DataSource/types.ts +548 -0
  30. package/src/components/HeadlessTable/HeadlessTableWithPinnedContainers.tsx +142 -0
  31. package/src/components/HeadlessTable/MappedCells.ts +251 -0
  32. package/src/components/HeadlessTable/RawTable.tsx +98 -0
  33. package/src/components/HeadlessTable/ReactHeadlessTableRenderer.tsx +1516 -0
  34. package/src/components/HeadlessTable/index.tsx +234 -0
  35. package/src/components/InfiniteTable/InfiniteCls.css.ts +164 -0
  36. package/src/components/InfiniteTable/InfiniteTableContext.ts +16 -0
  37. package/src/components/InfiniteTable/api/getImperativeApi.ts +391 -0
  38. package/src/components/InfiniteTable/api/getSelectionApi.ts +364 -0
  39. package/src/components/InfiniteTable/api/type.ts +11 -0
  40. package/src/components/InfiniteTable/components/ActiveCellIndicator.css.ts +51 -0
  41. package/src/components/InfiniteTable/components/ActiveCellIndicator.tsx +116 -0
  42. package/src/components/InfiniteTable/components/ActiveRowIndicator.css.ts +56 -0
  43. package/src/components/InfiniteTable/components/ActiveRowIndicator.tsx +94 -0
  44. package/src/components/InfiniteTable/components/CheckBox.css.ts +13 -0
  45. package/src/components/InfiniteTable/components/CheckBox.tsx +96 -0
  46. package/src/components/InfiniteTable/components/FilterEditors.tsx +52 -0
  47. package/src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx +27 -0
  48. package/src/components/InfiniteTable/components/InfiniteTableBody/index.tsx +1 -0
  49. package/src/components/InfiniteTable/components/InfiniteTableFooter/InfiniteTableFooter.tsx +31 -0
  50. package/src/components/InfiniteTable/components/InfiniteTableFooter/index.tsx +1 -0
  51. package/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableColumnHeaderFilter.tsx +102 -0
  52. package/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx +163 -0
  53. package/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx +574 -0
  54. package/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx +79 -0
  55. package/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderTypes.tsx +25 -0
  56. package/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx +185 -0
  57. package/src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/GroupResizeHandle.tsx +159 -0
  58. package/src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/ResizeHandle.css.ts +124 -0
  59. package/src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/columnResizer.ts +166 -0
  60. package/src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx +146 -0
  61. package/src/components/InfiniteTable/components/InfiniteTableHeader/buildColumnAndGroupTree.ts +240 -0
  62. package/src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts +358 -0
  63. package/src/components/InfiniteTable/components/InfiniteTableHeader/index.tsx +1 -0
  64. package/src/components/InfiniteTable/components/InfiniteTableHeader/useColumnGroupResizeHandle.tsx +114 -0
  65. package/src/components/InfiniteTable/components/InfiniteTableHeader/useColumnResizeHandle.tsx +146 -0
  66. package/src/components/InfiniteTable/components/InfiniteTableLicenseFooter/footer.css.ts +7 -0
  67. package/src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx +110 -0
  68. package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx +120 -0
  69. package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCellTypes.ts +74 -0
  70. package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx +457 -0
  71. package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRow.tsx +107 -0
  72. package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowClassName.ts +6 -0
  73. package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowTypes.ts +32 -0
  74. package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowUnvirtualized.tsx +75 -0
  75. package/src/components/InfiniteTable/components/InfiniteTableRow/columnRendering.tsx +263 -0
  76. package/src/components/InfiniteTable/components/InfiniteTableRow/index.tsx +1 -0
  77. package/src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts +74 -0
  78. package/src/components/InfiniteTable/components/InfiniteTableRow/useRowDOMProps.ts +199 -0
  79. package/src/components/InfiniteTable/components/LoadMask.css.ts +34 -0
  80. package/src/components/InfiniteTable/components/LoadMask.tsx +27 -0
  81. package/src/components/InfiniteTable/components/ScrollbarPlaceholder.tsx +56 -0
  82. package/src/components/InfiniteTable/components/cell.css.ts +192 -0
  83. package/src/components/InfiniteTable/components/icons/ArrowDown.tsx +14 -0
  84. package/src/components/InfiniteTable/components/icons/ArrowUp.tsx +14 -0
  85. package/src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts +31 -0
  86. package/src/components/InfiniteTable/components/icons/ExpanderIcon.tsx +63 -0
  87. package/src/components/InfiniteTable/components/icons/Icon.tsx +18 -0
  88. package/src/components/InfiniteTable/components/icons/InfiniteTableIconClassName.ts +1 -0
  89. package/src/components/InfiniteTable/components/icons/LoadingIcon.css.ts +8 -0
  90. package/src/components/InfiniteTable/components/icons/LoadingIcon.tsx +45 -0
  91. package/src/components/InfiniteTable/components/icons/MenuIcon.tsx +50 -0
  92. package/src/components/InfiniteTable/components/icons/SortIcon.tsx +113 -0
  93. package/src/components/InfiniteTable/eventHandlers/eventHandlerTypes.ts +57 -0
  94. package/src/components/InfiniteTable/eventHandlers/index.ts +95 -0
  95. package/src/components/InfiniteTable/eventHandlers/keyboardNavigation.ts +232 -0
  96. package/src/components/InfiniteTable/eventHandlers/keyboardSelection.ts +110 -0
  97. package/src/components/InfiniteTable/eventHandlers/onCellClick.ts +94 -0
  98. package/src/components/InfiniteTable/eventHandlers/onKeyDown.ts +25 -0
  99. package/src/components/InfiniteTable/hooks/adjustColumnOrderForAllColumns.ts +70 -0
  100. package/src/components/InfiniteTable/hooks/reorderColumnsOnDrag.ts +476 -0
  101. package/src/components/InfiniteTable/hooks/useAutoSizeColumns.ts +206 -0
  102. package/src/components/InfiniteTable/hooks/useCellClassName.ts +80 -0
  103. package/src/components/InfiniteTable/hooks/useCellRendering.tsx +217 -0
  104. package/src/components/InfiniteTable/hooks/useColumnGroups.ts +71 -0
  105. package/src/components/InfiniteTable/hooks/useColumnMenu.ts +72 -0
  106. package/src/components/InfiniteTable/hooks/useColumnPointerEvents.ts +258 -0
  107. package/src/components/InfiniteTable/hooks/useColumnRowspan.ts +43 -0
  108. package/src/components/InfiniteTable/hooks/useColumnSizeFn.ts +24 -0
  109. package/src/components/InfiniteTable/hooks/useColumnsWhen.ts +582 -0
  110. package/src/components/InfiniteTable/hooks/useComputed.ts +186 -0
  111. package/src/components/InfiniteTable/hooks/useComputedVisibleColumns.ts +219 -0
  112. package/src/components/InfiniteTable/hooks/useDOMProps.ts +306 -0
  113. package/src/components/InfiniteTable/hooks/useEffectWithRaf.ts +47 -0
  114. package/src/components/InfiniteTable/hooks/useInfiniteTable.ts +10 -0
  115. package/src/components/InfiniteTable/hooks/useInfiniteTableState.ts +11 -0
  116. package/src/components/InfiniteTable/hooks/useInternalProps.ts +8 -0
  117. package/src/components/InfiniteTable/hooks/useLicense/LicenseDetails.ts +13 -0
  118. package/src/components/InfiniteTable/hooks/useLicense/crc32.ts +56 -0
  119. package/src/components/InfiniteTable/hooks/useLicense/decode.ts +147 -0
  120. package/src/components/InfiniteTable/hooks/useLicense/useLicense.ts +39 -0
  121. package/src/components/InfiniteTable/hooks/useRerenderOnKeyChange.ts +21 -0
  122. package/src/components/InfiniteTable/hooks/useRowHover.ts +18 -0
  123. package/src/components/InfiniteTable/hooks/useScrollToActiveCell.ts +48 -0
  124. package/src/components/InfiniteTable/hooks/useScrollToActiveRow.ts +44 -0
  125. package/src/components/InfiniteTable/hooks/useScrollbars.ts +51 -0
  126. package/src/components/InfiniteTable/hooks/useToggleGroupRow.ts +56 -0
  127. package/src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx +165 -0
  128. package/src/components/InfiniteTable/hooks/useYourBrain.ts +55 -0
  129. package/src/components/InfiniteTable/index.tsx +352 -0
  130. package/src/components/InfiniteTable/internalProps.ts +4 -0
  131. package/src/components/InfiniteTable/state/computeColumnGroupsDepths.ts +29 -0
  132. package/src/components/InfiniteTable/state/getColumnVisibilityForHideEmptyGroupColumns.ts +127 -0
  133. package/src/components/InfiniteTable/state/getInitialState.ts +375 -0
  134. package/src/components/InfiniteTable/theme.css.ts +556 -0
  135. package/src/components/InfiniteTable/types/InfiniteTableAction.ts +6 -0
  136. package/src/components/InfiniteTable/types/InfiniteTableActionType.ts +12 -0
  137. package/src/components/InfiniteTable/types/InfiniteTableColumn.ts +478 -0
  138. package/src/components/InfiniteTable/types/InfiniteTableComputedValues.ts +43 -0
  139. package/src/components/InfiniteTable/types/InfiniteTableContextValue.ts +12 -0
  140. package/src/components/InfiniteTable/types/InfiniteTableInternalProps.ts +3 -0
  141. package/src/components/InfiniteTable/types/InfiniteTableProps.ts +511 -0
  142. package/src/components/InfiniteTable/types/InfiniteTableState.ts +195 -0
  143. package/src/components/InfiniteTable/types/Utility.ts +35 -0
  144. package/src/components/InfiniteTable/types/index.ts +96 -0
  145. package/src/components/InfiniteTable/utilities.css.ts +179 -0
  146. package/src/components/InfiniteTable/utils/MultiRowSelector.ts +111 -0
  147. package/src/components/InfiniteTable/utils/RenderHookComponentForInfinite.tsx +52 -0
  148. package/src/components/InfiniteTable/utils/adjustColumnOrderForPinning.ts +33 -0
  149. package/src/components/InfiniteTable/utils/assignFiltered.ts +29 -0
  150. package/src/components/InfiniteTable/utils/defaultGetColumContextMenuItems.tsx +108 -0
  151. package/src/components/InfiniteTable/utils/getColumnComputedType.ts +33 -0
  152. package/src/components/InfiniteTable/utils/getColumnForGroupBy.tsx +313 -0
  153. package/src/components/InfiniteTable/utils/getComputedVisibleColumns.ts +773 -0
  154. package/src/components/InfiniteTable/utils/getContextMenuForColumn.tsx +72 -0
  155. package/src/components/InfiniteTable/utils/infiniteDOMUtils.ts +189 -0
  156. package/src/components/InfiniteTable/utils/mapToObject.ts +20 -0
  157. package/src/components/InfiniteTable/utils/moveXatY.ts +25 -0
  158. package/src/components/InfiniteTable/utils/objectValuesExcept.ts +9 -0
  159. package/src/components/InfiniteTable/utils/progressiveSpeedScroller.ts +158 -0
  160. package/src/components/InfiniteTable/utils/rafFn.ts +13 -0
  161. package/src/components/InfiniteTable/utils/toCSSVarName.ts +1 -0
  162. package/src/components/InfiniteTable/utils/toMap.ts +24 -0
  163. package/src/components/Menu/Menu.tsx +750 -0
  164. package/src/components/Menu/MenuCls.css.ts +139 -0
  165. package/src/components/Menu/MenuContext.ts +10 -0
  166. package/src/components/Menu/MenuContextValue.ts +15 -0
  167. package/src/components/Menu/MenuProps.ts +98 -0
  168. package/src/components/Menu/MenuState.ts +56 -0
  169. package/src/components/Menu/MenuTriangleContext.ts +352 -0
  170. package/src/components/Menu/childrenToRuntimeItems.tsx +103 -0
  171. package/src/components/Menu/getMenuState.tsx +119 -0
  172. package/src/components/Menu/index.tsx +88 -0
  173. package/src/components/Menu/propToIdentifyMenu.ts +1 -0
  174. package/src/components/RawList/AvoidReactDiff.tsx +48 -0
  175. package/src/components/RawList/MappedItems.ts +143 -0
  176. package/src/components/RawList/ReactVirtualRenderer.tsx +307 -0
  177. package/src/components/RawList/index.tsx +42 -0
  178. package/src/components/RawList/types.ts +23 -0
  179. package/src/components/RawList/useVirtualRenderer.ts +36 -0
  180. package/src/components/RenderHookComponent.tsx +10 -0
  181. package/src/components/ResizeObserver/index.tsx +170 -0
  182. package/src/components/VirtualBrain/MatrixBrain.ts +1621 -0
  183. package/src/components/VirtualBrain/ScrollListener.ts +39 -0
  184. package/src/components/VirtualBrain/index.ts +664 -0
  185. package/src/components/VirtualList/ColumnListWithExternalScrolling.tsx +78 -0
  186. package/src/components/VirtualList/InfiniteListRootClassName.ts +1 -0
  187. package/src/components/VirtualList/RowListWithExternalScrolling.tsx +120 -0
  188. package/src/components/VirtualList/SpacePlaceholder.tsx +32 -0
  189. package/src/components/VirtualList/VirtualList.css.ts +29 -0
  190. package/src/components/VirtualList/VirtualList.tsx +141 -0
  191. package/src/components/VirtualList/VirtualRowList.tsx +34 -0
  192. package/src/components/VirtualList/types.ts +56 -0
  193. package/src/components/VirtualList/useCorrectHeightForRowElements.ts +14 -0
  194. package/src/components/VirtualScrollContainer/VirtualScrollContainer.css.ts +51 -0
  195. package/src/components/VirtualScrollContainer/getScrollableClassName.ts +30 -0
  196. package/src/components/VirtualScrollContainer/index.tsx +63 -0
  197. package/src/components/flexbox/index.ts +562 -0
  198. package/src/components/hooks/useComponentState/index.tsx +562 -0
  199. package/src/components/hooks/useComponentState/types.ts +32 -0
  200. package/src/components/hooks/useEffectOnceWithProperUnmount.ts +33 -0
  201. package/src/components/hooks/useEffectWithChanges.ts +56 -0
  202. package/src/components/hooks/useImmutableRef.ts +7 -0
  203. package/src/components/hooks/useInterceptedMap.ts +71 -0
  204. package/src/components/hooks/useLatest.tsx +8 -0
  205. package/src/components/hooks/useLazyLatest.ts +23 -0
  206. package/src/components/hooks/useMemoShallowObjectMerge.ts +16 -0
  207. package/src/components/hooks/useMounted.ts +18 -0
  208. package/src/components/hooks/useOnMount.ts +21 -0
  209. package/src/components/hooks/useOnScroll.ts +34 -0
  210. package/src/components/hooks/useOnce.ts +10 -0
  211. package/src/components/hooks/useOverlay/index.tsx +418 -0
  212. package/src/components/hooks/usePrevious.ts +8 -0
  213. package/src/components/hooks/usePropertyOld.ts +168 -0
  214. package/src/components/hooks/useRerender.ts +12 -0
  215. package/src/components/hooks/xuseProperty.ts +165 -0
  216. package/src/components/types/CellPosition.ts +4 -0
  217. package/src/components/types/NonUndefined.ts +1 -0
  218. package/src/components/types/RemoveObject.ts +22 -0
  219. package/src/components/types/Renderable.ts +3 -0
  220. package/src/components/types/ScrollPosition.ts +7 -0
  221. package/src/components/types/Setter.ts +2 -0
  222. package/src/components/types/Size.ts +6 -0
  223. package/src/components/types/SubscriptionCallback.ts +10 -0
  224. package/src/components/types/VoidFn.ts +1 -0
  225. package/src/components/utils/buildSubscriptionCallback.tsx +60 -0
  226. package/src/components/utils/clamp.ts +3 -0
  227. package/src/components/utils/debounce.ts +16 -0
  228. package/src/components/utils/decamelize.ts +11 -0
  229. package/src/components/utils/discardCallsWithEqualArg.ts +42 -0
  230. package/src/components/utils/getRenderIndexes.ts +33 -0
  231. package/src/components/utils/getScrollbarWidth.ts +31 -0
  232. package/src/components/utils/getVirtualRenderCount.ts +21 -0
  233. package/src/components/utils/isControlled.ts +12 -0
  234. package/src/components/utils/isControlledValue.ts +5 -0
  235. package/src/index.tsx +34 -0
  236. package/src/test.tsx +18 -0
  237. package/src/utils/DeepMap/index.ts +588 -0
  238. package/src/utils/DeepMap/once.ts +16 -0
  239. package/src/utils/DeepMap/sortAscending.ts +1 -0
  240. package/src/utils/DeepMap/tsconfig.deepmap.json +17 -0
  241. package/src/utils/DeepMap/xpackage.json +26 -0
  242. package/src/utils/debug.ts +40 -0
  243. package/src/utils/deepClone.ts +38 -0
  244. package/src/utils/getGlobal.ts +3 -0
  245. package/src/utils/groupAndPivot/defaultToKey.ts +3 -0
  246. package/src/utils/groupAndPivot/getGroupKeysForDataItem.ts +19 -0
  247. package/src/utils/groupAndPivot/getPivotColumnsAndColumnGroups.ts +361 -0
  248. package/src/utils/groupAndPivot/index.ts +1229 -0
  249. package/src/utils/groupAndPivot/types.ts +10 -0
  250. package/src/utils/join.ts +4 -0
  251. package/src/utils/mathIntersection.ts +21 -0
  252. package/src/utils/minified.d.ts +2 -0
  253. package/src/utils/minified.js +6 -0
  254. package/src/utils/multisort/index.ts +151 -0
  255. package/src/utils/multisort/sortTypes.ts +25 -0
  256. package/src/utils/notes-status.md +92 -0
  257. package/src/utils/pageGeometry/ConvexPoly.ts +34 -0
  258. package/src/utils/pageGeometry/Point.ts +51 -0
  259. package/src/utils/pageGeometry/PolyWithPoints.ts +52 -0
  260. package/src/utils/pageGeometry/Rectangle.ts +98 -0
  261. package/src/utils/pageGeometry/Triangle.ts +16 -0
  262. package/src/utils/pageGeometry/alignment/index.ts +221 -0
  263. package/src/utils/pageGeometry/polyContainsPoint.ts +182 -0
  264. package/src/utils/pageGeometry/types.ts +3 -0
  265. package/src/utils/proxyFnCall.ts +46 -0
  266. package/src/utils/raf.ts +13 -0
  267. package/src/utils/selectParent.ts +18 -0
  268. package/src/utils/shallowEqualObjects.ts +49 -0
  269. package/src/utils/stripVar.ts +3 -0
  270. package/src/utils/toUpperFirst.ts +5 -0
  271. package/todo.md +2 -0
  272. package/tsconfig.build.json +8 -0
  273. package/tsconfig.dev.json +7 -0
  274. package/tsconfig.json +30 -0
  275. package/tsconfig.typebundler.json +13 -0
  276. package/typedoc.json +4 -0
  277. package/README.md +0 -104
  278. package/index.css +0 -857
  279. package/index.d.ts +0 -2111
  280. package/index.esm.css +0 -857
  281. package/index.esm.js +0 -13695
  282. package/index.js +0 -13565
package/index.d.ts DELETED
@@ -1,2111 +0,0 @@
1
- import * as React$1 from 'react';
2
- import { CSSProperties, HTMLProps, RefCallback, MutableRefObject, MouseEvent, KeyboardEvent } from 'react';
3
-
4
- declare type SortDir = 1 | -1;
5
- declare type MultisortInfo<T> = {
6
- /**
7
- * The sorting direction
8
- */
9
- dir: SortDir;
10
- /**
11
- * for now 'string' and 'number' are known types, meaning they have
12
- * sort functions already implemented
13
- */
14
- type?: string;
15
- fn?: (a: any, b: any) => number;
16
- /**
17
- * a property whose value to use for sorting on the array items
18
- */
19
- field?: keyof T;
20
- /**
21
- * or a function to retrieve the item value to use for sorting
22
- */
23
- valueGetter?: (item: T) => any;
24
- };
25
- declare type MultisortInfoAllowMultipleFields<T> = Omit<MultisortInfo<T>, 'field'> & {
26
- field?: keyof T | (keyof T)[];
27
- };
28
- declare const multisort: {
29
- <T>(sortInfo: MultisortInfoAllowMultipleFields<T>[], array: T[], get?: ((item: any) => T) | undefined): T[];
30
- knownTypes: {
31
- [key: string]: (first: any, second: any) => number;
32
- };
33
- };
34
-
35
- declare type VoidFn$1 = () => void;
36
- declare type Pair<KeyType, ValueType> = {
37
- value?: ValueType;
38
- map?: Map<KeyType, Pair<KeyType, ValueType>>;
39
- length: number;
40
- revision?: number;
41
- };
42
- declare type DeepMapVisitFn<KeyType, ValueType> = (pair: Pair<KeyType, ValueType>, keys: KeyType[], next: VoidFn$1) => void;
43
- declare class DeepMap<KeyType, ValueType> {
44
- private map;
45
- private length;
46
- private revision;
47
- private emptyKey;
48
- static clone<KeyType, ValueType>(map: DeepMap<KeyType, ValueType>): DeepMap<KeyType, ValueType>;
49
- constructor(initial?: [KeyType[], ValueType][]);
50
- fill(initial?: [KeyType[], ValueType][]): void;
51
- getValuesStartingWith(keys: KeyType[], excludeSelf?: boolean, depthLimit?: number): ValueType[];
52
- getKeysStartingWith(keys: KeyType[], excludeSelf?: boolean, depthLimit?: number): KeyType[][];
53
- private getStartingWith;
54
- private getMapAt;
55
- getAllChildrenSizeFor(keys: KeyType[]): number;
56
- getDirectChildrenSizeFor(keys: KeyType[]): number;
57
- set(keys: KeyType[] & {
58
- length: Omit<number, 0>;
59
- }, value: ValueType): this;
60
- get(keys: KeyType[]): ValueType | undefined;
61
- get size(): number;
62
- clear(): void;
63
- delete(keys: KeyType[]): boolean;
64
- has(keys: KeyType[]): boolean;
65
- private visitKey;
66
- visit: (fn: DeepMapVisitFn<KeyType, ValueType>) => void;
67
- visitDepthFirst: (fn: (value: ValueType, keys: KeyType[], indexInGroup: number, next?: VoidFn$1 | undefined) => void) => void;
68
- private visitWithNext;
69
- private getArray;
70
- valuesAt(keys: KeyType[]): ValueType[];
71
- values(): Generator<ValueType, void, unknown>;
72
- keys(): Generator<KeyType[], void, unknown>;
73
- entries(): Generator<[KeyType[], ValueType], void, unknown>;
74
- topDownEntries(): [KeyType[], ValueType][];
75
- topDownKeys(): KeyType[][];
76
- topDownValues(): ValueType[];
77
- private sortedIterator;
78
- }
79
-
80
- declare enum InfiniteTableActionType {
81
- SET_COLUMN_SIZE = 0,
82
- SET_SCROLL_POSITION = 1,
83
- SET_BODY_SIZE = 2,
84
- SET_COLUMN_ORDER = 3,
85
- SET_COLUMN_VISIBILITY = 4,
86
- SET_COLUMN_SHIFTS = 5,
87
- SET_COLUMN_PINNING = 6,
88
- SET_COLUMN_AGGREGATIONS = 7,
89
- SET_DRAGGING_COLUMN_ID = 8
90
- }
91
-
92
- declare type InfiniteTableAction = {
93
- type: InfiniteTableActionType;
94
- payload?: any;
95
- };
96
-
97
- declare type Renderable = React$1.ReactNode | JSX.Element;
98
-
99
- declare function useInfiniteHeaderCell<T>(): InfiniteTableColumnHeaderParam<T, InfiniteTableComputedColumn<T>>;
100
-
101
- declare function useInfiniteColumnCell<T>(): InfiniteTableColumnCellContextType<T>;
102
-
103
- declare const InfiniteTableClassName: string;
104
- declare const InfiniteTableComponent: React$1.MemoExoticComponent<(<T>() => JSX.Element)>;
105
- declare function InfiniteTable<T>(props: InfiniteTableProps<T>): JSX.Element;
106
- declare namespace InfiniteTable {
107
- var defaultProps: {
108
- rowHeight: number;
109
- columnHeaderHeight: string;
110
- };
111
- }
112
-
113
- interface Size {
114
- width: number;
115
- height: number;
116
- }
117
-
118
- declare type InfiniteTableBaseCellProps<T> = {
119
- column: InfiniteTableComputedColumn<T>;
120
- rowId?: any;
121
- renderChildren: () => Renderable;
122
- width: number;
123
- cssEllipsis?: boolean;
124
- contentStyle?: CSSProperties;
125
- contentClassName?: string;
126
- virtualized?: boolean;
127
- skipColumnShifting?: boolean;
128
- beforeChildren?: Renderable;
129
- afterChildren?: Renderable;
130
- cssPosition?: CSSProperties['position'];
131
- domRef?: React.RefCallback<HTMLElement>;
132
- };
133
- declare type InfiniteTableCellProps<T> = ({
134
- cellType: 'header';
135
- } & InfiniteTableBaseCellProps<T>) | ({
136
- cellType: 'body';
137
- } & InfiniteTableBaseCellProps<T>);
138
-
139
- declare type DiscriminatedUnion<A, B> = (A & {
140
- [K in keyof B]?: undefined;
141
- }) | (B & {
142
- [K in keyof A]?: undefined;
143
- });
144
-
145
- declare type InfiniteTableToggleGroupRowFn = (groupKeys: any[]) => void;
146
- declare type InfiniteTableSelectRowFn = (id: any) => void;
147
- declare type InfiniteTableColumnHeaderParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
148
- domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
149
- dragging: boolean;
150
- column: COL_TYPE;
151
- columnsMap: Map<string, COL_TYPE>;
152
- columnSortInfo: DataSourceSingleSortInfo<DATA_TYPE> | null;
153
- columnFilterValue: DataSourceFilterValueItem<DATA_TYPE> | null;
154
- selectionMode: DataSourcePropSelectionMode;
155
- allRowsSelected: boolean;
156
- someRowsSelected: boolean;
157
- api: InfiniteTableApi<DATA_TYPE>;
158
- renderBag: {
159
- header: string | number | Renderable;
160
- sortIcon?: Renderable;
161
- selectionCheckBox?: Renderable;
162
- };
163
- };
164
- declare type InfiniteTableColumnRenderBag = {
165
- value: string | number | Renderable;
166
- groupIcon?: Renderable;
167
- selectionCheckBox?: Renderable;
168
- };
169
- declare type InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
170
- domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
171
- value: string | number | Renderable;
172
- renderBag: InfiniteTableColumnRenderBag;
173
- rowIndex: number;
174
- rowActive: boolean;
175
- api: InfiniteTableApi<DATA_TYPE>;
176
- column: COL_TYPE;
177
- columnsMap: Map<string, COL_TYPE>;
178
- fieldsToColumn: Map<keyof DATA_TYPE, COL_TYPE>;
179
- groupByColumn?: InfiniteTableComputedColumn<DATA_TYPE>;
180
- toggleCurrentGroupRow: () => void;
181
- toggleGroupRow: InfiniteTableToggleGroupRowFn;
182
- toggleCurrentGroupRowSelection: () => void;
183
- selectCurrentRow: () => void;
184
- selectRow: InfiniteTableSelectRowFn;
185
- deselectRow: InfiniteTableSelectRowFn;
186
- deselectCurrentRow: () => void;
187
- toggleRowSelection: InfiniteTableSelectRowFn;
188
- selectionMode: DataSourcePropSelectionMode | undefined;
189
- rootGroupBy: DataSourceState<DATA_TYPE>['groupBy'];
190
- pivotBy?: DataSourceState<DATA_TYPE>['pivotBy'];
191
- };
192
- declare type InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE> & InfiniteTableRowInfoDataDiscriminator<DATA_TYPE>;
193
- declare type InfiniteTableColumnCellContextType<DATA_TYPE> = InfiniteTableColumnRenderParam<DATA_TYPE> & {};
194
- declare type InfiniteTableColumnRenderValueParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>;
195
- declare type InfiniteTableColumnRowspanParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
196
- rowInfo: InfiniteTableRowInfo<DATA_TYPE>;
197
- data: DATA_TYPE | Partial<DATA_TYPE> | null;
198
- dataArray: InfiniteTableRowInfo<DATA_TYPE>[];
199
- rowIndex: number;
200
- column: COL_TYPE;
201
- };
202
- declare type InfiniteTableColumnRenderFunctionForGroupRows<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE> & {
203
- isGroupRow: true;
204
- }) => Renderable | null;
205
- declare type InfiniteTableColumnRenderFunctionForNormalRows<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE> & {
206
- isGroupRow: false;
207
- }) => Renderable | null;
208
- declare type InfiniteTableColumnRenderFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>) => Renderable | null;
209
- declare type InfiniteTableColumnHeaderRenderFunction<T> = (headerParams: InfiniteTableColumnHeaderParam<T>) => Renderable;
210
- declare type InfiniteTableColumnAlign = 'start' | 'center' | 'end';
211
- declare type InfiniteTableColumnVerticalAlign = 'start' | 'center' | 'end';
212
- declare type InfiniteTableColumnHeader<T> = Renderable | InfiniteTableColumnHeaderRenderFunction<T>;
213
- declare type InfiniteTableDataTypeNames = 'string' | 'number' | 'date' | string;
214
- declare type InfiniteTableColumnTypeNames = 'string' | 'number' | 'date' | string;
215
- declare type InfiniteTableColumnStyleFnParams<T> = {
216
- value: Renderable;
217
- column: InfiniteTableComputedColumn<T>;
218
- } & InfiniteTableRowInfoDataDiscriminator<T>;
219
- declare type InfiniteTableColumnStyleFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | React.CSSProperties;
220
- declare type InfiniteTableColumnHeaderClassNameFn<T> = (params: InfiniteTableColumnHeaderParam<T>) => undefined | string;
221
- declare type InfiniteTableColumnHeaderStyleFn<T> = (params: InfiniteTableColumnHeaderParam<T>) => undefined | React.CSSProperties;
222
- declare type InfiniteTableColumnClassNameFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | string;
223
- declare type InfiniteTableColumnStyle<T> = CSSProperties | InfiniteTableColumnStyleFn<T>;
224
- declare type InfiniteTableColumnHeaderStyle<T> = CSSProperties | InfiniteTableColumnHeaderStyleFn<T>;
225
- declare type InfiniteTableColumnClassName<T> = string | InfiniteTableColumnClassNameFn<T>;
226
- declare type InfiniteTableColumnHeaderClassName<T> = string | InfiniteTableColumnHeaderClassNameFn<T>;
227
- declare type InfiniteTableColumnValueGetterParams<T> = {
228
- data: T;
229
- field?: keyof T;
230
- };
231
- declare type InfiniteTableColumnValueFormatterParams<T> = InfiniteTableRowInfoDataDiscriminator<T>;
232
- declare type InfiniteTableColumnValueGetter<T, VALUE_GETTER_TYPE = string | number | boolean | Date | null | undefined> = (params: InfiniteTableColumnValueGetterParams<T>) => VALUE_GETTER_TYPE;
233
- declare type InfiniteTableColumnValueFormatter<T, VALUE_FORMATTER_TYPE = string | number | boolean | Date | null | undefined> = (params: InfiniteTableColumnValueFormatterParams<T>) => VALUE_FORMATTER_TYPE;
234
- declare type InfiniteTableColumnRowspanFn<T> = (params: InfiniteTableColumnRowspanParam<T>) => number;
235
- declare type InfiniteTableColumnComparer<T> = (a: T, b: T) => number;
236
- /**
237
- * Defines a column in the table.
238
- *
239
- * @typeParam DATA_TYPE The type of the data in the table.
240
- *
241
- * Can be bound to a field which is a `keyof DATA_TYPE`.
242
- */
243
- declare type InfiniteTableColumn<DATA_TYPE> = {
244
- sortable?: boolean;
245
- draggable?: boolean;
246
- resizable?: boolean;
247
- comparer?: InfiniteTableColumnComparer<DATA_TYPE>;
248
- defaultHiddenWhenGroupedBy?: '*' | true | keyof DATA_TYPE | {
249
- [k in keyof Partial<DATA_TYPE>]: true;
250
- };
251
- align?: InfiniteTableColumnAlign;
252
- verticalAlign?: InfiniteTableColumnVerticalAlign;
253
- columnGroup?: string;
254
- header?: InfiniteTableColumnHeader<DATA_TYPE>;
255
- renderHeader?: InfiniteTableColumnHeaderRenderFunction<DATA_TYPE>;
256
- name?: Renderable;
257
- cssEllipsis?: boolean;
258
- headerCssEllipsis?: boolean;
259
- type?: InfiniteTableColumnTypeNames | InfiniteTableColumnTypeNames[] | null;
260
- dataType?: InfiniteTableDataTypeNames;
261
- sortType?: string;
262
- filterType?: string;
263
- style?: InfiniteTableColumnStyle<DATA_TYPE>;
264
- headerStyle?: InfiniteTableColumnHeaderStyle<DATA_TYPE>;
265
- headerClassName?: InfiniteTableColumnHeaderClassName<DATA_TYPE>;
266
- className?: InfiniteTableColumnClassName<DATA_TYPE>;
267
- rowspan?: InfiniteTableColumnRowspanFn<DATA_TYPE>;
268
- field?: keyof DATA_TYPE;
269
- render?: InfiniteTableColumnRenderFunction<DATA_TYPE>;
270
- renderValue?: InfiniteTableColumnRenderFunction<DATA_TYPE>;
271
- renderGroupValue?: InfiniteTableColumnRenderFunctionForGroupRows<DATA_TYPE>;
272
- renderLeafValue?: InfiniteTableColumnRenderFunctionForNormalRows<DATA_TYPE>;
273
- valueGetter?: InfiniteTableColumnValueGetter<DATA_TYPE>;
274
- valueFormatter?: InfiniteTableColumnValueFormatter<DATA_TYPE, Renderable>;
275
- defaultWidth?: number;
276
- defaultFlex?: number;
277
- defaultFilterable?: boolean;
278
- minWidth?: number;
279
- maxWidth?: number;
280
- renderGroupIcon?: InfiniteTableColumnRenderFunctionForGroupRows<DATA_TYPE>;
281
- renderSortIcon?: InfiniteTableColumnHeaderRenderFunction<DATA_TYPE>;
282
- renderSelectionCheckBox?: boolean | InfiniteTableColumnRenderFunction<DATA_TYPE>;
283
- renderHeaderSelectionCheckBox?: boolean | InfiniteTableColumnHeaderRenderFunction<DATA_TYPE>;
284
- components?: {
285
- ColumnCell?: React.FunctionComponent<HTMLProps<HTMLDivElement>>;
286
- HeaderCell?: React.FunctionComponent<HTMLProps<HTMLDivElement>>;
287
- };
288
- };
289
- declare type InfiniteTableGeneratedGroupColumn<T> = Omit<InfiniteTableColumn<T>, 'sortable'> & {
290
- groupByField: string | string[];
291
- id?: string;
292
- };
293
- declare type InfiniteTablePivotColumn<T> = InfiniteTableColumn<T> & ColumnTypeWithInherit<Partial<InfiniteTablePivotFinalColumnVariant<T, any>>>;
294
- declare type InfiniteTablePivotFinalColumnGroup<DataType, KeyType extends any = any> = InfiniteTableColumnGroup & {
295
- pivotBy: DataSourcePivotBy<DataType>[];
296
- pivotTotalColumnGroup?: true;
297
- pivotGroupKeys: KeyType[];
298
- pivotByAtIndex: PivotBy<DataType, KeyType>;
299
- pivotGroupKey: KeyType;
300
- pivotIndex: number;
301
- };
302
- declare type InfiniteTablePivotFinalColumn<DataType, KeyType extends any = any> = InfiniteTableColumn<DataType> & {
303
- pivotBy: DataSourcePivotBy<DataType>[];
304
- pivotColumn: true;
305
- pivotTotalColumn: boolean;
306
- pivotAggregator: AggregationReducer<DataType, any>;
307
- pivotAggregatorIndex: number;
308
- pivotGroupKeys: KeyType[];
309
- pivotByAtIndex?: PivotBy<DataType, KeyType>;
310
- pivotIndex: number;
311
- pivotGroupKey: KeyType;
312
- };
313
- declare type InfiniteTablePivotFinalColumnVariant<DataType, KeyType extends any = any> = InfiniteTablePivotFinalColumn<DataType, KeyType>;
314
- declare type InfiniteTableComputedColumnBase<T> = {
315
- computedFilterType: string;
316
- computedSortType: string;
317
- computedDataType: string;
318
- computedWidth: number;
319
- computedFlex: number | null;
320
- computedMinWidth: number;
321
- computedMaxWidth: number;
322
- computedOffset: number;
323
- computedPinningOffset: number;
324
- computedAbsoluteOffset: number;
325
- computedSortable: boolean;
326
- computedSortInfo: DataSourceSingleSortInfo<T> | null;
327
- computedSorted: boolean;
328
- computedSortedAsc: boolean;
329
- computedSortedDesc: boolean;
330
- computedSortIndex: number;
331
- computedVisible: boolean;
332
- computedVisibleIndex: number;
333
- computedVisibleIndexInCategory: number;
334
- computedMultiSort: boolean;
335
- computedFiltered: boolean;
336
- computedFilterable: boolean;
337
- computedFilterValue: DataSourceFilterValueItem<T> | null;
338
- computedPinned: InfiniteTableColumnPinnedValues;
339
- computedDraggable: boolean;
340
- computedResizable: boolean;
341
- computedFirstInCategory: boolean;
342
- computedLastInCategory: boolean;
343
- computedFirst: boolean;
344
- computedLast: boolean;
345
- toggleSort: () => void;
346
- colType: InfiniteTableColumnType<T>;
347
- id: string;
348
- };
349
- declare type InfiniteTableComputedColumn<T> = InfiniteTableColumn<T> & InfiniteTableComputedColumnBase<T> & Partial<InfiniteTablePivotFinalColumn<T>> & Partial<InfiniteTableGeneratedGroupColumn<T>>;
350
- declare type InfiniteTableComputedPivotFinalColumn<T> = InfiniteTableComputedColumn<T> & InfiniteTablePivotFinalColumn<T>;
351
-
352
- interface LogFn {
353
- (...args: any[]): LogFn;
354
- extend: (channelName: string) => LogFn;
355
- }
356
- declare class Logger {
357
- debug: LogFn;
358
- error: LogFn;
359
- constructor(channelName: string);
360
- }
361
-
362
- interface ScrollPosition {
363
- scrollTop: number;
364
- scrollLeft: number;
365
- }
366
- declare type OnScrollFn = (scrollPosition: ScrollPosition) => void;
367
-
368
- declare type VoidFn = () => void;
369
-
370
- declare type FixedPosition = false | 'start' | 'end';
371
- declare type SpanFunction = ({ rowIndex, colIndex, }: {
372
- rowIndex: number;
373
- colIndex: number;
374
- }) => number;
375
- declare type RenderRangeType = {
376
- startIndex: number;
377
- endIndex: number;
378
- };
379
- declare type ItemSizeFunction = (index: number) => number;
380
- declare type MatrixBrainOptions = {
381
- width: number;
382
- height: number;
383
- cols: number;
384
- rows: number;
385
- rowHeight: number | ItemSizeFunction;
386
- colWidth: number | ItemSizeFunction;
387
- rowspan?: SpanFunction;
388
- colspan?: SpanFunction;
389
- };
390
- declare type TableRenderRange = {
391
- start: [number, number];
392
- end: [number, number];
393
- rowFixed?: FixedPosition;
394
- colFixed?: FixedPosition;
395
- };
396
- declare type WhichDirection = {
397
- horizontal?: boolean;
398
- vertical?: boolean;
399
- };
400
- declare type FnOnRenderRangeChange = (range: TableRenderRange) => void;
401
- declare type FnOnDirectionalRenderRangeChange = (range: [number, number]) => void;
402
- declare type FnOnRenderCountChange = ({ horizontal, vertical, }: {
403
- horizontal: number;
404
- vertical: number;
405
- }) => void;
406
- declare type OnAvailableSizeChange = (size: Size) => void;
407
- declare class MatrixBrain extends Logger {
408
- private scrolling;
409
- private width;
410
- private height;
411
- private cols;
412
- private rows;
413
- private rowHeight;
414
- private colWidth;
415
- private rowspan;
416
- private colspan;
417
- private rowspanParent;
418
- private rowspanValue;
419
- private rowHeightCache;
420
- private rowOffsetCache;
421
- private verticalTotalSize;
422
- private colspanParent;
423
- private colspanValue;
424
- private colWidthCache;
425
- private colOffsetCache;
426
- private horizontalTotalSize;
427
- private horizontalRenderCount?;
428
- private verticalRenderCount?;
429
- private horizontalRenderRange;
430
- private verticalRenderRange;
431
- private extraSpanCells;
432
- private scrollPosition;
433
- private onScrollFns;
434
- private onRenderRangeChangeFns;
435
- private onVerticalRenderRangeChangeFns;
436
- private onHorizontalRenderRangeChangeFns;
437
- private onDestroyFns;
438
- private destroyed;
439
- private onRenderCountChangeFns;
440
- private onAvailableSizeChangeFns;
441
- private onScrollStartFns;
442
- private onScrollStopFns;
443
- private scrollTimeoutId;
444
- private scrollStopDelay;
445
- /**
446
- * Number of columns that are fixed at the start
447
- */
448
- private fixedColsStart;
449
- /**
450
- * Number of columns that are fixed at the end
451
- */
452
- private fixedColsEnd;
453
- /**
454
- * Number of rows that are fixed at the start
455
- */
456
- private fixedRowsStart;
457
- /**
458
- * Number of rows that are fixed at the end
459
- */
460
- private fixedRowsEnd;
461
- constructor();
462
- private reset;
463
- private resetVertical;
464
- private resetHorizontal;
465
- setScrollStopDelay: (scrollStopDelay: number) => void;
466
- getRowCount: () => number;
467
- getColCount: () => number;
468
- update: (options: Partial<MatrixBrainOptions>) => void;
469
- setRowAndColumnSizes({ rowHeight, colWidth, }: {
470
- rowHeight: number | ItemSizeFunction;
471
- colWidth: number | ItemSizeFunction;
472
- }): void;
473
- setRowsAndCols: ({ rows, cols }: {
474
- rows: number;
475
- cols: number;
476
- }) => void;
477
- setAvailableSize(size: Partial<Size>, config?: {
478
- skipUpdateRenderCount?: boolean;
479
- }): void;
480
- updateRenderCount: (which?: WhichDirection) => void;
481
- private doUpdateRenderCount;
482
- get scrollTopMax(): number;
483
- get scrollLeftMax(): number;
484
- private setScrolling;
485
- private notifyScrollStart;
486
- private notifyScrollStop;
487
- setScrollPosition: (scrollPosition: ScrollPosition, callback?: ((scrollPos: ScrollPosition) => void) | undefined) => void;
488
- private notifyAvailableSizeChange;
489
- private notifyRenderRangeChange;
490
- private notifyVerticalRenderRangeChange;
491
- private notifyHorizontalRenderRangeChange;
492
- private notifyScrollChange;
493
- private computeDirectionalRenderCount;
494
- getFixedSize(direction: 'horizontal' | 'vertical'): number;
495
- getFixedStartSize(direction: 'horizontal' | 'vertical'): number;
496
- getFixedEndSize(direction: 'horizontal' | 'vertical'): number;
497
- isColFixedEnd: (colIndex: number) => boolean;
498
- isColFixedStart: (colIndex: number) => boolean;
499
- isRowFixedEnd: (rowIndex: number) => boolean;
500
- isRowFixedStart: (rowIndex: number) => boolean;
501
- isColFixed: (colIndex: number) => boolean;
502
- isRowFixed: (rowIndex: number) => boolean;
503
- getFixedEndColsWidth: () => number;
504
- /**
505
- * Returns an array of offsets for all cols fixed at the end
506
- *
507
- * The order in the array is from leftmost col to the rightmost col
508
- * The reference for offset is the left side of the table.
509
- * The offsets take into account the scroll position and return the correct position.
510
- *
511
- * The indexes in the returned array are the absolute indexes of the cols, so the returned array is an array with holes
512
- *
513
- */
514
- getFixedEndColsOffsets: ({ skipScroll }?: {
515
- skipScroll: boolean;
516
- }) => number[];
517
- /**
518
- * Returns an array of offsets for all rows fixed at the end
519
- *
520
- * The order in the array is from topmost row to the bottom-most row
521
- * The reference for offset is the top side of the table.
522
- * The offsets take into account the scroll position and return the correct position.
523
- *
524
- * The indexes in the returned array are the absolute indexes of the rows, so the returned array is an array with holes
525
- *
526
- */
527
- getFixedEndRowsOffsets: ({ skipScroll }?: {
528
- skipScroll: boolean;
529
- }) => number[];
530
- getFixedStartColsWidth: () => number;
531
- getFixedEndRowsHeight: () => number;
532
- getFixedStartRowsHeight: () => number;
533
- computeRenderCount: (which?: WhichDirection) => {
534
- horizontal: number;
535
- vertical: number;
536
- };
537
- setRenderCount: ({ horizontal, vertical, }: {
538
- horizontal: number | undefined;
539
- vertical: number | undefined;
540
- }) => void;
541
- private notifyRenderCountChange;
542
- updateFixedCells: (config: {
543
- fixedColsStart?: number;
544
- fixedColsEnd?: number;
545
- fixedRowsStart?: number;
546
- fixedRowsEnd?: number;
547
- }) => void;
548
- getFixedCellInfo: () => {
549
- fixedRowsStart: number;
550
- fixedColsStart: number;
551
- fixedRowsEnd: number;
552
- fixedColsEnd: number;
553
- };
554
- updateRenderRange: (which?: WhichDirection) => void;
555
- getExtraSpanCellsForRange: ({ horizontal, vertical, }: {
556
- horizontal: RenderRangeType;
557
- vertical: RenderRangeType;
558
- }) => [number, number][];
559
- computeRenderRange: (which?: WhichDirection) => {
560
- horizontal: RenderRangeType;
561
- vertical: RenderRangeType;
562
- extraCells: [number, number][];
563
- };
564
- computeDirectionalRenderRange: (direction: 'horizontal' | 'vertical') => {
565
- startIndex: number;
566
- endIndex: number;
567
- };
568
- getItemAt: (scrollPos: number, direction: 'horizontal' | 'vertical') => number;
569
- getCellOffset: (rowIndex: number, colIndex: number) => {
570
- x: number;
571
- y: number;
572
- };
573
- getItemOffsetFor: (itemIndex: number, direction: 'horizontal' | 'vertical') => number;
574
- private computeCacheFor;
575
- private getItemSizeCacheFor;
576
- private computeItemSpanUpTo;
577
- private getCellSpan;
578
- getRowspan: (rowIndex: number, colIndex: number) => number;
579
- getColspan: (rowIndex: number, colIndex: number) => number;
580
- getRowspanParent: (rowIndex: number, colIndex: number) => number;
581
- getColspanParent: (rowIndex: number, colIndex: number) => number;
582
- getItemSpanParent: (rowIndex: number, colIndex: number, direction: 'horizontal' | 'vertical') => number;
583
- getRowHeightWithSpan: (rowIndex: number, colIndex: number, rowspan: number) => number;
584
- getColWidthWithSpan: (rowIndex: number, colIndex: number, colspan: number) => number;
585
- private getItemSizeWithSpan;
586
- getRowHeight: (rowIndex: number) => number;
587
- getColWidth: (colIndex: number) => number;
588
- /**
589
- * For now, this doesn't take into account the row/colspan, and it's okay not to
590
- * @param itemIndex
591
- * @returns the size of the specified item
592
- */
593
- getItemSize: (itemIndex: number, direction: 'horizontal' | 'vertical') => number;
594
- getTotalSize: () => {
595
- height: number;
596
- width: number;
597
- };
598
- getTotalSizeFor: (direction: 'horizontal' | 'vertical') => number;
599
- setRenderRange: ({ horizontal, vertical, extraCells, }: {
600
- horizontal: RenderRangeType;
601
- vertical: RenderRangeType;
602
- extraCells?: [number, number][] | undefined;
603
- }) => void;
604
- getRenderRangeCellCount: (range: TableRenderRange) => number;
605
- getExtraCells: () => [
606
- number,
607
- number
608
- ][];
609
- getScrollPosition: () => ScrollPosition;
610
- getRenderRange: () => TableRenderRange;
611
- onScroll: (fn: OnScrollFn) => () => void;
612
- onScrollStart: (fn: VoidFunction) => () => void;
613
- onScrollStop: (fn: (scrollPos: ScrollPosition) => void) => () => void;
614
- onRenderRangeChange: (fn: FnOnRenderRangeChange) => () => void;
615
- onVerticalRenderRangeChange: (fn: FnOnDirectionalRenderRangeChange) => () => void;
616
- onHorizontalRenderRangeChange: (fn: FnOnDirectionalRenderRangeChange) => () => void;
617
- onRenderCountChange: (fn: FnOnRenderCountChange) => () => void;
618
- onAvailableSizeChange: (fn: OnAvailableSizeChange) => () => void;
619
- onDestroy: (fn: VoidFn) => () => void;
620
- getAvailableSize: () => {
621
- width: number;
622
- height: number;
623
- };
624
- private notifyDestroy;
625
- destroy: () => void;
626
- }
627
-
628
- declare type RowSelectionStateItem = (any | any[])[];
629
- declare type RowSelectionStateObject = {
630
- selectedRows: RowSelectionStateItem;
631
- deselectedRows: RowSelectionStateItem;
632
- defaultSelection: boolean;
633
- } | {
634
- defaultSelection: true;
635
- deselectedRows: RowSelectionStateItem;
636
- selectedRows?: RowSelectionStateItem;
637
- } | {
638
- defaultSelection: false;
639
- selectedRows: RowSelectionStateItem;
640
- deselectedRows?: RowSelectionStateItem;
641
- };
642
- declare type RowSelectionStateConfig<T> = {
643
- groupBy: DataSourceState<T>['groupBy'];
644
- groupDeepMap: DataSourceState<T>['groupDeepMap'];
645
- toPrimaryKey: DataSourceState<T>['toPrimaryKey'];
646
- totalCount: number;
647
- indexer: DataSourceState<T>['indexer'];
648
- lazyLoad: boolean;
649
- onlyUsePrimaryKeys: boolean;
650
- };
651
- declare type GetRowSelectionStateConfig<T> = () => RowSelectionStateConfig<T>;
652
- declare type RowSelectionStateOverride = {
653
- getGroupKeysForPrimaryKey: RowSelectionState<any>['getGroupKeysForPrimaryKey'];
654
- getGroupByLength: RowSelectionState<any>['getGroupByLength'];
655
- getGroupCount: RowSelectionState<any>['getGroupCount'];
656
- getGroupKeysDirectlyInsideGroup: RowSelectionState<any>['getGroupKeysDirectlyInsideGroup'];
657
- getAllPrimaryKeysInsideGroup: RowSelectionState<any>['getAllPrimaryKeysInsideGroup'];
658
- };
659
- declare class RowSelectionState<T = any> {
660
- selectedRows: RowSelectionStateItem | null;
661
- deselectedRows: RowSelectionStateItem | null;
662
- defaultSelection: boolean;
663
- selectedMap: DeepMap<any, true>;
664
- deselectedMap: DeepMap<any, true>;
665
- onlyUsePrimaryKeys: boolean;
666
- selectionCache: DeepMap<any, boolean | null>;
667
- selectionCountCache: DeepMap<any, {
668
- selectedCount: number;
669
- deselectedCount: number;
670
- }>;
671
- getConfig: GetRowSelectionStateConfig<T>;
672
- getGroupKeysForPrimaryKey(pk: any): any[];
673
- getGroupDeepMap(): DeepMap<any, DeepMapGroupValueType<T, any>> | undefined;
674
- getGroupCount(groupKeys: any[]): number;
675
- getGroupKeysDirectlyInsideGroup(groupKeys: any[]): any[][];
676
- getAllPrimaryKeysInsideGroup(groupKeys: any[]): any[];
677
- getGroupByLength(): number;
678
- static from<T>(rowSeleStateObject: RowSelectionStateObject, getConfig: GetRowSelectionStateConfig<T>, overrides?: RowSelectionStateOverride): RowSelectionState<T>;
679
- constructor(state: RowSelectionStateObject | RowSelectionState, getConfig: GetRowSelectionStateConfig<T>, _forTestingOnly?: RowSelectionStateOverride);
680
- mapSet: (name: 'selected' | 'deselected', key: any | any[]) => void;
681
- _selectedMapSet: (key: any | any[]) => void;
682
- _deselectedMapSet: (key: any | any[]) => void;
683
- update(stateObject: RowSelectionStateObject): void;
684
- private xcache;
685
- getState(): RowSelectionStateObject;
686
- deselectAll(): void;
687
- selectAll(): void;
688
- isRowDefaultSelected(): boolean;
689
- isRowDefaultDeselected(): boolean;
690
- /**
691
- *
692
- * @param key the id of the row - if a row in a grouped datasource, this is the final row id, without the group keys
693
- * @param groupKeys the keys of row parents, in order
694
- * @returns Whether the row is selected or not.
695
- */
696
- isRowSelected(key: any, groupKeys?: any[]): boolean;
697
- isRowDeselected(key: any, groupKeys?: any[]): boolean;
698
- setRowSelected(key: string | number, selected: boolean, groupKeys?: any[]): void;
699
- /**
700
- * Returns if the selection state ('full','partial','none') for the current group
701
- *
702
- * The selection state will be full (true) if either of those are true:
703
- * * the group keys are specified as selected
704
- * * all the children are specified as selected
705
- *
706
- * The selection state will be partial (null) if either of those are true:
707
- * * the group keys are partially selected
708
- * * some of the children are specified as selected
709
- *
710
- *
711
- * @param groupKeys the keys of the group row
712
- * @param children leaf children that belong to the group
713
- * @returns boolean
714
- */
715
- getGroupRowSelectionState(initialGroupKeys: any[]): boolean | null;
716
- private getGroupRowBooleanSelectionStateFromParent;
717
- isGroupRowPartlySelected(groupKeys: any[]): boolean;
718
- isGroupRowSelected(groupKeys: any[]): boolean;
719
- isGroupRowDeselected(groupKeys: any[]): boolean;
720
- selectGroupRow(groupKeys: any[]): void;
721
- deselectGroupRow(groupKeys: any[]): void;
722
- setRowAsSelected(key: string | number, groupKeys?: any[]): void;
723
- setRowAsDeselected(key: string | number, groupKeys?: any[]): void;
724
- deselectRow(key: any, groupKeys?: any[]): void;
725
- selectRow(key: any, groupKeys?: any[]): void;
726
- toggleGroupRowSelection(groupKeys: any[]): void;
727
- toggleRowSelection(key: string | number, groupKeys?: any[] | undefined): void;
728
- getSelectedCount(): number;
729
- getDeselectedCount(): number;
730
- getSelectionCountFor(groupKeys?: any[], parentSelected?: boolean): {
731
- selectedCount: number;
732
- deselectedCount: number;
733
- };
734
- }
735
-
736
- declare type MultiRowSelectorOptions = {
737
- getIdForIndex: (index: number) => string | number;
738
- };
739
- declare class MultiRowSelector {
740
- getIdForIndex: MultiRowSelectorOptions['getIdForIndex'];
741
- multiSelectStartIndex: number;
742
- multiSelectEndIndex?: number;
743
- _rowSelectionState: RowSelectionState;
744
- constructor(options: MultiRowSelectorOptions);
745
- set rowSelectionState(rowSelectionState: RowSelectionState);
746
- get rowSelectionState(): RowSelectionState;
747
- private selectRange;
748
- private deselectRange;
749
- /**
750
- * This is the single click, without any modifier
751
- */
752
- resetClick(index: number): void;
753
- /**
754
- * This is the click with ctrl/cmd key pressed
755
- * @param index
756
- */
757
- singleAddClick(index: number): void;
758
- multiSelectClick(index: number): void;
759
- }
760
-
761
- interface InfiniteTableComputedValues<T> {
762
- scrollbars: {
763
- vertical: boolean;
764
- horizontal: boolean;
765
- };
766
- multiRowSelector: MultiRowSelector;
767
- showColumnFilters: boolean;
768
- renderSelectionCheckBox: boolean;
769
- rowspan?: MatrixBrainOptions['rowspan'];
770
- computedPinnedStartOverflow: boolean;
771
- computedPinnedEndOverflow: boolean;
772
- computedPinnedStartColumns: InfiniteTableComputedColumn<T>[];
773
- computedPinnedEndColumns: InfiniteTableComputedColumn<T>[];
774
- computedUnpinnedColumns: InfiniteTableComputedColumn<T>[];
775
- computedVisibleColumns: InfiniteTableComputedColumn<T>[];
776
- computedVisibleColumnsMap: Map<string, InfiniteTableComputedColumn<T>>;
777
- computedColumnsMap: Map<string, InfiniteTableComputedColumn<T>>;
778
- computedColumnVisibility: InfiniteTablePropColumnVisibility;
779
- computedColumnOrder: InfiniteTablePropColumnOrderNormalized;
780
- computedPinnedStartColumnsWidth: number;
781
- computedPinnedStartWidth: number;
782
- computedPinnedEndColumnsWidth: number;
783
- computedPinnedEndWidth: number;
784
- computedUnpinnedColumnsWidth: number;
785
- computedUnpinnedOffset: number;
786
- computedPinnedEndOffset: number;
787
- computedRemainingSpace: number;
788
- fieldsToColumn: Map<keyof T, InfiniteTableComputedColumn<T>>;
789
- toggleGroupRow: (groupKeys: any[]) => void;
790
- columnSize: (colIndex: number) => number;
791
- }
792
-
793
- declare type TableRenderCellFnParam = {
794
- domRef: RefCallback<HTMLElement>;
795
- rowIndex: number;
796
- colIndex: number;
797
- rowspan: number;
798
- colspan: number;
799
- hidden: boolean;
800
- width: number;
801
- height: number;
802
- widthWithColspan: number;
803
- heightWithRowspan: number;
804
- rowFixed: FixedPosition;
805
- colFixed: FixedPosition;
806
- onMouseEnter: VoidFunction;
807
- onMouseLeave: VoidFunction;
808
- };
809
- declare type TableRenderCellFn = (param: TableRenderCellFnParam) => Renderable;
810
- declare class ReactHeadlessTableRenderer extends Logger {
811
- private brain;
812
- private destroyed;
813
- private scrolling;
814
- cellHoverClassNames: string[];
815
- name: string;
816
- private itemDOMElements;
817
- private itemDOMRefs;
818
- private updaters;
819
- private mappedCells;
820
- private items;
821
- private currentHoveredRow;
822
- private onDestroy;
823
- private hoverRowUpdatesInProgress;
824
- private infiniteNode;
825
- private getInfiniteNode;
826
- setTransform: (element: HTMLElement, _rowIndex: number, colIndex: number, { x, y, scrollLeft, scrollTop, }: {
827
- x: number;
828
- y: number;
829
- scrollLeft?: boolean | undefined;
830
- scrollTop?: boolean | undefined;
831
- }, zIndex: number | 'auto' | undefined | null) => void;
832
- constructor(brain: MatrixBrain);
833
- getFullyVisibleRowsRange: () => {
834
- start: number;
835
- end: number;
836
- } | null;
837
- getScrollPositionForScrollRowIntoView: (rowIndex: number, config?: {
838
- scrollAdjustPosition?: ScrollAdjustPosition;
839
- offset?: number;
840
- }) => ScrollPosition | null;
841
- getScrollPositionForScrollColumnIntoView: (colIndex: number, config?: {
842
- scrollAdjustPosition?: ScrollAdjustPosition;
843
- offset?: number;
844
- }) => ScrollPosition | null;
845
- getScrollPositionForScrollCellIntoView: (rowIndex: number, colIndex: number, config?: {
846
- rowScrollAdjustPosition?: ScrollAdjustPosition;
847
- colScrollAdjustPosition?: ScrollAdjustPosition;
848
- scrollAdjustPosition?: ScrollAdjustPosition;
849
- offsetTop: number;
850
- offsetLeft: number;
851
- }) => ScrollPosition | null;
852
- isRowFullyVisible: (rowIndex: number, offsetMargin?: number) => boolean;
853
- isRowVisible: (rowIndex: number, offsetMargin?: number) => boolean;
854
- isRowRendered: (rowIndex: number) => boolean;
855
- isCellVisible: (rowIndex: number, colIndex: number) => boolean;
856
- isCellFullyVisible: (rowIndex: number, colIndex: number) => boolean;
857
- isColumnFullyVisible: (colIndex: number, offsetMargin?: number) => boolean;
858
- isColumnVisible: (colIndex: number, offsetMargin?: number) => boolean;
859
- isCellRendered: (rowIndex: number, colIndex: number) => boolean;
860
- isColumnRendered: (colIndex: number) => boolean;
861
- getExtraSpanCellsForRange: (range: TableRenderRange) => [number, number][];
862
- renderRange: (range: TableRenderRange, { renderCell, force, onRender, }: {
863
- force?: boolean | undefined;
864
- renderCell: TableRenderCellFn;
865
- onRender: (items: Renderable[]) => void;
866
- }) => Renderable[];
867
- private renderElement;
868
- getFixedRanges: (currentRenderRange: TableRenderRange) => TableRenderRange[];
869
- private isCellFixed;
870
- private isCellCovered;
871
- private renderCellAtElement;
872
- private onMouseEnter;
873
- private addHoverClass;
874
- private onMouseLeave;
875
- private removeHoverClass;
876
- private updateHoverClassNamesForRow;
877
- private updateElementPosition;
878
- private onScrollStart;
879
- private onScrollStop;
880
- adjustFixedElementsOnScroll: (scrollPosition?: ScrollPosition) => void;
881
- destroy: () => void;
882
- reset(): void;
883
- }
884
-
885
- declare type ComponentStateContext<T_STATE, T_ACTIONS> = {
886
- getComponentState: () => T_STATE;
887
- componentState: T_STATE;
888
- componentActions: T_ACTIONS;
889
- };
890
- declare type ComponentStateGeneratedActions<T_STATE> = {
891
- [k in keyof T_STATE]: T_STATE[k] | React.SetStateAction<T_STATE[k]>;
892
- };
893
- declare type ComponentInterceptedActions<T_STATE> = {
894
- [k in keyof T_STATE]?: (value: T_STATE[k], { actions, state, }: {
895
- actions: ComponentStateGeneratedActions<T_STATE>;
896
- state: T_STATE;
897
- }) => void | boolean;
898
- };
899
- declare type ComponentMappedCallbacks<T_STATE> = {
900
- [k in keyof T_STATE]: (value: T_STATE[k], state: T_STATE) => {
901
- callbackName: string;
902
- callbackParams: any[];
903
- };
904
- };
905
- declare type ComponentStateActions<T_STATE> = ComponentStateGeneratedActions<T_STATE>;
906
-
907
- declare type CellPosition = {
908
- rowIndex: number;
909
- colIndex: number;
910
- };
911
-
912
- declare type NonUndefined<T> = T extends undefined ? never : T;
913
-
914
- declare type SubscriptionCallbackOnChangeFn<T> = (node: T | null) => void;
915
- interface SubscriptionCallback<T> {
916
- (node: T, callback?: () => void): void;
917
- get: () => T | null;
918
- destroy: VoidFn;
919
- onChange: (fn: SubscriptionCallbackOnChangeFn<T>) => VoidFn;
920
- }
921
-
922
- declare class ScrollListener {
923
- private scrollPosition;
924
- private onScrollFns;
925
- getScrollPosition: () => ScrollPosition;
926
- onScroll: (fn: OnScrollFn) => () => void;
927
- setScrollPosition: (scrollPosition: ScrollPosition) => void;
928
- private notifyScrollChange;
929
- destroy: () => void;
930
- }
931
-
932
- interface InfiniteTableSetupState<T> {
933
- renderer: ReactHeadlessTableRenderer;
934
- onRenderUpdater: SubscriptionCallback<Renderable>;
935
- propsCache: Map<keyof InfiniteTableProps<T>, WeakMap<any, any>>;
936
- columnsWhenInlineGroupRenderStrategy?: Map<string, InfiniteTableColumn<T>>;
937
- domRef: MutableRefObject<HTMLDivElement | null>;
938
- scrollerDOMRef: MutableRefObject<HTMLDivElement | null>;
939
- portalDOMRef: MutableRefObject<HTMLDivElement | null>;
940
- activeCellIndicatorDOMRef: MutableRefObject<HTMLDivElement | null>;
941
- onRowHeightCSSVarChange: SubscriptionCallback<number>;
942
- onColumnHeaderHeightCSSVarChange: SubscriptionCallback<number>;
943
- cellClick: SubscriptionCallback<CellPosition & {
944
- event: MouseEvent;
945
- }>;
946
- cellMouseDown: SubscriptionCallback<CellPosition & {
947
- event: MouseEvent;
948
- }>;
949
- keyDown: SubscriptionCallback<KeyboardEvent>;
950
- columnsWhenGrouping?: InfiniteTableColumnsMap<T>;
951
- bodySize: Size;
952
- brain: MatrixBrain;
953
- headerBrain: MatrixBrain;
954
- focused: boolean;
955
- ready: boolean;
956
- columnReorderDragColumnId: false | string;
957
- columnVisibilityForGrouping: Record<string, false>;
958
- focusedWithin: boolean;
959
- scrollPosition: ScrollPosition;
960
- pinnedStartScrollListener: ScrollListener;
961
- pinnedEndScrollListener: ScrollListener;
962
- }
963
- declare type InfiniteTableColumnGroupsDepthsMap = Map<string, number>;
964
- declare type InfiniteTablePropPivotTotalColumnPosition = false | 'start' | 'end';
965
- declare type InfiniteTablePropPivotGrandTotalColumnPosition = InfiniteTablePropPivotTotalColumnPosition;
966
- interface InfiniteTableMappedState<T> {
967
- scrollTopKey: InfiniteTableProps<T>['scrollTopKey'];
968
- viewportReservedWidth: InfiniteTableProps<T>['viewportReservedWidth'];
969
- resizableColumns: InfiniteTableProps<T>['resizableColumns'];
970
- groupColumn: InfiniteTableProps<T>['groupColumn'];
971
- headerOptions: NonUndefined<InfiniteTableProps<T>['headerOptions']>;
972
- onScrollbarsChange: InfiniteTableProps<T>['onScrollbarsChange'];
973
- columnPinning: InfiniteTablePropColumnPinning;
974
- loadingText: InfiniteTableProps<T>['loadingText'];
975
- components: InfiniteTableProps<T>['components'];
976
- columns: InfiniteTableColumnsMap<T>;
977
- pivotColumns: InfiniteTableProps<T>['pivotColumns'];
978
- onReady: InfiniteTableProps<T>['onReady'];
979
- onSelfFocus: InfiniteTableProps<T>['onSelfFocus'];
980
- onSelfBlur: InfiniteTableProps<T>['onSelfBlur'];
981
- onFocusWithin: InfiniteTableProps<T>['onFocusWithin'];
982
- onBlurWithin: InfiniteTableProps<T>['onBlurWithin'];
983
- autoSizeColumnsKey: InfiniteTableProps<T>['autoSizeColumnsKey'];
984
- activeRowIndex: InfiniteTableProps<T>['activeRowIndex'];
985
- activeCellIndex: InfiniteTableProps<T>['activeCellIndex'];
986
- scrollStopDelay: NonUndefined<InfiniteTableProps<T>['scrollStopDelay']>;
987
- onScrollToTop: InfiniteTableProps<T>['onScrollToTop'];
988
- onScrollToBottom: InfiniteTableProps<T>['onScrollToBottom'];
989
- onScrollStop: InfiniteTableProps<T>['onScrollStop'];
990
- scrollToBottomOffset: InfiniteTableProps<T>['scrollToBottomOffset'];
991
- filterEditors: NonUndefined<InfiniteTableProps<T>['filterEditors']>;
992
- focusedClassName: InfiniteTableProps<T>['focusedClassName'];
993
- focusedWithinClassName: InfiniteTableProps<T>['focusedWithinClassName'];
994
- focusedStyle: InfiniteTableProps<T>['focusedStyle'];
995
- focusedWithinStyle: InfiniteTableProps<T>['focusedWithinStyle'];
996
- showSeparatePivotColumnForSingleAggregation: NonUndefined<InfiniteTableProps<T>['showSeparatePivotColumnForSingleAggregation']>;
997
- domProps: InfiniteTableProps<T>['domProps'];
998
- rowStyle: InfiniteTableProps<T>['rowStyle'];
999
- rowProps: InfiniteTableProps<T>['rowProps'];
1000
- rowClassName: InfiniteTableProps<T>['rowClassName'];
1001
- pinnedStartMaxWidth: InfiniteTableProps<T>['pinnedStartMaxWidth'];
1002
- pinnedEndMaxWidth: InfiniteTableProps<T>['pinnedEndMaxWidth'];
1003
- pivotColumn: InfiniteTableProps<T>['pivotColumn'];
1004
- pivotColumnGroups: InfiniteTablePropColumnGroupsMap;
1005
- columnMinWidth: NonUndefined<InfiniteTableProps<T>['columnMinWidth']>;
1006
- columnMaxWidth: NonUndefined<InfiniteTableProps<T>['columnMaxWidth']>;
1007
- columnDefaultWidth: NonUndefined<InfiniteTableProps<T>['columnDefaultWidth']>;
1008
- columnCssEllipsis: NonUndefined<InfiniteTableProps<T>['columnCssEllipsis']>;
1009
- draggableColumns: NonUndefined<InfiniteTableProps<T>['draggableColumns']>;
1010
- sortable: NonUndefined<InfiniteTableProps<T>['sortable']>;
1011
- hideEmptyGroupColumns: NonUndefined<InfiniteTableProps<T>['hideEmptyGroupColumns']>;
1012
- hideColumnWhenGrouped: NonUndefined<InfiniteTableProps<T>['hideColumnWhenGrouped']>;
1013
- keyboardSelection: NonUndefined<InfiniteTableProps<T>['keyboardSelection']>;
1014
- columnOrder: NonUndefined<InfiniteTableProps<T>['columnOrder']>;
1015
- showZebraRows: NonUndefined<InfiniteTableProps<T>['showZebraRows']>;
1016
- showHoverRows: NonUndefined<InfiniteTableProps<T>['showHoverRows']>;
1017
- header: NonUndefined<InfiniteTableProps<T>['header']>;
1018
- virtualizeColumns: NonUndefined<InfiniteTableProps<T>['virtualizeColumns']>;
1019
- rowHeight: number;
1020
- columnHeaderHeight: number;
1021
- licenseKey: NonUndefined<InfiniteTableProps<T>['licenseKey']>;
1022
- columnVisibility: InfiniteTablePropColumnVisibility;
1023
- columnSizing: InfiniteTablePropColumnSizing;
1024
- columnTypes: InfiniteTablePropColumnTypes<T>;
1025
- columnGroups: InfiniteTablePropColumnGroupsMap;
1026
- collapsedColumnGroups: NonUndefined<InfiniteTableProps<T>['collapsedColumnGroups']>;
1027
- pivotTotalColumnPosition: NonUndefined<InfiniteTableProps<T>['pivotTotalColumnPosition']>;
1028
- pivotGrandTotalColumnPosition: InfiniteTableProps<T>['pivotGrandTotalColumnPosition'];
1029
- }
1030
- interface InfiniteTableDerivedState<T> {
1031
- groupBy: DataSourceProps<T>['groupBy'];
1032
- computedColumns: Map<string, InfiniteTableColumn<T>>;
1033
- initialColumns: InfiniteTableProps<T>['columns'];
1034
- groupRenderStrategy: NonUndefined<InfiniteTableProps<T>['groupRenderStrategy']>;
1035
- columnHeaderCssEllipsis: NonUndefined<InfiniteTableProps<T>['columnHeaderCssEllipsis']>;
1036
- keyboardNavigation: NonUndefined<InfiniteTableProps<T>['keyboardNavigation']>;
1037
- columnGroupsDepthsMap: InfiniteTableColumnGroupsDepthsMap;
1038
- columnGroupsMaxDepth: number;
1039
- computedColumnGroups: InfiniteTablePropColumnGroupsMap;
1040
- rowHeightCSSVar: string;
1041
- columnHeaderHeightCSSVar: string;
1042
- controlledColumnVisibility: boolean;
1043
- }
1044
- declare type InfiniteTableActions<T> = ComponentStateActions<InfiniteTableState<T>>;
1045
- interface InfiniteTableState<T> extends InfiniteTableMappedState<T>, InfiniteTableDerivedState<T>, InfiniteTableSetupState<T> {
1046
- }
1047
-
1048
- interface InfiniteTableContextValue<T> {
1049
- imperativeApi: InfiniteTableApi<T>;
1050
- componentState: InfiniteTableState<T>;
1051
- componentActions: InfiniteTableActions<T>;
1052
- computed: InfiniteTableComputedValues<T>;
1053
- getComputed: () => InfiniteTableComputedValues<T>;
1054
- getState: () => InfiniteTableState<T>;
1055
- }
1056
-
1057
- declare type GroupKeyType$1<T extends any = any> = T;
1058
- declare type GroupBy<DataType, KeyType> = {
1059
- field: keyof DataType;
1060
- toKey?: (value: any, data: DataType) => GroupKeyType$1<KeyType>;
1061
- column?: Partial<InfiniteTableGroupColumnBase<DataType>>;
1062
- };
1063
-
1064
- declare type RenderRange = {
1065
- renderStartIndex: number;
1066
- renderEndIndex: number;
1067
- };
1068
-
1069
- declare type BooleanDeepCollectionStateKeys<KeyType> = true | KeyType[][];
1070
- declare type BooleanDeepCollectionStateObject<KeyType> = {
1071
- positiveItems: BooleanDeepCollectionStateKeys<KeyType>;
1072
- negativeItems: BooleanDeepCollectionStateKeys<KeyType>;
1073
- };
1074
- declare abstract class BooleanDeepCollectionState<StateObject, KeyType extends any = any> {
1075
- protected positiveMap?: DeepMap<KeyType, true>;
1076
- protected negativeMap?: DeepMap<KeyType, true>;
1077
- protected allNegative: boolean;
1078
- protected allPositive: boolean;
1079
- private initialState;
1080
- constructor(state: BooleanDeepCollectionStateObject<KeyType> | BooleanDeepCollectionState<StateObject, KeyType>);
1081
- abstract getPositiveFromState(state: StateObject): BooleanDeepCollectionStateKeys<KeyType>;
1082
- abstract getNegativeFromState(state: StateObject): BooleanDeepCollectionStateKeys<KeyType>;
1083
- abstract getState(): StateObject;
1084
- protected getInitialState(): BooleanDeepCollectionStateObject<KeyType>;
1085
- destroy(): void;
1086
- private update;
1087
- protected areAllNegative(): boolean;
1088
- protected areAllPositive(): boolean;
1089
- protected makeAllNegative(): void;
1090
- protected makeAllPositive(): void;
1091
- protected isItemPositive(keys: KeyType[]): boolean | undefined;
1092
- protected isItemNegative(keys: KeyType[]): boolean;
1093
- protected setItemValue(keys: KeyType[], shouldMakePositive: boolean): void;
1094
- protected makeItemNegative(keys: KeyType[]): void;
1095
- protected makeItemPositive(keys: KeyType[]): void;
1096
- protected toggleItem(keys: KeyType[]): void;
1097
- }
1098
-
1099
- declare class GroupRowsState<KeyType extends any = any> extends BooleanDeepCollectionState<DataSourcePropGroupRowsStateObject<KeyType>, KeyType> {
1100
- constructor(state: DataSourcePropGroupRowsStateObject<KeyType> | GroupRowsState<KeyType>);
1101
- getState(): DataSourcePropGroupRowsStateObject<KeyType>;
1102
- getPositiveFromState(state: DataSourcePropGroupRowsStateObject<KeyType>): DataSourceGroupRowsList<KeyType>;
1103
- getNegativeFromState(state: DataSourcePropGroupRowsStateObject<KeyType>): DataSourceGroupRowsList<KeyType>;
1104
- areAllCollapsed(): boolean;
1105
- areAllExpanded(): boolean;
1106
- collapseAll(): void;
1107
- expandAll(): void;
1108
- isGroupRowExpanded(keys: KeyType[]): boolean | undefined;
1109
- isGroupRowCollapsed(keys: KeyType[]): boolean;
1110
- setGroupRowExpanded(keys: KeyType[], shouldExpand: boolean): void;
1111
- collapseGroupRow(keys: KeyType[]): void;
1112
- expandGroupRow(keys: KeyType[]): void;
1113
- toggleGroupRow(keys: KeyType[]): void;
1114
- }
1115
-
1116
- declare class Indexer<DataType, PrimaryKeyType = string> {
1117
- primaryKeyToData: Map<string, DataType>;
1118
- add: (primaryKey: PrimaryKeyType, data: DataType) => void;
1119
- clear: () => void;
1120
- getDataForPrimaryKey: (primaryKey: PrimaryKeyType) => DataType | undefined;
1121
- indexArray: (arr: DataType[], toPrimaryKey: (data: DataType) => PrimaryKeyType) => void;
1122
- }
1123
-
1124
- interface DataSourceDataParams<T> {
1125
- originalDataArray: T[];
1126
- sortInfo?: DataSourceSortInfo<T>;
1127
- groupBy?: DataSourcePropGroupBy<T>;
1128
- pivotBy?: DataSourcePropPivotBy<T>;
1129
- filterValue?: DataSourcePropFilterValue<T>;
1130
- groupRowsState?: DataSourcePropGroupRowsStateObject<any>;
1131
- lazyLoadBatchSize?: number;
1132
- lazyLoadStartIndex?: number;
1133
- groupKeys?: any[];
1134
- append?: boolean;
1135
- aggregationReducers?: DataSourcePropAggregationReducers<T>;
1136
- livePaginationCursor?: DataSourceLivePaginationCursorValue;
1137
- __cursorId?: DataSourceSetupState<T>['cursorId'];
1138
- changes?: DataSourceDataParamsChanges<T>;
1139
- }
1140
- declare type DataSourceDataParamsChanges<T> = Partial<Record<keyof Omit<DataSourceDataParams<T>, 'originalDataArray' | 'changes'>, true>>;
1141
- declare type DataSourceSingleSortInfo<T> = Omit<MultisortInfo<T>, 'field'> & {
1142
- field?: keyof T | (keyof T)[];
1143
- id?: string;
1144
- };
1145
- declare type DataSourceGroupBy<T> = GroupBy<T, any>;
1146
- declare type DataSourcePivotBy<T> = PivotBy<T, any>;
1147
- declare type DataSourceSortInfo<T> = null | DataSourceSingleSortInfo<T> | DataSourceSingleSortInfo<T>[];
1148
- declare type DataSourcePropSortInfo<T> = DataSourceSortInfo<T>;
1149
- declare type DataSourceRemoteData<T> = {
1150
- data: T[] | LazyGroupDataItem<T>[];
1151
- mappings?: DataSourceMappings;
1152
- cache?: boolean;
1153
- error?: string;
1154
- totalCount?: number;
1155
- totalCountUnfiltered?: number;
1156
- livePaginationCursor?: DataSourceLivePaginationCursorValue;
1157
- };
1158
- declare type DataSourceData<T> = T[] | DataSourceRemoteData<T> | Promise<T[] | DataSourceRemoteData<T>> | ((dataInfo: DataSourceDataParams<T>) => T[] | Promise<T[] | DataSourceRemoteData<T>>);
1159
- declare type DataSourceGroupRowsList<KeyType> = true | KeyType[][];
1160
- declare type DataSourcePropGroupRowsStateObject<KeyType> = {
1161
- expandedRows: DataSourceGroupRowsList<KeyType>;
1162
- collapsedRows: DataSourceGroupRowsList<KeyType>;
1163
- };
1164
- declare type DataSourcePropGroupBy<T> = DataSourceGroupBy<T>[];
1165
- declare type DataSourcePropPivotBy<T> = DataSourcePivotBy<T>[];
1166
- interface DataSourceMappedState<T> {
1167
- aggregationReducers?: DataSourceProps<T>['aggregationReducers'];
1168
- livePagination: DataSourceProps<T>['livePagination'];
1169
- isRowSelected: DataSourceProps<T>['isRowSelected'];
1170
- lazyLoad: DataSourceProps<T>['lazyLoad'];
1171
- useGroupKeysForMultiRowSelection: NonUndefined<DataSourceProps<T>['useGroupKeysForMultiRowSelection']>;
1172
- onDataParamsChange: DataSourceProps<T>['onDataParamsChange'];
1173
- data: DataSourceProps<T>['data'];
1174
- sortMode: DataSourceProps<T>['sortMode'];
1175
- filterFunction: DataSourceProps<T>['filterFunction'];
1176
- filterValue: DataSourceProps<T>['filterValue'];
1177
- filterTypes: NonUndefined<DataSourceProps<T>['filterTypes']>;
1178
- primaryKey: DataSourceProps<T>['primaryKey'];
1179
- filterDelay: NonUndefined<DataSourceProps<T>['filterDelay']>;
1180
- groupBy: NonUndefined<DataSourceProps<T>['groupBy']>;
1181
- pivotBy: DataSourceProps<T>['pivotBy'];
1182
- loading: NonUndefined<DataSourceProps<T>['loading']>;
1183
- sortTypes: NonUndefined<DataSourceProps<T>['sortTypes']>;
1184
- collapseGroupRowsOnDataFunctionChange: NonUndefined<DataSourceProps<T>['collapseGroupRowsOnDataFunctionChange']>;
1185
- sortInfo: DataSourceSingleSortInfo<T>[] | null;
1186
- }
1187
- declare type DataSourceAggregationReducer<T, AggregationResultType> = {
1188
- name?: string;
1189
- field?: keyof T;
1190
- initialValue?: AggregationResultType;
1191
- getter?: (data: T) => any;
1192
- reducer: string | ((accumulator: any, value: any, data: T, index: number, groupKeys: any[] | undefined) => AggregationResultType | any);
1193
- done?: (accumulatedValue: AggregationResultType | any, array: T[]) => AggregationResultType;
1194
- pivotColumn?: ColumnTypeWithInherit<Partial<InfiniteTableColumn<T>>> | (({ column, }: {
1195
- column: InfiniteTablePivotFinalColumnVariant<T>;
1196
- }) => ColumnTypeWithInherit<Partial<InfiniteTablePivotColumn<T>>>);
1197
- };
1198
- declare type ColumnTypeWithInherit<COL_TYPE> = COL_TYPE & {
1199
- inheritFromColumn?: string | boolean;
1200
- };
1201
- declare type DataSourceMappings = Record<'totals' | 'values', string>;
1202
- declare type LazyGroupDataItem<DataType> = {
1203
- data: Partial<DataType>;
1204
- keys: any[];
1205
- aggregations?: Record<string, any>;
1206
- dataset?: DataSourceRemoteData<DataType>;
1207
- totalChildrenCount?: number;
1208
- pivot?: {
1209
- values: Record<string, any>;
1210
- totals?: Record<string, any>;
1211
- };
1212
- };
1213
- declare type LazyRowInfoGroup<DataType> = {
1214
- /**
1215
- * Those are direct children of the current lazy group row
1216
- */
1217
- children: LazyGroupDataItem<DataType>[];
1218
- childrenLoading: boolean;
1219
- childrenAvailable: boolean;
1220
- cache: boolean;
1221
- totalCount: number;
1222
- totalCountUnfiltered: number;
1223
- error?: string;
1224
- };
1225
- declare type LazyGroupDataDeepMap<DataType, KeyType = string> = DeepMap<KeyType, LazyRowInfoGroup<DataType>>;
1226
- interface DataSourceSetupState<T> {
1227
- indexer: Indexer<T, any>;
1228
- unfilteredCount: number;
1229
- filteredCount: number;
1230
- lazyLoadCacheOfLoadedBatches: DeepMap<string, true>;
1231
- pivotMappings?: DataSourceMappings;
1232
- propsCache: Map<keyof DataSourceProps<T>, WeakMap<any, any>>;
1233
- showSeparatePivotColumnForSingleAggregation: boolean;
1234
- dataParams?: DataSourceDataParams<T>;
1235
- originalLazyGroupData: LazyGroupDataDeepMap<T>;
1236
- originalLazyGroupDataChangeDetect: number | string;
1237
- scrollStopDelayUpdatedByTable: number;
1238
- notifyScrollbarsChange: SubscriptionCallback<Scrollbars>;
1239
- notifyScrollStop: SubscriptionCallback<ScrollStopInfo>;
1240
- notifyRenderRangeChange: SubscriptionCallback<RenderRange>;
1241
- originalDataArray: T[];
1242
- lastFilterDataArray?: T[];
1243
- lastSortDataArray?: T[];
1244
- lastGroupDataArray?: InfiniteTableRowInfo<T>[];
1245
- dataArray: InfiniteTableRowInfo<T>[];
1246
- groupDeepMap?: DeepMap<GroupKeyType, DeepMapGroupValueType<T, any>>;
1247
- reducerResults?: Record<string, AggregationReducerResult>;
1248
- allRowsSelected: boolean;
1249
- someRowsSelected: boolean;
1250
- pivotTotalColumnPosition: InfiniteTablePropPivotTotalColumnPosition;
1251
- pivotGrandTotalColumnPosition: InfiniteTablePropPivotGrandTotalColumnPosition;
1252
- cursorId: number | symbol | DataSourceLivePaginationCursorValue;
1253
- updatedAt: number;
1254
- reducedAt: number;
1255
- groupedAt: number;
1256
- sortedAt: number;
1257
- filteredAt: number;
1258
- generateGroupRows: boolean;
1259
- postFilterDataArray?: T[];
1260
- postSortDataArray?: T[];
1261
- postGroupDataArray?: InfiniteTableRowInfo<T>[];
1262
- pivotColumns?: Map<string, InfiniteTableColumn<T>>;
1263
- pivotColumnGroups?: Map<string, InfiniteTableColumnGroup>;
1264
- }
1265
- declare type DataSourcePropAggregationReducers<T> = Record<string, DataSourceAggregationReducer<T, any>>;
1266
- declare type DataSourcePropMultiRowSelectionChangeParamType = RowSelectionStateObject;
1267
- declare type DataSourcePropRowSelection = DataSourcePropRowSelection_MultiRow | DataSourcePropRowSelection_SingleRow;
1268
- declare type DataSourcePropRowSelection_MultiRow = RowSelectionStateObject;
1269
- declare type DataSourcePropRowSelection_SingleRow = null | string | number;
1270
- declare type DataSourcePropCellSelection = any;
1271
- declare type DataSourcePropSelectionMode = false | 'single-cell' | 'single-row' | 'multi-cell' | 'multi-row';
1272
- declare type DataSourcePropOnRowSelectionChange_MultiRow = (rowSelection: DataSourcePropRowSelection_MultiRow, selectionMode: 'multi-row') => void;
1273
- declare type DataSourcePropOnRowSelectionChange_SingleRow = (rowSelection: DataSourcePropRowSelection_SingleRow, selectionMode: 'single-row') => void;
1274
- declare type DataSourcePropOnRowSelectionChange = DataSourcePropOnRowSelectionChange_SingleRow | DataSourcePropOnRowSelectionChange_MultiRow;
1275
- declare type DataSourcePropOnCellSelectionChange = (cellSelectionParams: any) => void;
1276
- declare type DataSourcePropIsRowSelected<T> = (rowInfo: InfiniteTableRowInfo<T>, rowSelectionState: RowSelectionState, selectionMode: 'multi-row') => boolean | null;
1277
- declare type DataSourceProps<T> = {
1278
- children: React$1.ReactNode | ((contextData: DataSourceState<T>) => React$1.ReactNode);
1279
- primaryKey: keyof T | ((data: T) => string);
1280
- fields?: (keyof T)[];
1281
- data: DataSourceData<T>;
1282
- selectionMode?: DataSourcePropSelectionMode;
1283
- useGroupKeysForMultiRowSelection?: boolean;
1284
- rowSelection?: DataSourcePropRowSelection_MultiRow | DataSourcePropRowSelection_SingleRow;
1285
- defaultRowSelection?: DataSourcePropRowSelection_MultiRow | DataSourcePropRowSelection_SingleRow;
1286
- cellSelection?: DataSourcePropCellSelection;
1287
- defaultCellSelection?: DataSourcePropCellSelection;
1288
- onCellSelectionChange?: DataSourcePropOnCellSelectionChange;
1289
- isRowSelected?: DataSourcePropIsRowSelected<T>;
1290
- lazyLoad?: boolean | {
1291
- batchSize?: number;
1292
- };
1293
- loading?: boolean;
1294
- defaultLoading?: boolean;
1295
- onLoadingChange?: (loading: boolean) => void;
1296
- pivotBy?: DataSourcePropPivotBy<T>;
1297
- defaultPivotBy?: DataSourcePropPivotBy<T>;
1298
- onPivotByChange?: (pivotBy: DataSourcePropPivotBy<T>) => void;
1299
- aggregationReducers?: DataSourcePropAggregationReducers<T>;
1300
- defaultAggregationReducers?: DataSourcePropAggregationReducers<T>;
1301
- groupBy?: DataSourcePropGroupBy<T>;
1302
- defaultGroupBy?: DataSourcePropGroupBy<T>;
1303
- onGroupByChange?: (groupBy: DataSourcePropGroupBy<T>) => void;
1304
- groupRowsState?: GroupRowsState | DataSourcePropGroupRowsStateObject<any>;
1305
- defaultGroupRowsState?: GroupRowsState | DataSourcePropGroupRowsStateObject<keyof T>;
1306
- onGroupRowsStateChange?: (groupRowsState: GroupRowsState) => void;
1307
- collapseGroupRowsOnDataFunctionChange?: boolean;
1308
- sortInfo?: DataSourceSortInfo<T>;
1309
- defaultSortInfo?: DataSourceSortInfo<T>;
1310
- onSortInfoChange?: ((sortInfo: DataSourceSingleSortInfo<T> | null) => void) | ((sortInfo: DataSourceSingleSortInfo<T>[]) => void);
1311
- onDataParamsChange?: (dataParamsChange: DataSourceDataParams<T>) => void;
1312
- livePagination?: boolean;
1313
- livePaginationCursor?: DataSourcePropLivePaginationCursor<T>;
1314
- onLivePaginationCursorChange?: (livePaginationCursor: DataSourceLivePaginationCursorValue) => void;
1315
- filterFunction?: DataSourcePropFilterFunction<T>;
1316
- sortMode?: 'local' | 'remote';
1317
- filterMode?: 'local' | 'remote';
1318
- filterValue?: DataSourcePropFilterValue<T>;
1319
- defaultFilterValue?: DataSourcePropFilterValue<T>;
1320
- onFilterValueChange?: (filterValue: DataSourcePropFilterValue<T>) => void;
1321
- filterDelay?: number;
1322
- filterTypes?: DataSourcePropFilterTypes<T>;
1323
- sortTypes?: DataSourcePropSortTypes;
1324
- } & ({
1325
- selectionMode?: 'multi-row';
1326
- rowSelection?: DataSourcePropRowSelection_MultiRow;
1327
- defaultRowSelection?: DataSourcePropRowSelection_MultiRow;
1328
- onRowSelectionChange?: DataSourcePropOnRowSelectionChange_MultiRow;
1329
- } | {
1330
- selectionMode?: 'single-row';
1331
- rowSelection?: DataSourcePropRowSelection_SingleRow;
1332
- defaultRowSelection?: DataSourcePropRowSelection_SingleRow;
1333
- onRowSelectionChange?: DataSourcePropOnRowSelectionChange_SingleRow;
1334
- } | {
1335
- selectionMode?: 'single-cell';
1336
- } | {
1337
- selectionMode?: 'multi-cell';
1338
- } | {
1339
- selectionMode?: false;
1340
- });
1341
- declare type DataSourcePropSortTypes = Record<string, (first: any, second: any) => number>;
1342
- declare type DataSourcePropFilterTypes<T> = Record<string, DataSourceFilterType<T>>;
1343
- declare type DataSourceFilterFunctionParam<T> = {
1344
- data: T;
1345
- index: number;
1346
- dataArray: T[];
1347
- primaryKey: any;
1348
- };
1349
- declare type DataSourcePropFilterFunction<T> = (filterParam: DataSourceFilterFunctionParam<T>) => boolean;
1350
- declare type DataSourcePropFilterValue<T> = DataSourceFilterValueItem<T>[];
1351
- declare type DataSourceFilterValueItem<T> = DiscriminatedUnion<{
1352
- field: keyof T;
1353
- }, {
1354
- id: string;
1355
- }> & {
1356
- valueGetter?: DataSourceFilterValueItemValueGetter<T>;
1357
- filterValue: any;
1358
- disabled?: boolean;
1359
- filterType: string;
1360
- operator: string;
1361
- };
1362
- declare type DataSourceFilterValueItemValueGetter<T> = (param: DataSourceFilterFunctionParam<T>) => any;
1363
- declare type DataSourceFilterType<T> = {
1364
- emptyValues: Set<any>;
1365
- label?: string;
1366
- defaultOperator: string;
1367
- operators: DataSourceFilterOperator<T>[];
1368
- };
1369
- declare type DataSourceFilterOperator<T> = {
1370
- name: string;
1371
- label?: string;
1372
- fn: DataSourceFilterOperatorFunction<T>;
1373
- };
1374
- declare type DataSourceFilterOperatorFunction<T> = (filterOperatorFunctionParam: DataSourceFilterOperatorFunctionParam<T>) => boolean;
1375
- declare type DataSourceFilterOperatorFunctionParam<T> = {
1376
- currentValue: any;
1377
- filterValue: any;
1378
- emptyValues: Set<any>;
1379
- } & DataSourceFilterFunctionParam<T>;
1380
- declare type DataSourcePropLivePaginationCursor<T> = DataSourceLivePaginationCursorValue | DataSourceLivePaginationCursorFn<T>;
1381
- declare type DataSourceLivePaginationCursorFn<T> = (params: DataSourceLivePaginationCursorParams<T>) => DataSourceLivePaginationCursorValue;
1382
- declare type DataSourceLivePaginationCursorParams<T> = {
1383
- array: T[];
1384
- lastItem: T | Partial<T> | null;
1385
- length: number;
1386
- };
1387
- declare type DataSourceLivePaginationCursorValue = string | number | null;
1388
- interface DataSourceState<T> extends DataSourceSetupState<T>, DataSourceDerivedState<T>, DataSourceMappedState<T> {
1389
- }
1390
- declare type DataSourceDerivedState<T> = {
1391
- toPrimaryKey: (data: T) => any;
1392
- operatorsByFilterType: Record<string, Record<string, DataSourceFilterOperator<T>>>;
1393
- filterMode: NonUndefined<DataSourceProps<T>['filterMode']>;
1394
- groupRowsState: GroupRowsState<T>;
1395
- multiSort: boolean;
1396
- controlledSort: boolean;
1397
- controlledFilter: boolean;
1398
- livePaginationCursor?: DataSourceLivePaginationCursorValue;
1399
- lazyLoadBatchSize?: number;
1400
- rowSelection: RowSelectionState | null | number | string;
1401
- selectionMode: NonUndefined<DataSourceProps<T>['selectionMode']>;
1402
- };
1403
- declare type DataSourceComponentActions<T> = ComponentStateActions<DataSourceState<T>>;
1404
- interface DataSourceContextValue<T> {
1405
- getState: () => DataSourceState<T>;
1406
- componentState: DataSourceState<T>;
1407
- componentActions: DataSourceComponentActions<T>;
1408
- }
1409
- declare enum DataSourceActionType {
1410
- INIT = "INIT"
1411
- }
1412
- interface DataSourceAction<T> {
1413
- type: DataSourceActionType;
1414
- payload: T;
1415
- }
1416
- interface DataSourceReducer<T> {
1417
- (state: DataSourceState<T>, action: DataSourceAction<any>): DataSourceState<T>;
1418
- }
1419
-
1420
- declare const defaultFilterTypes: Record<string, DataSourceFilterType<any>>;
1421
-
1422
- declare function useDataSource<T>(): DataSourceState<T>;
1423
-
1424
- declare function DataSource<T>(props: DataSourceProps<T>): JSX.Element;
1425
-
1426
- declare type AggregationReducer<T, AggregationResultType = any> = DataSourceAggregationReducer<T, AggregationResultType> & {
1427
- id: string;
1428
- };
1429
- declare type AggregationReducerResult<AggregationResultType extends any = any> = {
1430
- value: AggregationResultType;
1431
- id: string;
1432
- };
1433
- /**
1434
- * InfiniteTableRowInfo can have different object shape depending on the presence or absence of grouping.
1435
- *
1436
- * You can use `dataSourceHasGrouping: boolean` as a discriminator to determine the shape of the object, to know
1437
- * if the dataSource had grouping or not. Furthermore, for when the dataSource has grouping,
1438
- * you can use `isGroupRow: boolean` to discriminate between group rows vs normal rows.
1439
- *
1440
- */
1441
- declare type InfiniteTableRowInfo<T> = InfiniteTable_HasGrouping_RowInfoNormal<T> | InfiniteTable_HasGrouping_RowInfoGroup<T> | InfiniteTable_NoGrouping_RowInfoNormal<T>;
1442
- declare type InfiniteTableRowInfoDataDiscriminator_RowInfoNormal<T> = {
1443
- data: T;
1444
- isGroupRow: false;
1445
- rowActive: boolean;
1446
- rowInfo: InfiniteTable_NoGrouping_RowInfoNormal<T> | InfiniteTable_HasGrouping_RowInfoNormal<T>;
1447
- field?: keyof T;
1448
- value: any;
1449
- rowSelected: boolean | null;
1450
- };
1451
- declare type InfiniteTableRowInfoDataDiscriminator_RowInfoGroup<T> = {
1452
- rowActive: boolean;
1453
- data: Partial<T> | null;
1454
- rowInfo: InfiniteTable_HasGrouping_RowInfoGroup<T>;
1455
- isGroupRow: true;
1456
- field?: keyof T;
1457
- value: any;
1458
- rowSelected: boolean | null;
1459
- };
1460
- declare type InfiniteTableRowInfoDataDiscriminator<T> = InfiniteTableRowInfoDataDiscriminator_RowInfoNormal<T> | InfiniteTableRowInfoDataDiscriminator_RowInfoGroup<T>;
1461
- /**
1462
- * This is the base row info for all scenarios - things every
1463
- * rowInfo is guaranteed to have (be it group or normal row, or dataSource with or without grouping)
1464
- *
1465
- */
1466
- declare type InfiniteTable_RowInfoBase<_T> = {
1467
- id: any;
1468
- value?: any;
1469
- indexInAll: number;
1470
- rowSelected: boolean | null;
1471
- };
1472
- declare type InfiniteTable_HasGrouping_RowInfoNormal<T> = {
1473
- dataSourceHasGrouping: true;
1474
- data: T;
1475
- isGroupRow: false;
1476
- } & InfiniteTable_HasGrouping_RowInfoBase<T> & InfiniteTable_RowInfoBase<T>;
1477
- declare type InfiniteTable_HasGrouping_RowInfoGroup<T> = {
1478
- dataSourceHasGrouping: true;
1479
- data: Partial<T> | null;
1480
- isGroupRow: true;
1481
- /**
1482
- * This array contains all the (uncollapsed, so visible) row infos under this group, at any level of nesting,
1483
- * in the order in which they are visible in the table
1484
- */
1485
- deepRowInfoArray: (InfiniteTable_HasGrouping_RowInfoNormal<T> | InfiniteTable_HasGrouping_RowInfoGroup<T>)[];
1486
- error?: string;
1487
- reducerResults?: Record<string, AggregationReducerResult>;
1488
- /**
1489
- * The count of all leaf nodes (normal rows) that are inside this group.
1490
- * This count is the same as the length of the groupData array property.
1491
- *
1492
- */
1493
- groupCount: number;
1494
- /**
1495
- * The array of all leaf nodes (normal rows) that are inside this group.
1496
- */
1497
- groupData: T[];
1498
- /**
1499
- * The count of all selected leaf nodes (normal rows) inside the group that are selected
1500
- */
1501
- selectedChildredCount: number;
1502
- /**
1503
- * The count of all deselected leaf nodes (normal rows) inside the group that are selected
1504
- */
1505
- deselectedChildredCount: number;
1506
- /**
1507
- * Will be used only with lazy loading, if the server provides this info on the data items.
1508
- *
1509
- * Represents the total count of all leaf nodes (normal rows) that are under this group
1510
- * at any level (so not only direct children). This is needed for multiple selection to work properly,
1511
- * so the table component knows how many rows are on the remote backend, and whether to show a group as selected or not
1512
- * when it has a certain number of rows selected
1513
- */
1514
- totalChildrenCount?: number;
1515
- /**
1516
- * The count of all leaf nodes (normal rows) inside the group that are not being visible
1517
- * due to collapsing (either the current row is collapsed or any of its children)
1518
- */
1519
- collapsedChildrenCount: number;
1520
- collapsedGroupsCount: number;
1521
- /**
1522
- * The count of the direct children of the current group. Direct children can be either normal rows or groups.
1523
- */
1524
- directChildrenCount: number;
1525
- directChildrenLoadedCount: number;
1526
- /**
1527
- *
1528
- * A DeepMap of pivot values.
1529
- *
1530
- * For each pivot reducer result, it contains all the items that make up the pivot value.
1531
- *
1532
- */
1533
- pivotValuesMap?: PivotValuesDeepMap<T, any>;
1534
- /**
1535
- * For non-lazy grouping, this is always true.
1536
- * For lazy/batched grouping, this is true if the group has been expanded at least once (and if the remote call has been configured with cache: true),
1537
- * since if the remote call is not cached, collapsing the row group should lose all the data that was loaded for it, and it's as if it was never loaded, so in that case, childrenAvailable is false.
1538
- *
1539
- * NOTE: if this is true, it doesn't mean that all the children have been loaded, it only means that some children have been loaded and are available
1540
- *
1541
- * Use directChildrenCount and directChildrenLoadedCount to know if all the children have been loaded or not.
1542
- */
1543
- childrenAvailable: boolean;
1544
- /**
1545
- * Boolean flag that will be true while lazy loading direct children of the current row group.
1546
- *
1547
- * NOTE: with batched loading, if the user is no longer scrolling, after everything
1548
- * in the viewport has loaded (and thus for example a certain row group had childrenLoading: true)
1549
- * if no new batches are being loaded, childrenLoading will be false again, even though
1550
- * the current row group still has children that are not loaded yet.
1551
- * Use directChildrenLoadedCount and directChildrenCount to know if all the children have been loaded or not.
1552
- */
1553
- childrenLoading: boolean;
1554
- } & InfiniteTable_HasGrouping_RowInfoBase<T> & InfiniteTable_RowInfoBase<T>;
1555
- declare type InfiniteTable_NoGrouping_RowInfoNormal<T> = {
1556
- dataSourceHasGrouping: false;
1557
- data: T;
1558
- isGroupRow: false;
1559
- selfLoaded: boolean;
1560
- } & InfiniteTable_RowInfoBase<T>;
1561
- declare type InfiniteTable_HasGrouping_RowInfoBase<T> = {
1562
- indexInGroup: number;
1563
- /**
1564
- * Available on all rowInfo objects when the datasource is grouped, otherwise, it will be undefined.
1565
- *
1566
- * For group rows, the group keys will have all the keys starting from the topmost parent
1567
- * down to the current group row (including the group row).
1568
- * For normal rows, the group keys will have all the keys starting from the topmost parent
1569
- * down to the last group row in the hierarchy (the direct parent of the current row).
1570
- *
1571
- * Example: People grouped by country and city
1572
- *
1573
- * Italy - country - groupKeys: ['Italy']
1574
- * Rome - city - groupKeys: ['Italy', 'Rome']
1575
- * Marco - person - groupKeys: ['Italy', 'Rome']
1576
- * Luca - person - groupKeys: ['Italy', 'Rome']
1577
- * Giuseppe - person - groupKeys: ['Italy', 'Rome']
1578
- *
1579
- */
1580
- groupKeys: any[];
1581
- /**
1582
- * Available on all rowInfo objects when the datasource is grouped, otherwise, it will be undefined.
1583
- *
1584
- * Has the same structure as groupKeys, but it will contain the fields used to group the rows.
1585
- *
1586
- * Example: People grouped by country and city
1587
- *
1588
- * Italy - country - groupKeys: ['country']
1589
- * Rome - city - groupKeys: ['country', 'city']
1590
- * Marco - person - groupKeys: ['country', 'city']
1591
- * Luca - person - groupKeys: ['country', 'city']
1592
- * Giuseppe - person - groupKeys: ['country', 'city']
1593
- */
1594
- groupBy: (keyof T)[];
1595
- /**
1596
- * The groupBy value of the DataSource component, mapped to the groupBy.field
1597
- */
1598
- rootGroupBy: (keyof T)[];
1599
- /**
1600
- * Available on all rowInfo objects when the datasource is grouped.
1601
- *
1602
- * Italy - country - parent mapped to their ids will be: [] // rowInfo.parents.map((p: any) => p.id)
1603
- * Rome - city - parent mapped to their ids will be: ['Italy']
1604
- * Marco - person - parent mapped to their ids will be: ['Italy','Italy,Rome']
1605
- * Luca - person - parent mapped to their ids will be: ['Italy','Italy,Rome']
1606
- * Giuseppe - person - parent mapped to their ids will be: ['Italy','Italy,Rome']
1607
- * USA - country - parent mapped to their ids will be: []
1608
- * LA - city - parent mapped to their ids will be: ['USA']
1609
- * Bob - person - parent mapped to their ids will be: ['USA','USA,LA']
1610
- */
1611
- parents: InfiniteTable_HasGrouping_RowInfoGroup<T>[];
1612
- /**
1613
- * Available when the datasource is grouped, this will be set for both group and normal rows.
1614
- * Italy - country - indexInParentGroups: [0]
1615
- * Rome - city - indexInParentGroups: [0,0]
1616
- * Marco - person - indexInParentGroups: [0,0,0]
1617
- * Luca - person - indexInParentGroups: [0,0,1]
1618
- * Giuseppe - person - indexInParentGroups: [0,0,2]
1619
- * USA - country - indexInParentGroups: [1]
1620
- * LA - city - indexInParentGroups: [1,0]
1621
- * Bob - person - indexInParentGroups: [1,0,2]
1622
- */
1623
- indexInParentGroups: number[];
1624
- /**
1625
- * Available on all rowInfo objects when the datasource is grouped.
1626
- *
1627
- * For every rowInfo object, it counts the number of leaf/normal rows that the group contains.
1628
- * For normal rows, the groupCount represents the groupCount of the direct parent.
1629
- *
1630
- * Italy - country - groupCount: 3
1631
- * Rome - city - groupCount: 2
1632
- * Marco - person - groupCount: 2
1633
- * Luca - person - groupCount: 2
1634
- * Napoli - city - groupCount: 1
1635
- * Giuseppe - person - groupCount: 1
1636
- * USA - country - groupCount: 1
1637
- * LA - city - groupCount: 1
1638
- * Bob - person - groupCount: 1
1639
- */
1640
- groupCount: number;
1641
- groupNesting: number;
1642
- collapsed: boolean;
1643
- /**
1644
- * This is false only when the DataSource is configured with lazy batching and the current
1645
- * row has not been loaded yet. It has nothing to do with children, only with self.
1646
- */
1647
- selfLoaded: boolean;
1648
- };
1649
- declare type GroupKeyType<T extends any = any> = T;
1650
- declare type PivotReducerResults<T = any> = Record<string, AggregationReducerResult<T>>;
1651
- declare type PivotGroupValueType<DataType, KeyType> = {
1652
- reducerResults: PivotReducerResults<KeyType>;
1653
- items: DataType[];
1654
- };
1655
- declare type PivotValuesDeepMap<DataType, KeyType> = DeepMap<GroupKeyType<KeyType>, PivotGroupValueType<DataType, KeyType>>;
1656
- declare type DeepMapGroupValueType<DataType, KeyType> = {
1657
- /**
1658
- * These are leaf items. This array may be empty when there is batched lazy loading
1659
- */
1660
- items: DataType[];
1661
- commonData?: Partial<DataType>;
1662
- childrenLoading: boolean;
1663
- childrenAvailable: boolean;
1664
- totalChildrenCount?: number;
1665
- cache: boolean;
1666
- error?: string;
1667
- reducerResults: Record<string, AggregationReducerResult>;
1668
- pivotDeepMap?: DeepMap<GroupKeyType<KeyType>, PivotGroupValueType<DataType, KeyType>>;
1669
- };
1670
- declare type PivotBy<DataType, KeyType> = Omit<GroupBy<DataType, KeyType>, 'column'> & {
1671
- column?: ColumnTypeWithInherit<Partial<InfiniteTableColumn<DataType>>> | (({ column, }: {
1672
- column: InfiniteTablePivotFinalColumnVariant<DataType, KeyType>;
1673
- }) => Partial<InfiniteTablePivotColumn<DataType>>);
1674
- columnGroup?: InfiniteTableColumnGroup | (({ columnGroup, }: {
1675
- columnGroup: InfiniteTablePivotFinalColumnGroup<DataType, KeyType>;
1676
- }) => ColumnTypeWithInherit<Partial<InfiniteTablePivotFinalColumnGroup<DataType>>>);
1677
- };
1678
- declare type GroupParams<DataType, KeyType> = {
1679
- groupBy: GroupBy<DataType, KeyType>[];
1680
- defaultToKey?: (value: any, item: DataType) => GroupKeyType<KeyType>;
1681
- pivot?: PivotBy<DataType, KeyType>[];
1682
- reducers?: Record<string, DataSourceAggregationReducer<DataType, any>>;
1683
- };
1684
- declare type DataGroupResult<DataType, KeyType extends any> = {
1685
- deepMap: DeepMap<GroupKeyType<KeyType>, DeepMapGroupValueType<DataType, KeyType>>;
1686
- groupParams: GroupParams<DataType, KeyType>;
1687
- initialData: DataType[];
1688
- reducerResults?: Record<string, AggregationReducerResult>;
1689
- topLevelPivotColumns?: DeepMap<GroupKeyType<KeyType>, boolean>;
1690
- pivot?: PivotBy<DataType, KeyType>[];
1691
- };
1692
- declare function group<DataType, KeyType = any>(groupParams: GroupParams<DataType, KeyType>, data: DataType[]): DataGroupResult<DataType, KeyType>;
1693
- declare function flatten<DataType, KeyType extends any>(groupResult: DataGroupResult<DataType, KeyType>): DataType[];
1694
-
1695
- declare type InfiniteCheckBoxPropChecked = true | false | null;
1696
- declare type InfiniteCheckBoxProps = {
1697
- checked?: InfiniteCheckBoxPropChecked;
1698
- defaultChecked?: InfiniteCheckBoxPropChecked;
1699
- onChange?: (checked: InfiniteCheckBoxPropChecked) => void;
1700
- domProps?: React$1.HTMLProps<HTMLElement>;
1701
- };
1702
- declare function InfiniteCheckBox(props: InfiniteCheckBoxProps): JSX.Element;
1703
-
1704
- declare type ArrayOfIds = Pick<InfiniteTable_RowInfoBase<any>, 'id'>[];
1705
- declare type InfiniteTableSelectionApi = {
1706
- get allRowsSelected(): boolean;
1707
- isRowSelected(pk: any, groupKeys?: any[]): boolean;
1708
- isRowDeselected(pk: any, groupKeys?: any[]): boolean;
1709
- selectRow(pk: any, groupKeys?: any[]): void;
1710
- deselectRow(pk: any, groupKeys?: any[]): void;
1711
- toggleRowSelection(pk: any, groupKeys?: any[]): void;
1712
- selectGroupRow(groupKeys: any[], children?: ArrayOfIds): void;
1713
- deselectGroupRow(groupKeys: any[], children?: ArrayOfIds): void;
1714
- toggleGroupRowSelection(groupKeys: any[], children?: ArrayOfIds): void;
1715
- getGroupRowSelectionState(groupKeys: any[]): boolean | null;
1716
- getSelectedPrimaryKeys(rowSelection?: RowSelectionStateObject): (string | number)[];
1717
- selectAll(): void;
1718
- deselectAll(): void;
1719
- };
1720
-
1721
- declare type LoadMaskProps = {
1722
- visible: boolean;
1723
- children: Renderable;
1724
- };
1725
- declare type InfiniteTablePropColumnOrderNormalized = string[];
1726
- declare type InfiniteTablePropColumnOrder = InfiniteTablePropColumnOrderNormalized | true;
1727
- declare type InfiniteTablePropColumnVisibility = Record<string, false>;
1728
- declare type InfiniteTableColumnPinnedValues = false | 'start' | 'end';
1729
- declare type InfiniteTablePropColumnPinning = Record<string, true | 'start' | 'end'>;
1730
- declare type InfiniteTableRowStyleFnParams<T> = {
1731
- rowIndex: number;
1732
- } & InfiniteTableRowInfoDataDiscriminator<T>;
1733
- declare type InfiniteTableRowStyleFn<T> = (params: InfiniteTableRowStyleFnParams<T>) => undefined | React$1.CSSProperties;
1734
- declare type InfiniteTableRowClassNameFn<T> = (params: InfiniteTableRowStyleFnParams<T>) => string | undefined;
1735
- declare type InfiniteTablePropRowStyle<T> = React$1.CSSProperties | InfiniteTableRowStyleFn<T>;
1736
- declare type InfiniteTablePropRowClassName<T> = string | InfiniteTableRowClassNameFn<T>;
1737
- declare type InfiniteTableColumnAggregator<T, AggregationResultType> = Omit<AggregationReducer<T, AggregationResultType>, 'getter' | 'id'> & {
1738
- getter?: AggregationReducer<T, AggregationResultType>['getter'];
1739
- field?: keyof T;
1740
- };
1741
- declare type InfiniteTableColumnType<T> = {
1742
- minWidth?: number;
1743
- maxWidth?: number;
1744
- filterType?: string;
1745
- sortType?: string;
1746
- dataType?: InfiniteTableDataTypeNames;
1747
- defaultWidth?: number;
1748
- defaultFlex?: number;
1749
- defaultPinned?: InfiniteTableColumnPinnedValues;
1750
- defaultFilterable?: boolean;
1751
- defaultHiddenWhenGroupedBy?: InfiniteTableColumn<T>['defaultHiddenWhenGroupedBy'];
1752
- header?: InfiniteTableColumn<T>['header'];
1753
- comparer?: InfiniteTableColumn<T>['comparer'];
1754
- draggable?: InfiniteTableColumn<T>['draggable'];
1755
- sortable?: InfiniteTableColumn<T>['sortable'];
1756
- resizable?: InfiniteTableColumn<T>['resizable'];
1757
- align?: InfiniteTableColumn<T>['align'];
1758
- verticalAlign?: InfiniteTableColumn<T>['verticalAlign'];
1759
- columnGroup?: string;
1760
- cssEllipsis?: boolean;
1761
- headerCssEllipsis?: boolean;
1762
- field?: keyof T;
1763
- components?: InfiniteTableColumn<T>['components'];
1764
- renderValue?: InfiniteTableColumn<T>['renderValue'];
1765
- render?: InfiniteTableColumn<T>['render'];
1766
- valueGetter?: InfiniteTableColumn<T>['valueGetter'];
1767
- valueFormatter?: InfiniteTableColumn<T>['valueFormatter'];
1768
- style?: InfiniteTableColumn<T>['style'];
1769
- headerStyle?: InfiniteTableColumn<T>['headerStyle'];
1770
- headerClassName?: InfiniteTableColumn<T>['headerClassName'];
1771
- };
1772
- declare type InfiniteTablePropColumnTypes<T> = Record<'default' | string, InfiniteTableColumnType<T>>;
1773
- declare type InfiniteTableColumnSizingOptions = {
1774
- flex?: number;
1775
- width?: number;
1776
- minWidth?: number;
1777
- maxWidth?: number;
1778
- };
1779
- declare type InfiniteTablePropColumnSizing = Record<string, InfiniteTableColumnSizingOptions>;
1780
- declare type InfiniteTableApi<T> = {
1781
- get selectionApi(): InfiniteTableSelectionApi;
1782
- setColumnOrder: (columnOrder: InfiniteTablePropColumnOrder) => void;
1783
- setColumnVisibility: (columnVisibility: InfiniteTablePropColumnVisibility) => void;
1784
- x?: T;
1785
- get scrollLeft(): number;
1786
- set scrollLeft(value: number);
1787
- get scrollTop(): number;
1788
- set scrollTop(value: number);
1789
- toggleGroupRow: (groupKeys: any[]) => void;
1790
- collapseGroupRow: (groupKeys: any[]) => boolean;
1791
- expandGroupRow: (groupKeys: any[]) => boolean;
1792
- scrollRowIntoView: (rowIndex: number, config?: {
1793
- scrollAdjustPosition?: ScrollAdjustPosition;
1794
- offset?: number;
1795
- }) => boolean;
1796
- scrollColumnIntoView: (colId: string, config?: {
1797
- scrollAdjustPosition?: ScrollAdjustPosition;
1798
- offset?: number;
1799
- }) => boolean;
1800
- scrollCellIntoView: (rowIndex: number, colIdOrIndex: string | number, config?: {
1801
- scrollAdjustPosition?: ScrollAdjustPosition;
1802
- offset?: number;
1803
- }) => boolean;
1804
- getState: () => InfiniteTableState<T>;
1805
- getDataSourceState: () => DataSourceState<T>;
1806
- };
1807
- declare type InfiniteTablePropVirtualizeColumns<T> = boolean | ((columns: InfiniteTableComputedColumn<T>[]) => boolean);
1808
- declare type InfiniteTableColumnsMap<T, ColumnType = InfiniteTableColumn<T>> = Map<string, ColumnType>;
1809
- declare type InfiniteTablePropColumns<T, ColumnType = InfiniteTableColumn<T>> = Record<string, ColumnType> | InfiniteTableColumnsMap<T, ColumnType>;
1810
- declare type InfiniteTablePropColumnGroupsMap = Map<string, InfiniteTableColumnGroup>;
1811
- declare type InfiniteTablePropColumnGroupsRecord = Record<string, InfiniteTableColumnGroup>;
1812
- declare type InfiniteTablePropColumnGroups = InfiniteTablePropColumnGroupsRecord | InfiniteTablePropColumnGroupsMap;
1813
- declare type InfiniteTablePropCollapsedColumnGroups = Map<string[], string>;
1814
- declare type InfiniteTableColumnGroupHeaderRenderParams = {
1815
- columnGroup: InfiniteTableComputedColumnGroup;
1816
- };
1817
- declare type InfiniteTableColumnGroupHeaderRenderFunction = (params: InfiniteTableColumnGroupHeaderRenderParams) => Renderable;
1818
- declare type InfiniteTableColumnGroup = {
1819
- columnGroup?: string;
1820
- header?: Renderable | InfiniteTableColumnGroupHeaderRenderFunction;
1821
- };
1822
- declare type InfiniteTableComputedColumnGroup = InfiniteTableColumnGroup & {
1823
- id: string;
1824
- groupOffset: number;
1825
- computedWidth: number;
1826
- uniqueGroupId: string[];
1827
- columns: string[];
1828
- depth: number;
1829
- };
1830
- declare type InfiniteTableGroupColumnGetterOptions<T> = {
1831
- groupIndexForColumn?: number;
1832
- groupByForColumn?: DataSourceGroupBy<T>;
1833
- selectionMode: DataSourcePropSelectionMode;
1834
- groupRenderStrategy: InfiniteTablePropGroupRenderStrategy;
1835
- groupCount: number;
1836
- groupBy: DataSourceGroupBy<T>[];
1837
- pivotBy?: DataSourcePivotBy<T>[];
1838
- sortable?: boolean;
1839
- };
1840
- declare type InfiniteTablePivotColumnGetterOptions<T, COL_TYPE = InfiniteTableColumn<T>> = {
1841
- column: COL_TYPE;
1842
- groupBy: DataSourcePropGroupBy<T>;
1843
- pivotBy: DataSourcePropPivotBy<T>;
1844
- };
1845
- declare type InfiniteTablePropGroupRenderStrategy = 'single-column' | 'multi-column' | 'inline';
1846
- declare type InfiniteTableGroupColumnBase<T> = Partial<InfiniteTableColumn<T>> & {
1847
- renderGroupIcon?: InfiniteTableColumnRenderFunctionForGroupRows<T>;
1848
- id?: string;
1849
- };
1850
- declare type InfiniteTablePivotColumnBase<T> = InfiniteTableColumn<T> & {
1851
- renderValue?: InfiniteTableColumnRenderFunction<T, InfiniteTableComputedPivotFinalColumn<T>>;
1852
- };
1853
- declare type InfiniteTablePropGroupColumn<T> = InfiniteTableGroupColumnBase<T> | InfiniteTableGroupColumnFunction<T>;
1854
- declare type InfiniteTableGroupColumnFunction<T> = (options: InfiniteTableGroupColumnGetterOptions<T>, toggleGroupRow: (groupKeys: any[]) => void) => Partial<InfiniteTableGroupColumnBase<T>>;
1855
- declare type InfiniteTablePropPivotColumn<T, COL_TYPE = InfiniteTableColumn<T>> = Partial<InfiniteTablePivotColumnBase<T>> | ((options: InfiniteTablePivotColumnGetterOptions<T, COL_TYPE>) => InfiniteTablePivotColumnBase<T>);
1856
- declare type InfiniteTablePropComponents = {
1857
- LoadMask?: React$1.FC<LoadMaskProps>;
1858
- CheckBox?: React$1.FC<InfiniteCheckBoxProps>;
1859
- };
1860
- declare type ScrollStopInfo = {
1861
- scrollTop: number;
1862
- firstVisibleRowIndex: number;
1863
- lastVisibleRowIndex: number;
1864
- };
1865
- declare type InfiniteTablePropFilterEditors<T> = Record<string, React$1.FC<InfiniteTableFilterEditorProps<T>>>;
1866
- declare type InfiniteTableFilterEditorProps<T extends any> = {
1867
- filterType: string;
1868
- operator: string;
1869
- ariaLabel: string;
1870
- filterValue: T;
1871
- className: string;
1872
- onChange: (value: T | undefined) => void;
1873
- };
1874
- interface InfiniteTableProps<T> {
1875
- columns: InfiniteTablePropColumns<T>;
1876
- pivotColumns?: InfiniteTableColumnsMap<T, InfiniteTablePivotColumn<T>>;
1877
- loadingText?: Renderable;
1878
- components?: InfiniteTablePropComponents;
1879
- viewportReservedWidth?: number;
1880
- onViewportReservedWidthChange?: (viewportReservedWidth: number) => void;
1881
- pivotColumn?: InfiniteTablePropPivotColumn<T, InfiniteTableColumn<T> & InfiniteTablePivotFinalColumn<T>>;
1882
- pivotTotalColumnPosition?: InfiniteTablePropPivotTotalColumnPosition;
1883
- pivotGrandTotalColumnPosition?: InfiniteTablePropPivotGrandTotalColumnPosition;
1884
- groupColumn?: Partial<InfiniteTablePropGroupColumn<T>>;
1885
- groupRenderStrategy?: InfiniteTablePropGroupRenderStrategy;
1886
- hideEmptyGroupColumns?: boolean;
1887
- columnVisibility?: InfiniteTablePropColumnVisibility;
1888
- defaultColumnVisibility?: InfiniteTablePropColumnVisibility;
1889
- pinnedStartMaxWidth?: number;
1890
- pinnedEndMaxWidth?: number;
1891
- columnPinning?: InfiniteTablePropColumnPinning;
1892
- defaultColumnPinning?: InfiniteTablePropColumnPinning;
1893
- columnSizing?: InfiniteTablePropColumnSizing;
1894
- defaultColumnSizing?: InfiniteTablePropColumnSizing;
1895
- onColumnSizingChange?: (columnSizing: InfiniteTablePropColumnSizing) => void;
1896
- pivotColumnGroups?: InfiniteTablePropColumnGroups;
1897
- columnGroups?: InfiniteTablePropColumnGroups;
1898
- defaultColumnGroups?: InfiniteTablePropColumnGroups;
1899
- defaultCollapsedColumnGroups?: InfiniteTablePropCollapsedColumnGroups;
1900
- collapsedColumnGroups?: InfiniteTablePropCollapsedColumnGroups;
1901
- onScrollbarsChange?: (scrollbars: Scrollbars) => void;
1902
- onColumnVisibilityChange?: (columnVisibility: InfiniteTablePropColumnVisibility) => void;
1903
- columnTypes?: InfiniteTablePropColumnTypes<T>;
1904
- showSeparatePivotColumnForSingleAggregation?: boolean;
1905
- rowHeight: number | string;
1906
- rowStyle?: InfiniteTablePropRowStyle<T>;
1907
- rowClassName?: InfiniteTablePropRowClassName<T>;
1908
- columnHeaderHeight: number | string;
1909
- domProps?: React$1.HTMLProps<HTMLDivElement>;
1910
- showZebraRows?: boolean;
1911
- showHoverRows?: boolean;
1912
- sortable?: boolean;
1913
- keyboardNavigation?: InfiniteTablePropKeyboardNavigation;
1914
- keyboardSelection?: InfiniteTablePropKeyboardSelection;
1915
- defaultActiveRowIndex?: number | null;
1916
- activeRowIndex?: number | null;
1917
- onActiveRowIndexChange?: (activeRowIndex: number) => void;
1918
- onActiveCellIndexChange?: (activeCellIndex: [number, number]) => void;
1919
- activeCellIndex?: [number, number] | null;
1920
- defaultActiveCellIndex?: [number, number] | null;
1921
- draggableColumns?: boolean;
1922
- header?: boolean;
1923
- headerOptions?: InfiniteTablePropHeaderOptions;
1924
- focusedClassName?: string;
1925
- focusedWithinClassName?: string;
1926
- focusedStyle?: React$1.CSSProperties;
1927
- focusedWithinStyle?: React$1.CSSProperties;
1928
- columnCssEllipsis?: boolean;
1929
- columnHeaderCssEllipsis?: boolean;
1930
- columnDefaultWidth?: number;
1931
- columnMinWidth?: number;
1932
- columnMaxWidth?: number;
1933
- hideColumnWhenGrouped?: boolean;
1934
- resizableColumns?: boolean;
1935
- virtualizeColumns?: InfiniteTablePropVirtualizeColumns<T>;
1936
- virtualizeRows?: boolean;
1937
- onSelfFocus?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
1938
- onSelfBlur?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
1939
- onFocusWithin?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
1940
- onBlurWithin?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
1941
- onScrollToTop?: () => void;
1942
- onScrollToBottom?: () => void;
1943
- scrollStopDelay?: number;
1944
- onScrollStop?: (param: ScrollStopInfo) => void;
1945
- scrollToBottomOffset?: number;
1946
- defaultColumnOrder?: InfiniteTablePropColumnOrder;
1947
- columnOrder?: InfiniteTablePropColumnOrder;
1948
- onColumnOrderChange?: (columnOrder: InfiniteTablePropColumnOrderNormalized) => void;
1949
- onRowHeightChange?: (rowHeight: number) => void;
1950
- filterEditors?: InfiniteTablePropFilterEditors<T>;
1951
- onReady?: (api: InfiniteTableApi<T>) => void;
1952
- rowProps?: React$1.HTMLProps<HTMLDivElement> | ((rowArgs: InfiniteTableRowStyleFnParams<T>) => React$1.HTMLProps<HTMLDivElement>);
1953
- licenseKey?: string;
1954
- scrollTopKey?: string | number;
1955
- autoSizeColumnsKey?: InfiniteTablePropAutoSizeColumnsKey;
1956
- }
1957
- declare type InfiniteTablePropKeyboardNavigation = 'cell' | 'row' | false;
1958
- declare type InfiniteTablePropKeyboardSelection = boolean;
1959
- declare type InfiniteTablePropHeaderOptions = {
1960
- alwaysReserveSpaceForSortIcon: boolean;
1961
- };
1962
- declare type InfiniteTablePropAutoSizeColumnsKey = string | number | {
1963
- key: string | number;
1964
- columnsToSkip?: string[];
1965
- columnsToResize?: string[];
1966
- includeHeader?: boolean;
1967
- };
1968
- declare type Scrollbars = {
1969
- vertical: boolean;
1970
- horizontal: boolean;
1971
- };
1972
- declare type ScrollAdjustPosition = 'start' | 'end' | 'center';
1973
-
1974
- declare function debounce(fn: Function, { wait }: {
1975
- wait: number;
1976
- }): (...args: any[]) => void;
1977
-
1978
- /**
1979
-
1980
- We have this utility - it's used in Menu Renderable declaration
1981
- because:
1982
-
1983
- type Renderable = React.ReactNode;
1984
-
1985
- const x: Renderable = <div />;
1986
- const y: Renderable = {};
1987
-
1988
- we don't want to allow the above `y` as a valid declaration
1989
-
1990
- it breaks some types in the Menu component as well
1991
-
1992
- */
1993
- declare type RemoveObject<T> = T extends null | undefined ? T : T extends unknown ? keyof T extends never ? never : T : never;
1994
-
1995
- declare type MenuRenderable = string | number | RemoveObject<Renderable>;
1996
- declare type MenuProps = {
1997
- items?: MenuItemDefinition[];
1998
- columns?: MenuColumn[];
1999
- children?: MenuRenderable;
2000
- addSubmenuColumnIfNeeded?: boolean;
2001
- };
2002
- declare type MenuSeparator = '-';
2003
- declare type MenuItemDefinition = MenuItemObject | MenuDecoration | MenuSeparator;
2004
- declare type MenuItemObject = {
2005
- key: string;
2006
- label: NonUndefined<MenuRenderable>;
2007
- span?: number;
2008
- description?: MenuRenderable;
2009
- disabled?: boolean;
2010
- menu?: Omit<MenuProps, 'children' | 'items'> & {
2011
- items: (MenuItemObject | MenuSeparator)[];
2012
- };
2013
- [k: string]: any;
2014
- };
2015
- declare type MenuDecoration = MenuRenderable;
2016
- declare type MenuColumn = {
2017
- flex?: number;
2018
- width?: string | number;
2019
- style?: CSSProperties;
2020
- name: string;
2021
- field?: string;
2022
- render?: (param: MenuColumnRenderParam) => MenuRenderable;
2023
- };
2024
- declare type MenuColumnRenderParam = {
2025
- item: MenuItemObject;
2026
- column: MenuColumn;
2027
- value: MenuRenderable;
2028
- domProps: HTMLProps<HTMLDivElement>;
2029
- };
2030
-
2031
- declare function Menu(props: MenuProps & HTMLProps<HTMLDivElement>): JSX.Element;
2032
- declare namespace Menu {
2033
- var defaultProps: MenuProps;
2034
- }
2035
- declare function MenuItem(_props: {
2036
- key: MenuItemObject['key'];
2037
- span?: MenuItemObject['span'];
2038
- label?: MenuItemObject['label'];
2039
- children?: MenuItemObject['description'];
2040
- description?: MenuItemObject['description'];
2041
- __is_menu_item: boolean;
2042
- }): null;
2043
- declare namespace MenuItem {
2044
- var defaultProps: {
2045
- __is_menu_item: boolean;
2046
- };
2047
- }
2048
-
2049
- declare type ForwardPropsToStateFnResult<TYPE_PROPS, TYPE_RESULT> = {
2050
- [propName in keyof TYPE_PROPS & keyof TYPE_RESULT]: 1 | ((value: TYPE_PROPS[propName]) => TYPE_RESULT[propName]);
2051
- };
2052
- declare type ComponentStateRootConfig<T_PROPS, COMPONENT_MAPPED_STATE, COMPONENT_SETUP_STATE = {}, COMPONENT_DERIVED_STATE = {}, T_ACTIONS = {}, T_PARENT_STATE = {}> = {
2053
- debugName?: string;
2054
- initSetupState?: () => COMPONENT_SETUP_STATE;
2055
- forwardProps?: (setupState: COMPONENT_SETUP_STATE) => ForwardPropsToStateFnResult<T_PROPS, COMPONENT_MAPPED_STATE>;
2056
- allowedControlledPropOverrides?: Record<keyof T_PROPS, true>;
2057
- interceptActions?: ComponentInterceptedActions<COMPONENT_MAPPED_STATE & COMPONENT_DERIVED_STATE & COMPONENT_SETUP_STATE>;
2058
- mappedCallbacks?: ComponentMappedCallbacks<COMPONENT_MAPPED_STATE & COMPONENT_DERIVED_STATE & COMPONENT_SETUP_STATE>;
2059
- onPropChange?: (params: {
2060
- name: keyof T_PROPS;
2061
- oldValue: any;
2062
- newValue: any;
2063
- }, props: T_PROPS, actions: ComponentStateActions<COMPONENT_MAPPED_STATE & COMPONENT_DERIVED_STATE & COMPONENT_SETUP_STATE>) => void;
2064
- mapPropsToState?: (params: {
2065
- props: T_PROPS;
2066
- state: COMPONENT_MAPPED_STATE & COMPONENT_SETUP_STATE & Partial<COMPONENT_DERIVED_STATE>;
2067
- oldState: null | (COMPONENT_MAPPED_STATE & COMPONENT_SETUP_STATE & Partial<COMPONENT_DERIVED_STATE>);
2068
- parentState: T_PARENT_STATE | null;
2069
- }) => COMPONENT_DERIVED_STATE;
2070
- concludeReducer?: (params: {
2071
- previousState: COMPONENT_MAPPED_STATE & COMPONENT_SETUP_STATE & COMPONENT_DERIVED_STATE;
2072
- state: COMPONENT_MAPPED_STATE & COMPONENT_SETUP_STATE & COMPONENT_DERIVED_STATE;
2073
- updatedProps: Partial<T_PROPS> | null;
2074
- parentState: T_PARENT_STATE | null;
2075
- }) => COMPONENT_MAPPED_STATE & COMPONENT_SETUP_STATE & COMPONENT_DERIVED_STATE;
2076
- getReducerActions?: (dispatch: React$1.Dispatch<any>) => T_ACTIONS;
2077
- getParentState?: () => T_PARENT_STATE;
2078
- cleanup?: (state: COMPONENT_MAPPED_STATE & COMPONENT_SETUP_STATE & COMPONENT_DERIVED_STATE) => void;
2079
- onControlledPropertyChange?: (name: string, newValue: any, oldValue: any) => void | ((value: any, oldValue: any) => any);
2080
- };
2081
- declare function getComponentStateRoot<T_PROPS, COMPONENT_MAPPED_STATE extends object, COMPONENT_SETUP_STATE extends object = {}, COMPONENT_DERIVED_STATE extends object = {}, T_ACTIONS = {}, T_PARENT_STATE = {}>(config: ComponentStateRootConfig<T_PROPS, COMPONENT_MAPPED_STATE, COMPONENT_SETUP_STATE, COMPONENT_DERIVED_STATE, T_ACTIONS, T_PARENT_STATE>): React$1.NamedExoticComponent<T_PROPS & {
2082
- children: React$1.ReactNode;
2083
- }>;
2084
- declare function useComponentState<COMPONENT_STATE>(): ComponentStateContext<COMPONENT_STATE, ComponentStateGeneratedActions<COMPONENT_STATE>>;
2085
-
2086
- declare type InterceptedMapFns<K, V> = {
2087
- set?: (k: K, v: V) => void;
2088
- beforeClear?: (map: Map<K, V>) => void;
2089
- clear?: () => void;
2090
- delete?: (k: K) => void;
2091
- };
2092
- /**
2093
- *
2094
- * @param map Map to intercept
2095
- * @param fns fns to inject
2096
- * @returns a function to restore the map to initial methods
2097
- */
2098
- declare function interceptMap<K, V>(map: Map<K, V>, fns: InterceptedMapFns<K, V>): () => void;
2099
-
2100
- declare function useEffectWithChanges<T>(fn: (changes: Record<keyof T, any>, prevValues: Record<string, any>) => void | (() => void), deps: Record<keyof T, any>): void;
2101
-
2102
- declare const defaultFilterEditors: InfiniteTablePropFilterEditors<unknown>;
2103
- declare function StringFilterEditor<T>(props: InfiniteTableFilterEditorProps<T>): JSX.Element;
2104
- declare function NumberFilterEditor<T>(props: InfiniteTableFilterEditorProps<T>): JSX.Element;
2105
-
2106
- declare const components: {
2107
- CheckBox: typeof InfiniteCheckBox;
2108
- LoadMask: (props: LoadMaskProps) => JSX.Element;
2109
- };
2110
-
2111
- export { ColumnTypeWithInherit, DataSource, DataSourceAction, DataSourceActionType, DataSourceAggregationReducer, DataSourceComponentActions, DataSourceContextValue, DataSourceData, DataSourceDataParams, DataSourceDataParamsChanges, DataSourceDerivedState, DataSourceFilterFunctionParam, DataSourceFilterOperator, DataSourceFilterOperatorFunction, DataSourceFilterOperatorFunctionParam, DataSourceFilterType, DataSourceFilterValueItem, DataSourceFilterValueItemValueGetter, DataSourceGroupBy, DataSourceGroupRowsList, DataSourceLivePaginationCursorFn, DataSourceLivePaginationCursorParams, DataSourceLivePaginationCursorValue, DataSourceMappedState, DataSourceMappings, DataSourcePivotBy, DataSourcePropAggregationReducers, DataSourcePropCellSelection, DataSourcePropFilterFunction, DataSourcePropFilterTypes, DataSourcePropFilterValue, DataSourcePropGroupBy, DataSourcePropGroupRowsStateObject, DataSourcePropIsRowSelected, DataSourcePropLivePaginationCursor, DataSourcePropMultiRowSelectionChangeParamType, DataSourcePropOnCellSelectionChange, DataSourcePropOnRowSelectionChange, DataSourcePropOnRowSelectionChange_MultiRow, DataSourcePropOnRowSelectionChange_SingleRow, DataSourcePropPivotBy, DataSourcePropRowSelection, DataSourcePropRowSelection_MultiRow, DataSourcePropRowSelection_SingleRow, DataSourcePropSelectionMode, DataSourcePropSortInfo, DataSourcePropSortTypes, DataSourceProps, DataSourceReducer, DataSourceRemoteData, DataSourceSetupState, DataSourceSingleSortInfo, DataSourceSortInfo, DataSourceState, GroupRowsState, InfiniteTable, InfiniteTableAction, InfiniteTableActionType, InfiniteTableApi, InfiniteTableClassName, InfiniteTableColumn, InfiniteTableColumnAggregator, InfiniteTableColumnComparer, InfiniteTableColumnGroup, InfiniteTableColumnRenderFunctionForGroupRows, InfiniteTableColumnRenderFunctionForNormalRows, InfiniteTableColumnRenderParam, InfiniteTableColumnRenderValueParam, InfiniteTableColumnRowspanParam, InfiniteTableColumnSizingOptions, InfiniteTableColumnsMap, InfiniteTableComponent, InfiniteTableComputedColumn, InfiniteTableComputedValues, InfiniteTableContextValue, InfiniteTableFilterEditorProps, InfiniteTableGroupColumnBase, InfiniteTableGroupColumnFunction, InfiniteTableGroupColumnGetterOptions, InfiniteTablePivotColumn, InfiniteTablePropAutoSizeColumnsKey, InfiniteTablePropColumnGroups, InfiniteTablePropColumnOrder, InfiniteTablePropColumnPinning, InfiniteTablePropColumnSizing, InfiniteTablePropColumnTypes, InfiniteTablePropColumnVisibility, InfiniteTablePropColumns, InfiniteTablePropComponents, InfiniteTablePropFilterEditors, InfiniteTablePropGroupColumn, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropHeaderOptions, InfiniteTablePropKeyboardNavigation, InfiniteTablePropRowClassName, InfiniteTablePropRowStyle, InfiniteTableProps, InfiniteTableRowClassNameFn, InfiniteTableRowInfo, InfiniteTableRowStyleFn, InfiniteTableState, LazyGroupDataDeepMap, LazyGroupDataItem, LazyRowInfoGroup, Menu, MenuItem, MenuItemDefinition, MenuItemObject, MenuProps, NumberFilterEditor, RowSelectionState, Scrollbars, StringFilterEditor, components, debounce, defaultFilterEditors, defaultFilterTypes, defaultFilterTypes as filterTypes, flatten, getComponentStateRoot, group, interceptMap, multisort, useComponentState, useDataSource, useEffectWithChanges, useInfiniteColumnCell, useInfiniteHeaderCell };