@carbon/ibm-products 2.43.2-canary.253 → 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.
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +8 -6
- package/es/components/Datagrid/useSelectRows.js +40 -19
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +7 -5
- package/lib/components/Datagrid/useSelectRows.js +39 -18
- package/package.json +2 -2
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
-
import { slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2, toConsumableArray as _toConsumableArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
8
|
+
import { slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2, extends as _extends, toConsumableArray as _toConsumableArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import React__default, { useContext, useRef, useState, useEffect, useCallback } from 'react';
|
10
10
|
import PropTypes from '../../../node_modules/prop-types/index.js';
|
11
11
|
import { Button, Section, Heading } from '@carbon/react';
|
@@ -145,14 +145,16 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
145
145
|
onClick: onStartConditionBuilder
|
146
146
|
}, startConditionLabel);
|
147
147
|
}
|
148
|
+
var wrapperRole = variant === HIERARCHICAL_VARIANT ? {
|
149
|
+
role: 'treegrid',
|
150
|
+
'aria-label': conditionBuilderHierarchicalText
|
151
|
+
} : null;
|
148
152
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Section, {
|
149
153
|
className: "".concat(blockClass, "__heading"),
|
150
154
|
level: 4
|
151
|
-
}, /*#__PURE__*/React__default.createElement(Heading, null, conditionHeadingText)), /*#__PURE__*/React__default.createElement("div", {
|
152
|
-
className: "".concat(blockClass, "__content-container")
|
153
|
-
|
154
|
-
"aria-label": conditionBuilderHierarchicalText
|
155
|
-
}, rootState && (rootState === null || rootState === void 0 || (_rootState$groups4 = rootState.groups) === null || _rootState$groups4 === void 0 ? void 0 : _rootState$groups4.map(function (eachGroup, groupIndex) {
|
155
|
+
}, /*#__PURE__*/React__default.createElement(Heading, null, conditionHeadingText)), /*#__PURE__*/React__default.createElement("div", _extends({
|
156
|
+
className: "".concat(blockClass, "__content-container")
|
157
|
+
}, wrapperRole), rootState && (rootState === null || rootState === void 0 || (_rootState$groups4 = rootState.groups) === null || _rootState$groups4 === void 0 ? void 0 : _rootState$groups4.map(function (eachGroup, groupIndex) {
|
156
158
|
var _ref2;
|
157
159
|
return /*#__PURE__*/React__default.createElement("div", {
|
158
160
|
key: eachGroup.id,
|
@@ -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,
|
@@ -153,14 +153,16 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
153
153
|
onClick: onStartConditionBuilder
|
154
154
|
}, startConditionLabel);
|
155
155
|
}
|
156
|
+
var wrapperRole = variant === util.HIERARCHICAL_VARIANT ? {
|
157
|
+
role: 'treegrid',
|
158
|
+
'aria-label': conditionBuilderHierarchicalText
|
159
|
+
} : null;
|
156
160
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(react.Section, {
|
157
161
|
className: "".concat(util.blockClass, "__heading"),
|
158
162
|
level: 4
|
159
|
-
}, /*#__PURE__*/React__default["default"].createElement(react.Heading, null, conditionHeadingText)), /*#__PURE__*/React__default["default"].createElement("div", {
|
160
|
-
className: "".concat(util.blockClass, "__content-container")
|
161
|
-
|
162
|
-
"aria-label": conditionBuilderHierarchicalText
|
163
|
-
}, rootState && (rootState === null || rootState === void 0 || (_rootState$groups4 = rootState.groups) === null || _rootState$groups4 === void 0 ? void 0 : _rootState$groups4.map(function (eachGroup, groupIndex) {
|
163
|
+
}, /*#__PURE__*/React__default["default"].createElement(react.Heading, null, conditionHeadingText)), /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
164
|
+
className: "".concat(util.blockClass, "__content-container")
|
165
|
+
}, wrapperRole), rootState && (rootState === null || rootState === void 0 || (_rootState$groups4 = rootState.groups) === null || _rootState$groups4 === void 0 ? void 0 : _rootState$groups4.map(function (eachGroup, groupIndex) {
|
164
166
|
var _ref2;
|
165
167
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
166
168
|
key: eachGroup.id,
|
@@ -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
|
}
|