carbon-addons-iot-react 4.3.6 → 4.4.0
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 +18 -3
- package/es/components/CardEditor/CardEditForm/CardEditFormItems/DataSeriesFormItems/DataSeriesFormContent.js +19 -2
- package/es/components/CardEditor/CardEditForm/CommonCardEditFormFields.js +17 -1
- 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 +38 -2
- 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 +17 -2
- package/lib/components/CardEditor/CardEditForm/CardEditFormItems/DataSeriesFormItems/DataSeriesFormContent.js +19 -2
- package/lib/components/CardEditor/CardEditForm/CommonCardEditFormFields.js +17 -1
- 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 +38 -2
- 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 +226 -19
|
@@ -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,9 @@ 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);
|
|
312994
313033
|
return /*#__PURE__*/React$1.createElement("div", {
|
|
312995
313034
|
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
313035
|
style: {
|
|
@@ -313010,10 +313049,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313010
313049
|
}) : null, tooltip ? /*#__PURE__*/React$1.createElement(Tooltip, {
|
|
313011
313050
|
direction: "right",
|
|
313012
313051
|
showIcon: false,
|
|
313013
|
-
triggerText:
|
|
313052
|
+
triggerText: displayLabel
|
|
313014
313053
|
}, /*#__PURE__*/React$1.createElement("p", null, tooltip)) : /*#__PURE__*/React$1.createElement("span", {
|
|
313015
313054
|
"data-testid": "".concat(testId, "-threshold-label")
|
|
313016
|
-
},
|
|
313055
|
+
}, displayLabel)), /*#__PURE__*/React$1.createElement("div", {
|
|
313017
313056
|
className: "".concat(BEM_BASE)
|
|
313018
313057
|
}, /*#__PURE__*/React$1.createElement(ValueRenderer$1, {
|
|
313019
313058
|
value: value,
|
|
@@ -313189,6 +313228,31 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313189
313228
|
},
|
|
313190
313229
|
"required": false
|
|
313191
313230
|
},
|
|
313231
|
+
"shouldUseTranslatedLabels": {
|
|
313232
|
+
"defaultValue": {
|
|
313233
|
+
"value": "false",
|
|
313234
|
+
"computed": false
|
|
313235
|
+
},
|
|
313236
|
+
"description": "whether to use translated labels in cards",
|
|
313237
|
+
"type": {
|
|
313238
|
+
"name": "bool"
|
|
313239
|
+
},
|
|
313240
|
+
"required": false
|
|
313241
|
+
},
|
|
313242
|
+
"i18n": {
|
|
313243
|
+
"defaultValue": {
|
|
313244
|
+
"value": "{}",
|
|
313245
|
+
"computed": false
|
|
313246
|
+
},
|
|
313247
|
+
"description": "",
|
|
313248
|
+
"type": {
|
|
313249
|
+
"name": "objectOf",
|
|
313250
|
+
"value": {
|
|
313251
|
+
"name": "any"
|
|
313252
|
+
}
|
|
313253
|
+
},
|
|
313254
|
+
"required": false
|
|
313255
|
+
},
|
|
313192
313256
|
"testId": {
|
|
313193
313257
|
"defaultValue": {
|
|
313194
313258
|
"value": "'attribute'",
|
|
@@ -313315,7 +313379,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313315
313379
|
};
|
|
313316
313380
|
var Attribute$1 = Attribute;
|
|
313317
313381
|
|
|
313318
|
-
var _excluded$q = ["id", "title", "content", "values", "layout", "dataState", "locale", "isEditable", "customFormatter", "fontSize", "isNumberValueCompact", "testId", "onAttributeClick", "size"];
|
|
313382
|
+
var _excluded$q = ["id", "title", "content", "values", "layout", "dataState", "locale", "isEditable", "shouldUseTranslatedLabels", "customFormatter", "fontSize", "isNumberValueCompact", "testId", "onAttributeClick", "size"];
|
|
313319
313383
|
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
313384
|
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
313385
|
var propTypes$15 = _objectSpread$Y({
|
|
@@ -313323,7 +313387,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313323
313387
|
title: PropTypes.string,
|
|
313324
313388
|
layout: PropTypes.oneOf(['HORIZONTAL', 'VERTICAL']),
|
|
313325
313389
|
locale: PropTypes.string,
|
|
313326
|
-
isEditable: PropTypes.bool
|
|
313390
|
+
isEditable: PropTypes.bool,
|
|
313391
|
+
/** whether to use translated labels in cards */
|
|
313392
|
+
shouldUseTranslatedLabels: PropTypes.bool
|
|
313327
313393
|
}, ValueContentPropTypes);
|
|
313328
313394
|
var defaultProps$18 = {
|
|
313329
313395
|
id: 'valueContent-id',
|
|
@@ -313331,6 +313397,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313331
313397
|
layout: 'VERTICAL',
|
|
313332
313398
|
locale: 'en',
|
|
313333
313399
|
isEditable: false,
|
|
313400
|
+
shouldUseTranslatedLabels: false,
|
|
313334
313401
|
dataState: null,
|
|
313335
313402
|
values: null,
|
|
313336
313403
|
fontSize: DEFAULT_FONT_SIZE,
|
|
@@ -313349,6 +313416,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313349
313416
|
dataState = _ref.dataState,
|
|
313350
313417
|
locale = _ref.locale,
|
|
313351
313418
|
isEditable = _ref.isEditable,
|
|
313419
|
+
shouldUseTranslatedLabels = _ref.shouldUseTranslatedLabels,
|
|
313352
313420
|
customFormatter = _ref.customFormatter,
|
|
313353
313421
|
fontSize = _ref.fontSize,
|
|
313354
313422
|
isNumberValueCompact = _ref.isNumberValueCompact,
|
|
@@ -313368,6 +313436,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313368
313436
|
locale: locale,
|
|
313369
313437
|
isEditable: isEditable,
|
|
313370
313438
|
title: title,
|
|
313439
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels,
|
|
313440
|
+
i18n: others.i18n,
|
|
313371
313441
|
renderIconByName: others.renderIconByName,
|
|
313372
313442
|
value: determineValue(attribute.dataSourceId, values, attribute.dataFilter),
|
|
313373
313443
|
secondaryValue: attribute.secondaryValue && _objectSpread$Y(_objectSpread$Y({}, attribute.secondaryValue), {}, {
|
|
@@ -313455,6 +313525,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313455
313525
|
},
|
|
313456
313526
|
"required": false
|
|
313457
313527
|
},
|
|
313528
|
+
"shouldUseTranslatedLabels": {
|
|
313529
|
+
"defaultValue": {
|
|
313530
|
+
"value": "false",
|
|
313531
|
+
"computed": false
|
|
313532
|
+
},
|
|
313533
|
+
"description": "whether to use translated labels in cards",
|
|
313534
|
+
"type": {
|
|
313535
|
+
"name": "bool"
|
|
313536
|
+
},
|
|
313537
|
+
"required": false
|
|
313538
|
+
},
|
|
313458
313539
|
"dataState": {
|
|
313459
313540
|
"defaultValue": {
|
|
313460
313541
|
"value": "null",
|
|
@@ -313516,7 +313597,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313516
313597
|
};
|
|
313517
313598
|
var ValueContent$1 = ValueContent;
|
|
313518
313599
|
|
|
313519
|
-
var _excluded$p = ["title", "content", "size", "values", "isEditable", "isResizable", "i18n", "dataState", "id", "locale", "customFormatter", "children", "fontSize", "isNumberValueCompact", "testID", "testId", "onAttributeClick", "className"];
|
|
313600
|
+
var _excluded$p = ["title", "content", "size", "values", "isEditable", "isResizable", "i18n", "dataState", "id", "locale", "customFormatter", "children", "fontSize", "isNumberValueCompact", "testID", "testId", "onAttributeClick", "className", "shouldUseTranslatedLabels"];
|
|
313520
313601
|
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
313602
|
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
313603
|
|
|
@@ -313545,6 +313626,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313545
313626
|
testId = _ref.testId,
|
|
313546
313627
|
onAttributeClick = _ref.onAttributeClick,
|
|
313547
313628
|
className = _ref.className,
|
|
313629
|
+
shouldUseTranslatedLabels = _ref.shouldUseTranslatedLabels,
|
|
313548
313630
|
others = _objectWithoutProperties$3(_ref, _excluded$p);
|
|
313549
313631
|
var availableActions = _objectSpread$X({
|
|
313550
313632
|
expand: false
|
|
@@ -313569,6 +313651,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313569
313651
|
isResizable: isResizable,
|
|
313570
313652
|
resizeHandles: resizeHandles,
|
|
313571
313653
|
i18n: i18n,
|
|
313654
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels,
|
|
313572
313655
|
locale: locale,
|
|
313573
313656
|
id: id,
|
|
313574
313657
|
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 +313672,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313589
313672
|
values: values,
|
|
313590
313673
|
isEditable: isEditable,
|
|
313591
313674
|
fontSize: fontSize,
|
|
313592
|
-
isNumberValueCompact: isNumberValueCompact
|
|
313675
|
+
isNumberValueCompact: isNumberValueCompact,
|
|
313676
|
+
i18n: i18n,
|
|
313677
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels
|
|
313593
313678
|
}, others)), resizeHandles);
|
|
313594
313679
|
};
|
|
313595
313680
|
ValueCard.propTypes = _objectSpread$X(_objectSpread$X({}, CardPropTypes), ValueContentPropTypes);
|
|
@@ -313605,7 +313690,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313605
313690
|
isNumberValueCompact: false,
|
|
313606
313691
|
// TODO: fix this default in V3, so that cards are unique not inherited from the base Card
|
|
313607
313692
|
testId: 'Card',
|
|
313608
|
-
onAttributeClick: null
|
|
313693
|
+
onAttributeClick: null,
|
|
313694
|
+
shouldUseTranslatedLabels: false
|
|
313609
313695
|
};
|
|
313610
313696
|
ValueCard.__docgenInfo = {
|
|
313611
313697
|
"description": "This components responsibilities include:\nRendering the attribute groups\nDetermining the layout\ndetermines the data to render",
|
|
@@ -313681,6 +313767,13 @@ React keys must be passed directly to JSX without using spread:
|
|
|
313681
313767
|
"computed": false
|
|
313682
313768
|
},
|
|
313683
313769
|
"required": false
|
|
313770
|
+
},
|
|
313771
|
+
"shouldUseTranslatedLabels": {
|
|
313772
|
+
"defaultValue": {
|
|
313773
|
+
"value": "false",
|
|
313774
|
+
"computed": false
|
|
313775
|
+
},
|
|
313776
|
+
"required": false
|
|
313684
313777
|
}
|
|
313685
313778
|
},
|
|
313686
313779
|
"composes": ["../../constants/CardPropTypes"]
|
|
@@ -326709,6 +326802,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
326709
326802
|
thisQuarterLabel: PropTypes.string,
|
|
326710
326803
|
thisYearLabel: PropTypes.string
|
|
326711
326804
|
}),
|
|
326805
|
+
/** whether to use translated labels in cards */
|
|
326806
|
+
shouldUseTranslatedLabels: PropTypes.bool,
|
|
326712
326807
|
/** if provided, returns an array of strings which are the timeRanges to be allowed
|
|
326713
326808
|
* on each card
|
|
326714
326809
|
* getValidTimeRanges(card, selectedDataItems)
|
|
@@ -326742,6 +326837,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
326742
326837
|
thisQuarterLabel: 'This quarter',
|
|
326743
326838
|
thisYearLabel: 'This year'
|
|
326744
326839
|
},
|
|
326840
|
+
shouldUseTranslatedLabels: false,
|
|
326745
326841
|
selectedDataItems: [],
|
|
326746
326842
|
getValidTimeRanges: null,
|
|
326747
326843
|
currentBreakpoint: 'xl',
|
|
@@ -326765,6 +326861,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
326765
326861
|
var cardConfig = _ref.cardConfig,
|
|
326766
326862
|
_onChange = _ref.onChange,
|
|
326767
326863
|
i18n = _ref.i18n,
|
|
326864
|
+
shouldUseTranslatedLabels = _ref.shouldUseTranslatedLabels,
|
|
326768
326865
|
getValidTimeRanges = _ref.getValidTimeRanges,
|
|
326769
326866
|
currentBreakpoint = _ref.currentBreakpoint,
|
|
326770
326867
|
selectedDataItems = _ref.selectedDataItems,
|
|
@@ -326795,7 +326892,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
326795
326892
|
title: evt.target.value
|
|
326796
326893
|
}));
|
|
326797
326894
|
},
|
|
326798
|
-
value: title
|
|
326895
|
+
value: getTranslatedLabel(title, shouldUseTranslatedLabels, mergedI18n)
|
|
326799
326896
|
})), /*#__PURE__*/React$1.createElement("div", {
|
|
326800
326897
|
className: "".concat(baseClassName, "--input")
|
|
326801
326898
|
}, /*#__PURE__*/React$1.createElement(react.TextArea, {
|
|
@@ -327088,6 +327185,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
327088
327185
|
},
|
|
327089
327186
|
"required": false
|
|
327090
327187
|
},
|
|
327188
|
+
"shouldUseTranslatedLabels": {
|
|
327189
|
+
"defaultValue": {
|
|
327190
|
+
"value": "false",
|
|
327191
|
+
"computed": false
|
|
327192
|
+
},
|
|
327193
|
+
"description": "whether to use translated labels in cards",
|
|
327194
|
+
"type": {
|
|
327195
|
+
"name": "bool"
|
|
327196
|
+
},
|
|
327197
|
+
"required": false
|
|
327198
|
+
},
|
|
327091
327199
|
"selectedDataItems": {
|
|
327092
327200
|
"defaultValue": {
|
|
327093
327201
|
"value": "[]",
|
|
@@ -328370,6 +328478,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
328370
328478
|
primaryButtonLabelText: PropTypes.string,
|
|
328371
328479
|
secondaryButtonLabelText: PropTypes.string
|
|
328372
328480
|
}),
|
|
328481
|
+
/** whether to use translated labels in cards */
|
|
328482
|
+
shouldUseTranslatedLabels: PropTypes.bool,
|
|
328373
328483
|
actions: DashboardEditorActionsPropTypes,
|
|
328374
328484
|
/**
|
|
328375
328485
|
* Used to override the default behaviour of handleDataItemEdit. if we dont pass any function then it uses handleDefaultDataItemEdit function by default
|
|
@@ -328423,6 +328533,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
328423
328533
|
secondaryButtonLabelText: 'Cancel',
|
|
328424
328534
|
decimalPlacesLabel: 'Decimal places'
|
|
328425
328535
|
},
|
|
328536
|
+
shouldUseTranslatedLabels: false,
|
|
328426
328537
|
editDataSeries: [],
|
|
328427
328538
|
showEditor: false,
|
|
328428
328539
|
setShowEditor: null,
|
|
@@ -328493,6 +328604,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
328493
328604
|
availableDimensions = _ref.availableDimensions,
|
|
328494
328605
|
onChange = _ref.onChange,
|
|
328495
328606
|
i18n = _ref.i18n,
|
|
328607
|
+
shouldUseTranslatedLabels = _ref.shouldUseTranslatedLabels,
|
|
328496
328608
|
isLarge = _ref.isLarge,
|
|
328497
328609
|
_ref$actions$dataSeri = _ref.actions.dataSeriesFormActions,
|
|
328498
328610
|
hasAggregationsDropDown = _ref$actions$dataSeri.hasAggregationsDropDown,
|
|
@@ -328649,7 +328761,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
328649
328761
|
label: evt.target.value
|
|
328650
328762
|
}));
|
|
328651
328763
|
},
|
|
328652
|
-
value: editDataItem.label,
|
|
328764
|
+
value: getTranslatedLabel(editDataItem.label, shouldUseTranslatedLabels, i18n),
|
|
328653
328765
|
helperText: mergedI18n.dataItemEditorDataItemHelperText(mergedI18n.dataItemSource, editDataItem.dataItemId)
|
|
328654
328766
|
})), hasColorDropdown &&
|
|
328655
328767
|
/*#__PURE__*/
|
|
@@ -328794,7 +328906,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
328794
328906
|
},
|
|
328795
328907
|
columnType: editDataItem.columnType || editDataItem.type
|
|
328796
328908
|
}));
|
|
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]);
|
|
328909
|
+
}, [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
328910
|
return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, showEditor && /*#__PURE__*/React$1.createElement("div", {
|
|
328799
328911
|
className: "".concat(baseClassName, "--modal-wrapper")
|
|
328800
328912
|
}, /*#__PURE__*/React$1.createElement(ComposedModal$1, {
|
|
@@ -329024,6 +329136,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
329024
329136
|
},
|
|
329025
329137
|
"required": false
|
|
329026
329138
|
},
|
|
329139
|
+
"shouldUseTranslatedLabels": {
|
|
329140
|
+
"defaultValue": {
|
|
329141
|
+
"value": "false",
|
|
329142
|
+
"computed": false
|
|
329143
|
+
},
|
|
329144
|
+
"description": "whether to use translated labels in cards",
|
|
329145
|
+
"type": {
|
|
329146
|
+
"name": "bool"
|
|
329147
|
+
},
|
|
329148
|
+
"required": false
|
|
329149
|
+
},
|
|
329027
329150
|
"editDataSeries": {
|
|
329028
329151
|
"defaultValue": {
|
|
329029
329152
|
"value": "[]",
|
|
@@ -329981,6 +330104,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
329981
330104
|
incrementNumberText: PropTypes.string,
|
|
329982
330105
|
decrementNumberText: PropTypes.string
|
|
329983
330106
|
}),
|
|
330107
|
+
/** whether to use translated labels in cards */
|
|
330108
|
+
shouldUseTranslatedLabels: PropTypes.bool,
|
|
329984
330109
|
translateWithId: PropTypes.func.isRequired,
|
|
329985
330110
|
actions: DashboardEditorActionsPropTypes
|
|
329986
330111
|
};
|
|
@@ -330014,6 +330139,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
330014
330139
|
incrementNumberText: 'Increment number',
|
|
330015
330140
|
decrementNumberText: 'Decrement number'
|
|
330016
330141
|
},
|
|
330142
|
+
shouldUseTranslatedLabels: false,
|
|
330017
330143
|
getValidDataItems: null,
|
|
330018
330144
|
dataItems: [],
|
|
330019
330145
|
selectedDataItems: [],
|
|
@@ -330101,6 +330227,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
330101
330227
|
selectedTimeRange = _ref2.selectedTimeRange,
|
|
330102
330228
|
availableDimensions = _ref2.availableDimensions,
|
|
330103
330229
|
i18n = _ref2.i18n,
|
|
330230
|
+
shouldUseTranslatedLabels = _ref2.shouldUseTranslatedLabels,
|
|
330104
330231
|
dataSeriesItemLinks = _ref2.dataSeriesItemLinks,
|
|
330105
330232
|
translateWithId = _ref2.translateWithId,
|
|
330106
330233
|
actions = _ref2.actions;
|
|
@@ -330246,7 +330373,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
330246
330373
|
return {
|
|
330247
330374
|
id: dataItem.dataSourceId,
|
|
330248
330375
|
content: {
|
|
330249
|
-
value: dataItem.label || dataItem.dataItemId,
|
|
330376
|
+
value: getTranslatedLabel(dataItem.label || dataItem.dataItemId, shouldUseTranslatedLabels, i18n),
|
|
330250
330377
|
icon: cardConfig.type === CARD_TYPES.TIMESERIES || cardConfig.type === CARD_TYPES.BAR ? /*#__PURE__*/React$1.createElement("div", {
|
|
330251
330378
|
className: "".concat(baseClassName$3, "--data-item-list--item-color-icon"),
|
|
330252
330379
|
style: {
|
|
@@ -330283,7 +330410,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
330283
330410
|
}
|
|
330284
330411
|
};
|
|
330285
330412
|
})) || [];
|
|
330286
|
-
}, [cardConfig.type, handleEditButton, handleRemoveButton, mergedI18n.edit, mergedI18n.remove]);
|
|
330413
|
+
}, [cardConfig.type, handleEditButton, handleRemoveButton, i18n, mergedI18n.edit, mergedI18n.remove, shouldUseTranslatedLabels]);
|
|
330287
330414
|
var dataItemListItems = React$1.useMemo(function () {
|
|
330288
330415
|
return generateListItems(dataSection);
|
|
330289
330416
|
}, [dataSection, generateListItems]);
|
|
@@ -330304,6 +330431,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
330304
330431
|
dataSection: dataSection,
|
|
330305
330432
|
onChange: _onChange,
|
|
330306
330433
|
i18n: mergedI18n,
|
|
330434
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels,
|
|
330307
330435
|
actions: actions,
|
|
330308
330436
|
options: {
|
|
330309
330437
|
hasColorDropdown: type === CARD_TYPES.TIMESERIES || type === CARD_TYPES.BAR,
|
|
@@ -330625,6 +330753,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
330625
330753
|
},
|
|
330626
330754
|
"required": false
|
|
330627
330755
|
},
|
|
330756
|
+
"shouldUseTranslatedLabels": {
|
|
330757
|
+
"defaultValue": {
|
|
330758
|
+
"value": "false",
|
|
330759
|
+
"computed": false
|
|
330760
|
+
},
|
|
330761
|
+
"description": "whether to use translated labels in cards",
|
|
330762
|
+
"type": {
|
|
330763
|
+
"name": "bool"
|
|
330764
|
+
},
|
|
330765
|
+
"required": false
|
|
330766
|
+
},
|
|
330628
330767
|
"getValidDataItems": {
|
|
330629
330768
|
"defaultValue": {
|
|
330630
330769
|
"value": "null",
|
|
@@ -336086,6 +336225,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
336086
336225
|
thisQuarterLabel: PropTypes.string,
|
|
336087
336226
|
thisYearLabel: PropTypes.string
|
|
336088
336227
|
}),
|
|
336228
|
+
/** whether to use translated labels in cards */
|
|
336229
|
+
shouldUseTranslatedLabels: PropTypes.bool,
|
|
336089
336230
|
/** if provided, returns an array of strings which are the timeRanges to be allowed
|
|
336090
336231
|
* on each card
|
|
336091
336232
|
* getValidTimeRanges(card, selectedDataItems)
|
|
@@ -336122,6 +336263,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
336122
336263
|
var defaultProps$G = {
|
|
336123
336264
|
cardConfig: {},
|
|
336124
336265
|
i18n: {},
|
|
336266
|
+
shouldUseTranslatedLabels: false,
|
|
336125
336267
|
getValidDataItems: null,
|
|
336126
336268
|
getValidTimeRanges: null,
|
|
336127
336269
|
dataItems: [],
|
|
@@ -336151,6 +336293,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
336151
336293
|
isSummaryDashboard = _ref.isSummaryDashboard,
|
|
336152
336294
|
onChange = _ref.onChange,
|
|
336153
336295
|
i18n = _ref.i18n,
|
|
336296
|
+
shouldUseTranslatedLabels = _ref.shouldUseTranslatedLabels,
|
|
336154
336297
|
dataItems = _ref.dataItems,
|
|
336155
336298
|
getValidDataItems = _ref.getValidDataItems,
|
|
336156
336299
|
getValidTimeRanges = _ref.getValidTimeRanges,
|
|
@@ -336185,6 +336328,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
336185
336328
|
,
|
|
336186
336329
|
onChange: onChange,
|
|
336187
336330
|
i18n: mergedI18n,
|
|
336331
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels,
|
|
336188
336332
|
getValidTimeRanges: getValidTimeRanges,
|
|
336189
336333
|
currentBreakpoint: currentBreakpoint,
|
|
336190
336334
|
selectedDataItems: selectedDataItems,
|
|
@@ -336231,6 +336375,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
336231
336375
|
getValidDataItems: getValidDataItems,
|
|
336232
336376
|
availableDimensions: availableDimensions,
|
|
336233
336377
|
i18n: mergedI18n,
|
|
336378
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels,
|
|
336234
336379
|
dataSeriesItemLinks: dataSeriesItemLinks,
|
|
336235
336380
|
translateWithId: handleTranslation,
|
|
336236
336381
|
actions: actions
|
|
@@ -336469,6 +336614,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
336469
336614
|
},
|
|
336470
336615
|
"required": false
|
|
336471
336616
|
},
|
|
336617
|
+
"shouldUseTranslatedLabels": {
|
|
336618
|
+
"defaultValue": {
|
|
336619
|
+
"value": "false",
|
|
336620
|
+
"computed": false
|
|
336621
|
+
},
|
|
336622
|
+
"description": "whether to use translated labels in cards",
|
|
336623
|
+
"type": {
|
|
336624
|
+
"name": "bool"
|
|
336625
|
+
},
|
|
336626
|
+
"required": false
|
|
336627
|
+
},
|
|
336472
336628
|
"getValidDataItems": {
|
|
336473
336629
|
"defaultValue": {
|
|
336474
336630
|
"value": "null",
|
|
@@ -338460,6 +338616,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
338460
338616
|
modalHelpText: PropTypes.string,
|
|
338461
338617
|
modalIconDescription: PropTypes.string
|
|
338462
338618
|
}),
|
|
338619
|
+
/** whether to use translated labels in cards */
|
|
338620
|
+
shouldUseTranslatedLabels: PropTypes.bool,
|
|
338463
338621
|
/** if provided, returns an array of strings which are the dataItems to be allowed
|
|
338464
338622
|
* on each card
|
|
338465
338623
|
* getValidDataItems(card, selectedTimeRange)
|
|
@@ -338521,6 +338679,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
338521
338679
|
modalHelpText: 'The JSON definition for this card is provided below. You can modify this data directly to update the card configuration.',
|
|
338522
338680
|
modalIconDescription: 'Close'
|
|
338523
338681
|
},
|
|
338682
|
+
shouldUseTranslatedLabels: false,
|
|
338524
338683
|
getValidDataItems: null,
|
|
338525
338684
|
getValidTimeRanges: null,
|
|
338526
338685
|
dataItems: [],
|
|
@@ -338542,6 +338701,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
338542
338701
|
availableDimensions = _ref.availableDimensions,
|
|
338543
338702
|
dataSeriesItemLinks = _ref.dataSeriesItemLinks,
|
|
338544
338703
|
onFetchDynamicDemoHotspots = _ref.onFetchDynamicDemoHotspots,
|
|
338704
|
+
shouldUseTranslatedLabels = _ref.shouldUseTranslatedLabels,
|
|
338545
338705
|
actions = _ref.actions;
|
|
338546
338706
|
var mergedI18n = React$1.useMemo(function () {
|
|
338547
338707
|
return _objectSpread$p(_objectSpread$p({}, defaultProps$z.i18n), i18n);
|
|
@@ -338558,6 +338718,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
338558
338718
|
onChange: onChange,
|
|
338559
338719
|
isSummaryDashboard: isSummaryDashboard,
|
|
338560
338720
|
i18n: mergedI18n,
|
|
338721
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels,
|
|
338561
338722
|
dataItems: dataItems,
|
|
338562
338723
|
availableDimensions: availableDimensions,
|
|
338563
338724
|
getValidDataItems: getValidDataItems,
|
|
@@ -338705,6 +338866,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
338705
338866
|
},
|
|
338706
338867
|
"required": false
|
|
338707
338868
|
},
|
|
338869
|
+
"shouldUseTranslatedLabels": {
|
|
338870
|
+
"defaultValue": {
|
|
338871
|
+
"value": "false",
|
|
338872
|
+
"computed": false
|
|
338873
|
+
},
|
|
338874
|
+
"description": "whether to use translated labels in cards",
|
|
338875
|
+
"type": {
|
|
338876
|
+
"name": "bool"
|
|
338877
|
+
},
|
|
338878
|
+
"required": false
|
|
338879
|
+
},
|
|
338708
338880
|
"getValidDataItems": {
|
|
338709
338881
|
"defaultValue": {
|
|
338710
338882
|
"value": "null",
|
|
@@ -338948,6 +339120,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
338948
339120
|
searchPlaceHolderText: PropTypes.string,
|
|
338949
339121
|
editDataItems: PropTypes.string
|
|
338950
339122
|
}),
|
|
339123
|
+
/** whether to use translated labels in cards */
|
|
339124
|
+
shouldUseTranslatedLabels: PropTypes.bool,
|
|
338951
339125
|
currentBreakpoint: PropTypes.string,
|
|
338952
339126
|
isSummaryDashboard: PropTypes.bool,
|
|
338953
339127
|
/** Id that can be used for testing */
|
|
@@ -338981,6 +339155,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
338981
339155
|
modalHelpText: 'The JSON definition for this card is provided below. You can modify this data directly to update the card configuration.',
|
|
338982
339156
|
modalIconDescription: 'Close'
|
|
338983
339157
|
},
|
|
339158
|
+
shouldUseTranslatedLabels: false,
|
|
338984
339159
|
getValidDimensions: null,
|
|
338985
339160
|
getValidDataItems: null,
|
|
338986
339161
|
getValidTimeRanges: null,
|
|
@@ -339126,6 +339301,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
339126
339301
|
onRenderCardEditForm = _ref.onRenderCardEditForm,
|
|
339127
339302
|
icons = _ref.icons,
|
|
339128
339303
|
i18n = _ref.i18n,
|
|
339304
|
+
shouldUseTranslatedLabels = _ref.shouldUseTranslatedLabels,
|
|
339129
339305
|
currentBreakpoint = _ref.currentBreakpoint,
|
|
339130
339306
|
testId = _ref.testId,
|
|
339131
339307
|
dataSeriesItemLinks = _ref.dataSeriesItemLinks,
|
|
@@ -339191,6 +339367,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
339191
339367
|
getValidTimeRanges: getValidTimeRanges,
|
|
339192
339368
|
availableDimensions: availableDimensions,
|
|
339193
339369
|
i18n: mergedI18n,
|
|
339370
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels,
|
|
339194
339371
|
currentBreakpoint: currentBreakpoint,
|
|
339195
339372
|
dataSeriesItemLinks: dataSeriesItemLinks,
|
|
339196
339373
|
onFetchDynamicDemoHotspots: onFetchDynamicDemoHotspots,
|
|
@@ -339356,6 +339533,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
339356
339533
|
},
|
|
339357
339534
|
"required": false
|
|
339358
339535
|
},
|
|
339536
|
+
"shouldUseTranslatedLabels": {
|
|
339537
|
+
"defaultValue": {
|
|
339538
|
+
"value": "false",
|
|
339539
|
+
"computed": false
|
|
339540
|
+
},
|
|
339541
|
+
"description": "whether to use translated labels in cards",
|
|
339542
|
+
"type": {
|
|
339543
|
+
"name": "bool"
|
|
339544
|
+
},
|
|
339545
|
+
"required": false
|
|
339546
|
+
},
|
|
339359
339547
|
"getValidDimensions": {
|
|
339360
339548
|
"defaultValue": {
|
|
339361
339549
|
"value": "null",
|
|
@@ -340279,7 +340467,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
340279
340467
|
var DashboardEditorDefaultCardRenderer$1 = DashboardEditorDefaultCardRenderer;
|
|
340280
340468
|
|
|
340281
340469
|
var _excluded$c = ["style", "children"],
|
|
340282
|
-
_excluded2 = ["isSelected", "availableDimensions", "i18n", "onRemove", "onDuplicate", "onCardChange", "setSelectedCardId", "renderIconByName", "onShowImageGallery", "onValidateUploadedImage", "baseClassName", "renderCardPreview", "style"];
|
|
340470
|
+
_excluded2 = ["isSelected", "availableDimensions", "i18n", "onRemove", "onDuplicate", "onCardChange", "setSelectedCardId", "renderIconByName", "onShowImageGallery", "onValidateUploadedImage", "baseClassName", "renderCardPreview", "style", "shouldUseTranslatedLabels"];
|
|
340283
340471
|
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
340472
|
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
340473
|
|
|
@@ -340351,6 +340539,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
340351
340539
|
baseClassName = _ref2.baseClassName,
|
|
340352
340540
|
renderCardPreview = _ref2.renderCardPreview,
|
|
340353
340541
|
style = _ref2.style,
|
|
340542
|
+
shouldUseTranslatedLabels = _ref2.shouldUseTranslatedLabels,
|
|
340354
340543
|
cardConfig = _objectWithoutProperties$3(_ref2, _excluded2);
|
|
340355
340544
|
// We have to keep track of our dynamic hotspots here
|
|
340356
340545
|
var _useState5 = React$1.useState([]),
|
|
@@ -340384,6 +340573,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
340384
340573
|
key: cardConfig.id,
|
|
340385
340574
|
tooltip: cardConfig.description,
|
|
340386
340575
|
i18n: i18n,
|
|
340576
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels,
|
|
340387
340577
|
availableActions: availableActions,
|
|
340388
340578
|
onCardAction: handleOnCardAction,
|
|
340389
340579
|
renderIconByName: renderIconByName,
|
|
@@ -340396,7 +340586,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
340396
340586
|
onBrowseClick: cardConfig.type === CARD_TYPES.IMAGE && isNil((_cardConfig$content = cardConfig.content) === null || _cardConfig$content === void 0 ? void 0 : _cardConfig$content.src) ? onShowImageGallery : undefined,
|
|
340397
340587
|
validateUploadedImage: cardConfig.type === CARD_TYPES.IMAGE ? onValidateUploadedImage : undefined
|
|
340398
340588
|
});
|
|
340399
|
-
}, [baseClassName, cardConfig, handleOnCardAction, handleOnCardKeyDown, handleOnCardMouseDown, i18n, isSelected, onShowImageGallery, onValidateUploadedImage, renderIconByName, style]);
|
|
340589
|
+
}, [baseClassName, cardConfig, handleOnCardAction, handleOnCardKeyDown, handleOnCardMouseDown, i18n, isSelected, onShowImageGallery, onValidateUploadedImage, renderIconByName, shouldUseTranslatedLabels, style]);
|
|
340400
340590
|
React$1.useEffect(function () {
|
|
340401
340591
|
var _cardProps$values;
|
|
340402
340592
|
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 +340904,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
340714
340904
|
abbreviateNumbersTooltip: PropTypes.string,
|
|
340715
340905
|
editDataItems: PropTypes.string
|
|
340716
340906
|
}),
|
|
340907
|
+
/** whether to use translated labels in cards */
|
|
340908
|
+
shouldUseTranslatedLabels: PropTypes.bool,
|
|
340717
340909
|
/** locale data */
|
|
340718
340910
|
locale: PropTypes.string,
|
|
340719
340911
|
/** optional link href's for each card type that will appear in a tooltip */
|
|
@@ -340804,6 +340996,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
340804
340996
|
saveTitleButton: 'Save title',
|
|
340805
340997
|
editDataItems: 'Edit data items'
|
|
340806
340998
|
},
|
|
340999
|
+
shouldUseTranslatedLabels: false,
|
|
340807
341000
|
locale: 'en',
|
|
340808
341001
|
dataSeriesItemLinks: null,
|
|
340809
341002
|
onFetchDynamicDemoHotspots: function onFetchDynamicDemoHotspots() {
|
|
@@ -340873,6 +341066,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
340873
341066
|
isSummaryDashboard = _ref.isSummaryDashboard,
|
|
340874
341067
|
isLoading = _ref.isLoading,
|
|
340875
341068
|
i18n = _ref.i18n,
|
|
341069
|
+
shouldUseTranslatedLabels = _ref.shouldUseTranslatedLabels,
|
|
340876
341070
|
locale = _ref.locale,
|
|
340877
341071
|
dataSeriesItemLinks = _ref.dataSeriesItemLinks,
|
|
340878
341072
|
isTitleEditable = _ref.isTitleEditable,
|
|
@@ -341129,7 +341323,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
341129
341323
|
className: classnames("".concat(baseClassName$1, "--content"), _defineProperty$c({}, "".concat(baseClassName$1, "__overflow"), selectedBreakpointIndex !== LAYOUTS.FIT_TO_SCREEN.index)),
|
|
341130
341324
|
ref: scrollContainerRef
|
|
341131
341325
|
}, renderHeader ? renderHeader() : /*#__PURE__*/React$1.createElement(DashboardEditorHeader$1, {
|
|
341132
|
-
title: (dashboardJson === null || dashboardJson === void 0 ? void 0 : dashboardJson.title) || title,
|
|
341326
|
+
title: getTranslatedLabel(dashboardJson === null || dashboardJson === void 0 ? void 0 : dashboardJson.title, shouldUseTranslatedLabels, i18n) || title,
|
|
341133
341327
|
breadcrumbs: headerBreadcrumbs,
|
|
341134
341328
|
onImport: onImport,
|
|
341135
341329
|
onExport: function onExport() {
|
|
@@ -341213,6 +341407,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
341213
341407
|
key: cardConfig.id,
|
|
341214
341408
|
isResizable: isCardResizable,
|
|
341215
341409
|
i18n: mergedI18n,
|
|
341410
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels,
|
|
341216
341411
|
isSelected: isSelected,
|
|
341217
341412
|
availableDimensions: availableDimensions,
|
|
341218
341413
|
onFetchDynamicDemoHotspots: onFetchDynamicDemoHotspots,
|
|
@@ -341257,6 +341452,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
341257
341452
|
getValidDimensions: getValidDimensions,
|
|
341258
341453
|
availableDimensions: availableDimensions,
|
|
341259
341454
|
i18n: mergedI18n,
|
|
341455
|
+
shouldUseTranslatedLabels: shouldUseTranslatedLabels,
|
|
341260
341456
|
currentBreakpoint: currentBreakpoint,
|
|
341261
341457
|
dataSeriesItemLinks: dataSeriesItemLinks,
|
|
341262
341458
|
onFetchDynamicDemoHotspots: onFetchDynamicDemoHotspots,
|
|
@@ -342179,6 +342375,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
342179
342375
|
},
|
|
342180
342376
|
"required": false
|
|
342181
342377
|
},
|
|
342378
|
+
"shouldUseTranslatedLabels": {
|
|
342379
|
+
"defaultValue": {
|
|
342380
|
+
"value": "false",
|
|
342381
|
+
"computed": false
|
|
342382
|
+
},
|
|
342383
|
+
"description": "whether to use translated labels in cards",
|
|
342384
|
+
"type": {
|
|
342385
|
+
"name": "bool"
|
|
342386
|
+
},
|
|
342387
|
+
"required": false
|
|
342388
|
+
},
|
|
342182
342389
|
"locale": {
|
|
342183
342390
|
"defaultValue": {
|
|
342184
342391
|
"value": "'en'",
|