carbon-addons-iot-react 2.147.2 → 2.147.3

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,17 @@
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
+ ## [2.147.3](https://github.com/carbon-design-system/carbon-addons-iot-react/compare/v2.147.2...v2.147.3) (2022-01-27)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **suite-header:** do not allow tabbing to closed app switcher panel ([7ac17ba](https://github.com/carbon-design-system/carbon-addons-iot-react/commit/7ac17ba151eee24a3f71df0679e69cacf5287f58))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [2.147.2](https://github.com/carbon-design-system/carbon-addons-iot-react/compare/v2.147.1...v2.147.2) (2022-01-26)
7
18
 
8
19
 
@@ -119,7 +119,13 @@ var HeaderActionPanel = function HeaderActionPanel(_ref) {
119
119
  }, metaData, {
120
120
  onClick: onClick,
121
121
  onKeyDown: handleSpecificKeyDown(['Enter', ' '], onKeyDown)
122
- }), childItem.content));
122
+ }), // if we're working with an actual react component (not an html element) pass
123
+ // the isExpanded prop, so we can control tab-navigation on the closed AppSwitcher
124
+
125
+ /*#__PURE__*/
126
+ React__default.isValidElement(childItem.content) && typeof childItem.content.type !== 'string' ? /*#__PURE__*/React__default.cloneElement(childItem.content, {
127
+ isExpanded: isExpanded
128
+ }) : childItem.content));
123
129
  }))));
124
130
  };
125
131
 
