@cloud-ru/ds-table 2.2.1 → 2.2.2

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 (26) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/components/Table/Table.js +1 -1
  3. package/dist/cjs/helperComponents/Cells/HeaderCell/styles.module.css +1 -1
  4. package/dist/cjs/helperComponents/Rows/HeaderRow.js +1 -1
  5. package/dist/cjs/helperComponents/TablePagination/TablePagination.d.ts +4 -1
  6. package/dist/cjs/helperComponents/TablePagination/TablePagination.js +2 -2
  7. package/dist/cjs/helperComponents/TablePagination/styles.module.css +1 -1
  8. package/dist/cjs/helperComponents/TreeChevronButton/styles.module.css +1 -1
  9. package/dist/cjs/style.css +3 -3
  10. package/dist/esm/components/Table/Table.js +1 -1
  11. package/dist/esm/helperComponents/Cells/HeaderCell/styles.module.css +1 -1
  12. package/dist/esm/helperComponents/Rows/HeaderRow.js +1 -1
  13. package/dist/esm/helperComponents/TablePagination/TablePagination.d.ts +4 -1
  14. package/dist/esm/helperComponents/TablePagination/TablePagination.js +2 -2
  15. package/dist/esm/helperComponents/TablePagination/styles.module.css +1 -1
  16. package/dist/esm/helperComponents/TreeChevronButton/styles.module.css +1 -1
  17. package/dist/esm/style.css +3 -3
  18. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  19. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  20. package/package.json +11 -11
  21. package/src/components/Table/Table.tsx +1 -0
  22. package/src/helperComponents/Cells/HeaderCell/styles.module.scss +2 -1
  23. package/src/helperComponents/Rows/HeaderRow.tsx +8 -1
  24. package/src/helperComponents/TablePagination/TablePagination.tsx +5 -1
  25. package/src/helperComponents/TablePagination/styles.module.scss +1 -1
  26. package/src/helperComponents/TreeChevronButton/styles.module.scss +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud-ru/ds-table",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "description": "Таблица данных: клиентская Table, серверная ServerTable и preset-обёртки с упрощённым API.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -48,24 +48,24 @@
48
48
  "@tanstack/react-table": "^8.21.3",
49
49
  "@tanstack/react-virtual": "^3.14.8",
50
50
  "classnames": "^2.5.1",
51
- "@cloud-ru/ds-adaptive": "^1.0.3",
52
- "@cloud-ru/ds-card": "^1.0.29",
53
51
  "@cloud-ru/ds-button": "^1.0.5",
52
+ "@cloud-ru/ds-card": "^1.0.30",
53
+ "@cloud-ru/ds-chips": "^1.2.6",
54
+ "@cloud-ru/ds-info-block": "^1.0.4",
55
+ "@cloud-ru/ds-adaptive": "^1.0.3",
54
56
  "@cloud-ru/ds-drag-and-drop": "^1.1.4",
55
- "@cloud-ru/ds-chips": "^1.2.5",
56
57
  "@cloud-ru/ds-locale": "^1.0.0",
57
- "@cloud-ru/ds-icons": "^1.7.1",
58
- "@cloud-ru/ds-info-block": "^1.0.4",
59
- "@cloud-ru/ds-list": "^3.0.4",
60
58
  "@cloud-ru/ds-materials": "^2.0.2",
59
+ "@cloud-ru/ds-list": "^3.0.5",
61
60
  "@cloud-ru/ds-pagination": "^1.1.8",
62
- "@cloud-ru/ds-scroll": "^1.0.6",
61
+ "@cloud-ru/ds-icons": "^1.7.1",
63
62
  "@cloud-ru/ds-skeleton": "^1.0.3",
64
- "@cloud-ru/ds-toggles": "^1.1.13",
65
- "@cloud-ru/ds-status": "^1.1.13",
66
- "@cloud-ru/ds-toolbar": "^2.1.1",
63
+ "@cloud-ru/ds-status": "^1.1.14",
64
+ "@cloud-ru/ds-scroll": "^1.0.6",
65
+ "@cloud-ru/ds-toolbar": "^2.1.2",
67
66
  "@cloud-ru/ds-tooltip": "^1.0.16",
