@infinite-table/infinite-react 0.5.1 → 0.5.3

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/README.md +104 -0
  2. package/index.css +896 -0
  3. package/index.d.ts +2264 -0
  4. package/index.esm.css +896 -0
  5. package/index.esm.js +15404 -0
  6. package/index.js +15240 -0
  7. package/package.json +3 -95
  8. package/.vscode/settings.json +0 -3
  9. package/API.md +0 -0
  10. package/build/buildPackageJson.js +0 -43
  11. package/build/scripts/test.js +0 -37
  12. package/bundler.config.js +0 -25
  13. package/globals.d.ts +0 -7
  14. package/rollup.config.js +0 -15
  15. package/run-build-deepmap.js +0 -47
  16. package/run-build.js +0 -45
  17. package/run-dts-concat.js +0 -21
  18. package/src/components/CSSVariableWatch.tsx +0 -82
  19. package/src/components/DataSource/BooleanCollectionState.ts +0 -214
  20. package/src/components/DataSource/BooleanDeepCollectionState.ts +0 -208
  21. package/src/components/DataSource/DataSourceContext.ts +0 -20
  22. package/src/components/DataSource/GroupRowsState.ts +0 -74
  23. package/src/components/DataSource/Indexer.ts +0 -27
  24. package/src/components/DataSource/RowSelectionState.ts +0 -763
  25. package/src/components/DataSource/defaultFilterTypes.ts +0 -64
  26. package/src/components/DataSource/index.tsx +0 -108
  27. package/src/components/DataSource/privateHooks/getChangeDetect.ts +0 -7
  28. package/src/components/DataSource/privateHooks/useLoadData.ts +0 -783
  29. package/src/components/DataSource/publicHooks/useDataSource.ts +0 -19
  30. package/src/components/DataSource/publicHooks/useDataSourceActions.ts +0 -14
  31. package/src/components/DataSource/state/getInitialState.ts +0 -494
  32. package/src/components/DataSource/state/normalizeSortInfo.ts +0 -35
  33. package/src/components/DataSource/state/reducer.ts +0 -466
  34. package/src/components/DataSource/state/rowInfoStatus.ts +0 -27
  35. package/src/components/DataSource/types.ts +0 -548
  36. package/src/components/HeadlessTable/HeadlessTableWithPinnedContainers.tsx +0 -142
  37. package/src/components/HeadlessTable/MappedCells.ts +0 -251
  38. package/src/components/HeadlessTable/RawTable.tsx +0 -98
  39. package/src/components/HeadlessTable/ReactHeadlessTableRenderer.tsx +0 -1516
  40. package/src/components/HeadlessTable/index.tsx +0 -234
  41. package/src/components/InfiniteTable/InfiniteCls.css.ts +0 -164
  42. package/src/components/InfiniteTable/InfiniteTableContext.ts +0 -16
  43. package/src/components/InfiniteTable/api/getImperativeApi.ts +0 -391
  44. package/src/components/InfiniteTable/api/getSelectionApi.ts +0 -364
  45. package/src/components/InfiniteTable/api/type.ts +0 -11
  46. package/src/components/InfiniteTable/components/ActiveCellIndicator.css.ts +0 -51
  47. package/src/components/InfiniteTable/components/ActiveCellIndicator.tsx +0 -116
  48. package/src/components/InfiniteTable/components/ActiveRowIndicator.css.ts +0 -56
  49. package/src/components/InfiniteTable/components/ActiveRowIndicator.tsx +0 -94
  50. package/src/components/InfiniteTable/components/CheckBox.css.ts +0 -13
  51. package/src/components/InfiniteTable/components/CheckBox.tsx +0 -96
  52. package/src/components/InfiniteTable/components/FilterEditors.tsx +0 -52
  53. package/src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx +0 -27
  54. package/src/components/InfiniteTable/components/InfiniteTableBody/index.tsx +0 -1
  55. package/src/components/InfiniteTable/components/InfiniteTableFooter/InfiniteTableFooter.tsx +0 -31
  56. package/src/components/InfiniteTable/components/InfiniteTableFooter/index.tsx +0 -1
  57. package/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableColumnHeaderFilter.tsx +0 -102
  58. package/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx +0 -163
  59. package/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx +0 -574
  60. package/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx +0 -79
  61. package/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderTypes.tsx +0 -25
  62. package/src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx +0 -185
  63. package/src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/GroupResizeHandle.tsx +0 -159
  64. package/src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/ResizeHandle.css.ts +0 -124
  65. package/src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/columnResizer.ts +0 -166
  66. package/src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx +0 -146
  67. package/src/components/InfiniteTable/components/InfiniteTableHeader/buildColumnAndGroupTree.ts +0 -240
  68. package/src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts +0 -358
  69. package/src/components/InfiniteTable/components/InfiniteTableHeader/index.tsx +0 -1
  70. package/src/components/InfiniteTable/components/InfiniteTableHeader/useColumnGroupResizeHandle.tsx +0 -114
  71. package/src/components/InfiniteTable/components/InfiniteTableHeader/useColumnResizeHandle.tsx +0 -146
  72. package/src/components/InfiniteTable/components/InfiniteTableLicenseFooter/footer.css.ts +0 -7
  73. package/src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx +0 -110
  74. package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx +0 -120
  75. package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCellTypes.ts +0 -74
  76. package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx +0 -457
  77. package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRow.tsx +0 -107
  78. package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowClassName.ts +0 -6
  79. package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowTypes.ts +0 -32
  80. package/src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowUnvirtualized.tsx +0 -75
  81. package/src/components/InfiniteTable/components/InfiniteTableRow/columnRendering.tsx +0 -263
  82. package/src/components/InfiniteTable/components/InfiniteTableRow/index.tsx +0 -1
  83. package/src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts +0 -74
  84. package/src/components/InfiniteTable/components/InfiniteTableRow/useRowDOMProps.ts +0 -199
  85. package/src/components/InfiniteTable/components/LoadMask.css.ts +0 -34
  86. package/src/components/InfiniteTable/components/LoadMask.tsx +0 -27
  87. package/src/components/InfiniteTable/components/ScrollbarPlaceholder.tsx +0 -56
  88. package/src/components/InfiniteTable/components/cell.css.ts +0 -192
  89. package/src/components/InfiniteTable/components/icons/ArrowDown.tsx +0 -14
  90. package/src/components/InfiniteTable/components/icons/ArrowUp.tsx +0 -14
  91. package/src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts +0 -31
  92. package/src/components/InfiniteTable/components/icons/ExpanderIcon.tsx +0 -63
  93. package/src/components/InfiniteTable/components/icons/Icon.tsx +0 -18
  94. package/src/components/InfiniteTable/components/icons/InfiniteTableIconClassName.ts +0 -1
  95. package/src/components/InfiniteTable/components/icons/LoadingIcon.css.ts +0 -8
  96. package/src/components/InfiniteTable/components/icons/LoadingIcon.tsx +0 -45
  97. package/src/components/InfiniteTable/components/icons/MenuIcon.tsx +0 -50
  98. package/src/components/InfiniteTable/components/icons/SortIcon.tsx +0 -113
  99. package/src/components/InfiniteTable/eventHandlers/eventHandlerTypes.ts +0 -57
  100. package/src/components/InfiniteTable/eventHandlers/index.ts +0 -95
  101. package/src/components/InfiniteTable/eventHandlers/keyboardNavigation.ts +0 -232
  102. package/src/components/InfiniteTable/eventHandlers/keyboardSelection.ts +0 -110
  103. package/src/components/InfiniteTable/eventHandlers/onCellClick.ts +0 -94
  104. package/src/components/InfiniteTable/eventHandlers/onKeyDown.ts +0 -25
  105. package/src/components/InfiniteTable/hooks/adjustColumnOrderForAllColumns.ts +0 -70
  106. package/src/components/InfiniteTable/hooks/reorderColumnsOnDrag.ts +0 -476
  107. package/src/components/InfiniteTable/hooks/useAutoSizeColumns.ts +0 -206
  108. package/src/components/InfiniteTable/hooks/useCellClassName.ts +0 -80
  109. package/src/components/InfiniteTable/hooks/useCellRendering.tsx +0 -217
  110. package/src/components/InfiniteTable/hooks/useColumnGroups.ts +0 -71
  111. package/src/components/InfiniteTable/hooks/useColumnMenu.ts +0 -72
  112. package/src/components/InfiniteTable/hooks/useColumnPointerEvents.ts +0 -258
  113. package/src/components/InfiniteTable/hooks/useColumnRowspan.ts +0 -43
  114. package/src/components/InfiniteTable/hooks/useColumnSizeFn.ts +0 -24
  115. package/src/components/InfiniteTable/hooks/useColumnsWhen.ts +0 -582
  116. package/src/components/InfiniteTable/hooks/useComputed.ts +0 -186
  117. package/src/components/InfiniteTable/hooks/useComputedVisibleColumns.ts +0 -219
  118. package/src/components/InfiniteTable/hooks/useDOMProps.ts +0 -306
  119. package/src/components/InfiniteTable/hooks/useEffectWithRaf.ts +0 -47
  120. package/src/components/InfiniteTable/hooks/useInfiniteTable.ts +0 -10
  121. package/src/components/InfiniteTable/hooks/useInfiniteTableState.ts +0 -11
  122. package/src/components/InfiniteTable/hooks/useInternalProps.ts +0 -8
  123. package/src/components/InfiniteTable/hooks/useLicense/LicenseDetails.ts +0 -13
  124. package/src/components/InfiniteTable/hooks/useLicense/crc32.ts +0 -56
  125. package/src/components/InfiniteTable/hooks/useLicense/decode.ts +0 -147
  126. package/src/components/InfiniteTable/hooks/useLicense/useLicense.ts +0 -39
  127. package/src/components/InfiniteTable/hooks/useRerenderOnKeyChange.ts +0 -21
  128. package/src/components/InfiniteTable/hooks/useRowHover.ts +0 -18
  129. package/src/components/InfiniteTable/hooks/useScrollToActiveCell.ts +0 -48
  130. package/src/components/InfiniteTable/hooks/useScrollToActiveRow.ts +0 -44
  131. package/src/components/InfiniteTable/hooks/useScrollbars.ts +0 -51
  132. package/src/components/InfiniteTable/hooks/useToggleGroupRow.ts +0 -56
  133. package/src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx +0 -165
  134. package/src/components/InfiniteTable/hooks/useYourBrain.ts +0 -55
  135. package/src/components/InfiniteTable/index.tsx +0 -352
  136. package/src/components/InfiniteTable/internalProps.ts +0 -4
  137. package/src/components/InfiniteTable/state/computeColumnGroupsDepths.ts +0 -29
  138. package/src/components/InfiniteTable/state/getColumnVisibilityForHideEmptyGroupColumns.ts +0 -127
  139. package/src/components/InfiniteTable/state/getInitialState.ts +0 -375
  140. package/src/components/InfiniteTable/theme.css.ts +0 -556
  141. package/src/components/InfiniteTable/types/InfiniteTableAction.ts +0 -6
  142. package/src/components/InfiniteTable/types/InfiniteTableActionType.ts +0 -12
  143. package/src/components/InfiniteTable/types/InfiniteTableColumn.ts +0 -478
  144. package/src/components/InfiniteTable/types/InfiniteTableComputedValues.ts +0 -43
  145. package/src/components/InfiniteTable/types/InfiniteTableContextValue.ts +0 -12
  146. package/src/components/InfiniteTable/types/InfiniteTableInternalProps.ts +0 -3
  147. package/src/components/InfiniteTable/types/InfiniteTableProps.ts +0 -511
  148. package/src/components/InfiniteTable/types/InfiniteTableState.ts +0 -195
  149. package/src/components/InfiniteTable/types/Utility.ts +0 -35
  150. package/src/components/InfiniteTable/types/index.ts +0 -96
  151. package/src/components/InfiniteTable/utilities.css.ts +0 -179
  152. package/src/components/InfiniteTable/utils/MultiRowSelector.ts +0 -111
  153. package/src/components/InfiniteTable/utils/RenderHookComponentForInfinite.tsx +0 -52
  154. package/src/components/InfiniteTable/utils/adjustColumnOrderForPinning.ts +0 -33
  155. package/src/components/InfiniteTable/utils/assignFiltered.ts +0 -29
  156. package/src/components/InfiniteTable/utils/defaultGetColumContextMenuItems.tsx +0 -108
  157. package/src/components/InfiniteTable/utils/getColumnComputedType.ts +0 -33
  158. package/src/components/InfiniteTable/utils/getColumnForGroupBy.tsx +0 -313
  159. package/src/components/InfiniteTable/utils/getComputedVisibleColumns.ts +0 -773
  160. package/src/components/InfiniteTable/utils/getContextMenuForColumn.tsx +0 -72
  161. package/src/components/InfiniteTable/utils/infiniteDOMUtils.ts +0 -189
  162. package/src/components/InfiniteTable/utils/mapToObject.ts +0 -20
  163. package/src/components/InfiniteTable/utils/moveXatY.ts +0 -25
  164. package/src/components/InfiniteTable/utils/objectValuesExcept.ts +0 -9
  165. package/src/components/InfiniteTable/utils/progressiveSpeedScroller.ts +0 -158
  166. package/src/components/InfiniteTable/utils/rafFn.ts +0 -13
  167. package/src/components/InfiniteTable/utils/toCSSVarName.ts +0 -1
  168. package/src/components/InfiniteTable/utils/toMap.ts +0 -24
  169. package/src/components/Menu/Menu.tsx +0 -750
  170. package/src/components/Menu/MenuCls.css.ts +0 -139
  171. package/src/components/Menu/MenuContext.ts +0 -10
  172. package/src/components/Menu/MenuContextValue.ts +0 -15
  173. package/src/components/Menu/MenuProps.ts +0 -98
  174. package/src/components/Menu/MenuState.ts +0 -56
  175. package/src/components/Menu/MenuTriangleContext.ts +0 -352
  176. package/src/components/Menu/childrenToRuntimeItems.tsx +0 -103
  177. package/src/components/Menu/getMenuState.tsx +0 -119
  178. package/src/components/Menu/index.tsx +0 -88
  179. package/src/components/Menu/propToIdentifyMenu.ts +0 -1
  180. package/src/components/RawList/AvoidReactDiff.tsx +0 -48
  181. package/src/components/RawList/MappedItems.ts +0 -143
  182. package/src/components/RawList/ReactVirtualRenderer.tsx +0 -307
  183. package/src/components/RawList/index.tsx +0 -42
  184. package/src/components/RawList/types.ts +0 -23
  185. package/src/components/RawList/useVirtualRenderer.ts +0 -36
  186. package/src/components/RenderHookComponent.tsx +0 -10
  187. package/src/components/ResizeObserver/index.tsx +0 -170
  188. package/src/components/VirtualBrain/MatrixBrain.ts +0 -1621
  189. package/src/components/VirtualBrain/ScrollListener.ts +0 -39
  190. package/src/components/VirtualBrain/index.ts +0 -664
  191. package/src/components/VirtualList/ColumnListWithExternalScrolling.tsx +0 -78
  192. package/src/components/VirtualList/InfiniteListRootClassName.ts +0 -1
  193. package/src/components/VirtualList/RowListWithExternalScrolling.tsx +0 -120
  194. package/src/components/VirtualList/SpacePlaceholder.tsx +0 -32
  195. package/src/components/VirtualList/VirtualList.css.ts +0 -29
  196. package/src/components/VirtualList/VirtualList.tsx +0 -141
  197. package/src/components/VirtualList/VirtualRowList.tsx +0 -34
  198. package/src/components/VirtualList/types.ts +0 -56
  199. package/src/components/VirtualList/useCorrectHeightForRowElements.ts +0 -14
  200. package/src/components/VirtualScrollContainer/VirtualScrollContainer.css.ts +0 -51
  201. package/src/components/VirtualScrollContainer/getScrollableClassName.ts +0 -30
  202. package/src/components/VirtualScrollContainer/index.tsx +0 -63
  203. package/src/components/flexbox/index.ts +0 -562
  204. package/src/components/hooks/useComponentState/index.tsx +0 -562
  205. package/src/components/hooks/useComponentState/types.ts +0 -32
  206. package/src/components/hooks/useEffectOnceWithProperUnmount.ts +0 -33
  207. package/src/components/hooks/useEffectWithChanges.ts +0 -56
  208. package/src/components/hooks/useImmutableRef.ts +0 -7
  209. package/src/components/hooks/useInterceptedMap.ts +0 -71
  210. package/src/components/hooks/useLatest.tsx +0 -8
  211. package/src/components/hooks/useLazyLatest.ts +0 -23
  212. package/src/components/hooks/useMemoShallowObjectMerge.ts +0 -16
  213. package/src/components/hooks/useMounted.ts +0 -18
  214. package/src/components/hooks/useOnMount.ts +0 -21
  215. package/src/components/hooks/useOnScroll.ts +0 -34
  216. package/src/components/hooks/useOnce.ts +0 -10
  217. package/src/components/hooks/useOverlay/index.tsx +0 -418
  218. package/src/components/hooks/usePrevious.ts +0 -8
  219. package/src/components/hooks/usePropertyOld.ts +0 -168
  220. package/src/components/hooks/useRerender.ts +0 -12
  221. package/src/components/hooks/xuseProperty.ts +0 -165
  222. package/src/components/types/CellPosition.ts +0 -4
  223. package/src/components/types/NonUndefined.ts +0 -1
  224. package/src/components/types/RemoveObject.ts +0 -22
  225. package/src/components/types/Renderable.ts +0 -3
  226. package/src/components/types/ScrollPosition.ts +0 -7
  227. package/src/components/types/Setter.ts +0 -2
  228. package/src/components/types/Size.ts +0 -6
  229. package/src/components/types/SubscriptionCallback.ts +0 -10
  230. package/src/components/types/VoidFn.ts +0 -1
  231. package/src/components/utils/buildSubscriptionCallback.tsx +0 -60
  232. package/src/components/utils/clamp.ts +0 -3
  233. package/src/components/utils/debounce.ts +0 -16
  234. package/src/components/utils/decamelize.ts +0 -11
  235. package/src/components/utils/discardCallsWithEqualArg.ts +0 -42
  236. package/src/components/utils/getRenderIndexes.ts +0 -33
  237. package/src/components/utils/getScrollbarWidth.ts +0 -31
  238. package/src/components/utils/getVirtualRenderCount.ts +0 -21
  239. package/src/components/utils/isControlled.ts +0 -12
  240. package/src/components/utils/isControlledValue.ts +0 -5
  241. package/src/index.tsx +0 -34
  242. package/src/test.tsx +0 -18
  243. package/src/utils/DeepMap/index.ts +0 -588
  244. package/src/utils/DeepMap/once.ts +0 -16
  245. package/src/utils/DeepMap/sortAscending.ts +0 -1
  246. package/src/utils/DeepMap/tsconfig.deepmap.json +0 -17
  247. package/src/utils/DeepMap/xpackage.json +0 -26
  248. package/src/utils/debug.ts +0 -40
  249. package/src/utils/deepClone.ts +0 -38
  250. package/src/utils/getGlobal.ts +0 -3
  251. package/src/utils/groupAndPivot/defaultToKey.ts +0 -3
  252. package/src/utils/groupAndPivot/getGroupKeysForDataItem.ts +0 -19
  253. package/src/utils/groupAndPivot/getPivotColumnsAndColumnGroups.ts +0 -361
  254. package/src/utils/groupAndPivot/index.ts +0 -1229
  255. package/src/utils/groupAndPivot/types.ts +0 -10
  256. package/src/utils/join.ts +0 -4
  257. package/src/utils/mathIntersection.ts +0 -21
  258. package/src/utils/minified.d.ts +0 -2
  259. package/src/utils/minified.js +0 -6
  260. package/src/utils/multisort/index.ts +0 -151
  261. package/src/utils/multisort/sortTypes.ts +0 -25
  262. package/src/utils/notes-status.md +0 -92
  263. package/src/utils/pageGeometry/ConvexPoly.ts +0 -34
  264. package/src/utils/pageGeometry/Point.ts +0 -51
  265. package/src/utils/pageGeometry/PolyWithPoints.ts +0 -52
  266. package/src/utils/pageGeometry/Rectangle.ts +0 -98
  267. package/src/utils/pageGeometry/Triangle.ts +0 -16
  268. package/src/utils/pageGeometry/alignment/index.ts +0 -221
  269. package/src/utils/pageGeometry/polyContainsPoint.ts +0 -182
  270. package/src/utils/pageGeometry/types.ts +0 -3
  271. package/src/utils/proxyFnCall.ts +0 -46
  272. package/src/utils/raf.ts +0 -13
  273. package/src/utils/selectParent.ts +0 -18
  274. package/src/utils/shallowEqualObjects.ts +0 -49
  275. package/src/utils/stripVar.ts +0 -3
  276. package/src/utils/toUpperFirst.ts +0 -5
  277. package/todo.md +0 -2
  278. package/tsconfig.build.json +0 -8
  279. package/tsconfig.dev.json +0 -7
  280. package/tsconfig.json +0 -30
  281. package/tsconfig.typebundler.json +0 -13
  282. package/typedoc.json +0 -4