@@ -160,7 +160,7 @@ var HeaderActionGroup = function HeaderActionGroup(_ref) {
160
160
  * know whether the OverflowMenu is open and adjust the icons accordingly. This double-click
161
161
  * only occurs when changing the icon. If the same icon is always used it works as expected.
162
162
  * My guess is this is because of the outsideClickClosing that the overflow menu does. WHen the
163
- * icon is change it is "outside" of the element for a momemnt and causes a close--that or a re-render that
163
+ * icon is change it is "outside" of the element for a moment and causes a close--that or a re-render that
164
164
  * is triggered when the icon changes.
165
165
  */
166
166
  var button = target.closest('button');
@@ -357,8 +357,11 @@ var SuiteHeader = function SuiteHeader(_ref) {
357
357
  handleSideNavButtonClick(evt);
358
358
  },
359
359
  headerPanel: {
360
- content: /*#__PURE__*/React__default.forwardRef(function () {
360
+ // eslint-disable-next-line react/prop-types
361
+ content: /*#__PURE__*/React__default.forwardRef(function (_ref5, ref) {
362
+ var isExpanded = _ref5.isExpanded;
361
363
  return /*#__PURE__*/React__default.createElement(SuiteHeaderAppSwitcher, {
364
+ ref: ref,
362
365
  applications: applications,
363
366
  customApplications: customApplications,
364
367
  allApplicationsLink: routes === null || routes === void 0 ? void 0 : routes.navigator,
@@ -370,7 +373,8 @@ var SuiteHeader = function SuiteHeader(_ref) {
370
373
  requestAccess: mergedI18N.switcherRequestAccess,
371
374
  learnMoreLink: mergedI18N.switcherLearnMoreLink
372
375
  },
373
- testId: "".concat(testId, "-app-switcher")
376
+ testId: "".concat(testId, "-app-switcher"),
377
+ isExpanded: isExpanded
374
378
  });
375
379
  })
376
380
  },
@@ -57,7 +57,8 @@ var defaultProps = {
57
57
  requestAccess: 'Contact your administrator to request application access.',
58
58
  learnMoreLink: 'Learn more'
59
59
  },
60
- testId: 'suite-header-app-switcher'
60
+ testId: 'suite-header-app-switcher',
61
+ isExpanded: false
61
62
  };
62
63
  var propTypes = {
63
64
  applications: PropTypes.arrayOf(PropTypes.shape(SuiteHeaderApplicationPropTypes)),
@@ -70,7 +71,8 @@ var propTypes = {
70
71
  requestAccess: PropTypes.string,
71
72
  learnMoreLink: PropTypes.string
72
73
  }),
73
- testId: PropTypes.string
74
+ testId: PropTypes.string,
75
+ isExpanded: PropTypes.bool
74
76
  };
75
77
 
76
78
  var SuiteHeaderAppSwitcher = function SuiteHeaderAppSwitcher(_ref) {
@@ -80,7 +82,8 @@ var SuiteHeaderAppSwitcher = function SuiteHeaderAppSwitcher(_ref) {
80
82
  noAccessLink = _ref.noAccessLink,
81
83
  i18n = _ref.i18n,
82
84
  onRouteChange = _ref.onRouteChange,
83
- testId = _ref.testId;
85
+ testId = _ref.testId,
86
+ isExpanded = _ref.isExpanded;
84
87
 
85
88
  var mergedI18n = _objectSpread(_objectSpread({}, defaultProps.i18n), i18n);
86
89
 
@@ -161,6 +164,7 @@ var SuiteHeaderAppSwitcher = function SuiteHeaderAppSwitcher(_ref) {
161
164
  return _ref4.apply(this, arguments);
162
165
  };
163
166
  }(), [allApplicationsLink, onRouteChange]);
167
+ var tabIndex = isExpanded ? 0 : -1;
164
168
  return /*#__PURE__*/React__default.createElement("ul", {
165
169
  "data-testid": testId,
166
170
  className: baseClassName
@@ -173,7 +177,8 @@ var SuiteHeaderAppSwitcher = function SuiteHeaderAppSwitcher(_ref) {
173
177
  testId: "".concat(testId, "--all-applications"),
174
178
  onClick: handleAllApplicationRoute,
175
179
  onKeyDown: handleSpecificKeyDown(['Enter', 'Space'], handleAllApplicationRoute),
176
- renderIcon: ArrowRight16
180
+ renderIcon: ArrowRight16,
181
+ tabIndex: tabIndex
177
182
  }, mergedI18n.allApplicationsLink)), /*#__PURE__*/React__default.createElement("div", {
178
183
  className: "".concat(baseClassName, "--nav-link--separator")
179
184
  }), mergedApplications === null ? /*#__PURE__*/React__default.createElement("li", null, /*#__PURE__*/React__default.createElement("div", {
@@ -201,7 +206,8 @@ var SuiteHeaderAppSwitcher = function SuiteHeaderAppSwitcher(_ref) {
201
206
  kind: "ghost",
202
207
  testId: "".concat(testId, "--").concat(id),
203
208
  onClick: eventHandler,
204
- onKeyDown: handleSpecificKeyDown(['Enter', 'Space'], eventHandler)
209
+ onKeyDown: handleSpecificKeyDown(['Enter', 'Space'], eventHandler),
210
+ tabIndex: tabIndex
205
211
  }, name));
206
212
  }), (mergedApplications === null || mergedApplications === void 0 ? void 0 : mergedApplications.length) === 0 ? /*#__PURE__*/React__default.createElement("div", {
207
213
  className: "".concat(baseClassName, "--no-app")
@@ -234,7 +240,8 @@ var SuiteHeaderAppSwitcher = function SuiteHeaderAppSwitcher(_ref) {
234
240
  }
235
241
  }
236
242
  }, _callee4);
237
- }))
243
+ })),
244
+ tabIndex: tabIndex
238
245
  }, mergedI18n.learnMoreLink)) : null);
239
246
  };
240
247
 
@@ -335,6 +342,17 @@ SuiteHeaderAppSwitcher.__docgenInfo = {
335
342
  "required": false,
336
343
  "description": ""
337
344
  },