68
67
  "@cloud-ru/ds-truncate-string": "^1.0.17",
68
+ "@cloud-ru/ds-toggles": "^1.1.13",
69
69
  "@cloud-ru/ds-utils": "^1.3.0"
70
70
  },
71
71
  "publishConfig": {
@@ -710,6 +710,7 @@ export function Table<TData extends object, TFilters extends FiltersState = Reco
710
710
  optionsLabel={paginationProp?.optionsLabel}
711
711
  pageCount={pageCount}
712
712
  optionsRender={paginationProp?.optionsRender}
713
+ view={view}
713
714
  />
714
715
  );
715
716
 
@@ -77,7 +77,8 @@
77
77
 
78
78
  background-color: transparent;
79
79
 
80
- [data-test-id='table__pinned-cells'] &::after {
80
+ // Нижняя граница под закреплёнными колонками: `pinPosition` получают только ячейки внутри `PinnedCells`.
81
+ &[data-pin-position]::after {
81
82
  pointer-events: none;
82
83
  content: '';
83
84
 
@@ -26,7 +26,14 @@ export function HeaderRow({ rowAutoHeight, columnOrder, enableColumnsOrderSortBy
26
26
  <PinnedCells position={COLUMN_PIN_POSITION.Left}>
27
27
  {leftPinned.map(headerGroup =>
28
28
  headerGroup.headers.map(header =>
29
- header.isPlaceholder ? null : <HeaderCell key={header.id} header={header} rowAutoHeight={rowAutoHeight} />,
29
+ header.isPlaceholder ? null : (
30
+ <HeaderCell
31
+ key={header.id}
32
+ header={header}
33
+ pinPosition={COLUMN_PIN_POSITION.Left}
34
+ rowAutoHeight={rowAutoHeight}
35
+ />
36
+ ),
30
37
  ),
31
38
  )}
32
39
  </PinnedCells>
@@ -3,6 +3,7 @@ import { Pagination } from '@cloud-ru/ds-pagination';
3
3
  import { Table } from '@tanstack/react-table';
4
4
  import { useCallback, useMemo } from 'react';
5
5
 
6
+ import { View } from '../../constants';
6
7
  import { tableLocale } from '../../locale';
7
8
  import styles from './styles.module.scss';
8
9
 
@@ -12,6 +13,8 @@ export type TablePaginationProps<TData> = {
12
13
  optionsLabel?: string;
13
14
  optionsRender?(value: number, idx: number): string | number;
14
15
  pageCount?: number;
16
+ /** Режим таблицы: в карточках пагинация занимает всю свободную ширину футера */
17
+ view?: View;
15
18
  };
16
19
 
17
20
  export function TablePagination<TData>({
@@ -19,6 +22,7 @@ export function TablePagination<TData>({
19
22
  options: optionsProp,
20
23
  optionsLabel: optionsLabelProp,
21
24
  optionsRender,
25
+ view,
22
26
  }: TablePaginationProps<TData>) {
23
27
  const { t } = tableLocale.useTranslations();
24
28
  const optionsLabel = optionsLabelProp ?? t('rowsOptionsLabel');
@@ -56,7 +60,7 @@ export function TablePagination<TData>({
56
60
  }
57
61
 
58
62
  return (
59
- <div className={styles.footer}>
63
+ <div className={styles.footer} data-view={view}>
60
64
  {table.getPageCount() > 1 && (
61
65
  <Pagination
62
66
  total={table.getPageCount()}
@@ -18,6 +18,6 @@
18
18
  margin-right: auto;
19
19
  }
20
20
 
21
- [data-view='cards'] .pagination {
21
+ .footer[data-view='cards'] .pagination {
22
22
  flex: 1;
23
23
  }
@@ -67,7 +67,7 @@
67
67
  transition: transform 0.2s ease;
68
68
  }
69
69
 
70
- [data-expanded] > .content > & svg {
70
+ .root[data-expanded] > .content > & svg {
71
71
  transform: rotate(90deg);
72
72
  }
73
73
  }