sag_components 1.0.283 → 1.0.285
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/.history/package_20231101114544.json +82 -0
- package/.history/package_20231101151518.json +82 -0
- package/dist/stories/components/Benchmark.js +18 -20
- package/dist/stories/components/Benchmark.style.js +13 -13
- package/dist/stories/components/CollapseData.js +12 -6
- package/dist/stories/components/CollapseData.style.js +2 -2
- package/dist/stories/components/Datepicker.js +48 -53
- package/dist/stories/components/Datepicker.style.js +2 -2
- package/dist/stories/components/OneColumnContainer.js +1 -2
- package/dist/stories/components/PerformanceAnalytics.js +29 -29
- package/dist/stories/components/PerformanceAnalytics.style.js +2 -2
- package/dist/stories/components/PerformanceAnalyticsLegend.js +8 -7
- package/dist/stories/components/PerformanceAnalyticsTotals.js +13 -13
- package/dist/stories/components/SegmentedButton.js +25 -26
- package/dist/stories/components/SegmentedButton.style.js +7 -7
- package/dist/stories/components/TextField.js +46 -50
- package/dist/stories/components/TitleDescription.js +4 -4
- package/dist/stories/components/TitleDescription.style.js +3 -3
- package/dist/stories/components/TotalBenchmark.js +25 -25
- package/dist/stories/components/TotalBenchmark.style.js +2 -4
- package/dist/stories/components/TotalBenchmarkAreachart.js +5 -7
- package/dist/stories/components/TotalBenchmarkAreachart.style.js +1 -3
- package/dist/stories/components/TotalBenchmarkArrows.js +41 -42
- package/dist/stories/components/TotalBenchmarkArrows.style.js +1 -3
- package/dist/stories/components/TotalBenchmarkBarchart.js +37 -42
- package/dist/stories/components/TotalBenchmarkBarchart.style.js +1 -3
- package/dist/stories/components/TotalDoughnutChart.js +5 -4
- package/dist/stories/components/icons/LegendUnionIcon.js +6 -7
- package/package.json +1 -1
|
@@ -18,7 +18,7 @@ var _PerformanceAnalyticsTotals = require("./PerformanceAnalyticsTotals");
|
|
|
18
18
|
var _PerformanceAnalyticsLegend = require("./PerformanceAnalyticsLegend");
|
|
19
19
|
var _CommonFunctions = require("./CommonFunctions");
|
|
20
20
|
var _PerformanceAnalytics = require("./PerformanceAnalytics.style");
|
|
21
|
-
var _excluded = ["totalsData", "data", "currencyType", "colorGraphROI", "colorBarchart1", "colorBarchart2", "
|
|
21
|
+
var _excluded = ["totalsData", "data", "currencyType", "colorGraphROI", "colorBarchart1", "colorBarchart2", "textcolor", "width", "height", "lineChartHeight", "noDataText"];
|
|
22
22
|
var INDIVIDUAL_PERFORMANCE_STR = 'Individual Performance';
|
|
23
23
|
var PERCENT_INCREMENTAL_GROWTH_STR = '% Incremental Growth';
|
|
24
24
|
var PERCENT_CONTRIBUTION_OF_TOTAL_STR = '% Contribution of Total';
|
|
@@ -65,8 +65,8 @@ var PerformanceAnalytics = exports.PerformanceAnalytics = function PerformanceAn
|
|
|
65
65
|
colorBarchart1 = _ref$colorBarchart === void 0 ? '#1F7677' : _ref$colorBarchart,
|
|
66
66
|
_ref$colorBarchart2 = _ref.colorBarchart2,
|
|
67
67
|
colorBarchart2 = _ref$colorBarchart2 === void 0 ? '#90CE9C' : _ref$colorBarchart2,
|
|
68
|
-
_ref$
|
|
69
|
-
|
|
68
|
+
_ref$textcolor = _ref.textcolor,
|
|
69
|
+
textcolor = _ref$textcolor === void 0 ? '#212121' : _ref$textcolor,
|
|
70
70
|
width = _ref.width,
|
|
71
71
|
height = _ref.height,
|
|
72
72
|
_ref$lineChartHeight = _ref.lineChartHeight,
|
|
@@ -95,18 +95,18 @@ var PerformanceAnalytics = exports.PerformanceAnalytics = function PerformanceAn
|
|
|
95
95
|
}, {
|
|
96
96
|
value: PERCENT_CONTRIBUTION_OF_TOTAL_STR
|
|
97
97
|
}],
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
backgroundcolor: "#F2F2F2",
|
|
99
|
+
controlradius: 8,
|
|
100
100
|
defaultIndex: 0,
|
|
101
101
|
fontSize: 12,
|
|
102
102
|
name: "segmentedDollarsOrUnits",
|
|
103
103
|
onClick: function onClick(event) {
|
|
104
104
|
setSegmentedButtonsFilter(event.value);
|
|
105
105
|
},
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
segmentradius: 8,
|
|
107
|
+
selectedsegmentcolor: "#ffffff",
|
|
108
|
+
selectedtextcolor: "#212121",
|
|
109
|
+
unselectedtextcolor: "#212121",
|
|
110
110
|
width: 490,
|
|
111
111
|
heigth: 14
|
|
112
112
|
}));
|
|
@@ -193,7 +193,7 @@ var PerformanceAnalytics = exports.PerformanceAnalytics = function PerformanceAn
|
|
|
193
193
|
return /*#__PURE__*/_react.default.createElement("g", null, /*#__PURE__*/_react.default.createElement("text", {
|
|
194
194
|
x: x + width / 2,
|
|
195
195
|
y: y - radius,
|
|
196
|
-
fill:
|
|
196
|
+
fill: textcolor,
|
|
197
197
|
fontWeight: 400,
|
|
198
198
|
fontSize: "16px",
|
|
199
199
|
textAnchor: "middle",
|
|
@@ -358,12 +358,12 @@ var PerformanceAnalytics = exports.PerformanceAnalytics = function PerformanceAn
|
|
|
358
358
|
id: "ControlsContainer",
|
|
359
359
|
height: height,
|
|
360
360
|
width: width,
|
|
361
|
-
|
|
361
|
+
textcolor: textcolor
|
|
362
362
|
}, (totalsData === null || totalsData === void 0 ? void 0 : totalsData.length) > 0 && (data === null || data === void 0 ? void 0 : data.length) > 0 ? /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.Controls, {
|
|
363
363
|
id: "Controls"
|
|
364
364
|
}, /*#__PURE__*/_react.default.createElement(_SegmentedButton.SegmentedButton, {
|
|
365
|
-
|
|
366
|
-
|
|
365
|
+
backgroundcolor: "#F2F2F2",
|
|
366
|
+
controlradius: 8,
|
|
367
367
|
defaultIndex: 1,
|
|
368
368
|
fontSize: 14,
|
|
369
369
|
height: 40,
|
|
@@ -374,14 +374,14 @@ var PerformanceAnalytics = exports.PerformanceAnalytics = function PerformanceAn
|
|
|
374
374
|
}, {
|
|
375
375
|
value: 'Units'
|
|
376
376
|
}],
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
377
|
+
segmentradius: 8,
|
|
378
|
+
selectedsegmentcolor: "#FFFFFF",
|
|
379
|
+
selectedtextcolor: "#212121",
|
|
380
|
+
unselectedtextcolor: "#212121",
|
|
381
381
|
width: 200
|
|
382
382
|
}), /*#__PURE__*/_react.default.createElement(_SegmentedButton.SegmentedButton, {
|
|
383
|
-
|
|
384
|
-
|
|
383
|
+
backgroundcolor: "#F2F2F2",
|
|
384
|
+
controlradius: 8,
|
|
385
385
|
defaultIndex: 1,
|
|
386
386
|
fontSize: 14,
|
|
387
387
|
height: 40,
|
|
@@ -392,14 +392,14 @@ var PerformanceAnalytics = exports.PerformanceAnalytics = function PerformanceAn
|
|
|
392
392
|
}, {
|
|
393
393
|
value: 'STLY'
|
|
394
394
|
}],
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
395
|
+
segmentradius: 8,
|
|
396
|
+
selectedsegmentcolor: "#FFFFFF",
|
|
397
|
+
selectedtextcolor: "#212121",
|
|
398
|
+
unselectedtextcolor: "#212121",
|
|
399
399
|
width: 200
|
|
400
400
|
}), /*#__PURE__*/_react.default.createElement(_SegmentedButton.SegmentedButton, {
|
|
401
|
-
|
|
402
|
-
|
|
401
|
+
backgroundcolor: "#F2F2F2",
|
|
402
|
+
controlradius: 8,
|
|
403
403
|
defaultIndex: 1,
|
|
404
404
|
fontSize: 14,
|
|
405
405
|
height: 40,
|
|
@@ -410,10 +410,10 @@ var PerformanceAnalytics = exports.PerformanceAnalytics = function PerformanceAn
|
|
|
410
410
|
}, {
|
|
411
411
|
value: 'Actual Sales'
|
|
412
412
|
}],
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
413
|
+
segmentradius: 8,
|
|
414
|
+
selectedsegmentcolor: "#FFFFFF",
|
|
415
|
+
selectedtextcolor: "#212121",
|
|
416
|
+
unselectedtextcolor: "#212121",
|
|
417
417
|
width: 200
|
|
418
418
|
}), displayTotalsData(), displaySegmentedButtons(), displayLineChartROI(), displayBarChart(), displayLegendData()) : /*#__PURE__*/_react.default.createElement(_NoDataFoundMessage.NoDataFoundMessage, {
|
|
419
419
|
noDataText: noDataText
|
|
@@ -12,13 +12,13 @@ var scrollableStyles = "\n overflow-y: auto;\n\n &::-webkit-scrollbar {\n w
|
|
|
12
12
|
var ControlsContainer = exports.ControlsContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n font-family: \"Poppins\", sans-serif;\n font-style: normal;\n font-size: ", ";\n color: ", ";\n width: ", ";\n height: ", ";\n border-radius: 12px;\n align-self: center;\n\n > * {\n box-sizing: border-box;\n }\n"])), function (props) {
|
|
13
13
|
return props.rootFont;
|
|
14
14
|
}, function (props) {
|
|
15
|
-
return props.
|
|
15
|
+
return props.textcolor;
|
|
16
16
|
}, function (props) {
|
|
17
17
|
return props.width;
|
|
18
18
|
}, function (props) {
|
|
19
19
|
return props.height;
|
|
20
20
|
});
|
|
21
|
-
var Controls = exports.Controls = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n height: 100%;\n padding: 24px 40px;\n background: white;\n overflow-y: auto;\n ", "\n @media (max-width: 1536px) {\n padding: 12px 32px;\n } \n > #SegmentedButtonContainer {\n padding-left: 0;\n }\n"])), scrollableStyles);
|
|
21
|
+
var Controls = exports.Controls = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n height: 100%;\n padding: 24px 40px;\n background: white;\n overflow-y: auto;\n ", "\n @media (max-width: 1536px) {\n padding: 12px 32px;\n } \n > #SegmentedButtonContainer {\n padding-left: 0;\n > #Controls {\n background: #f2f2f2;\n }\n }\n"])), scrollableStyles);
|
|
22
22
|
var SegmentedButtonContainer = exports.SegmentedButtonContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n padding: 10px 0 0 10px;\n"])));
|
|
23
23
|
var TooltipContainer = exports.TooltipContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);\n border-radius: 5px;\n background: #fff;\n font-family: \"Poppins\", sans-serif;\n border-radius: 5px;\n padding: 8px 12px;\n display: grid;\n"])));
|
|
24
24
|
var TooltipLabel = exports.TooltipLabel = _styledComponents.default.p(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n color: #212121;\n font-family: \"Poppins\", sans-serif;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: normal;\n width: fit-content;\n margin: 0 6px 0 0;\n"])));
|
|
@@ -8,8 +8,8 @@ exports.default = exports.PerformanceAnalyticsLegend = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _LegendUnionIcon = require("./icons/LegendUnionIcon");
|
|
10
10
|
var _PerformanceAnalyticsLegend = require("./PerformanceAnalyticsLegend.style");
|
|
11
|
-
var ICON_TYPE_SQUARE =
|
|
12
|
-
var ICON_TYPE_LEGEND_UNION_ICON =
|
|
11
|
+
var ICON_TYPE_SQUARE = 'Square';
|
|
12
|
+
var ICON_TYPE_LEGEND_UNION_ICON = 'LegendUnionIcon';
|
|
13
13
|
|
|
14
14
|
/* PerformanceAnalyticsLegend */
|
|
15
15
|
var PerformanceAnalyticsLegend = exports.PerformanceAnalyticsLegend = function PerformanceAnalyticsLegend(_ref) {
|
|
@@ -17,16 +17,17 @@ var PerformanceAnalyticsLegend = exports.PerformanceAnalyticsLegend = function P
|
|
|
17
17
|
legendData = _ref$legendData === void 0 ? [{
|
|
18
18
|
title: string,
|
|
19
19
|
iconType: ICON_TYPE_SQUARE,
|
|
20
|
-
iconColor:
|
|
20
|
+
iconColor: '#1F7677'
|
|
21
21
|
}] : _ref$legendData,
|
|
22
22
|
width = _ref.width,
|
|
23
23
|
height = _ref.height;
|
|
24
24
|
var getLegendData = function getLegendData() {
|
|
25
25
|
return /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsLegend.LegendDataContainer, {
|
|
26
26
|
id: "LegendDataContainer"
|
|
27
|
-
}, legendData === null || legendData === void 0 ? void 0 : legendData.map(function (item) {
|
|
27
|
+
}, legendData === null || legendData === void 0 ? void 0 : legendData.map(function (item, i) {
|
|
28
28
|
return /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsLegend.TitleAndIconContainer, {
|
|
29
|
-
id: "TitleAndIconContainer"
|
|
29
|
+
id: "TitleAndIconContainer",
|
|
30
|
+
key: "".concat(item.title + i)
|
|
30
31
|
}, item.iconType === ICON_TYPE_SQUARE ? /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsLegend.LegendColorRectangle, {
|
|
31
32
|
id: "LegendColorRectangle",
|
|
32
33
|
color: item.iconColor
|
|
@@ -34,7 +35,7 @@ var PerformanceAnalyticsLegend = exports.PerformanceAnalyticsLegend = function P
|
|
|
34
35
|
width: 30,
|
|
35
36
|
height: 30,
|
|
36
37
|
color: item.iconColor
|
|
37
|
-
}) :
|
|
38
|
+
}) : '', /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsLegend.Title, {
|
|
38
39
|
id: "Title",
|
|
39
40
|
width: width
|
|
40
41
|
}, item.title));
|
|
@@ -48,6 +49,6 @@ var PerformanceAnalyticsLegend = exports.PerformanceAnalyticsLegend = function P
|
|
|
48
49
|
id: "Controls",
|
|
49
50
|
height: height,
|
|
50
51
|
width: width
|
|
51
|
-
}, getLegendData()) :
|
|
52
|
+
}, getLegendData()) : '');
|
|
52
53
|
};
|
|
53
54
|
var _default = exports.default = PerformanceAnalyticsLegend;
|
|
@@ -22,26 +22,26 @@ var PerformanceAnalyticsTotals = exports.PerformanceAnalyticsTotals = function P
|
|
|
22
22
|
growthPercent: _propTypes.number | null,
|
|
23
23
|
showGrowthPercentSign: _propTypes.bool
|
|
24
24
|
}] : _ref$totalsData,
|
|
25
|
-
_ref$
|
|
26
|
-
|
|
25
|
+
_ref$textcolor = _ref.textcolor,
|
|
26
|
+
textcolor = _ref$textcolor === void 0 ? '#212121' : _ref$textcolor,
|
|
27
27
|
width = _ref.width,
|
|
28
28
|
height = _ref.height;
|
|
29
29
|
var getGrowthPercent = function getGrowthPercent(growthPercent, showGrowthPercentSign) {
|
|
30
30
|
if (!growthPercent) {
|
|
31
|
-
return
|
|
32
|
-
} else {
|
|
33
|
-
var growthPercentSign = showGrowthPercentSign && growthPercent > 0 ? "+" : "";
|
|
34
|
-
return /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsTotals.GrowthPercent, {
|
|
35
|
-
id: "GrowthPercent"
|
|
36
|
-
}, "(", growthPercentSign, growthPercent, "%)");
|
|
31
|
+
return '';
|
|
37
32
|
}
|
|
33
|
+
var growthPercentSign = showGrowthPercentSign && growthPercent > 0 ? '+' : '';
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsTotals.GrowthPercent, {
|
|
35
|
+
id: "GrowthPercent"
|
|
36
|
+
}, "(", growthPercentSign, growthPercent, "%)");
|
|
38
37
|
};
|
|
39
38
|
var getTotalsData = function getTotalsData() {
|
|
40
39
|
return /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsTotals.TotalsDataContainer, {
|
|
41
40
|
id: "TotalsDataContainer"
|
|
42
|
-
}, totalsData === null || totalsData === void 0 ? void 0 : totalsData.map(function (item) {
|
|
41
|
+
}, totalsData === null || totalsData === void 0 ? void 0 : totalsData.map(function (item, i) {
|
|
43
42
|
return /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsTotals.TitleAndValueContainer, {
|
|
44
|
-
id: "TitleAndValueContainer"
|
|
43
|
+
id: "TitleAndValueContainer",
|
|
44
|
+
key: "".concat(item.title + i)
|
|
45
45
|
}, /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsTotals.Title, {
|
|
46
46
|
id: "Title",
|
|
47
47
|
width: width
|
|
@@ -52,18 +52,18 @@ var PerformanceAnalyticsTotals = exports.PerformanceAnalyticsTotals = function P
|
|
|
52
52
|
width: width
|
|
53
53
|
}, /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsTotals.CurrencySign, {
|
|
54
54
|
id: "CurrencySign"
|
|
55
|
-
}, item.currency ? (0, _CommonFunctions.getCurrencySign)(item.currencyType, item.value) :
|
|
55
|
+
}, item.currency ? (0, _CommonFunctions.getCurrencySign)(item.currencyType, item.value) : ''), item.dotCut ? (0, _CommonFunctions.getFormattedValue)(item.value) : (0, _CommonFunctions.getNumberWithCommas)(item.value), item.dotCut ? (0, _CommonFunctions.getFormattedUnits)(item.value) : '', item.growthPercent ? getGrowthPercent(item.growthPercent, item.showGrowthPercentSign) : '')));
|
|
56
56
|
}));
|
|
57
57
|
};
|
|
58
58
|
return /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsTotals.ControlsContainer, {
|
|
59
59
|
id: "ControlsContainer",
|
|
60
60
|
height: height,
|
|
61
61
|
width: width,
|
|
62
|
-
|
|
62
|
+
textcolor: textcolor
|
|
63
63
|
}, (totalsData === null || totalsData === void 0 ? void 0 : totalsData.length) > 0 ? /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsTotals.Controls, {
|
|
64
64
|
id: "Controls",
|
|
65
65
|
height: height,
|
|
66
66
|
width: width
|
|
67
|
-
}, getTotalsData()) :
|
|
67
|
+
}, getTotalsData()) : '');
|
|
68
68
|
};
|
|
69
69
|
var _default = exports.default = PerformanceAnalyticsTotals;
|
|
@@ -11,7 +11,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm
|
|
|
11
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _SegmentedButton = require("./SegmentedButton.style");
|
|
14
|
-
var _excluded = ["name", "options", "width", "height", "
|
|
14
|
+
var _excluded = ["name", "options", "width", "height", "controlradius", "segmentradius", "fontSize", "backgroundcolor", "selectedsegmentcolor", "selectedtextcolor", "unselectedtextcolor", "defaultIndex", "onClick"];
|
|
15
15
|
/* eslint-disable react/require-default-props */
|
|
16
16
|
/* SegmentedButton */
|
|
17
17
|
var SegmentedButton = exports.SegmentedButton = function SegmentedButton(_ref) {
|
|
@@ -21,20 +21,20 @@ var SegmentedButton = exports.SegmentedButton = function SegmentedButton(_ref) {
|
|
|
21
21
|
width = _ref$width === void 0 ? 120 : _ref$width,
|
|
22
22
|
_ref$height = _ref.height,
|
|
23
23
|
height = _ref$height === void 0 ? 40 : _ref$height,
|
|
24
|
-
_ref$
|
|
25
|
-
|
|
26
|
-
_ref$
|
|
27
|
-
|
|
24
|
+
_ref$controlradius = _ref.controlradius,
|
|
25
|
+
controlradius = _ref$controlradius === void 0 ? 8 : _ref$controlradius,
|
|
26
|
+
_ref$segmentradius = _ref.segmentradius,
|
|
27
|
+
segmentradius = _ref$segmentradius === void 0 ? 8 : _ref$segmentradius,
|
|
28
28
|
_ref$fontSize = _ref.fontSize,
|
|
29
29
|
fontSize = _ref$fontSize === void 0 ? 14 : _ref$fontSize,
|
|
30
|
-
_ref$
|
|
31
|
-
|
|
32
|
-
_ref$
|
|
33
|
-
|
|
34
|
-
_ref$
|
|
35
|
-
|
|
36
|
-
_ref$
|
|
37
|
-
|
|
30
|
+
_ref$backgroundcolor = _ref.backgroundcolor,
|
|
31
|
+
backgroundcolor = _ref$backgroundcolor === void 0 ? '#ECF0FF' : _ref$backgroundcolor,
|
|
32
|
+
_ref$selectedsegmentc = _ref.selectedsegmentcolor,
|
|
33
|
+
selectedsegmentcolor = _ref$selectedsegmentc === void 0 ? '#3a9df9' : _ref$selectedsegmentc,
|
|
34
|
+
_ref$selectedtextcolo = _ref.selectedtextcolor,
|
|
35
|
+
selectedtextcolor = _ref$selectedtextcolo === void 0 ? 'white' : _ref$selectedtextcolo,
|
|
36
|
+
_ref$unselectedtextco = _ref.unselectedtextcolor,
|
|
37
|
+
unselectedtextcolor = _ref$unselectedtextco === void 0 ? 'black' : _ref$unselectedtextco,
|
|
38
38
|
_ref$defaultIndex = _ref.defaultIndex,
|
|
39
39
|
defaultIndex = _ref$defaultIndex === void 0 ? 0 : _ref$defaultIndex,
|
|
40
40
|
onClick = _ref.onClick,
|
|
@@ -77,29 +77,28 @@ var SegmentedButton = exports.SegmentedButton = function SegmentedButton(_ref) {
|
|
|
77
77
|
value: value
|
|
78
78
|
});
|
|
79
79
|
};
|
|
80
|
-
var
|
|
80
|
+
var segmentwidth = 120;
|
|
81
81
|
if (options && options.length > 0 && width && width > 0) {
|
|
82
|
-
|
|
82
|
+
segmentwidth = width / options.length;
|
|
83
83
|
}
|
|
84
84
|
return /*#__PURE__*/_react.default.createElement(_SegmentedButton.ButtonsControlsContainer, {
|
|
85
85
|
fontSize: fontSize,
|
|
86
86
|
ref: controlRef
|
|
87
87
|
}, /*#__PURE__*/_react.default.createElement(_SegmentedButton.Controls, {
|
|
88
88
|
id: "Controls",
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
selectedsegmentcolor: selectedsegmentcolor,
|
|
90
|
+
segmentradius: segmentradius,
|
|
91
|
+
controlradius: controlradius,
|
|
92
|
+
segmentwidth: segmentwidth,
|
|
93
93
|
className: "controls ".concat(componentReady.current ? 'ready' : 'idle')
|
|
94
94
|
}, optionsRef === null || optionsRef === void 0 ? void 0 : optionsRef.map(function (item, i) {
|
|
95
95
|
return /*#__PURE__*/_react.default.createElement(_SegmentedButton.Segment, {
|
|
96
96
|
id: "Segment",
|
|
97
97
|
key: item.id,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
segmentWidth: segmentWidth,
|
|
98
|
+
backgroundcolor: backgroundcolor,
|
|
99
|
+
selectedsegmentcolor: selectedsegmentcolor,
|
|
100
|
+
controlradius: controlradius,
|
|
101
|
+
segmentwidth: segmentwidth,
|
|
103
102
|
className: "".concat(activeIndex === i ? 'active' : 'inactive'),
|
|
104
103
|
ref: item.ref
|
|
105
104
|
}, /*#__PURE__*/_react.default.createElement(_SegmentedButton.ControlsInput, {
|
|
@@ -113,8 +112,8 @@ var SegmentedButton = exports.SegmentedButton = function SegmentedButton(_ref) {
|
|
|
113
112
|
checked: i === activeIndex
|
|
114
113
|
}), /*#__PURE__*/_react.default.createElement(_SegmentedButton.SegmentLabel, {
|
|
115
114
|
id: "SegmentLabel",
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
selectedtextcolor: selectedtextcolor,
|
|
116
|
+
unselectedtextcolor: unselectedtextcolor,
|
|
118
117
|
segmentheight: height / 5,
|
|
119
118
|
className: "".concat(activeIndex === i ? 'active' : 'inactive', " "),
|
|
120
119
|
htmlFor: item.value
|
|
@@ -14,20 +14,20 @@ var ButtonsControlsContainer = exports.ButtonsControlsContainer = _styledCompone
|
|
|
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
16
|
var Controls = exports.Controls = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: inline-flex;\n justify-content: space-between; \n background: ", ";\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 background: ", "; /* #3a9df9; #5465ff;*/\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"])), function (props) {
|
|
17
|
-
return props.
|
|
17
|
+
return props.backgroundcolor;
|
|
18
18
|
}, function (props) {
|
|
19
|
-
return props.
|
|
19
|
+
return props.controlradius.toString().concat('', 'px');
|
|
20
20
|
}, function (props) {
|
|
21
|
-
return props.
|
|
21
|
+
return props.selectedsegmentcolor;
|
|
22
22
|
}, function (props) {
|
|
23
|
-
return props.
|
|
23
|
+
return props.segmentradius.toString().concat('', 'px');
|
|
24
24
|
});
|
|
25
25
|
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"])));
|
|
26
26
|
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) {
|
|
27
|
-
return props.
|
|
27
|
+
return props.segmentwidth.toString().concat('', 'px');
|
|
28
28
|
});
|
|
29
29
|
var SegmentLabel = exports.SegmentLabel = _styledComponents.default.label(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n cursor: pointer;\n display: block;\n transition: color 0.5s ease;\n &.active {\n color: ", ";\n }\n &.inactive {\n color: ", ";\n }\n"])), function (props) {
|
|
30
|
-
return props.
|
|
30
|
+
return props.selectedtextcolor;
|
|
31
31
|
}, function (props) {
|
|
32
|
-
return props.
|
|
32
|
+
return props.unselectedtextcolor;
|
|
33
33
|
});
|
|
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = exports.TextField = void 0;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _TextFieldStyle = require("./TextField.style.js");
|
|
12
11
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
13
12
|
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
14
13
|
var _OutlinedInput = _interopRequireDefault(require("@mui/material/OutlinedInput"));
|
|
@@ -19,20 +18,21 @@ var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
|
19
18
|
var _Visibility = _interopRequireDefault(require("@mui/icons-material/Visibility"));
|
|
20
19
|
var _VisibilityOff = _interopRequireDefault(require("@mui/icons-material/VisibilityOff"));
|
|
21
20
|
var _styles = require("@mui/material/styles");
|
|
21
|
+
var _TextField2 = require("./TextField.style");
|
|
22
22
|
/**
|
|
23
23
|
* SAG TextField
|
|
24
24
|
*/
|
|
25
25
|
var TextField = exports.TextField = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
26
26
|
var _ref$width = _ref.width,
|
|
27
|
-
width = _ref$width === void 0 ?
|
|
27
|
+
width = _ref$width === void 0 ? '100%' : _ref$width,
|
|
28
28
|
_ref$height = _ref.height,
|
|
29
|
-
height = _ref$height === void 0 ?
|
|
29
|
+
height = _ref$height === void 0 ? '49px' : _ref$height,
|
|
30
30
|
label = _ref.label,
|
|
31
31
|
labelColor = _ref.labelColor,
|
|
32
32
|
shape = _ref.shape,
|
|
33
33
|
size = _ref.size,
|
|
34
34
|
_ref$placeHolder = _ref.placeHolder,
|
|
35
|
-
placeHolder = _ref$placeHolder === void 0 ?
|
|
35
|
+
placeHolder = _ref$placeHolder === void 0 ? 'Type...' : _ref$placeHolder,
|
|
36
36
|
_ref$passwordField = _ref.passwordField,
|
|
37
37
|
passwordField = _ref$passwordField === void 0 ? false : _ref$passwordField,
|
|
38
38
|
defaultValue = _ref.defaultValue,
|
|
@@ -40,7 +40,7 @@ var TextField = exports.TextField = /*#__PURE__*/_react.default.forwardRef(funct
|
|
|
40
40
|
required = _ref.required,
|
|
41
41
|
inputRef = _ref.inputRef,
|
|
42
42
|
_ref$allowedInput = _ref.allowedInput,
|
|
43
|
-
allowedInput = _ref$allowedInput === void 0 ?
|
|
43
|
+
allowedInput = _ref$allowedInput === void 0 ? 'all' : _ref$allowedInput,
|
|
44
44
|
onChange = _ref.onChange,
|
|
45
45
|
_ref$multiline = _ref.multiline,
|
|
46
46
|
multiline = _ref$multiline === void 0 ? false : _ref$multiline;
|
|
@@ -78,7 +78,7 @@ var TextField = exports.TextField = /*#__PURE__*/_react.default.forwardRef(funct
|
|
|
78
78
|
MuiFormLabel: {
|
|
79
79
|
styleOverrides: {
|
|
80
80
|
asterisk: {
|
|
81
|
-
color:
|
|
81
|
+
color: '#db3131'
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
}
|
|
@@ -88,75 +88,77 @@ var TextField = exports.TextField = /*#__PURE__*/_react.default.forwardRef(funct
|
|
|
88
88
|
event.preventDefault();
|
|
89
89
|
};
|
|
90
90
|
|
|
91
|
-
//defines shape: squire or round
|
|
91
|
+
// defines shape: squire or round
|
|
92
92
|
var getTextFieldStyle = function getTextFieldStyle() {
|
|
93
|
-
if (shape ===
|
|
93
|
+
if (shape === 'round') {
|
|
94
94
|
// round
|
|
95
95
|
return {
|
|
96
|
-
|
|
96
|
+
'& .MuiOutlinedInput-root': {
|
|
97
97
|
width: {
|
|
98
98
|
width: width
|
|
99
99
|
},
|
|
100
100
|
height: {
|
|
101
101
|
height: height
|
|
102
102
|
},
|
|
103
|
-
paddingTop: multiline ?
|
|
103
|
+
paddingTop: multiline ? '12px' : '0',
|
|
104
104
|
marginTop: 0,
|
|
105
|
-
borderColor:
|
|
106
|
-
borderRadius:
|
|
105
|
+
borderColor: 'green',
|
|
106
|
+
borderRadius: '12px',
|
|
107
107
|
legend: {
|
|
108
|
-
marginLeft:
|
|
108
|
+
marginLeft: '6px'
|
|
109
109
|
},
|
|
110
|
-
|
|
110
|
+
alignitems: multiline ? 'flex-start' : 'center'
|
|
111
111
|
},
|
|
112
|
-
|
|
113
|
-
paddingLeft:
|
|
114
|
-
borderRadius:
|
|
112
|
+
'& .MuiAutocomplete-inputRoot': {
|
|
113
|
+
paddingLeft: '10px !important',
|
|
114
|
+
borderRadius: '12px'
|
|
115
115
|
},
|
|
116
|
-
|
|
117
|
-
paddingLeft:
|
|
116
|
+
'& .MuiInputLabel-outlined': {
|
|
117
|
+
paddingLeft: '10px',
|
|
118
118
|
color: labelColor,
|
|
119
|
-
paddingTop:
|
|
119
|
+
paddingTop: '4px'
|
|
120
120
|
},
|
|
121
|
-
|
|
122
|
-
marginLeft:
|
|
123
|
-
paddingLeft:
|
|
121
|
+
'& .MuiInputLabel-shrink': {
|
|
122
|
+
marginLeft: '1px',
|
|
123
|
+
paddingLeft: '4px',
|
|
124
124
|
paddingRight: 0,
|
|
125
|
-
background:
|
|
125
|
+
background: 'white',
|
|
126
126
|
paddingTop: 0
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
|
-
} else {
|
|
130
|
-
//square
|
|
131
|
-
return null;
|
|
132
129
|
}
|
|
130
|
+
// square
|
|
131
|
+
return null;
|
|
133
132
|
};
|
|
134
133
|
var isInputAllowed = function isInputAllowed(inputChar) {
|
|
135
134
|
var NUMERIC_REGEX = /^[0-9-]+$/;
|
|
136
135
|
var ALPHA_REGEX = /^[a-zA-Z]+$/;
|
|
137
136
|
var ALPHA_NUMERIC_REGEX = /^[a-zA-Z0-9-]+$/;
|
|
138
137
|
switch (allowedInput) {
|
|
139
|
-
case
|
|
138
|
+
case 'all':
|
|
140
139
|
return true;
|
|
141
|
-
case
|
|
142
|
-
if (ALPHA_REGEX.test(inputChar)) return true;
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
140
|
+
case 'alpha':
|
|
141
|
+
if (ALPHA_REGEX.test(inputChar)) return true;
|
|
142
|
+
return false;
|
|
143
|
+
case 'numeric':
|
|
144
|
+
if (NUMERIC_REGEX.test(inputChar)) return true;
|
|
145
|
+
return false;
|
|
146
|
+
case 'alphaNumeric':
|
|
147
|
+
if (ALPHA_NUMERIC_REGEX.test(inputChar)) return true;
|
|
148
|
+
return false;
|
|
147
149
|
default:
|
|
148
150
|
return true;
|
|
149
151
|
}
|
|
150
152
|
};
|
|
151
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
153
|
+
return /*#__PURE__*/_react.default.createElement(_TextField2.TextFieldContainer, {
|
|
152
154
|
id: "TextFieldContainer",
|
|
153
155
|
width: width
|
|
154
156
|
}, /*#__PURE__*/_react.default.createElement(_styles.ThemeProvider, {
|
|
155
157
|
theme: theme
|
|
156
158
|
}, /*#__PURE__*/_react.default.createElement(_Box.default, {
|
|
157
159
|
sx: {
|
|
158
|
-
display:
|
|
159
|
-
flexWrap:
|
|
160
|
+
display: 'flex',
|
|
161
|
+
flexWrap: 'wrap'
|
|
160
162
|
}
|
|
161
163
|
}, /*#__PURE__*/_react.default.createElement("div", null, !passwordField && /*#__PURE__*/_react.default.createElement(_TextField.default, {
|
|
162
164
|
key: resetDefaultValue,
|
|
@@ -179,21 +181,15 @@ var TextField = exports.TextField = /*#__PURE__*/_react.default.forwardRef(funct
|
|
|
179
181
|
onChangeHandler(event);
|
|
180
182
|
},
|
|
181
183
|
InputProps: {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
184
|
+
textalign: 'flex-start',
|
|
185
|
+
alignitems: 'flex-start',
|
|
186
|
+
aligncontent: 'flex-start',
|
|
187
|
+
disableunderline: true.toString(),
|
|
186
188
|
style: {
|
|
187
|
-
//color: 'red',
|
|
188
|
-
|
|
189
|
+
// color: 'red',
|
|
190
|
+
textalign: 'start'
|
|
189
191
|
}
|
|
190
192
|
}
|
|
191
|
-
|
|
192
|
-
// style={{
|
|
193
|
-
// // height: '50px',
|
|
194
|
-
// // width: '50px',
|
|
195
|
-
// textAlign: 'start',
|
|
196
|
-
// justifyContent: 'start'}}
|
|
197
193
|
}), passwordField && /*#__PURE__*/_react.default.createElement(_FormControl.default, {
|
|
198
194
|
sx: getTextFieldStyle(),
|
|
199
195
|
variant: "outlined"
|
|
@@ -201,7 +197,7 @@ var TextField = exports.TextField = /*#__PURE__*/_react.default.forwardRef(funct
|
|
|
201
197
|
htmlFor: "outlined-adornment-password"
|
|
202
198
|
}, label), /*#__PURE__*/_react.default.createElement(_OutlinedInput.default, {
|
|
203
199
|
id: "outlined-adornment-password",
|
|
204
|
-
type: showPassword ?
|
|
200
|
+
type: showPassword ? 'text' : 'password',
|
|
205
201
|
size: size,
|
|
206
202
|
endAdornment: /*#__PURE__*/_react.default.createElement(_InputAdornment.default, {
|
|
207
203
|
position: "end"
|
|
@@ -14,7 +14,7 @@ var _HannafordIcon = require("./icons/HannafordIcon");
|
|
|
14
14
|
var _StopAndShopIcon = require("./icons/StopAndShopIcon");
|
|
15
15
|
var _TheGiantCompanyIcon = require("./icons/TheGiantCompanyIcon");
|
|
16
16
|
var _TitleDescription = require("./TitleDescription.style");
|
|
17
|
-
var _excluded = ["showRetailerIcon", "data", "viewCreativeOnClick", "width", "height", "
|
|
17
|
+
var _excluded = ["showRetailerIcon", "data", "viewCreativeOnClick", "width", "height", "textcolor", "disabled"];
|
|
18
18
|
/* TitleDescription */
|
|
19
19
|
var TitleDescription = exports.TitleDescription = function TitleDescription(_ref) {
|
|
20
20
|
var _data$objectivesDescr, _data$eventDatesValue, _data$eventDatesValue2;
|
|
@@ -26,8 +26,8 @@ var TitleDescription = exports.TitleDescription = function TitleDescription(_ref
|
|
|
26
26
|
width = _ref$width === void 0 ? '100%' : _ref$width,
|
|
27
27
|
_ref$height = _ref.height,
|
|
28
28
|
height = _ref$height === void 0 ? '100%' : _ref$height,
|
|
29
|
-
_ref$
|
|
30
|
-
|
|
29
|
+
_ref$textcolor = _ref.textcolor,
|
|
30
|
+
textcolor = _ref$textcolor === void 0 ? '#212121' : _ref$textcolor,
|
|
31
31
|
_ref$disabled = _ref.disabled,
|
|
32
32
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
33
33
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -80,7 +80,7 @@ var TitleDescription = exports.TitleDescription = function TitleDescription(_ref
|
|
|
80
80
|
id: "MainContainer",
|
|
81
81
|
height: height,
|
|
82
82
|
width: width,
|
|
83
|
-
|
|
83
|
+
textcolor: textcolor
|
|
84
84
|
}, /*#__PURE__*/_react.default.createElement(_TitleDescription.PanelContainer, {
|
|
85
85
|
id: "PanelContainer"
|
|
86
86
|
}, /*#__PURE__*/_react.default.createElement(_TitleDescription.EventNameAndViewCreativeContainer, {
|
|
@@ -9,7 +9,7 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
9
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
10
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24;
|
|
11
11
|
var MainContainer = exports.MainContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n position: relative;\n font-family: \"Poppins\", sans-serif;\n font-style: normal;\n font-size: 1rem;\n color: ", ";\n width: ", ";\n height: ", ";\n border-radius: 12px;\n"])), function (props) {
|
|
12
|
-
return props.
|
|
12
|
+
return props.textcolor ? props.textcolor : '#000';
|
|
13
13
|
}, function (props) {
|
|
14
14
|
return props.width;
|
|
15
15
|
}, function (props) {
|
|
@@ -26,9 +26,9 @@ var ViewCreativeContainer = exports.ViewCreativeContainer = _styledComponents.de
|
|
|
26
26
|
});
|
|
27
27
|
var ViewCreativeTextField = exports.ViewCreativeTextField = _styledComponents.default.h4(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin: 0 5px;\n font-weight: 400;\n"])));
|
|
28
28
|
var FilterValuesContainer = exports.FilterValuesContainer = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-content: center;\n align-items: center;\n width: 100%;\n margin: 0.5rem;\n"])));
|
|
29
|
-
var FilterValue = exports.FilterValue = _styledComponents.default.p(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n color: #212121;\n
|
|
29
|
+
var FilterValue = exports.FilterValue = _styledComponents.default.p(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n color: #212121;\n margin: 0;\n"])));
|
|
30
30
|
var FieldsDelimiter = exports.FieldsDelimiter = _styledComponents.default.p(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n color: #ccc;\n margin: 0;\n"])));
|
|
31
|
-
var Retailer = exports.Retailer = _styledComponents.default.
|
|
31
|
+
var Retailer = exports.Retailer = _styledComponents.default.div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n color: #1b30aa;\n margin: 0;\n margin-inline-end: 5px;\n"])));
|
|
32
32
|
var Space = exports.Space = _styledComponents.default.p(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n margin: 0;\n"])));
|
|
33
33
|
var RetailerIconContainer = exports.RetailerIconContainer = _styledComponents.default.div(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n"])));
|
|
34
34
|
var ObjectiesContainer = exports.ObjectiesContainer = _styledComponents.default.div(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-content: center;\n align-items: center;\n justify-content: space-between;\n width: 75%;\n"])));
|