carbon-addons-iot-react 2.152.0-next.13 → 2.152.0-next.15

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/css/carbon-addons-iot-react.css +8 -3
  3. package/css/carbon-addons-iot-react.css.map +1 -1
  4. package/es/components/BarChartCard/barChartUtils.js +2 -2
  5. package/es/components/Card/CardTitle.js +8 -2
  6. package/es/components/DateTimePicker/DateTimePickerV2WithTimeSpinner.js +3 -3
  7. package/es/components/DateTimePicker/DateTimePickerV2WithoutTimeSpinner.js +3 -3
  8. package/es/components/SuiteHeader/IdleLogoutConfirmationModal/IdleLogoutConfirmationModal.js +77 -4
  9. package/es/components/SuiteHeader/SuiteHeader.js +26 -3
  10. package/es/components/SuiteHeader/hooks/useUiResources.js +4 -1
  11. package/es/components/SuiteHeader/util/uiresources.js +5 -4
  12. package/es/components/Table/Table.js +7 -17
  13. package/es/components/Table/TableBody/TableBody.js +5 -16
  14. package/es/components/Table/TableBody/TableBodyRow/TableBodyRow.js +9 -20
  15. package/es/components/Table/TableBody/TableBodyRowRenderer.js +5 -16
  16. package/es/components/Table/TableCellRenderer/TableCellRenderer.js +6 -17
  17. package/es/components/Table/TableHead/TableHead.js +4 -15
  18. package/es/constants/SharedPropTypes.js +2 -1
  19. package/es/hooks/usePopoverPositioning.js +53 -11
  20. package/lib/components/BarChartCard/barChartUtils.js +2 -2
  21. package/lib/components/Card/CardTitle.js +8 -2
  22. package/lib/components/DateTimePicker/DateTimePickerV2WithTimeSpinner.js +3 -3
  23. package/lib/components/DateTimePicker/DateTimePickerV2WithoutTimeSpinner.js +3 -3
  24. package/lib/components/SuiteHeader/IdleLogoutConfirmationModal/IdleLogoutConfirmationModal.js +77 -4
  25. package/lib/components/SuiteHeader/SuiteHeader.js +26 -3
  26. package/lib/components/SuiteHeader/hooks/useUiResources.js +4 -1
  27. package/lib/components/SuiteHeader/util/uiresources.js +5 -4
  28. package/lib/components/Table/Table.js +7 -17
  29. package/lib/components/Table/TableBody/TableBody.js +5 -16
  30. package/lib/components/Table/TableBody/TableBodyRow/TableBodyRow.js +9 -20
  31. package/lib/components/Table/TableBody/TableBodyRowRenderer.js +5 -16
  32. package/lib/components/Table/TableCellRenderer/TableCellRenderer.js +6 -17
  33. package/lib/components/Table/TableHead/TableHead.js +4 -15
  34. package/lib/constants/SharedPropTypes.js +2 -0
  35. package/lib/css/carbon-addons-iot-react.css +8 -3
  36. package/lib/css/carbon-addons-iot-react.css.map +1 -1
  37. package/lib/hooks/usePopoverPositioning.js +53 -11
  38. package/lib/scss/components/DateTimePicker/_date-time-pickerv2.scss +4 -4
  39. package/lib/scss/components/Table/_table.scss +5 -0
  40. package/package.json +4 -3
  41. package/scss/components/DateTimePicker/_date-time-pickerv2.scss +4 -4
  42. package/scss/components/Table/_table.scss +5 -0
  43. package/umd/carbon-addons-iot-react.js +212 -134
