eai-frontend-components 2.0.24 → 2.0.25
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/index.d.ts +17 -11
- package/dist/index.esm.js +17 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -901,6 +901,22 @@ const stringToNumber = (value) => {
|
|
|
901
901
|
.replace(',', '.');
|
|
902
902
|
return Number.parseFloat(numericValue);
|
|
903
903
|
};
|
|
904
|
+
var InternetAmountUnity;
|
|
905
|
+
(function (InternetAmountUnity) {
|
|
906
|
+
InternetAmountUnity[InternetAmountUnity["iauMegabyte"] = 0] = "iauMegabyte";
|
|
907
|
+
InternetAmountUnity[InternetAmountUnity["iauGigabyte"] = 1] = "iauGigabyte";
|
|
908
|
+
InternetAmountUnity[InternetAmountUnity["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
909
|
+
})(InternetAmountUnity || (InternetAmountUnity = {}));
|
|
910
|
+
const convertInternetToDisplay = (internet, unit) => {
|
|
911
|
+
if (internet === 0) {
|
|
912
|
+
return '';
|
|
913
|
+
}
|
|
914
|
+
const internetInMB = unit === InternetAmountUnity.iauGigabyte ? convertGbToMb(internet) : internet;
|
|
915
|
+
if (internetInMB > 1023) {
|
|
916
|
+
return `${convertMbToGb(roundNumber(internetInMB))} GB`;
|
|
917
|
+
}
|
|
918
|
+
return `${internetInMB} MB`;
|
|
919
|
+
};
|
|
904
920
|
const convertMbToGb = (value) => {
|
|
905
921
|
return value > 0 ? roundNumber(value / 1024) : 0;
|
|
906
922
|
};
|
|
@@ -3850,6 +3866,7 @@ exports.cn = cn;
|
|
|
3850
3866
|
exports.convertBytesToMB = convertBytesToMB;
|
|
3851
3867
|
exports.convertDaysToMonth = convertDaysToMonth;
|
|
3852
3868
|
exports.convertGbToMb = convertGbToMb;
|
|
3869
|
+
exports.convertInternetToDisplay = convertInternetToDisplay;
|
|
3853
3870
|
exports.convertMbToGb = convertMbToGb;
|
|
3854
3871
|
exports.convertMonthToDays = convertMonthToDays;
|
|
3855
3872
|
exports.convertSecondsToMinutes = convertSecondsToMinutes;
|