@telus-uds/components-community.data-grid 1.7.7 → 1.8.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.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,35 @@
1
1
  # Change Log - @telus-uds/components-community.data-grid
2
2
 
3
- This log was last generated on Mon, 19 Jan 2026 20:39:51 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 18 Feb 2026 02:50:19 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.8.0
8
+
9
+ Wed, 18 Feb 2026 02:50:19 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - `Datagrid`: Enhancement to provide custom business logic per row on checkbox click. (shivam.gupta3@telus.com)
14
+ - Bump @telus-uds/components-web to v4.18.1
15
+ - Bump @telus-uds/components-base to v3.28.0
16
+ - Bump @telus-uds/system-theme-tokens to v4.20.0
17
+ - Bump @telus-uds/browserslist-config to v1.0.5
18
+
19
+ ## 1.7.8
20
+
21
+ Thu, 29 Jan 2026 15:50:18 GMT
22
+
23
+ ### Patches
24
+
25
+ - Bump @telus-uds/components-web to v4.18.0
26
+ - Bump @telus-uds/components-base to v3.27.0
27
+ - Bump @telus-uds/system-theme-tokens to v4.19.0
28
+ - Bump @telus-uds/browserslist-config to v1.0.5
29
+
7
30
  ## 1.7.7
8
31
 
9
- Mon, 19 Jan 2026 20:39:51 GMT
32
+ Mon, 19 Jan 2026 20:01:23 GMT
10
33
 
11
34
  ### Patches
12
35
 
@@ -124,8 +124,26 @@ const DataGrid = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
124
124
  ...data
125
125
  };
126
126
  tempData[group].data = (0, _utility.toggleRowCheckbox)(tempData[group].data, id);
127
+ if (row?.hasExpandedRow && row?.onCheckBoxToggle && typeof row.onCheckBoxToggle === 'function') {
128
+ const {
129
+ data: newData,
130
+ shouldToggle
131
+ } = row.onCheckBoxToggle(tempData[group].data, id);
132
+ if (shouldToggle) {
133
+ tempData[group].data = newData;
134
+ }
135
+ }
127
136
  } else {
128
137
  tempData = (0, _utility.toggleRowCheckbox)(data, rowId);
138
+ if (row?.hasExpandedRow && row?.onCheckBoxToggle && typeof row.onCheckBoxToggle === 'function') {
139
+ const {
140
+ data: newData,
141
+ shouldToggle
142
+ } = row.onCheckBoxToggle(tempData, rowId);
143
+ if (shouldToggle) {
144
+ tempData = newData;
145
+ }
146
+ }
129
147
  }
130
148
  setData(tempData);
131
149
  };
@@ -415,7 +433,8 @@ DataGrid.propTypes = {
415
433
  name: _propTypes.default.string,
416
434
  value: _propTypes.default.string.isRequired,
417
435
  onChange: _propTypes.default.func
418
- })
436
+ }),
437
+ onCheckBoxToggle: _propTypes.default.func
419
438
  })),
420
439
  /**
421
440
  * Set this to true to enable columns to become sortable.
@@ -91,6 +91,10 @@ DataGridRow.propTypes = {
91
91
  /**
92
92
  * onClick is a function to open/close a row with expanded content
93
93
  */
94
- onClick: _propTypes.default.func
94
+ onClick: _propTypes.default.func,
95
+ /**
96
+ * Optional function prop to intercept the checkbox's functionality and provide auto expand of row on deselect checkbox
97
+ */
98
+ onCheckBoxToggle: _propTypes.default.func
95
99
  };
96
100
  var _default = exports.default = DataGridRow;
@@ -115,8 +115,26 @@ const DataGrid = /*#__PURE__*/React.forwardRef((_ref, ref) => {
115
115
  ...data
116
116
  };
117
117
  tempData[group].data = toggleRowCheckbox(tempData[group].data, id);
118
+ if (row?.hasExpandedRow && row?.onCheckBoxToggle && typeof row.onCheckBoxToggle === 'function') {
119
+ const {
120
+ data: newData,
121
+ shouldToggle
122
+ } = row.onCheckBoxToggle(tempData[group].data, id);
123
+ if (shouldToggle) {
124
+ tempData[group].data = newData;
125
+ }
126
+ }
118
127
  } else {
119
128
  tempData = toggleRowCheckbox(data, rowId);
129
+ if (row?.hasExpandedRow && row?.onCheckBoxToggle && typeof row.onCheckBoxToggle === 'function') {
130
+ const {
131
+ data: newData,
132
+ shouldToggle
133
+ } = row.onCheckBoxToggle(tempData, rowId);
134
+ if (shouldToggle) {
135
+ tempData = newData;
136
+ }
137
+ }
120
138
  }