@@ -288,7 +288,7 @@ var formatChartData = function formatChartData(seriesArg, values, categoryDataSo
288
288
  group.forEach(function (value) {
289
289
  series.forEach(function (dataset) {
290
290
  // if value is null, don't add it to the formatted chartData
291
- if (!isNil(value[dataset.dataSourceId])) {
291
+ if ((!isNil(value[categoryDataSourceId]) || !isNil(dataset.label)) && (timeDataSourceId && type !== BAR_CHART_TYPES.GROUPED ? !isNil(value[timeDataSourceId]) : !isNil(value[categoryDataSourceId]))) {
292
292
  data.push(_objectSpread({
293
293
  // if there's a dataset label, use it
294
294
  group: dataset.label ? dataset.label : value[categoryDataSourceId],
@@ -320,7 +320,7 @@ var formatChartData = function formatChartData(seriesArg, values, categoryDataSo
320
320
  labeledData.forEach(function (dataset) {
321
321
  dataset.forEach(function (value) {
322
322
  // if value is null, don't add it to the formatted chartData
323
- if (!isNil(value[series[0].dataSourceId])) {
323
+ if (!isNil(value[series[0].dataSourceId] && value[categoryDataSourceId])) {
324
324
  data.push({
325
325
  group: value[categoryDataSourceId],
326
326
  // bar this data belongs to
@@ -71,6 +71,7 @@ var CardTitle = function CardTitle(_ref // eslint-disable-line react/prop-types
71
71
 
72
72
  var _usePopoverPositionin = usePopoverPositioning({
73
73
  direction: 'bottom',
74
+ defaultAlignment: 'center',
74
75
  menuOffset: getTooltipMenuOffset,
75
76
  useAutoPositioning: true,
76
77
  isOverflowMenu: true // Needed to preserve default direction (bottom)
@@ -78,7 +79,9 @@ var CardTitle = function CardTitle(_ref // eslint-disable-line react/prop-types
78
79
  }),
79
80
  _usePopoverPositionin2 = _slicedToArray(_usePopoverPositionin, 2),
80
81
  calculateMenuOffset = _usePopoverPositionin2[0],
81
- adjustedDirection = _usePopoverPositionin2[1].adjustedDirection;
82
+ _usePopoverPositionin3 = _usePopoverPositionin2[1],
83
+ adjustedDirection = _usePopoverPositionin3.adjustedDirection,
84
+ adjustedAlignment = _usePopoverPositionin3.adjustedAlignment;
82
85
 
83
86
  var _useState = useState({
84
87
  title: false,
@@ -154,7 +157,7 @@ var CardTitle = function CardTitle(_ref // eslint-disable-line react/prop-types
154
157
  var _classnames;
155
158
 
156
159
  return hasTitleTooltipFromTruncation || hasExternalTitleTextTooltip ? /*#__PURE__*/React__default.createElement(Tooltip, {
157
- align: "center",
160
+ align: adjustedAlignment,
158
161
  menuOffset: calculateMenuOffset,
159
162
  direction: adjustedDirection,
160
163
  "data-testid": "".concat(testId, "-title-tooltip"),
@@ -179,6 +182,9 @@ var CardTitle = function CardTitle(_ref // eslint-disable-line react/prop-types
179
182
 
180
183
  var renderSubTitle = function renderSubTitle() {
181
184
  return !subtitle ? null : hasSubTitleTooltip ? /*#__PURE__*/React__default.createElement(Tooltip, {
185
+ align: adjustedAlignment,
186
+ menuOffset: calculateMenuOffset,
187
+ direction: adjustedDirection,
182
188
  "data-testid": "".concat(testId, "-subtitle"),
183
189
  ref: subTitleRef,
184
190
  showIcon: false,
@@ -272,7 +272,7 @@ var defaultProps = {
272
272
  };
273
273
 
274
274
  var DateTimePicker = function DateTimePicker(_ref) {
275
- var _classnames2, _classnames4, _style$zIndex;
275
+ var _classnames, _classnames2, _classnames4, _style$zIndex;
276
276
 
277
277
  var testId = _ref.testId,
278
278
  defaultValue = _ref.defaultValue,
@@ -847,7 +847,7 @@ var DateTimePicker = function DateTimePicker(_ref) {
847
847
  }, /*#__PURE__*/React__default.createElement("div", {
848
848
  "data-testid": testId,
849
849
  id: "".concat(id, "-").concat(iotPrefix, "--date-time-pickerv2__wrapper"),
850
- className: classnames("".concat(iotPrefix, "--date-time-pickerv2__wrapper"), _defineProperty({}, "".concat(iotPrefix, "--date-time-pickerv2__wrapper--disabled"), disabled)),
850
+ className: classnames("".concat(iotPrefix, "--date-time-pickerv2__wrapper"), (_classnames = {}, _defineProperty(_classnames, "".concat(iotPrefix, "--date-time-pickerv2__wrapper--disabled"), disabled), _defineProperty(_classnames, "".concat(iotPrefix, "--date-time-pickerv2__wrapper--invalid"), invalidState), _classnames)),
851
851
  style: {
852
852
  '--wrapper-width': hasIconOnly ? '3rem' : '20rem'
853
853
  },
@@ -869,7 +869,7 @@ var DateTimePicker = function DateTimePicker(_ref) {
869
869
  onMouseLeave: toggleTooltip,
870
870
  tabIndex: 0
871
871
  }, /*#__PURE__*/React__default.createElement("div", {
872
- className: classnames((_classnames2 = {}, _defineProperty(_classnames2, "".concat(iotPrefix, "--date-time-picker__box--full"), !hasIconOnly), _defineProperty(_classnames2, "".concat(iotPrefix, "--date-time-picker__box--light"), light), _defineProperty(_classnames2, "".concat(iotPrefix, "--date-time-picker__box--invalid"), invalidState), _defineProperty(_classnames2, "".concat(iotPrefix, "--date-time-picker__box--disabled"), disabled), _classnames2))
872
+ className: classnames((_classnames2 = {}, _defineProperty(_classnames2, "".concat(iotPrefix, "--date-time-picker__box--full"), !hasIconOnly), _defineProperty(_classnames2, "".concat(iotPrefix, "--date-time-picker__box--light"), light), _defineProperty(_classnames2, "".concat(iotPrefix, "--date-time-picker__box--disabled"), disabled), _defineProperty(_classnames2, "".concat(iotPrefix, "--date-time-picker__box--invalid"), invalidState), _classnames2))
873
873
  }, !hasIconOnly ? /*#__PURE__*/React__default.createElement("div", {
874
874
  "data-testid": "".concat(testId, "__field"),
875
875
  className: "".concat(iotPrefix, "--date-time-picker__field")
@@ -253,7 +253,7 @@ var defaultProps = {
253
253
  };
254
254
 
255
255
  var DateTimePicker = function DateTimePicker(_ref) {
256
- var _classnames2, _classnames4;
256
+ var _classnames, _classnames2, _classnames4;
257
257
 
258
258
  var testId = _ref.testId,
259
259
  defaultValue = _ref.defaultValue,
@@ -706,7 +706,7 @@ var DateTimePicker = function DateTimePicker(_ref) {
706
706
  }, /*#__PURE__*/React__default.createElement("div", {
707
707
  "data-testid": testId,
708
708
  id: "".concat(id, "-").concat(iotPrefix, "--date-time-pickerv2__wrapper"),
709
- className: classnames("".concat(iotPrefix, "--date-time-pickerv2__wrapper"), _defineProperty({}, "".concat(iotPrefix, "--date-time-pickerv2__wrapper--disabled"), disabled)),
709
+ className: classnames("".concat(iotPrefix, "--date-time-pickerv2__wrapper"), (_classnames = {}, _defineProperty(_classnames, "".concat(iotPrefix, "--date-time-pickerv2__wrapper--disabled"), disabled), _defineProperty(_classnames, "".concat(iotPrefix, "--date-time-pickerv2__wrapper--invalid"), invalidState), _classnames)),
710
710
  style: {
711
711
  '--wrapper-width': hasIconOnly ? '3rem' : '20rem'
712
712
  },
@@ -728,7 +728,7 @@ var DateTimePicker = function DateTimePicker(_ref) {
728
728
  onMouseLeave: toggleTooltip,
729
729
  tabIndex: 0
730
730
  }, /*#__PURE__*/React__default.createElement("div", {
731
- className: classnames((_classnames2 = {}, _defineProperty(_classnames2, "".concat(iotPrefix, "--date-time-picker__box--full"), !hasIconOnly), _defineProperty(_classnames2, "".concat(iotPrefix, "--date-time-picker__box--light"), light), _defineProperty(_classnames2, "".concat(iotPrefix, "--date-time-picker__box--invalid"), invalidState), _defineProperty(_classnames2, "".concat(iotPrefix, "--date-time-picker__box--disabled"), disabled), _classnames2))
731
+ className: classnames((_classnames2 = {}, _defineProperty(_classnames2, "".concat(iotPrefix, "--date-time-picker__box--full"), !hasIconOnly), _defineProperty(_classnames2, "".concat(iotPrefix, "--date-time-picker__box--light"), light), _defineProperty(_classnames2, "".concat(iotPrefix, "--date-time-picker__box--disabled"), disabled), _defineProperty(_classnames2, "".concat(iotPrefix, "--date-time-picker__box--invalid"), invalidState), _classnames2))
732
732
  }, !hasIconOnly ? /*#__PURE__*/React__default.createElement("div", {
733
733
  "data-testid": "".concat(testId, "__field"),
734
734
  className: "".concat(iotPrefix, "--date-time-picker__field")
@@ -55,6 +55,9 @@ var IdleLogoutConfirmationModalI18NPropTypes = {
55
55
  sessionTimeoutModalStayLoggedInButton: PropTypes.string
56
56
  };
57
57
  var defaultProps = {
58
+ isAdminView: null,
59
+ appId: null,
60
+ workspaceId: null,
58
61
  className: null,
59
62
  idleTimeoutData: {
60
63
  timeout: 1800,
@@ -96,6 +99,15 @@ var defaultProps = {
96
99
  }
97
100
  };
98
101
  var propTypes = {
102
+ /** If true, include the originIsAdmin query param in the logout URL */
103
+ isAdminView: PropTypes.bool,
104
+
105
+ /** Application ID in suite */
106
+ appId: PropTypes.string,
107
+
108
+ /** Workspace ID in suite */
109
+ workspaceId: PropTypes.string,
110
+
99
111
  /** Add class name to the rendered Modal component */
100
112
  className: PropTypes.string,
101
113
 
@@ -116,7 +128,10 @@ var propTypes = {
116
128
  };
117
129
 
118
130
  var IdleLogoutConfirmationModal = function IdleLogoutConfirmationModal(_ref) {
119
- var className = _ref.className,
131
+ var isAdminView = _ref.isAdminView,
132
+ appId = _ref.appId,
133
+ workspaceId = _ref.workspaceId,
134
+ className = _ref.className,
120
135
  idleTimeoutData = _ref.idleTimeoutData,
121
136
  routes = _ref.routes,
122
137
  onRouteChange = _ref.onRouteChange,
@@ -133,7 +148,7 @@ var IdleLogoutConfirmationModal = function IdleLogoutConfirmationModal(_ref) {
133
148
 
134
149
  return acc.replace(key, val);
135
150
  }, string);
136
- }, []); // Append originHref query parameter to the logout routes
151
+ }, []); // Append originHref query parameter (and, optionally, originIsAdmin, originWorkspaceId and originAppId) to the logout routes
137
152
 
138
153
  var logoutRoute = routes === null || routes === void 0 ? void 0 : routes.logout;
139
154
 
@@ -142,8 +157,21 @@ var IdleLogoutConfirmationModal = function IdleLogoutConfirmationModal(_ref) {
142
157
 
143
158
  if (window.location.href) {
144
159
  url.searchParams.append('originHref', window.location.href);
145
- logoutRoute = url.href;
146
160
  }
161
+
162
+ if (appId) {
163
+ url.searchParams.append('originAppId', appId);
164
+ }
165
+
166
+ if (workspaceId) {
167
+ url.searchParams.append('originWorkspaceId', workspaceId);
168
+ }
169
+
170
+ if (isAdminView) {
171
+ url.searchParams.append('originIsAdmin', isAdminView);
172
+ }
173
+
174
+ logoutRoute = url.href;
147
175
  } catch (e) {
148
176
  logoutRoute = routes === null || routes === void 0 ? void 0 : routes.logout;
149
177
  }
@@ -155,9 +183,21 @@ var IdleLogoutConfirmationModal = function IdleLogoutConfirmationModal(_ref) {
155
183
 
156
184
  if (window.location.href) {
157
185
  _url.searchParams.append('originHref', window.location.href);
186
+ }
158
187
 
159
- logoutInactivityRoute = _url.href;
188
+ if (appId) {
189
+ _url.searchParams.append('originAppId', appId);
160
190
  }
191
+
192
+ if (workspaceId) {
193
+ _url.searchParams.append('originWorkspaceId', workspaceId);
194
+ }
195
+
196
+ if (isAdminView) {
197
+ _url.searchParams.append('originIsAdmin', isAdminView);
198
+ }
199
+
200
+ logoutInactivityRoute = _url.href;
161
201
  } catch (e) {
162
202
  logoutInactivityRoute = routes === null || routes === void 0 ? void 0 : routes.logoutInactivity;
163
203
  } // This state is just to force the recreation of the IdleTimer object in the useEffect below
@@ -315,6 +355,39 @@ IdleLogoutConfirmationModal.__docgenInfo = {
315
355
  "methods": [],
316
356
  "displayName": "IdleLogoutConfirmationModal",
317
357
  "props": {
358
+ "isAdminView": {
359
+ "defaultValue": {
360
+ "value": "null",
361
+ "computed": false
362
+ },
363
+ "type": {
364
+ "name": "bool"
365
+ },
366
+ "required": false,
367
+ "description": "If true, include the originIsAdmin query param in the logout URL"
368
+ },
369
+ "appId": {
370
+ "defaultValue": {
371
+ "value": "null",
372
+ "computed": false
373
+ },
374
+ "type": {
375
+ "name": "string"
376
+ },
377
+ "required": false,
378
+ "description": "Application ID in suite"
379
+ },
380
+ "workspaceId": {
381
+ "defaultValue": {
382
+ "value": "null",
383
+ "computed": false
384
+ },
385
+ "type": {
386
+ "name": "string"
387
+ },
388
+ "required": false,
389
+ "description": "Workspace ID in suite"
390
+ },
318
391
  "className": {
319
392
  "defaultValue": {
320
393
  "value": "null",
@@ -206,6 +206,8 @@ var propTypes = {
206
206
  };
207
207
 
208
208
  var SuiteHeader = function SuiteHeader(_ref) {
209
+ var _currentWorkspace$app, _currentWorkspace$app2, _currentWorkspace$app3, _applications$find;
210
+
209
211
  var className = _ref.className,
210
212
  suiteName = _ref.suiteName,
211
213
  appName = _ref.appName,
@@ -265,7 +267,12 @@ var SuiteHeader = function SuiteHeader(_ref) {
265
267
  var isMultiWorkspace = (workspaces === null || workspaces === void 0 ? void 0 : workspaces.length) > 0;
266
268
  var currentWorkspace = workspaces === null || workspaces === void 0 ? void 0 : workspaces.find(function (wo) {
267
269
  return wo.isCurrent;
268
- }); // Include the current workspace label only if we are not in an admin page and multi workspace is supported and more than one workspace is available
270
+ });
271
+ var appId = (_currentWorkspace$app = currentWorkspace === null || currentWorkspace === void 0 ? void 0 : (_currentWorkspace$app2 = currentWorkspace.applications) === null || _currentWorkspace$app2 === void 0 ? void 0 : (_currentWorkspace$app3 = _currentWorkspace$app2.find(function (a) {
272
+ return a.isCurrent;
273
+ })) === null || _currentWorkspace$app3 === void 0 ? void 0 : _currentWorkspace$app3.id) !== null && _currentWorkspace$app !== void 0 ? _currentWorkspace$app : applications === null || applications === void 0 ? void 0 : (_applications$find = applications.find(function (a) {
274
+ return a.isCurrent;
275
+ })) === null || _applications$find === void 0 ? void 0 : _applications$find.id; // Include the current workspace label only if we are not in an admin page and multi workspace is supported and more than one workspace is available
269
276
 
270
277
  var currentWorkspaceComponent = !isAdminView && isMultiWorkspace && (workspaces === null || workspaces === void 0 ? void 0 : workspaces.length) > 1 && currentWorkspace ? /*#__PURE__*/React__default.createElement("span", {
271
278
  "data-testid": "".concat(testId, "--current-workspace")
@@ -278,7 +285,7 @@ var SuiteHeader = function SuiteHeader(_ref) {
278
285
  className: "".concat(settings.iotPrefix, "--suite-header-subtitle")
279
286
  }, extraContent) : null;
280
287
  var navigatorRoute = (currentWorkspace === null || currentWorkspace === void 0 ? void 0 : currentWorkspace.href) || (routes === null || routes === void 0 ? void 0 : routes.navigator) || 'javascript:void(0)';
281
- var adminRoute = (routes === null || routes === void 0 ? void 0 : routes.admin) || 'javascript:void(0)'; // Append originHref query parameter to the logout route
288
+ var adminRoute = (routes === null || routes === void 0 ? void 0 : routes.admin) || 'javascript:void(0)'; // Append originHref query parameter (and, optionally, originIsAdmin, originWorkspaceId and originAppId) to the logout route
282
289
 
283
290
  var logoutRoute = routes === null || routes === void 0 ? void 0 : routes.logout;
284
291
 
@@ -287,8 +294,21 @@ var SuiteHeader = function SuiteHeader(_ref) {
287
294
 
288
295
  if (window.location.href) {
289
296
  url.searchParams.append('originHref', window.location.href);
290
- logoutRoute = url.href;
291
297
  }
298
+
299
+ if (appId) {
300
+ url.searchParams.append('originAppId', appId);
301
+ }
302
+
303
+ if (currentWorkspace !== null && currentWorkspace !== void 0 && currentWorkspace.id) {
304
+ url.searchParams.append('originWorkspaceId', currentWorkspace.id);
305
+ }
306
+
307
+ if (isAdminView) {
308
+ url.searchParams.append('originIsAdmin', isAdminView);
309
+ }
310
+
311
+ logoutRoute = url.href;
292
312
  } catch (e) {
293
313
  logoutRoute = routes === null || routes === void 0 ? void 0 : routes.logout;
294
314
  } // If there are custom help links, include an extra child content entry for the separator
@@ -365,6 +385,9 @@ var SuiteHeader = function SuiteHeader(_ref) {
365
385
  return setShowToast(false);
366
386
  }
367
387
  }) : null, idleTimeoutData && (routes === null || routes === void 0 ? void 0 : routes.domain) !== null && (routes === null || routes === void 0 ? void 0 : routes.domain) !== undefined ? /*#__PURE__*/React__default.createElement(IdleLogoutConfirmationModal, {
388
+ isAdminView: isAdminView,
389
+ appId: appId,
390
+ workspaceId: currentWorkspace === null || currentWorkspace === void 0 ? void 0 : currentWorkspace.id,
368
391
  idleTimeoutData: idleTimeoutData,
369
392
  routes: routes,
370
393
  onRouteChange: onRouteChange,
@@ -10,6 +10,8 @@ var useUiResources = function useUiResources(_ref) {
10
10
  lang = _ref$lang === void 0 ? 'en' : _ref$lang,
11
11
  _ref$surveyId = _ref.surveyId,
12
12
  surveyId = _ref$surveyId === void 0 ? null : _ref$surveyId,
13
+ _ref$appId = _ref.appId,
14
+ appId = _ref$appId === void 0 ? null : _ref$appId,
13
15
  _ref$workspaceId = _ref.workspaceId,
14
16
  workspaceId = _ref$workspaceId === void 0 ? null : _ref$workspaceId,
15
17
  _ref$fetchApi = _ref.fetchApi,
@@ -55,6 +57,7 @@ var useUiResources = function useUiResources(_ref) {
55
57
  baseApiUrl: baseApiUrl,
56
58
  lang: lang,
57
59
  surveyId: surveyId,
60
+ appId: appId,
58
61
  workspaceId: workspaceId,
59
62
  fetchApi: fetchApi,
60
63
  isTest: isTest
@@ -82,7 +85,7 @@ var useUiResources = function useUiResources(_ref) {
82
85
  }
83
86
  }
84
87
  }, _callee, null, [[0, 8, 11, 14]]);
85
- })), [baseApiUrl, lang, surveyId, workspaceId, isTest, setIsLoading]); // eslint-disable-line react-hooks/exhaustive-deps
88
+ })), [baseApiUrl, lang, surveyId, appId, workspaceId, isTest, setIsLoading]); // eslint-disable-line react-hooks/exhaustive-deps
86
89
 
87
90
  useEffect(function () {
88
91
  // load actual data
@@ -46,13 +46,13 @@ var defaultFetchApi = /*#__PURE__*/function () {
46
46
 
47
47
  var getUiResourcesData = /*#__PURE__*/function () {
48
48
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
49
- var baseApiUrl, _ref2$lang, lang, _ref2$surveyId, surveyId, _ref2$workspaceId, workspaceId, _ref2$fetchApi, fetchApi, _ref2$isTest, isTest, api, langParam, surveyIdParam, workspaceIdParam;
49
+ var baseApiUrl, _ref2$lang, lang, _ref2$surveyId, surveyId, _ref2$appId, appId, _ref2$workspaceId, workspaceId, _ref2$fetchApi, fetchApi, _ref2$isTest, isTest, api, langParam, surveyIdParam, appIdParam, workspaceIdParam;
50
50
 
51
51
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
52
52
  while (1) {
53
53
  switch (_context2.prev = _context2.next) {
54
54
  case 0:
55
- baseApiUrl = _ref2.baseApiUrl, _ref2$lang = _ref2.lang, lang = _ref2$lang === void 0 ? 'en' : _ref2$lang, _ref2$surveyId = _ref2.surveyId, surveyId = _ref2$surveyId === void 0 ? null : _ref2$surveyId, _ref2$workspaceId = _ref2.workspaceId, workspaceId = _ref2$workspaceId === void 0 ? null : _ref2$workspaceId, _ref2$fetchApi = _ref2.fetchApi, fetchApi = _ref2$fetchApi === void 0 ? defaultFetchApi : _ref2$fetchApi, _ref2$isTest = _ref2.isTest, isTest = _ref2$isTest === void 0 ? false : _ref2$isTest;
55
+ baseApiUrl = _ref2.baseApiUrl, _ref2$lang = _ref2.lang, lang = _ref2$lang === void 0 ? 'en' : _ref2$lang, _ref2$surveyId = _ref2.surveyId, surveyId = _ref2$surveyId === void 0 ? null : _ref2$surveyId, _ref2$appId = _ref2.appId, appId = _ref2$appId === void 0 ? null : _ref2$appId, _ref2$workspaceId = _ref2.workspaceId, workspaceId = _ref2$workspaceId === void 0 ? null : _ref2$workspaceId, _ref2$fetchApi = _ref2.fetchApi, fetchApi = _ref2$fetchApi === void 0 ? defaultFetchApi : _ref2$fetchApi, _ref2$isTest = _ref2.isTest, isTest = _ref2$isTest === void 0 ? false : _ref2$isTest;
56
56
 
57
57
  api = function api(method, path, body, headers) {
58
58
  return fetchApi(method, "".concat(baseApiUrl).concat(path), body, headers, isTest ? fixture[path.split('?')[0]] : null);
@@ -60,10 +60,11 @@ var getUiResourcesData = /*#__PURE__*/function () {
60
60
 
61
61
  langParam = "&lang=".concat(lang);
62
62
  surveyIdParam = surveyId ? "&surveyId=".concat(surveyId) : '';
63
+ appIdParam = appId ? "&appId=".concat(appId) : '';
63
64
  workspaceIdParam = workspaceId ? "&workspaceId=".concat(workspaceId) : '';
64
- return _context2.abrupt("return", api('GET', "/uiresources?id=masthead".concat(langParam).concat(surveyIdParam).concat(workspaceIdParam)));
65
+ return _context2.abrupt("return", api('GET', "/uiresources?id=masthead".concat(langParam).concat(surveyIdParam).concat(appIdParam).concat(workspaceIdParam)));
65
66
 
66
- case 6:
67
+ case 7:
67
68
  case "end":
68
69
  return _context2.stop();
69
70
  }
@@ -37,6 +37,7 @@ import { useLangDirection } from 'use-lang-direction';
37
37
  import warning from 'warning';
38
38
  import { defaultFunction } from '../../utils/componentUtilityFunctions.js';
39
39
  import { settings } from '../../constants/Settings.js';
40
+ import { WrapCellTextPropTypes } from '../../constants/SharedPropTypes.js';
40
41
  import FilterTags from '../FilterTags/FilterTags.js';
41
42
  import { RuleGroupPropType } from '../RuleBuilder/RuleBuilderPropTypes.js';
42
43
  import deprecate$1 from '../../internal/experimental.js';
@@ -158,8 +159,9 @@ var propTypes = {
158
159
  * always - Wrap if needed for all table column configurations
159
160
  * never - Tables with dynamic columns widths grow larger and tables with fixed or resizable columns truncate.
160
161
  * alwaysTruncate - Always truncate if needed for all table column configurations
162
+ * expand - Expand to fit text width (by horizontal scrollbar) for table with fixed columns
161
163
  */
162
- wrapCellText: PropTypes.oneOf(['always', 'never', 'auto', 'alwaysTruncate']),
164
+ wrapCellText: WrapCellTextPropTypes,
163
165
 
164
166
  /** use white-space: pre; css when true */
165
167
  preserveCellWhiteSpace: PropTypes.bool
@@ -708,7 +710,7 @@ var Table = function Table(props) {
708
710
  forceUpdateCellTextWidth = _useState4[1];
709
711
 
710
712
  var useCellTextTruncate = useMemo(function () {
711
- return options ? options.wrapCellText === 'alwaysTruncate' || options.wrapCellText !== 'always' && (options.hasResize && !options.useAutoTableLayoutForResize || columns.some(function (col) {
713
+ return options ? options.wrapCellText === 'alwaysTruncate' || options.wrapCellText !== 'always' && options.wrapCellText !== 'expand' && (options.hasResize && !options.useAutoTableLayoutForResize || columns.some(function (col) {
712
714
  return col.hasOwnProperty('width');
713
715
  })) : undefined;
714
716
  }, [options, columns]);
@@ -1318,21 +1320,9 @@ Table.__docgenInfo = {
1318
1320
  "required": false
1319
1321
  },
1320
1322
  "wrapCellText": {
1321
- "name": "enum",
1322
- "value": [{
1323
- "value": "'always'",
1324
- "computed": false
1325
- }, {
1326
- "value": "'never'",
1327
- "computed": false
1328
- }, {
1329
- "value": "'auto'",
1330
- "computed": false
1331
- }, {
1332
- "value": "'alwaysTruncate'",
1333
- "computed": false
1334
- }],
1335
- "description": "auto - Wrap for tables with dynamic columns widths and truncate for tables with fixed or resizable columns\nalways - Wrap if needed for all table column configurations\nnever - Tables with dynamic columns widths grow larger and tables with fixed or resizable columns truncate.\nalwaysTruncate - Always truncate if needed for all table column configurations",
1323
+ "name": "custom",
1324
+ "raw": "WrapCellTextPropTypes",
1325
+ "description": "auto - Wrap for tables with dynamic columns widths and truncate for tables with fixed or resizable columns\nalways - Wrap if needed for all table column configurations\nnever - Tables with dynamic columns widths grow larger and tables with fixed or resizable columns truncate.\nalwaysTruncate - Always truncate if needed for all table column configurations\nexpand - Expand to fit text width (by horizontal scrollbar) for table with fixed columns",
1336
1326
  "required": false
1337
1327
  },
1338
1328
  "preserveCellWhiteSpace": {
@@ -22,6 +22,7 @@ import PropTypes from 'prop-types';
22
22
  import { TableBody as TableBody$1 } from 'carbon-components-react';
23
23
  import { TableRowsPropTypes, ExpandedRowsPropTypes, TableColumnsPropTypes, RowActionsStatePropTypes } from '../TablePropTypes.js';
24
24
  import deprecate from '../../../internal/deprecate.js';
25
+ import { WrapCellTextPropTypes } from '../../../constants/SharedPropTypes.js';
25
26
  import { tableTraverser, findRow } from '../tableUtilities.js';
26
27
  import TableBodyRowRenderer from './TableBodyRowRenderer.js';
27
28
 
@@ -74,7 +75,7 @@ var propTypes = {
74
75
  hasSingleNestedHierarchy: PropTypes.bool
75
76
  })]),
76
77
  hasRowActions: PropTypes.bool,
77
- wrapCellText: PropTypes.oneOf(['always', 'never', 'auto', 'alwaysTruncate']).isRequired,
78
+ wrapCellText: WrapCellTextPropTypes.isRequired,
78
79
  truncateCellText: PropTypes.bool.isRequired,
79
80
 
80
81
  /** the current state of the row actions */
@@ -776,22 +777,10 @@ TableBody.__docgenInfo = {
776
777
  },
777
778
  "wrapCellText": {
778
779
  "type": {
779
- "name": "enum",
780
- "value": [{
781
- "value": "'always'",
782
- "computed": false
783
- }, {
784
- "value": "'never'",
785
- "computed": false
786
- }, {
787
- "value": "'auto'",
788
- "computed": false
789
- }, {
790
- "value": "'alwaysTruncate'",
791
- "computed": false
792
- }]
780
+ "name": "custom",
781
+ "raw": "WrapCellTextPropTypes.isRequired"
793
782
  },
794
- "required": true,
783
+ "required": false,
795
784
  "description": ""
796
785
  },
797
786
  "truncateCellText": {
@@ -12,6 +12,7 @@ import PropTypes from 'prop-types';
12
12
  import { TableCell, TableRow, Checkbox, RadioButton } from 'carbon-components-react';
13
13
  import classnames from 'classnames';
14
14
  import { settings } from '../../../../constants/Settings.js';
15
+ import { WrapCellTextPropTypes } from '../../../../constants/SharedPropTypes.js';
15
16
  import RowActionsCell from '../RowActionsCell/RowActionsCell.js';
16
17
  import TableCellRenderer from '../../TableCellRenderer/TableCellRenderer.js';
17
18
  import { TableColumnsPropTypes, RowActionPropTypes, RowActionErrorPropTypes } from '../../TablePropTypes.js';
@@ -63,7 +64,7 @@ var propTypes = {
63
64
  })]),
64
65
  hasRowActions: PropTypes.bool,
65
66
  shouldExpandOnRowClick: PropTypes.bool,
66
- wrapCellText: PropTypes.oneOf(['always', 'never', 'auto', 'alwaysTruncate']).isRequired,
67
+ wrapCellText: WrapCellTextPropTypes.isRequired,
67
68
  truncateCellText: PropTypes.bool.isRequired,
68
69
 
69
70
  /** use white-space: pre; css when true */
@@ -185,7 +186,7 @@ var defaultProps = {
185
186
  };
186
187
 
187
188
  var TableBodyRow = function TableBodyRow(_ref) {
188
- var _classnames4, _classnames5, _classnames6;
189
+ var _classnames5, _classnames6, _classnames7;
189
190
 
190
191
  var id = _ref.id,
191
192
  tableId = _ref.tableId,
@@ -311,7 +312,7 @@ var TableBodyRow = function TableBodyRow(_ref) {
311
312
  className: classnames("data-table-".concat(align), (_classnames = {}, _defineProperty(_classnames, "".concat(iotPrefix, "--table__cell--truncate"), truncateCellText), _defineProperty(_classnames, "".concat(iotPrefix, "--table__cell--sortable"), sortable), _classnames)),
312
313
  width: initialColumnWidth
313
314
  }, /*#__PURE__*/React__default.createElement("span", {
314
- className: "".concat(iotPrefix, "--table__cell__offset"),
315
+ className: classnames("".concat(iotPrefix, "--table__cell__offset"), _defineProperty({}, "".concat(iotPrefix, "--table__cell__offset__expand"), wrapCellText === 'expand')),
315
316
  style: {
316
317
  '--row-nesting-offset': "".concat(offset, "px")
317
318
  }
@@ -399,7 +400,7 @@ var TableBodyRow = function TableBodyRow(_ref) {
399
400
  }, rowDetails))) : /*#__PURE__*/React__default.createElement(TableExpandRow, {
400
401
  key: id,
401
402
  expandHeaderId: "".concat(tableId, "-expand"),
402
- className: classnames("".concat(iotPrefix, "--expandable-tablerow"), (_classnames4 = {}, _defineProperty(_classnames4, "".concat(iotPrefix, "--expandable-tablerow--parent"), hasRowNesting && (hasRowNesting === null || hasRowNesting === void 0 ? void 0 : hasRowNesting.hasSingleNestedHierarchy) && nestingChildCount > 0), _defineProperty(_classnames4, "".concat(iotPrefix, "--expandable-tablerow--childless"), hasRowNesting && nestingChildCount === 0), _defineProperty(_classnames4, "".concat(iotPrefix, "--expandable-tablerow--indented"), parseInt(nestingOffset, 10) > 0), _defineProperty(_classnames4, "".concat(iotPrefix, "--expandable-tablerow--singly-selected"), hasRowSelection === 'single' && isSelected && !useRadioButtonSingleSelect), _defineProperty(_classnames4, "".concat(iotPrefix, "--expandable-tablerow--last-child"), isLastChild), _classnames4)),
403
+ className: classnames("".concat(iotPrefix, "--expandable-tablerow"), (_classnames5 = {}, _defineProperty(_classnames5, "".concat(iotPrefix, "--expandable-tablerow--parent"), hasRowNesting && (hasRowNesting === null || hasRowNesting === void 0 ? void 0 : hasRowNesting.hasSingleNestedHierarchy) && nestingChildCount > 0), _defineProperty(_classnames5, "".concat(iotPrefix, "--expandable-tablerow--childless"), hasRowNesting && nestingChildCount === 0), _defineProperty(_classnames5, "".concat(iotPrefix, "--expandable-tablerow--indented"), parseInt(nestingOffset, 10) > 0), _defineProperty(_classnames5, "".concat(iotPrefix, "--expandable-tablerow--singly-selected"), hasRowSelection === 'single' && isSelected && !useRadioButtonSingleSelect), _defineProperty(_classnames5, "".concat(iotPrefix, "--expandable-tablerow--last-child"), isLastChild), _classnames5)),
403
404
  "data-row-nesting": hasRowNesting,
404
405
  "data-child-count": nestingChildCount,
405
406
  "data-nesting-offset": nestingOffset,
@@ -430,7 +431,7 @@ var TableBodyRow = function TableBodyRow(_ref) {
430
431
  rowId: id,
431
432
  langDir: langDir
432
433
  }, tableCells) : hasRowSelection === 'single' && isSelected ? /*#__PURE__*/React__default.createElement(TableRow, {
433
- className: classnames("".concat(iotPrefix, "--table__row"), (_classnames5 = {}, _defineProperty(_classnames5, "".concat(iotPrefix, "--table__row--singly-selected"), isSelected && !useRadioButtonSingleSelect), _defineProperty(_classnames5, "".concat(iotPrefix, "--table__row--background"), isSelected), _classnames5)),
434
+ className: classnames("".concat(iotPrefix, "--table__row"), (_classnames6 = {}, _defineProperty(_classnames6, "".concat(iotPrefix, "--table__row--singly-selected"), isSelected && !useRadioButtonSingleSelect), _defineProperty(_classnames6, "".concat(iotPrefix, "--table__row--background"), isSelected), _classnames6)),
434
435
  key: id,
435
436
  onClick: function onClick() {
436
437
  if (isSelectable !== false) {
@@ -442,7 +443,7 @@ var TableBodyRow = function TableBodyRow(_ref) {
442
443
  }
443
444
  }
444
445
  }, tableCells) : /*#__PURE__*/React__default.createElement(TableRow, {
445
- className: classnames("".concat(iotPrefix, "--table__row"), (_classnames6 = {}, _defineProperty(_classnames6, "".concat(iotPrefix, "--table__row--unselectable"), isSelectable === false), _defineProperty(_classnames6, "".concat(iotPrefix, "--table__row--selectable"), isSelectable !== false), _defineProperty(_classnames6, "".concat(iotPrefix, "--table__row--editing"), isEditMode), _defineProperty(_classnames6, "".concat(iotPrefix, "--table__row--selected"), isSelected), _classnames6)),
446
+ className: classnames("".concat(iotPrefix, "--table__row"), (_classnames7 = {}, _defineProperty(_classnames7, "".concat(iotPrefix, "--table__row--unselectable"), isSelectable === false), _defineProperty(_classnames7, "".concat(iotPrefix, "--table__row--selectable"), isSelectable !== false), _defineProperty(_classnames7, "".concat(iotPrefix, "--table__row--editing"), isEditMode), _defineProperty(_classnames7, "".concat(iotPrefix, "--table__row--selected"), isSelected), _classnames7)),
446
447
  key: id,
447
448
  onClick: function onClick() {
448
449
  if (isSelectable !== false) {
@@ -636,20 +637,8 @@ TableBodyRow.__docgenInfo = {
636
637
  "required": false
637
638
  },
638
639
  "wrapCellText": {
639
- "name": "enum",
640
- "value": [{
641
- "value": "'always'",
642
- "computed": false
643
- }, {
644
- "value": "'never'",
645
- "computed": false
646
- }, {
647
- "value": "'auto'",
648
- "computed": false
649
- }, {
650
- "value": "'alwaysTruncate'",
651
- "computed": false
652
- }],
640
+ "name": "custom",
641
+ "raw": "WrapCellTextPropTypes.isRequired",
653
642
  "required": true
654
643
  },
655
644
  "truncateCellText": {
@@ -19,6 +19,7 @@ import 'core-js/modules/es.array.map.js';
19
19
  import React__default, { useRef } from 'react';
20
20
  import PropTypes from 'prop-types';
21
21
  import useVisibilityObserver from '../../../hooks/useVisibilityObserver.js';
22
+ import { WrapCellTextPropTypes } from '../../../constants/SharedPropTypes.js';
22
23
  import { ExpandedRowsPropTypes, TableColumnsPropTypes, RowActionsStatePropTypes, TableRowPropTypes, TableRowsPropTypes } from '../TablePropTypes.js';
23
24
  import TableBodyRow from './TableBodyRow/TableBodyRow.js';
24
25
  import TableBodyLoadMoreRow from './TableBodyLoadMoreRow/TableBodyLoadMoreRow.js';
@@ -74,7 +75,7 @@ var propTypes = {
74
75
  hasSingleNestedHierarchy: PropTypes.bool
75
76
  })]),
76
77
  hasRowActions: PropTypes.bool,
77
- wrapCellText: PropTypes.oneOf(['always', 'never', 'auto', 'alwaysTruncate']).isRequired,
78
+ wrapCellText: WrapCellTextPropTypes.isRequired,
78
79
  truncateCellText: PropTypes.bool.isRequired,
79
80
 
80
81
  /** the current state of the row actions */
@@ -797,22 +798,10 @@ TableBodyRowRenderer.__docgenInfo = {
797
798
  },
798
799
  "wrapCellText": {
799
800
  "type": {
800
- "name": "enum",
801
- "value": [{
802
- "value": "'always'",
803
- "computed": false
804
- }, {
805
- "value": "'never'",
806
- "computed": false
807
- }, {
808
- "value": "'auto'",
809
- "computed": false
810
- }, {
811
- "value": "'alwaysTruncate'",
812
- "computed": false
813
- }]
801
+ "name": "custom",
802
+ "raw": "WrapCellTextPropTypes.isRequired"
814
803
  },
815
- "required": true,
804
+ "required": false,
816
805
  "description": ""
817
806
  },
818
807
  "truncateCellText": {
@@ -9,11 +9,12 @@ import classnames from 'classnames';
9
9
  import { TooltipDefinition, Tooltip } from 'carbon-components-react';
10
10
  import warning from 'warning';
11
11
  import { settings } from '../../../constants/Settings.js';
12
+ import { WrapCellTextPropTypes } from '../../../constants/SharedPropTypes.js';
12
13
 
13
14
  var iotPrefix = settings.iotPrefix;
14
15
  var propTypes = {
15
16
  children: PropTypes.oneOfType([PropTypes.node, PropTypes.bool, PropTypes.object, PropTypes.array]),
16
- wrapText: PropTypes.oneOf(['always', 'never', 'auto', 'alwaysTruncate']).isRequired,
17
+ wrapText: WrapCellTextPropTypes.isRequired,
17
18
  truncateCellText: PropTypes.bool.isRequired,
18
19
  allowTooltip: PropTypes.bool,
19
20
 
@@ -74,7 +75,7 @@ var TableCellRenderer = function TableCellRenderer(_ref) {
74
75
  filterFunction = _ref.filterFunction,
75
76
  preserveCellWhiteSpace = _ref.preserveCellWhiteSpace;
76
77
  var mySpanRef = /*#__PURE__*/React__default.createRef();
77
- var myClasses = classnames((_classnames = {}, _defineProperty(_classnames, "".concat(iotPrefix, "--table__cell-text--truncate"), wrapText !== 'always' && truncateCellText), _defineProperty(_classnames, "".concat(iotPrefix, "--table__cell-text--no-wrap"), wrapText === 'never'), _defineProperty(_classnames, "".concat(iotPrefix, "--table__cell-text--preserve"), preserveCellWhiteSpace), _classnames));
78
+ var myClasses = classnames((_classnames = {}, _defineProperty(_classnames, "".concat(iotPrefix, "--table__cell-text--truncate"), wrapText !== 'always' && truncateCellText), _defineProperty(_classnames, "".concat(iotPrefix, "--table__cell-text--no-wrap"), wrapText === 'never' || wrapText === 'expand'), _defineProperty(_classnames, "".concat(iotPrefix, "--table__cell-text--preserve"), preserveCellWhiteSpace), _classnames));
78
79
 
79
80
  var _useState = useState(false),
80
81
  _useState2 = _slicedToArray(_useState, 2),
@@ -254,22 +255,10 @@ TableCellRenderer.__docgenInfo = {
254
255
  },
255
256
  "wrapText": {
256
257
  "type": {
257
- "name": "enum",
258
- "value": [{
259
- "value": "'always'",
260
- "computed": false
261
- }, {
262
- "value": "'never'",
263
- "computed": false
264
- }, {
265
- "value": "'auto'",
266
- "computed": false
267
- }, {
268
- "value": "'alwaysTruncate'",
269
- "computed": false
270
- }]
258
+ "name": "custom",
259
+ "raw": "WrapCellTextPropTypes.isRequired"
271
260
  },
272
- "required": true,
261
+ "required": false,
273
262
  "description": ""
274
263
  },
275
264
  "truncateCellText": {