logitude-dashboard-library 3.1.54 → 3.1.55
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/dist/Utils/General.d.ts +2 -1
- package/dist/index.js +24 -21
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +24 -21
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/Utils/General.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ declare const getGlobalNumberFormatting: () => {
|
|
|
4
4
|
thousandsSeparator: string;
|
|
5
5
|
decimalSeparator: string;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
declare const getNumberInSystemLocalFormat: (value: number) => string | number;
|
|
8
|
+
export { isNullOrUndefined, isNullOrUndefinedOrEmpty, getGlobalNumberFormatting, getNumberInSystemLocalFormat };
|
package/dist/index.js
CHANGED
|
@@ -729,6 +729,25 @@ var getGlobalNumberFormatting = function getGlobalNumberFormatting() {
|
|
|
729
729
|
return numberSeparatorSettings;
|
|
730
730
|
};
|
|
731
731
|
|
|
732
|
+
var getNumberInSystemLocalFormat = function getNumberInSystemLocalFormat(value) {
|
|
733
|
+
if (isNaN(value)) return value;
|
|
734
|
+
|
|
735
|
+
var _numberSeparatorSettings = getGlobalNumberFormatting();
|
|
736
|
+
|
|
737
|
+
var _val = value.toLocaleString('en-US');
|
|
738
|
+
|
|
739
|
+
if (_val) {
|
|
740
|
+
var _formattedValue = _val.replaceAll(",", "*");
|
|
741
|
+
|
|
742
|
+
_formattedValue = _formattedValue.replaceAll(".", "#");
|
|
743
|
+
_formattedValue = _formattedValue.replaceAll("*", _numberSeparatorSettings.thousandsSeparator);
|
|
744
|
+
_formattedValue = _formattedValue.replaceAll("#", _numberSeparatorSettings.decimalSeparator);
|
|
745
|
+
return _formattedValue;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
return value;
|
|
749
|
+
};
|
|
750
|
+
|
|
732
751
|
var KpiChart = function KpiChart(props) {
|
|
733
752
|
var _widget$current16;
|
|
734
753
|
|
|
@@ -1632,7 +1651,10 @@ var PivotTable = React.forwardRef(function (props, comRef) {
|
|
|
1632
1651
|
dataType: 'number',
|
|
1633
1652
|
summaryType: 'sum',
|
|
1634
1653
|
wordWrapEnabled: true,
|
|
1635
|
-
caption: measure.DisplayName
|
|
1654
|
+
caption: measure.DisplayName,
|
|
1655
|
+
format: function format(value) {
|
|
1656
|
+
return getNumberInSystemLocalFormat(value);
|
|
1657
|
+
}
|
|
1636
1658
|
};
|
|
1637
1659
|
});
|
|
1638
1660
|
var AllfieldsData = [].concat(pivotRowsAndColumnsFields, pivotDataCellsFields);
|
|
@@ -1730,28 +1752,9 @@ function getTooltiplabel(value, seriesMeasure) {
|
|
|
1730
1752
|
return '$label';
|
|
1731
1753
|
}
|
|
1732
1754
|
|
|
1733
|
-
var getFormattedValue = function getFormattedValue(value) {
|
|
1734
|
-
if (isNaN(value)) return value;
|
|
1735
|
-
|
|
1736
|
-
var _numberSeparatorSettings = getGlobalNumberFormatting();
|
|
1737
|
-
|
|
1738
|
-
var _val = value.toLocaleString('en-US');
|
|
1739
|
-
|
|
1740
|
-
if (_val) {
|
|
1741
|
-
var _formattedValue = _val.replaceAll(",", "*");
|
|
1742
|
-
|
|
1743
|
-
_formattedValue = _formattedValue.replaceAll(".", "-");
|
|
1744
|
-
_formattedValue = _formattedValue.replaceAll("*", _numberSeparatorSettings.thousandsSeparator);
|
|
1745
|
-
_formattedValue = _formattedValue.replaceAll("-", _numberSeparatorSettings.decimalSeparator);
|
|
1746
|
-
return _formattedValue;
|
|
1747
|
-
}
|
|
1748
|
-
|
|
1749
|
-
return value;
|
|
1750
|
-
};
|
|
1751
|
-
|
|
1752
1755
|
function getTooltipValue(value, seriesMeasure) {
|
|
1753
1756
|
if (!isNullOrUndefined(value)) {
|
|
1754
|
-
return seriesMeasure && seriesMeasure.MeasureFieldDataType == 'Percentage' ?
|
|
1757
|
+
return seriesMeasure && seriesMeasure.MeasureFieldDataType == 'Percentage' ? getNumberInSystemLocalFormat(value) + "%" : getNumberInSystemLocalFormat(value);
|
|
1755
1758
|
}
|
|
1756
1759
|
|
|
1757
1760
|
return '$dataValue';
|