345
+ "isExpanded": {
346
+ "defaultValue": {
347
+ "value": "false",
348
+ "computed": false
349
+ },
350
+ "type": {
351
+ "name": "bool"
352
+ },
353
+ "required": false,
354
+ "description": ""
355
+ },
338
356
  "noAccessLink": {
339
357
  "type": {
340
358
  "name": "string"
@@ -130,7 +130,13 @@ var HeaderActionPanel = function HeaderActionPanel(_ref) {
130
130
  }, metaData, {
131
131
  onClick: onClick,
132
132
  onKeyDown: componentUtilityFunctions.handleSpecificKeyDown(['Enter', ' '], onKeyDown)
133
- }), childItem.content));
133
+ }), // if we're working with an actual react component (not an html element) pass
134
+ // the isExpanded prop, so we can control tab-navigation on the closed AppSwitcher
135
+
136
+ /*#__PURE__*/
137
+ React__default['default'].isValidElement(childItem.content) && typeof childItem.content.type !== 'string' ? /*#__PURE__*/React__default['default'].cloneElement(childItem.content, {
138
+ isExpanded: isExpanded
139
+ }) : childItem.content));
134
140
  }))));
135
141
  };
136
142
 
@@ -171,7 +171,7 @@ var HeaderActionGroup = function HeaderActionGroup(_ref) {
171
171
  * know whether the OverflowMenu is open and adjust the icons accordingly. This double-click
172
172
  * only occurs when changing the icon. If the same icon is always used it works as expected.
173
173
  * My guess is this is because of the outsideClickClosing that the overflow menu does. WHen the
174
- * icon is change it is "outside" of the element for a momemnt and causes a close--that or a re-render that
174
+ * icon is change it is "outside" of the element for a moment and causes a close--that or a re-render that
175
175
  * is triggered when the icon changes.
176
176
  */
177
177
  var button = target.closest('button');
@@ -372,8 +372,11 @@ var SuiteHeader = function SuiteHeader(_ref) {
372
372
  handleSideNavButtonClick(evt);
373
373
  },
374
374
  headerPanel: {
375
- content: /*#__PURE__*/React__default['default'].forwardRef(function () {
375
+ // eslint-disable-next-line react/prop-types
376
+ content: /*#__PURE__*/React__default['default'].forwardRef(function (_ref5, ref) {
377
+ var isExpanded = _ref5.isExpanded;
376
378
  return /*#__PURE__*/React__default['default'].createElement(SuiteHeaderAppSwitcher, {
379
+ ref: ref,
377
380
  applications: applications,
378
381
  customApplications: customApplications,
379
382
  allApplicationsLink: routes === null || routes === void 0 ? void 0 : routes.navigator,
@@ -385,7 +388,8 @@ var SuiteHeader = function SuiteHeader(_ref) {
385
388
  requestAccess: mergedI18N.switcherRequestAccess,
386
389
  learnMoreLink: mergedI18N.switcherLearnMoreLink
387
390
  },
388
- testId: "".concat(testId, "-app-switcher")
391
+ testId: "".concat(testId, "-app-switcher"),
392
+ isExpanded: isExpanded
389
393
  });
390
394
  })
391
395
  },
@@ -68,7 +68,8 @@ var defaultProps = {
68
68
  requestAccess: 'Contact your administrator to request application access.',
69
69
  learnMoreLink: 'Learn more'
70
70
  },
71
- testId: 'suite-header-app-switcher'
71
+ testId: 'suite-header-app-switcher',
72
+ isExpanded: false
72
73
  };
73
74
  var propTypes = {
74
75
  applications: PropTypes__default['default'].arrayOf(PropTypes__default['default'].shape(SuiteHeaderPropTypes.SuiteHeaderApplicationPropTypes)),
@@ -81,7 +82,8 @@ var propTypes = {
81
82
  requestAccess: PropTypes__default['default'].string,
82
83
  learnMoreLink: PropTypes__default['default'].string
83
84
  }),
84
- testId: PropTypes__default['default'].string
85
+ testId: PropTypes__default['default'].string,
86
+ isExpanded: PropTypes__default['default'].bool
85
87
  };
86
88
 
87
89
  var SuiteHeaderAppSwitcher = function SuiteHeaderAppSwitcher(_ref) {
@@ -91,7 +93,8 @@ var SuiteHeaderAppSwitcher = function SuiteHeaderAppSwitcher(_ref) {
91
93
  noAccessLink = _ref.noAccessLink,
92
94
  i18n = _ref.i18n,
93
95
  onRouteChange = _ref.onRouteChange,
94
- testId = _ref.testId;
96
+ testId = _ref.testId,
97
+ isExpanded = _ref.isExpanded;
95
98
 
96
99
  var mergedI18n = _objectSpread(_objectSpread({}, defaultProps.i18n), i18n);
97
100
 
@@ -172,6 +175,7 @@ var SuiteHeaderAppSwitcher = function SuiteHeaderAppSwitcher(_ref) {
172
175
  return _ref4.apply(this, arguments);
173
176
  };
174
177
  }(), [allApplicationsLink, onRouteChange]);
178
+ var tabIndex = isExpanded ? 0 : -1;
175
179
  return /*#__PURE__*/React__default['default'].createElement("ul", {
176
180
  "data-testid": testId,
177
181
  className: baseClassName
@@ -184,7 +188,8 @@ var SuiteHeaderAppSwitcher = function SuiteHeaderAppSwitcher(_ref) {
184
188
  testId: "".concat(testId, "--all-applications"),
185
189
  onClick: handleAllApplicationRoute,
186
190
  onKeyDown: componentUtilityFunctions.handleSpecificKeyDown(['Enter', 'Space'], handleAllApplicationRoute),
187
- renderIcon: iconsReact.ArrowRight16
191
+ renderIcon: iconsReact.ArrowRight16,
192
+ tabIndex: tabIndex
188
193
  }, mergedI18n.allApplicationsLink)), /*#__PURE__*/React__default['default'].createElement("div", {
189
194
  className: "".concat(baseClassName, "--nav-link--separator")
190
195
  }), mergedApplications === null ? /*#__PURE__*/React__default['default'].createElement("li", null, /*#__PURE__*/React__default['default'].createElement("div", {
@@ -212,7 +217,8 @@ var SuiteHeaderAppSwitcher = function SuiteHeaderAppSwitcher(_ref) {
212
217
  kind: "ghost",
213
218
  testId: "".concat(testId, "--").concat(id),
214
219
  onClick: eventHandler,
215
- onKeyDown: componentUtilityFunctions.handleSpecificKeyDown(['Enter', 'Space'], eventHandler)
220
+ onKeyDown: componentUtilityFunctions.handleSpecificKeyDown(['Enter', 'Space'], eventHandler),
221
+ tabIndex: tabIndex
216
222
  }, name));
217
223
  }), (mergedApplications === null || mergedApplications === void 0 ? void 0 : mergedApplications.length) === 0 ? /*#__PURE__*/React__default['default'].createElement("div", {
218
224
  className: "".concat(baseClassName, "--no-app")
@@ -245,7 +251,8 @@ var SuiteHeaderAppSwitcher = function SuiteHeaderAppSwitcher(_ref) {
245
251
  }
246
252
  }
247
253
  }, _callee4);
