@synerise/ds-table 1.3.1 → 1.4.0

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 (108) hide show
  1. package/CHANGELOG.md +1204 -3394
  2. package/README.md +6 -6
  3. package/dist/Cell/Action/ActionCell.d.ts +1 -1
  4. package/dist/Cell/Action/ActionCell.styles.d.ts +1 -1
  5. package/dist/Cell/Action/ActionCell.styles.js +0 -2
  6. package/dist/Cell/Action/ActionCell.types.d.ts +2 -2
  7. package/dist/Cell/AvatarLabel/AvatarLabel.d.ts +1 -1
  8. package/dist/Cell/AvatarLabel/AvatarLabel.styles.d.ts +1 -1
  9. package/dist/Cell/AvatarLabel/AvatarLabel.types.d.ts +1 -1
  10. package/dist/Cell/Copyable/Copyable.styles.js +0 -2
  11. package/dist/Cell/Copyable/Copyable.types.d.ts +1 -1
  12. package/dist/Cell/Copyable/CopyableCell.d.ts +1 -1
  13. package/dist/Cell/Copyable/CopyableCell.js +6 -3
  14. package/dist/Cell/Editable/EditableCell.d.ts +1 -1
  15. package/dist/Cell/Editable/EditableCell.js +2 -5
  16. package/dist/Cell/Editable/EditableCell.types.d.ts +1 -1
  17. package/dist/Cell/FlagLabel/FlagLabelCell.d.ts +1 -1
  18. package/dist/Cell/FlagLabel/FlagLabelCell.styles.js +0 -2
  19. package/dist/Cell/FlagLabel/FlagLabelCell.types.d.ts +2 -2
  20. package/dist/Cell/IconLabel/IconLabel.d.ts +1 -1
  21. package/dist/Cell/IconTooltipCell/IconTooltipCell.d.ts +1 -1
  22. package/dist/Cell/LabelsWithShowMore/LabelsWithShowMore.d.ts +2 -2
  23. package/dist/Cell/LabelsWithShowMore/LabelsWithShowMore.js +1 -1
  24. package/dist/Cell/LabelsWithShowMore/LabelsWithShowMore.types.d.ts +2 -2
  25. package/dist/Cell/LabelsWithShowMore/Modal/Modal.d.ts +1 -1
  26. package/dist/Cell/LabelsWithShowMore/Modal/Modal.types.d.ts +2 -2
  27. package/dist/Cell/Star/StarCell.d.ts +1 -1
  28. package/dist/Cell/Star/StarCell.styles.d.ts +1 -1
  29. package/dist/Cell/Star/StarCell.types.d.ts +2 -2
  30. package/dist/Cell/StatusLabel/StatusLabel.types.d.ts +3 -3
  31. package/dist/Cell/TagIcon/TagIcon.d.ts +1 -1
  32. package/dist/Cell/TagIcon/TagIcon.types.d.ts +2 -2
  33. package/dist/Cell/index.d.ts +7 -7
  34. package/dist/Cell/index.js +7 -7
  35. package/dist/ColumnSortMenu/SortIcons.d.ts +1 -1
  36. package/dist/ColumnSortMenu/SortIcons.js +1 -1
  37. package/dist/ColumnSortMenu/SortRenderer.d.ts +4 -4
  38. package/dist/ColumnSortMenu/SortRenderer.js +3 -3
  39. package/dist/ColumnSortMenu/TitleWithSort.d.ts +4 -4
  40. package/dist/ColumnSortMenu/columnWithSortButtons.d.ts +4 -4
  41. package/dist/ColumnSortMenu/columnWithSortButtons.js +1 -1
  42. package/dist/ColumnSortMenu/groupedColumnsSort.d.ts +4 -4
  43. package/dist/ColumnSortMenu/replaceSortButtons.d.ts +1 -1
  44. package/dist/ColumnSortMenu/useSortState.d.ts +2 -2
  45. package/dist/ColumnSortMenu/useSortState.js +1 -4
  46. package/dist/DefaultTable/DefaultTable.d.ts +1 -1
  47. package/dist/DefaultTable/DefaultTable.js +10 -14
  48. package/dist/FilterTrigger/FilterTrigger.d.ts +1 -1
  49. package/dist/FilterTrigger/FilterTrigger.types.d.ts +1 -1
  50. package/dist/GroupTable/GroupTable.d.ts +2 -2
  51. package/dist/GroupTable/GroupTable.js +8 -12
  52. package/dist/GroupTable/GroupTable.styles.js +10 -4
  53. package/dist/GroupTable/GroupTableBody/GroupTableBody.d.ts +2 -2
  54. package/dist/GroupTable/GroupTableBody/GroupTableBody.js +4 -4
  55. package/dist/GroupTable/GroupTableBody/GroupTableBody.types.d.ts +4 -4
  56. package/dist/GroupTable/GroupTableHeader/GroupTableHeader.d.ts +2 -2
  57. package/dist/GroupTable/GroupTableHeader/GroupTableHeader.types.d.ts +1 -1
  58. package/dist/InfiniteScroll/BackToTopButton.d.ts +1 -1
  59. package/dist/InfiniteScroll/ErrorItem.js +1 -1
  60. package/dist/InfiniteScroll/InfiniteLoaderItem.d.ts +1 -1
  61. package/dist/InfiniteScroll/InfiniteLoaderItem.js +2 -2
  62. package/dist/InfiniteScroll/InfiniteLoaderItem.types.d.ts +1 -1
  63. package/dist/InfiniteScroll/OuterListElement.d.ts +1 -1
  64. package/dist/InfiniteScroll/OuterListElement.js +1 -1
  65. package/dist/InfiniteScroll/utils.d.ts +1 -1
  66. package/dist/ItemsMenu/ItemsMenu.d.ts +1 -1
  67. package/dist/ItemsMenu/ItemsMenu.styles.js +0 -2
  68. package/dist/RowSelection/RowSelectionColumn.d.ts +2 -2
  69. package/dist/RowSelection/RowSelectionColumn.js +1 -1
  70. package/dist/RowSelection/RowSelectionColumn.types.d.ts +2 -2
  71. package/dist/Table.d.ts +1 -1
  72. package/dist/Table.js +8 -8
  73. package/dist/Table.styles.d.ts +2 -2
  74. package/dist/Table.styles.js +4 -4
  75. package/dist/Table.types.d.ts +4 -4
  76. package/dist/TableHeader/TableHeader.d.ts +1 -1
  77. package/dist/TableHeader/TableHeader.js +4 -5
  78. package/dist/TableHeader/TableHeader.types.d.ts +2 -2
  79. package/dist/TableHeader/TableLimit/TableLimit.d.ts +1 -1
  80. package/dist/TableHeader/TableLimit/TableLimit.js +2 -2
  81. package/dist/TableHeader/TableLimit/TableLimit.types.d.ts +1 -1
  82. package/dist/TableHeader/TableSelection.js +7 -5
  83. package/dist/TableHeader/TableSelection.types.d.ts +1 -1
  84. package/dist/TreeTable/TreeTable.d.ts +1 -1
  85. package/dist/TreeTable/TreeTable.js +4 -4
  86. package/dist/TreeTable/TreeTable.styles.js +3 -1
  87. package/dist/VirtualTable/VirtualTable.d.ts +2 -2
  88. package/dist/VirtualTable/VirtualTable.js +17 -15
  89. package/dist/VirtualTable/VirtualTable.types.d.ts +1 -1
  90. package/dist/VirtualTable/VirtualTableRow.d.ts +4 -5
  91. package/dist/VirtualTable/VirtualTableRow.js +3 -3
  92. package/dist/constants/TableSkeleton.constants.js +1 -1
  93. package/dist/hooks/useBulkSelection/useBulkSelection.d.ts +1 -1
  94. package/dist/hooks/useBulkSelection/useBulkSelection.js +4 -2
  95. package/dist/hooks/useRowKey/useRowKey.js +6 -3
  96. package/dist/hooks/useRowStar/useRowStar.d.ts +1 -1
  97. package/dist/hooks/useRowStar/useRowStar.js +3 -3
  98. package/dist/hooks/useRowStar/useRowStar.types.d.ts +3 -3
  99. package/dist/index.d.ts +3 -3
  100. package/dist/index.js +2 -2
  101. package/dist/style/index.css +1 -1
  102. package/dist/utils/calculateColumnWidths.d.ts +1 -1
  103. package/dist/utils/calculatePixels.js +1 -3
  104. package/dist/utils/getRecordSelectionStatus.d.ts +1 -1
  105. package/dist/utils/getSkeletonProps.js +4 -2
  106. package/dist/utils/getValueFromPath.js +6 -4
  107. package/dist/utils/locale.d.ts +2 -2
  108. package/package.json +27 -27
