carbon-addons-iot-react 2.156.0 → 2.156.1

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.
@@ -287,7 +287,7 @@ var Card = function Card(props) {
287
287
  error = props.error,
288
288
  hideHeader = props.hideHeader,
289
289
  id = props.id,
290
- tooltip = props.tooltip,
290
+ tooltipProp = props.tooltip,
291
291
  titleTextTooltip = props.titleTextTooltip,
292
292
  timeRange = props.timeRange,
293
293
  timeRangeOptions = props.timeRangeOptions,
@@ -315,7 +315,8 @@ var Card = function Card(props) {
315
315
  others = _objectWithoutProperties(props, ["size", "children", "title", "subtitle", "hasTitleWrap", "layout", "isLoading", "isEmpty", "isEditable", "isExpanded", "isLazyLoading", "isResizable", "resizeHandles", "error", "hideHeader", "id", "tooltip", "titleTextTooltip", "timeRange", "timeRangeOptions", "onCardAction", "availableActions", "renderExpandIcon", "renderDateDropdownInPortal", "breakpoint", "i18n", "style", "className", "values", "testID", "testId", "contentClassName", "footerContent", "dateTimeMask", "extraActions", "padding", "overrides", "type", "data", "content", "shouldUseTranslatedLabels"]); // Get translated title if shouldUseTranslatedLabels is true
316
316
 
317
317
 
318
- var title = getTranslatedLabel(titleProp, shouldUseTranslatedLabels, i18n); // TODO: remove once final version of range prop is supported
318
+ var title = getTranslatedLabel(titleProp, shouldUseTranslatedLabels, i18n);
319
+ var tooltip = getTranslatedLabel(tooltipProp, shouldUseTranslatedLabels, i18n); // TODO: remove once final version of range prop is supported
319
320
 
320
321
  useEffect(function () {
321
322
  if (typeof (availableActions === null || availableActions === void 0 ? void 0 : availableActions.range) === 'string') {
@@ -495,7 +495,7 @@ var DataSeriesFormItemModal = function DataSeriesFormItemModal(_ref) {
495
495
  unit: evt.target.value
496
496
  }));
497
497
  },
498
- value: editDataItem.unit
498
+ value: getTranslatedLabel(editDataItem.unit, shouldUseTranslatedLabels, i18n)
499
499
  })), hasDecimalPlacesDropdown && /*#__PURE__*/React__default.createElement("div", {
500
500
  className: "".concat(baseClassName, "--input-group--item-end")
501
501
  }, /*#__PURE__*/React__default.createElement(Dropdown, {
@@ -186,7 +186,7 @@ var CommonCardEditFormFields = function CommonCardEditFormFields(_ref) {
186
186
  description: evt.target.value
187
187
  }));
188
188
  },