121
139
  setData(tempData);
122
140
  };
@@ -406,7 +424,8 @@ DataGrid.propTypes = {
406
424
  name: PropTypes.string,
407
425
  value: PropTypes.string.isRequired,
408
426
  onChange: PropTypes.func
409
- })
427
+ }),
428
+ onCheckBoxToggle: PropTypes.func
410
429
  })),
411
430
  /**
412
431
  * Set this to true to enable columns to become sortable.
@@ -82,6 +82,10 @@ DataGridRow.propTypes = {
82
82
  /**
83
83
  * onClick is a function to open/close a row with expanded content
84
84
  */
85
- onClick: PropTypes.func
85
+ onClick: PropTypes.func,
86
+ /**
87
+ * Optional function prop to intercept the checkbox's functionality and provide auto expand of row on deselect checkbox
88
+ */
89
+ onCheckBoxToggle: PropTypes.func
86
90
  };
87
91
  export default DataGridRow;
package/package.json CHANGED
@@ -5,9 +5,9 @@
5
5
  ],
6
6
  "dependencies": {
7
7
  "prop-types": "^15.7.2",
8
- "@telus-uds/components-web": "^4.17.0",
9
- "@telus-uds/components-base": "^3.26.0",
10
- "@telus-uds/system-theme-tokens": "^4.18.0",
8
+ "@telus-uds/components-web": "^4.18.1",
9
+ "@telus-uds/components-base": "^3.28.0",
10
+ "@telus-uds/system-theme-tokens": "^4.20.0",
11
11
  "styled-components": "6.1.13"
12
12
  },
13
13
  "devDependencies": {
@@ -44,5 +44,5 @@
44
44
  "standard-engine": {
45
45
  "skip": true
46
46
  },
47
- "version": "1.7.7"
47
+ "version": "1.8.0"
48
48
  }
package/src/DataGrid.jsx CHANGED
@@ -137,7 +137,6 @@ const DataGrid = React.forwardRef(
137
137
 
138
138
  const toggleCheckbox = (rowId, row) => {
139
139
  let tempData = null
140
-
141
140
  if (typeof row.checkBoxProps?.onChange === 'function') {
142
141
  row.checkBoxProps.onChange()
143
142
  }
@@ -147,8 +146,29 @@ const DataGrid = React.forwardRef(
147
146
  const id = parseInt(splitID, 10)
148
147
  tempData = { ...data }
149
148
  tempData[group].data = toggleRowCheckbox(tempData[group].data, id)
149
+
150
+ if (
151
+ row?.hasExpandedRow &&
152
+ row?.onCheckBoxToggle &&
153
+ typeof row.onCheckBoxToggle === 'function'
154
+ ) {
155
+ const { data: newData, shouldToggle } = row.onCheckBoxToggle(tempData[group].data, id)
156
+ if (shouldToggle) {
157
+ tempData[group].data = newData
158
+ }
159
+ }
150
160
  } else {
151
161
  tempData = toggleRowCheckbox(data, rowId)
162
+ if (
163
+ row?.hasExpandedRow &&
164
+ row?.onCheckBoxToggle &&
165
+ typeof row.onCheckBoxToggle === 'function'
166
+ ) {
167
+ const { data: newData, shouldToggle } = row.onCheckBoxToggle(tempData, rowId)
168
+ if (shouldToggle) {
169
+ tempData = newData
170
+ }
171
+ }
152
172
  }
153
173
  setData(tempData)
154
174
  }
@@ -551,7 +571,8 @@ DataGrid.propTypes = {
551
571
  name: PropTypes.string,
552
572
  value: PropTypes.string.isRequired,
553
573
  onChange: PropTypes.func
554
- })
574
+ }),
575
+ onCheckBoxToggle: PropTypes.func
555
576
  })
556
577
  ),
557
578
  /**
@@ -102,7 +102,11 @@ DataGridRow.propTypes = {
102
102
  /**
103
103
  * onClick is a function to open/close a row with expanded content
104
104
  */
105
- onClick: PropTypes.func
105
+ onClick: PropTypes.func,
106
+ /**
107
+ * Optional function prop to intercept the checkbox's functionality and provide auto expand of row on deselect checkbox
108
+ */
109
+ onCheckBoxToggle: PropTypes.func
106
110
  }
107
111
 
108
112
  export default DataGridRow