@qoretechnologies/reqore 0.35.1 → 0.35.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 (77) hide show
  1. package/__tests__/helpers/table.test.tsx +20 -0
  2. package/dist/components/Collection/index.d.ts +11 -2
  3. package/dist/components/Collection/index.d.ts.map +1 -1
  4. package/dist/components/Collection/index.js +33 -7
  5. package/dist/components/Collection/index.js.map +1 -1
  6. package/dist/components/ControlGroup/index.d.ts.map +1 -1
  7. package/dist/components/ControlGroup/index.js +1 -1
  8. package/dist/components/ControlGroup/index.js.map +1 -1
  9. package/dist/components/Dropdown/list.d.ts +1 -0
  10. package/dist/components/Dropdown/list.d.ts.map +1 -1
  11. package/dist/components/Dropdown/list.js.map +1 -1
  12. package/dist/components/Menu/divider.d.ts +1 -0
  13. package/dist/components/Menu/divider.d.ts.map +1 -1
  14. package/dist/components/Menu/divider.js +3 -2
  15. package/dist/components/Menu/divider.js.map +1 -1
  16. package/dist/components/Spacer/index.d.ts.map +1 -1
  17. package/dist/components/Spacer/index.js +1 -1
  18. package/dist/components/Spacer/index.js.map +1 -1
  19. package/dist/components/Table/body.d.ts +10 -4
  20. package/dist/components/Table/body.d.ts.map +1 -1
  21. package/dist/components/Table/body.js +44 -9
  22. package/dist/components/Table/body.js.map +1 -1
  23. package/dist/components/Table/cell.d.ts.map +1 -1
  24. package/dist/components/Table/cell.js +2 -2
  25. package/dist/components/Table/cell.js.map +1 -1
  26. package/dist/components/Table/header.d.ts +8 -7
  27. package/dist/components/Table/header.d.ts.map +1 -1
  28. package/dist/components/Table/header.js +34 -37
  29. package/dist/components/Table/header.js.map +1 -1
  30. package/dist/components/Table/headerCell.d.ts +2 -2
  31. package/dist/components/Table/headerCell.d.ts.map +1 -1
  32. package/dist/components/Table/headerCell.js +25 -7
  33. package/dist/components/Table/headerCell.js.map +1 -1
  34. package/dist/components/Table/helpers.d.ts +2 -0
  35. package/dist/components/Table/helpers.d.ts.map +1 -1
  36. package/dist/components/Table/helpers.js +28 -2
  37. package/dist/components/Table/helpers.js.map +1 -1
  38. package/dist/components/Table/index.d.ts +9 -2
  39. package/dist/components/Table/index.d.ts.map +1 -1
  40. package/dist/components/Table/index.js +175 -15
  41. package/dist/components/Table/index.js.map +1 -1
  42. package/dist/components/Table/row.d.ts.map +1 -1
  43. package/dist/components/Table/row.js +17 -28
  44. package/dist/components/Table/row.js.map +1 -1
  45. package/dist/components/Tree/index.d.ts +3 -1
  46. package/dist/components/Tree/index.d.ts.map +1 -1
  47. package/dist/components/Tree/index.js +9 -2
  48. package/dist/components/Tree/index.js.map +1 -1
  49. package/dist/constants/paging.d.ts +1 -0
  50. package/dist/constants/paging.d.ts.map +1 -1
  51. package/dist/constants/paging.js +20 -1
  52. package/dist/constants/paging.js.map +1 -1
  53. package/dist/constants/sizes.d.ts +15 -0
  54. package/dist/constants/sizes.d.ts.map +1 -1
  55. package/dist/constants/sizes.js +16 -1
  56. package/dist/constants/sizes.js.map +1 -1
  57. package/package.json +1 -1
  58. package/src/components/Collection/index.tsx +41 -6
  59. package/src/components/ControlGroup/index.tsx +1 -0
  60. package/src/components/Dropdown/list.tsx +1 -0
  61. package/src/components/Menu/divider.tsx +31 -21
  62. package/src/components/Spacer/index.tsx +2 -2
  63. package/src/components/Table/body.tsx +87 -36
  64. package/src/components/Table/cell.tsx +4 -1
  65. package/src/components/Table/header.tsx +133 -124
  66. package/src/components/Table/headerCell.tsx +34 -8
  67. package/src/components/Table/helpers.ts +42 -2
  68. package/src/components/Table/index.tsx +251 -53
  69. package/src/components/Table/row.tsx +34 -53
  70. package/src/components/Tree/index.tsx +13 -2
  71. package/src/constants/paging.ts +22 -0
  72. package/src/constants/sizes.ts +17 -0
  73. package/src/stories/Breadcrumbs/Breadcrumbs.stories.tsx +0 -3
  74. package/src/stories/Collection/Collection.stories.tsx +16 -0
  75. package/src/stories/Table/Table.stories.tsx +96 -1
  76. package/src/stories/Tree/Tree.stories.tsx +13 -0
  77. package/tests.json +1 -1
