sag_components 1.0.396 → 1.0.398
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.js +1 -1
- package/dist/stories/components/Benchmark.js +23 -20
- package/dist/stories/components/Benchmark.style.js +5 -35
- package/dist/stories/components/Button.js +35 -30
- package/dist/stories/components/Button.style.js +1 -3
- package/dist/stories/components/CheckBox.js +22 -35
- package/dist/stories/components/CheckBox.style.js +4 -12
- package/dist/stories/components/CheckBoxButton.js +27 -45
- package/dist/stories/components/CheckBoxButton.style.js +4 -20
- package/dist/stories/components/CodeEditor.js +5 -3
- package/dist/stories/components/CodeEditor.style.js +1 -1
- package/dist/stories/components/CollapseData.js +34 -42
- package/dist/stories/components/CollapseData.style.js +11 -17
- package/dist/stories/components/CommonFunctions.js +13 -10
- package/dist/stories/components/Datepicker.js +22 -27
- package/dist/stories/components/Datepicker.style.js +1 -3
- package/dist/stories/components/Dropdown.js +94 -112
- package/dist/stories/components/Dropdown.style.js +1 -3
- package/dist/stories/components/DropdownMulti.js +123 -145
- package/dist/stories/components/DropdownMulti.style.js +1 -3
- package/dist/stories/components/FilterContainer.js +7 -7
- package/dist/stories/components/FilterContainer.style.js +3 -3
- package/dist/stories/components/IconButton.js +58 -27
- package/dist/stories/components/IconButton.style.js +8 -13
- package/dist/stories/components/KpiFilter.js +223 -186
- package/dist/stories/components/KpiFilter.style.js +16 -16
- package/dist/stories/components/ListBox.js +50 -67
- package/dist/stories/components/ListBox.style.js +4 -12
- package/dist/stories/components/Modal.js +6 -4
- package/dist/stories/components/Modal.style.js +5 -5
- package/dist/stories/components/ModalTotalBenchmark.js +48 -46
- package/dist/stories/components/ModalTotalCost.js +66 -68
- package/dist/stories/components/NoDataFoundMessage.js +5 -2
- package/dist/stories/components/NoDataFoundMessage.style.js +3 -3
- package/dist/stories/components/OneColumnContainer.js +30 -38
- package/dist/stories/components/OneColumnContainer.style.js +7 -23
- package/dist/stories/components/PerformanceAnalytics.js +142 -156
- package/dist/stories/components/PerformanceAnalytics.style.js +15 -25
- package/dist/stories/components/PerformanceAnalyticsLegend.js +25 -26
- package/dist/stories/components/PerformanceAnalyticsLegend.style.js +6 -16
- package/dist/stories/components/PerformanceAnalyticsOneColumn.js +119 -123
- package/dist/stories/components/PerformanceAnalyticsOneColumn.style.js +13 -23
- package/dist/stories/components/PerformanceAnalyticsTotals.js +26 -27
- package/dist/stories/components/PerformanceAnalyticsTotals.style.js +10 -18
- package/dist/stories/components/ReportTable.js +15 -18
- package/dist/stories/components/ReportTable.style.js +8 -14
- package/dist/stories/components/SegmentedButton.js +63 -68
- package/dist/stories/components/SegmentedButton.style.js +6 -16
- package/dist/stories/components/TextField.js +37 -52
- package/dist/stories/components/TextField.style.js +1 -3
- package/dist/stories/components/TitleDescription.js +39 -42
- package/dist/stories/components/TitleDescription.style.js +26 -50
- package/dist/stories/components/Tooltip.js +6 -11
- package/dist/stories/components/Tooltip.style.js +3 -3
- package/dist/stories/components/TotalBenchmark.js +54 -58
- package/dist/stories/components/TotalBenchmark.style.js +11 -17
- package/dist/stories/components/TotalBenchmarkAreachart.js +55 -58
- package/dist/stories/components/TotalBenchmarkAreachart.style.js +14 -20
- package/dist/stories/components/TotalBenchmarkArrows.js +48 -53
- package/dist/stories/components/TotalBenchmarkArrows.style.js +14 -20
- package/dist/stories/components/TotalBenchmarkBarchart.js +45 -51
- package/dist/stories/components/TotalBenchmarkBarchart.style.js +10 -16
- package/dist/stories/components/TotalDoughnutChart.js +60 -64
- package/dist/stories/components/TotalDoughnutChart.style.js +19 -29
- package/dist/stories/components/TspanTooltip.js +6 -8
- package/dist/stories/components/TspanTooltip.style.js +3 -7
- package/dist/stories/components/icons/ArrowDownIcon.js +7 -6
- package/dist/stories/components/icons/ArrowDropDownIcon.js +7 -6
- package/dist/stories/components/icons/ArrowUpIcon.js +7 -6
- package/dist/stories/components/icons/BellIcon.js +6 -5
- package/dist/stories/components/icons/CalendarIcon.js +7 -6
- package/dist/stories/components/icons/CheckBoxButtonCheckedIcon.js +8 -8
- package/dist/stories/components/icons/CheckBoxCheckedIcon.js +8 -8
- package/dist/stories/components/icons/CheckBoxNotCheckedIcon.js +8 -8
- package/dist/stories/components/icons/ClockIcon.js +7 -6
- package/dist/stories/components/icons/ComboBoxArrowDownIcon.js +8 -8
- package/dist/stories/components/icons/ComboBoxArrowUpIcon.js +8 -8
- package/dist/stories/components/icons/DocumentIcon.js +7 -7
- package/dist/stories/components/icons/DownloadIcon.js +7 -7
- package/dist/stories/components/icons/ExitIcon.js +7 -6
- package/dist/stories/components/icons/EyeIcon.js +7 -6
- package/dist/stories/components/icons/FlyIcon.js +7 -6
- package/dist/stories/components/icons/FoodLionIcon.js +7 -6
- package/dist/stories/components/icons/GiantFoodIcon.js +7 -6
- package/dist/stories/components/icons/HannafordIcon.js +7 -6
- package/dist/stories/components/icons/InfoIcon.js +8 -8
- package/dist/stories/components/icons/LegendUnionIcon.js +7 -7
- package/dist/stories/components/icons/MaintenanceIcon.js +7 -6
- package/dist/stories/components/icons/NoDataFoundIcon.js +6 -5
- package/dist/stories/components/icons/ShoppingCartIcon.js +7 -6
- package/dist/stories/components/icons/StopAndShopIcon.js +7 -6
- package/dist/stories/components/icons/TheGiantCompanyIcon.js +7 -6
- package/dist/stories/utils/ComponentFactory.js +4 -2
- package/package.json +5 -5
|
@@ -8,32 +8,29 @@ exports.default = exports.ReportTable = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _ReportTable = require("./ReportTable.style");
|
|
10
10
|
var _InfoIcon = require("./icons/InfoIcon");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const ReportTable = props => {
|
|
12
|
+
const {
|
|
13
|
+
tableData,
|
|
14
|
+
maxColumnsNumber
|
|
15
|
+
} = props;
|
|
16
|
+
const columnsNumber = tableData.columnsHeadings.length;
|
|
17
|
+
const tableWidthSize = 100 / maxColumnsNumber * columnsNumber;
|
|
16
18
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ReportTable.TableWrapper, {
|
|
17
19
|
maxColumnsNumber: maxColumnsNumber,
|
|
18
20
|
columnsNumber: columnsNumber
|
|
19
21
|
}, /*#__PURE__*/_react.default.createElement(_ReportTable.Table, {
|
|
20
22
|
tableWidthSize: tableWidthSize
|
|
21
|
-
}, /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement("tr", null, tableData.columnsHeadings.map(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}, Object.values(data).map(function (value, dataIndex) {
|
|
29
|
-
return /*#__PURE__*/_react.default.createElement(_ReportTable.Td, {
|
|
30
|
-
key: dataIndex
|
|
31
|
-
}, value);
|
|
32
|
-
}));
|
|
33
|
-
})))), /*#__PURE__*/_react.default.createElement(_ReportTable.InfoBlock, null, /*#__PURE__*/_react.default.createElement(_InfoIcon.InfoIcon, {
|
|
23
|
+
}, /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement("tr", null, tableData.columnsHeadings.map((headline, index) => /*#__PURE__*/_react.default.createElement(_ReportTable.Th, {
|
|
24
|
+
key: index
|
|
25
|
+
}, headline.label)))), /*#__PURE__*/_react.default.createElement("tbody", null, tableData.rowsValues.map((data, index) => /*#__PURE__*/_react.default.createElement(_ReportTable.Tr, {
|
|
26
|
+
key: index
|
|
27
|
+
}, Object.values(data).map((value, dataIndex) => /*#__PURE__*/_react.default.createElement(_ReportTable.Td, {
|
|
28
|
+
key: dataIndex
|
|
29
|
+
}, value))))))), /*#__PURE__*/_react.default.createElement(_ReportTable.InfoBlock, null, /*#__PURE__*/_react.default.createElement(_InfoIcon.InfoIcon, {
|
|
34
30
|
color: "#1B30AA"
|
|
35
31
|
}), /*#__PURE__*/_react.default.createElement(_ReportTable.InfoText, null, "Download table to get the full data")));
|
|
36
32
|
};
|
|
33
|
+
exports.ReportTable = ReportTable;
|
|
37
34
|
var _default = exports.default = ReportTable;
|
|
38
35
|
ReportTable.defaultProps = {
|
|
39
36
|
tableData: {
|
|
@@ -8,17 +8,11 @@ exports.Tr = exports.Th = exports.Td = exports.TableWrapper = exports.Table = ex
|
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
10
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
});
|
|
20
|
-
var Th = exports.Th = _styledComponents.default.th(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 600;\n font-size: 12px;\n font-family: \"poppins\";\n color: #212121;\n padding-top: 16px;\n padding-left: 40px;\n"])));
|
|
21
|
-
var Td = exports.Td = _styledComponents.default.td(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 400;\n font-size: 12px;\n font-family: \"poppins\";\n padding-top: 20px;\n padding-bottom: 20px;\n padding-top: 16px;\n padding-left: 40px;\n"])));
|
|
22
|
-
var Tr = exports.Tr = _styledComponents.default.tr(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n border-bottom: 1px solid #F3F4F6;\n &:last-of-type {\n &::after {\n content: \"\";\n position: absolute;\n pointer-events: none;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: linear-gradient(transparent 50%, white);\n z-index: 2;\n }\n }\n"])));
|
|
23
|
-
var InfoText = exports.InfoText = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 400;\n font-size: 14px;\n font-family: \"poppins\";\n color: #212121;\n padding-top: 20px;\n padding-bottom: 20px;\n"])));
|
|
24
|
-
var InfoBlock = exports.InfoBlock = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 8px;\n background-color: white;\n"])));
|
|
11
|
+
const scrollableStyles = "\n overflow-y: auto;\n\n &::-webkit-scrollbar {\n height: 10px;\n }\n\n &::-webkit-scrollbar-track {\n background: #E8E8E8;\n border-radius: 5px;\n }\n\n &::-webkit-scrollbar-thumb {\n background: #D0D0D0;\n border-radius: 5px;\n }\n";
|
|
12
|
+
const TableWrapper = exports.TableWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n white-space: nowrap;\n border: 1px solid #dddddd;\n border-radius: ", ";\n overflow-x: ", ";\n ", "\n\n"])), props => props.columnsNumber > props.maxColumnsNumber ? ' 12px 12px 6px 6px' : '12px', props => props.columnsNumber > props.maxColumnsNumber ? 'auto' : 'hidden', scrollableStyles);
|
|
13
|
+
const Table = exports.Table = _styledComponents.default.table(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: ", ";\n table-layout: fixed;\n position: relative;\n background-color: white;\n border-collapse: collapse; \n th,\n td {\n text-align: left;\n width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])), props => "".concat(props.tableWidthSize, "%"));
|
|
14
|
+
const Th = exports.Th = _styledComponents.default.th(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 600;\n font-size: 12px;\n font-family: \"poppins\";\n color: #212121;\n padding-top: 16px;\n padding-left: 40px;\n"])));
|
|
15
|
+
const Td = exports.Td = _styledComponents.default.td(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 400;\n font-size: 12px;\n font-family: \"poppins\";\n padding-top: 20px;\n padding-bottom: 20px;\n padding-top: 16px;\n padding-left: 40px;\n"])));
|
|
16
|
+
const Tr = exports.Tr = _styledComponents.default.tr(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n border-bottom: 1px solid #F3F4F6;\n &:last-of-type {\n &::after {\n content: \"\";\n position: absolute;\n pointer-events: none;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: linear-gradient(transparent 50%, white);\n z-index: 2;\n }\n }\n"])));
|
|
17
|
+
const InfoText = exports.InfoText = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 400;\n font-size: 14px;\n font-family: \"poppins\";\n color: #212121;\n padding-top: 20px;\n padding-bottom: 20px;\n"])));
|
|
18
|
+
const InfoBlock = exports.InfoBlock = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 8px;\n background-color: white;\n"])));
|
|
@@ -1,70 +1,68 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = exports.SegmentedButton = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
9
|
var _SegmentedButton = require("./SegmentedButton.style");
|
|
13
10
|
/* eslint-disable react/require-default-props */
|
|
14
11
|
|
|
15
12
|
/* SegmentedButton */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
});
|
|
40
|
-
});
|
|
13
|
+
const SegmentedButton = props => {
|
|
14
|
+
const {
|
|
15
|
+
name,
|
|
16
|
+
options,
|
|
17
|
+
width,
|
|
18
|
+
height,
|
|
19
|
+
controlradius,
|
|
20
|
+
segmentradius,
|
|
21
|
+
fontSize,
|
|
22
|
+
selectedsegmentcolor,
|
|
23
|
+
selectedtextcolor,
|
|
24
|
+
unselectedtextcolor,
|
|
25
|
+
defaultIndex,
|
|
26
|
+
onClick
|
|
27
|
+
} = props;
|
|
28
|
+
const [activeIndex, setActiveIndex] = (0, _react.useState)(defaultIndex);
|
|
29
|
+
const controlRef = (0, _react.useRef)();
|
|
30
|
+
const componentReady = (0, _react.useRef)();
|
|
31
|
+
const optionsRef = options === null || options === void 0 ? void 0 : options.map((item, i) => ({
|
|
32
|
+
...item,
|
|
33
|
+
id: i,
|
|
34
|
+
ref: (0, _react.useRef)()
|
|
35
|
+
}));
|
|
41
36
|
|
|
42
37
|
// Determine when the component is "ready"
|
|
43
|
-
(0, _react.useEffect)(
|
|
38
|
+
(0, _react.useEffect)(() => {
|
|
44
39
|
componentReady.current = true;
|
|
45
40
|
}, []);
|
|
46
|
-
(0, _react.useEffect)(
|
|
41
|
+
(0, _react.useEffect)(() => {
|
|
47
42
|
if (defaultIndex >= 0 && defaultIndex < (options === null || options === void 0 ? void 0 : options.length)) {
|
|
48
43
|
setActiveIndex(defaultIndex);
|
|
49
44
|
}
|
|
50
45
|
}, [defaultIndex]);
|
|
51
|
-
(0, _react.useEffect)(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
offsetWidth
|
|
55
|
-
offsetLeft
|
|
56
|
-
|
|
46
|
+
(0, _react.useEffect)(() => {
|
|
47
|
+
const activeSegmentRef = optionsRef[activeIndex].ref;
|
|
48
|
+
const {
|
|
49
|
+
offsetWidth,
|
|
50
|
+
offsetLeft
|
|
51
|
+
} = activeSegmentRef.current;
|
|
52
|
+
const {
|
|
53
|
+
style
|
|
54
|
+
} = controlRef.current;
|
|
57
55
|
style.setProperty('--highlight-width', "".concat(offsetWidth, "px"));
|
|
58
56
|
style.setProperty('--highlight-x-pos', "".concat(offsetLeft, "px"));
|
|
59
57
|
}, [activeIndex, controlRef, optionsRef]);
|
|
60
|
-
|
|
58
|
+
const onInputChangeHandler = (value, index) => {
|
|
61
59
|
setActiveIndex(index);
|
|
62
60
|
onClick({
|
|
63
|
-
index
|
|
64
|
-
value
|
|
61
|
+
index,
|
|
62
|
+
value
|
|
65
63
|
});
|
|
66
64
|
};
|
|
67
|
-
|
|
65
|
+
let segmentwidth = 120;
|
|
68
66
|
if (options && options.length > 0 && width && width > 0) {
|
|
69
67
|
segmentwidth = width / options.length;
|
|
70
68
|
}
|
|
@@ -78,34 +76,31 @@ var SegmentedButton = exports.SegmentedButton = function SegmentedButton(props)
|
|
|
78
76
|
controlradius: controlradius,
|
|
79
77
|
segmentwidth: segmentwidth,
|
|
80
78
|
className: "controls ".concat(componentReady.current ? 'ready' : 'idle')
|
|
81
|
-
}, optionsRef === null || optionsRef === void 0 ? void 0 : optionsRef.map(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
className: "".concat(activeIndex === i ? 'active' : 'inactive', " "),
|
|
105
|
-
htmlFor: item.value
|
|
106
|
-
}, item.value));
|
|
107
|
-
})));
|
|
79
|
+
}, optionsRef === null || optionsRef === void 0 ? void 0 : optionsRef.map((item, i) => /*#__PURE__*/_react.default.createElement(_SegmentedButton.Segment, {
|
|
80
|
+
id: "Segment",
|
|
81
|
+
key: item.id,
|
|
82
|
+
selectedsegmentcolor: selectedsegmentcolor,
|
|
83
|
+
controlradius: controlradius,
|
|
84
|
+
segmentwidth: segmentwidth,
|
|
85
|
+
className: "".concat(activeIndex === i ? 'active' : 'inactive'),
|
|
86
|
+
ref: item.ref
|
|
87
|
+
}, /*#__PURE__*/_react.default.createElement(_SegmentedButton.ControlsInput, {
|
|
88
|
+
type: "radio",
|
|
89
|
+
value: item.value,
|
|
90
|
+
id: item.id,
|
|
91
|
+
name: name,
|
|
92
|
+
onChange: () => onInputChangeHandler(item.value, item.id),
|
|
93
|
+
checked: i === activeIndex
|
|
94
|
+
}), /*#__PURE__*/_react.default.createElement(_SegmentedButton.SegmentLabel, {
|
|
95
|
+
id: "SegmentLabel",
|
|
96
|
+
selectedtextcolor: selectedtextcolor,
|
|
97
|
+
unselectedtextcolor: unselectedtextcolor,
|
|
98
|
+
segmentheight: height / 5,
|
|
99
|
+
className: "".concat(activeIndex === i ? 'active' : 'inactive', " "),
|
|
100
|
+
htmlFor: item.value
|
|
101
|
+
}, item.value)))));
|
|
108
102
|
};
|
|
103
|
+
exports.SegmentedButton = SegmentedButton;
|
|
109
104
|
SegmentedButton.defaultProps = {
|
|
110
105
|
name: '',
|
|
111
106
|
options: [{
|
|
@@ -124,6 +119,6 @@ SegmentedButton.defaultProps = {
|
|
|
124
119
|
selectedtextcolor: '#212121',
|
|
125
120
|
unselectedtextcolor: 'black',
|
|
126
121
|
defaultIndex: 0,
|
|
127
|
-
onClick:
|
|
122
|
+
onClick: () => {}
|
|
128
123
|
};
|
|
129
124
|
var _default = exports.default = SegmentedButton;
|
|
@@ -8,22 +8,12 @@ exports.SegmentedButtonGroup = exports.SegmentLabel = exports.Segment = exports.
|
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
10
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const SegmentedButtonGroup = exports.SegmentedButtonGroup = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n gap: 28px;\n @media (max-width: 1536px) {\n gap: 20px;\n }\n @media (max-width: 1366px) {\n gap: 17px;\n }\n"])));
|
|
12
|
+
const ButtonsControlsContainer = exports.ButtonsControlsContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex; \n font: ", "; \n margin: 0;\n --highlight-width: auto;\n --highlight-x-pos: 0;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n float: left;\n\n &:not(:first-of-type) {\n padding-left: 40px;\n @media (max-width: 1536px) {\n padding-left: 35px;\n }\n @media (max-width: 1366px) {\n padding-left: 24px;\n }\n }\n"])), props => {
|
|
13
13
|
var _props$fontSize;
|
|
14
14
|
return (_props$fontSize = props.fontSize) === null || _props$fontSize === void 0 ? void 0 : _props$fontSize.toString().concat('', 'px Poppins, sans-serif');
|
|
15
15
|
});
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
21
|
-
var ControlsInput = exports.ControlsInput = _styledComponents.default.input(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n opacity: 0;\n margin: 0;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n position: absolute;\n width: 100%;\n cursor: pointer;\n height: 100%;\n"])));
|
|
22
|
-
var Segment = exports.Segment = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n /* width: 100%; uncomment for each segment to have matching width */ \n min-width: ", "; //120px;\n position: relative;\n text-align: center;\n z-index: 1; \n"])), function (props) {
|
|
23
|
-
return props.segmentwidth.toString().concat('', 'px');
|
|
24
|
-
});
|
|
25
|
-
var SegmentLabel = exports.SegmentLabel = _styledComponents.default.label(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n cursor: pointer;\n display: block;\n padding: 0 6px;\n transition: color 0.5s ease;\n &.active {\n color: ", ";\n }\n &.inactive {\n color: ", ";\n }\n"])), function (props) {
|
|
26
|
-
return props.selectedtextcolor;
|
|
27
|
-
}, function (props) {
|
|
28
|
-
return props.unselectedtextcolor;
|
|
29
|
-
});
|
|
16
|
+
const Controls = exports.Controls = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: inline-flex;\n justify-content: space-between; \n background: #f2f2f2;\n border-radius: ", "; //12px\n // max-width: 500px; //use this to limit max lenght of the control \n padding: 6px;\n overflow: hidden;\n position: relative;\n &.controls::before {\n content: \"\";\n color: #212121;\n background: #FFFFFF;\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);\n border-radius: ", "; //12px\n width: var(--highlight-width);\n transform: translateX(var(--highlight-x-pos));\n position: absolute;\n top: 3px;\n bottom: 3px;\n left: 0; \n z-index: 0;\n }\n &.controls.ready::before {\n transition: transform 0.3s ease, width 0.3s ease;\n }\n"])), props => props.controlradius.toString().concat('', 'px'), props => props.segmentradius.toString().concat('', 'px'));
|
|
17
|
+
const ControlsInput = exports.ControlsInput = _styledComponents.default.input(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n opacity: 0;\n margin: 0;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n position: absolute;\n width: 100%;\n cursor: pointer;\n height: 100%;\n"])));
|
|
18
|
+
const Segment = exports.Segment = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n /* width: 100%; uncomment for each segment to have matching width */ \n min-width: ", "; //120px;\n position: relative;\n text-align: center;\n z-index: 1; \n"])), props => props.segmentwidth.toString().concat('', 'px'));
|
|
19
|
+
const SegmentLabel = exports.SegmentLabel = _styledComponents.default.label(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n cursor: pointer;\n display: block;\n padding: 0 6px;\n transition: color 0.5s ease;\n &.active {\n color: ", ";\n }\n &.inactive {\n color: ", ";\n }\n"])), props => props.selectedtextcolor, props => props.unselectedtextcolor);
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = exports.TextField = void 0;
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
10
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
12
11
|
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
@@ -22,41 +21,27 @@ var _TextField2 = require("./TextField.style");
|
|
|
22
21
|
/**
|
|
23
22
|
* SAG TextField
|
|
24
23
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
width =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
multiline = _ref$multiline === void 0 ? false : _ref$multiline;
|
|
47
|
-
var _useState = (0, _react.useState)(null),
|
|
48
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
49
|
-
currentInputValue = _useState2[0],
|
|
50
|
-
setCurrentInputValue = _useState2[1];
|
|
51
|
-
var _React$useState = _react.default.useState(false),
|
|
52
|
-
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
53
|
-
showPassword = _React$useState2[0],
|
|
54
|
-
setShowPassword = _React$useState2[1];
|
|
55
|
-
var handleClickShowPassword = function handleClickShowPassword() {
|
|
56
|
-
return setShowPassword(function (show) {
|
|
57
|
-
return !show;
|
|
58
|
-
});
|
|
59
|
-
};
|
|
24
|
+
const TextField = exports.TextField = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
25
|
+
let {
|
|
26
|
+
width = '100%',
|
|
27
|
+
height = '49px',
|
|
28
|
+
label,
|
|
29
|
+
labelColor,
|
|
30
|
+
shape,
|
|
31
|
+
size,
|
|
32
|
+
placeHolder = 'Enter your email address',
|
|
33
|
+
passwordField = false,
|
|
34
|
+
defaultValue,
|
|
35
|
+
resetDefaultValue,
|
|
36
|
+
required,
|
|
37
|
+
inputRef,
|
|
38
|
+
allowedInput = 'all',
|
|
39
|
+
onChange,
|
|
40
|
+
multiline = false
|
|
41
|
+
} = _ref;
|
|
42
|
+
const [currentInputValue, setCurrentInputValue] = (0, _react.useState)(null);
|
|
43
|
+
const [showPassword, setShowPassword] = _react.default.useState(false);
|
|
44
|
+
const handleClickShowPassword = () => setShowPassword(show => !show);
|
|
60
45
|
|
|
61
46
|
// useEffect(() => {
|
|
62
47
|
// const delayDebounceFn = setTimeout(() => {
|
|
@@ -66,14 +51,14 @@ var TextField = exports.TextField = /*#__PURE__*/_react.default.forwardRef(funct
|
|
|
66
51
|
// return () => clearTimeout(delayDebounceFn);
|
|
67
52
|
// }, [currentInputValue]);
|
|
68
53
|
|
|
69
|
-
|
|
54
|
+
const onChangeHandler = event => {
|
|
70
55
|
onChange(event);
|
|
71
56
|
setCurrentInputValue({
|
|
72
|
-
event
|
|
57
|
+
event,
|
|
73
58
|
value: event.target.value
|
|
74
59
|
});
|
|
75
60
|
};
|
|
76
|
-
|
|
61
|
+
const theme = (0, _styles.createTheme)({
|
|
77
62
|
components: {
|
|
78
63
|
MuiFormLabel: {
|
|
79
64
|
styleOverrides: {
|
|
@@ -84,21 +69,21 @@ var TextField = exports.TextField = /*#__PURE__*/_react.default.forwardRef(funct
|
|
|
84
69
|
}
|
|
85
70
|
}
|
|
86
71
|
});
|
|
87
|
-
|
|
72
|
+
const handleMouseDownPassword = event => {
|
|
88
73
|
event.preventDefault();
|
|
89
74
|
};
|
|
90
75
|
|
|
91
76
|
// defines shape: squire or round
|
|
92
|
-
|
|
77
|
+
const getTextFieldStyle = () => {
|
|
93
78
|
if (shape === 'round') {
|
|
94
79
|
// round
|
|
95
80
|
return {
|
|
96
81
|
'& .MuiOutlinedInput-root': {
|
|
97
82
|
width: {
|
|
98
|
-
width
|
|
83
|
+
width
|
|
99
84
|
},
|
|
100
85
|
height: {
|
|
101
|
-
height
|
|
86
|
+
height
|
|
102
87
|
},
|
|
103
88
|
paddingTop: multiline ? '12px' : '0',
|
|
104
89
|
marginTop: 0,
|
|
@@ -136,10 +121,10 @@ var TextField = exports.TextField = /*#__PURE__*/_react.default.forwardRef(funct
|
|
|
136
121
|
// square
|
|
137
122
|
return null;
|
|
138
123
|
};
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
124
|
+
const isInputAllowed = inputChar => {
|
|
125
|
+
const NUMERIC_REGEX = /^[0-9-]+$/;
|
|
126
|
+
const ALPHA_REGEX = /^[a-zA-Z]+$/;
|
|
127
|
+
const ALPHA_NUMERIC_REGEX = /^[a-zA-Z0-9-]+$/;
|
|
143
128
|
switch (allowedInput) {
|
|
144
129
|
case 'all':
|
|
145
130
|
return true;
|
|
@@ -178,12 +163,12 @@ var TextField = exports.TextField = /*#__PURE__*/_react.default.forwardRef(funct
|
|
|
178
163
|
required: required,
|
|
179
164
|
inputRef: inputRef !== null && inputRef !== void 0 ? inputRef : null,
|
|
180
165
|
ref: ref !== null && ref !== void 0 ? ref : null,
|
|
181
|
-
onKeyDown:
|
|
166
|
+
onKeyDown: event => {
|
|
182
167
|
if (!isInputAllowed(event.key)) {
|
|
183
168
|
event.preventDefault();
|
|
184
169
|
}
|
|
185
170
|
},
|
|
186
|
-
onChange:
|
|
171
|
+
onChange: event => {
|
|
187
172
|
onChangeHandler(event);
|
|
188
173
|
},
|
|
189
174
|
InputProps: {
|
|
@@ -218,12 +203,12 @@ var TextField = exports.TextField = /*#__PURE__*/_react.default.forwardRef(funct
|
|
|
218
203
|
multiline: multiline,
|
|
219
204
|
inputRef: inputRef !== null && inputRef !== void 0 ? inputRef : null,
|
|
220
205
|
ref: ref !== null && ref !== void 0 ? ref : null,
|
|
221
|
-
onKeyDown:
|
|
206
|
+
onKeyDown: event => {
|
|
222
207
|
if (!isInputAllowed(event.key)) {
|
|
223
208
|
event.preventDefault();
|
|
224
209
|
}
|
|
225
210
|
},
|
|
226
|
-
onChange:
|
|
211
|
+
onChange: event => {
|
|
227
212
|
onChangeHandler(event);
|
|
228
213
|
}
|
|
229
214
|
}))))));
|
|
@@ -10,6 +10,4 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
10
10
|
var _templateObject;
|
|
11
11
|
//import './font.css';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
return props.width;
|
|
15
|
-
});
|
|
13
|
+
const TextFieldContainer = exports.TextFieldContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n width: ", "; \n text-align: left; \n position: relative; \n align-items: flex-start;\n justify-content: flex-start;\n font-family: Poppins; \n font-size: \"14px\";\n"])), props => props.width);
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = exports.TitleDescription = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
9
|
var _EyeIcon = require("./icons/EyeIcon");
|
|
13
10
|
var _FoodLionIcon = require("./icons/FoodLionIcon");
|
|
@@ -20,41 +17,36 @@ var _ComboBoxArrowUpIcon = require("./icons/ComboBoxArrowUpIcon");
|
|
|
20
17
|
var _ListBox = require("./ListBox");
|
|
21
18
|
var _TitleDescription = require("./TitleDescription.style");
|
|
22
19
|
/* TitleDescription */
|
|
23
|
-
|
|
20
|
+
const TitleDescription = props => {
|
|
24
21
|
var _data$objectivesDescr, _data$eventDatesValue, _data$eventDatesValue2;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
setViewCreativeListBoxOpenedState = _useState4[1];
|
|
42
|
-
var viewCreativeContainerRef = (0, _react.useRef)(null);
|
|
43
|
-
(0, _react.useEffect)(function () {
|
|
44
|
-
var newData = [];
|
|
22
|
+
const {
|
|
23
|
+
showRetailerIcon,
|
|
24
|
+
showPeriodIcon,
|
|
25
|
+
viewCreativeRetailersData,
|
|
26
|
+
data,
|
|
27
|
+
viewCreativeOnClick,
|
|
28
|
+
width,
|
|
29
|
+
height,
|
|
30
|
+
textcolor,
|
|
31
|
+
disabled
|
|
32
|
+
} = props;
|
|
33
|
+
const [retailersDataState, setRetailersDataState] = (0, _react.useState)(null);
|
|
34
|
+
const [viewCreativeListBoxOpenedState, setViewCreativeListBoxOpenedState] = (0, _react.useState)(false);
|
|
35
|
+
const viewCreativeContainerRef = (0, _react.useRef)(null);
|
|
36
|
+
(0, _react.useEffect)(() => {
|
|
37
|
+
let newData = [];
|
|
45
38
|
if (viewCreativeRetailersData && viewCreativeRetailersData.length > 0) {
|
|
46
|
-
newData = viewCreativeRetailersData === null || viewCreativeRetailersData === void 0 ? void 0 : viewCreativeRetailersData.map(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
});
|
|
39
|
+
newData = viewCreativeRetailersData === null || viewCreativeRetailersData === void 0 ? void 0 : viewCreativeRetailersData.map(item => ({
|
|
40
|
+
...item,
|
|
41
|
+
checked: false,
|
|
42
|
+
disabled: false
|
|
43
|
+
}));
|
|
52
44
|
setRetailersDataState(newData);
|
|
53
45
|
} else {
|
|
54
46
|
setRetailersDataState(null);
|
|
55
47
|
}
|
|
56
48
|
}, [viewCreativeRetailersData]);
|
|
57
|
-
|
|
49
|
+
const getRetailerIcon = retailerName => {
|
|
58
50
|
switch (retailerName) {
|
|
59
51
|
case 'Food Lion':
|
|
60
52
|
return /*#__PURE__*/_react.default.createElement(_TitleDescription.RetailerIconContainer, {
|
|
@@ -99,7 +91,7 @@ var TitleDescription = exports.TitleDescription = function TitleDescription(prop
|
|
|
99
91
|
}, " | "));
|
|
100
92
|
}
|
|
101
93
|
};
|
|
102
|
-
|
|
94
|
+
const viewCreativeOnClickHandler = () => {
|
|
103
95
|
if (retailersDataState && retailersDataState.length > 0) {
|
|
104
96
|
setViewCreativeListBoxOpenedState(!viewCreativeListBoxOpenedState);
|
|
105
97
|
} else {
|
|
@@ -108,24 +100,28 @@ var TitleDescription = exports.TitleDescription = function TitleDescription(prop
|
|
|
108
100
|
});
|
|
109
101
|
}
|
|
110
102
|
};
|
|
111
|
-
|
|
103
|
+
const listBoxViewCreativeOnClickHandler = props => {
|
|
112
104
|
var _props$selectedData, _props$selectedData2;
|
|
113
|
-
|
|
105
|
+
const selectedRetailer = ((_props$selectedData = props.selectedData) === null || _props$selectedData === void 0 ? void 0 : _props$selectedData.length) > 0 ? props.selectedData[0].label : null;
|
|
114
106
|
if (selectedRetailer) {
|
|
115
107
|
viewCreativeOnClick({
|
|
116
|
-
selectedRetailer
|
|
108
|
+
selectedRetailer
|
|
117
109
|
});
|
|
118
110
|
}
|
|
119
111
|
if (((_props$selectedData2 = props.selectedData) === null || _props$selectedData2 === void 0 ? void 0 : _props$selectedData2.length) > 0) {
|
|
120
112
|
setViewCreativeListBoxOpenedState(false);
|
|
121
113
|
}
|
|
122
114
|
};
|
|
123
|
-
|
|
124
|
-
|
|
115
|
+
const getViewCreativeContainerLeft = () => {
|
|
116
|
+
const {
|
|
117
|
+
offsetLeft
|
|
118
|
+
} = viewCreativeContainerRef.current;
|
|
125
119
|
return offsetLeft.toString().concat('', 'px');
|
|
126
120
|
};
|
|
127
|
-
|
|
128
|
-
|
|
121
|
+
const getViewCreativeContainerTop = () => {
|
|
122
|
+
const {
|
|
123
|
+
offsetTop
|
|
124
|
+
} = viewCreativeContainerRef.current;
|
|
129
125
|
return (offsetTop + 33).toString().concat('', 'px');
|
|
130
126
|
};
|
|
131
127
|
return /*#__PURE__*/_react.default.createElement(_TitleDescription.MainContainer, {
|
|
@@ -159,7 +155,7 @@ var TitleDescription = exports.TitleDescription = function TitleDescription(prop
|
|
|
159
155
|
top: getViewCreativeContainerTop(),
|
|
160
156
|
width: "100%",
|
|
161
157
|
height: "100%",
|
|
162
|
-
onMouseLeave:
|
|
158
|
+
onMouseLeave: () => {
|
|
163
159
|
setViewCreativeListBoxOpenedState(false);
|
|
164
160
|
}
|
|
165
161
|
}, /*#__PURE__*/_react.default.createElement(_ListBox.ListBox, {
|
|
@@ -173,7 +169,7 @@ var TitleDescription = exports.TitleDescription = function TitleDescription(prop
|
|
|
173
169
|
buttonsTextColorUnchecked: "#212121",
|
|
174
170
|
height: "100%",
|
|
175
171
|
width: "100%",
|
|
176
|
-
onClick:
|
|
172
|
+
onClick: props => {
|
|
177
173
|
listBoxViewCreativeOnClickHandler(props);
|
|
178
174
|
}
|
|
179
175
|
}))))), /*#__PURE__*/_react.default.createElement(_TitleDescription.FilterValuesContainer, {
|
|
@@ -227,6 +223,7 @@ var TitleDescription = exports.TitleDescription = function TitleDescription(prop
|
|
|
227
223
|
id: "PeriodValue"
|
|
228
224
|
}, data.eventDatesValue) : '')))));
|
|
229
225
|
};
|
|
226
|
+
exports.TitleDescription = TitleDescription;
|
|
230
227
|
var _default = exports.default = TitleDescription;
|
|
231
228
|
TitleDescription.defaultProps = {
|
|
232
229
|
showRetailerIcon: true,
|
|
@@ -255,7 +252,7 @@ TitleDescription.defaultProps = {
|
|
|
255
252
|
supplier: '',
|
|
256
253
|
brand: ''
|
|
257
254
|
},
|
|
258
|
-
viewCreativeOnClick:
|
|
255
|
+
viewCreativeOnClick: () => {},
|
|
259
256
|
width: '100%',
|
|
260
257
|
height: '100%',
|
|
261
258
|
textcolor: '#212121',
|