@citygross/components 0.8.13 → 0.8.15
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/build/cjs/components/src/components/CartSubTotal/CartSubTotal.js +4 -6
- package/build/cjs/components/src/components/CartSubTotal/CartSubTotal.js.map +1 -1
- package/build/cjs/utils/build/index.js +9 -0
- package/build/cjs/utils/build/index.js.map +1 -1
- package/build/es/components/src/components/CartSubTotal/CartSubTotal.js +5 -7
- package/build/es/components/src/components/CartSubTotal/CartSubTotal.js.map +1 -1
- package/build/es/utils/build/index.js +9 -0
- package/build/es/utils/build/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -21,7 +21,7 @@ exports.ECartSubTotalTypes = void 0;
|
|
|
21
21
|
var CartSubTotal = function (_a) {
|
|
22
22
|
var _b;
|
|
23
23
|
var label = _a.label, value = _a.value, children = _a.children, info = _a.info, type = _a.type, fromPriceLabel = _a.fromPriceLabel, infoOnBottom = _a.infoOnBottom, _c = _a.priceColor, priceColor = _c === void 0 ? (_b = designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.darkest : _c;
|
|
24
|
-
var formattedPrice = utils.
|
|
24
|
+
var formattedPrice = utils.formatPriceWithNoZero(value);
|
|
25
25
|
var _d = React.useState(false), infoOpen = _d[0], setInfoOpen = _d[1];
|
|
26
26
|
var toggleInfoOpen = function () {
|
|
27
27
|
setInfoOpen(!infoOpen);
|
|
@@ -34,15 +34,13 @@ var CartSubTotal = function (_a) {
|
|
|
34
34
|
React__default["default"].createElement(icons.Icons.Info, { height: 16, width: 16 }))),
|
|
35
35
|
React__default["default"].createElement(CartSubTotal_styles.Price, { priceColor: priceColor }, (value !== 0 && !value) || isNaN(value)
|
|
36
36
|
? '-'
|
|
37
|
-
: "".concat(fromPriceLabel || '', " ").concat(formattedPrice
|
|
37
|
+
: "".concat(fromPriceLabel || '', " ").concat(formattedPrice, " kr")),
|
|
38
38
|
infoOpen && (React__default["default"].createElement(ToolTipDialog.ToolTipDialog, { onBottom: infoOnBottom, info: info, toggle: toggleInfoOpen })))) : (React__default["default"].createElement(CartSubTotal_styles.CartSubTotalContainer, { type: type },
|
|
39
39
|
React__default["default"].createElement(CartSubTotal_styles.SubTotalLabel, null,
|
|
40
40
|
label,
|
|
41
41
|
children),
|
|
42
|
-
value !== undefined ? (React__default["default"].createElement(CartSubTotal_styles.Price, { priceColor: priceColor },
|
|
43
|
-
formattedPrice
|
|
44
|
-
",", formattedPrice === null || formattedPrice === void 0 ? void 0 :
|
|
45
|
-
formattedPrice.decimal,
|
|
42
|
+
value !== undefined ? (React__default["default"].createElement(CartSubTotal_styles.Price, { priceColor: priceColor },
|
|
43
|
+
formattedPrice,
|
|
46
44
|
" kr")) : null));
|
|
47
45
|
};
|
|
48
46
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartSubTotal.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CartSubTotal.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -49,6 +49,14 @@ var formatPriceWithDecimalsReduced = function (price) {
|
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
+
var formatPriceWithNoZero = function (price) {
|
|
53
|
+
if ((price !== 0 && !price) || isNaN(price)) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
var formattedPrice = formatPriceWithDecimalsReduced(price);
|
|
57
|
+
return "".concat(formattedPrice === null || formattedPrice === void 0 ? void 0 : formattedPrice.value).concat("".concat((formattedPrice === null || formattedPrice === void 0 ? void 0 : formattedPrice.decimal) !== '00' ? ",".concat(formattedPrice === null || formattedPrice === void 0 ? void 0 : formattedPrice.decimal) : ''));
|
|
58
|
+
};
|
|
59
|
+
|
|
52
60
|
var capitalizeFirstLetter = function (string) {
|
|
53
61
|
if (string.length > 1) {
|
|
54
62
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
@@ -18715,6 +18723,7 @@ index.__exports.formatLeadingZero = formatLeadingZero;
|
|
|
18715
18723
|
index.__exports.formatPostalCode = formatPostalCode;
|
|
18716
18724
|
index.__exports.formatPrice = formatPrice;
|
|
18717
18725
|
index.__exports.formatPriceWithDecimalsReduced = formatPriceWithDecimalsReduced;
|
|
18726
|
+
index.__exports.formatPriceWithNoZero = formatPriceWithNoZero;
|
|
18718
18727
|
index.__exports.getCountryFromLanguageCode = getCountryFromLanguageCode;
|
|
18719
18728
|
index.__exports.languageCodeToCountryMap = languageCodeToCountryMap;
|
|
18720
18729
|
index.__exports.makeCateringPortionsString = makeCateringPortionsString;
|