@@ -8,6 +8,21 @@ export declare const ReqoreSizes: {
8
8
  HUGE: string;
9
9
  };
10
10
  export declare const SIZES: readonly ["tiny", "small", "normal", "big", "huge"];
11
+ export declare const SIZE_TO_MODIFIER: {
12
+ tiny: number;
13
+ small: number;
14
+ normal: number;
15
+ big: number;
16
+ huge: number;
17
+ };
18
+ export declare const LINE_SIZE_TO_NUMBER: {
19
+ none: number;
20
+ tiny: number;
21
+ small: number;
22
+ normal: number;
23
+ big: number;
24
+ huge: number;
25
+ };
11
26
  export declare const SIZE_TO_NUMBER: {
12
27
  none: number;
13
28
  tiny: number;
@@ -1 +1 @@
1
- {"version":3,"file":"sizes.d.ts","sourceRoot":"","sources":["../../src/constants/sizes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;AAClE,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEnD,eAAO,MAAM,WAAW;;;;;;CAMvB,CAAC;AAEF,eAAO,MAAM,KAAK,qDAAsD,CAAC;AAEzE,eAAO,MAAM,cAAc;;;;;;;CAO1B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;CAM1B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;CAMjC,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;CAMtB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;CAM5B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;CAM3B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;CAM5B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;CAM9B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;CAM5B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;CAM1B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;CAM1B,CAAC;AAEF,eAAO,MAAM,iBAA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CAM5B,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;CAMzB,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;CAOjC,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;;;;CAMzC,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;CAM5B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  exports.__esModule = true;
3
- exports.WEIGHT_TO_NUMBER = exports.ICON_WRAPPER_FROM_HEADER_SIZE = exports.ICON_FROM_HEADER_SIZE = exports.GAP_FROM_SIZE = exports.RADIUS_FROM_SIZE = exports.PADDING_FROM_SIZE = exports.ICON_FROM_SIZE = exports.TEXT_FROM_SIZE = exports.MARGIN_FROM_SIZE = exports.TABS_PADDING_TO_PX = exports.TABLE_SIZE_TO_PX = exports.TABS_SIZE_TO_PX = exports.BADGE_SIZE_TO_PX = exports.SIZE_TO_PX = exports.HEADER_SIZE_TO_NUMBER = exports.NUMBER_TO_SIZE = exports.SIZE_TO_NUMBER = exports.SIZES = exports.ReqoreSizes = void 0;
3
+ exports.WEIGHT_TO_NUMBER = exports.ICON_WRAPPER_FROM_HEADER_SIZE = exports.ICON_FROM_HEADER_SIZE = exports.GAP_FROM_SIZE = exports.RADIUS_FROM_SIZE = exports.PADDING_FROM_SIZE = exports.ICON_FROM_SIZE = exports.TEXT_FROM_SIZE = exports.MARGIN_FROM_SIZE = exports.TABS_PADDING_TO_PX = exports.TABLE_SIZE_TO_PX = exports.TABS_SIZE_TO_PX = exports.BADGE_SIZE_TO_PX = exports.SIZE_TO_PX = exports.HEADER_SIZE_TO_NUMBER = exports.NUMBER_TO_SIZE = exports.SIZE_TO_NUMBER = exports.LINE_SIZE_TO_NUMBER = exports.SIZE_TO_MODIFIER = exports.SIZES = exports.ReqoreSizes = void 0;
4
4
  exports.ReqoreSizes = {
5
5
  TINY: 'tiny',
6
6
  SMALL: 'small',
@@ -9,6 +9,21 @@ exports.ReqoreSizes = {
9
9
  HUGE: 'huge'
10
10
  };
11
11
  exports.SIZES = ['tiny', 'small', 'normal', 'big', 'huge'];
12
+ exports.SIZE_TO_MODIFIER = {
13
+ tiny: 0.6,
14
+ small: 0.8,
15
+ normal: 1,
16
+ big: 1.2,
17
+ huge: 1.4
18
+ };
19
+ exports.LINE_SIZE_TO_NUMBER = {
20
+ none: 0,
21
+ tiny: 1,
22
+ small: 1,
23
+ normal: 1.5,
24
+ big: 2,
25
+ huge: 3
26
+ };
12
27
  exports.SIZE_TO_NUMBER = {
13
28
  none: 0,
14
29
  tiny: 1,
@@ -1 +1 @@
1
- {"version":3,"file":"sizes.js","sourceRoot":"","sources":["../../src/constants/sizes.ts"],"names":[],"mappings":";;;AAGa,QAAA,WAAW,GAAG;IACzB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACb,CAAC;AAEW,QAAA,KAAK,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAU,CAAC;AAE5D,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,GAAG,EAAE,CAAC;IACN,IAAI,EAAE,CAAC;CACR,CAAC;AAEW,QAAA,cAAc,GAAG;IAC5B,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,MAAM;CACV,CAAC;AAEW,QAAA,qBAAqB,GAAG;IACnC,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,GAAG,EAAE,CAAC;IACN,IAAI,EAAE,CAAC;CACR,CAAC;AAEW,QAAA,UAAU,GAAG;IACxB,IAAI,EAAE,EAAE;IACR,KAAK,EAAE,EAA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AqB,GAAG;IACnC,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,CAAC;CACL,CAAC;AAEW,QAAA,6BAA6B,GAAG;IAC3C,IAAI,EAAE,EAAE;IACR,GAAG,EAAE,EAAE;IACP,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,EAAE;CACT,CAAC;AAEW,QAAA,gBAAgB,GAAG;IAC9B,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;IACX,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,GAAG;CACX,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qoretechnologies/reqore",
3
- "version": "0.35.1",
3
+ "version": "0.35.3",
4
4
  "description": "ReQore is a highly theme-able and modular UI library for React",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,7 +14,7 @@ import ReqoreInput, { IReqoreInputProps } from '../Input';
14
14
  import ReqoreMessage from '../Message';
15
15
  import { IReqorePanelAction, IReqorePanelProps, ReqorePanel, TReqorePanelActions } from '../Panel';
16
16
  import { ReqoreVerticalSpacer } from '../Spacer';
17
- import { sortTableData } from '../Table/helpers';
17
+ import { getZoomActions, sizeToZoom, sortTableData, zoomToSize } from '../Table/helpers';
18
18
  import { IReqoreCollectionItemProps, ReqoreCollectionItem } from './item';
19
19
 
20
20
  export interface IReqoreCollectionProps extends IReqorePanelProps, IReqoreColumnsProps {
@@ -29,9 +29,14 @@ export interface IReqoreCollectionProps extends IReqorePanelProps, IReqoreColumn
29
29
  height?: string;
30
30
  fill?: boolean;
31
31
  maxItemHeight?: number;
32
- filterable?: boolean;
32
+
33
33
  defaultQuery?: string;
34
+ defaultZoom?: 0 | 0.5 | 1 | 1.5 | 2;
35
+
36
+ filterable?: boolean;
34
37
  sortable?: boolean;
38
+ zoomable?: boolean;
39
+
35
40
  showAs?: 'list' | 'grid';
36
41
  showSelectedFirst?: boolean;
37
42
  selectedIcon?: IReqoreIconName;
@@ -67,6 +72,14 @@ export const StyledCollectionWrapper = styled(StyledColumns)`
67
72
  position: relative;
68
73
  `;
69
74
 
75
+ export const zoomToWidth = {
76
+ 0: '200px',
77
+ 0.5: '300px',
78
+ 1: '400px',
79
+ 1.5: '500px',
80
+ 2: '600px',
81
+ };
82
+
70
83
  export const ReqoreCollection = ({
71
84
  items,
72
85
  stacked,
@@ -76,6 +89,8 @@ export const ReqoreCollection = ({
76
89
  filterable,
77
90
  inputInTitle = true,
78
91
  sortable,
92
+ zoomable,
93
+ defaultZoom,
79
94
  showSelectedFirst,
80
95
  inputProps,
81
96
  sortButtonProps,
@@ -116,6 +131,7 @@ export const ReqoreCollection = ({
116
131
  const [sort, setSort] = useState<'asc' | 'desc'>('asc');
117
132
  const [contentRef, setContentRef] = useState<HTMLDivElement>(undefined);
118
133
  const isMobile = useReqoreProperty('isMobile');
134
+ const [zoom, setZoom] = useState<number>(defaultZoom || sizeToZoom.normal);
119
135
  const { query, setQuery, preQuery, setPreQuery } = useQueryWithDelay(
120
136
  defaultQuery,
121
137
  searchDelay,
@@ -197,6 +213,13 @@ export const ReqoreCollection = ({
197
213
  ],
198
214
  };
199
215
 
216
+ if (zoomable) {
217
+ actions.push({
218
+ fluid: false,
219
+ group: getZoomActions('reqore-collection', zoom, setZoom),
220
+ });
221
+ }
222
+
200
223
  if (sortable) {
201
224
  toolbarGroup.group.push({
202
225
  icon: sort === 'desc' ? 'SortDesc' : 'SortAsc',
@@ -233,7 +256,19 @@ export const ReqoreCollection = ({
233
256
  }
234
257
 
235
258
  return [...actions, toolbarGroup];
236
- }, [filterable, preQuery, query, rest.actions, _showAs, sort, sortable, filteredItems, isMobile]);
259
+ }, [
260
+ filterable,
261
+ preQuery,
262
+ query,
263
+ rest.actions,
264
+ _showAs,
265
+ sort,
266
+ sortable,
267
+ filteredItems,
268
+ isMobile,
269
+ zoom,
270
+ zoomable,
271
+ ]);
237
272
 
238
273
  const renderContent = useCallback(() => {
239
274
  return contentRenderer(
@@ -261,13 +296,13 @@ export const ReqoreCollection = ({
261
296
  ref={setContentRef}
262
297
  height={height}
263
298
  alignItems={alignItems}
264
- minColumnWidth={minColumnWidth}
299
+ minColumnWidth={minColumnWidth || zoomToWidth[zoom]}
265
300
  maxColumnWidth={maxColumnWidth}
266
301
  className='reqore-collection-content'
267
302
  >
268
303
  {finalItems?.map((item, index) => (
269
304
  <ReqoreCollectionItem
270
- size={rest.size}
305
+ size={zoomToSize[zoom]}
271
306
  responsiveTitle={false}
272
307
  {...item}
273
308
  icon={item.icon || (item.selected ? selectedIcon : undefined)}
@@ -313,8 +348,8 @@ export const ReqoreCollection = ({
313
348
  rest,
314
349
  rounded,
315
350
  selectedIcon,
316
- size,
317
351
  stacked,
352
+ zoom,
318
353
  ]);
319
354
 
320
355
  return (
@@ -469,6 +469,7 @@ const ReqoreControlGroup = memo(
469
469
  </ReqoreDrawer>
470
470
  ) : null}
471
471
  <StyledReqoreControlGroup
472
+ as='div'
472
473
  {...rest}
473
474
  vertical={vertical}
474
475
  style={{
@@ -17,6 +17,7 @@ export interface IReqoreDropdownItem
17
17
  onClick?: TDropdownItemOnClick;
18
18
  divider?: boolean;
19
19
  dividerAlign?: 'left' | 'center' | 'right';
20
+ line?: boolean;
20
21
  }
21
22
 
22
23
  export type TReqoreDropdownItem = IReqoreDropdownItem;
@@ -5,6 +5,7 @@ import { getReadableColor } from '../../helpers/colors';
5
5
  import { getOneLessSize, isStringSize } from '../../helpers/utils';
6
6
  import { IWithReqoreEffect, IWithReqoreSize } from '../../types/global';
7
7
  import { IReqoreEffect, StyledTextEffect } from '../Effect';
8
+ import { ReqoreVerticalSpacer } from '../Spacer';
8
9
 
9
10
  export interface IReqoreMenuDividerProps
10
11
  extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>,
@@ -13,6 +14,7 @@ export interface IReqoreMenuDividerProps
13
14
  label?: string | number;
14
15
  margin?: 'left' | 'right' | 'both' | 'none';
15
16
  align?: 'left' | 'center' | 'right';
17
+ line?: boolean;
16
18
  }
17
19
 
18
20
  export const StyledMenuDivider = styled(StyledTextEffect)`
@@ -46,30 +48,38 @@ const ReqoreMenuDivider = forwardRef<HTMLDivElement, IReqoreMenuDividerProps>(
46
48
  effect,
47
49
  size = 'normal',
48
50
  align = 'center',
51
+ line,
49
52
  ...rest
50
53
  }: IReqoreMenuDividerProps,
51
54
  ref: any
52
- ) => (
53
- <StyledMenuDivider
54
- as='div'
55
- {...rest}
56
- size={size}
57
- className={`${className || ''} reqore-menu-divider`}
58
- ref={ref}
59
- effect={
60
- {
61
- uppercase: true,
62
- spaced: 2,
63
- textAlign: align,
64
- textSize: getOneLessSize(size),
65
- weight: 'bold',
66
- ...effect,
67
- } as IReqoreEffect
68
- }
69
- >
70
- {label}
71
- </StyledMenuDivider>
72
- )
55
+ ) =>
56
+ line ? (
57
+ <ReqoreVerticalSpacer
58
+ className={`${className || ''} reqore-menu-divider`}
59
+ height={PADDING_FROM_SIZE[size]}
60
+ lineSize={size}
61
+ />
62
+ ) : (
63
+ <StyledMenuDivider
64
+ as='div'
65
+ {...rest}
66
+ size={size}
67
+ className={`${className || ''} reqore-menu-divider`}
68
+ ref={ref}
69
+ effect={
70
+ {
71
+ uppercase: true,
72
+ spaced: 2,
73
+ textAlign: align,
74
+ textSize: getOneLessSize(size),
75
+ weight: 'bold',
76
+ ...effect,
77
+ } as IReqoreEffect
78
+ }
79
+ >
80
+ {label}
81
+ </StyledMenuDivider>
82
+ )
73
83
  );
74
84
 
75
85
  export default ReqoreMenuDivider;
@@ -1,6 +1,6 @@
1
1
  import { memo, useMemo } from 'react';
2
2
  import styled, { css } from 'styled-components';
3
- import { SIZE_TO_NUMBER, TEXT_FROM_SIZE, TSizes } from '../../constants/sizes';
3
+ import { LINE_SIZE_TO_NUMBER, TEXT_FROM_SIZE, TSizes } from '../../constants/sizes';
4
4
  import { changeLightness } from '../../helpers/colors';
5
5
  import { useReqoreTheme } from '../../hooks/useTheme';
6
6
  import { IReqoreIntent, IWithReqoreCustomTheme, IWithReqoreEffect } from '../../types/global';
@@ -103,7 +103,7 @@ export const ReqoreSpacer = memo(
103
103
  }
104
104
 
105
105
  const _lineSize = useMemo(
106
- () => (lineSize === 'none' ? 0 : SIZE_TO_NUMBER[lineSize]),
106
+ () => (lineSize === 'none' ? 0 : LINE_SIZE_TO_NUMBER[lineSize]),
107
107
  [lineSize]
108
108
  );
109
109
 
@@ -1,46 +1,97 @@
1
- import { Dispatch, SetStateAction, useEffect, useRef } from 'react';
2
- import { useScroll } from 'react-use';
1
+ import { forwardRef, useMemo } from 'react';
2
+ import { useMount } from 'react-use';
3
3
  import { FixedSizeList as List } from 'react-window';
4
+ import styled from 'styled-components';
4
5
  import { TABLE_SIZE_TO_PX } from '../../constants/sizes';
6
+ import { useCombinedRefs } from '../../hooks/useCombinedRefs';
5
7
  import ReqoreTableRow, { IReqoreTableRowOptions } from './row';
6
8
 
7
9
  export interface IReqoreTableSectionBodyProps extends IReqoreTableRowOptions {
8
- setLeftScroll: Dispatch<SetStateAction<number>>;
9
- rowHeight?: number;
10
10
  height: number;
11
+ refs: {
12
+ left: React.RefObject<HTMLDivElement>;
13
+ right: React.RefObject<HTMLDivElement>;
14
+ main: React.RefObject<HTMLDivElement>;
15
+ header: React.RefObject<HTMLDivElement>;
16
+ };
17
+ type?: 'left' | 'right' | 'main';
18
+ onScrollChange?: (isScrolled: boolean) => void;
11
19
  }
12
20
 
13
- const ReqoreTableBody = ({
14
- data,
15
- setLeftScroll,
16
- height,
17
- rowHeight,
18
- size = 'normal',
19
- ...rest
20
- }: IReqoreTableSectionBodyProps) => {
21
- const ref = useRef(null);
22
- const { x }: { x: number } = useScroll(ref);
23
-
24
- useEffect(() => {
25
- setLeftScroll(x);
26
- }, [x]);
27
-
28
- return (
29
- <List
30
- outerRef={ref}
31
- itemCount={data.length}
32
- height={height}
33
- className='reqore-table-body'
34
- itemSize={rest.flat ? TABLE_SIZE_TO_PX[size] : TABLE_SIZE_TO_PX[size] + 1}
35
- itemData={{
36
- data,
37
- size,
38
- ...rest,
39
- }}
40
- >
41
- {ReqoreTableRow}
42
- </List>
43
- );
44
- };
21
+ const StyledList = styled(List)`
22
+ ::-webkit-scrollbar {
23
+ display: none;
24
+ }
25
+ `;
26
+
27
+ const ReqoreTableBody = forwardRef<HTMLDivElement, IReqoreTableSectionBodyProps>(
28
+ (
29
+ {
30
+ data,
31
+ height,
32
+ size = 'normal',
33
+ refs,
34
+ type,
35
+ onScrollChange,
36
+ ...rest
37
+ }: IReqoreTableSectionBodyProps,
38
+ ref
39
+ ) => {
40
+ const { targetRef } = useCombinedRefs(ref);
41
+
42
+ useMount(() => {
43
+ targetRef.current?.addEventListener('wheel', (e) => {
44
+ if (e.deltaY) {
45
+ e.preventDefault();
46
+
47
+ const currentScroll = refs[type].current?.scrollTop + e.deltaY;
48
+
49
+ onScrollChange?.(currentScroll > 0);
50
+
51
+ refs[type].current?.scrollTo({ top: currentScroll });
52
+
53
+ if (type === 'left') {
54
+ refs.main.current?.scrollTo({ top: refs.main.current?.scrollTop + e.deltaY });
55
+ refs.right.current?.scrollTo({ top: refs.right.current?.scrollTop + e.deltaY });
56
+ } else if (type === 'main') {
57
+ refs.left.current?.scrollTo({ top: refs.left.current?.scrollTop + e.deltaY });
58
+ refs.right.current?.scrollTo({ top: refs.right.current?.scrollTop + e.deltaY });
59
+ } else if (type === 'right') {
60
+ refs.main.current?.scrollTo({ top: refs.main.current?.scrollTop + e.deltaY });
61
+ refs.left.current?.scrollTo({ top: refs.left.current?.scrollTop + e.deltaY });
62
+ }
63
+ }
64
+
65
+ if (e.deltaX && type === 'main') {
66
+ refs.header.current?.scrollTo({ left: refs.main.current?.scrollLeft + e.deltaX });
67
+ }
68
+ });
69
+ });
70
+
71
+ const rowHeight = useMemo(
72
+ () => (rest.flat ? TABLE_SIZE_TO_PX[size] : TABLE_SIZE_TO_PX[size] + 1),
73
+ [size, rest.flat]
74
+ );
75
+
76
+ return (
77
+ <StyledList
78
+ outerRef={targetRef}
79
+ itemCount={data.length}
80
+ // If the defined height is less than the count of items' height
81
+ // use that height instead
82
+ height={height > data.length * rowHeight ? data.length * rowHeight : height}
83
+ className='reqore-table-body'
84
+ itemSize={rest.flat ? TABLE_SIZE_TO_PX[size] : TABLE_SIZE_TO_PX[size] + 1}
85
+ itemData={{
86
+ data,
87
+ size,
88
+ ...rest,
89
+ }}
90
+ >
91
+ {ReqoreTableRow}
92
+ </StyledList>
93
+ );
94
+ }
95
+ );
45
96
 
46
97
  export default ReqoreTableBody;
@@ -17,9 +17,12 @@ export interface IReqoreTableBodyCellProps
17
17
  }
18
18
 
19
19
  export const StyledTableCell = styled.div<IReqoreTableCellStyle>`
20
- ${({ width, grow }) =>
20
+ ${({ width, minWidth, maxWidth, grow }) =>
21
21
  css`
22
22
  width: ${width}px;
23
+ min-width: ${minWidth}px;
24
+ max-width: ${maxWidth}px;
25
+
23
26
  flex-grow: ${grow || (width ? undefined : 1)};
24
27
  `}
25
28