189
- value: description
189
+ value: getTranslatedLabel(description, shouldUseTranslatedLabels, mergedI18n)
190
190
  })), /*#__PURE__*/React__default.createElement("div", {
191
191
  className: "".concat(baseClassName, "--input")
192
192
  }, /*#__PURE__*/React__default.createElement(Dropdown, {
@@ -118,6 +118,7 @@ var Attribute = function Attribute(_ref) {
118
118
  var attributeWidthPercentage = layout === CARD_LAYOUTS.HORIZONTAL ? 100 / attributeCount : 100; // Get translated label if shouldUseTranslatedLabels is true
119
119
 
120
120
  var displayLabel = getTranslatedLabel(label, shouldUseTranslatedLabels, i18n);
121
+ var displayUnitLabel = getTranslatedLabel(unit, shouldUseTranslatedLabels, i18n);
121
122
  return /*#__PURE__*/React__default.createElement("div", {
122
123
  className: classnames("".concat(BEM_BASE, "-wrapper"), (_classnames = {}, _defineProperty(_classnames, "".concat(BEM_BASE, "-wrapper--vertical"), layout === CARD_LAYOUTS.VERTICAL), _defineProperty(_classnames, "".concat(BEM_BASE, "-wrapper--horizontal"), layout === CARD_LAYOUTS.HORIZONTAL), _classnames)),
123
124
  style: {
@@ -155,7 +156,7 @@ var Attribute = function Attribute(_ref) {
155
156
  measurementUnitLabel: measurementUnitLabel,
156
157
  onClick: onValueClick
157
158
  }), /*#__PURE__*/React__default.createElement(UnitRenderer, {
158
- unit: unit,
159
+ unit: displayUnitLabel,
159
160
  testId: "".concat(testId, "-unit")
160
161
  })), !isNil(secondaryValue) ? /*#__PURE__*/React__default.createElement("div", {
161
162
  "data-testid": "".concat(testId, "-secondary-value"),
@@ -302,7 +302,7 @@ var Card = function Card(props) {
302
302
  error = props.error,
303
303
  hideHeader = props.hideHeader,
304
304
  id = props.id,
305
- tooltip = props.tooltip,
305
+ tooltipProp = props.tooltip,
306
306
  titleTextTooltip = props.titleTextTooltip,
307
307
  timeRange = props.timeRange,
308
308
  timeRangeOptions = props.timeRangeOptions,
@@ -330,7 +330,8 @@ var Card = function Card(props) {
330
330
  others = _objectWithoutProperties__default["default"](props, ["size", "children", "title", "subtitle", "hasTitleWrap", "layout", "isLoading", "isEmpty", "isEditable", "isExpanded", "isLazyLoading", "isResizable", "resizeHandles", "error", "hideHeader", "id", "tooltip", "titleTextTooltip", "timeRange", "timeRangeOptions", "onCardAction", "availableActions", "renderExpandIcon", "renderDateDropdownInPortal", "breakpoint", "i18n", "style", "className", "values", "testID", "testId", "contentClassName", "footerContent", "dateTimeMask", "extraActions", "padding", "overrides", "type", "data", "content", "shouldUseTranslatedLabels"]); // Get translated title if shouldUseTranslatedLabels is true
331
331
 
332
332
 
333
- var title = cardUtilityFunctions.getTranslatedLabel(titleProp, shouldUseTranslatedLabels, i18n); // TODO: remove once final version of range prop is supported
333
+ var title = cardUtilityFunctions.getTranslatedLabel(titleProp, shouldUseTranslatedLabels, i18n);
334
+ var tooltip = cardUtilityFunctions.getTranslatedLabel(tooltipProp, shouldUseTranslatedLabels, i18n); // TODO: remove once final version of range prop is supported
334
335
 
335
336
  React.useEffect(function () {
336
337
  if (typeof (availableActions === null || availableActions === void 0 ? void 0 : availableActions.range) === 'string') {
@@ -505,7 +505,7 @@ var DataSeriesFormItemModal = function DataSeriesFormItemModal(_ref) {
505
505
  unit: evt.target.value
506
506
  }));
507
507
  },
508
- value: editDataItem.unit
508
+ value: cardUtilityFunctions.getTranslatedLabel(editDataItem.unit, shouldUseTranslatedLabels, i18n)
509
509
  })), hasDecimalPlacesDropdown && /*#__PURE__*/React__default["default"].createElement("div", {
510
510
  className: "".concat(baseClassName, "--input-group--item-end")
511
511
  }, /*#__PURE__*/React__default["default"].createElement(carbonComponentsReact.Dropdown, {
@@ -196,7 +196,7 @@ var CommonCardEditFormFields = function CommonCardEditFormFields(_ref) {
196
196
  description: evt.target.value
197
197
  }));
198
198
  },
199
- value: description
199
+ value: cardUtilityFunctions.getTranslatedLabel(description, shouldUseTranslatedLabels, mergedI18n)
200
200
  })), /*#__PURE__*/React__default["default"].createElement("div", {
201
201
  className: "".concat(baseClassName, "--input")
202
202
  }, /*#__PURE__*/React__default["default"].createElement(carbonComponentsReact.Dropdown, {
@@ -127,6 +127,7 @@ var Attribute = function Attribute(_ref) {
127
127
  var attributeWidthPercentage = layout === LayoutConstants.CARD_LAYOUTS.HORIZONTAL ? 100 / attributeCount : 100; // Get translated label if shouldUseTranslatedLabels is true
128
128
 
129
129
  var displayLabel = cardUtilityFunctions.getTranslatedLabel(label, shouldUseTranslatedLabels, i18n);
130
+ var displayUnitLabel = cardUtilityFunctions.getTranslatedLabel(unit, shouldUseTranslatedLabels, i18n);
130
131
  return /*#__PURE__*/React__default["default"].createElement("div", {
131
132
  className: classnames__default["default"]("".concat(BEM_BASE, "-wrapper"), (_classnames = {}, _defineProperty__default["default"](_classnames, "".concat(BEM_BASE, "-wrapper--vertical"), layout === LayoutConstants.CARD_LAYOUTS.VERTICAL), _defineProperty__default["default"](_classnames, "".concat(BEM_BASE, "-wrapper--horizontal"), layout === LayoutConstants.CARD_LAYOUTS.HORIZONTAL), _classnames)),
132
133
  style: {
@@ -164,7 +165,7 @@ var Attribute = function Attribute(_ref) {
164
165
  measurementUnitLabel: measurementUnitLabel,
165
166
  onClick: onValueClick
166
167
  }), /*#__PURE__*/React__default["default"].createElement(UnitRenderer, {
167
- unit: unit,
168
+ unit: displayUnitLabel,
168
169
  testId: "".concat(testId, "-unit")
169
170
  })), !isNil(secondaryValue) ? /*#__PURE__*/React__default["default"].createElement("div", {
170
171
  "data-testid": "".concat(testId, "-secondary-value"),
package/package.json CHANGED
@@ -341,11 +341,11 @@
341
341
  "whatwg-fetch": "^3.0.0"
342
342
  },
343
343
  "sideEffects": false,
344
- "version": "2.156.0",
344
+ "version": "2.156.1",
345
345
  "resolutions": {
346
346
  "chokidar": "3.3.1",
347
347
  "react-grid-layout": "1.2.2",
348
348
  "got": "11.8.5"
349
349
  },
350
- "gitHead": "2f1feb15d99001a26fedc949958cd4b480c90335"
350
+ "gitHead": "7a3b178053896da403e40467ef6f9af352f27202"
351
351
  }
@@ -141885,7 +141885,7 @@
141885
141885
  error = props.error,
141886
141886
  hideHeader = props.hideHeader,
141887
141887
  id = props.id,
141888
- tooltip = props.tooltip,
141888
+ tooltipProp = props.tooltip,
141889
141889
  titleTextTooltip = props.titleTextTooltip,
141890
141890
  timeRange = props.timeRange,
141891
141891
  timeRangeOptions = props.timeRangeOptions,
@@ -141913,7 +141913,8 @@
141913
141913
  others = objectWithoutProperties(props, ["size", "children", "title", "subtitle", "hasTitleWrap", "layout", "isLoading", "isEmpty", "isEditable", "isExpanded", "isLazyLoading", "isResizable", "resizeHandles", "error", "hideHeader", "id", "tooltip", "titleTextTooltip", "timeRange", "timeRangeOptions", "onCardAction", "availableActions", "renderExpandIcon", "renderDateDropdownInPortal", "breakpoint", "i18n", "style", "className", "values", "testID", "testId", "contentClassName", "footerContent", "dateTimeMask", "extraActions", "padding", "overrides", "type", "data", "content", "shouldUseTranslatedLabels"]); // Get translated title if shouldUseTranslatedLabels is true
141914
141914
 
141915
141915
 
141916
- var title = getTranslatedLabel(titleProp, shouldUseTranslatedLabels, i18n); // TODO: remove once final version of range prop is supported
141916
+ var title = getTranslatedLabel(titleProp, shouldUseTranslatedLabels, i18n);
141917
+ var tooltip = getTranslatedLabel(tooltipProp, shouldUseTranslatedLabels, i18n); // TODO: remove once final version of range prop is supported
141917
141918
 
141918
141919
  React$1.useEffect(function () {
141919
141920
  if (typeof (availableActions === null || availableActions === void 0 ? void 0 : availableActions.range) === 'string') {
@@ -172994,6 +172995,7 @@
172994
172995
  var attributeWidthPercentage = layout === CARD_LAYOUTS.HORIZONTAL ? 100 / attributeCount : 100; // Get translated label if shouldUseTranslatedLabels is true
172995
172996
 
172996
172997
  var displayLabel = getTranslatedLabel(label, shouldUseTranslatedLabels, i18n);
172998
+ var displayUnitLabel = getTranslatedLabel(unit, shouldUseTranslatedLabels, i18n);
172997
172999
  return /*#__PURE__*/React__default["default"].createElement("div", {
172998
173000
  className: classnames$3("".concat(BEM_BASE, "-wrapper"), (_classnames = {}, defineProperty$d(_classnames, "".concat(BEM_BASE, "-wrapper--vertical"), layout === CARD_LAYOUTS.VERTICAL), defineProperty$d(_classnames, "".concat(BEM_BASE, "-wrapper--horizontal"), layout === CARD_LAYOUTS.HORIZONTAL), _classnames)),
172999
173001
  style: {
@@ -173031,7 +173033,7 @@
173031
173033
  measurementUnitLabel: measurementUnitLabel,
173032
173034
  onClick: onValueClick
173033
173035
  }), /*#__PURE__*/React__default["default"].createElement(UnitRenderer$1, {
173034
- unit: unit,
173036
+ unit: displayUnitLabel,
173035
173037
  testId: "".concat(testId, "-unit")
173036
173038
  })), !isNil(secondaryValue) ? /*#__PURE__*/React__default["default"].createElement("div", {
173037
173039
  "data-testid": "".concat(testId, "-secondary-value"),
@@ -182754,7 +182756,7 @@
182754
182756
  description: evt.target.value
182755
182757
  }));
182756
182758
  },
182757
- value: description
182759
+ value: getTranslatedLabel(description, shouldUseTranslatedLabels, mergedI18n)
182758
182760
  })), /*#__PURE__*/React__default["default"].createElement("div", {
182759
182761
  className: "".concat(baseClassName, "--input")
182760
182762
  }, /*#__PURE__*/React__default["default"].createElement(carbonComponentsReact.Dropdown, {
@@ -184757,7 +184759,7 @@
184757
184759
  unit: evt.target.value
184758
184760
  }));
184759
184761
  },
184760
- value: editDataItem.unit
184762
+ value: getTranslatedLabel(editDataItem.unit, shouldUseTranslatedLabels, i18n)
184761
184763
  })), hasDecimalPlacesDropdown && /*#__PURE__*/React__default["default"].createElement("div", {
184762
184764
  className: "".concat(baseClassName, "--input-group--item-end")
184763
184765
  }, /*#__PURE__*/React__default["default"].createElement(carbonComponentsReact.Dropdown, {