@synerise/ds-table 1.5.8 → 1.5.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.5.10](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@1.5.9...@synerise/ds-table@1.5.10) (2025-09-16)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-table
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.5.9](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@1.5.8...@synerise/ds-table@1.5.9) (2025-09-05)
15
+
16
+ **Note:** Version bump only for package @synerise/ds-table
17
+
18
+
19
+
20
+
21
+
6
22
  ## [1.5.8](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@1.5.7...@synerise/ds-table@1.5.8) (2025-09-05)
7
23
 
8
24
  **Note:** Version bump only for package @synerise/ds-table
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type ColumnSortOrder } from './useSortState';
2
+ import { type ColumnSortOrder } from '../Table.types';
3
3
  export declare const CheckIcon: React.ForwardRefExoticComponent<{
4
4
  isActive: boolean;
5
5
  } & {
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { type DSColumnType, type OnSortFn } from '../Table.types';
3
- import { type SortStateAPI } from './useSortState';
2
+ import { type DSColumnType, type OnSortFn, type SortStateAPI } from '../Table.types';
4
3
  type SortRendererProps<T> = {
5
4
  sortStateApi: SortStateAPI;
6
5
  column: DSColumnType<T>;
@@ -1,14 +1,4 @@
1
- import { type ColumnTitleProps } from 'antd/lib/table/interface';
2
1
  import React from 'react';
3
- import { type DSColumnType } from '../Table.types';
4
- import { type SortStateAPI } from './useSortState';
5
- export type SortButtonsRenderer<T> = (sortStateApi: SortStateAPI, column: DSColumnType<T>) => React.ReactElement;
6
- export type SortRender<T> = 'default' | 'string' | SortButtonsRenderer<T>;
7
- export interface TitleWithSortOwnProps<T> {
8
- column: DSColumnType<T>;
9
- sortRender: React.ReactElement;
10
- titleProps: ColumnTitleProps<T>;
11
- }
12
- export type TitleWithSortProps<T> = TitleWithSortOwnProps<T> & React.ComponentPropsWithoutRef<'span'>;
2
+ import { type TitleWithSortProps } from '../Table.types';
13
3
  export declare const TitleWithSort: <T>({ column, sortRender, titleProps, ...spanProps }: TitleWithSortProps<T>) => React.ReactElement;
14
4
  export default TitleWithSort;
@@ -1,5 +1,5 @@
1
- import { type DSColumnType, type OnSortFn } from '../Table.types';
2
- import { type SortStateAPI } from './useSortState';
1
+ import { type DSColumnType, type OnSortFn, type SortStateAPI } from '../Table.types';
2
+ import './useSortState';
3
3
  export declare const columnWithSortButtons: (sortStateApi: SortStateAPI, onSort?: OnSortFn) => <T>(column: DSColumnType<T>) => DSColumnType<T>;
4
4
  declare const _default: {
5
5
  columnWithSortButtons: (sortStateApi: SortStateAPI, onSort?: OnSortFn) => <T>(column: DSColumnType<T>) => DSColumnType<T>;
@@ -2,6 +2,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
2
2
  import React from 'react';
3
3
  import { CommonRenderer, StringRenderer } from './SortRenderer';
4
4
  import { TitleWithSort } from './TitleWithSort';
5
+ import './useSortState';
5
6
  var getSortRenderer = function getSortRenderer(sortRender, onSort) {
6
7
  if (sortRender === void 0) {
7
8
  sortRender = 'default';
@@ -1,7 +1,6 @@
1
1
  import { type CompareFn } from 'antd/lib/table/interface';
2
2
  import { type GroupType } from '../GroupTable/GroupTable.types';
3
- import { type DSColumnType } from '../Table.types';
4
- import { type ColumnSortOrder, type SortStateAPI } from './useSortState';
3
+ import { type ColumnSortOrder, type DSColumnType, type SortStateAPI } from '../Table.types';
5
4
  export declare const getColumnsWithActiveSorting: <T extends GroupType<T>>(sortStateApi: SortStateAPI, columns?: DSColumnType<T>[]) => DSColumnType<T>[];
6
5
  export declare const sortRows: <T>(sortOrder: ColumnSortOrder, compareFn: CompareFn<T>, rows: T[]) => T[];
7
6
  export declare const sortDataSourceRows: <T extends GroupType<T>>(sortStateApi: SortStateAPI, sortingColumns?: DSColumnType<T>[], dataSource?: readonly T[]) => readonly T[];
@@ -1,17 +1,4 @@
1
- import { type DSColumnType, type OnSortFn } from '../Table.types';
2
- export type ColumnSortOrder = 'descend' | 'ascend' | null;
3
- export interface ColumnsSortState {
4
- [key: string]: {
5
- sortOrder: ColumnSortOrder;
6
- multiple: number | false;
7
- };
8
- }
9
- export interface SortStateAPI {
10
- columnsSortState: ColumnsSortState;
11
- getColumnSortOrder: (key: string) => ColumnSortOrder;
12
- setColumnSortOrder: (key: string, sort: ColumnSortOrder) => void;
13
- updateColumnsData: (columns: ColumnsSortState) => void;
14
- }
1
+ import { type ColumnSortOrder, type ColumnsSortState, type DSColumnType, type OnSortFn, type SortStateAPI } from '../Table.types';
15
2
  export declare const toSortOrder: (value: string | null | undefined) => ColumnSortOrder;
16
3
  export declare const columnsToSortState: <T>(columns?: DSColumnType<T>[]) => ColumnsSortState;
17
4
  export declare const useSortState: (initialState: ColumnsSortState | undefined, onSort: OnSortFn | undefined) => SortStateAPI;
package/dist/Table.js CHANGED
@@ -2,8 +2,8 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
2
2
  import React, { useCallback, useMemo } from 'react';
3
3
  import { useIntl } from 'react-intl';
4
4
  import Button from '@synerise/ds-button';
5
+ import { useDataFormat } from '@synerise/ds-core';
5
6
  import '@synerise/ds-core/dist/js/style';
6
- import { useDataFormat } from '@synerise/ds-data-format';
7
7
  import Icon, { AngleLeftS, AngleRightS } from '@synerise/ds-icon';
8
8
  import Skeleton from '@synerise/ds-skeleton';
9
9
  import DefaultTable from './DefaultTable/DefaultTable';
@@ -1,19 +1,24 @@
1
1
  import type { ColumnType, TableProps } from 'antd/lib/table';
2
- import type { TableLocale, TableRowSelection } from 'antd/lib/table/interface';
2
+ import type { ColumnTitleProps, TableLocale, TableRowSelection } from 'antd/lib/table/interface';
3
+ import type { SELECTION_ALL, SELECTION_INVERT } from 'constants/Table.constants';
3
4
  import type { Key, ReactNode, Ref } from 'react';
4
5
  import type { LiteralStringUnion } from '@synerise/ds-utils';
5
- import type { SortRender } from './ColumnSortMenu/TitleWithSort';
6
- import type { ColumnSortOrder, ColumnsSortState } from './ColumnSortMenu/useSortState';
7
6
  import type { GroupType } from './GroupTable/GroupTable.types';
8
- import type DSTable from './Table';
9
- import type { RowStar } from './hooks/useRowStar';
7
+ export type RowStar<T> = {
8
+ className?: string;
9
+ starredRowKeys: string[];
10
+ renderCell?: ColumnType<T>['render'];
11
+ onClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
12
+ onChange?: (starredRowKeys: string[], starredKey: string, isStarred: boolean) => void;
13
+ disableForExpandedRows?: boolean;
14
+ };
10
15
  export type AntTableProps<T> = Omit<TableProps<T>, 'title' | 'subTitle' | 'onSearch' | 'itemsMenu' | 'search' | 'locale' | 'columns' | 'loading'>;
11
16
  export type Selection = {
12
17
  key: string;
13
18
  label: string;
14
19
  onClick: () => void;
15
20
  };
16
- export type SelectionItem = typeof DSTable.SELECTION_ALL | typeof DSTable.SELECTION_INVERT | Selection | null | undefined;
21
+ export type SelectionItem = typeof SELECTION_ALL | typeof SELECTION_INVERT | Selection | null | undefined;
17
22
  export type RowSelection<T> = Omit<TableRowSelection<T>, 'selections'> & {
18
23
  fixed?: boolean;
19
24
  selectedRowKeys: Key[];
@@ -154,4 +159,25 @@ export type DSTableProps<T extends any & GroupType<T>> = AntTableProps<T> & {
154
159
  cellHeight?: number;
155
160
  };
156
161
  };
162
+ export type ColumnSortOrder = 'descend' | 'ascend' | null;
163
+ export interface ColumnsSortState {
164
+ [key: string]: {
165
+ sortOrder: ColumnSortOrder;
166
+ multiple: number | false;
167
+ };
168
+ }
169
+ export interface SortStateAPI {
170
+ columnsSortState: ColumnsSortState;
171
+ getColumnSortOrder: (key: string) => ColumnSortOrder;
172
+ setColumnSortOrder: (key: string, sort: ColumnSortOrder) => void;
173
+ updateColumnsData: (columns: ColumnsSortState) => void;
174
+ }
175
+ export type SortButtonsRenderer<T> = (sortStateApi: SortStateAPI, column: DSColumnType<T>) => React.ReactElement;
176
+ export type SortRender<T> = 'default' | 'string' | SortButtonsRenderer<T>;
177
+ export interface TitleWithSortOwnProps<T> {
178
+ column: DSColumnType<T>;
179
+ sortRender: React.ReactElement;
180
+ titleProps: ColumnTitleProps<T>;
181
+ }
182
+ export type TitleWithSortProps<T> = TitleWithSortOwnProps<T> & React.ComponentPropsWithoutRef<'span'>;
157
183
  export {};
@@ -1,6 +1,6 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
2
  import React, { useMemo } from 'react';
3
- import { useDataFormat } from '@synerise/ds-data-format';
3
+ import { useDataFormat } from '@synerise/ds-core';
4
4
  import FilterTrigger from '../FilterTrigger/FilterTrigger';
5
5
  import * as S from '../Table.styles';
6
6
  import { TableLimit } from './TableLimit';
@@ -1,6 +1,6 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import Alert from '@synerise/ds-alert';
3
- import { useDataFormat } from '@synerise/ds-data-format';
3
+ import { useDataFormat } from '@synerise/ds-core';
4
4
  import { Skeleton } from '../../Table.styles';
5
5
  import * as S from './TableLimit.styles';
6
6
  export function TableLimit(_ref) {
@@ -1,7 +1,6 @@
1
1
  import React, { type CSSProperties, type ReactElement } from 'react';
2
2
  import type { InfiniteScrollProps } from '../InfiniteScroll/InfiniteLoaderItem.types';
3
- import type { DSTableProps, RowSelection } from '../Table.types';
4
- import { type RowStar } from '../hooks/useRowStar';
3
+ import { type DSTableProps, type RowSelection, type RowStar } from '../Table.types';
5
4
  export declare const INFINITE_LOADED_ITEM_HEIGHT = 64;
6
5
  export interface VirtualTableRowProps<T> {
7
6
  data: {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { SkeletonAvatar } from '@synerise/ds-skeleton';
3
- import { AvatarLabelCell } from '../Cell';
3
+ import AvatarLabelCell from '../Cell/AvatarLabel/AvatarLabel';
4
4
  import * as S from '../Table.styles';
5
5
  export var DEFAULT_ROW_COUNT = 10;
6
6
  export var HEADER_HEIGHT = 73;
@@ -1,14 +1,5 @@
1
- import { type ColumnType } from 'antd/lib/table';
2
1
  import type React from 'react';
3
2
  import { type DSColumnType, type DSTableProps } from '../../Table.types';
4
- export interface RowStar<T> {
5
- className?: string;
6
- starredRowKeys: string[];
7
- renderCell?: ColumnType<T>['render'];
8
- onClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
9
- onChange?: (starredRowKeys: string[], starredKey: string, isStarred: boolean) => void;
10
- disableForExpandedRows?: boolean;
11
- }
12
3
  export type AnyRecordType = any;
13
4
  export interface UseStarredApi {
14
5
  getStarredKeys: () => string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-table",
3
- "version": "1.5.8",
3
+ "version": "1.5.10",
4
4
  "description": "Table UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "synerise/synerise-design",
@@ -26,6 +26,7 @@
26
26
  "test": "jest",
27
27
  "test:watch": "npm run test -- --watchAll",
28
28
  "types": "tsc --noEmit",
29
+ "check:circular-dependencies": "madge --circular --extensions ts,tsx,js,jsx --ts-config tsconfig.json src/ --exclude '/dist/'",
29
30
  "upgrade:ds": "ncu -f \"@synerise/ds-*\" -u"
30
31
  },
31
32
  "sideEffects": [
@@ -34,31 +35,30 @@
34
35
  ],
35
36
  "types": "dist/index.d.ts",
36
37
  "dependencies": {
37
- "@synerise/ds-alert": "^1.1.15",
38
- "@synerise/ds-badge": "^1.0.20",
39
- "@synerise/ds-button": "^1.4.9",
40
- "@synerise/ds-button-group": "^1.1.13",
41
- "@synerise/ds-checkbox": "^1.1.6",
42
- "@synerise/ds-column-manager": "^1.2.12",
43
- "@synerise/ds-data-format": "^1.1.1",
44
- "@synerise/ds-dropdown": "^1.0.21",
45
- "@synerise/ds-flag": "^1.0.3",
46
- "@synerise/ds-icon": "^1.7.1",
47
- "@synerise/ds-input": "^1.3.8",
48
- "@synerise/ds-loader": "^1.0.8",
49
- "@synerise/ds-menu": "^1.0.21",
50
- "@synerise/ds-modal": "^1.2.9",
51
- "@synerise/ds-pagination": "^1.0.23",
52
- "@synerise/ds-result": "^1.0.22",
53
- "@synerise/ds-scrollbar": "^1.1.7",
54
- "@synerise/ds-search": "^1.3.0",
55
- "@synerise/ds-select": "^1.1.16",
56
- "@synerise/ds-skeleton": "^1.0.20",
57
- "@synerise/ds-status": "^1.2.13",
58
- "@synerise/ds-tag": "^1.1.17",
59
- "@synerise/ds-tooltip": "^1.1.17",
60
- "@synerise/ds-typography": "^1.0.19",
61
- "@synerise/ds-utils": "^1.4.1",
38
+ "@synerise/ds-alert": "^1.1.17",
39
+ "@synerise/ds-badge": "^1.0.21",
40
+ "@synerise/ds-button": "^1.4.10",
41
+ "@synerise/ds-button-group": "^1.1.14",
42
+ "@synerise/ds-checkbox": "^1.1.7",
43
+ "@synerise/ds-column-manager": "^1.2.13",
44
+ "@synerise/ds-dropdown": "^1.0.22",
45
+ "@synerise/ds-flag": "^1.0.4",
46
+ "@synerise/ds-icon": "^1.7.2",
47
+ "@synerise/ds-input": "^1.3.9",
48
+ "@synerise/ds-loader": "^1.0.9",
49
+ "@synerise/ds-menu": "^1.0.22",
50
+ "@synerise/ds-modal": "^1.2.10",
51
+ "@synerise/ds-pagination": "^1.0.24",
52
+ "@synerise/ds-result": "^1.0.23",
53
+ "@synerise/ds-scrollbar": "^1.1.8",
54
+ "@synerise/ds-search": "^1.3.1",
55
+ "@synerise/ds-select": "^1.1.17",
56
+ "@synerise/ds-skeleton": "^1.0.21",
57
+ "@synerise/ds-status": "^1.2.14",
58
+ "@synerise/ds-tag": "^1.1.18",
59
+ "@synerise/ds-tooltip": "^1.1.18",
60
+ "@synerise/ds-typography": "^1.0.20",
61
+ "@synerise/ds-utils": "^1.4.2",
62
62
  "@types/react-window": "^1.8.8",
63
63
  "classnames": "^2.5.1",
64
64
  "copy-to-clipboard": "^3.3.1",
@@ -77,5 +77,5 @@
77
77
  "react-intl": ">=3.12.0 <= 6.8",
78
78
  "styled-components": "^5.3.3"
79
79
  },
80
- "gitHead": "7f119fa17e645f1d800aea95c313fe22f348439c"
80
+ "gitHead": "5beb6ab5f2d77b9e98e04caab7dff20b8436078b"
81
81
  }