248
- }))
254
+ })),
255
+ tabIndex: tabIndex
249
256
  }, mergedI18n.learnMoreLink)) : null);
250
257
  };
251
258
 
@@ -346,6 +353,17 @@ SuiteHeaderAppSwitcher.__docgenInfo = {
346
353
  "required": false,
347
354
  "description": ""
348
355
  },
356
+ "isExpanded": {
357
+ "defaultValue": {
358
+ "value": "false",
359
+ "computed": false
360
+ },
361
+ "type": {
362
+ "name": "bool"
363
+ },
364
+ "required": false,
365
+ "description": ""
366
+ },
349
367
  "noAccessLink": {
350
368
  "type": {
351
369
  "name": "string"
package/package.json CHANGED
@@ -340,10 +340,10 @@
340
340
  "whatwg-fetch": "^3.0.0"
341
341
  },
342
342
  "sideEffects": false,
343
- "version": "2.147.2",
343
+ "version": "2.147.3",
344
344
  "resolutions": {
345
345
  "chokidar": "3.3.1",
346
346
  "react-grid-layout": "1.2.2"
347
347
  },
348
- "gitHead": "16a2a7871d2c44bf16dcf97893148cc6413eda9e"
348
+ "gitHead": "53fa40581e33f8b87ca9baddb05563d62760170e"
349
349
  }
