@citygross/components 0.8.59 → 0.8.60
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/PriceTag/PriceTag.js +4 -4
- package/build/cjs/components/src/components/PriceTag/PriceTag.styles.js +2 -2
- package/build/es/components/src/components/PriceTag/PriceTag.js +4 -4
- package/build/es/components/src/components/PriceTag/PriceTag.styles.js +2 -2
- package/package.json +2 -2
|
@@ -16,12 +16,12 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
16
16
|
var PriceTag = function (_a) {
|
|
17
17
|
var _b = _a.multiPrice, multiPrice = _b === void 0 ? 0 : _b, _c = _a.pant, pant = _c === void 0 ? false : _c, price$1 = _a.price, _d = _a.variant, variant = _d === void 0 ? PriceTag_types.EPriceVariant.REGULAR : _d, _e = _a.size, size = _e === void 0 ? PriceTag_types.EPriceSize.MEDIUM : _e, unit = _a.unit;
|
|
18
18
|
var _f = price.getPriceTagAttributes(size, variant), sizeAttributes = _f.sizeAttributes, variantAttributes = _f.variantAttributes;
|
|
19
|
+
var isMultiPrice = multiPrice > 1;
|
|
20
|
+
var pantStr = '+pant';
|
|
19
21
|
var priceBase = Math.floor(price$1);
|
|
20
22
|
var priceDecimals = (price$1 % 1).toFixed(2).split('.')[1];
|
|
21
|
-
var isMultiPrice = multiPrice > 1;
|
|
22
23
|
var showPriceIndicator = priceDecimals === '00';
|
|
23
|
-
var showUnit = pant || unit
|
|
24
|
-
var pantStr = '+pant';
|
|
24
|
+
var showUnit = pant || !(isMultiPrice && unit === 'st');
|
|
25
25
|
return (React__default["default"].createElement(PriceTag_styles.PriceTagWrapper, { fontColor: variantAttributes.fontColor },
|
|
26
26
|
variant !== PriceTag_types.EPriceVariant.REGULAR && (React__default["default"].createElement(PriceTag_styles.PriceBannerContainer, null,
|
|
27
27
|
React__default["default"].createElement(PriceBanner.PriceBanner, { multiPrice: multiPrice, size: size, variant: variant }))),
|
|
@@ -31,7 +31,7 @@ var PriceTag = function (_a) {
|
|
|
31
31
|
React__default["default"].createElement(PriceTag_styles.PriceDetails, { pant: pant, width: sizeAttributes.detailsPantWidth },
|
|
32
32
|
showPriceIndicator ? (React__default["default"].createElement(PriceTag_styles.PriceIndicatorContainer, { isSmall: size === PriceTag_types.EPriceSize.SMALL, showUnit: showUnit },
|
|
33
33
|
React__default["default"].createElement(icons.Icons.PriceIndicator, { fill: variantAttributes.fontColor, size: sizeAttributes.indicatorSize }))) : (React__default["default"].createElement(PriceTag_styles.PriceDecimals, { fontSize: sizeAttributes.decimalsFontSize, isSmall: size === PriceTag_types.EPriceSize.SMALL }, priceDecimals)),
|
|
34
|
-
|
|
34
|
+
React__default["default"].createElement(PriceTag_styles.PriceUnit, { fontSize: sizeAttributes.unitFontSize, isSmall: size === PriceTag_types.EPriceSize.SMALL, pant: pant }, pant ? pantStr : isMultiPrice ? '' : "/".concat(unit)))))));
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
exports.PriceTag = PriceTag;
|
|
@@ -56,14 +56,14 @@ var PriceDecimals = styled__default["default"].span(templateObject_8 || (templat
|
|
|
56
56
|
return fontSize;
|
|
57
57
|
}, function (_a) {
|
|
58
58
|
var isSmall = _a.isSmall;
|
|
59
|
-
return (isSmall ? -
|
|
59
|
+
return (isSmall ? -12 : -14);
|
|
60
60
|
});
|
|
61
61
|
var PriceUnit = styled__default["default"].span(templateObject_9 || (templateObject_9 = _tslib.__makeTemplateObject(["\n font-size: ", "px;\n position: absolute;\n bottom: ", "px;\n right: ", "px;\n"], ["\n font-size: ", "px;\n position: absolute;\n bottom: ", "px;\n right: ", "px;\n"])), function (_a) {
|
|
62
62
|
var fontSize = _a.fontSize;
|
|
63
63
|
return fontSize;
|
|
64
64
|
}, function (_a) {
|
|
65
65
|
var isSmall = _a.isSmall;
|
|
66
|
-
return (isSmall ?
|
|
66
|
+
return (isSmall ? 5 : 6);
|
|
67
67
|
}, function (_a) {
|
|
68
68
|
var pant = _a.pant;
|
|
69
69
|
return (pant ? 3 : 5);
|
|
@@ -8,12 +8,12 @@ import { EPriceVariant, EPriceSize } from './PriceTag.types.js';
|
|
|
8
8
|
var PriceTag = function (_a) {
|
|
9
9
|
var _b = _a.multiPrice, multiPrice = _b === void 0 ? 0 : _b, _c = _a.pant, pant = _c === void 0 ? false : _c, price = _a.price, _d = _a.variant, variant = _d === void 0 ? EPriceVariant.REGULAR : _d, _e = _a.size, size = _e === void 0 ? EPriceSize.MEDIUM : _e, unit = _a.unit;
|
|
10
10
|
var _f = getPriceTagAttributes(size, variant), sizeAttributes = _f.sizeAttributes, variantAttributes = _f.variantAttributes;
|
|
11
|
+
var isMultiPrice = multiPrice > 1;
|
|
12
|
+
var pantStr = '+pant';
|
|
11
13
|
var priceBase = Math.floor(price);
|
|
12
14
|
var priceDecimals = (price % 1).toFixed(2).split('.')[1];
|
|
13
|
-
var isMultiPrice = multiPrice > 1;
|
|
14
15
|
var showPriceIndicator = priceDecimals === '00';
|
|
15
|
-
var showUnit = pant || unit
|
|
16
|
-
var pantStr = '+pant';
|
|
16
|
+
var showUnit = pant || !(isMultiPrice && unit === 'st');
|
|
17
17
|
return (React.createElement(PriceTagWrapper, { fontColor: variantAttributes.fontColor },
|
|
18
18
|
variant !== EPriceVariant.REGULAR && (React.createElement(PriceBannerContainer, null,
|
|
19
19
|
React.createElement(PriceBanner, { multiPrice: multiPrice, size: size, variant: variant }))),
|
|
@@ -23,7 +23,7 @@ var PriceTag = function (_a) {
|
|
|
23
23
|
React.createElement(PriceDetails, { pant: pant, width: sizeAttributes.detailsPantWidth },
|
|
24
24
|
showPriceIndicator ? (React.createElement(PriceIndicatorContainer, { isSmall: size === EPriceSize.SMALL, showUnit: showUnit },
|
|
25
25
|
React.createElement(Icons.PriceIndicator, { fill: variantAttributes.fontColor, size: sizeAttributes.indicatorSize }))) : (React.createElement(PriceDecimals, { fontSize: sizeAttributes.decimalsFontSize, isSmall: size === EPriceSize.SMALL }, priceDecimals)),
|
|
26
|
-
|
|
26
|
+
React.createElement(PriceUnit, { fontSize: sizeAttributes.unitFontSize, isSmall: size === EPriceSize.SMALL, pant: pant }, pant ? pantStr : isMultiPrice ? '' : "/".concat(unit)))))));
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export { PriceTag };
|
|
@@ -48,14 +48,14 @@ var PriceDecimals = styled.span(templateObject_8 || (templateObject_8 = __makeTe
|
|
|
48
48
|
return fontSize;
|
|
49
49
|
}, function (_a) {
|
|
50
50
|
var isSmall = _a.isSmall;
|
|
51
|
-
return (isSmall ? -
|
|
51
|
+
return (isSmall ? -12 : -14);
|
|
52
52
|
});
|
|
53
53
|
var PriceUnit = styled.span(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n font-size: ", "px;\n position: absolute;\n bottom: ", "px;\n right: ", "px;\n"], ["\n font-size: ", "px;\n position: absolute;\n bottom: ", "px;\n right: ", "px;\n"])), function (_a) {
|
|
54
54
|
var fontSize = _a.fontSize;
|
|
55
55
|
return fontSize;
|
|
56
56
|
}, function (_a) {
|
|
57
57
|
var isSmall = _a.isSmall;
|
|
58
|
-
return (isSmall ?
|
|
58
|
+
return (isSmall ? 5 : 6);
|
|
59
59
|
}, function (_a) {
|
|
60
60
|
var pant = _a.pant;
|
|
61
61
|
return (pant ? 3 : 5);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citygross/components",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.60",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./build/cjs/components/src/index.js",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"react-slick": "^0.30.1",
|
|
77
77
|
"slick-carousel": "^1.8.1"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "547bbd7051f70a9c74b09602de91412260f05a57"
|
|
80
80
|
}
|