carbon-addons-iot-react 4.3.6 → 4.4.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.
- package/es/components/Card/Card.js +18 -5
- package/es/components/CardEditor/CardEditForm/CardEditForm.js +16 -0
- package/es/components/CardEditor/CardEditForm/CardEditFormContent.js +17 -0
- package/es/components/CardEditor/CardEditForm/CardEditFormItems/DataSeriesFormItemModal.js +19 -4
- package/es/components/CardEditor/CardEditForm/CardEditFormItems/DataSeriesFormItems/DataSeriesFormContent.js +19 -2
- package/es/components/CardEditor/CardEditForm/CommonCardEditFormFields.js +18 -2
- package/es/components/CardEditor/CardEditor.js +16 -0
- package/es/components/DashboardEditor/DashboardEditor.js +19 -1
- package/es/components/DashboardEditor/DashboardEditorCardRenderer.js +4 -2
- package/es/components/ValueCard/Attribute.js +40 -3
- package/es/components/ValueCard/ValueCard.js +15 -3
- package/es/components/ValueCard/ValueContent.js +19 -2
- package/es/constants/CardPropTypes.js +2 -0
- package/es/utils/cardUtilityFunctions.js +16 -1
- package/lib/components/Card/Card.js +17 -4
- package/lib/components/CardEditor/CardEditForm/CardEditForm.js +16 -0
- package/lib/components/CardEditor/CardEditForm/CardEditFormContent.js +17 -0
- package/lib/components/CardEditor/CardEditForm/CardEditFormItems/DataSeriesFormItemModal.js +18 -3
- package/lib/components/CardEditor/CardEditForm/CardEditFormItems/DataSeriesFormItems/DataSeriesFormContent.js +19 -2
- package/lib/components/CardEditor/CardEditForm/CommonCardEditFormFields.js +18 -2
- package/lib/components/CardEditor/CardEditor.js +16 -0
- package/lib/components/DashboardEditor/DashboardEditor.js +19 -1
- package/lib/components/DashboardEditor/DashboardEditorCardRenderer.js +4 -2
- package/lib/components/ValueCard/Attribute.js +40 -3
- package/lib/components/ValueCard/ValueCard.js +15 -3
- package/lib/components/ValueCard/ValueContent.js +19 -2
- package/lib/constants/CardPropTypes.js +2 -0
- package/lib/utils/cardUtilityFunctions.js +16 -0
- package/package.json +1 -1
- package/umd/carbon-addons-iot-react.js +230 -22
|
@@ -280806,6 +280806,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
280806
280806
|
defaultFilterStringPlaceholdText: PropTypes.string,
|
|
280807
280807
|
downloadIconDescription: PropTypes.string
|
|
280808
280808
|
}),
|
|
280809
|
+
/** whether to use translated labels in cards */
|
|
280810
|
+
shouldUseTranslatedLabels: PropTypes.bool,
|
|
280809
280811
|
cardVariables: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.number, PropTypes.bool])),
|
|
280810
280812
|
/** default date format pattern that follows the dayjs formatting patterns */
|
|
280811
280813
|
defaultDateFormatPattern: PropTypes.string
|
|
@@ -284150,6 +284152,20 @@ React keys must be passed directly to JSX without using spread:
|
|
|
284150
284152
|
})) || ((_card$content2 = card.content) === null || _card$content2 === void 0 ? void 0 : _card$content2.type) === BAR_CHART_TYPES.SIMPLE && ((_card$content3 = card.content) === null || _card$content3 === void 0 ? void 0 : _card$content3.timeDataSourceId) || ((_card$content4 = card.content) === null || _card$content4 === void 0 ? void 0 : _card$content4.type) === BAR_CHART_TYPES.STACKED && ((_card$content5 = card.content) === null || _card$content5 === void 0 ? void 0 : _card$content5.timeDataSourceId);
|
|
284151
284153
|
};
|
|
284152
284154
|
|
|
284155
|
+
/**
|
|
284156
|
+
* Get translated label or title from i18n object, fallback to original if not found
|
|
284157
|
+
* @param {string} label - The label or title key to translate
|
|
284158
|
+
* @param {boolean} shouldUseTranslatedLabels - Flag to determine if translation should be used
|
|
284159
|
+
* @param {Object} i18n - The i18n object containing translations
|
|
284160
|
+
* @returns {string} - The translated label or original label if translation not found
|
|
284161
|
+
*/
|
|
284162
|
+
var getTranslatedLabel = function getTranslatedLabel(label, shouldUseTranslatedLabels, i18n) {
|
|
284163
|
+
if (!isEmpty(label) && shouldUseTranslatedLabels && i18n && i18n[label]) {
|
|
284164
|
+
return i18n[label];
|
|
284165
|
+
}
|
|
284166
|
+
return label;
|
|
284167
|
+
};
|
|
284168
|
+
|
|
284153
284169
|
var REPLACE = wellKnownSymbol('replace');
|
|
284154
284170
|
var $TypeError = TypeError;
|
|
284155
284171
|
var indexOf = functionUncurryThis(''.indexOf);
|
|
@@ -285454,7 +285470,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
285454
285470
|
};
|
|
285455
285471
|
|
|
285456
285472
|
var _excluded$F = ["isSelected", "children", "dimensions", "id", "style", "className", "onScroll", "onMouseDown", "onMouseUp", "onTouchEnd", "onTouchStart", "onFocus", "onBlur", "tabIndex", "testID", "testId"],
|
|
285457
|
-
_excluded2$4 = ["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"];
|
|
285473
|
+
_excluded2$4 = ["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"];
|
|
285458
285474
|
function ownKeys$1p(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
285459
285475
|
function _objectSpread$1n(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1p(Object(t), !0).forEach(function (r) { _defineProperty$c(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1p(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
285460
285476
|
var prefix$l = settings.prefix,
|
|
@@ -285670,7 +285686,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
285670
285686
|
overrides: undefined,
|
|
285671
285687
|
type: null,
|
|
285672
285688
|
data: null,
|
|
285673
|
-
content: null
|
|
285689
|
+
content: null,
|
|
285690
|
+
shouldUseTranslatedLabels: false
|
|
285674
285691
|
};
|
|
285675
285692
|
|
|
285676
285693
|
/** Dumb component that renders the card basics */
|
|
@@ -285678,7 +285695,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
285678
285695
|
var _overrides$errorMessa, _overrides$errorMessa2, _overrides$errorMessa3;
|
|
285679
285696
|
var size = props.size,
|
|
285680
285697
|
children = props.children,
|
|
285681
|
-
|
|
285698
|
+
titleProp = props.title,
|
|
285682
285699
|
subtitleProp = props.subtitle,
|
|
285683
285700
|
hasTitleWrap = props.hasTitleWrap;
|
|
285684
285701
|
props.layout;
|
|
@@ -285692,7 +285709,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
285692
285709
|
error = props.error,
|
|
285693
285710
|
hideHeader = props.hideHeader,
|
|
285694
285711
|
id = props.id,
|
|
285695
|
-
|
|
285712
|
+
tooltipProp = props.tooltip,
|
|
285696
285713
|
titleTextTooltip = props.titleTextTooltip,
|
|
285697
285714
|
timeRange = props.timeRange,
|
|
285698
285715
|
timeRangeOptions = props.timeRangeOptions,
|
|
@@ -285716,8 +285733,13 @@ React keys must be passed directly to JSX without using spread:
|
|
|
285716
285733
|
type = props.type,
|
|
285717
285734
|
data = props.data,
|
|
285718
285735
|
content = props.content,
|
|
285736
|
+
shouldUseTranslatedLabels = props.shouldUseTranslatedLabels,
|
|
285719
285737
|
others = _objectWithoutProperties$3(props, _excluded2$4);
|
|
285720
285738
|
|
|
285739
|
+
// Get translated title if shouldUseTranslatedLabels is true
|
|
285740
|
+
var title = getTranslatedLabel(titleProp, shouldUseTranslatedLabels, i18n);
|
|
285741
|
+
var tooltip = getTranslatedLabel(tooltipProp, shouldUseTranslatedLabels, i18n);
|
|
285742
|
+
|
|
285721
285743
|
// TODO: remove once final version of range prop is supported
|
|
285722
285744
|
React$1.useEffect(function () {
|
|
285723
285745
|
if (typeof (availableActions === null || availableActions === void 0 ? void 0 : availableActions.range) === 'string') {
|
|
@@ -286205,6 +286227,13 @@ React keys must be passed directly to JSX without using spread:
|
|
|
286205
286227
|
"computed": false
|
|
286206
286228
|
},
|
|
286207
286229
|
"required": false
|
|
286230
|
+
},
|
|
286231
|
+
"shouldUseTranslatedLabels": {
|
|
286232
|
+
"defaultValue": {
|
|
286233
|
+
"value": "false",
|
|
286234
|
+
"computed": false
|
|
286235
|
+
},
|
|
286236
|
+
"required": false
|
|
286208
286237
|
}
|
|
286209
286238
|
},
|
|
286210
286239
|
"composes": ["../../constants/CardPropTypes"]
|
|
@@ -312923,6 +312952,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
312923
312952
|
isEditable: PropTypes.bool,
|
|
312924
312953
|
layout: PropTypes.oneOf(Object.values(CARD_LAYOUTS)),
|
|
312925
312954
|
locale: PropTypes.string,
|
|
312955
|
+
/** whether to use translated labels in cards */
|
|
312956
|
+
shouldUseTranslatedLabels: PropTypes.bool,
|
|
312957
|
+
i18n: PropTypes.objectOf(PropTypes.any),
|
|
312926
312958
|
renderIconByName: PropTypes.func,
|
|
312927
312959
|
/** Optional trend information */
|
|
312928
312960
|
secondaryValue: PropTypes.shape({
|
|
@@ -312950,6 +312982,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
312950
312982
|
locale: 'en',
|
|
312951
312983
|
customFormatter: null,
|
|
312952
312984
|
isEditable: false,
|
|
312985
|
+
shouldUseTranslatedLabels: false,
|
|
312986
|
+
i18n: {},
|
|
312953
312987
|
testId: 'attribute',
|
|
312954
312988
|
onValueClick: null
|
|
312955
312989
|
};
|
|
@@ -312973,6 +313007,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
312973
313007
|
isEditable = _ref.isEditable,
|
|
312974
313008
|
layout = _ref.layout,
|
|
312975
313009
|
locale = _ref.locale,
|
|
313010
|
+
shouldUseTranslatedLabels = _ref.shouldUseTranslatedLabels,
|
|
313011
|
+
i18n = _ref.i18n,
|
|
312976
313012
|
renderIconByName = _ref.renderIconByName,
|
|
312977
313013
|
secondaryValue = _ref.secondaryValue,
|
|
312978
313014
|
value = _ref.value,
|
|
@@ -312991,6 +313027,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
312991
313027
|
|
|
312992
313028
|
// need to reduce the width size to fit multiple attributes when card layout is horizontal
|
|
312993
313029
|
var attributeWidthPercentage = layout === CARD_LAYOUTS.HORIZONTAL ? 100 / attributeCount : 100;
|
|
313030
|
+
|
|
313031
|
+
// Get translated label if shouldUseTranslatedLabels is true
|
|
313032
|
+
var displayLabel = getTranslatedLabel(label, shouldUseTranslatedLabels, i18n);
|
|
313033
|
+
var displayUnitLabel = getTranslatedLabel(unit, shouldUseTranslatedLabels, i18n);
|
|
312994
313034
|
return /*#__PURE__*/React$1.createElement("div", {
|
|
312995
313035
|
className: classnames("".concat(BEM_BASE, "-wrapper"), _defineProperty$c(_defineProperty$c({}, "".concat(BEM_BASE, "-wrapper--vertical"), layout === CARD_LAYOUTS.VERTICAL), "".concat(BEM_BASE, "-wrapper--horizontal"), layout === CARD_LAYOUTS.HORIZONTAL)),
|
|
312996
313036
|
style: {
|
|
@@ -313010,10 +313050,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313010
313050
|
}) : null, tooltip ? /*#__PURE__*/React$1.createElement(Tooltip, {
|
|
313011
313051
|
direction: "right",
|
|
313012
313052
|
showIcon: false,
|
|
313013
|
-
triggerText:
|
|
313053
|
+
triggerText: displayLabel
|
|
313014
313054
|
}, /*#__PURE__*/React$1.createElement("p", null, tooltip)) : /*#__PURE__*/React$1.createElement("span", {
|
|
313015
313055
|
"data-testid": "".concat(testId, "-threshold-label")
|
|
313016
|
-
},
|
|
313056
|
+
}, displayLabel)), /*#__PURE__*/React$1.createElement("div", {
|
|
313017
313057
|
className: "".concat(BEM_BASE)
|
|
313018
313058
|
}, /*#__PURE__*/React$1.createElement(ValueRenderer$1, {
|
|
313019
313059
|
value: value,
|
|
@@ -313029,7 +313069,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313029
313069
|
measurementUnitLabel: measurementUnitLabel,
|
|
313030
313070
|
onClick: onValueClick
|
|
313031
313071
|
}), /*#__PURE__*/React$1.createElement(UnitRenderer$1, {
|
|
313032
|
-
unit:
|
|
313072
|
+
unit: displayUnitLabel,
|
|
313033
313073
|
testId: "".concat(testId, "-unit")
|
|
313034
313074
|
})), !isNil(secondaryValue) ? /*#__PURE__*/React$1.createElement("div", {
|
|
313035
313075
|
"data-testid": "".concat(testId, "-secondary-value"),
|
|
@@ -313189,6 +313229,31 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313189
313229
|
},
|
|
313190
313230
|
"required": false
|
|
313191
313231
|
},
|
|
313232
|
+
"shouldUseTranslatedLabels": {
|
|
313233
|
+
"defaultValue": {
|
|
313234
|
+
"value": "false",
|
|
313235
|
+
"computed": false
|
|
313236
|
+
},
|
|
313237
|
+
"description": "whether to use translated labels in cards",
|
|
313238
|
+
"type": {
|
|
313239
|
+
"name": "bool"
|
|
313240
|
+
},
|
|
313241
|
+
"required": false
|
|
313242
|
+
},
|
|
313243
|
+
"i18n": {
|
|
313244
|
+
"defaultValue": {
|
|
313245
|
+
"value": "{}",
|
|
313246
|
+
"computed": false
|
|
313247
|
+
},
|
|
313248
|
+
"description": "",
|
|
313249
|
+
"type": {
|
|
313250
|
+
"name": "objectOf",
|
|
313251
|
+
"value": {
|
|
313252
|
+
"name": "any"
|
|
313253
|
+
}
|
|
313254
|
+
},
|
|
313255
|
+
"required": false
|
|
313256
|
+
},
|
|
313192
313257
|
"testId": {
|
|
313193
313258
|
"defaultValue": {
|
|
313194
313259
|
"value": "'attribute'",
|
|
@@ -313315,7 +313380,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313315
313380
|
};
|
|
313316
313381
|
var Attribute$1 = Attribute;
|
|
313317
313382
|
|
|
313318
|
-
var _excluded$q = ["id", "title", "content", "values", "layout", "dataState", "locale", "isEditable", "customFormatter", "fontSize", "isNumberValueCompact", "testId", "onAttributeClick", "size"];
|
|
313383
|
+
var _excluded$q = ["id", "title", "content", "values", "layout", "dataState", "locale", "isEditable", "shouldUseTranslatedLabels", "customFormatter", "fontSize", "isNumberValueCompact", "testId", "onAttributeClick", "size"];
|
|
313319
313384
|
function ownKeys$_(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
313320
313385
|
function _objectSpread$Y(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$_(Object(t), !0).forEach(function (r) { _defineProperty$c(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$_(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
313321
313386
|
var propTypes$15 = _objectSpread$Y({
|
|
@@ -313323,7 +313388,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313323
313388
|
title: PropTypes.string,
|
|
313324
313389
|
layout: PropTypes.oneOf(['HORIZONTAL', 'VERTICAL']),
|
|
313325
313390
|
locale: PropTypes.string,
|
|
313326
|
-
isEditable: PropTypes.bool
|
|
313391
|
+
isEditable: PropTypes.bool,
|
|
313392
|
+
/** whether to use translated labels in cards */
|
|
313393
|
+
shouldUseTranslatedLabels: PropTypes.bool
|
|
313327
313394
|
}, ValueContentPropTypes);
|
|
313328
313395
|
var defaultProps$18 = {
|
|
313329
313396
|
id: 'valueContent-id',
|
|
@@ -313331,6 +313398,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313331
313398
|
layout: 'VERTICAL',
|
|
313332
313399
|
locale: 'en',
|
|
313333
313400
|
isEditable: false,
|
|
313401
|
+
shouldUseTranslatedLabels: false,
|
|
313334
313402
|
dataState: null,
|
|
313335
313403
|
values: null,
|
|
313336
313404
|
fontSize: DEFAULT_FONT_SIZE,
|
|
@@ -313349,6 +313417,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313349
313417
|
dataState = _ref.dataState,
|
|
313350
313418
|
locale = _ref.locale,
|
|
313351
313419
|
isEditable = _ref.isEditable,
|
|
313420
|
+
shouldUseTranslatedLabels = _ref.shouldUseTranslatedLabels,
|
|
313352
313421
|
customFormatter = _ref.customFormatter,
|
|
313353
313422
|
fontSize = _ref.fontSize,
|
|
313354
313423
|
isNumberValueCompact = _ref.isNumberValueCompact,
|
|
@@ -313368,6 +313437,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313368
313437
|
locale: locale,
|
|
313369
313438
|
isEditable: isEditable,
|
|
313370
313439
|
title: title,
|
|
313440
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels,
|
|
313441
|
+
i18n: others.i18n,
|
|
313371
313442
|
renderIconByName: others.renderIconByName,
|
|
313372
313443
|
value: determineValue(attribute.dataSourceId, values, attribute.dataFilter),
|
|
313373
313444
|
secondaryValue: attribute.secondaryValue && _objectSpread$Y(_objectSpread$Y({}, attribute.secondaryValue), {}, {
|
|
@@ -313455,6 +313526,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313455
313526
|
},
|
|
313456
313527
|
"required": false
|
|
313457
313528
|
},
|
|
313529
|
+
"shouldUseTranslatedLabels": {
|
|
313530
|
+
"defaultValue": {
|
|
313531
|
+
"value": "false",
|
|
313532
|
+
"computed": false
|
|
313533
|
+
},
|
|
313534
|
+
"description": "whether to use translated labels in cards",
|
|
313535
|
+
"type": {
|
|
313536
|
+
"name": "bool"
|
|
313537
|
+
},
|
|
313538
|
+
"required": false
|
|
313539
|
+
},
|
|
313458
313540
|
"dataState": {
|
|
313459
313541
|
"defaultValue": {
|
|
313460
313542
|
"value": "null",
|
|
@@ -313516,7 +313598,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313516
313598
|
};
|
|
313517
313599
|
var ValueContent$1 = ValueContent;
|
|
313518
313600
|
|
|
313519
|
-
var _excluded$p = ["title", "content", "size", "values", "isEditable", "isResizable", "i18n", "dataState", "id", "locale", "customFormatter", "children", "fontSize", "isNumberValueCompact", "testID", "testId", "onAttributeClick", "className"];
|
|
313601
|
+
var _excluded$p = ["title", "content", "size", "values", "isEditable", "isResizable", "i18n", "dataState", "id", "locale", "customFormatter", "children", "fontSize", "isNumberValueCompact", "testID", "testId", "onAttributeClick", "className", "shouldUseTranslatedLabels"];
|
|
313520
313602
|
function ownKeys$Z(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
313521
313603
|
function _objectSpread$X(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$Z(Object(t), !0).forEach(function (r) { _defineProperty$c(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$Z(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
313522
313604
|
|
|
@@ -313545,6 +313627,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313545
313627
|
testId = _ref.testId,
|
|
313546
313628
|
onAttributeClick = _ref.onAttributeClick,
|
|
313547
313629
|
className = _ref.className,
|
|
313630
|
+
shouldUseTranslatedLabels = _ref.shouldUseTranslatedLabels,
|
|
313548
313631
|
others = _objectWithoutProperties$3(_ref, _excluded$p);
|
|
313549
313632
|
var availableActions = _objectSpread$X({
|
|
313550
313633
|
expand: false
|
|
@@ -313569,6 +313652,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313569
313652
|
isResizable: isResizable,
|
|
313570
313653
|
resizeHandles: resizeHandles,
|
|
313571
313654
|
i18n: i18n,
|
|
313655
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels,
|
|
313572
313656
|
locale: locale,
|
|
313573
313657
|
id: id,
|
|
313574
313658
|
className: classnames(className, _defineProperty$c(_defineProperty$c({}, "".concat(BASE_CLASS_NAME$2, "__horizontal"), layout === CARD_LAYOUTS.HORIZONTAL), "".concat(BASE_CLASS_NAME$2, "__vertical"), layout === CARD_LAYOUTS.VERTICAL))
|
|
@@ -313589,7 +313673,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313589
313673
|
values: values,
|
|
313590
313674
|
isEditable: isEditable,
|
|
313591
313675
|
fontSize: fontSize,
|
|
313592
|
-
isNumberValueCompact: isNumberValueCompact
|
|
313676
|
+
isNumberValueCompact: isNumberValueCompact,
|
|
313677
|
+
i18n: i18n,
|
|
313678
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels
|
|
313593
313679
|
}, others)), resizeHandles);
|
|
313594
313680
|
};
|
|
313595
313681
|
ValueCard.propTypes = _objectSpread$X(_objectSpread$X({}, CardPropTypes), ValueContentPropTypes);
|
|
@@ -313605,7 +313691,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313605
313691
|
isNumberValueCompact: false,
|
|
313606
313692
|
// TODO: fix this default in V3, so that cards are unique not inherited from the base Card
|
|
313607
313693
|
testId: 'Card',
|
|
313608
|
-
onAttributeClick: null
|
|
313694
|
+
onAttributeClick: null,
|
|
313695
|
+
shouldUseTranslatedLabels: false
|
|
313609
313696
|
};
|
|
313610
313697
|
ValueCard.__docgenInfo = {
|
|
313611
313698
|
"description": "This components responsibilities include:\nRendering the attribute groups\nDetermining the layout\ndetermines the data to render",
|
|
@@ -313681,6 +313768,13 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313681
313768
|
"computed": false
|
|
313682
313769
|
},
|
|
313683
313770
|
"required": false
|
|
313771
|
+
},
|
|
313772
|
+
"shouldUseTranslatedLabels": {
|
|
313773
|
+
"defaultValue": {
|
|
313774
|
+
"value": "false",
|
|
313775
|
+
"computed": false
|
|
313776
|
+
},
|
|
313777
|
+
"required": false
|
|
313684
313778
|
}
|
|
313685
313779
|
},
|
|
313686
313780
|
"composes": ["../../constants/CardPropTypes"]
|
|
@@ -326709,6 +326803,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
326709
326803
|
thisQuarterLabel: PropTypes.string,
|
|
326710
326804
|
thisYearLabel: PropTypes.string
|
|
326711
326805
|
}),
|
|
326806
|
+
/** whether to use translated labels in cards */
|
|
326807
|
+
shouldUseTranslatedLabels: PropTypes.bool,
|
|
326712
326808
|
/** if provided, returns an array of strings which are the timeRanges to be allowed
|
|
326713
326809
|
* on each card
|
|
326714
326810
|
* getValidTimeRanges(card, selectedDataItems)
|
|
@@ -326742,6 +326838,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
326742
326838
|
thisQuarterLabel: 'This quarter',
|
|
326743
326839
|
thisYearLabel: 'This year'
|
|
326744
326840
|
},
|
|
326841
|
+
shouldUseTranslatedLabels: false,
|
|
326745
326842
|
selectedDataItems: [],
|
|
326746
326843
|
getValidTimeRanges: null,
|
|
326747
326844
|
currentBreakpoint: 'xl',
|
|
@@ -326765,6 +326862,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
326765
326862
|
var cardConfig = _ref.cardConfig,
|
|
326766
326863
|
_onChange = _ref.onChange,
|
|
326767
326864
|
i18n = _ref.i18n,
|
|
326865
|
+
shouldUseTranslatedLabels = _ref.shouldUseTranslatedLabels,
|
|
326768
326866
|
getValidTimeRanges = _ref.getValidTimeRanges,
|
|
326769
326867
|
currentBreakpoint = _ref.currentBreakpoint,
|
|
326770
326868
|
selectedDataItems = _ref.selectedDataItems,
|
|
@@ -326795,7 +326893,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
326795
326893
|
title: evt.target.value
|
|
326796
326894
|
}));
|
|
326797
326895
|
},
|
|
326798
|
-
value: title
|
|
326896
|
+
value: getTranslatedLabel(title, shouldUseTranslatedLabels, mergedI18n)
|
|
326799
326897
|
})), /*#__PURE__*/React$1.createElement("div", {
|
|
326800
326898
|
className: "".concat(baseClassName, "--input")
|
|
326801
326899
|
}, /*#__PURE__*/React$1.createElement(react.TextArea, {
|
|
@@ -326807,7 +326905,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
326807
326905
|
description: evt.target.value
|
|
326808
326906
|
}));
|
|
326809
326907
|
},
|
|
326810
|
-
value: description
|
|
326908
|
+
value: getTranslatedLabel(description, shouldUseTranslatedLabels, mergedI18n)
|
|
326811
326909
|
})), /*#__PURE__*/React$1.createElement("div", {
|
|
326812
326910
|
className: "".concat(baseClassName, "--input")
|
|
326813
326911
|
}, /*#__PURE__*/React$1.createElement(react.Dropdown, {
|
|
@@ -327088,6 +327186,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
327088
327186
|
},
|
|
327089
327187
|
"required": false
|
|
327090
327188
|
},
|
|
327189
|
+
"shouldUseTranslatedLabels": {
|
|
327190
|
+
"defaultValue": {
|
|
327191
|
+
"value": "false",
|
|
327192
|
+
"computed": false
|
|
327193
|
+
},
|
|
327194
|
+
"description": "whether to use translated labels in cards",
|
|
327195
|
+
"type": {
|
|
327196
|
+
"name": "bool"
|
|
327197
|
+
},
|
|
327198
|
+
"required": false
|
|
327199
|
+
},
|
|
327091
327200
|
"selectedDataItems": {
|
|
327092
327201
|
"defaultValue": {
|
|
327093
327202
|
"value": "[]",
|
|
@@ -328370,6 +328479,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
328370
328479
|
primaryButtonLabelText: PropTypes.string,
|
|
328371
328480
|
secondaryButtonLabelText: PropTypes.string
|
|
328372
328481
|
}),
|
|
328482
|
+
/** whether to use translated labels in cards */
|
|
328483
|
+
shouldUseTranslatedLabels: PropTypes.bool,
|
|
328373
328484
|
actions: DashboardEditorActionsPropTypes,
|
|
328374
328485
|
/**
|
|
328375
328486
|
* Used to override the default behaviour of handleDataItemEdit. if we dont pass any function then it uses handleDefaultDataItemEdit function by default
|
|
@@ -328423,6 +328534,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
328423
328534
|
secondaryButtonLabelText: 'Cancel',
|
|
328424
328535
|
decimalPlacesLabel: 'Decimal places'
|
|
328425
328536
|
},
|
|
328537
|
+
shouldUseTranslatedLabels: false,
|
|
328426
328538
|
editDataSeries: [],
|
|
328427
328539
|
showEditor: false,
|
|
328428
328540
|
setShowEditor: null,
|
|
@@ -328493,6 +328605,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
328493
328605
|
availableDimensions = _ref.availableDimensions,
|
|
328494
328606
|
onChange = _ref.onChange,
|
|
328495
328607
|
i18n = _ref.i18n,
|
|
328608
|
+
shouldUseTranslatedLabels = _ref.shouldUseTranslatedLabels,
|
|
328496
328609
|
isLarge = _ref.isLarge,
|
|
328497
328610
|
_ref$actions$dataSeri = _ref.actions.dataSeriesFormActions,
|
|
328498
328611
|
hasAggregationsDropDown = _ref$actions$dataSeri.hasAggregationsDropDown,
|
|
@@ -328649,7 +328762,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
328649
328762
|
label: evt.target.value
|
|
328650
328763
|
}));
|
|
328651
328764
|
},
|
|
328652
|
-
value: editDataItem.label,
|
|
328765
|
+
value: getTranslatedLabel(editDataItem.label, shouldUseTranslatedLabels, i18n),
|
|
328653
328766
|
helperText: mergedI18n.dataItemEditorDataItemHelperText(mergedI18n.dataItemSource, editDataItem.dataItemId)
|
|
328654
328767
|
})), hasColorDropdown &&
|
|
328655
328768
|
/*#__PURE__*/
|
|
@@ -328696,7 +328809,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
328696
328809
|
unit: evt.target.value
|
|
328697
328810
|
}));
|
|
328698
328811
|
},
|
|
328699
|
-
value: editDataItem.unit
|
|
328812
|
+
value: getTranslatedLabel(editDataItem.unit, shouldUseTranslatedLabels, i18n)
|
|
328700
328813
|
})), /*#__PURE__*/React$1.createElement("div", {
|
|
328701
328814
|
className: "".concat(baseClassName, "--input-group--item")
|
|
328702
328815
|
}, hasDecimalPlacesDropdown && /*#__PURE__*/React$1.createElement(react.Dropdown, {
|
|
@@ -328794,7 +328907,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
328794
328907
|
},
|
|
328795
328908
|
columnType: editDataItem.columnType || editDataItem.type
|
|
328796
328909
|
}));
|
|
328797
|
-
}, [availableDimensions, availableDimensionsItems, availableGrains, baseClassName, cardConfig, editDataItem, handleTranslation, hasAggregationsDropDown, hasColorDropdown, hasDataFilterDropdown, hasDecimalPlacesDropdown, hasGrainsDropDown, hasThresholds, hasTooltip, hasUnit, id, initialAggregation, initialGrain, isSummaryDashboard, isTimeBasedCard$1, mergedI18n, selectedDimensionFilter, setEditDataItem, type]);
|
|
328910
|
+
}, [availableDimensions, availableDimensionsItems, availableGrains, baseClassName, cardConfig, editDataItem, handleTranslation, hasAggregationsDropDown, hasColorDropdown, hasDataFilterDropdown, hasDecimalPlacesDropdown, hasGrainsDropDown, hasThresholds, hasTooltip, hasUnit, i18n, id, initialAggregation, initialGrain, isSummaryDashboard, isTimeBasedCard$1, mergedI18n, selectedDimensionFilter, setEditDataItem, shouldUseTranslatedLabels, type]);
|
|
328798
328911
|
return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, showEditor && /*#__PURE__*/React$1.createElement("div", {
|
|
328799
328912
|
className: "".concat(baseClassName, "--modal-wrapper")
|
|
328800
328913
|
}, /*#__PURE__*/React$1.createElement(ComposedModal$1, {
|
|
@@ -329024,6 +329137,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
329024
329137
|
},
|
|
329025
329138
|
"required": false
|
|
329026
329139
|
},
|
|
329140
|
+
"shouldUseTranslatedLabels": {
|
|
329141
|
+
"defaultValue": {
|
|
329142
|
+
"value": "false",
|
|
329143
|
+
"computed": false
|
|
329144
|
+
},
|
|
329145
|
+
"description": "whether to use translated labels in cards",
|
|
329146
|
+
"type": {
|
|
329147
|
+
"name": "bool"
|
|
329148
|
+
},
|
|
329149
|
+
"required": false
|
|
329150
|
+
},
|
|
329027
329151
|
"editDataSeries": {
|
|
329028
329152
|
"defaultValue": {
|
|
329029
329153
|
"value": "[]",
|
|
@@ -329981,6 +330105,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
329981
330105
|
incrementNumberText: PropTypes.string,
|
|
329982
330106
|
decrementNumberText: PropTypes.string
|
|
329983
330107
|
}),
|
|
330108
|
+
/** whether to use translated labels in cards */
|
|
330109
|
+
shouldUseTranslatedLabels: PropTypes.bool,
|
|
329984
330110
|
translateWithId: PropTypes.func.isRequired,
|
|
329985
330111
|
actions: DashboardEditorActionsPropTypes
|
|
329986
330112
|
};
|
|
@@ -330014,6 +330140,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
330014
330140
|
incrementNumberText: 'Increment number',
|
|
330015
330141
|
decrementNumberText: 'Decrement number'
|
|
330016
330142
|
},
|
|
330143
|
+
shouldUseTranslatedLabels: false,
|
|
330017
330144
|
getValidDataItems: null,
|
|
330018
330145
|
dataItems: [],
|
|
330019
330146
|
selectedDataItems: [],
|
|
@@ -330101,6 +330228,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
330101
330228
|
selectedTimeRange = _ref2.selectedTimeRange,
|
|
330102
330229
|
availableDimensions = _ref2.availableDimensions,
|
|
330103
330230
|
i18n = _ref2.i18n,
|
|
330231
|
+
shouldUseTranslatedLabels = _ref2.shouldUseTranslatedLabels,
|
|
330104
330232
|
dataSeriesItemLinks = _ref2.dataSeriesItemLinks,
|
|
330105
330233
|
translateWithId = _ref2.translateWithId,
|
|
330106
330234
|
actions = _ref2.actions;
|
|
@@ -330246,7 +330374,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
330246
330374
|
return {
|
|
330247
330375
|
id: dataItem.dataSourceId,
|
|
330248
330376
|
content: {
|
|
330249
|
-
value: dataItem.label || dataItem.dataItemId,
|
|
330377
|
+
value: getTranslatedLabel(dataItem.label || dataItem.dataItemId, shouldUseTranslatedLabels, i18n),
|
|
330250
330378
|
icon: cardConfig.type === CARD_TYPES.TIMESERIES || cardConfig.type === CARD_TYPES.BAR ? /*#__PURE__*/React$1.createElement("div", {
|
|
330251
330379
|
className: "".concat(baseClassName$3, "--data-item-list--item-color-icon"),
|
|
330252
330380
|
style: {
|
|
@@ -330283,7 +330411,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
330283
330411
|
}
|
|
330284
330412
|
};
|
|
330285
330413
|
})) || [];
|
|
330286
|
-
}, [cardConfig.type, handleEditButton, handleRemoveButton, mergedI18n.edit, mergedI18n.remove]);
|
|
330414
|
+
}, [cardConfig.type, handleEditButton, handleRemoveButton, i18n, mergedI18n.edit, mergedI18n.remove, shouldUseTranslatedLabels]);
|
|
330287
330415
|
var dataItemListItems = React$1.useMemo(function () {
|
|
330288
330416
|
return generateListItems(dataSection);
|
|
330289
330417
|
}, [dataSection, generateListItems]);
|
|
@@ -330304,6 +330432,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
330304
330432
|
dataSection: dataSection,
|
|
330305
330433
|
onChange: _onChange,
|
|
330306
330434
|
i18n: mergedI18n,
|
|
330435
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels,
|
|
330307
330436
|
actions: actions,
|
|
330308
330437
|
options: {
|
|
330309
330438
|
hasColorDropdown: type === CARD_TYPES.TIMESERIES || type === CARD_TYPES.BAR,
|
|
@@ -330625,6 +330754,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
330625
330754
|
},
|
|
330626
330755
|
"required": false
|
|
330627
330756
|
},
|
|
330757
|
+
"shouldUseTranslatedLabels": {
|
|
330758
|
+
"defaultValue": {
|
|
330759
|
+
"value": "false",
|
|
330760
|
+
"computed": false
|
|
330761
|
+
},
|
|
330762
|
+
"description": "whether to use translated labels in cards",
|
|
330763
|
+
"type": {
|
|
330764
|
+
"name": "bool"
|
|
330765
|
+
},
|
|
330766
|
+
"required": false
|
|
330767
|
+
},
|
|
330628
330768
|
"getValidDataItems": {
|
|
330629
330769
|
"defaultValue": {
|
|
330630
330770
|
"value": "null",
|
|
@@ -336086,6 +336226,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
336086
336226
|
thisQuarterLabel: PropTypes.string,
|
|
336087
336227
|
thisYearLabel: PropTypes.string
|
|
336088
336228
|
}),
|
|
336229
|
+
/** whether to use translated labels in cards */
|
|
336230
|
+
shouldUseTranslatedLabels: PropTypes.bool,
|
|
336089
336231
|
/** if provided, returns an array of strings which are the timeRanges to be allowed
|
|
336090
336232
|
* on each card
|
|
336091
336233
|
* getValidTimeRanges(card, selectedDataItems)
|
|
@@ -336122,6 +336264,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
336122
336264
|
var defaultProps$G = {
|
|
336123
336265
|
cardConfig: {},
|
|
336124
336266
|
i18n: {},
|
|
336267
|
+
shouldUseTranslatedLabels: false,
|
|
336125
336268
|
getValidDataItems: null,
|
|
336126
336269
|
getValidTimeRanges: null,
|
|
336127
336270
|
dataItems: [],
|
|
@@ -336151,6 +336294,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
336151
336294
|
isSummaryDashboard = _ref.isSummaryDashboard,
|
|
336152
336295
|
onChange = _ref.onChange,
|
|
336153
336296
|
i18n = _ref.i18n,
|
|
336297
|
+
shouldUseTranslatedLabels = _ref.shouldUseTranslatedLabels,
|
|
336154
336298
|
dataItems = _ref.dataItems,
|
|
336155
336299
|
getValidDataItems = _ref.getValidDataItems,
|
|
336156
336300
|
getValidTimeRanges = _ref.getValidTimeRanges,
|
|
@@ -336185,6 +336329,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
336185
336329
|
,
|
|
336186
336330
|
onChange: onChange,
|
|
336187
336331
|
i18n: mergedI18n,
|
|
336332
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels,
|
|
336188
336333
|
getValidTimeRanges: getValidTimeRanges,
|
|
336189
336334
|
currentBreakpoint: currentBreakpoint,
|
|
336190
336335
|
selectedDataItems: selectedDataItems,
|
|
@@ -336231,6 +336376,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
336231
336376
|
getValidDataItems: getValidDataItems,
|
|
336232
336377
|
availableDimensions: availableDimensions,
|
|
336233
336378
|
i18n: mergedI18n,
|
|
336379
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels,
|
|
336234
336380
|
dataSeriesItemLinks: dataSeriesItemLinks,
|
|
336235
336381
|
translateWithId: handleTranslation,
|
|
336236
336382
|
actions: actions
|
|
@@ -336469,6 +336615,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
336469
336615
|
},
|
|
336470
336616
|
"required": false
|
|
336471
336617
|
},
|
|
336618
|
+
"shouldUseTranslatedLabels": {
|
|
336619
|
+
"defaultValue": {
|
|
336620
|
+
"value": "false",
|
|
336621
|
+
"computed": false
|
|
336622
|
+
},
|
|
336623
|
+
"description": "whether to use translated labels in cards",
|
|
336624
|
+
"type": {
|
|
336625
|
+
"name": "bool"
|
|
336626
|
+
},
|
|
336627
|
+
"required": false
|
|
336628
|
+
},
|
|
336472
336629
|
"getValidDataItems": {
|
|
336473
336630
|
"defaultValue": {
|
|
336474
336631
|
"value": "null",
|
|
@@ -338460,6 +338617,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
338460
338617
|
modalHelpText: PropTypes.string,
|
|
338461
338618
|
modalIconDescription: PropTypes.string
|
|
338462
338619
|
}),
|
|
338620
|
+
/** whether to use translated labels in cards */
|
|
338621
|
+
shouldUseTranslatedLabels: PropTypes.bool,
|
|
338463
338622
|
/** if provided, returns an array of strings which are the dataItems to be allowed
|
|
338464
338623
|
* on each card
|
|
338465
338624
|
* getValidDataItems(card, selectedTimeRange)
|
|
@@ -338521,6 +338680,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
338521
338680
|
modalHelpText: 'The JSON definition for this card is provided below. You can modify this data directly to update the card configuration.',
|
|
338522
338681
|
modalIconDescription: 'Close'
|
|
338523
338682
|
},
|
|
338683
|
+
shouldUseTranslatedLabels: false,
|
|
338524
338684
|
getValidDataItems: null,
|
|
338525
338685
|
getValidTimeRanges: null,
|
|
338526
338686
|
dataItems: [],
|
|
@@ -338542,6 +338702,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
338542
338702
|
availableDimensions = _ref.availableDimensions,
|
|
338543
338703
|
dataSeriesItemLinks = _ref.dataSeriesItemLinks,
|
|
338544
338704
|
onFetchDynamicDemoHotspots = _ref.onFetchDynamicDemoHotspots,
|
|
338705
|
+
shouldUseTranslatedLabels = _ref.shouldUseTranslatedLabels,
|
|
338545
338706
|
actions = _ref.actions;
|
|
338546
338707
|
var mergedI18n = React$1.useMemo(function () {
|
|
338547
338708
|
return _objectSpread$p(_objectSpread$p({}, defaultProps$z.i18n), i18n);
|
|
@@ -338558,6 +338719,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
338558
338719
|
onChange: onChange,
|
|
338559
338720
|
isSummaryDashboard: isSummaryDashboard,
|
|
338560
338721
|
i18n: mergedI18n,
|
|
338722
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels,
|
|
338561
338723
|
dataItems: dataItems,
|
|
338562
338724
|
availableDimensions: availableDimensions,
|
|
338563
338725
|
getValidDataItems: getValidDataItems,
|
|
@@ -338705,6 +338867,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
338705
338867
|
},
|
|
338706
338868
|
"required": false
|
|
338707
338869
|
},
|
|
338870
|
+
"shouldUseTranslatedLabels": {
|
|
338871
|
+
"defaultValue": {
|
|
338872
|
+
"value": "false",
|
|
338873
|
+
"computed": false
|
|
338874
|
+
},
|
|
338875
|
+
"description": "whether to use translated labels in cards",
|
|
338876
|
+
"type": {
|
|
338877
|
+
"name": "bool"
|
|
338878
|
+
},
|
|
338879
|
+
"required": false
|
|
338880
|
+
},
|
|
338708
338881
|
"getValidDataItems": {
|
|
338709
338882
|
"defaultValue": {
|
|
338710
338883
|
"value": "null",
|
|
@@ -338948,6 +339121,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
338948
339121
|
searchPlaceHolderText: PropTypes.string,
|
|
338949
339122
|
editDataItems: PropTypes.string
|
|
338950
339123
|
}),
|
|
339124
|
+
/** whether to use translated labels in cards */
|
|
339125
|
+
shouldUseTranslatedLabels: PropTypes.bool,
|
|
338951
339126
|
currentBreakpoint: PropTypes.string,
|
|
338952
339127
|
isSummaryDashboard: PropTypes.bool,
|
|
338953
339128
|
/** Id that can be used for testing */
|
|
@@ -338981,6 +339156,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
338981
339156
|
modalHelpText: 'The JSON definition for this card is provided below. You can modify this data directly to update the card configuration.',
|
|
338982
339157
|
modalIconDescription: 'Close'
|
|
338983
339158
|
},
|
|
339159
|
+
shouldUseTranslatedLabels: false,
|
|
338984
339160
|
getValidDimensions: null,
|
|
338985
339161
|
getValidDataItems: null,
|
|
338986
339162
|
getValidTimeRanges: null,
|
|
@@ -339126,6 +339302,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
339126
339302
|
onRenderCardEditForm = _ref.onRenderCardEditForm,
|
|
339127
339303
|
icons = _ref.icons,
|
|
339128
339304
|
i18n = _ref.i18n,
|
|
339305
|
+
shouldUseTranslatedLabels = _ref.shouldUseTranslatedLabels,
|
|
339129
339306
|
currentBreakpoint = _ref.currentBreakpoint,
|
|
339130
339307
|
testId = _ref.testId,
|
|
339131
339308
|
dataSeriesItemLinks = _ref.dataSeriesItemLinks,
|
|
@@ -339191,6 +339368,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
339191
339368
|
getValidTimeRanges: getValidTimeRanges,
|
|
339192
339369
|
availableDimensions: availableDimensions,
|
|
339193
339370
|
i18n: mergedI18n,
|
|
339371
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels,
|
|
339194
339372
|
currentBreakpoint: currentBreakpoint,
|
|
339195
339373
|
dataSeriesItemLinks: dataSeriesItemLinks,
|
|
339196
339374
|
onFetchDynamicDemoHotspots: onFetchDynamicDemoHotspots,
|
|
@@ -339356,6 +339534,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
339356
339534
|
},
|
|
339357
339535
|
"required": false
|
|
339358
339536
|
},
|
|
339537
|
+
"shouldUseTranslatedLabels": {
|
|
339538
|
+
"defaultValue": {
|
|
339539
|
+
"value": "false",
|
|
339540
|
+
"computed": false
|
|
339541
|
+
},
|
|
339542
|
+
"description": "whether to use translated labels in cards",
|
|
339543
|
+
"type": {
|
|
339544
|
+
"name": "bool"
|
|
339545
|
+
},
|
|
339546
|
+
"required": false
|
|
339547
|
+
},
|
|
339359
339548
|
"getValidDimensions": {
|
|
339360
339549
|
"defaultValue": {
|
|
339361
339550
|
"value": "null",
|
|
@@ -340279,7 +340468,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
340279
340468
|
var DashboardEditorDefaultCardRenderer$1 = DashboardEditorDefaultCardRenderer;
|
|
340280
340469
|
|
|
340281
340470
|
var _excluded$c = ["style", "children"],
|
|
340282
|
-
_excluded2 = ["isSelected", "availableDimensions", "i18n", "onRemove", "onDuplicate", "onCardChange", "setSelectedCardId", "renderIconByName", "onShowImageGallery", "onValidateUploadedImage", "baseClassName", "renderCardPreview", "style"];
|
|
340471
|
+
_excluded2 = ["isSelected", "availableDimensions", "i18n", "onRemove", "onDuplicate", "onCardChange", "setSelectedCardId", "renderIconByName", "onShowImageGallery", "onValidateUploadedImage", "baseClassName", "renderCardPreview", "style", "shouldUseTranslatedLabels"];
|
|
340283
340472
|
function ownKeys$m(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
340284
340473
|
function _objectSpread$m(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$m(Object(t), !0).forEach(function (r) { _defineProperty$c(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$m(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
340285
340474
|
|
|
@@ -340351,6 +340540,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
340351
340540
|
baseClassName = _ref2.baseClassName,
|
|
340352
340541
|
renderCardPreview = _ref2.renderCardPreview,
|
|
340353
340542
|
style = _ref2.style,
|
|
340543
|
+
shouldUseTranslatedLabels = _ref2.shouldUseTranslatedLabels,
|
|
340354
340544
|
cardConfig = _objectWithoutProperties$3(_ref2, _excluded2);
|
|
340355
340545
|
// We have to keep track of our dynamic hotspots here
|
|
340356
340546
|
var _useState5 = React$1.useState([]),
|
|
@@ -340384,6 +340574,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
340384
340574
|
key: cardConfig.id,
|
|
340385
340575
|
tooltip: cardConfig.description,
|
|
340386
340576
|
i18n: i18n,
|
|
340577
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels,
|
|
340387
340578
|
availableActions: availableActions,
|
|
340388
340579
|
onCardAction: handleOnCardAction,
|
|
340389
340580
|
renderIconByName: renderIconByName,
|
|
@@ -340396,7 +340587,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
340396
340587
|
onBrowseClick: cardConfig.type === CARD_TYPES.IMAGE && isNil((_cardConfig$content = cardConfig.content) === null || _cardConfig$content === void 0 ? void 0 : _cardConfig$content.src) ? onShowImageGallery : undefined,
|
|
340397
340588
|
validateUploadedImage: cardConfig.type === CARD_TYPES.IMAGE ? onValidateUploadedImage : undefined
|
|
340398
340589
|
});
|
|
340399
|
-
}, [baseClassName, cardConfig, handleOnCardAction, handleOnCardKeyDown, handleOnCardMouseDown, i18n, isSelected, onShowImageGallery, onValidateUploadedImage, renderIconByName, style]);
|
|
340590
|
+
}, [baseClassName, cardConfig, handleOnCardAction, handleOnCardKeyDown, handleOnCardMouseDown, i18n, isSelected, onShowImageGallery, onValidateUploadedImage, renderIconByName, shouldUseTranslatedLabels, style]);
|
|
340400
340591
|
React$1.useEffect(function () {
|
|
340401
340592
|
var _cardProps$values;
|
|
340402
340593
|
var originalDynamicHotspot = (_cardProps$values = cardProps.values) === null || _cardProps$values === void 0 || (_cardProps$values = _cardProps$values.hotspots) === null || _cardProps$values === void 0 ? void 0 : _cardProps$values.find(function (hotspot) {
|
|
@@ -340714,6 +340905,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
340714
340905
|
abbreviateNumbersTooltip: PropTypes.string,
|
|
340715
340906
|
editDataItems: PropTypes.string
|
|
340716
340907
|
}),
|
|
340908
|
+
/** whether to use translated labels in cards */
|
|
340909
|
+
shouldUseTranslatedLabels: PropTypes.bool,
|
|
340717
340910
|
/** locale data */
|
|
340718
340911
|
locale: PropTypes.string,
|
|
340719
340912
|
/** optional link href's for each card type that will appear in a tooltip */
|
|
@@ -340804,6 +340997,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
340804
340997
|
saveTitleButton: 'Save title',
|
|
340805
340998
|
editDataItems: 'Edit data items'
|
|
340806
340999
|
},
|
|
341000
|
+
shouldUseTranslatedLabels: false,
|
|
340807
341001
|
locale: 'en',
|
|
340808
341002
|
dataSeriesItemLinks: null,
|
|
340809
341003
|
onFetchDynamicDemoHotspots: function onFetchDynamicDemoHotspots() {
|
|
@@ -340873,6 +341067,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
340873
341067
|
isSummaryDashboard = _ref.isSummaryDashboard,
|
|
340874
341068
|
isLoading = _ref.isLoading,
|
|
340875
341069
|
i18n = _ref.i18n,
|
|
341070
|
+
shouldUseTranslatedLabels = _ref.shouldUseTranslatedLabels,
|
|
340876
341071
|
locale = _ref.locale,
|
|
340877
341072
|
dataSeriesItemLinks = _ref.dataSeriesItemLinks,
|
|
340878
341073
|
isTitleEditable = _ref.isTitleEditable,
|
|
@@ -341129,7 +341324,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
341129
341324
|
className: classnames("".concat(baseClassName$1, "--content"), _defineProperty$c({}, "".concat(baseClassName$1, "__overflow"), selectedBreakpointIndex !== LAYOUTS.FIT_TO_SCREEN.index)),
|
|
341130
341325
|
ref: scrollContainerRef
|
|
341131
341326
|
}, renderHeader ? renderHeader() : /*#__PURE__*/React$1.createElement(DashboardEditorHeader$1, {
|
|
341132
|
-
title: (dashboardJson === null || dashboardJson === void 0 ? void 0 : dashboardJson.title) || title,
|
|
341327
|
+
title: getTranslatedLabel(dashboardJson === null || dashboardJson === void 0 ? void 0 : dashboardJson.title, shouldUseTranslatedLabels, i18n) || title,
|
|
341133
341328
|
breadcrumbs: headerBreadcrumbs,
|
|
341134
341329
|
onImport: onImport,
|
|
341135
341330
|
onExport: function onExport() {
|
|
@@ -341213,6 +341408,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
341213
341408
|
key: cardConfig.id,
|
|
341214
341409
|
isResizable: isCardResizable,
|
|
341215
341410
|
i18n: mergedI18n,
|
|
341411
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels,
|
|
341216
341412
|
isSelected: isSelected,
|
|
341217
341413
|
availableDimensions: availableDimensions,
|
|
341218
341414
|
onFetchDynamicDemoHotspots: onFetchDynamicDemoHotspots,
|
|
@@ -341257,6 +341453,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
341257
341453
|
getValidDimensions: getValidDimensions,
|
|
341258
341454
|
availableDimensions: availableDimensions,
|
|
341259
341455
|
i18n: mergedI18n,
|
|
341456
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels,
|
|
341260
341457
|
currentBreakpoint: currentBreakpoint,
|
|
341261
341458
|
dataSeriesItemLinks: dataSeriesItemLinks,
|
|
341262
341459
|
onFetchDynamicDemoHotspots: onFetchDynamicDemoHotspots,
|
|
@@ -342179,6 +342376,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
342179
342376
|
},
|
|
342180
342377
|
"required": false
|
|
342181
342378
|
},
|
|
342379
|
+
"shouldUseTranslatedLabels": {
|
|
342380
|
+
"defaultValue": {
|
|
342381
|
+
"value": "false",
|
|
342382
|
+
"computed": false
|
|
342383
|
+
},
|
|
342384
|
+
"description": "whether to use translated labels in cards",
|
|
342385
|
+
"type": {
|
|
342386
|
+
"name": "bool"
|
|
342387
|
+
},
|
|
342388
|
+
"required": false
|
|
342389
|
+
},
|
|
342182
342390
|
"locale": {
|
|
342183
342391
|
"defaultValue": {
|
|
342184
342392
|
"value": "'en'",
|