@@ -122317,7 +122317,13 @@
122317
122317
  }, metaData, {
122318
122318
  onClick: onClick,
122319
122319
  onKeyDown: handleSpecificKeyDown(['Enter', ' '], onKeyDown)
122320
- }), childItem.content));
122320
+ }), // if we're working with an actual react component (not an html element) pass
122321
+ // the isExpanded prop, so we can control tab-navigation on the closed AppSwitcher
122322
+
122323
+ /*#__PURE__*/
122324
+ React__default$1['default'].isValidElement(childItem.content) && typeof childItem.content.type !== 'string' ? /*#__PURE__*/React__default$1['default'].cloneElement(childItem.content, {
122325
+ isExpanded: isExpanded
122326
+ }) : childItem.content));
122321
122327
  }))));
122322
122328
  };
122323
122329
 
@@ -122668,7 +122674,7 @@
122668
122674
  * know whether the OverflowMenu is open and adjust the icons accordingly. This double-click
122669
122675
  * only occurs when changing the icon. If the same icon is always used it works as expected.
122670
122676
  * My guess is this is because of the outsideClickClosing that the overflow menu does. WHen the
122671
- * icon is change it is "outside" of the element for a momemnt and causes a close--that or a re-render that
122677
+ * icon is change it is "outside" of the element for a moment and causes a close--that or a re-render that
122672
122678
  * is triggered when the icon changes.
122673
122679
  */
122674
122680
  var button = target.closest('button');
@@ -124467,7 +124473,8 @@
124467
124473
  requestAccess: 'Contact your administrator to request application access.',
124468
124474
  learnMoreLink: 'Learn more'
124469
124475
  },
124470
- testId: 'suite-header-app-switcher'
124476
+ testId: 'suite-header-app-switcher',
124477
+ isExpanded: false
124471
124478
  };
124472
124479
  var propTypes$18 = {
124473
124480
  applications: PropTypes__default['default'].arrayOf(PropTypes__default['default'].shape(SuiteHeaderApplicationPropTypes)),
@@ -124480,7 +124487,8 @@
124480
124487
  requestAccess: PropTypes__default['default'].string,
124481
124488
  learnMoreLink: PropTypes__default['default'].string
124482
124489
  }),
124483
- testId: PropTypes__default['default'].string
124490
+ testId: PropTypes__default['default'].string,
124491
+ isExpanded: PropTypes__default['default'].bool
124484
124492
  };
124485
124493
 
124486
124494
  var SuiteHeaderAppSwitcher = function SuiteHeaderAppSwitcher(_ref) {
@@ -124490,7 +124498,8 @@
124490
124498
  noAccessLink = _ref.noAccessLink,
124491
124499
  i18n = _ref.i18n,
124492
124500
  onRouteChange = _ref.onRouteChange,
124493
- testId = _ref.testId;
124501
+ testId = _ref.testId,
124502
+ isExpanded = _ref.isExpanded;
124494
124503
 
124495
124504
  var mergedI18n = _objectSpread$Z(_objectSpread$Z({}, defaultProps$1b.i18n), i18n);
124496
124505
 
@@ -124571,6 +124580,7 @@
124571
124580
  return _ref4.apply(this, arguments);
124572
124581
  };
124573
124582
  }(), [allApplicationsLink, onRouteChange]);
