sag_components 1.0.670 → 1.0.672
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/BarChartTwoRows.js +203 -0
- package/dist/stories/components/BarChartTwoRows.style.js +19 -0
- package/dist/stories/components/TotalCostModal.js +143 -0
- package/dist/stories/components/TwoBarCharts.js +216 -0
- package/dist/stories/components/TwoBarCharts.style.js +19 -0
- package/package.json +1 -1
- package/dist/stories/CampaignTool/PopupContent.stories.js +0 -284
- package/dist/stories/components/BannerEventBoxList.js +0 -64
- package/dist/stories/components/BannerEventBoxList.style.js +0 -11
- package/dist/stories/components/FilterButton.js +0 -53
- package/dist/stories/components/FilterButton.style.js +0 -12
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.BarChartTwoRows = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _recharts = require("recharts");
|
|
11
|
+
var _CommonFunctions = require("./CommonFunctions");
|
|
12
|
+
var _BarChartTwoRows = require("./BarChartTwoRows.style");
|
|
13
|
+
var _PerformanceAnalyticsLegend = _interopRequireDefault(require("./PerformanceAnalyticsLegend"));
|
|
14
|
+
/* eslint-disable react/prop-types */
|
|
15
|
+
/* eslint-disable no-shadow */
|
|
16
|
+
/* eslint-disable react/no-unstable-nested-components */
|
|
17
|
+
/* eslint-disable no-nested-ternary */
|
|
18
|
+
|
|
19
|
+
const ICON_TYPE_SQUARE = 'Square';
|
|
20
|
+
/* BarChartsByWeeks */
|
|
21
|
+
const BarChartTwoRows = props => {
|
|
22
|
+
const {
|
|
23
|
+
className,
|
|
24
|
+
title,
|
|
25
|
+
barChartData,
|
|
26
|
+
barSize,
|
|
27
|
+
isDollar,
|
|
28
|
+
width,
|
|
29
|
+
height,
|
|
30
|
+
barChartColorFirst,
|
|
31
|
+
barChartColorSecond,
|
|
32
|
+
showLegend,
|
|
33
|
+
legendData,
|
|
34
|
+
lowerValueLabel,
|
|
35
|
+
highValueLabel
|
|
36
|
+
} = props;
|
|
37
|
+
const controlsContainerRef = (0, _react.useRef)();
|
|
38
|
+
const displayFormattedValue = value => {
|
|
39
|
+
if (!value) return '';
|
|
40
|
+
let formattedValue = '';
|
|
41
|
+
formattedValue = !isDollar ? ''.concat('X', value.toFixed(1)) : ''.concat('$', (0, _CommonFunctions.getFormattedValue)(value), (0, _CommonFunctions.getFormattedUnits)(value));
|
|
42
|
+
return formattedValue;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// eslint-disable-next-line react/no-unstable-nested-components
|
|
46
|
+
const CustomTooltip = tooltipData => {
|
|
47
|
+
var _payload$0$payload, _payload$0$payload2, _payload$0$payload3, _payload$0$payload4;
|
|
48
|
+
const {
|
|
49
|
+
active,
|
|
50
|
+
payload,
|
|
51
|
+
label
|
|
52
|
+
} = tooltipData;
|
|
53
|
+
if (!active || !payload || (payload === null || payload === void 0 ? void 0 : payload.length) === 0) return null;
|
|
54
|
+
let currentTooltipLowerValue = 0;
|
|
55
|
+
let currentTooltipHighValue = 0;
|
|
56
|
+
if ((_payload$0$payload = payload[0].payload) !== null && _payload$0$payload !== void 0 && _payload$0$payload.lowerValue) currentTooltipLowerValue = (_payload$0$payload2 = payload[0].payload) === null || _payload$0$payload2 === void 0 ? void 0 : _payload$0$payload2.lowerValue;
|
|
57
|
+
if ((_payload$0$payload3 = payload[0].payload) !== null && _payload$0$payload3 !== void 0 && _payload$0$payload3.highValue) currentTooltipHighValue = (_payload$0$payload4 = payload[0].payload) === null || _payload$0$payload4 === void 0 ? void 0 : _payload$0$payload4.highValue;
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.TooltipDiv, null, /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.TooltipTitle, null, "".concat(label)), /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.TooltipLabel, null, "".concat(lowerValueLabel, " ").concat(displayFormattedValue(currentTooltipLowerValue))), /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.TooltipLabel, null, "".concat(highValueLabel, " ").concat(displayFormattedValue(currentTooltipHighValue))));
|
|
59
|
+
};
|
|
60
|
+
const CustomizedTickBarChart = props => {
|
|
61
|
+
const {
|
|
62
|
+
x,
|
|
63
|
+
y,
|
|
64
|
+
payload
|
|
65
|
+
} = props;
|
|
66
|
+
if (barChartData && barChartData.length > 0 && payload) {
|
|
67
|
+
const retailerData = barChartData.filter(item => item.title === payload.value);
|
|
68
|
+
if (retailerData && retailerData.length > 0) {
|
|
69
|
+
return /*#__PURE__*/_react.default.createElement("g", {
|
|
70
|
+
transform: "translate(".concat(x, ",").concat(y, ")")
|
|
71
|
+
// onMouseEnter={() => handleMouseEnter(offerType)}
|
|
72
|
+
// onMouseLeave={handleMouseLeave}
|
|
73
|
+
}, /*#__PURE__*/_react.default.createElement("text", {
|
|
74
|
+
x: 0,
|
|
75
|
+
y: 0,
|
|
76
|
+
dy: 16,
|
|
77
|
+
fill: "#212121"
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.LabelBoldText, {
|
|
79
|
+
textAnchor: "middle",
|
|
80
|
+
x: "0",
|
|
81
|
+
dy: "50",
|
|
82
|
+
fontSize: 16,
|
|
83
|
+
fontWeight: 600
|
|
84
|
+
}, payload.value), /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.LabelText, {
|
|
85
|
+
textAnchor: "middle",
|
|
86
|
+
x: "0",
|
|
87
|
+
dy: "30",
|
|
88
|
+
fontSize: 14,
|
|
89
|
+
fontWeight: 400
|
|
90
|
+
}, retailerData[0].date)));
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
};
|
|
96
|
+
const CustomizedLabel = props => {
|
|
97
|
+
const {
|
|
98
|
+
x,
|
|
99
|
+
y,
|
|
100
|
+
stroke,
|
|
101
|
+
value
|
|
102
|
+
} = props;
|
|
103
|
+
return /*#__PURE__*/_react.default.createElement("text", {
|
|
104
|
+
x: x,
|
|
105
|
+
y: y,
|
|
106
|
+
dy: -8,
|
|
107
|
+
fill: stroke,
|
|
108
|
+
fontSize: 14
|
|
109
|
+
}, displayFormattedValue(value));
|
|
110
|
+
};
|
|
111
|
+
return /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.ControlsContainer, {
|
|
112
|
+
className: className,
|
|
113
|
+
id: "ControlsContainer",
|
|
114
|
+
height: height,
|
|
115
|
+
width: width,
|
|
116
|
+
ref: controlsContainerRef
|
|
117
|
+
}, /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.Controls, {
|
|
118
|
+
id: "Controls"
|
|
119
|
+
}, /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.TitleAndValueContainer, {
|
|
120
|
+
id: "TitleAndValueContainer"
|
|
121
|
+
}, /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.Title, {
|
|
122
|
+
id: "Title"
|
|
123
|
+
}, title)), /*#__PURE__*/_react.default.createElement(_recharts.ResponsiveContainer, {
|
|
124
|
+
id: "ResponsiveContainer",
|
|
125
|
+
width: "100%",
|
|
126
|
+
height: showLegend ? '80%' : '86%'
|
|
127
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.BarChart, {
|
|
128
|
+
width: width,
|
|
129
|
+
height: height,
|
|
130
|
+
data: barChartData,
|
|
131
|
+
margin: {
|
|
132
|
+
top: 20,
|
|
133
|
+
right: 0,
|
|
134
|
+
bottom: -25,
|
|
135
|
+
left: -5
|
|
136
|
+
}
|
|
137
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.XAxis, {
|
|
138
|
+
dataKey: "title",
|
|
139
|
+
tick: CustomizedTickBarChart,
|
|
140
|
+
tickLine: false,
|
|
141
|
+
height: 120,
|
|
142
|
+
stroke: "#D0D0D0"
|
|
143
|
+
}), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, {
|
|
144
|
+
content: /*#__PURE__*/_react.default.createElement(CustomTooltip, null)
|
|
145
|
+
}), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, null), /*#__PURE__*/_react.default.createElement(_recharts.Bar, {
|
|
146
|
+
dataKey: "lowerValue",
|
|
147
|
+
fill: barChartColorFirst,
|
|
148
|
+
minPointSize: 5,
|
|
149
|
+
barSize: barSize !== null && barSize !== void 0 ? barSize : 60,
|
|
150
|
+
radius: [5, 5, 0, 0],
|
|
151
|
+
stackId: "a"
|
|
152
|
+
}), /*#__PURE__*/_react.default.createElement(_recharts.Bar, {
|
|
153
|
+
dataKey: "highValue",
|
|
154
|
+
fill: barChartColorSecond,
|
|
155
|
+
stackId: "a",
|
|
156
|
+
radius: [5, 5, 0, 0]
|
|
157
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.LabelList, {
|
|
158
|
+
dataKey: "value",
|
|
159
|
+
content: CustomizedLabel
|
|
160
|
+
})))), showLegend && /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsLegend.default, {
|
|
161
|
+
legendData: legendData
|
|
162
|
+
})));
|
|
163
|
+
};
|
|
164
|
+
exports.BarChartTwoRows = BarChartTwoRows;
|
|
165
|
+
var _default = exports.default = BarChartTwoRows;
|
|
166
|
+
BarChartTwoRows.defaultProps = {
|
|
167
|
+
title: 'String',
|
|
168
|
+
barChartData: [{
|
|
169
|
+
title: 'Food Lion',
|
|
170
|
+
date: '15.01.24-31.01.24',
|
|
171
|
+
value: 542366
|
|
172
|
+
}, {
|
|
173
|
+
title: 'Hannaford',
|
|
174
|
+
date: '15.01.24-31.01.24',
|
|
175
|
+
value: 699511
|
|
176
|
+
}, {
|
|
177
|
+
title: 'The Giant Company',
|
|
178
|
+
date: '15.01.24-31.01.24',
|
|
179
|
+
value: 403092
|
|
180
|
+
}, {
|
|
181
|
+
title: 'Giant Food',
|
|
182
|
+
date: '15.01.24-31.01.24',
|
|
183
|
+
value: 396184
|
|
184
|
+
}, {
|
|
185
|
+
title: 'Stop&Shop',
|
|
186
|
+
date: '15.01.24-31.01.24',
|
|
187
|
+
value: 415317
|
|
188
|
+
}],
|
|
189
|
+
width: '100%',
|
|
190
|
+
height: '100%',
|
|
191
|
+
barSize: 60,
|
|
192
|
+
barChartColorFirst: '#BD9EFF',
|
|
193
|
+
barChartColorSecond: '#0b00aaF',
|
|
194
|
+
isDollar: true,
|
|
195
|
+
showLegend: true,
|
|
196
|
+
legendData: [{
|
|
197
|
+
title: 'Incremental Sales',
|
|
198
|
+
iconType: ICON_TYPE_SQUARE,
|
|
199
|
+
iconColor: '#BD9EFF'
|
|
200
|
+
}],
|
|
201
|
+
lowerValueLabel: 'Lower Value:',
|
|
202
|
+
highValueLabel: 'High Value:'
|
|
203
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.TooltipTitle = exports.TooltipLabel = exports.TooltipDiv = exports.TitleAndValueContainer = exports.Title = exports.LabelText = exports.LabelBoldText = exports.ControlsContainer = exports.Controls = 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;
|
|
11
|
+
const ControlsContainer = exports.ControlsContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n font-family: \"Poppins\", sans-serif;\n color: #212121;\n width: ", ";\n height: ", ";\n min-width: 250px;\n"])), props => props.width, props => props.height);
|
|
12
|
+
const Controls = exports.Controls = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n height: 100%;\n width: 100%;\n background: #ffffff;\n"])));
|
|
13
|
+
const TooltipDiv = exports.TooltipDiv = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: 5px;\n padding: 8px 12px;\n background: white;\n box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);\n margin: 0;\n"])));
|
|
14
|
+
const TooltipLabel = exports.TooltipLabel = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n color: #212121;\n font-size: 14px;\n font-weight: 400;\n line-height: normal;\n width: fit-content;\n"])));
|
|
15
|
+
const TooltipTitle = exports.TooltipTitle = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n color: #212121;\n font-size: 14px;\n font-weight: 600;\n line-height: normal;\n"])));
|
|
16
|
+
const TitleAndValueContainer = exports.TitleAndValueContainer = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n padding: 0 1rem;\n"])));
|
|
17
|
+
const Title = exports.Title = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n font-family: \"Poppins\", sans-serif;\n font-weight: 500;\n font-size: 18px;\n line-height: 20px;\n @media (max-width: 1536px) {\n font-size: 16px;\n }\n @media (max-width: 1366px) {\n font-size: 14px;\n }\n\n"])));
|
|
18
|
+
const LabelBoldText = exports.LabelBoldText = _styledComponents.default.tspan(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 16px;\n @media (max-width: 1536px) {\n font-size: 12px;\n }\n"])));
|
|
19
|
+
const LabelText = exports.LabelText = _styledComponents.default.tspan(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 16px;\n @media (max-width: 1536px) {\n font-size: 10px;\n }\n @media (max-width: 1366px) {\n font-size: 8px;\n }\n"])));
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _Modal = _interopRequireDefault(require("./Modal"));
|
|
12
|
+
var _CodeEditor = _interopRequireDefault(require("./CodeEditor"));
|
|
13
|
+
var _TextField = _interopRequireDefault(require("./TextField"));
|
|
14
|
+
var _Dropdown = _interopRequireDefault(require("./Dropdown"));
|
|
15
|
+
var _reactHookForm = require("react-hook-form");
|
|
16
|
+
var _Modal2 = require("./Modal.style");
|
|
17
|
+
var TotalCostModal = function TotalCostModal(_ref) {
|
|
18
|
+
var title = _ref.title,
|
|
19
|
+
isModalOpen = _ref.isModalOpen,
|
|
20
|
+
setModalOpen = _ref.setModalOpen,
|
|
21
|
+
setResult = _ref.setResult;
|
|
22
|
+
var _useState = (0, _react.useState)([{
|
|
23
|
+
id: "title",
|
|
24
|
+
label: "Title",
|
|
25
|
+
type: "text"
|
|
26
|
+
}, {
|
|
27
|
+
id: "dotCut",
|
|
28
|
+
label: "Do Cut",
|
|
29
|
+
type: "select",
|
|
30
|
+
options: ["true", "false"]
|
|
31
|
+
}, {
|
|
32
|
+
id: "currency",
|
|
33
|
+
label: "Currency",
|
|
34
|
+
type: "select",
|
|
35
|
+
options: ["true", "false"]
|
|
36
|
+
}, {
|
|
37
|
+
id: "currencyType",
|
|
38
|
+
label: "Currency Type",
|
|
39
|
+
type: "select",
|
|
40
|
+
options: ["USD", "EUR", "ILS", "GBP", "JPY"]
|
|
41
|
+
}, {
|
|
42
|
+
id: "width",
|
|
43
|
+
label: "Width",
|
|
44
|
+
type: "text"
|
|
45
|
+
}, {
|
|
46
|
+
id: "height",
|
|
47
|
+
label: "Height",
|
|
48
|
+
type: "text"
|
|
49
|
+
}, {
|
|
50
|
+
id: "textColor",
|
|
51
|
+
label: "Text Color",
|
|
52
|
+
type: "text"
|
|
53
|
+
}, {
|
|
54
|
+
id: "noDataText",
|
|
55
|
+
label: "No Data Text",
|
|
56
|
+
type: "text"
|
|
57
|
+
}]),
|
|
58
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
59
|
+
params = _useState2[0],
|
|
60
|
+
setParams = _useState2[1];
|
|
61
|
+
var _useState3 = (0, _react.useState)("Select PACKAGE_COST,REDEMPTION_COST,(PACKAGE_COST+REDEMPTION_COST) AS TOTAL_COST,from FACT_EVENT_MEASURES A INNER JOIN DIM_EVENTS B ON A.EVENT_CODE = B.EVENT_CODE"),
|
|
62
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
63
|
+
code = _useState4[0],
|
|
64
|
+
setCode = _useState4[1];
|
|
65
|
+
var _useForm = (0, _reactHookForm.useForm)(),
|
|
66
|
+
register = _useForm.register,
|
|
67
|
+
handleSubmit = _useForm.handleSubmit,
|
|
68
|
+
watch = _useForm.watch,
|
|
69
|
+
control = _useForm.control,
|
|
70
|
+
errors = _useForm.formState.errors;
|
|
71
|
+
var onSubmit = function onSubmit(data) {
|
|
72
|
+
return setResult(data);
|
|
73
|
+
};
|
|
74
|
+
return /*#__PURE__*/_react.default.createElement("form", {
|
|
75
|
+
onSubmit: handleSubmit(onSubmit)
|
|
76
|
+
}, /*#__PURE__*/_react.default.createElement(_Modal.default, {
|
|
77
|
+
isOpen: isModalOpen,
|
|
78
|
+
onClose: function onClose() {
|
|
79
|
+
return setModalOpen(false);
|
|
80
|
+
}
|
|
81
|
+
}, /*#__PURE__*/_react.default.createElement("h2", null, title), /*#__PURE__*/_react.default.createElement("div", {
|
|
82
|
+
style: {
|
|
83
|
+
gap: "10px",
|
|
84
|
+
display: "grid"
|
|
85
|
+
}
|
|
86
|
+
}, /*#__PURE__*/_react.default.createElement(_CodeEditor.default, {
|
|
87
|
+
value: code,
|
|
88
|
+
onChange: setCode
|
|
89
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
90
|
+
style: {
|
|
91
|
+
gap: "10px",
|
|
92
|
+
display: "grid",
|
|
93
|
+
gridTemplateColumns: "auto auto auto"
|
|
94
|
+
}
|
|
95
|
+
}, params.map(function (item) {
|
|
96
|
+
if (item.type === "text") {
|
|
97
|
+
return /*#__PURE__*/_react.default.createElement(_reactHookForm.Controller, {
|
|
98
|
+
control: control,
|
|
99
|
+
name: item.id,
|
|
100
|
+
render: function render(_ref2) {
|
|
101
|
+
var field = _ref2.field;
|
|
102
|
+
return /*#__PURE__*/_react.default.createElement(_TextField.default, Object.assign({}, field, {
|
|
103
|
+
allowedInput: "all",
|
|
104
|
+
height: "100%",
|
|
105
|
+
label: item.label,
|
|
106
|
+
multiline: true,
|
|
107
|
+
placeHolder: "Type...",
|
|
108
|
+
shape: "round",
|
|
109
|
+
size: "small",
|
|
110
|
+
width: "300px"
|
|
111
|
+
}));
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
} else {
|
|
115
|
+
return /*#__PURE__*/_react.default.createElement(_reactHookForm.Controller, {
|
|
116
|
+
control: control,
|
|
117
|
+
name: item.id,
|
|
118
|
+
render: function render(_ref3) {
|
|
119
|
+
var field = _ref3.field;
|
|
120
|
+
return /*#__PURE__*/_react.default.createElement(_Dropdown.default, Object.assign({}, field, {
|
|
121
|
+
allowedInput: "all",
|
|
122
|
+
labelColor: "#1B30AA",
|
|
123
|
+
limitTagsOnMultiSelect: 0,
|
|
124
|
+
onInputChange: function onInputChange(e) {
|
|
125
|
+
var _e$inputValue;
|
|
126
|
+
console.log("e", e);
|
|
127
|
+
field.onChange((_e$inputValue = e === null || e === void 0 ? void 0 : e.inputValue) !== null && _e$inputValue !== void 0 ? _e$inputValue : "");
|
|
128
|
+
},
|
|
129
|
+
options: item.options,
|
|
130
|
+
placeHolder: "Type...",
|
|
131
|
+
shape: "round",
|
|
132
|
+
size: "small",
|
|
133
|
+
text: item.label,
|
|
134
|
+
width: "300px"
|
|
135
|
+
}));
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}))), /*#__PURE__*/_react.default.createElement(_Modal2.SubmitButton, {
|
|
140
|
+
type: "submit"
|
|
141
|
+
})));
|
|
142
|
+
};
|
|
143
|
+
var _default = exports.default = TotalCostModal;
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.TwoBarCharts = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _recharts = require("recharts");
|
|
11
|
+
var _CommonFunctions = require("./CommonFunctions");
|
|
12
|
+
var _TwoBarCharts = require("./TwoBarCharts.style");
|
|
13
|
+
var _PerformanceAnalyticsLegend = _interopRequireDefault(require("./PerformanceAnalyticsLegend"));
|
|
14
|
+
/* eslint-disable react/prop-types */
|
|
15
|
+
/* eslint-disable no-shadow */
|
|
16
|
+
/* eslint-disable react/no-unstable-nested-components */
|
|
17
|
+
/* eslint-disable no-nested-ternary */
|
|
18
|
+
|
|
19
|
+
const ICON_TYPE_SQUARE = 'Square';
|
|
20
|
+
/* BarChartsByWeeks */
|
|
21
|
+
const TwoBarCharts = props => {
|
|
22
|
+
const {
|
|
23
|
+
className,
|
|
24
|
+
title,
|
|
25
|
+
barChartData,
|
|
26
|
+
barSize,
|
|
27
|
+
isDollar,
|
|
28
|
+
width,
|
|
29
|
+
height,
|
|
30
|
+
barChartColor,
|
|
31
|
+
showLegend,
|
|
32
|
+
legendData
|
|
33
|
+
} = props;
|
|
34
|
+
|
|
35
|
+
// const [BarChartContainerWidth, setBarChartContainerWidth] = useState(0);
|
|
36
|
+
// const [BarChartContainerHeight, setBarChartContainerHeight] = useState(0);
|
|
37
|
+
|
|
38
|
+
const controlsContainerRef = (0, _react.useRef)();
|
|
39
|
+
|
|
40
|
+
// useEffect(() => {
|
|
41
|
+
// const { offsetWidth } = controlsContainerRef.current;
|
|
42
|
+
// setBarChartContainerWidth(offsetWidth - 20);
|
|
43
|
+
// }, [width]);
|
|
44
|
+
|
|
45
|
+
// useEffect(() => {
|
|
46
|
+
// const { offsetHeight } = controlsContainerRef.current;
|
|
47
|
+
// setBarChartContainerHeight(offsetHeight - 40);
|
|
48
|
+
// }, [height]);
|
|
49
|
+
|
|
50
|
+
const displayFormattedValue = value => {
|
|
51
|
+
if (!value) return '';
|
|
52
|
+
let formattedValue = '';
|
|
53
|
+
formattedValue = !isDollar ? ''.concat('X', value.toFixed(1)) : ''.concat('$', (0, _CommonFunctions.getFormattedValue)(value), (0, _CommonFunctions.getFormattedUnits)(value));
|
|
54
|
+
return formattedValue;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// eslint-disable-next-line react/no-unstable-nested-components
|
|
58
|
+
const CustomTooltip = tooltipData => {
|
|
59
|
+
var _payload$0$payload, _payload$0$payload2;
|
|
60
|
+
const {
|
|
61
|
+
active,
|
|
62
|
+
payload,
|
|
63
|
+
label
|
|
64
|
+
} = tooltipData;
|
|
65
|
+
if (!active || !payload || (payload === null || payload === void 0 ? void 0 : payload.length) === 0) return null;
|
|
66
|
+
let currentTooltipValue = 0;
|
|
67
|
+
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;
|
|
68
|
+
return /*#__PURE__*/_react.default.createElement(_TwoBarCharts.TooltipDiv, null, /*#__PURE__*/_react.default.createElement(_TwoBarCharts.TooltipTitle, null, "".concat(label)), /*#__PURE__*/_react.default.createElement(_TwoBarCharts.TooltipLabel, null, "".concat(displayFormattedValue(currentTooltipValue))));
|
|
69
|
+
};
|
|
70
|
+
const CustomizedTickBarChart = props => {
|
|
71
|
+
const {
|
|
72
|
+
x,
|
|
73
|
+
y,
|
|
74
|
+
stroke,
|
|
75
|
+
payload
|
|
76
|
+
} = props;
|
|
77
|
+
if (barChartData && barChartData.length > 0 && payload) {
|
|
78
|
+
const retailerData = barChartData.filter(item => item.title === payload.value);
|
|
79
|
+
if (retailerData && retailerData.length > 0) {
|
|
80
|
+
const {
|
|
81
|
+
offerType
|
|
82
|
+
} = retailerData[0];
|
|
83
|
+
return /*#__PURE__*/_react.default.createElement("g", {
|
|
84
|
+
transform: "translate(".concat(x, ",").concat(y, ")")
|
|
85
|
+
// onMouseEnter={() => handleMouseEnter(offerType)}
|
|
86
|
+
// onMouseLeave={handleMouseLeave}
|
|
87
|
+
}, /*#__PURE__*/_react.default.createElement("text", {
|
|
88
|
+
x: 0,
|
|
89
|
+
y: 0,
|
|
90
|
+
dy: 16,
|
|
91
|
+
fill: "#212121"
|
|
92
|
+
}, /*#__PURE__*/_react.default.createElement(_TwoBarCharts.LabelBoldText, {
|
|
93
|
+
textAnchor: "middle",
|
|
94
|
+
x: "0",
|
|
95
|
+
dy: "50",
|
|
96
|
+
fontSize: 16,
|
|
97
|
+
fontWeight: 600
|
|
98
|
+
}, payload.value), /*#__PURE__*/_react.default.createElement(_TwoBarCharts.LabelText, {
|
|
99
|
+
textAnchor: "middle",
|
|
100
|
+
x: "0",
|
|
101
|
+
dy: "30",
|
|
102
|
+
fontSize: 14,
|
|
103
|
+
fontWeight: 400
|
|
104
|
+
}, retailerData[0].date)));
|
|
105
|
+
}
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
return null;
|
|
109
|
+
};
|
|
110
|
+
const CustomizedLabel = props => {
|
|
111
|
+
const {
|
|
112
|
+
x,
|
|
113
|
+
y,
|
|
114
|
+
stroke,
|
|
115
|
+
value
|
|
116
|
+
} = props;
|
|
117
|
+
return /*#__PURE__*/_react.default.createElement("text", {
|
|
118
|
+
x: x,
|
|
119
|
+
y: y,
|
|
120
|
+
dy: -8,
|
|
121
|
+
fill: stroke,
|
|
122
|
+
fontSize: 14
|
|
123
|
+
}, displayFormattedValue(value));
|
|
124
|
+
};
|
|
125
|
+
return /*#__PURE__*/_react.default.createElement(_TwoBarCharts.ControlsContainer, {
|
|
126
|
+
className: className,
|
|
127
|
+
id: "ControlsContainer",
|
|
128
|
+
height: height,
|
|
129
|
+
width: width,
|
|
130
|
+
ref: controlsContainerRef
|
|
131
|
+
}, /*#__PURE__*/_react.default.createElement(_TwoBarCharts.Controls, {
|
|
132
|
+
id: "Controls"
|
|
133
|
+
}, /*#__PURE__*/_react.default.createElement(_TwoBarCharts.TitleAndValueContainer, {
|
|
134
|
+
id: "TitleAndValueContainer"
|
|
135
|
+
}, /*#__PURE__*/_react.default.createElement(_TwoBarCharts.Title, {
|
|
136
|
+
id: "Title"
|
|
137
|
+
}, title)), /*#__PURE__*/_react.default.createElement(_recharts.ResponsiveContainer, {
|
|
138
|
+
id: "ResponsiveContainer",
|
|
139
|
+
width: "100%",
|
|
140
|
+
height: showLegend ? '80%' : '86%'
|
|
141
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.BarChart, {
|
|
142
|
+
width: width,
|
|
143
|
+
height: height,
|
|
144
|
+
data: barChartData,
|
|
145
|
+
margin: {
|
|
146
|
+
top: 20,
|
|
147
|
+
right: 0,
|
|
148
|
+
bottom: -25,
|
|
149
|
+
left: -5
|
|
150
|
+
}
|
|
151
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.XAxis, {
|
|
152
|
+
dataKey: "title",
|
|
153
|
+
tick: CustomizedTickBarChart,
|
|
154
|
+
tickLine: false,
|
|
155
|
+
height: 120,
|
|
156
|
+
stroke: "#D0D0D0"
|
|
157
|
+
}), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, {
|
|
158
|
+
content: /*#__PURE__*/_react.default.createElement(CustomTooltip, null)
|
|
159
|
+
}), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, null), /*#__PURE__*/_react.default.createElement(_recharts.Bar, {
|
|
160
|
+
dataKey: "value",
|
|
161
|
+
fill: barChartColor,
|
|
162
|
+
minPointSize: 5,
|
|
163
|
+
barSize: barSize !== null && barSize !== void 0 ? barSize : 60,
|
|
164
|
+
radius: [5, 5, 0, 0]
|
|
165
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.LabelList, {
|
|
166
|
+
dataKey: "value",
|
|
167
|
+
content: CustomizedLabel
|
|
168
|
+
})), /*#__PURE__*/_react.default.createElement(_recharts.Bar, {
|
|
169
|
+
dataKey: "value",
|
|
170
|
+
fill: barChartColor,
|
|
171
|
+
minPointSize: 10,
|
|
172
|
+
radius: [5, 5, 0, 0]
|
|
173
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.LabelList, {
|
|
174
|
+
dataKey: "value",
|
|
175
|
+
content: CustomizedLabel
|
|
176
|
+
})))), showLegend && /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsLegend.default, {
|
|
177
|
+
legendData: legendData
|
|
178
|
+
})));
|
|
179
|
+
};
|
|
180
|
+
exports.TwoBarCharts = TwoBarCharts;
|
|
181
|
+
var _default = exports.default = TwoBarCharts;
|
|
182
|
+
TwoBarCharts.defaultProps = {
|
|
183
|
+
title: 'String',
|
|
184
|
+
barChartData: [{
|
|
185
|
+
title: 'Food Lion',
|
|
186
|
+
date: '15.01.24-31.01.24',
|
|
187
|
+
value: 542366
|
|
188
|
+
}, {
|
|
189
|
+
title: 'Hannaford',
|
|
190
|
+
date: '15.01.24-31.01.24',
|
|
191
|
+
value: 699511
|
|
192
|
+
}, {
|
|
193
|
+
title: 'The Giant Company',
|
|
194
|
+
date: '15.01.24-31.01.24',
|
|
195
|
+
value: 403092
|
|
196
|
+
}, {
|
|
197
|
+
title: 'Giant Food',
|
|
198
|
+
date: '15.01.24-31.01.24',
|
|
199
|
+
value: 396184
|
|
200
|
+
}, {
|
|
201
|
+
title: 'Stop&Shop',
|
|
202
|
+
date: '15.01.24-31.01.24',
|
|
203
|
+
value: 415317
|
|
204
|
+
}],
|
|
205
|
+
width: '100%',
|
|
206
|
+
height: '100%',
|
|
207
|
+
barSize: 60,
|
|
208
|
+
barChartColor: '#BD9EFF',
|
|
209
|
+
isDollar: true,
|
|
210
|
+
showLegend: true,
|
|
211
|
+
legendData: [{
|
|
212
|
+
title: 'Incremental Sales',
|
|
213
|
+
iconType: ICON_TYPE_SQUARE,
|
|
214
|
+
iconColor: '#BD9EFF'
|
|
215
|
+
}]
|
|
216
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.TooltipTitle = exports.TooltipLabel = exports.TooltipDiv = exports.TitleAndValueContainer = exports.Title = exports.LabelText = exports.LabelBoldText = exports.ControlsContainer = exports.Controls = 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;
|
|
11
|
+
const ControlsContainer = exports.ControlsContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n font-family: \"Poppins\", sans-serif;\n color: #212121;\n width: ", ";\n height: ", ";\n min-width: 250px;\n"])), props => props.width, props => props.height);
|
|
12
|
+
const Controls = exports.Controls = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n height: 100%;\n width: 100%;\n background: #ffffff;\n"])));
|
|
13
|
+
const TooltipDiv = exports.TooltipDiv = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: 5px;\n padding: 8px 12px;\n background: white;\n box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);\n margin: 0;\n"])));
|
|
14
|
+
const TooltipLabel = exports.TooltipLabel = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n color: #212121;\n font-size: 14px;\n font-weight: 400;\n line-height: normal;\n width: fit-content;\n"])));
|
|
15
|
+
const TooltipTitle = exports.TooltipTitle = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n color: #212121;\n font-size: 14px;\n font-weight: 600;\n line-height: normal;\n"])));
|
|
16
|
+
const TitleAndValueContainer = exports.TitleAndValueContainer = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n padding: 0 1rem;\n"])));
|
|
17
|
+
const Title = exports.Title = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n font-family: \"Poppins\", sans-serif;\n font-weight: 500;\n font-size: 18px;\n line-height: 20px;\n @media (max-width: 1536px) {\n font-size: 16px;\n }\n @media (max-width: 1366px) {\n font-size: 14px;\n }\n\n"])));
|
|
18
|
+
const LabelBoldText = exports.LabelBoldText = _styledComponents.default.tspan(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 16px;\n @media (max-width: 1536px) {\n font-size: 12px;\n }\n"])));
|
|
19
|
+
const LabelText = exports.LabelText = _styledComponents.default.tspan(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 16px;\n @media (max-width: 1536px) {\n font-size: 10px;\n }\n @media (max-width: 1366px) {\n font-size: 8px;\n }\n"])));
|
package/package.json
CHANGED
|
@@ -1,284 +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.ExamplePopupContent = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _PopupContent = _interopRequireDefault(require("../components/CampaignTool/PopupContent"));
|
|
10
|
-
const FieldsDataRow1 = [{
|
|
11
|
-
name: "FundationSource",
|
|
12
|
-
label: "Fundation Source",
|
|
13
|
-
disabled: false,
|
|
14
|
-
required: false,
|
|
15
|
-
inputType: "dropdown",
|
|
16
|
-
//aviliable values: textbox | dropdown | checkBox | datepicker
|
|
17
|
-
showInfo: true,
|
|
18
|
-
infoText: "This is one of the Popup content's fields",
|
|
19
|
-
placeHolder: "Select Source",
|
|
20
|
-
dropdownOptions: [{
|
|
21
|
-
value: 1,
|
|
22
|
-
label: "Source 1"
|
|
23
|
-
}, {
|
|
24
|
-
value: 2,
|
|
25
|
-
label: "Source 2"
|
|
26
|
-
}, {
|
|
27
|
-
value: 3,
|
|
28
|
-
label: "Source 3"
|
|
29
|
-
}],
|
|
30
|
-
dropdownDefaultValue: null
|
|
31
|
-
}, {
|
|
32
|
-
name: "Category",
|
|
33
|
-
label: "Category",
|
|
34
|
-
disabled: false,
|
|
35
|
-
required: false,
|
|
36
|
-
inputType: "dropdown",
|
|
37
|
-
//aviliable values: textbox | dropdown | checkBox | datepicker
|
|
38
|
-
showInfo: true,
|
|
39
|
-
infoText: "This is one of the Popup content's fields",
|
|
40
|
-
placeHolder: "Select Category",
|
|
41
|
-
dropdownOptions: [{
|
|
42
|
-
value: 1,
|
|
43
|
-
label: "Category 1"
|
|
44
|
-
}, {
|
|
45
|
-
value: 2,
|
|
46
|
-
label: "Category 2"
|
|
47
|
-
}, {
|
|
48
|
-
value: 3,
|
|
49
|
-
label: "Category 3"
|
|
50
|
-
}],
|
|
51
|
-
dropdownDefaultValue: null
|
|
52
|
-
}, {
|
|
53
|
-
name: "Supplier",
|
|
54
|
-
label: "Supplier",
|
|
55
|
-
disabled: false,
|
|
56
|
-
required: false,
|
|
57
|
-
inputType: "dropdown",
|
|
58
|
-
//aviliable values: textbox | dropdown | checkBox | datepicker
|
|
59
|
-
showInfo: true,
|
|
60
|
-
infoText: "This is one of the Popup content's fields",
|
|
61
|
-
placeHolder: "Select Supplier",
|
|
62
|
-
dropdownOptions: [{
|
|
63
|
-
value: 1,
|
|
64
|
-
label: "Supplier 1"
|
|
65
|
-
}, {
|
|
66
|
-
value: 2,
|
|
67
|
-
label: "Supplier 2"
|
|
68
|
-
}, {
|
|
69
|
-
value: 3,
|
|
70
|
-
label: "Supplier 3"
|
|
71
|
-
}],
|
|
72
|
-
dropdownDefaultValue: null
|
|
73
|
-
}, {
|
|
74
|
-
name: "ContactName",
|
|
75
|
-
label: "Contact Name",
|
|
76
|
-
disabled: false,
|
|
77
|
-
required: false,
|
|
78
|
-
inputType: "textbox",
|
|
79
|
-
//aviliable values: textbox | dropdown | checkBox | datepicker
|
|
80
|
-
showInfo: true,
|
|
81
|
-
infoText: "This is one of the Popup content's fields",
|
|
82
|
-
placeHolder: "Enter Contact Name",
|
|
83
|
-
dropdownOptions: null,
|
|
84
|
-
dropdownDefaultValue: null
|
|
85
|
-
}];
|
|
86
|
-
const FieldsDataRow2 = [{
|
|
87
|
-
name: "BrandName",
|
|
88
|
-
label: "Brand Name",
|
|
89
|
-
disabled: false,
|
|
90
|
-
required: false,
|
|
91
|
-
inputType: "dropdown",
|
|
92
|
-
//aviliable values: textbox | dropdown | checkBox | datepicker
|
|
93
|
-
showInfo: true,
|
|
94
|
-
infoText: "This is one of the Popup content's fields",
|
|
95
|
-
placeHolder: "Select Brand",
|
|
96
|
-
dropdownOptions: [{
|
|
97
|
-
value: 1,
|
|
98
|
-
label: "Brand 1"
|
|
99
|
-
}, {
|
|
100
|
-
value: 2,
|
|
101
|
-
label: "Brand 2"
|
|
102
|
-
}, {
|
|
103
|
-
value: 3,
|
|
104
|
-
label: "Brand 3"
|
|
105
|
-
}],
|
|
106
|
-
dropdownDefaultValue: null
|
|
107
|
-
}, {
|
|
108
|
-
name: "Budget",
|
|
109
|
-
label: "Budget",
|
|
110
|
-
disabled: false,
|
|
111
|
-
required: false,
|
|
112
|
-
inputType: "dropdown",
|
|
113
|
-
//aviliable values: textbox | dropdown | checkBox | datepicker
|
|
114
|
-
showInfo: true,
|
|
115
|
-
infoText: "This is one of the Popup content's fields",
|
|
116
|
-
placeHolder: "Select Budget",
|
|
117
|
-
dropdownOptions: [{
|
|
118
|
-
value: 1,
|
|
119
|
-
label: "Budget 1"
|
|
120
|
-
}, {
|
|
121
|
-
value: 2,
|
|
122
|
-
label: "Budget 2"
|
|
123
|
-
}, {
|
|
124
|
-
value: 3,
|
|
125
|
-
label: "Budget 3"
|
|
126
|
-
}],
|
|
127
|
-
dropdownDefaultValue: {
|
|
128
|
-
value: 1,
|
|
129
|
-
label: "Budget 1"
|
|
130
|
-
}
|
|
131
|
-
}, {
|
|
132
|
-
name: "CategoryManager",
|
|
133
|
-
label: "Category Manager",
|
|
134
|
-
disabled: false,
|
|
135
|
-
required: false,
|
|
136
|
-
inputType: "dropdown",
|
|
137
|
-
//aviliable values: textbox | dropdown | checkBox | datepicker
|
|
138
|
-
showInfo: true,
|
|
139
|
-
infoText: "This is one of the Popup content's fields",
|
|
140
|
-
placeHolder: "Select Category Manager",
|
|
141
|
-
dropdownOptions: [{
|
|
142
|
-
value: 1,
|
|
143
|
-
label: "Category Manager 1"
|
|
144
|
-
}, {
|
|
145
|
-
value: 2,
|
|
146
|
-
label: "Category Manager 2"
|
|
147
|
-
}, {
|
|
148
|
-
value: 3,
|
|
149
|
-
label: "Category Manager 3"
|
|
150
|
-
}],
|
|
151
|
-
dropdownDefaultValue: {
|
|
152
|
-
value: 3,
|
|
153
|
-
label: "Category Manager 3"
|
|
154
|
-
}
|
|
155
|
-
}, {
|
|
156
|
-
name: "ContactEmail",
|
|
157
|
-
label: "Contact Email",
|
|
158
|
-
disabled: false,
|
|
159
|
-
required: false,
|
|
160
|
-
inputType: "textbox",
|
|
161
|
-
//aviliable values: textbox | dropdown | checkBox | datepicker
|
|
162
|
-
showInfo: true,
|
|
163
|
-
infoText: "This is one of the Popup content's fields",
|
|
164
|
-
placeHolder: "Enter Contact Email",
|
|
165
|
-
dropdownOptions: null,
|
|
166
|
-
dropdownDefaultValue: null
|
|
167
|
-
}];
|
|
168
|
-
const FieldsDataRow3 = [{
|
|
169
|
-
name: "Broker",
|
|
170
|
-
label: "Broker",
|
|
171
|
-
disabled: false,
|
|
172
|
-
required: false,
|
|
173
|
-
inputType: "dropdown",
|
|
174
|
-
//aviliable values: textbox | dropdown | checkBox | datepicker
|
|
175
|
-
showInfo: true,
|
|
176
|
-
infoText: "This is one of the Popup content's fields",
|
|
177
|
-
placeHolder: "Select Broker",
|
|
178
|
-
dropdownOptions: [{
|
|
179
|
-
value: 1,
|
|
180
|
-
label: "Broker 1"
|
|
181
|
-
}, {
|
|
182
|
-
value: 2,
|
|
183
|
-
label: "Broker 2"
|
|
184
|
-
}, {
|
|
185
|
-
value: 3,
|
|
186
|
-
label: "Broker 3"
|
|
187
|
-
}],
|
|
188
|
-
dropdownDefaultValue: null
|
|
189
|
-
}, {
|
|
190
|
-
name: "SupplierOfferID",
|
|
191
|
-
label: "Supplier Offer ID",
|
|
192
|
-
disabled: false,
|
|
193
|
-
required: false,
|
|
194
|
-
inputType: "textbox",
|
|
195
|
-
//aviliable values: textbox | dropdown | checkBox | datepicker
|
|
196
|
-
showInfo: true,
|
|
197
|
-
infoText: "This is one of the Popup content's fields",
|
|
198
|
-
placeHolder: "Enter Supplier Offer ID",
|
|
199
|
-
dropdownOptions: null,
|
|
200
|
-
dropdownDefaultValue: null
|
|
201
|
-
}, {
|
|
202
|
-
name: "VendorID",
|
|
203
|
-
label: "Vendor ID",
|
|
204
|
-
disabled: false,
|
|
205
|
-
required: false,
|
|
206
|
-
inputType: "textbox",
|
|
207
|
-
//aviliable values: textbox | dropdown | checkBox | datepicker
|
|
208
|
-
showInfo: true,
|
|
209
|
-
infoText: "This is one of the Popup content's fields",
|
|
210
|
-
placeHolder: "Enter Vendor ID",
|
|
211
|
-
dropdownOptions: null,
|
|
212
|
-
dropdownDefaultValue: null
|
|
213
|
-
}, {
|
|
214
|
-
name: "ContactPhone",
|
|
215
|
-
label: "Contact Phone",
|
|
216
|
-
disabled: false,
|
|
217
|
-
required: true,
|
|
218
|
-
inputType: "textbox",
|
|
219
|
-
//aviliable values: textbox | dropdown | checkBox | datepicker
|
|
220
|
-
showInfo: true,
|
|
221
|
-
infoText: "This is one of the Popup content's fields",
|
|
222
|
-
placeHolder: "Enter Contact Phone",
|
|
223
|
-
dropdownOptions: null,
|
|
224
|
-
dropdownDefaultValue: null
|
|
225
|
-
}];
|
|
226
|
-
const RowsData1 = [{
|
|
227
|
-
fieldsArray: FieldsDataRow1
|
|
228
|
-
}, {
|
|
229
|
-
fieldsArray: FieldsDataRow2
|
|
230
|
-
}, {
|
|
231
|
-
fieldsArray: FieldsDataRow3
|
|
232
|
-
}];
|
|
233
|
-
var _default = exports.default = {
|
|
234
|
-
title: "Campaign Tool/PopupContent",
|
|
235
|
-
component: _PopupContent.default,
|
|
236
|
-
tags: ["autodocs"],
|
|
237
|
-
argTypes: {
|
|
238
|
-
FieldsData: {
|
|
239
|
-
name: "FieldsData",
|
|
240
|
-
control: {
|
|
241
|
-
type: "object"
|
|
242
|
-
},
|
|
243
|
-
description: " object: to fill kpi columns and buttons "
|
|
244
|
-
},
|
|
245
|
-
width: {
|
|
246
|
-
name: "width",
|
|
247
|
-
control: {
|
|
248
|
-
type: "text"
|
|
249
|
-
},
|
|
250
|
-
description: "width of the control (in px / %)"
|
|
251
|
-
},
|
|
252
|
-
height: {
|
|
253
|
-
name: "height",
|
|
254
|
-
control: {
|
|
255
|
-
type: "text"
|
|
256
|
-
},
|
|
257
|
-
description: "height of the control (in px / % )"
|
|
258
|
-
},
|
|
259
|
-
onClick: {
|
|
260
|
-
action: "onClick",
|
|
261
|
-
description: "onClick event - returns an object of check box {true/false} "
|
|
262
|
-
},
|
|
263
|
-
onChange: {
|
|
264
|
-
action: "onChange",
|
|
265
|
-
description: "onChange event "
|
|
266
|
-
},
|
|
267
|
-
borderColor: {
|
|
268
|
-
name: "borderColor",
|
|
269
|
-
description: "Sets the border color",
|
|
270
|
-
control: {
|
|
271
|
-
type: "color",
|
|
272
|
-
presetColors: ["#ffffff", "#ff0000", "#00ff00", "#0000ff"]
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
const Template = args => /*#__PURE__*/_react.default.createElement(_PopupContent.default, args);
|
|
278
|
-
const ExamplePopupContent = exports.ExamplePopupContent = Template.bind({});
|
|
279
|
-
ExamplePopupContent.args = {
|
|
280
|
-
rowsData: RowsData1,
|
|
281
|
-
borderColor: "#066768",
|
|
282
|
-
width: "100%",
|
|
283
|
-
height: "100%"
|
|
284
|
-
};
|
|
@@ -1,64 +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 = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _BannerEventBoxList = require("./BannerEventBoxList.style");
|
|
10
|
-
var _BannerEventBox = _interopRequireDefault(require("./BannerEventBox"));
|
|
11
|
-
const BannerEventBoxList = props => {
|
|
12
|
-
const {
|
|
13
|
-
width,
|
|
14
|
-
height,
|
|
15
|
-
data
|
|
16
|
-
} = props;
|
|
17
|
-
return /*#__PURE__*/_react.default.createElement(_BannerEventBoxList.MainContainer, {
|
|
18
|
-
width: width,
|
|
19
|
-
height: height
|
|
20
|
-
}, data.map(item => /*#__PURE__*/_react.default.createElement(_BannerEventBox.default, {
|
|
21
|
-
height: "100%",
|
|
22
|
-
width: "100%",
|
|
23
|
-
banner: item.banner,
|
|
24
|
-
description: item.description,
|
|
25
|
-
dates: item.dates,
|
|
26
|
-
data: item.data
|
|
27
|
-
})));
|
|
28
|
-
};
|
|
29
|
-
BannerEventBoxList.defaultProps = {
|
|
30
|
-
width: 'auto',
|
|
31
|
-
height: 'auto',
|
|
32
|
-
data: [{
|
|
33
|
-
banner: 'Stop&Shop',
|
|
34
|
-
description: 'description',
|
|
35
|
-
dates: ['01/01/2024', '14/01/2024'],
|
|
36
|
-
data: [{
|
|
37
|
-
name: 'Product Line',
|
|
38
|
-
items: ['cola', 'spring']
|
|
39
|
-
}, {
|
|
40
|
-
name: 'Supplier',
|
|
41
|
-
items: ['coca', 'cola', 'spring']
|
|
42
|
-
}, {
|
|
43
|
-
name: 'Brands',
|
|
44
|
-
items: ['coca', 'mentos', 'spring', 'cola']
|
|
45
|
-
}]
|
|
46
|
-
}, {
|
|
47
|
-
banner: 'Hannaford',
|
|
48
|
-
description: 'description',
|
|
49
|
-
dates: ['01/01/2024', '14/01/2024'],
|
|
50
|
-
data: [{
|
|
51
|
-
name: 'Supplier',
|
|
52
|
-
items: ['coca', 'cola', 'spring']
|
|
53
|
-
}]
|
|
54
|
-
}, {
|
|
55
|
-
banner: 'Giant Food',
|
|
56
|
-
description: 'description',
|
|
57
|
-
dates: ['01/01/2024', '14/01/2024'],
|
|
58
|
-
data: [{
|
|
59
|
-
name: 'Brands',
|
|
60
|
-
items: ['coca', 'mentos', 'spring', 'cola']
|
|
61
|
-
}]
|
|
62
|
-
}]
|
|
63
|
-
};
|
|
64
|
-
var _default = exports.default = BannerEventBoxList;
|
|
@@ -1,11 +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.MainContainer = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
-
var _templateObject;
|
|
11
|
-
const MainContainer = exports.MainContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: ", ";\n height: ", ";\n display: flex;\n gap: 20px;\n"])), props => props.width, props => props.height);
|
|
@@ -1,53 +0,0 @@
|
|
|
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 = exports.FilterButton = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _FilterButton = require("./FilterButton.style");
|
|
10
|
-
var _FilterIcon = require("./icons/FilterIcon");
|
|
11
|
-
const FilterButton = props => {
|
|
12
|
-
const {
|
|
13
|
-
color,
|
|
14
|
-
activeColor,
|
|
15
|
-
height,
|
|
16
|
-
buttonText,
|
|
17
|
-
iconWidth,
|
|
18
|
-
iconHeight,
|
|
19
|
-
disabled,
|
|
20
|
-
openState,
|
|
21
|
-
onButtonClick
|
|
22
|
-
} = props;
|
|
23
|
-
const [activeState, setActiveState] = (0, _react.useState)(openState);
|
|
24
|
-
const onClickHandler = event => {
|
|
25
|
-
onButtonClick(event);
|
|
26
|
-
setActiveState(!activeState);
|
|
27
|
-
};
|
|
28
|
-
return /*#__PURE__*/_react.default.createElement(_FilterButton.FilterButtonWrapper, {
|
|
29
|
-
height: height,
|
|
30
|
-
color: activeState ? activeColor : color,
|
|
31
|
-
disabled: disabled,
|
|
32
|
-
onClick: event => {
|
|
33
|
-
onClickHandler(event);
|
|
34
|
-
}
|
|
35
|
-
}, /*#__PURE__*/_react.default.createElement(_FilterIcon.FilterIcon, {
|
|
36
|
-
width: iconWidth,
|
|
37
|
-
height: iconHeight,
|
|
38
|
-
color: activeState ? activeColor : color
|
|
39
|
-
}), /*#__PURE__*/_react.default.createElement(_FilterButton.SpanText, null, buttonText));
|
|
40
|
-
};
|
|
41
|
-
exports.FilterButton = FilterButton;
|
|
42
|
-
var _default = exports.default = FilterButton;
|
|
43
|
-
FilterButton.defaultProps = {
|
|
44
|
-
buttonText: 'Filter',
|
|
45
|
-
height: '40px',
|
|
46
|
-
color: '#212121',
|
|
47
|
-
activeColor: '#229E38',
|
|
48
|
-
iconHeight: 12,
|
|
49
|
-
iconWidth: 12,
|
|
50
|
-
openState: false,
|
|
51
|
-
disabled: false,
|
|
52
|
-
onButtonClick: () => {}
|
|
53
|
-
};
|
|
@@ -1,12 +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.SpanText = exports.FilterButtonWrapper = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
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 ", ";\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, props => props.color);
|
|
12
|
-
const SpanText = exports.SpanText = _styledComponents.default.span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n"])));
|