@carbon/ibm-products 2.43.2-canary.254 → 2.43.2-canary.257

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 onSelectHandler(event) {
99
- event.stopPropagation(); // avoid triggering onRowClick
100
- if (radio) {
101
- toggleAllRowsSelected(false);
102
- if (onRadioSelect) {
103
- onRadioSelect(row);
104
- }
105
- }
106
- onChange(event);
107
- onRowSelect === null || onRowSelect === void 0 || onRowSelect(row, event);
108
- handleToggleRowSelected({
109
- dispatch: dispatch,
110
- rowData: row,
111
- isChecked: event.target.checked,
112
- getRowId: getRowId,
113
- selectAll: null
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,
@@ -228,7 +228,7 @@ var NotificationsPanel = /*#__PURE__*/React__default.forwardRef(function (_ref,
228
228
  setTimeout(function () {
229
229
  var _triggerButtonRef$cur2;
230
230
  triggerButtonRef === null || triggerButtonRef === void 0 || (_triggerButtonRef$cur2 = triggerButtonRef.current) === null || _triggerButtonRef$cur2 === void 0 || _triggerButtonRef$cur2.focus();
231
- }, 0);
231
+ }, 100);
232
232
  }
233
233
  };
234
234
  useEffect(function () {
@@ -104,24 +104,45 @@ var SelectRow = function SelectRow(datagridState) {
104
104
  return window.removeEventListener('resize', updateSize);
105
105
  };
106
106
  }, []);
107
- var onSelectHandler = function onSelectHandler(event) {
108
- event.stopPropagation(); // avoid triggering onRowClick
109
- if (radio) {
110
- toggleAllRowsSelected(false);
111
- if (onRadioSelect) {
112
- onRadioSelect(row);
113
- }
114
- }
115
- onChange(event);
116
- onRowSelect === null || onRowSelect === void 0 || onRowSelect(row, event);
117
- stateReducer.handleToggleRowSelected({
118
- dispatch: dispatch,
119
- rowData: row,
120
- isChecked: event.target.checked,
121
- getRowId: getRowId,
122
- selectAll: null
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,
@@ -237,7 +237,7 @@ exports.NotificationsPanel = /*#__PURE__*/React__default["default"].forwardRef(f
237
237
  setTimeout(function () {
238
238
  var _triggerButtonRef$cur2;
239
239
  triggerButtonRef === null || triggerButtonRef === void 0 || (_triggerButtonRef$cur2 = triggerButtonRef.current) === null || _triggerButtonRef$cur2 === void 0 || _triggerButtonRef$cur2.focus();
240
- }, 0);
240
+ }, 100);
241
241
  }
242
242
  };
243
243
  React.useEffect(function () {
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.254+6c7823ed1",
4
+ "version": "2.43.2-canary.257+752739bde",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -81,7 +81,7 @@
81
81
  "fs-extra": "^11.2.0",
82
82
  "glob": "^10.3.10",
83
83
  "jest": "^29.7.0",
84
- "jest-config-ibm-cloud-cognitive": "^1.9.0-rc.0",
84
+ "jest-config-ibm-cloud-cognitive": "^1.9.0",
85
85
  "jest-environment-jsdom": "^29.7.0",
86
86
  "namor": "^1.1.2",
87
87
  "npm-check-updates": "^16.14.12",
@@ -96,7 +96,7 @@
96
96
  "dependencies": {
97
97
  "@babel/runtime": "^7.23.9",
98
98
  "@carbon/feature-flags": "^0.22.0",
99
- "@carbon/ibm-products-styles": "^2.46.0-rc.0",
99
+ "@carbon/ibm-products-styles": "^2.46.0",
100
100
  "@carbon/telemetry": "^0.1.0",
101
101
  "@dnd-kit/core": "^6.0.8",
102
102
  "@dnd-kit/modifiers": "^7.0.0",
@@ -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": "6c7823ed1405d0dfa6ef51cac89e0373f6763ef0"
123
+ "gitHead": "752739bde31c3dcb5de1ff2702167b7a838350dd"
124
124
  }