@@ -1,14 +1,14 @@
1
1
  var _excluded = ["rows"];
2
2
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
3
3
  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); }
4
- import React from 'react';
5
- import { flow } from 'lodash';
6
4
  import Table from 'antd/lib/table';
7
- import { columnsToSortState, useSortState } from '../ColumnSortMenu/useSortState';
5
+ import { flow } from 'lodash';
6
+ import React from 'react';
8
7
  import { columnWithSortButtons } from '../ColumnSortMenu/columnWithSortButtons';
9
- import GroupTableBody from './GroupTableBody/GroupTableBody';
10
- import "../style/index.css";
11
8
  import { getColumnsWithActiveSorting, sortDataSourceRows } from '../ColumnSortMenu/groupedColumnsSort';
9
+ import { columnsToSortState, useSortState } from '../ColumnSortMenu/useSortState';
10
+ import "../style/index.css";
11
+ import GroupTableBody from './GroupTableBody/GroupTableBody';
12
12
  var addActiveColumnClass = function addActiveColumnClass(activeColumn) {
13
13
  return function (column) {
14
14
  return column.key === activeColumn ? _extends({}, column, {
@@ -36,8 +36,6 @@ var addSortClassByState = function addSortClassByState(sortStateApi) {
36
36
  }) : column;
37
37
  };
38
38
  };
39
-
40
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
39
  function GroupTable(props) {
42
40
  var selection = props.selection,
43
41
  rowKey = props.rowKey,
@@ -104,9 +102,7 @@ function GroupTable(props) {
104
102
  return /*#__PURE__*/React.createElement("div", {
105
103
  className: "ds-table ds-table-cell-size-" + cellSize + " " + (roundedHeader ? 'ds-table-rounded' : '')
106
104
  }, /*#__PURE__*/React.createElement(Table, _extends({}, props, {
107
- dataSource: sortedRowsData
108
- // @ts-ignore: FIXME: antd table columns type is not compatible with DS
109
- ,
105
+ dataSource: sortedRowsData,
110
106
  columns: decoratedColumns,
111
107
  components: {
112
108
  body: {
@@ -120,7 +116,7 @@ function GroupTable(props) {
120
116
  allItems: allItems,
121
117
  expanded: expandedGroups.indexOf(record['data-row-key']) >= 0,
122
118
  expandGroup: toggleExpand
123
- // @ts-ignore: FIXME: Type 'DSColumnType<T>[]' is not assignable to type 'GroupColumnsType<T>[]'.
119
+ // @ts-expect-error: FIXME: Type 'DSColumnType<T>[]' is not assignable to type 'GroupColumnsType<T>[]'.
124
120
  ,
125
121
  columns: columnsWithCustomSorting,
126
122
  addItem: addItem,
@@ -130,7 +126,7 @@ function GroupTable(props) {
130
126
  }
131
127
  }
132
128
  }
133
- // @ts-ignore
129
+ // @ts-expect-error Type 'undefined' is not assignable to type 'INTERNAL_SELECTION_ITEM'.
134
130
  ,
135
131
  rowSelection: selection && _extends({}, selection, {
136
132
  columnWidth: 64
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components';
2
- import { StatusTag } from '@synerise/ds-status/dist/Status.styles';
3
2
  import Button from '@synerise/ds-button';
4
3
  import { CheckboxWrapper } from '@synerise/ds-checkbox/dist/Checkbox.styles';
4
+ import { StatusTag } from '@synerise/ds-status/dist/Status.styles';
5
5
  export var GroupAddItemButton = styled(Button).withConfig({
6
6
  displayName: "GroupTablestyles__GroupAddItemButton",
7
7
  componentId: "sc-1whlllx-0"
@@ -48,11 +48,17 @@ export var SubRow = styled.td.withConfig({
48
48
  var theme = _ref2.theme,
49
49
  selected = _ref2.selected,
50
50
  sorted = _ref2.sorted;
51
- if (selected) return theme.palette['yellow-050'] + ";";
52
- if (sorted) return theme.palette['blue-050'] + ";";
51
+ if (selected) {
52
+ return theme.palette['yellow-050'] + ";";
53
+ }
54
+ if (sorted) {
55
+ return theme.palette['blue-050'] + ";";
56
+ }
53
57
  return "";
54
58
  }, function (props) {
55
- if (props.selected || props.sorted) return '500';
59
+ if (props.selected || props.sorted) {
60
+ return '500';
61
+ }
56
62
  return 'initial';
57
63
  }, function (props) {
58
64
  return props.theme.palette['grey-600'];
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { Props } from './GroupTableBody.types';
3
- declare function GroupTableBody<T extends unknown>({ group, columns, rowKey, selection, allItems, expanded, expandGroup, addItem, activeGroup, hideGroupExpander, }: Props<T>): JSX.Element;
2
+ import { type Props } from './GroupTableBody.types';
3
+ declare function GroupTableBody<T>({ group, columns, rowKey, selection, allItems, expanded, expandGroup, addItem, activeGroup, hideGroupExpander, }: Props<T>): JSX.Element;
4
4
  export default GroupTableBody;
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
- import Checkbox from '@synerise/ds-checkbox';
3
- import Status from '@synerise/ds-status';
4
2
  import Button from '@synerise/ds-button';
3
+ import Checkbox from '@synerise/ds-checkbox';
5
4
  import Icon, { AddS } from '@synerise/ds-icon';
5
+ import Status from '@synerise/ds-status';
6
+ import { useRowKey } from '../../hooks/useRowKey';
6
7
  import * as S from '../GroupTable.styles';
7
8
  import { GROUP_BY } from '../GroupTable.types';
8
- import { useRowKey } from '../../hooks/useRowKey';
9
9
  function GroupTableBody(_ref) {
10
10
  var group = _ref.group,
11
11
  columns = _ref.columns,
@@ -53,7 +53,7 @@ function GroupTableBody(_ref) {
53
53
  indeterminate: selectedRowsNumber > 0 && selectedRowsNumber < allRowKeys.length,
54
54
  onChange: function onChange(event) {
55
55
  if (event.target.checked) {
56
- var selectedKeys = Array.from(new Set([].concat(selection == null ? void 0 : selection.selectedRowKeys, allRowKeys)));
56
+ var selectedKeys = Array.from(new Set([].concat((selection == null ? void 0 : selection.selectedRowKeys) || [], allRowKeys)));
57
57
  selection.onChange(selectedKeys, allItems.filter(function (item) {
58
58
  return selectedKeys.indexOf(getRowKey(item)) >= 0;
59
59
  }));
@@ -1,7 +1,7 @@
1
- import React from 'react';
2
- import { RowSelection } from '../../Table.types';
3
- import { GroupColumnsType, GroupType } from '../GroupTable.types';
4
- export interface Props<T extends unknown> {
1
+ import type React from 'react';
2
+ import { type RowSelection } from '../../Table.types';
3
+ import { type GroupColumnsType, type GroupType } from '../GroupTable.types';
4
+ export interface Props<T> {
5
5
  group: any;
6
6
  rowKey: string | Function | undefined;
7
7
  selection?: RowSelection<T>;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { Props } from './GroupTableHeader.types';
3
- declare function GroupTableHeader<T extends unknown>({ header, activeColumnKey, sortColumn }: Props<T>): JSX.Element;
2
+ import { type Props } from './GroupTableHeader.types';
3
+ declare function GroupTableHeader<T>({ header, activeColumnKey, sortColumn, }: Props<T>): JSX.Element;
4
4
  export default GroupTableHeader;
@@ -1,4 +1,4 @@
1
- export interface Props<T extends unknown> {
1
+ export interface Props<T> {
2
2
  header: any;
3
3
  activeColumnKey?: string;
4
4
  sortColumn: (column: T) => void;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ButtonProps } from '@synerise/ds-button';
2
+ import { type ButtonProps } from '@synerise/ds-button';
3
3
  export declare const BackToTopButton: (props: ButtonProps & {
4
4
  isSticky?: boolean;
5
5
  }) => React.ReactElement;
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import Alert from '@synerise/ds-alert';
3
3
  import Button from '@synerise/ds-button';
4
4
  import Icon, { RefreshM } from '@synerise/ds-icon';
5
- import * as S from './ErrorItem.styles';
6
5
  import { useTableLocaleContext } from '../utils/locale';
6
+ import * as S from './ErrorItem.styles';
7
7
  export var ErrorItem = function ErrorItem(_ref) {
8
8
  var onRetryClick = _ref.onRetryClick;
9
9
  var tableLocale = useTableLocaleContext();
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { LoaderItemProps } from './InfiniteLoaderItem.types';
2
+ import { type LoaderItemProps } from './InfiniteLoaderItem.types';
3
3
  declare const InfiniteLoaderItem: ({ infiniteScroll, position }: LoaderItemProps) => React.JSX.Element;
4
4
  export default InfiniteLoaderItem;
@@ -1,8 +1,8 @@
1
1
  import React, { useEffect } from 'react';
2
- import { infiniteScrollPropsToState } from './utils';
3
2
  import { ErrorItem } from './ErrorItem';
4
3
  import { LoadingItem } from './LoadingItem';
5
4
  import { NoMoreItem } from './NoMoreItem';
5
+ import { infiniteScrollPropsToState } from './utils';
6
6
  var InfiniteLoaderItem = function InfiniteLoaderItem(_ref) {
7
7
  var infiniteScroll = _ref.infiniteScroll,
8
8
  position = _ref.position;
@@ -17,7 +17,7 @@ var InfiniteLoaderItem = function InfiniteLoaderItem(_ref) {
17
17
  } : undefined;
18
18
 
19
19
  // @ts-expect-error TS7030: Not all code paths return a value
20
- // eslint-disable-next-line consistent-return
20
+
21
21
  useEffect(function () {
22
22
  if (!isLoading && hasMore) {
23
23
  if ((!position || position === 'BOTTOM') && typeof onScrollEndReach === 'function') {
@@ -1,4 +1,4 @@
1
- import { ReactElement } from 'react';
1
+ import { type ReactElement } from 'react';
2
2
  export type LoaderItemPosition = 'TOP' | 'BOTTOM';
3
3
  export type InfiniteScrollState = {
4
4
  hasError: boolean;
@@ -1,3 +1,3 @@
1
- import React, { MutableRefObject } from 'react';
1
+ import React, { type MutableRefObject } from 'react';
2
2
  declare const OuterListElement: (containerRef: MutableRefObject<HTMLDivElement | null | undefined>, isSticky: boolean) => React.ForwardRefExoticComponent<React.HTMLAttributes<Element> & React.RefAttributes<HTMLDivElement>>;
3
3
  export default OuterListElement;
@@ -1,7 +1,7 @@
1
1
  var _excluded = ["height"];
2
2
  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); }
3
3
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
- import React, { useCallback, useState, forwardRef, useEffect } from 'react';
4
+ import React, { forwardRef, useCallback, useEffect, useState } from 'react';
5
5
  import Scrollbar from '@synerise/ds-scrollbar';
6
6
  var OuterListElement = function OuterListElement(containerRef, isSticky) {
7
7
  return /*#__PURE__*/forwardRef(function (_ref, ref) {
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { InfiniteScrollProps, InfiniteScrollState } from './InfiniteLoaderItem.types';
2
+ import { type InfiniteScrollProps, type InfiniteScrollState } from './InfiniteLoaderItem.types';
3
3
  export declare const infiniteScrollPropsToState: ({ hasError, hasMore, isLoading, }: InfiniteScrollProps & InfiniteScrollState) => InfiniteScrollState;
4
4
  declare const _default: {
5
5
  infiniteScrollPropsToState: ({ hasError, hasMore, isLoading, }: InfiniteScrollState & {
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { Props } from './ItemsMenu.types';
2
+ import { type Props } from './ItemsMenu.types';
3
3
  declare const ItemsMenu: ({ children }: Props) => React.JSX.Element;
4
4
  export default ItemsMenu;
@@ -1,6 +1,4 @@
1
1
  import styled from 'styled-components';
2
-
3
- // eslint-disable-next-line import/prefer-default-export
4
2
  export var ItemsMenu = styled.div.withConfig({
5
3
  displayName: "ItemsMenustyles__ItemsMenu",
6
4
  componentId: "sc-zmeifj-0"
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { RowSelectionProps } from './RowSelectionColumn.types';
3
- import { RowType } from '../Table.types';
2
+ import { type RowType } from '../Table.types';
3
+ import { type RowSelectionProps } from './RowSelectionColumn.types';
4
4
  export declare function RowSelectionColumn<T extends object & RowType<T>>({ rowKey, record, limit, independentSelectionExpandedRows, selectedRowKeys, selectedRecords, tableLocale, onChange, checkRowSelectionStatus, childrenColumnName, }: RowSelectionProps<T>): React.JSX.Element | null;
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback, useMemo } from 'react';
2
- import Tooltip from '@synerise/ds-tooltip';
3
2
  import Button from '@synerise/ds-button';
3
+ import Tooltip from '@synerise/ds-tooltip';
4
4
  import { useRowKey } from '../hooks/useRowKey';
5
5
  import { getRecordSelectionStatus, isRecordSelectable } from '../utils';
6
6
  export function RowSelectionColumn(_ref) {
@@ -1,6 +1,6 @@
1
+ import { type TableProps } from 'rc-table/lib/Table';
1
2
  import type { Key } from 'react';
2
- import { TableProps } from 'rc-table/lib/Table';
3
- import { DSTableProps, RowSelection } from '../Table.types';
3
+ import { type DSTableProps, type RowSelection } from '../Table.types';
4
4
  export type RowSelectionProps<T> = {
5
5
  rowKey: TableProps<T>['rowKey'];
6
6
  independentSelectionExpandedRows?: boolean;
package/dist/Table.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import '@synerise/ds-core/dist/js/style';
3
+ import { type DSTableProps } from './Table.types';
3
4
  import './style/index.less';
4
- import { DSTableProps } from './Table.types';
5
5
  declare const DSTable: {
6
6
  <T extends object>(props: DSTableProps<T>): React.JSX.Element;
7
7
  SELECTION_ALL: string;
package/dist/Table.js CHANGED
@@ -1,18 +1,18 @@
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, { useCallback, useMemo } from 'react';
3
3
  import { useIntl } from 'react-intl';
4
+ import Button from '@synerise/ds-button';
4
5
  import '@synerise/ds-core/dist/js/style';
6
+ import { useDataFormat } from '@synerise/ds-data-format';
5
7
  import Icon, { AngleLeftS, AngleRightS } from '@synerise/ds-icon';
6
- import Button from '@synerise/ds-button';
7
8
  import Skeleton from '@synerise/ds-skeleton';
8
- import { useDataFormat } from '@synerise/ds-data-format';
9
- import "./style/index.css";
10
- import * as S from './Table.styles';
11
- import TableHeader from './TableHeader/TableHeader';
12
9
  import DefaultTable from './DefaultTable/DefaultTable';
13
10
  import GroupTable from './GroupTable/GroupTable';
14
- import { useTableLocale, TableLocaleContext, getChildrenColumnName, getSkeletonProps, isGrouped } from './utils';
15
- import { SELECTION_INVERT, SELECTION_ALL, ITEM_RENDER_TYPE } from './constants/Table.constants';
11
+ import * as S from './Table.styles';
12
+ import TableHeader from './TableHeader/TableHeader';
13
+ import { ITEM_RENDER_TYPE, SELECTION_ALL, SELECTION_INVERT } from './constants/Table.constants';
14
+ import "./style/index.css";
15
+ import { TableLocaleContext, getChildrenColumnName, getSkeletonProps, isGrouped, useTableLocale } from './utils';
16
16
  var DSTable = function DSTable(props) {
17
17
  var intl = useIntl();
18
18
  var title = props.title,
@@ -134,7 +134,7 @@ var DSTable = function DSTable(props) {
134
134
  disableColumnNamesLineBreak: disableColumnNamesLineBreak
135
135
  }, !loading && grouped && dataSource != null && dataSource.length ?
136
136
  /*#__PURE__*/
137
- // @ts-ignore
137
+ // @ts-expect-error type 'T' does not satisfy the constraint 'GroupType<T>'.
138
138
  React.createElement(GroupTable, _extends({}, props, {
139
139
  locale: tableLocale,
140
140
  title: renderHeader,
@@ -5,7 +5,7 @@ export declare const Header: import("styled-components").StyledComponent<"div",
5
5
  }, never>;
6
6
  export declare const Size: import("styled-components").StyledComponent<"div", any, {}, never>;
7
7
  export declare const TitleContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
8
- export declare const TitlePartEllipsis: import("styled-components").StyledComponent<({ size, className, children, ellipsis }: {
8
+ export declare const TitlePartEllipsis: import("styled-components").StyledComponent<({ size, className, children, ellipsis, }: {
9
9
  size?: import("@synerise/ds-typography").TextSize | undefined;
10
10
  ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps | undefined;
11
11
  children?: import("react").ReactNode;
@@ -31,7 +31,7 @@ export declare const TableWrapper: import("styled-components").StyledComponent<"
31
31
  hideColumnNames?: boolean | undefined;
32
32
  disableColumnNamesLineBreak?: boolean | undefined;
33
33
  }, never>;
34
- export declare const Skeleton: import("styled-components").StyledComponent<({ size, numberOfSkeletons, width, height, className }: import("@synerise/ds-skeleton").SkeletonProps) => import("react").JSX.Element, any, {
34
+ export declare const Skeleton: import("styled-components").StyledComponent<({ size, numberOfSkeletons, width, height, className, }: import("@synerise/ds-skeleton").SkeletonProps) => import("react").JSX.Element, any, {
35
35
  skeletonWidth?: string | undefined;
36
36
  }, never>;
37
37
  export declare const TableSkeletonCell: import("styled-components").StyledComponent<"div", any, {
@@ -1,9 +1,9 @@
1
1
  import styled, { keyframes } from 'styled-components';
2
- import { macro, Text } from '@synerise/ds-typography';
3
2
  import { CheckboxWrapper } from '@synerise/ds-checkbox/dist/Checkbox.styles';
4
- import Menu from '@synerise/ds-menu';
5
3
  import { IconContainer } from '@synerise/ds-icon';
4
+ import Menu from '@synerise/ds-menu';
6
5
  import DSSkeleton from '@synerise/ds-skeleton';
6
+ import { Text, macro } from '@synerise/ds-typography';
7
7
  export var Header = styled.div.withConfig({
8
8
  displayName: "Tablestyles__Header",
9
9
  componentId: "sc-dacfhr-0"
@@ -92,7 +92,7 @@ export var Spinner = styled.div.withConfig({
92
92
  export var TableWrapper = styled.div.withConfig({
93
93
  displayName: "Tablestyles__TableWrapper",
94
94
  componentId: "sc-dacfhr-15"
95
- })(["table{.ant-table-thead{", ";}}.ant-table-wrapper .ant-table{z-index:1;}.ant-table .ant-table-cell.ant-table-selection-column,.ant-table .ant-table-cell.ds-table-star-column{padding:0 8px 0 24px;& > button{display:inline-block;}}.ant-table .ant-table-cell.ant-table-selection-column + .ant-table-cell.ds-table-star-column{padding-left:0;}.ant-table .ant-table-thead th{transition:background 0.3s,border-color 0.3s;background-color:", ";border-bottom-color:", ";&.ant-table-column-has-sorters{cursor:default;}&.ant-table-column-has-sorters:hover{background-color:", ";border-bottom:2px solid ", ";> *{margin-bottom:-1px;}}> *{display:flex;width:100%;}[class^='ant-table-column-sorters']{width:100%;}&.ant-table-column-sort{background-color:", ";border-bottom:2px solid ", ";&:hover{background-color:", ";border-bottom:2px solid ", ";}& > [class^='ant-table-column-sorters']{overflow:hidden;}> *{margin-bottom:-1px;}}&.ant-table-cell-ellipsis.ant-table-column-has-sorters{overflow:visible;}&:not(.ds-table-column-sort){.ds-table-column-sorter{margin-left:8px;}}&.ds-table-active-column{background-color:", ";border-bottom:2px solid ", ";cursor:default;&:hover{background-color:", ";border-bottom:2px solid ", ";}.ant-table-column-sorter{display:none;}> *{margin-bottom:-1px;}}}.ant-table tr.ant-table-row:not(:hover) td.ant-table-column-sort{background-color:", ";}.ant-table .ant-table-column-sorter{margin-left:8px;max-width:32px;min-width:32px;}.ant-table-cell .ds-sort-dropdown-button{opacity:0;}.ant-table-cell:hover .ds-sort-dropdown-button,.ant-table-cell.ant-table-column-sort .ds-sort-dropdown-button{opacity:1;}.ant-table-wrapper.virtual-table.virtual-table-infinite-scroll .ant-table .ant-table-header{box-shadow:0 4px 12px 0 rgba(35,41,54,0.04);}.virtual-table:not(.with-sticky-header) .ant-table-container{overflow:auto hidden;}.virtual-table .virtual-table-row:not(:hover) .virtual-table-cell.ant-table-column-sort{background-color:", ";}& .ant-table .ant-table-cell-scrollbar{box-shadow:none;}& .ant-table th.ant-table-cell{white-space:", ";}&&& .ant-table-thead > tr > th:not(:last-child):not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan])::before{position:relative;}"], function (props) {
95
+ })(["table{.ant-table-thead{", ";}}.ant-table-wrapper .ant-table{z-index:1;}.ant-table .ant-table-cell.ant-table-selection-column,.ant-table .ant-table-cell.ds-table-star-column{padding:0 8px 0 24px;& > button{display:inline-block;}}.ant-table .ant-table-cell.ant-table-selection-column + .ant-table-cell.ds-table-star-column{padding-left:0;}.ant-table .ant-table-thead th{transition:background 0.3s,border-color 0.3s;background-color:", ";border-bottom-color:", ";&.ant-table-column-has-sorters{cursor:default;}&.ant-table-column-has-sorters:hover{background-color:", ";border-bottom:2px solid ", ";> *{margin-bottom:-1px;}}> *{display:flex;width:100%;}[class^='ant-table-column-sorters']{width:100%;}&.ant-table-column-sort{background-color:", ";border-bottom:2px solid ", ";&:hover{background-color:", ";border-bottom:2px solid ", ";}& > [class^='ant-table-column-sorters']{overflow:hidden;}> *{margin-bottom:-1px;}}&.ant-table-cell-ellipsis.ant-table-column-has-sorters{overflow:visible;}&:not(.ds-table-column-sort){.ds-table-column-sorter{margin-left:8px;}}&.ds-table-active-column{background-color:", ";border-bottom:2px solid ", ";cursor:default;&:hover{background-color:", ";border-bottom:2px solid ", ";}.ant-table-column-sorter{display:none;}> *{margin-bottom:-1px;}}}.ant-table tr.ant-table-row:not(:hover) td.ant-table-column-sort{background-color:", ";}.ant-table .ant-table-column-sorter{margin-left:8px;max-width:32px;min-width:32px;}.ant-table-cell .ds-sort-dropdown-button{opacity:0;}.ant-table-cell:hover .ds-sort-dropdown-button,.ant-table-cell.ant-table-column-sort .ds-sort-dropdown-button{opacity:1;}.ant-table-wrapper.virtual-table.virtual-table-infinite-scroll .ant-table .ant-table-header{box-shadow:0 4px 12px 0 rgba(35,41,54,0.04);}.virtual-table:not(.with-sticky-header) .ant-table-container{overflow:auto hidden;}.virtual-table .virtual-table-row:not(:hover) .virtual-table-cell.ant-table-column-sort{background-color:", ";}& .ant-table .ant-table-cell-scrollbar{box-shadow:none;}& .ant-table th.ant-table-cell{white-space:", ";}&&& .ant-table-thead > tr > th:not(:last-child):not(.ant-table-selection-column):not( .ant-table-row-expand-icon-cell ):not([colspan])::before{position:relative;}"], function (props) {
96
96
  return props.hideColumnNames ? 'display: none' : '';
97
97
  }, function (_ref3) {
98
98
  var theme = _ref3.theme;
@@ -149,7 +149,7 @@ export var TableSkeletonCell = styled.div.withConfig({
149
149
  displayName: "Tablestyles__TableSkeletonCell",
150
150
  componentId: "sc-dacfhr-17"
151
151
  })(["display:flex;height:", ";width:", ";align-items:center;justify-content:flex-start;"], function (props) {
152
- return props.height + "px" || 'auto';
152
+ return props.height ? props.height + "px" : 'auto';
153
153
  }, function (props) {
154
154
  return "" + props.width || '50%';
155
155
  });
@@ -1,12 +1,12 @@
1
- import type { Key, ReactNode, Ref } from 'react';
2
1
  import type { ColumnType, TableProps } from 'antd/lib/table';
3
2
  import type { TableLocale, TableRowSelection } from 'antd/lib/table/interface';
3
+ import type { Key, ReactNode, Ref } from 'react';
4
4
  import type { LiteralStringUnion } from '@synerise/ds-utils';
5
- import type DSTable from './Table';
6
- import type { GroupType } from './GroupTable/GroupTable.types';
7
- import type { RowStar } from './hooks/useRowStar';
8
5
  import type { SortRender } from './ColumnSortMenu/TitleWithSort';
9
6
  import type { ColumnSortOrder, ColumnsSortState } from './ColumnSortMenu/useSortState';
7
+ import type { GroupType } from './GroupTable/GroupTable.types';
8
+ import type DSTable from './Table';
9
+ import type { RowStar } from './hooks/useRowStar';
10
10
  export type AntTableProps<T> = Omit<TableProps<T>, 'title' | 'subTitle' | 'onSearch' | 'itemsMenu' | 'search' | 'locale' | 'columns' | 'loading'>;
11
11
  export type Selection = {
12
12
  key: string;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { Props } from './TableHeader.types';
2
+ import { type Props } from './TableHeader.types';
3
3
  declare const TableHeader: <T extends object>({ title, filters, searchComponent, filterComponent, selectedRows, itemsMenu, selection, dataSource, dataSourceFull, dataSourceTotalCount, isCounterLoading, rowKey, withBorderTop, headerButton, locale, renderSelectionTitle, hideTitlePart, childrenColumnName, isLoading, }: Props<T>) => React.JSX.Element;
4
4
  export default TableHeader;
@@ -1,10 +1,10 @@
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
3
  import { useDataFormat } from '@synerise/ds-data-format';
4
- import * as S from '../Table.styles';
5
4
  import FilterTrigger from '../FilterTrigger/FilterTrigger';
6
- import TableSelection from './TableSelection';
5
+ import * as S from '../Table.styles';
7
6
  import { TableLimit } from './TableLimit';
7
+ import TableSelection from './TableSelection';
8
8
  var TableHeader = function TableHeader(_ref) {
9
9
  var title = _ref.title,
10
10
  filters = _ref.filters,
@@ -62,7 +62,7 @@ var TableHeader = function TableHeader(_ref) {
62
62
  selection: selection,
63
63
  locale: locale,
64
64
  childrenColumnName: childrenColumnName
65
- }), renderSelectionTitle ? /*#__PURE__*/React.createElement(React.Fragment, null, renderSelectionTitle(selection, filters)) : /*#__PURE__*/React.createElement(S.TitleContainer, null, /*#__PURE__*/React.createElement(S.TitlePart, null, /*#__PURE__*/React.createElement("strong", null, formatValue(selectedRows)), " ", /*#__PURE__*/React.createElement("span", null, locale.selected))), itemsMenu) : /*#__PURE__*/React.createElement(S.Left, {
65
+ }), renderSelectionTitle ? /*#__PURE__*/React.createElement(React.Fragment, null, renderSelectionTitle(selection, filters)) : /*#__PURE__*/React.createElement(S.TitleContainer, null, /*#__PURE__*/React.createElement(S.TitlePart, null, /*#__PURE__*/React.createElement("strong", null, formatValue(selectedRows)), ' ', /*#__PURE__*/React.createElement("span", null, locale.selected))), itemsMenu) : /*#__PURE__*/React.createElement(S.Left, {
66
66
  "data-testid": "ds-table-title"
67
67
  }, selection && !isLoading && !hideSelectAll && /*#__PURE__*/React.createElement(TableSelection, {
68
68
  rowKey: rowKey,
@@ -102,8 +102,7 @@ var TableHeader = function TableHeader(_ref) {
102
102
  name: filter.key,
103
103
  iconComponent: filter.icon,
104
104
  tooltips: filter.tooltips,
105
- openedLabel: filter.openedLabel
106
- /* eslint-disable-next-line react/jsx-handler-names */,
105
+ openedLabel: filter.openedLabel,
107
106
  handleClear: filter.handleClear,
108
107
  show: filter.show,
109
108
  showList: filter.showList,
@@ -1,5 +1,5 @@
1
- import { ReactNode } from 'react';
2
- import { Filter, Locale, RowSelection } from '../Table.types';
1
+ import { type ReactNode } from 'react';
2
+ import { type Filter, type Locale, type RowSelection } from '../Table.types';
3
3
  export type Props<T extends object> = {
4
4
  title?: ReactNode | (() => ReactNode);
5
5
  filters?: Filter[];
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { TableLimitProps } from './TableLimit.types';
2
+ import { type TableLimitProps } from './TableLimit.types';
3
3
  export declare function TableLimit<T extends {
4
4
  children?: T[];
5
5
  }>({ total, locale, itemsMenu, selection, isCounterLoading, }: TableLimitProps<T>): React.JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import Alert from '@synerise/ds-alert';
3
3
  import { useDataFormat } from '@synerise/ds-data-format';
4
- import * as S from './TableLimit.styles';
5
4
  import { Skeleton } from '../../Table.styles';
5
+ import * as S from './TableLimit.styles';
6
6
  export function TableLimit(_ref) {
7
7
  var total = _ref.total,
8
8
  locale = _ref.locale,
@@ -24,7 +24,7 @@ export function TableLimit(_ref) {
24
24
  }, [locale, selectedRows, limit]);
25
25
  var selected = useMemo(function () {
26
26
  var _locale$pagination;
27
- return selectedRows > 0 ? /*#__PURE__*/React.createElement(S.Title, null, /*#__PURE__*/React.createElement("strong", null, formatValue(selectedRows) + " / " + formatValue(limit)), " ", locale.selected) : /*#__PURE__*/React.createElement(S.Title, null, isCounterLoading ? /*#__PURE__*/React.createElement(Skeleton, {
27
+ return selectedRows > 0 ? /*#__PURE__*/React.createElement(S.Title, null, /*#__PURE__*/React.createElement("strong", null, formatValue(selectedRows) + " / " + formatValue(limit)), ' ', locale.selected) : /*#__PURE__*/React.createElement(S.Title, null, isCounterLoading ? /*#__PURE__*/React.createElement(Skeleton, {
28
28
  numberOfSkeletons: 1,
29
29
  size: "S",
30
30
  skeletonWidth: "100px"
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { RequiredProps } from '@synerise/ds-utils';
3
- import { Locale, RowSelection } from '../../Table.types';
3
+ import { type Locale, type RowSelection } from '../../Table.types';
4
4
  export type TableLimitProps<T extends object> = {
5
5
  selection: RequiredProps<RowSelection<T>, 'limit'>;
6
6
  total: number;
@@ -1,14 +1,14 @@
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, { useCallback, useMemo } from 'react';
3
- import Dropdown from '@synerise/ds-dropdown';
4
3
  import Button from '@synerise/ds-button';
5
- import Tooltip from '@synerise/ds-tooltip';
4
+ import Dropdown from '@synerise/ds-dropdown';
6
5
  import Icon, { OptionVerticalM } from '@synerise/ds-icon';
6
+ import Tooltip from '@synerise/ds-tooltip';
7
7
  import * as S from '../Table.styles';
8
8
  import { SELECTION_ALL, SELECTION_INVERT } from '../constants/Table.constants';
9
- import { isRecordSelectable } from '../utils';
10
- import { useRowKey } from '../hooks/useRowKey';
11
9
  import { useBulkSelectionCount } from '../hooks/useBulkSelection';
10
+ import { useRowKey } from '../hooks/useRowKey';
11
+ import { isRecordSelectable } from '../utils';
12
12
  var TableSelection = function TableSelection(_ref) {
13
13
  var dataSource = _ref.dataSource,
14
14
  dataSourceFull = _ref.dataSourceFull,
@@ -121,7 +121,9 @@ var TableSelection = function TableSelection(_ref) {
121
121
  if (!selectableChildren || selection.independentSelectionExpandedRows) {
122
122
  var key = getRowKey(record);
123
123
  var isSelectable = isRecordSelectable(record, checkRowSelectionStatus);
124
- if (!isSelectable) return;
124
+ if (!isSelectable) {
125
+ return;
126
+ }
125
127
  if (selectedRowKeys.includes(key)) {
126
128
  keys.splice(keys.indexOf(key), 1);
127
129
  } else {
@@ -1,4 +1,4 @@
1
- import type { RowSelection, Locale } from '../Table.types';
1
+ import type { Locale, RowSelection } from '../Table.types';
2
2
  export type TableSelectionProps<T extends object> = {
3
3
  selection?: RowSelection<T>;
4
4
  dataSource: readonly T[];
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import '@synerise/ds-core/dist/js/style';
3
- import { DSTableProps } from '../Table.types';
3
+ import { type DSTableProps } from '../Table.types';
4
4
  declare function TreeTable<T extends object = any>(props: DSTableProps<T>): React.ReactElement;
5
5
  export default TreeTable;
@@ -1,11 +1,11 @@
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
- import React from 'react';
3
- import '@synerise/ds-core/dist/js/style';
4
2
  import classNames from 'classnames';
3
+ import React from 'react';
4
+ import { v4 as uuid } from 'uuid';
5
5
  import Button from '@synerise/ds-button';
6
- import Icon, { ChildRowLeftDownM } from '@synerise/ds-icon';
7
6
  import { theme } from '@synerise/ds-core';
8
- import { v4 as uuid } from 'uuid';
7
+ import '@synerise/ds-core/dist/js/style';
8
+ import Icon, { ChildRowLeftDownM } from '@synerise/ds-icon';
9
9
  import DSTable from '../Table';
10
10
  import * as S from './TreeTable.styles';
11
11
  var INDENT_SIZE = 42;
@@ -1,7 +1,9 @@
1
1
  import styled from 'styled-components';
2
2
  var LEVELS = ['yellow', 'green', 'cyan', 'violet', 'orange', 'purple', 'blue', 'grey'];
3
3
  var getColor = function getColor(active, level) {
4
- if (level === LEVELS.indexOf('cyan') && active) return '500';
4
+ if (level === LEVELS.indexOf('cyan') && active) {
5
+ return '500';
6
+ }
5
7
  return active ? '600' : '200';
6
8
  };
7
9
  export var Indents = styled.div.withConfig({
@@ -1,6 +1,6 @@
1
- import type { Ref, ReactElement } from 'react';
1
+ import { type ReactElement, type Ref } from 'react';
2
2
  import type { RowType } from '../Table.types';
3
- import type { VirtualTableRef, VirtualTableProps } from './VirtualTable.types';
3
+ import type { VirtualTableProps, VirtualTableRef } from './VirtualTable.types';
4
4
  import { EXPANDED_ROW_PROPERTY } from './constants';
5
5
  type VirtualTableType = <T extends object & RowType<T> & {
6
6
  [EXPANDED_ROW_PROPERTY]?: boolean;