@carbon/ibm-products 2.43.2-canary.254 → 2.43.2-canary.255
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.
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
-
import { toConsumableArray as _toConsumableArray, slicedToArray as _slicedToArray, objectWithoutProperties as _objectWithoutProperties, extends as _extends, defineProperty as _defineProperty, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
8
|
+
import { toConsumableArray as _toConsumableArray, slicedToArray as _slicedToArray, objectWithoutProperties as _objectWithoutProperties, extends as _extends, defineProperty as _defineProperty, objectSpread2 as _objectSpread2, asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import React__default, { useState, useLayoutEffect } from 'react';
|
10
10
|
import cx from 'classnames';
|
11
11
|
import { TableSelectRow } from '@carbon/react';
|
@@ -95,24 +95,45 @@ var SelectRow = function SelectRow(datagridState) {
|
|
95
95
|
return window.removeEventListener('resize', updateSize);
|
96
96
|
};
|
97
97
|
}, []);
|
98
|
-
var onSelectHandler = function
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
98
|
+
var onSelectHandler = /*#__PURE__*/function () {
|
99
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {
|
100
|
+
var _document$activeEleme, _document, _document2;
|
101
|
+
var activeElement;
|
102
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
103
|
+
while (1) switch (_context.prev = _context.next) {
|
104
|
+
case 0:
|
105
|
+
event.stopPropagation(); // avoid triggering onRowClick
|
106
|
+
if (radio) {
|
107
|
+
toggleAllRowsSelected(false);
|
108
|
+
if (onRadioSelect) {
|
109
|
+
onRadioSelect(row);
|
110
|
+
}
|
111
|
+
}
|
112
|
+
onChange(event);
|
113
|
+
onRowSelect === null || onRowSelect === void 0 || onRowSelect(row, event);
|
114
|
+
handleToggleRowSelected({
|
115
|
+
dispatch: dispatch,
|
116
|
+
rowData: row,
|
117
|
+
isChecked: event.target.checked,
|
118
|
+
getRowId: getRowId,
|
119
|
+
selectAll: null
|
120
|
+
});
|
121
|
+
// focus the radio / checkbox if lost
|
122
|
+
activeElement = (_document$activeEleme = (_document = document) === null || _document === void 0 || (_document = _document.activeElement) === null || _document === void 0 ? void 0 : _document.id) !== null && _document$activeEleme !== void 0 ? _document$activeEleme : '';
|
123
|
+
_context.next = 8;
|
124
|
+
return undefined;
|
125
|
+
case 8:
|
126
|
+
(_document2 = document) === null || _document2 === void 0 || (_document2 = _document2.getElementById(activeElement)) === null || _document2 === void 0 || _document2.focus();
|
127
|
+
case 9:
|
128
|
+
case "end":
|
129
|
+
return _context.stop();
|
130
|
+
}
|
131
|
+
}, _callee);
|
132
|
+
}));
|
133
|
+
return function onSelectHandler(_x) {
|
134
|
+
return _ref3.apply(this, arguments);
|
135
|
+
};
|
136
|
+
}();
|
116
137
|
var selectDisabled = isFetching || row.getRowProps().disabled;
|
117
138
|
var _row$getToggleRowSele2 = row.getToggleRowSelectedProps(),
|
118
139
|
onChange = _row$getToggleRowSele2.onChange,
|
@@ -104,24 +104,45 @@ var SelectRow = function SelectRow(datagridState) {
|
|
104
104
|
return window.removeEventListener('resize', updateSize);
|
105
105
|
};
|
106
106
|
}, []);
|
107
|
-
var onSelectHandler = function
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
107
|
+
var onSelectHandler = /*#__PURE__*/function () {
|
108
|
+
var _ref3 = _rollupPluginBabelHelpers.asyncToGenerator( /*#__PURE__*/_rollupPluginBabelHelpers.regeneratorRuntime().mark(function _callee(event) {
|
109
|
+
var _document$activeEleme, _document, _document2;
|
110
|
+
var activeElement;
|
111
|
+
return _rollupPluginBabelHelpers.regeneratorRuntime().wrap(function _callee$(_context) {
|
112
|
+
while (1) switch (_context.prev = _context.next) {
|
113
|
+
case 0:
|
114
|
+
event.stopPropagation(); // avoid triggering onRowClick
|
115
|
+
if (radio) {
|
116
|
+
toggleAllRowsSelected(false);
|
117
|
+
if (onRadioSelect) {
|
118
|
+
onRadioSelect(row);
|
119
|
+
}
|
120
|
+
}
|
121
|
+
onChange(event);
|
122
|
+
onRowSelect === null || onRowSelect === void 0 || onRowSelect(row, event);
|
123
|
+
stateReducer.handleToggleRowSelected({
|
124
|
+
dispatch: dispatch,
|
125
|
+
rowData: row,
|
126
|
+
isChecked: event.target.checked,
|
127
|
+
getRowId: getRowId,
|
128
|
+
selectAll: null
|
129
|
+
});
|
130
|
+
// focus the radio / checkbox if lost
|
131
|
+
activeElement = (_document$activeEleme = (_document = document) === null || _document === void 0 || (_document = _document.activeElement) === null || _document === void 0 ? void 0 : _document.id) !== null && _document$activeEleme !== void 0 ? _document$activeEleme : '';
|
132
|
+
_context.next = 8;
|
133
|
+
return undefined;
|
134
|
+
case 8:
|
135
|
+
(_document2 = document) === null || _document2 === void 0 || (_document2 = _document2.getElementById(activeElement)) === null || _document2 === void 0 || _document2.focus();
|
136
|
+
case 9:
|
137
|
+
case "end":
|
138
|
+
return _context.stop();
|
139
|
+
}
|
140
|
+
}, _callee);
|
141
|
+
}));
|
142
|
+
return function onSelectHandler(_x) {
|
143
|
+
return _ref3.apply(this, arguments);
|
144
|
+
};
|
145
|
+
}();
|
125
146
|
var selectDisabled = isFetching || row.getRowProps().disabled;
|
126
147
|
var _row$getToggleRowSele2 = row.getToggleRowSelectedProps(),
|
127
148
|
onChange = _row$getToggleRowSele2.onChange,
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@carbon/ibm-products",
|
3
3
|
"description": "Carbon for IBM Products",
|
4
|
-
"version": "2.43.2-canary.
|
4
|
+
"version": "2.43.2-canary.255+127824b9d",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -120,5 +120,5 @@
|
|
120
120
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0",
|
121
121
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
|
122
122
|
},
|
123
|
-
"gitHead": "
|
123
|
+
"gitHead": "127824b9dcdb9847a58940305bb06c35565c720c"
|
124
124
|
}
|