@@ -1,192 +0,0 @@
1
- import { style, styleVariants } from '@vanilla-extract/css';
2
- import { recipe, RecipeVariants } from '@vanilla-extract/recipes';
3
- import { InfiniteClsShiftingColumns } from '../InfiniteCls.css';
4
-
5
- import { ThemeVars } from '../theme.css';
6
- import {
7
- alignItems,
8
- display,
9
- flexFlow,
10
- position,
11
- userSelect,
12
- whiteSpace,
13
- willChange,
14
- } from '../utilities.css';
15
-
16
- export const columnAlignCellStyle = styleVariants({
17
- center: { justifyContent: 'center' },
18
- start: { justifyContent: 'flex-start' },
19
- end: { justifyContent: 'flex-start', flexFlow: 'row-reverse' },
20
- });
21
-
22
- export const CellBorderObject = {
23
- borderLeft: `${ThemeVars.components.Cell.borderWidth} solid transparent`,
24
- borderRight: `${ThemeVars.components.Cell.borderWidth} solid transparent`,
25
- };
26
-
27
- export const CellClsVariants = styleVariants({
28
- shifting: {
29
- transition: 'left 300ms',
30
- },
31
- dragging: {
32
- transition: 'none',
33
- },
34
- });
35
-
36
- export const CellCls = style([
37
- display.flex,
38
- flexFlow.row,
39
- alignItems.center,
40
- position.absolute,
41
- willChange.transform,
42
- whiteSpace.nowrap,
43
- userSelect.none,
44
- {
45
- padding: ThemeVars.components.Cell.padding,
46
- ...CellBorderObject,
47
- },
48
- ]);
49
-
50
- export const ColumnCellCls = style([
51
- CellCls,
52
- {
53
- selectors: {
54
- [`${InfiniteClsShiftingColumns} &`]: {
55
- // color: 'red',
56
- transition: `transform ${ThemeVars.components.Cell.reorderEffectDuration}`,
57
- },
58
- },
59
- },
60
- ]);
61
-
62
- export const ColumnCellVariantsObject = {
63
- first: {
64
- borderTopLeftRadius: ThemeVars.components.Cell.borderRadius,
65
- borderBottomLeftRadius: ThemeVars.components.Cell.borderRadius,
66
- },
67
- last: {
68
- borderTopRightRadius: ThemeVars.components.Cell.borderRadius,
69
- borderBottomRightRadius: ThemeVars.components.Cell.borderRadius,
70
- },
71
- groupByField: {},
72
- firstInCategory: {},
73
- lastInCategory: {},
74
- pinnedStart: {},
75
- pinnedEnd: {},
76
- unpinned: {},
77
- pinnedStartLastInCategory: {},
78
- pinnedStartFirstInCategory: {},
79
- pinnedEndFirstInCategory: {},
80
- pinnedEndLastInCategory: {},
81
- };
82
-
83
- export const SelectionCheckboxCls = style({
84
- marginInline: ThemeVars.components.SelectionCheckBox.marginInline,
85
- });
86
-
87
- export const ColumnCellRecipe = recipe({
88
- base: [
89
- {
90
- color: ThemeVars.components.Cell.color,
91
- },
92
- ],
93
- variants: {
94
- dragging: { false: {}, true: {} },
95
- rowActive: {
96
- false: {},
97
- true: {},
98
- },
99
- zebra: {
100
- false: {},
101
- even: {
102
- background: ThemeVars.components.Row.background,
103
- },
104
- odd: {
105
- background: ThemeVars.components.Row.oddBackground,
106
- },
107
- },
108
- rowSelected: {
109
- true: {
110
- background: ThemeVars.components.Row.selectedBackground,
111
- },
112
- false: {},
113
- null: {},
114
- },
115
- first: {
116
- true: {
117
- borderTopLeftRadius: ThemeVars.components.Cell.borderRadius,
118
- borderBottomLeftRadius: ThemeVars.components.Cell.borderRadius,
119
- },
120
- false: {},
121
- },
122
- last: {
123
- true: {
124
- borderTopRightRadius: ThemeVars.components.Cell.borderRadius,
125
- borderBottomRightRadius: ThemeVars.components.Cell.borderRadius,
126
- },
127
- false: {},
128
- },
129
- groupByField: {
130
- true: ColumnCellVariantsObject.groupByField,
131
- false: {},
132
- },
133
- firstInCategory: {
134
- true: ColumnCellVariantsObject.firstInCategory,
135
- false: {},
136
- },
137
- lastInCategory: {
138
- true: ColumnCellVariantsObject.lastInCategory,
139
- false: {},
140
- },
141
- pinned: {
142
- start: {
143
- // vars: {
144
- // [ThemeVars.components.Cell.reorderEffectDuration]: '0',
145
- // },
146
- },
147
- end: {
148
- // vars: {
149
- // [ThemeVars.components.Cell.reorderEffectDuration]: '0',
150
- // },
151
- },
152
- false: {},
153
- },
154
- filtered: {
155
- true: {},
156
- false: {},
157
- },
158
- },
159
-
160
- compoundVariants: [
161
- {
162
- variants: {
163
- pinned: 'start',
164
- lastInCategory: true,
165
- },
166
- style: ColumnCellVariantsObject.pinnedStartLastInCategory,
167
- },
168
- {
169
- variants: {
170
- pinned: 'start',
171
- firstInCategory: true,
172
- },
173
- style: ColumnCellVariantsObject.pinnedStartFirstInCategory,
174
- },
175
- {
176
- variants: {
177
- pinned: 'end',
178
- firstInCategory: true,
179
- },
180
- style: ColumnCellVariantsObject.pinnedEndFirstInCategory,
181
- },
182
- {
183
- variants: {
184
- pinned: 'end',
185
- lastInCategory: true,
186
- },
187
- style: ColumnCellVariantsObject.pinnedEndLastInCategory,
188
- },
189
- ],
190
- });
191
-
192
- export type ColumnCellVariantsType = RecipeVariants<typeof ColumnCellRecipe>;
@@ -1,14 +0,0 @@
1
- import * as React from 'react';
2
-
3
- import { TableIconProps, Icon } from './Icon';
4
-
5
- export const ArrowDown = (props: Omit<TableIconProps, 'children'>) => {
6
- return (
7
- <Icon {...props}>
8
- <path
9
- fill="currentColor"
10
- d="M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z"
11
- />
12
- </Icon>
13
- );
14
- };
@@ -1,14 +0,0 @@
1
- import * as React from 'react';
2
-
3
- import { TableIconProps, Icon } from './Icon';
4
-
5
- export const ArrowUp = (props: Omit<TableIconProps, 'children'>) => {
6
- return (
7
- <Icon {...props}>
8
- <path
9
- fill="currentColor"
10
- d="M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z"
11
- />
12
- </Icon>
13
- );
14
- };
@@ -1,31 +0,0 @@
1
- import { style } from '@vanilla-extract/css';
2
- import { recipe } from '@vanilla-extract/recipes';
3
- import { cursor, fill, flex, transform } from '../../utilities.css';
4
-
5
- export const ExpanderIconCls = style([
6
- fill.accentColor,
7
- flex.none,
8
- cursor.pointer,
9
- ]);
10
-
11
- export const ExpanderIconClsVariants = recipe({
12
- variants: {
13
- expanded: {
14
- true: transform.rotate90,
15
- false: {},
16
- },
17
- direction: {
18
- end: {},
19
- start: {},
20
- },
21
- },
22
- compoundVariants: [
23
- {
24
- variants: {
25
- expanded: false,
26
- direction: 'end',
27
- },
28
- style: transform.rotate180,
29
- },
30
- ],
31
- });
@@ -1,63 +0,0 @@
1
- import * as React from 'react';
2
- import { useState } from 'react';
3
-
4
- import { join } from '../../../../utils/join';
5
- import { isControlled } from '../../../utils/isControlled';
6
- import { ExpanderIconCls, ExpanderIconClsVariants } from './ExpanderIcon.css';
7
- import { InfiniteTableIconClassName } from './InfiniteTableIconClassName';
8
-
9
- type ExpanderIconProps = {
10
- size?: number;
11
- expanded?: boolean;
12
- defaultExpanded?: boolean;
13
- onChange?: (expanded: boolean) => void;
14
- style?: React.CSSProperties;
15
- className?: string;
16
- direction?: 'end' | 'start';
17
- };
18
-
19
- export function ExpanderIcon(props: ExpanderIconProps) {
20
- const { size = 24, direction = 'start' } = props;
21
-
22
- const [expanded, setExpanded] = useState(
23
- props.expanded ?? props.defaultExpanded,
24
- );
25
-
26
- const onClick = () => {
27
- props.onChange?.(!expanded);
28
- if (!isControlled('expanded', props)) {
29
- setExpanded(!expanded);
30
- }
31
- };
32
-
33
- React.useEffect(() => {
34
- if (isControlled('expanded', props)) {
35
- setExpanded(props.expanded);
36
- }
37
- }, [props.expanded]);
38
- return (
39
- <svg
40
- data-name="expander-icon"
41
- xmlns="http://www.w3.org/2000/svg"
42
- height={`${size}px`}
43
- viewBox="0 0 24 24"
44
- width={`${size}px`}
45
- style={props.style}
46
- onClick={onClick}
47
- className={join(
48
- props.className,
49
- ExpanderIconCls,
50
- ExpanderIconClsVariants({
51
- direction: direction || 'start',
52
- expanded,
53
- }),
54
- `${InfiniteTableIconClassName}`,
55
- `${InfiniteTableIconClassName}-expander`,
56
- `InfiniteIcon-expander--${expanded ? 'expanded' : 'collapsed'}`,
57
- `InfiniteIcon-expander--${direction === 'end' ? 'end' : 'start'}`,
58
- )}
59
- >
60
- <path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" />
61
- </svg>
62
- );
63
- }
@@ -1,18 +0,0 @@
1
- import * as React from 'react';
2
- export type TableIconProps = {
3
- children: React.ReactNode;
4
- size?: number;
5
- style?: React.CSSProperties;
6
- className?: string;
7
- };
8
-
9
- export const Icon = (props: TableIconProps) => {
10
- const size = props.size ?? `var(--ITableHeaderCell-icon-size)`;
11
- const style = { flex: 'none', width: size, height: size, ...props.style };
12
- return (
13
- //@ts-ignore
14
- <svg viewBox="0 0 24 24" {...props} style={style}>
15
- {props.children}
16
- </svg>
17
- );
18
- };
@@ -1 +0,0 @@
1
- export const InfiniteTableIconClassName = 'InfiniteTableIcon';
@@ -1,8 +0,0 @@
1
- import { style } from '@vanilla-extract/css';
2
- import { cursor, stroke, flex } from '../../utilities.css';
3
-
4
- export const LoadingIconCls = style([
5
- stroke.accentColor,
6
- flex.none,
7
- cursor.pointer,
8
- ]);
@@ -1,45 +0,0 @@
1
- import { TableIconProps } from './Icon';
2
- import * as React from 'react';
3
- import { join } from '../../../../utils/join';
4
- import { LoadingIconCls } from './LoadingIcon.css';
5
-
6
- export const LoadingIcon = (props: Omit<TableIconProps, 'children'>) => {
7
- return (
8
- <svg
9
- xmlns="http://www.w3.org/2000/svg"
10
- style={{
11
- margin: 'auto',
12
- display: 'block',
13
- shapeRendering: 'auto',
14
- }}
15
- width="24px"
16
- height="24px"
17
- viewBox="0 0 100 100"
18
- preserveAspectRatio="xMidYMid"
19
- className={join(
20
- props.className,
21
- LoadingIconCls,
22
- 'InfiniteIcon',
23
- 'InfiniteIcon-loading',
24
- )}
25
- >
26
- <circle
27
- cx="50"
28
- cy="50"
29
- fill="none"
30
- strokeWidth="10"
31
- r="35"
32
- strokeDasharray="164.93361431346415 56.97787143782138"
33
- >
34
- <animateTransform
35
- attributeName="transform"
36
- type="rotate"
37
- repeatCount="indefinite"
38
- dur="1s"
39
- values="0 50 50;360 50 50"
40
- keyTimes="0;1"
41
- />
42
- </circle>
43
- </svg>
44
- );
45
- };
@@ -1,50 +0,0 @@
1
- import * as React from 'react';
2
-
3
- import { join } from '../../../../utils/join';
4
- import { ThemeVars } from '../../theme.css';
5
-
6
- import { HeaderMenuIconCls } from '../InfiniteTableHeader/header.css';
7
- import { InfiniteTableIconClassName } from './InfiniteTableIconClassName';
8
-
9
- type MenuIconProps = {
10
- lineWidth?: number;
11
- lineStyle?: React.CSSProperties;
12
- style?: React.CSSProperties;
13
- className?: string;
14
- domProps?: React.HTMLAttributes<HTMLDivElement>;
15
- };
16
-
17
- const defaultLineStyle: React.CSSProperties = {
18
- width: '100%',
19
- pointerEvents: 'none',
20
- };
21
-
22
- const lineClassName = `${InfiniteTableIconClassName}-menu`;
23
-
24
- export function MenuIcon(props: MenuIconProps) {
25
- const { style, className, domProps } = props;
26
-
27
- const lineStyle = {
28
- ...defaultLineStyle,
29
- borderTop: `${ThemeVars.components.HeaderCell.menuIconLineWidth} solid currentColor`,
30
- ...props.lineStyle,
31
- };
32
-
33
- return (
34
- <div
35
- {...domProps}
36
- style={style}
37
- onPointerDown={(e) => e.stopPropagation()}
38
- className={join(
39
- className,
40
- HeaderMenuIconCls,
41
- InfiniteTableIconClassName,
42
- `${InfiniteTableIconClassName}-menu`,
43
- )}
44
- >
45
- <div className={lineClassName} style={lineStyle}></div>
46
- <div className={lineClassName} style={lineStyle}></div>
47
- <div className={lineClassName} style={lineStyle}></div>
48
- </div>
49
- );
50
- }
@@ -1,113 +0,0 @@
1
- import * as React from 'react';
2
- import { useEffect, useState } from 'react';
3
-
4
- import { join } from '../../../../utils/join';
5
- import { HeaderSortIconIndexCls } from '../InfiniteTableHeader/header.css';
6
- import { InfiniteTableIconClassName } from './InfiniteTableIconClassName';
7
-
8
- type SortIconProps = {
9
- direction: 1 | -1 | 0;
10
- size?: number;
11
- lineWidth?: number;
12
- lineStyle?: React.CSSProperties;
13
- style?: React.CSSProperties;
14
- className?: string;
15
- index?: number;
16
- };
17
-
18
- const defaultLineStyle: React.CSSProperties = {
19
- marginTop: 2,
20
- marginBottom: 2,
21
- transition: `width 0.25s, opacity 0.25s`,
22
- };
23
-
24
- export function SortIcon(props: SortIconProps) {
25
- const [rendered, setRendered] = useState(true);
26
- const [opacity, setOpacity] = useState(0);
27
-
28
- const { direction, lineWidth = 1, style, className, index } = props;
29
-
30
- const showIndex = index != null && index > 0;
31
-
32
- const size = props.size ?? 16;
33
-
34
- const part = Math.floor(size / 4);
35
-
36
- const sizes = direction
37
- ? [size - 3 * part, size - 2 * part, size - part]
38
- : [0, 0, 0];
39
-
40
- if (direction === -1) {
41
- sizes.reverse();
42
- }
43
-
44
- const lineStyle = {
45
- ...defaultLineStyle,
46
- borderTop: `${lineWidth}px solid currentColor`,
47
- ...props.lineStyle,
48
- opacity,
49
- };
50
-
51
- useEffect(() => {
52
- const newOpacity = direction != 0 ? 1 : 0;
53
-
54
- if (!rendered && newOpacity) {
55
- setRendered(true);
56
- }
57
- if (newOpacity !== opacity) {
58
- const rafId = requestAnimationFrame(() => {
59
- setOpacity(newOpacity);
60
- });
61
-
62
- return () => {
63
- cancelAnimationFrame(rafId);
64
- };
65
- }
66
- return () => {};
67
- }, [direction, rendered]);
68
-
69
- const onTransitionEnd = () => {
70
- const hidden = opacity === 0 && direction === 0;
71
- const newRendered = !hidden;
72
- if (newRendered !== rendered) {
73
- setRendered(newRendered);
74
- }
75
- };
76
-
77
- if (!rendered) {
78
- return null;
79
- }
80
-
81
- const indexStyle: React.CSSProperties = {};
82
-
83
- if (direction === -1) {
84
- indexStyle.top = '100%';
85
- }
86
-
87
- return (
88
- <div
89
- style={{ ...style, width: size }}
90
- className={join(
91
- className,
92
- InfiniteTableIconClassName,
93
- `${InfiniteTableIconClassName}-sort`,
94
- )}
95
- >
96
- {showIndex ? (
97
- <div
98
- data-name="index"
99
- style={indexStyle}
100
- className={HeaderSortIconIndexCls}
101
- >
102
- {index}
103
- </div>
104
- ) : null}
105
- <div
106
- style={{ width: sizes[0], ...lineStyle }}
107
- onTransitionEnd={onTransitionEnd}
108
- ></div>
109
- <div style={{ width: sizes[1], ...lineStyle }}></div>
110
- <div style={{ width: sizes[2], ...lineStyle }}></div>
111
- </div>
112
- );
113
- }
@@ -1,57 +0,0 @@
1
- import {
2
- DataSourceState,
3
- DataSourceComponentActions,
4
- RowSelectionState,
5
- } from '../../DataSource';
6
- import { InfiniteTableSelectionApi } from '../api/getSelectionApi';
7
- import {
8
- InfiniteTableApi,
9
- InfiniteTableComputedValues,
10
- InfiniteTableState,
11
- } from '../types';
12
- import { InfiniteTableActions } from '../types/InfiniteTableState';
13
-
14
- export type InfiniteTableEventHandlerAbstractContext<T> = {
15
- getComputed: () => InfiniteTableComputedValues<T>;
16
- getState: () => {
17
- activeRowIndex: InfiniteTableState<T>['activeRowIndex'];
18
- activeCellIndex: InfiniteTableState<T>['activeCellIndex'];
19
- keyboardNavigation: InfiniteTableState<T>['keyboardNavigation'];
20
- keyboardSelection: InfiniteTableState<T>['keyboardSelection'];
21
- };
22
- actions: InfiniteTableActions<T>;
23
- cloneRowSelection: (
24
- rowSelection: RowSelectionState<T>,
25
- ) => RowSelectionState<T>;
26
- getDataSourceState: () => {
27
- rowSelection: DataSourceState<T>['rowSelection'];
28
- groupBy: DataSourceState<T>['groupBy'];
29
- selectionMode: DataSourceState<T>['selectionMode'];
30
- dataArray: { id: string; isGroupRow: boolean; groupKeys?: any[] }[];
31
- };
32
- dataSourceActions: DataSourceComponentActions<T>;
33
- api: {
34
- selectionApi: InfiniteTableSelectionApi;
35
- };
36
- };
37
-
38
- export type InfiniteTableEventHandlerContext<T> = {
39
- getComputed: () => InfiniteTableComputedValues<T>;
40
- getState: () => InfiniteTableState<T>;
41
- actions: InfiniteTableActions<T>;
42
- cloneRowSelection: (
43
- rowSelection: RowSelectionState<T>,
44
- ) => RowSelectionState<T>;
45
- getDataSourceState: () => DataSourceState<T>;
46
- dataSourceActions: DataSourceComponentActions<T>;
47
- api: InfiniteTableApi<T>;
48
- };
49
-
50
- export type InfiniteTableKeyboardEventHandlerContext<T> =
51
- InfiniteTableEventHandlerContext<T>;
52
-
53
- export type InfiniteTableCellClickEventHandlerContext<T> =
54
- InfiniteTableEventHandlerContext<T> & {
55
- rowIndex: number;
56
- colIndex: number;
57
- };