124583
+ var tabIndex = isExpanded ? 0 : -1;
124574
124584
  return /*#__PURE__*/React__default$1['default'].createElement("ul", {
124575
124585
  "data-testid": testId,
124576
124586
  className: baseClassName
@@ -124583,7 +124593,8 @@
124583
124593
  testId: "".concat(testId, "--all-applications"),
124584
124594
  onClick: handleAllApplicationRoute,
124585
124595
  onKeyDown: handleSpecificKeyDown(['Enter', 'Space'], handleAllApplicationRoute),
124586
- renderIcon: iconsReact.ArrowRight16
124596
+ renderIcon: iconsReact.ArrowRight16,
124597
+ tabIndex: tabIndex
124587
124598
  }, mergedI18n.allApplicationsLink)), /*#__PURE__*/React__default$1['default'].createElement("div", {
124588
124599
  className: "".concat(baseClassName, "--nav-link--separator")
124589
124600
  }), mergedApplications === null ? /*#__PURE__*/React__default$1['default'].createElement("li", null, /*#__PURE__*/React__default$1['default'].createElement("div", {
@@ -124611,7 +124622,8 @@
124611
124622
  kind: "ghost",
124612
124623
  testId: "".concat(testId, "--").concat(id),
124613
124624
  onClick: eventHandler,
124614
- onKeyDown: handleSpecificKeyDown(['Enter', 'Space'], eventHandler)
124625
+ onKeyDown: handleSpecificKeyDown(['Enter', 'Space'], eventHandler),
124626
+ tabIndex: tabIndex
124615
124627
  }, name));
124616
124628
  }), (mergedApplications === null || mergedApplications === void 0 ? void 0 : mergedApplications.length) === 0 ? /*#__PURE__*/React__default$1['default'].createElement("div", {
124617
124629
  className: "".concat(baseClassName, "--no-app")
@@ -124644,7 +124656,8 @@
124644
124656
  }
124645
124657
  }
124646
124658
  }, _callee4);
124647
- }))
124659
+ })),
124660
+ tabIndex: tabIndex
124648
124661
  }, mergedI18n.learnMoreLink)) : null);
124649
124662
  };
124650
124663
 
@@ -124745,6 +124758,17 @@
124745
124758
  "required": false,
124746
124759
  "description": ""
124747
124760
  },
124761
+ "isExpanded": {
124762
+ "defaultValue": {
124763
+ "value": "false",
124764
+ "computed": false
124765
+ },
124766
+ "type": {
124767
+ "name": "bool"
124768
+ },
124769
+ "required": false,
124770
+ "description": ""
124771
+ },
124748
124772
  "noAccessLink": {
124749
124773
  "type": {
124750
124774
  "name": "string"
@@ -125240,8 +125264,11 @@
125240
125264
  handleSideNavButtonClick(evt);
125241
125265
  },
125242
125266
  headerPanel: {
125243
- content: /*#__PURE__*/React__default$1['default'].forwardRef(function () {
125267
+ // eslint-disable-next-line react/prop-types
125268
+ content: /*#__PURE__*/React__default$1['default'].forwardRef(function (_ref5, ref) {
125269
+ var isExpanded = _ref5.isExpanded;
125244
125270
  return /*#__PURE__*/React__default$1['default'].createElement(SuiteHeaderAppSwitcher, {
125271
+ ref: ref,
125245
125272
  applications: applications,
125246
125273
  customApplications: customApplications,
125247
125274
  allApplicationsLink: routes === null || routes === void 0 ? void 0 : routes.navigator,
@@ -125253,7 +125280,8 @@
125253
125280
  requestAccess: mergedI18N.switcherRequestAccess,
125254
125281
  learnMoreLink: mergedI18N.switcherLearnMoreLink
125255
125282
  },
125256
- testId: "".concat(testId, "-app-switcher")
125283
+ testId: "".concat(testId, "-app-switcher"),
125284
+ isExpanded: isExpanded
125257
125285
  });
125258
125286
  })
125259
125287
  },