sag_components 1.0.998 → 1.0.999
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/stories/components/BarChart.js +25 -12
- package/dist/stories/components/EventInfo.js +92 -0
- package/dist/stories/components/EventInfo.style.js +20 -0
- package/dist/stories/components/FilterButton.js +4 -10
- package/dist/stories/components/FilterButton.style.js +1 -1
- package/package.json +1 -1
- package/dist/stories/components/DoublePanelDataRow.js +0 -70
- package/dist/stories/components/DoublePanelDataRow.style.js +0 -66
|
@@ -37,13 +37,25 @@ const BarChart = props => {
|
|
|
37
37
|
referenceLinePoint,
|
|
38
38
|
referenceLineColor,
|
|
39
39
|
referenceLineDashed,
|
|
40
|
-
showCurrentCampaignStyle
|
|
40
|
+
showCurrentCampaignStyle,
|
|
41
|
+
isPercent
|
|
41
42
|
} = props;
|
|
42
43
|
const controlsContainerRef = (0, _react.useRef)();
|
|
43
|
-
const
|
|
44
|
-
if (!
|
|
44
|
+
const areAllDatesEmpty = () => {
|
|
45
|
+
if (!barChartData || (barChartData === null || barChartData === void 0 ? void 0 : barChartData.length) === 0) return true;
|
|
46
|
+
return barChartData === null || barChartData === void 0 ? void 0 : barChartData.every(item => !item.date);
|
|
47
|
+
};
|
|
48
|
+
const displayFormattedValue = function (value) {
|
|
49
|
+
let showFullNumber = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
50
|
+
if (value === undefined || value === null) return '';
|
|
45
51
|
let formattedValue = '';
|
|
46
|
-
|
|
52
|
+
if (isPercent) {
|
|
53
|
+
formattedValue = ''.concat(value.toFixed(1), '%');
|
|
54
|
+
} else if (isDollar) {
|
|
55
|
+
formattedValue = ''.concat(showDollarSign ? '$' : '', !showFullNumber ? (0, _CommonFunctions.getFormattedValue)(value) : (0, _CommonFunctions.getNumberWithCommas)(value), !showFullNumber ? (0, _CommonFunctions.getFormattedUnits)(value) : '');
|
|
56
|
+
} else {
|
|
57
|
+
formattedValue = ''.concat(!showFullNumber ? (0, _CommonFunctions.getFormattedValue)(value) : (0, _CommonFunctions.getNumberWithCommas)(value), !showFullNumber ? (0, _CommonFunctions.getFormattedUnits)(value) : '');
|
|
58
|
+
}
|
|
47
59
|
return formattedValue;
|
|
48
60
|
};
|
|
49
61
|
|
|
@@ -58,7 +70,7 @@ const BarChart = props => {
|
|
|
58
70
|
if (!active || !payload || (payload === null || payload === void 0 ? void 0 : payload.length) === 0) return null;
|
|
59
71
|
let currentTooltipValue = 0;
|
|
60
72
|
if ((_payload$0$payload = payload[0].payload) !== null && _payload$0$payload !== void 0 && _payload$0$payload.value) currentTooltipValue = (_payload$0$payload2 = payload[0].payload) === null || _payload$0$payload2 === void 0 ? void 0 : _payload$0$payload2.value;
|
|
61
|
-
return /*#__PURE__*/_react.default.createElement(_BarChart.TooltipDiv, null, /*#__PURE__*/_react.default.createElement(_BarChart.TooltipTitle, null, `${label}`), /*#__PURE__*/_react.default.createElement(_BarChart.TooltipLabel, null, `${displayFormattedValue(currentTooltipValue)}`));
|
|
73
|
+
return /*#__PURE__*/_react.default.createElement(_BarChart.TooltipDiv, null, /*#__PURE__*/_react.default.createElement(_BarChart.TooltipTitle, null, `${label}`), /*#__PURE__*/_react.default.createElement(_BarChart.TooltipLabel, null, `${displayFormattedValue(currentTooltipValue, !!showCurrentCampaignStyle)}`));
|
|
62
74
|
};
|
|
63
75
|
const CustomizedTickBarChart = props => {
|
|
64
76
|
const {
|
|
@@ -72,11 +84,11 @@ const BarChart = props => {
|
|
|
72
84
|
return /*#__PURE__*/_react.default.createElement("g", {
|
|
73
85
|
transform: `translate(${x},${y})`
|
|
74
86
|
}, showCurrentCampaignStyle && retailerData[0].isCurrent && /*#__PURE__*/_react.default.createElement("rect", {
|
|
75
|
-
x: -
|
|
87
|
+
x: -58 // Adjust this to position the background properly
|
|
76
88
|
,
|
|
77
|
-
y:
|
|
89
|
+
y: 5 // Adjust this for vertical alignment with your text
|
|
78
90
|
,
|
|
79
|
-
width:
|
|
91
|
+
width: 116 // Adjust width based on the text length
|
|
80
92
|
,
|
|
81
93
|
height: 22 // Adjust height based on font size
|
|
82
94
|
,
|
|
@@ -89,8 +101,8 @@ const BarChart = props => {
|
|
|
89
101
|
fill: "#212121"
|
|
90
102
|
}, /*#__PURE__*/_react.default.createElement(_BarChart.LabelBoldText, {
|
|
91
103
|
textAnchor: "middle",
|
|
92
|
-
x:
|
|
93
|
-
dy:
|
|
104
|
+
x: 0,
|
|
105
|
+
dy: showCurrentCampaignStyle ? 20 : 50,
|
|
94
106
|
fontSize: showCurrentCampaignStyle ? 12 : 16,
|
|
95
107
|
fontWeight: showCurrentCampaignStyle ? 500 : 600
|
|
96
108
|
}, payload.value), /*#__PURE__*/_react.default.createElement(_BarChart.LabelText, {
|
|
@@ -162,7 +174,7 @@ const BarChart = props => {
|
|
|
162
174
|
dataKey: "title",
|
|
163
175
|
tick: CustomizedTickBarChart,
|
|
164
176
|
tickLine: false,
|
|
165
|
-
height: 120,
|
|
177
|
+
height: areAllDatesEmpty() ? 50 : 120,
|
|
166
178
|
stroke: "#D0D0D0",
|
|
167
179
|
domain: [0, 'auto'],
|
|
168
180
|
interval: 0
|
|
@@ -224,5 +236,6 @@ BarChart.defaultProps = {
|
|
|
224
236
|
referenceLineColor: '#212121',
|
|
225
237
|
referenceLineDashed: '5',
|
|
226
238
|
showCurrentCampaignStyle: false,
|
|
227
|
-
currentBarColor: '#90CE9C'
|
|
239
|
+
currentBarColor: '#90CE9C',
|
|
240
|
+
isPercent: false
|
|
228
241
|
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _MenuItemOpenIcon = require("./icons/MenuItemOpenIcon");
|
|
10
|
+
var _MenuItemUpIcon = require("./icons/MenuItemUpIcon");
|
|
11
|
+
var _SpotlightProductIcon = require("./icons/SpotlightProductIcon");
|
|
12
|
+
var _BannersDropdown = require("./BannersDropdown");
|
|
13
|
+
var _EventInfo = require("./EventInfo.style");
|
|
14
|
+
const EventInfo = props => {
|
|
15
|
+
const {
|
|
16
|
+
title,
|
|
17
|
+
subTitle,
|
|
18
|
+
productsData,
|
|
19
|
+
onSpotlightProductClick,
|
|
20
|
+
onClickBannersDropdown
|
|
21
|
+
} = props;
|
|
22
|
+
const [IsProductsListOpen, setIsProductsListOpen] = (0, _react.useState)(false);
|
|
23
|
+
const displayBannersDropdown = () => /*#__PURE__*/_react.default.createElement(_BannersDropdown.BannersDropdown, {
|
|
24
|
+
banners: [{
|
|
25
|
+
checked: true,
|
|
26
|
+
name: 'StopAndShop'
|
|
27
|
+
}, {
|
|
28
|
+
checked: true,
|
|
29
|
+
name: 'FoodLion'
|
|
30
|
+
}, {
|
|
31
|
+
checked: true,
|
|
32
|
+
name: 'GiantFood'
|
|
33
|
+
}, {
|
|
34
|
+
checked: true,
|
|
35
|
+
name: 'TheGiantCompany'
|
|
36
|
+
}, {
|
|
37
|
+
checked: true,
|
|
38
|
+
name: 'Hannaford'
|
|
39
|
+
}],
|
|
40
|
+
onClick: banners => {
|
|
41
|
+
onClickBannersDropdown({
|
|
42
|
+
banners
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return /*#__PURE__*/_react.default.createElement(_EventInfo.EventInfoMainContainer, {
|
|
47
|
+
id: "EventInfoMainContainer"
|
|
48
|
+
}, /*#__PURE__*/_react.default.createElement(_EventInfo.EventInfoContainer, {
|
|
49
|
+
id: "EventInfoContainer"
|
|
50
|
+
}, /*#__PURE__*/_react.default.createElement(_EventInfo.EventInfoTitleContainer, {
|
|
51
|
+
id: "EventInfoTitleContainer"
|
|
52
|
+
}, /*#__PURE__*/_react.default.createElement(_EventInfo.EventInfoTitle, {
|
|
53
|
+
id: "EventInfoTitle"
|
|
54
|
+
}, title), /*#__PURE__*/_react.default.createElement(_EventInfo.EventInfoSubTitle, {
|
|
55
|
+
id: "EventInfoSubTitle"
|
|
56
|
+
}, "|"), /*#__PURE__*/_react.default.createElement(_EventInfo.EventInfoSubTitle, {
|
|
57
|
+
id: "EventInfoSubTitle"
|
|
58
|
+
}, productsData ? productsData === null || productsData === void 0 ? void 0 : productsData.length : ''), displayBannersDropdown()), /*#__PURE__*/_react.default.createElement(_EventInfo.ProductButtonContainer, {
|
|
59
|
+
id: "ProductButtonContainer",
|
|
60
|
+
onClick: () => {
|
|
61
|
+
setIsProductsListOpen(!IsProductsListOpen);
|
|
62
|
+
}
|
|
63
|
+
}, IsProductsListOpen ? /*#__PURE__*/_react.default.createElement(_MenuItemUpIcon.MenuItemUpIcon, {
|
|
64
|
+
color: "#212121"
|
|
65
|
+
}) : /*#__PURE__*/_react.default.createElement(_MenuItemOpenIcon.MenuItemOpenIcon, {
|
|
66
|
+
color: "#212121"
|
|
67
|
+
}))), IsProductsListOpen && /*#__PURE__*/_react.default.createElement(_EventInfo.EventInfoContentContainer, {
|
|
68
|
+
id: "EventInfoContentContainer"
|
|
69
|
+
}, /*#__PURE__*/_react.default.createElement(_EventInfo.ProductsTitle, {
|
|
70
|
+
id: "ProductsTitle"
|
|
71
|
+
}, subTitle), productsData === null || productsData === void 0 ? void 0 : productsData.map(item => /*#__PURE__*/_react.default.createElement(_EventInfo.ProductContainer, {
|
|
72
|
+
id: "ProductContainer"
|
|
73
|
+
}, /*#__PURE__*/_react.default.createElement(_EventInfo.Product, {
|
|
74
|
+
id: "Product"
|
|
75
|
+
}, item.label), item.ShowSpotlightProductButton ? /*#__PURE__*/_react.default.createElement(_EventInfo.ProductButtonContainer, {
|
|
76
|
+
id: "ProductButtonContainer",
|
|
77
|
+
background: "#F8CD00",
|
|
78
|
+
onClick: () => {
|
|
79
|
+
onSpotlightProductClick({
|
|
80
|
+
value: item.value,
|
|
81
|
+
label: item.label
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}, /*#__PURE__*/_react.default.createElement(_SpotlightProductIcon.SpotlightProductIcon, null)) : ''))));
|
|
85
|
+
};
|
|
86
|
+
var _default = exports.default = EventInfo;
|
|
87
|
+
EventInfo.defaultProps = {
|
|
88
|
+
title: 'Products Variety',
|
|
89
|
+
subTitle: 'Product Name',
|
|
90
|
+
onSpotlightProductClick: () => {},
|
|
91
|
+
onClickBannersDropdown: () => {}
|
|
92
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ProductsTitle = exports.ProductContainer = exports.ProductButtonContainer = exports.Product = exports.EventInfoTitleContainer = exports.EventInfoTitle = exports.EventInfoSubTitle = exports.EventInfoMainContainer = exports.EventInfoContentContainer = exports.EventInfoContainer = void 0;
|
|
8
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
11
|
+
const EventInfoMainContainer = exports.EventInfoMainContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n margin: 0;\n padding: 10px;\n border-radius: 12px;\n box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);\n"])));
|
|
12
|
+
const EventInfoContainer = exports.EventInfoContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin: 0 10px;\n"])));
|
|
13
|
+
const EventInfoTitleContainer = exports.EventInfoTitleContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n font-family: \"Poppins\", sans-serif;\n font-style: normal;\n font-size: 20px;\n line-height: 25px;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n margin: 10px;\n gap: 15px;\n"])));
|
|
14
|
+
const EventInfoTitle = exports.EventInfoTitle = _styledComponents.default.h3(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n font-size: 20px;\n\n margin: 0;\n"])));
|
|
15
|
+
const EventInfoSubTitle = exports.EventInfoSubTitle = _styledComponents.default.h3(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n color: #757171;\n font-weight: 500;\n font-size: 20px;\n margin: 0;\n"])));
|
|
16
|
+
const EventInfoContentContainer = exports.EventInfoContentContainer = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-family: \"Poppins\", sans-serif;\n font-style: normal;\n font-size: 20px;\n line-height: 25px;\n display: flex;\n justify-content: flex-start;\n flex-direction: column;\n align-items: flex-start;\n margin: 10px;\n padding: 10px 20px 20px 50px;\n"])));
|
|
17
|
+
const ProductsTitle = exports.ProductsTitle = _styledComponents.default.h3(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 600;\n font-size: 14px;\n margin: 10px 0;\n"])));
|
|
18
|
+
const ProductContainer = exports.ProductContainer = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: flex-start;\n align-items: center;\n border-bottom: 1px solid #00000010;\n width: 100%;\n gap: 20px;\n"])));
|
|
19
|
+
const Product = exports.Product = _styledComponents.default.h3(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 400;\n font-size: 14px;\n border-radius: 12px;\n"])));
|
|
20
|
+
const ProductButtonContainer = exports.ProductButtonContainer = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n background: ", ";\n border-radius: 12px;\n height: 25px;\n padding: 0 15px;\n user-select: none;\n &:hover {\n background-color: #f0f0f0;\n cursor: pointer;\n }\n gap: 10px;\n"])), props => props.background || '#ffffff');
|
|
@@ -1,33 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.FilterButton = void 0;
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _FilterButton = require("./FilterButton.style");
|
|
10
10
|
var _FilterIcon = require("./icons/FilterIcon");
|
|
11
11
|
const FilterButton = props => {
|
|
12
12
|
const {
|
|
13
13
|
color,
|
|
14
|
-
activeColor,
|
|
15
14
|
height,
|
|
16
15
|
buttonText,
|
|
17
16
|
iconWidth,
|
|
18
17
|
iconHeight,
|
|
19
18
|
disabled,
|
|
20
|
-
openState,
|
|
21
19
|
onButtonClick
|
|
22
20
|
} = props;
|
|
23
|
-
const [activeState, setActiveState] = (0, _react.useState)(openState);
|
|
24
21
|
const onClickHandler = event => {
|
|
25
22
|
onButtonClick(event);
|
|
26
|
-
setActiveState(!activeState);
|
|
27
23
|
};
|
|
28
24
|
return /*#__PURE__*/_react.default.createElement(_FilterButton.FilterButtonWrapper, {
|
|
29
25
|
height: height,
|
|
30
|
-
color:
|
|
26
|
+
color: color,
|
|
31
27
|
disabled: disabled,
|
|
32
28
|
onClick: event => {
|
|
33
29
|
onClickHandler(event);
|
|
@@ -35,7 +31,7 @@ const FilterButton = props => {
|
|
|
35
31
|
}, /*#__PURE__*/_react.default.createElement(_FilterIcon.FilterIcon, {
|
|
36
32
|
width: iconWidth,
|
|
37
33
|
height: iconHeight,
|
|
38
|
-
color:
|
|
34
|
+
color: color
|
|
39
35
|
}), /*#__PURE__*/_react.default.createElement(_FilterButton.SpanText, null, buttonText));
|
|
40
36
|
};
|
|
41
37
|
exports.FilterButton = FilterButton;
|
|
@@ -44,10 +40,8 @@ FilterButton.defaultProps = {
|
|
|
44
40
|
buttonText: 'Filter',
|
|
45
41
|
height: '40px',
|
|
46
42
|
color: '#212121',
|
|
47
|
-
activeColor: '#229E38',
|
|
48
43
|
iconHeight: 12,
|
|
49
44
|
iconWidth: 12,
|
|
50
|
-
openState: false,
|
|
51
45
|
disabled: false,
|
|
52
46
|
onButtonClick: () => {}
|
|
53
47
|
};
|
|
@@ -8,5 +8,5 @@ exports.SpanText = exports.FilterButtonWrapper = void 0;
|
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
10
|
var _templateObject, _templateObject2;
|
|
11
|
-
const FilterButtonWrapper = exports.FilterButtonWrapper = _styledComponents.default.button(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n height: ", ";\n font-size: 14px;\n font-weight: 400;\n display: flex;\n gap: 8px;\n align-items: center;\n justify-content: center;\n padding: 8px 18px;\n color: ", ";\n border-radius: 8px;\n border: 1px solid
|
|
11
|
+
const FilterButtonWrapper = exports.FilterButtonWrapper = _styledComponents.default.button(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n height: ", ";\n font-size: 14px;\n font-weight: 400;\n display: flex;\n gap: 8px;\n align-items: center;\n justify-content: center;\n padding: 8px 18px;\n color: ", ";\n border-radius: 8px;\n border: 1px solid #B1B1B1;\n background: transparent;\n transition: box-shadow 0.3s ease;\n &:hover, &:focus {\n cursor: pointer;\n box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.1);\n }\n"])), props => props.height, props => props.color);
|
|
12
12
|
const SpanText = exports.SpanText = _styledComponents.default.span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n"])));
|
package/package.json
CHANGED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = exports.DoublePanelDataRow = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _DoublePanelDataRow = require("./DoublePanelDataRow.style");
|
|
10
|
-
var _ArrowUpIcon = require("./icons/ArrowUpIcon");
|
|
11
|
-
var _ArrowDownIcon = require("./icons/ArrowDownIcon");
|
|
12
|
-
var _CommonFunctions = require("./CommonFunctions");
|
|
13
|
-
/* eslint-disable no-restricted-globals */
|
|
14
|
-
|
|
15
|
-
const DoublePanelDataRow = props => {
|
|
16
|
-
const {
|
|
17
|
-
width,
|
|
18
|
-
height,
|
|
19
|
-
data,
|
|
20
|
-
backgroundColor,
|
|
21
|
-
className,
|
|
22
|
-
customDataFormat,
|
|
23
|
-
showPercentChange
|
|
24
|
-
} = props;
|
|
25
|
-
const getArrowSign = arrowSign => {
|
|
26
|
-
if (!arrowSign) {
|
|
27
|
-
return '-';
|
|
28
|
-
}
|
|
29
|
-
if (arrowSign === 'up') {
|
|
30
|
-
return /*#__PURE__*/_react.default.createElement(_DoublePanelDataRow.PercentageChange, {
|
|
31
|
-
color: "#5FCC70",
|
|
32
|
-
value: 34 // TODO: when ready, replace with actual value
|
|
33
|
-
}, /*#__PURE__*/_react.default.createElement(_ArrowUpIcon.ArrowUpIcon, {
|
|
34
|
-
width: 12,
|
|
35
|
-
height: 12
|
|
36
|
-
}), ' ', "(+34K)");
|
|
37
|
-
}
|
|
38
|
-
return /*#__PURE__*/_react.default.createElement(_DoublePanelDataRow.PercentageChange, {
|
|
39
|
-
color: "#D23630",
|
|
40
|
-
value: 66 // TODO: when ready, replace with actual value
|
|
41
|
-
}, /*#__PURE__*/_react.default.createElement(_ArrowDownIcon.ArrowDownIcon, {
|
|
42
|
-
width: 12,
|
|
43
|
-
height: 12
|
|
44
|
-
}), ' ', "(-12K)");
|
|
45
|
-
};
|
|
46
|
-
return /*#__PURE__*/_react.default.createElement(_DoublePanelDataRow.LinnerContainer, {
|
|
47
|
-
className: className,
|
|
48
|
-
backgroundColor: backgroundColor,
|
|
49
|
-
width: width,
|
|
50
|
-
height: height,
|
|
51
|
-
customDataFormat: customDataFormat
|
|
52
|
-
}, data.map(item => /*#__PURE__*/_react.default.createElement(_DoublePanelDataRow.DataBox, {
|
|
53
|
-
className: "data-box-item"
|
|
54
|
-
}, item.title && /*#__PURE__*/_react.default.createElement(_DoublePanelDataRow.DataBoxTitle, {
|
|
55
|
-
className: "DataBoxTitle"
|
|
56
|
-
}, item.title), /*#__PURE__*/_react.default.createElement(_DoublePanelDataRow.CellItem, null, item.value !== null && item.value !== undefined && !isNaN(item.value) && item.value !== 'null' && item.value !== 'undefined' ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.sign && /*#__PURE__*/_react.default.createElement(_DoublePanelDataRow.CellItemValueSign, null, item.sign), customDataFormat ? /*#__PURE__*/_react.default.createElement(_DoublePanelDataRow.BigValue, {
|
|
57
|
-
className: "DataBoxValue"
|
|
58
|
-
}, ''.concat((0, _CommonFunctions.formattedValue)(item.value), (0, _CommonFunctions.getFormattedUnits)(item.value)), item.isPercent && /*#__PURE__*/_react.default.createElement(_DoublePanelDataRow.CellItemValueSign, null, "%")) : /*#__PURE__*/_react.default.createElement(_DoublePanelDataRow.BigValue, null, ''.concat((0, _CommonFunctions.getFormattedValue)(item.value), (0, _CommonFunctions.getFormattedUnits)(item.value)), item.isPercent && /*#__PURE__*/_react.default.createElement(_DoublePanelDataRow.CellItemValueSign, null, "%")), showPercentChange && getArrowSign(item.value >= 0 ? 'up' : 'down')) : /*#__PURE__*/_react.default.createElement(_DoublePanelDataRow.CellItemNoValue, null, "N/A")), /*#__PURE__*/_react.default.createElement(_DoublePanelDataRow.ValueChange, null))));
|
|
59
|
-
};
|
|
60
|
-
exports.DoublePanelDataRow = DoublePanelDataRow;
|
|
61
|
-
var _default = exports.default = DoublePanelDataRow;
|
|
62
|
-
DoublePanelDataRow.defaultProps = {
|
|
63
|
-
className: '',
|
|
64
|
-
width: '100%',
|
|
65
|
-
height: 'auto',
|
|
66
|
-
data: [],
|
|
67
|
-
backgroundColor: '#FFFFFF',
|
|
68
|
-
customDataFormat: false,
|
|
69
|
-
showPercentChange: false
|
|
70
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.ValueChange = exports.PercentageChange = exports.LinnerContainer = exports.DataBoxTitle = exports.DataBox = exports.CellItemValueSign = exports.CellItemNoValue = exports.CellItem = exports.BigValue = void 0;
|
|
8
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
-
const LinnerContainer = exports.LinnerContainer = _styledComponents.default.div`
|
|
10
|
-
font-family: "Poppins", sans-serif;
|
|
11
|
-
display: grid;
|
|
12
|
-
gap: 48px 0;
|
|
13
|
-
grid-template-columns: repeat(5, 1fr);
|
|
14
|
-
grid-template-rows: auto auto;
|
|
15
|
-
width: ${props => props.width};
|
|
16
|
-
height: ${props => props.height};
|
|
17
|
-
background-color: ${props => props.backgroundColor};
|
|
18
|
-
padding: 50px 20px 20px;
|
|
19
|
-
box-sizing: border-box;
|
|
20
|
-
`;
|
|
21
|
-
const DataBox = exports.DataBox = _styledComponents.default.div`
|
|
22
|
-
height: 100%;
|
|
23
|
-
padding: 0 40px;
|
|
24
|
-
border-left: 1px solid #d0d0d0;
|
|
25
|
-
&:nth-child(1),
|
|
26
|
-
&:nth-child(6) {
|
|
27
|
-
border-left: none;
|
|
28
|
-
padding-left: 0;
|
|
29
|
-
}
|
|
30
|
-
&:nth-child(5),
|
|
31
|
-
&:nth-child(10) {
|
|
32
|
-
padding-right: 0;
|
|
33
|
-
}
|
|
34
|
-
`;
|
|
35
|
-
const CellItem = exports.CellItem = _styledComponents.default.div`
|
|
36
|
-
display: flex;
|
|
37
|
-
align-items: center;
|
|
38
|
-
`;
|
|
39
|
-
const DataBoxTitle = exports.DataBoxTitle = _styledComponents.default.span`
|
|
40
|
-
font-size: 18px;
|
|
41
|
-
display: block;
|
|
42
|
-
margin: 0 0 12px;
|
|
43
|
-
`;
|
|
44
|
-
const BigValue = exports.BigValue = _styledComponents.default.span`
|
|
45
|
-
font-size: 40px;
|
|
46
|
-
font-weight: 500;
|
|
47
|
-
margin-right: 5px;
|
|
48
|
-
`;
|
|
49
|
-
const CellItemValueSign = exports.CellItemValueSign = _styledComponents.default.span`
|
|
50
|
-
font-size: 16px;
|
|
51
|
-
font-weight: 400;
|
|
52
|
-
`;
|
|
53
|
-
const ValueChange = exports.ValueChange = _styledComponents.default.span`
|
|
54
|
-
font-size: 16px;
|
|
55
|
-
font-weight: 400;
|
|
56
|
-
`;
|
|
57
|
-
const CellItemNoValue = exports.CellItemNoValue = _styledComponents.default.span`
|
|
58
|
-
font-size: 40px;
|
|
59
|
-
font-weight: 500;
|
|
60
|
-
`;
|
|
61
|
-
const PercentageChange = exports.PercentageChange = _styledComponents.default.div`
|
|
62
|
-
display: flex;
|
|
63
|
-
align-items: center;
|
|
64
|
-
font-size: 16px;
|
|
65
|
-
color: ${props => props.color};
|
|
66
|
-
`;
|