@synerise/ds-table 1.6.1 → 1.6.4

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,33 @@
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.6.4](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@1.6.3...@synerise/ds-table@1.6.4) (2025-10-01)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **table:** updated batch checkbox change logic ([666bb54](https://github.com/synerise/synerise-design/commit/666bb54ed31e6d8417fedc3a9281b81643fd8bbd))
12
+
13
+
14
+
15
+
16
+
17
+ ## [1.6.3](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@1.6.2...@synerise/ds-table@1.6.3) (2025-09-30)
18
+
19
+ **Note:** Version bump only for package @synerise/ds-table
20
+
21
+
22
+
23
+
24
+
25
+ ## [1.6.2](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@1.6.1...@synerise/ds-table@1.6.2) (2025-09-30)
26
+
27
+ **Note:** Version bump only for package @synerise/ds-table
28
+
29
+
30
+
31
+
32
+
6
33
  ## [1.6.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@1.6.0...@synerise/ds-table@1.6.1) (2025-09-26)
7
34
 
8
35
  **Note:** Version bump only for package @synerise/ds-table
package/README.md CHANGED
@@ -91,16 +91,17 @@ This type of table requires a specific type of dataSource which has to contain a
91
91
  | groupType | Type of active grouping | `value` / `ranges` / `interval` / undefined | - |
92
92
 
93
93
  #### RowSelection
94
+ | Property | Description | Type | Default |
95
+ |----------------------------------|--------------------------------------------------------|-----------------------------------------------------------------|---------|
96
+ | fixed | Whether to show selection column as fixed or not | boolean | - |
97
+ | selectedRowKeys | Array of selected row keys | React.ReactText | [] |
98
+ | selections | Selections options available in table title | SelectionItem[] | - |
99
+ | onChange | Callback executed when selection changes | (selectedRowKeys: React.ReactText[], selectedRows: T[]) => void | - |
100
+ | limit | Max length of selection rows array | number | - |
101
+ | independentSelectionExpandedRows | Allows to select parent and child rows independently | boolean | - |
102
+ | checkRowSelectionStatus | Validator function record selection status | (record: T) => SelectionStatus | - |
103
+ | globalSelection | Global selection config (for use with infinite loader) | { isSelected: boolean; onChange: (selected: boolean) => void; } | - |
94
104
 
95
- | Property | Description | Type | Default |
96
- | -------------------------------- | ---------------------------------------------------- | --------------------------------------------------------------- | ------- |
97
- | fixed | Whether to show selection column as fixed or not | boolean | - |
98
- | selectedRowKeys | Array of selected row keys | React.ReactText | [] |
99
- | selections | Selections options available in table title | SelectionItem[] | - |
100
- | onChange | Callback executed when selection changes | (selectedRowKeys: React.ReactText[], selectedRows: T[]) => void | - |
101
- | limit | Max length of selection rows array | number | - |
102
- | independentSelectionExpandedRows | Allows to select parent and child rows independently | boolean | - |
103
- | checkRowSelectionStatus | Validator function record selection status | (record: T) => SelectionStatus | - |
104
105
 
105
106
  #### SelectionStatus
106
107
 
@@ -10,7 +10,7 @@ import { useBulkSelectionCount } from '../hooks/useBulkSelection';
10
10
  import { useRowKey } from '../hooks/useRowKey';
11
11
  import { isRecordSelectable } from '../utils';
12
12
  var TableSelection = function TableSelection(_ref) {
13
- var _selection$globalSele5, _selection$globalSele7;
13
+ var _selection$globalSele7;
14
14
  var dataSource = _ref.dataSource,
15
15
  dataSourceFull = _ref.dataSourceFull,
16
16
  selection = _ref.selection,
@@ -162,15 +162,14 @@ var TableSelection = function TableSelection(_ref) {
162
162
  var isAllSelected = !disabledBulkSelection && selectableRecordsCount === selectableAndSelectedRecordsCount;
163
163
  var isAnySelected = allRecordsCount > 0 && selectedRecordsCount > 0;
164
164
  var selectionTooltipTitle = useMemo(function () {
165
- var _selection$globalSele4;
166
- if ((_selection$globalSele4 = selection.globalSelection) != null && _selection$globalSele4.isSelected) {
167
- return locale == null ? void 0 : locale.unselectGlobalAll;
165
+ if (selection.globalSelection) {
166
+ return selection.globalSelection.isSelected ? locale == null ? void 0 : locale.unselectGlobalAll : locale == null ? void 0 : locale.selectGlobalAll;
168
167
  }
169
168
  return isAllSelected ? locale == null ? void 0 : locale.unselectAll : locale == null ? void 0 : locale.selectAllTooltip;
170
- }, [isAllSelected, locale == null ? void 0 : locale.selectAllTooltip, locale == null ? void 0 : locale.unselectAll, locale == null ? void 0 : locale.unselectGlobalAll, (_selection$globalSele5 = selection.globalSelection) == null ? void 0 : _selection$globalSele5.isSelected]);
169
+ }, [isAllSelected, locale == null ? void 0 : locale.selectAllTooltip, locale == null ? void 0 : locale.selectGlobalAll, locale == null ? void 0 : locale.unselectAll, locale == null ? void 0 : locale.unselectGlobalAll, selection.globalSelection]);
171
170
  var menuDataSource = useMemo(function () {
172
- var _selection$globalSele6, _selection$selections;
173
- var isGlobalAllSelected = (_selection$globalSele6 = selection.globalSelection) == null ? void 0 : _selection$globalSele6.isSelected;
171
+ var _selection$globalSele4, _selection$selections;
172
+ var isGlobalAllSelected = (_selection$globalSele4 = selection.globalSelection) == null ? void 0 : _selection$globalSele4.isSelected;
174
173
  var globalSelectionItem = selection.globalSelection ? [isGlobalAllSelected ? {
175
174
  onClick: unselectGlobalAll,
176
175
  text: locale == null ? void 0 : locale.unselectGlobalAll
@@ -215,6 +214,15 @@ var TableSelection = function TableSelection(_ref) {
215
214
  });
216
215
  return [].concat(globalSelectionItem, menuItems || []);
217
216
  }, [selection.globalSelection, selection == null ? void 0 : selection.selections, unselectGlobalAll, locale == null ? void 0 : locale.unselectGlobalAll, locale == null ? void 0 : locale.selectGlobalAll, locale == null ? void 0 : locale.selectAll, locale == null ? void 0 : locale.unselectAll, locale == null ? void 0 : locale.selectInvert, selectGlobalAll, isAllSelected, hasSelectionLimit, isAnySelected, selectAll, unselectAll, selectInvert]);
217
+ var handleBatchSelectionChange = function handleBatchSelectionChange() {
218
+ var _selection$globalSele5, _selection$globalSele6;
219
+ var isSelected = (_selection$globalSele5 = (_selection$globalSele6 = selection.globalSelection) == null ? void 0 : _selection$globalSele6.isSelected) != null ? _selection$globalSele5 : isAllSelected;
220
+ if (selection.globalSelection) {
221
+ isSelected ? unselectGlobalAll() : selectGlobalAll();
222
+ } else {
223
+ isSelected ? unselectAll() : selectAll();
224
+ }
225
+ };
218
226
  return selection != null && selection.selectedRowKeys ? /*#__PURE__*/React.createElement(S.Selection, {
219
227
  "data-popup-container": true
220
228
  }, !hasSelectionLimit && /*#__PURE__*/React.createElement(Tooltip, {
@@ -223,16 +231,7 @@ var TableSelection = function TableSelection(_ref) {
223
231
  disabled: disabledBulkSelection,
224
232
  "data-testid": "ds-table-batch-selection-button",
225
233
  checked: ((_selection$globalSele7 = selection.globalSelection) == null ? void 0 : _selection$globalSele7.isSelected) || isAllSelected,
226
- onChange: function onChange() {
227
- var _selection$globalSele8;
228
- if ((_selection$globalSele8 = selection.globalSelection) != null && _selection$globalSele8.isSelected) {
229
- unselectGlobalAll();
230
- } else if (!isAllSelected) {
231
- selectAll();
232
- } else {
233
- unselectAll();
234
- }
235
- },
234
+ onChange: handleBatchSelectionChange,
236
235
  indeterminate: isIndeterminate
237
236
  })), (selection.selections || !!(menuDataSource != null && menuDataSource.length)) && /*#__PURE__*/React.createElement(Dropdown, {
238
237
  disabled: disabledBulkSelection || (menuDataSource == null ? void 0 : menuDataSource.length) === 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-table",
3
- "version": "1.6.1",
3
+ "version": "1.6.4",
4
4
  "description": "Table UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "synerise/synerise-design",
@@ -38,22 +38,22 @@
38
38
  "@synerise/ds-alert": "^1.1.20",
39
39
  "@synerise/ds-badge": "^1.0.23",
40
40
  "@synerise/ds-button": "^1.4.12",
41
- "@synerise/ds-button-group": "^1.1.17",
41
+ "@synerise/ds-button-group": "^1.1.19",
42
42
  "@synerise/ds-checkbox": "^1.1.9",
43
- "@synerise/ds-dropdown": "^1.0.26",
43
+ "@synerise/ds-dropdown": "^1.0.28",
44
44
  "@synerise/ds-flag": "^1.0.5",
45
45
  "@synerise/ds-icon": "^1.7.2",
46
46
  "@synerise/ds-input": "^1.3.12",
47
47
  "@synerise/ds-loader": "^1.0.10",
48
- "@synerise/ds-menu": "^1.0.24",
48
+ "@synerise/ds-menu": "^1.0.26",
49
49
  "@synerise/ds-modal": "^1.2.12",
50
50
  "@synerise/ds-result": "^1.0.25",
51
51
  "@synerise/ds-scrollbar": "^1.1.8",
52
- "@synerise/ds-search": "^1.3.3",
52
+ "@synerise/ds-search": "^1.3.5",
53
53
  "@synerise/ds-skeleton": "^1.0.23",
54
54
  "@synerise/ds-status": "^1.2.16",
55
55
  "@synerise/ds-tag": "^1.3.0",
56
- "@synerise/ds-tags": "^1.4.1",
56
+ "@synerise/ds-tags": "^1.4.3",
57
57
  "@synerise/ds-tooltip": "^1.2.0",
58
58
  "@synerise/ds-typography": "^1.0.21",
59
59
  "@synerise/ds-utils": "^1.4.2",
@@ -75,5 +75,5 @@
75
75
  "react-intl": ">=3.12.0 <= 6.8",
76
76
  "styled-components": "^5.3.3"
77
77
  },
78
- "gitHead": "25221abb694880c2416ceb5f7598a5c7329f3379"
78
+ "gitHead": "2f453d3ec29744efda93cec90074ceb8fb7e038c"
79
79
  }