sag_components 2.0.0-beta2 → 2.0.0-beta4
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.d.ts +170 -1
- package/dist/index.esm.js +789 -85
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +791 -84
- package/dist/index.js.map +1 -1
- package/dist/types/components/FilterPanel/FilterPanel.d.ts +11 -0
- package/dist/types/index.d.ts +3 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -39505,7 +39505,7 @@ generateCategoricalChart({
|
|
|
39505
39505
|
/**
|
|
39506
39506
|
* @fileOverview Bar Chart
|
|
39507
39507
|
*/
|
|
39508
|
-
var BarChart = generateCategoricalChart({
|
|
39508
|
+
var BarChart$1 = generateCategoricalChart({
|
|
39509
39509
|
chartName: 'BarChart',
|
|
39510
39510
|
GraphicalChild: Bar,
|
|
39511
39511
|
defaultTooltipEventType: 'axis',
|
|
@@ -43145,7 +43145,7 @@ const scrollableStyles$a = `
|
|
|
43145
43145
|
border-radius: 5px;
|
|
43146
43146
|
}
|
|
43147
43147
|
`;
|
|
43148
|
-
const ControlsContainer$
|
|
43148
|
+
const ControlsContainer$9 = dt.div`
|
|
43149
43149
|
position: relative;
|
|
43150
43150
|
font-family: "Poppins", sans-serif;
|
|
43151
43151
|
font-style: normal;
|
|
@@ -43164,7 +43164,7 @@ const ControlsContainer$8 = dt.div`
|
|
|
43164
43164
|
box-sizing: border-box;
|
|
43165
43165
|
}
|
|
43166
43166
|
`;
|
|
43167
|
-
const Controls$
|
|
43167
|
+
const Controls$6 = dt.div`
|
|
43168
43168
|
display: flex;
|
|
43169
43169
|
flex-direction: column;
|
|
43170
43170
|
width: 100%;
|
|
@@ -43195,7 +43195,7 @@ const TitleAndValueContainer$4 = dt.div`
|
|
|
43195
43195
|
flex-direction: column;
|
|
43196
43196
|
padding: 0 20px;
|
|
43197
43197
|
`;
|
|
43198
|
-
const Title$
|
|
43198
|
+
const Title$a = dt.h4`
|
|
43199
43199
|
font-weight: 400;
|
|
43200
43200
|
font-size: 18px;
|
|
43201
43201
|
margin: 0 0 8px;
|
|
@@ -43275,7 +43275,7 @@ const LegendFormattedValue$1 = dt.span`
|
|
|
43275
43275
|
white-space: nowrap;
|
|
43276
43276
|
`;
|
|
43277
43277
|
|
|
43278
|
-
const ControlsContainer$
|
|
43278
|
+
const ControlsContainer$8 = dt.div`
|
|
43279
43279
|
display: flex;
|
|
43280
43280
|
position: relative;
|
|
43281
43281
|
margin: 0px 0 0px;
|
|
@@ -43288,7 +43288,7 @@ const ControlsContainer$7 = dt.div`
|
|
|
43288
43288
|
//border: 1px solid red;
|
|
43289
43289
|
align-items: center;
|
|
43290
43290
|
`;
|
|
43291
|
-
const Controls$
|
|
43291
|
+
const Controls$5 = dt.div`
|
|
43292
43292
|
position: relative;
|
|
43293
43293
|
border-radius: 100px;
|
|
43294
43294
|
width: ${props => props.width.toString().concat('', 'px')};
|
|
@@ -43536,7 +43536,7 @@ const Benchmark = props => {
|
|
|
43536
43536
|
return width * (benchmarkValue / totalValue);
|
|
43537
43537
|
};
|
|
43538
43538
|
const getTooltipText = () => /*#__PURE__*/React__default.createElement("h4", null, tooltipLabel, tooltipLabel ? ': ' : '', getFormattedValue(benchmarkValue)?.toString(), getFormattedUnits(benchmarkValue)?.toString());
|
|
43539
|
-
return /*#__PURE__*/React__default.createElement(ControlsContainer$
|
|
43539
|
+
return /*#__PURE__*/React__default.createElement(ControlsContainer$8, {
|
|
43540
43540
|
id: "ControlsContainer",
|
|
43541
43541
|
height: height,
|
|
43542
43542
|
width: width
|
|
@@ -43544,7 +43544,7 @@ const Benchmark = props => {
|
|
|
43544
43544
|
id: "Tooltip",
|
|
43545
43545
|
content: getTooltipText(),
|
|
43546
43546
|
direction: tooltipDirection
|
|
43547
|
-
}, /*#__PURE__*/React__default.createElement(Controls$
|
|
43547
|
+
}, /*#__PURE__*/React__default.createElement(Controls$5, {
|
|
43548
43548
|
id: "ControlsBenchmark",
|
|
43549
43549
|
height: height,
|
|
43550
43550
|
width: width
|
|
@@ -43661,7 +43661,7 @@ const PieChart = props => {
|
|
|
43661
43661
|
}
|
|
43662
43662
|
return null;
|
|
43663
43663
|
};
|
|
43664
|
-
return /*#__PURE__*/React__default.createElement(ControlsContainer$
|
|
43664
|
+
return /*#__PURE__*/React__default.createElement(ControlsContainer$9, {
|
|
43665
43665
|
className: className,
|
|
43666
43666
|
height: height,
|
|
43667
43667
|
width: width,
|
|
@@ -43669,13 +43669,13 @@ const PieChart = props => {
|
|
|
43669
43669
|
}, legendData.length === 0 || legendData.every(item => item.value === undefined || item.value === null) ? /*#__PURE__*/React__default.createElement(NoDataFoundMessage, {
|
|
43670
43670
|
className: "NoDataFoundMessage",
|
|
43671
43671
|
noDataText: noDataText
|
|
43672
|
-
}) : /*#__PURE__*/React__default.createElement(Controls$
|
|
43672
|
+
}) : /*#__PURE__*/React__default.createElement(Controls$6, {
|
|
43673
43673
|
className: "Controls",
|
|
43674
43674
|
height: height,
|
|
43675
43675
|
width: width
|
|
43676
43676
|
}, !hideTitleAndValue && /*#__PURE__*/React__default.createElement(TitleAndValueContainer$4, {
|
|
43677
43677
|
className: "TitleAndValueContainer"
|
|
43678
|
-
}, /*#__PURE__*/React__default.createElement(Title$
|
|
43678
|
+
}, /*#__PURE__*/React__default.createElement(Title$a, {
|
|
43679
43679
|
className: "Title"
|
|
43680
43680
|
}, title), /*#__PURE__*/React__default.createElement(CurrencySignAndFormattedValueContainer$2, {
|
|
43681
43681
|
className: "CurrencySignAndFormattedValueContainer"
|
|
@@ -44631,7 +44631,7 @@ EventDetailsCard.defaultProps = {
|
|
|
44631
44631
|
disableViewDetailsButton: false
|
|
44632
44632
|
};
|
|
44633
44633
|
|
|
44634
|
-
const LinnerContainer = dt.div`
|
|
44634
|
+
const LinnerContainer$1 = dt.div`
|
|
44635
44635
|
font-family: "Poppins", sans-serif;
|
|
44636
44636
|
display: flex;
|
|
44637
44637
|
justify-content: space-between;
|
|
@@ -44648,11 +44648,11 @@ const DataBoxWrap = dt.div`
|
|
|
44648
44648
|
width: ${props => props.width};
|
|
44649
44649
|
height: 100%;
|
|
44650
44650
|
`;
|
|
44651
|
-
const DataBox = dt.div`
|
|
44651
|
+
const DataBox$1 = dt.div`
|
|
44652
44652
|
color: #212121;
|
|
44653
44653
|
font-weight: 400;
|
|
44654
44654
|
`;
|
|
44655
|
-
const DataBoxTitle = dt.span`
|
|
44655
|
+
const DataBoxTitle$1 = dt.span`
|
|
44656
44656
|
font-size: 18px;
|
|
44657
44657
|
font-weight: 500;
|
|
44658
44658
|
`;
|
|
@@ -44702,7 +44702,7 @@ const LinnerDataBox = props => {
|
|
|
44702
44702
|
className,
|
|
44703
44703
|
customDataFormat
|
|
44704
44704
|
} = props;
|
|
44705
|
-
return /*#__PURE__*/React__default.createElement(LinnerContainer, {
|
|
44705
|
+
return /*#__PURE__*/React__default.createElement(LinnerContainer$1, {
|
|
44706
44706
|
className: className,
|
|
44707
44707
|
backgroundColor: backgroundColor,
|
|
44708
44708
|
width: width || "100%",
|
|
@@ -44711,7 +44711,7 @@ const LinnerDataBox = props => {
|
|
|
44711
44711
|
}, data.map((item, index) => /*#__PURE__*/React__default.createElement(DataBoxWrap, {
|
|
44712
44712
|
key: `${item.title}`,
|
|
44713
44713
|
width: `${100 / data.length}%`
|
|
44714
|
-
}, /*#__PURE__*/React__default.createElement(DataBox, null, item.title && /*#__PURE__*/React__default.createElement(DataBoxTitle, {
|
|
44714
|
+
}, /*#__PURE__*/React__default.createElement(DataBox$1, null, item.title && /*#__PURE__*/React__default.createElement(DataBoxTitle$1, {
|
|
44715
44715
|
className: "DataBoxTitle"
|
|
44716
44716
|
}, item.title), /*#__PURE__*/React__default.createElement(DataBoxContent, null, item.value !== null && item.value !== undefined && !isNaN(item.value) && item.value !== "null" && item.value !== "undefined" ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, item.sign && /*#__PURE__*/React__default.createElement(DataBoxContentSign, null, item.sign), customDataFormat ? /*#__PURE__*/React__default.createElement(DataBoxContentValue, {
|
|
44717
44717
|
className: "DataBoxValue"
|
|
@@ -45122,7 +45122,7 @@ const SagIconButtonWrapper = dt.button`
|
|
|
45122
45122
|
box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.1);
|
|
45123
45123
|
}
|
|
45124
45124
|
`;
|
|
45125
|
-
const SpanText = dt.span`
|
|
45125
|
+
const SpanText$1 = dt.span`
|
|
45126
45126
|
`;
|
|
45127
45127
|
|
|
45128
45128
|
const SagIconButton = props => {
|
|
@@ -45218,7 +45218,7 @@ const SagIconButton = props => {
|
|
|
45218
45218
|
onClick: event => {
|
|
45219
45219
|
onClickHandler(event);
|
|
45220
45220
|
}
|
|
45221
|
-
}, getIcon(iconName), buttonText && /*#__PURE__*/React__default.createElement(SpanText, null, buttonText));
|
|
45221
|
+
}, getIcon(iconName), buttonText && /*#__PURE__*/React__default.createElement(SpanText$1, null, buttonText));
|
|
45222
45222
|
};
|
|
45223
45223
|
SagIconButton.propTypes = {
|
|
45224
45224
|
className: PropTypes.string,
|
|
@@ -52794,7 +52794,7 @@ MonthPicker.defaultProps = {
|
|
|
52794
52794
|
selectedValue: ''
|
|
52795
52795
|
};
|
|
52796
52796
|
|
|
52797
|
-
const ControlsContainer$
|
|
52797
|
+
const ControlsContainer$7 = dt.div`
|
|
52798
52798
|
display: flex;
|
|
52799
52799
|
flex-direction: column;
|
|
52800
52800
|
justify-content: space-between;
|
|
@@ -53414,7 +53414,7 @@ const FilterPanel = props => {
|
|
|
53414
53414
|
}
|
|
53415
53415
|
return content;
|
|
53416
53416
|
};
|
|
53417
|
-
return /*#__PURE__*/React__default.createElement(ControlsContainer$
|
|
53417
|
+
return /*#__PURE__*/React__default.createElement(ControlsContainer$7, {
|
|
53418
53418
|
className: className,
|
|
53419
53419
|
height: height,
|
|
53420
53420
|
width: width,
|
|
@@ -53447,9 +53447,20 @@ FilterPanel.propTypes = {
|
|
|
53447
53447
|
availableMonths: PropTypes.arrayOf(PropTypes.string),
|
|
53448
53448
|
availableYears: PropTypes.arrayOf(PropTypes.string),
|
|
53449
53449
|
fieldsData: PropTypes.arrayOf(PropTypes.shape({
|
|
53450
|
+
disabled: PropTypes.bool,
|
|
53451
|
+
required: PropTypes.bool,
|
|
53452
|
+
inputType: PropTypes.string,
|
|
53453
|
+
placeHolder: PropTypes.string,
|
|
53454
|
+
xIconShow: PropTypes.bool,
|
|
53455
|
+
label: PropTypes.string,
|
|
53456
|
+
labelEmptyValue: PropTypes.string,
|
|
53450
53457
|
name: PropTypes.string,
|
|
53451
53458
|
value: PropTypes.number,
|
|
53452
|
-
color: PropTypes.string
|
|
53459
|
+
color: PropTypes.string,
|
|
53460
|
+
dropdownOptions: PropTypes.arrayOf(PropTypes.shape({
|
|
53461
|
+
value: PropTypes.string,
|
|
53462
|
+
label: PropTypes.string
|
|
53463
|
+
}))
|
|
53453
53464
|
})),
|
|
53454
53465
|
width: PropTypes.string,
|
|
53455
53466
|
height: PropTypes.string,
|
|
@@ -67082,7 +67093,7 @@ const scrollableStyles$3 = `
|
|
|
67082
67093
|
border-radius: 5px;
|
|
67083
67094
|
}
|
|
67084
67095
|
`;
|
|
67085
|
-
const ControlsContainer$
|
|
67096
|
+
const ControlsContainer$6 = dt.div`
|
|
67086
67097
|
position: relative;
|
|
67087
67098
|
font-family: "Poppins", sans-serif;
|
|
67088
67099
|
font-style: normal;
|
|
@@ -67101,7 +67112,7 @@ const ControlsContainer$5 = dt.div`
|
|
|
67101
67112
|
box-sizing: border-box;
|
|
67102
67113
|
}
|
|
67103
67114
|
`;
|
|
67104
|
-
const Controls$
|
|
67115
|
+
const Controls$4 = dt.div`
|
|
67105
67116
|
display: flex;
|
|
67106
67117
|
flex-direction: column;
|
|
67107
67118
|
width: 100%;
|
|
@@ -67112,7 +67123,7 @@ const TitleAndValueContainer$3 = dt.div`
|
|
|
67112
67123
|
display: flex;
|
|
67113
67124
|
flex-direction: column;
|
|
67114
67125
|
`;
|
|
67115
|
-
const Title$
|
|
67126
|
+
const Title$9 = dt.h4`
|
|
67116
67127
|
font-weight: 400;
|
|
67117
67128
|
font-size: 20px;
|
|
67118
67129
|
margin: 0;
|
|
@@ -67164,18 +67175,18 @@ const FormattedValue$2 = props => {
|
|
|
67164
67175
|
textcolor,
|
|
67165
67176
|
isPercent
|
|
67166
67177
|
} = props;
|
|
67167
|
-
return /*#__PURE__*/React__default.createElement(ControlsContainer$
|
|
67178
|
+
return /*#__PURE__*/React__default.createElement(ControlsContainer$6, {
|
|
67168
67179
|
className: className || 'FormattedValue_ControlsContainer',
|
|
67169
67180
|
height: height,
|
|
67170
67181
|
width: width,
|
|
67171
67182
|
textcolor: textcolor
|
|
67172
|
-
}, /*#__PURE__*/React__default.createElement(Controls$
|
|
67183
|
+
}, /*#__PURE__*/React__default.createElement(Controls$4, {
|
|
67173
67184
|
className: "Controls",
|
|
67174
67185
|
height: height,
|
|
67175
67186
|
width: width
|
|
67176
67187
|
}, /*#__PURE__*/React__default.createElement(TitleAndValueContainer$3, {
|
|
67177
67188
|
className: "TitleAndValueContainer"
|
|
67178
|
-
}, title ? /*#__PURE__*/React__default.createElement(Title$
|
|
67189
|
+
}, title ? /*#__PURE__*/React__default.createElement(Title$9, {
|
|
67179
67190
|
className: "Title",
|
|
67180
67191
|
width: width
|
|
67181
67192
|
}, title) : '', showTopValue && /*#__PURE__*/React__default.createElement(CurrencySignAndFormattedValueContainer$1, {
|
|
@@ -67187,7 +67198,7 @@ const FormattedValue$2 = props => {
|
|
|
67187
67198
|
className: "CurrencySignOrPercent"
|
|
67188
67199
|
}, currencySign ? getCurrencySign(currencyType, value) : ''), dotCut ? getFormattedValue(value && Math.abs(value) > 0 && value % 1 !== 0 ? value?.toFixed(2) : value) : getNumberWithCommas(value), dotCut ? getFormattedUnits(value) : '', /*#__PURE__*/React__default.createElement(CurrencySignOrPercent, {
|
|
67189
67200
|
className: "CurrencySignOrPercent"
|
|
67190
|
-
}, isPercent ? '%' : ''))), subtitle ? /*#__PURE__*/React__default.createElement(Title$
|
|
67201
|
+
}, isPercent ? '%' : ''))), subtitle ? /*#__PURE__*/React__default.createElement(Title$9, {
|
|
67191
67202
|
className: "Title",
|
|
67192
67203
|
width: width
|
|
67193
67204
|
}, subtitle) : '')));
|
|
@@ -67221,7 +67232,7 @@ FormattedValue$2.defaultProps = {
|
|
|
67221
67232
|
isPercent: false
|
|
67222
67233
|
};
|
|
67223
67234
|
|
|
67224
|
-
const ControlsContainer$
|
|
67235
|
+
const ControlsContainer$5 = dt.div`
|
|
67225
67236
|
position: relative;
|
|
67226
67237
|
font-family: "Poppins", sans-serif;
|
|
67227
67238
|
color: #212121;
|
|
@@ -67229,27 +67240,27 @@ const ControlsContainer$4 = dt.div`
|
|
|
67229
67240
|
height: ${props => props.height};
|
|
67230
67241
|
min-width: 250px;
|
|
67231
67242
|
`;
|
|
67232
|
-
const Controls$
|
|
67243
|
+
const Controls$3 = dt.div`
|
|
67233
67244
|
height: 100%;
|
|
67234
67245
|
width: 100%;
|
|
67235
67246
|
background: white;
|
|
67236
67247
|
display: flex;
|
|
67237
67248
|
flex-direction: column;
|
|
67238
67249
|
`;
|
|
67239
|
-
const TooltipDiv$
|
|
67250
|
+
const TooltipDiv$2 = dt.div`
|
|
67240
67251
|
border-radius: 5px;
|
|
67241
67252
|
padding: 8px 12px;
|
|
67242
67253
|
background: white;
|
|
67243
67254
|
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);
|
|
67244
67255
|
margin: 0;
|
|
67245
67256
|
`;
|
|
67246
|
-
const TooltipLabel$
|
|
67257
|
+
const TooltipLabel$2 = dt.div`
|
|
67247
67258
|
color: #212121;
|
|
67248
67259
|
font-size: 14px;
|
|
67249
67260
|
font-weight: 400;
|
|
67250
67261
|
width: fit-content;
|
|
67251
67262
|
`;
|
|
67252
|
-
const TooltipTitle = dt.div`
|
|
67263
|
+
const TooltipTitle$1 = dt.div`
|
|
67253
67264
|
color: #212121;
|
|
67254
67265
|
font-size: 14px;
|
|
67255
67266
|
font-weight: 600;
|
|
@@ -67257,7 +67268,7 @@ const TooltipTitle = dt.div`
|
|
|
67257
67268
|
const TitleAndValueContainer$2 = dt.div`
|
|
67258
67269
|
padding: 0 1rem;
|
|
67259
67270
|
`;
|
|
67260
|
-
const Title$
|
|
67271
|
+
const Title$8 = dt.h5`
|
|
67261
67272
|
font-weight: 500;
|
|
67262
67273
|
font-size: 18px;
|
|
67263
67274
|
line-height: 20px;
|
|
@@ -67344,7 +67355,7 @@ const LegendLineIcon = ({
|
|
|
67344
67355
|
fill: color
|
|
67345
67356
|
}));
|
|
67346
67357
|
|
|
67347
|
-
const ControlsContainer$
|
|
67358
|
+
const ControlsContainer$4 = dt.div`
|
|
67348
67359
|
position: relative;
|
|
67349
67360
|
font-family: "Poppins", sans-serif;
|
|
67350
67361
|
font-size: ${props => props.rootFont};
|
|
@@ -67356,7 +67367,7 @@ const ControlsContainer$3 = dt.div`
|
|
|
67356
67367
|
box-sizing: border-box;
|
|
67357
67368
|
}
|
|
67358
67369
|
`;
|
|
67359
|
-
const Controls$
|
|
67370
|
+
const Controls$2 = dt.div`
|
|
67360
67371
|
display: flex;
|
|
67361
67372
|
gap: 20px;
|
|
67362
67373
|
flex-direction: column;
|
|
@@ -67380,7 +67391,7 @@ const TitleAndIconContainer = dt.div`
|
|
|
67380
67391
|
display: flex;
|
|
67381
67392
|
align-items: center;
|
|
67382
67393
|
`;
|
|
67383
|
-
const Title$
|
|
67394
|
+
const Title$7 = dt.h4`
|
|
67384
67395
|
font-weight: 400;
|
|
67385
67396
|
font-size: 14px;
|
|
67386
67397
|
line-height: 27px;
|
|
@@ -67401,9 +67412,9 @@ const LegendColorRectangle$1 = dt.div`
|
|
|
67401
67412
|
`;
|
|
67402
67413
|
|
|
67403
67414
|
/* eslint-disable no-nested-ternary */
|
|
67404
|
-
const ICON_TYPE_SQUARE$
|
|
67405
|
-
const ICON_TYPE_LEGEND_UNION_ICON$
|
|
67406
|
-
const ICON_TYPE_LEGEND_LINE_ICON$
|
|
67415
|
+
const ICON_TYPE_SQUARE$2 = 'Square';
|
|
67416
|
+
const ICON_TYPE_LEGEND_UNION_ICON$2 = 'LegendUnionIcon';
|
|
67417
|
+
const ICON_TYPE_LEGEND_LINE_ICON$2 = 'LegendLineIcon';
|
|
67407
67418
|
const PerformanceAnalyticsLegend = props => {
|
|
67408
67419
|
const {
|
|
67409
67420
|
className,
|
|
@@ -67411,26 +67422,26 @@ const PerformanceAnalyticsLegend = props => {
|
|
|
67411
67422
|
width,
|
|
67412
67423
|
height
|
|
67413
67424
|
} = props;
|
|
67414
|
-
return /*#__PURE__*/React__default.createElement(ControlsContainer$
|
|
67425
|
+
return /*#__PURE__*/React__default.createElement(ControlsContainer$4, {
|
|
67415
67426
|
className: className,
|
|
67416
67427
|
height: height,
|
|
67417
67428
|
width: width
|
|
67418
|
-
}, legendData?.length > 0 ? /*#__PURE__*/React__default.createElement(Controls$
|
|
67429
|
+
}, legendData?.length > 0 ? /*#__PURE__*/React__default.createElement(Controls$2, {
|
|
67419
67430
|
height: height,
|
|
67420
67431
|
width: width
|
|
67421
67432
|
}, /*#__PURE__*/React__default.createElement(LegendDataContainer, {
|
|
67422
67433
|
id: "LegendDataContainer"
|
|
67423
67434
|
}, legendData?.map((item, i) => /*#__PURE__*/React__default.createElement(TitleAndIconContainer, {
|
|
67424
67435
|
key: `${item.title + i}`
|
|
67425
|
-
}, item.iconType === ICON_TYPE_SQUARE$
|
|
67436
|
+
}, item.iconType === ICON_TYPE_SQUARE$2 ? /*#__PURE__*/React__default.createElement(LegendColorRectangle$1, {
|
|
67426
67437
|
color: item.iconColor
|
|
67427
|
-
}) : item.iconType === ICON_TYPE_LEGEND_UNION_ICON$
|
|
67438
|
+
}) : item.iconType === ICON_TYPE_LEGEND_UNION_ICON$2 ? /*#__PURE__*/React__default.createElement(LegendUnionIcon, {
|
|
67428
67439
|
width: 30,
|
|
67429
67440
|
height: 30,
|
|
67430
67441
|
color: item.iconColor
|
|
67431
|
-
}) : item.iconType === ICON_TYPE_LEGEND_LINE_ICON$
|
|
67442
|
+
}) : item.iconType === ICON_TYPE_LEGEND_LINE_ICON$2 ? /*#__PURE__*/React__default.createElement(LegendLineIcon, {
|
|
67432
67443
|
color: item.iconColor
|
|
67433
|
-
}) : '', /*#__PURE__*/React__default.createElement(Title$
|
|
67444
|
+
}) : '', /*#__PURE__*/React__default.createElement(Title$7, {
|
|
67434
67445
|
id: "Title",
|
|
67435
67446
|
width: width
|
|
67436
67447
|
}, item.title))))) : '');
|
|
@@ -67441,7 +67452,7 @@ PerformanceAnalyticsLegend.propTypes = {
|
|
|
67441
67452
|
height: PropTypes.string,
|
|
67442
67453
|
legendData: PropTypes.arrayOf(PropTypes.shape({
|
|
67443
67454
|
title: PropTypes.string.isRequired,
|
|
67444
|
-
iconType: PropTypes.oneOf([ICON_TYPE_SQUARE$
|
|
67455
|
+
iconType: PropTypes.oneOf([ICON_TYPE_SQUARE$2, ICON_TYPE_LEGEND_UNION_ICON$2, ICON_TYPE_LEGEND_LINE_ICON$2]).isRequired,
|
|
67445
67456
|
iconColor: PropTypes.string.isRequired
|
|
67446
67457
|
}))
|
|
67447
67458
|
};
|
|
@@ -67451,15 +67462,15 @@ PerformanceAnalyticsLegend.defaultProps = {
|
|
|
67451
67462
|
height: '',
|
|
67452
67463
|
legendData: [{
|
|
67453
67464
|
title: '',
|
|
67454
|
-
iconType: ICON_TYPE_SQUARE$
|
|
67465
|
+
iconType: ICON_TYPE_SQUARE$2,
|
|
67455
67466
|
iconColor: '#1F7677'
|
|
67456
67467
|
}]
|
|
67457
67468
|
};
|
|
67458
67469
|
|
|
67459
67470
|
/* eslint-disable no-nested-ternary */
|
|
67460
|
-
const ICON_TYPE_SQUARE = 'Square';
|
|
67461
|
-
const ICON_TYPE_LEGEND_UNION_ICON = 'LegendUnionIcon';
|
|
67462
|
-
const ICON_TYPE_LEGEND_LINE_ICON = 'LegendLineIcon';
|
|
67471
|
+
const ICON_TYPE_SQUARE$1 = 'Square';
|
|
67472
|
+
const ICON_TYPE_LEGEND_UNION_ICON$1 = 'LegendUnionIcon';
|
|
67473
|
+
const ICON_TYPE_LEGEND_LINE_ICON$1 = 'LegendLineIcon';
|
|
67463
67474
|
const BarChartsByWeeks = props => {
|
|
67464
67475
|
const {
|
|
67465
67476
|
className,
|
|
@@ -67548,9 +67559,9 @@ const BarChartsByWeeks = props => {
|
|
|
67548
67559
|
let currentTooltipSecondValue = 0;
|
|
67549
67560
|
if (payload[0].payload?.value) currentTooltipValue = payload[0].payload?.value;
|
|
67550
67561
|
if (payload[0].payload?.secondValue) currentTooltipSecondValue = payload[0].payload?.secondValue;
|
|
67551
|
-
return /*#__PURE__*/React__default.createElement(TooltipDiv$
|
|
67562
|
+
return /*#__PURE__*/React__default.createElement(TooltipDiv$2, null, /*#__PURE__*/React__default.createElement(TooltipTitle$1, null, `${isTitleOriganal ? '' : 'Week: '}${week}`), /*#__PURE__*/React__default.createElement(TooltipLabel$2, null, `${tooltipTitle}
|
|
67552
67563
|
${displayFormattedValue(currentTooltipValue)}
|
|
67553
|
-
`), currentTooltipSecondValue ? /*#__PURE__*/React__default.createElement(TooltipLabel$
|
|
67564
|
+
`), currentTooltipSecondValue ? /*#__PURE__*/React__default.createElement(TooltipLabel$2, null, `${tooltipSecondTitle}
|
|
67554
67565
|
${displayFormattedValue(currentTooltipSecondValue)}
|
|
67555
67566
|
`) : '');
|
|
67556
67567
|
};
|
|
@@ -67598,14 +67609,14 @@ const BarChartsByWeeks = props => {
|
|
|
67598
67609
|
}
|
|
67599
67610
|
return `${newHeight}px`;
|
|
67600
67611
|
};
|
|
67601
|
-
return /*#__PURE__*/React__default.createElement(ControlsContainer$
|
|
67612
|
+
return /*#__PURE__*/React__default.createElement(ControlsContainer$5, {
|
|
67602
67613
|
className: className,
|
|
67603
67614
|
height: height,
|
|
67604
67615
|
width: width,
|
|
67605
67616
|
ref: controlsContainerRef
|
|
67606
|
-
}, /*#__PURE__*/React__default.createElement(Controls$
|
|
67617
|
+
}, /*#__PURE__*/React__default.createElement(Controls$3, {
|
|
67607
67618
|
height: getControlsHeight()
|
|
67608
|
-
}, showTitle && /*#__PURE__*/React__default.createElement(TitleAndValueContainer$2, null, /*#__PURE__*/React__default.createElement(Title$
|
|
67619
|
+
}, showTitle && /*#__PURE__*/React__default.createElement(TitleAndValueContainer$2, null, /*#__PURE__*/React__default.createElement(Title$8, null, title), /*#__PURE__*/React__default.createElement(FormattedValue$2, {
|
|
67609
67620
|
title: headerValueTopTitle,
|
|
67610
67621
|
subtitle: headerValueBottomTitle,
|
|
67611
67622
|
showTopValue: showHeaderTopValue,
|
|
@@ -67616,7 +67627,7 @@ const BarChartsByWeeks = props => {
|
|
|
67616
67627
|
})), /*#__PURE__*/React__default.createElement(ResponsiveContainer, {
|
|
67617
67628
|
width: "100%",
|
|
67618
67629
|
height: "100%"
|
|
67619
|
-
}, /*#__PURE__*/React__default.createElement(BarChart, {
|
|
67630
|
+
}, /*#__PURE__*/React__default.createElement(BarChart$1, {
|
|
67620
67631
|
width: width,
|
|
67621
67632
|
height: height,
|
|
67622
67633
|
data: formmatedData,
|
|
@@ -67700,7 +67711,7 @@ BarChartsByWeeks.propTypes = {
|
|
|
67700
67711
|
showLegend: PropTypes.bool,
|
|
67701
67712
|
legendData: PropTypes.arrayOf(PropTypes.shape({
|
|
67702
67713
|
title: PropTypes.string.isRequired,
|
|
67703
|
-
iconType: PropTypes.oneOf([ICON_TYPE_SQUARE, ICON_TYPE_LEGEND_UNION_ICON, ICON_TYPE_LEGEND_LINE_ICON]).isRequired,
|
|
67714
|
+
iconType: PropTypes.oneOf([ICON_TYPE_SQUARE$1, ICON_TYPE_LEGEND_UNION_ICON$1, ICON_TYPE_LEGEND_LINE_ICON$1]).isRequired,
|
|
67704
67715
|
iconColor: PropTypes.string.isRequired
|
|
67705
67716
|
})),
|
|
67706
67717
|
showTwoBars: PropTypes.bool,
|
|
@@ -67764,11 +67775,11 @@ BarChartsByWeeks.defaultProps = {
|
|
|
67764
67775
|
isTitleOriganal: false,
|
|
67765
67776
|
legendData: [{
|
|
67766
67777
|
title: 'Sales',
|
|
67767
|
-
iconType: ICON_TYPE_SQUARE,
|
|
67778
|
+
iconType: ICON_TYPE_SQUARE$1,
|
|
67768
67779
|
iconColor: '#90CE9C'
|
|
67769
67780
|
}, {
|
|
67770
67781
|
title: 'Category Average',
|
|
67771
|
-
iconType: ICON_TYPE_LEGEND_LINE_ICON,
|
|
67782
|
+
iconType: ICON_TYPE_LEGEND_LINE_ICON$1,
|
|
67772
67783
|
iconColor: '#C906FD'
|
|
67773
67784
|
}],
|
|
67774
67785
|
showTwoBars: false,
|
|
@@ -67793,7 +67804,7 @@ const scrollableStyles$2 = `
|
|
|
67793
67804
|
border-radius: 5px;
|
|
67794
67805
|
}
|
|
67795
67806
|
`;
|
|
67796
|
-
const ControlsContainer$
|
|
67807
|
+
const ControlsContainer$3 = dt.div`
|
|
67797
67808
|
position: relative;
|
|
67798
67809
|
font-family: "Poppins", sans-serif;
|
|
67799
67810
|
font-style: normal;
|
|
@@ -67812,7 +67823,7 @@ const ControlsContainer$2 = dt.div`
|
|
|
67812
67823
|
box-sizing: border-box;
|
|
67813
67824
|
}
|
|
67814
67825
|
`;
|
|
67815
|
-
const Controls = dt.div`
|
|
67826
|
+
const Controls$1 = dt.div`
|
|
67816
67827
|
display: flex;
|
|
67817
67828
|
flex-direction: column;
|
|
67818
67829
|
width: 100%;
|
|
@@ -67820,7 +67831,7 @@ const Controls = dt.div`
|
|
|
67820
67831
|
background: white;
|
|
67821
67832
|
border-radius: 12px;
|
|
67822
67833
|
`;
|
|
67823
|
-
const TooltipDiv = dt.div`
|
|
67834
|
+
const TooltipDiv$1 = dt.div`
|
|
67824
67835
|
display: flex;
|
|
67825
67836
|
background: white;
|
|
67826
67837
|
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);
|
|
@@ -67828,7 +67839,7 @@ const TooltipDiv = dt.div`
|
|
|
67828
67839
|
padding: 6px 10px;
|
|
67829
67840
|
margin: 0;
|
|
67830
67841
|
`;
|
|
67831
|
-
const TooltipLabel = dt.p`
|
|
67842
|
+
const TooltipLabel$1 = dt.p`
|
|
67832
67843
|
color: #212121;
|
|
67833
67844
|
font-family: "Poppins", sans-serif;
|
|
67834
67845
|
font-size: 12px;
|
|
@@ -67843,7 +67854,7 @@ const TitleAndValueContainer$1 = dt.div`
|
|
|
67843
67854
|
flex-direction: column;
|
|
67844
67855
|
padding: 0 20px;
|
|
67845
67856
|
`;
|
|
67846
|
-
const Title$
|
|
67857
|
+
const Title$6 = dt.h4`
|
|
67847
67858
|
font-weight: 500;
|
|
67848
67859
|
font-size: 1rem;
|
|
67849
67860
|
margin: 0;
|
|
@@ -68022,7 +68033,7 @@ const TotalDoughnutChart = props => {
|
|
|
68022
68033
|
fontWeight: itemsBoldedValues ? '700' : '400'
|
|
68023
68034
|
}
|
|
68024
68035
|
}, ' (', `${Math.round(row.value / value * 100)}%)`), isPercent && row.value && `${row.value.toFixed(1)}%`);
|
|
68025
|
-
return /*#__PURE__*/React__default.createElement(ControlsContainer$
|
|
68036
|
+
return /*#__PURE__*/React__default.createElement(ControlsContainer$3, {
|
|
68026
68037
|
className: className,
|
|
68027
68038
|
height: height,
|
|
68028
68039
|
width: width,
|
|
@@ -68030,13 +68041,13 @@ const TotalDoughnutChart = props => {
|
|
|
68030
68041
|
}, legendData.length === 0 || legendData.every(item => item.value === undefined || item.value === null) ? /*#__PURE__*/React__default.createElement(NoDataFoundMessage, {
|
|
68031
68042
|
className: "NoDataFoundMessage",
|
|
68032
68043
|
noDataText: noDataText
|
|
68033
|
-
}) : /*#__PURE__*/React__default.createElement(Controls, {
|
|
68044
|
+
}) : /*#__PURE__*/React__default.createElement(Controls$1, {
|
|
68034
68045
|
className: "Controls",
|
|
68035
68046
|
height: height,
|
|
68036
68047
|
width: width
|
|
68037
68048
|
}, !hideTitleAndValue && /*#__PURE__*/React__default.createElement(TitleAndValueContainer$1, {
|
|
68038
68049
|
className: "TitleAndValueContainer"
|
|
68039
|
-
}, /*#__PURE__*/React__default.createElement(Title$
|
|
68050
|
+
}, /*#__PURE__*/React__default.createElement(Title$6, {
|
|
68040
68051
|
className: "Title"
|
|
68041
68052
|
}, title), /*#__PURE__*/React__default.createElement(CurrencySignAndFormattedValueContainer, {
|
|
68042
68053
|
className: "CurrencySignAndFormattedValueContainer"
|
|
@@ -68131,7 +68142,7 @@ function CustomTooltip(_ref) {
|
|
|
68131
68142
|
if (active && payload && payload.length) {
|
|
68132
68143
|
// eslint-disable-next-line no-nested-ternary
|
|
68133
68144
|
const percent = value && value !== 0 && !isPercent ? (payload[0].value / value * 100).toFixed(1) : value && isPercent ? payload[0].value.toFixed(1) : 0;
|
|
68134
|
-
return /*#__PURE__*/React__default.createElement(TooltipDiv, null, /*#__PURE__*/React__default.createElement(TooltipLabel, null, `${payload[0].name} ${percent}%`));
|
|
68145
|
+
return /*#__PURE__*/React__default.createElement(TooltipDiv$1, null, /*#__PURE__*/React__default.createElement(TooltipLabel$1, null, `${payload[0].name} ${percent}%`));
|
|
68135
68146
|
}
|
|
68136
68147
|
}
|
|
68137
68148
|
CustomTooltip.propTypes = {
|
|
@@ -68280,7 +68291,7 @@ Tooltip.defaultProps = {
|
|
|
68280
68291
|
content: ''
|
|
68281
68292
|
};
|
|
68282
68293
|
|
|
68283
|
-
const ControlsContainer$
|
|
68294
|
+
const ControlsContainer$2 = dt.div`
|
|
68284
68295
|
font-family: "Poppins", sans-serif;
|
|
68285
68296
|
background-color: white;
|
|
68286
68297
|
color: ${props => props.textColor};
|
|
@@ -68343,7 +68354,7 @@ const TotalValue = dt.div`
|
|
|
68343
68354
|
font-size: 20px;
|
|
68344
68355
|
}
|
|
68345
68356
|
`;
|
|
68346
|
-
const Title$
|
|
68357
|
+
const Title$5 = dt.h4`
|
|
68347
68358
|
font-size: 18px;
|
|
68348
68359
|
font-weight: 400;
|
|
68349
68360
|
line-height: 1;
|
|
@@ -68490,7 +68501,7 @@ const TotalHorizontalCharts = props => {
|
|
|
68490
68501
|
}
|
|
68491
68502
|
return null;
|
|
68492
68503
|
};
|
|
68493
|
-
return /*#__PURE__*/React__default.createElement(ControlsContainer$
|
|
68504
|
+
return /*#__PURE__*/React__default.createElement(ControlsContainer$2, {
|
|
68494
68505
|
ref: wrapper,
|
|
68495
68506
|
height: height,
|
|
68496
68507
|
width: width,
|
|
@@ -68500,14 +68511,14 @@ const TotalHorizontalCharts = props => {
|
|
|
68500
68511
|
}, chartsData?.length > 0 ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !hideTitle || !hideTotalValue ? /*#__PURE__*/React__default.createElement(CardHeader, {
|
|
68501
68512
|
ref: topHeader,
|
|
68502
68513
|
className: "CardHeader"
|
|
68503
|
-
}, !hideTitle ? /*#__PURE__*/React__default.createElement(Title$
|
|
68514
|
+
}, !hideTitle ? /*#__PURE__*/React__default.createElement(Title$5, null, title) : '', !hideTotalValue ? /*#__PURE__*/React__default.createElement(TotalValue, {
|
|
68504
68515
|
className: "TotalValue"
|
|
68505
68516
|
}, currencySign && /*#__PURE__*/React__default.createElement(CurrencySign, {
|
|
68506
68517
|
className: "CurrencySign"
|
|
68507
68518
|
}, getCurrencySign(currencyType, value)), dotCut ? getFormattedValue(value && Math.abs(value) > 0 && value % 1 !== 0 ? value?.toFixed(2) : value) : getNumberWithCommas(value), dotCut ? getFormattedUnits(value) : '') : '') : '', /*#__PURE__*/React__default.createElement(ResponsiveContainer, {
|
|
68508
68519
|
width: "100%",
|
|
68509
68520
|
height: calculateChartHeight()
|
|
68510
|
-
}, /*#__PURE__*/React__default.createElement(BarChart, {
|
|
68521
|
+
}, /*#__PURE__*/React__default.createElement(BarChart$1, {
|
|
68511
68522
|
layout: "vertical",
|
|
68512
68523
|
data: chartsData,
|
|
68513
68524
|
margin: {
|
|
@@ -68609,7 +68620,7 @@ TotalHorizontalCharts.defaultProps = {
|
|
|
68609
68620
|
hideTitle: false
|
|
68610
68621
|
};
|
|
68611
68622
|
|
|
68612
|
-
const ControlsContainer = dt.div`
|
|
68623
|
+
const ControlsContainer$1 = dt.div`
|
|
68613
68624
|
// position: relative;
|
|
68614
68625
|
display: flex;
|
|
68615
68626
|
flex-direction: column;
|
|
@@ -68640,7 +68651,7 @@ const ItemContainer = dt.div`
|
|
|
68640
68651
|
flex-direction: column;
|
|
68641
68652
|
flex-wrap: wrap;
|
|
68642
68653
|
`;
|
|
68643
|
-
const Title$
|
|
68654
|
+
const Title$4 = dt.h4`
|
|
68644
68655
|
font-size: 18px;
|
|
68645
68656
|
font-weight: 500;
|
|
68646
68657
|
margin: 0;
|
|
@@ -68748,7 +68759,7 @@ const SalesAndROI = props => {
|
|
|
68748
68759
|
}, /*#__PURE__*/React__default.createElement(TextBeforeAndAfterValue, {
|
|
68749
68760
|
id: "TextBeforeAndAfterValue"
|
|
68750
68761
|
}, getTextBefore(dataItem)), dotCut ? getFormattedValue(dataItem.value && Math.abs(dataItem.value) > 0 && dataItem.value % 1 !== 0 ? dataItem.value?.toFixed(2) : dataItem.value) : getNumberWithCommas(dataItem.value), dotCut ? getFormattedUnits(dataItem.value) : '', /*#__PURE__*/React__default.createElement(TextBeforeAndAfterValue, null, dataItem.textAfter)));
|
|
68751
|
-
return /*#__PURE__*/React__default.createElement(ControlsContainer, {
|
|
68762
|
+
return /*#__PURE__*/React__default.createElement(ControlsContainer$1, {
|
|
68752
68763
|
id: "ControlsContainer",
|
|
68753
68764
|
height: height,
|
|
68754
68765
|
width: width,
|
|
@@ -68756,7 +68767,7 @@ const SalesAndROI = props => {
|
|
|
68756
68767
|
showBorderShadow: showBorderShadow
|
|
68757
68768
|
}, /*#__PURE__*/React__default.createElement(TitleAndValueContainer, {
|
|
68758
68769
|
id: "TitleAndValueContainer"
|
|
68759
|
-
}, /*#__PURE__*/React__default.createElement(Title$
|
|
68770
|
+
}, /*#__PURE__*/React__default.createElement(Title$4, {
|
|
68760
68771
|
id: "Title"
|
|
68761
68772
|
}, title), showBanner && /*#__PURE__*/React__default.createElement(OutBanner, {
|
|
68762
68773
|
id: "OutBanner",
|
|
@@ -68855,7 +68866,7 @@ const TitleContainer$1 = dt.div`
|
|
|
68855
68866
|
margin: 0;
|
|
68856
68867
|
border-bottom: 1px solid #b1b1b1;
|
|
68857
68868
|
`;
|
|
68858
|
-
const Title$
|
|
68869
|
+
const Title$3 = dt.p`
|
|
68859
68870
|
font-weight: 400;
|
|
68860
68871
|
font-size: 24px;
|
|
68861
68872
|
margin: 0;
|
|
@@ -69075,7 +69086,7 @@ const PopupCharts = props => {
|
|
|
69075
69086
|
height: height,
|
|
69076
69087
|
width: width,
|
|
69077
69088
|
onClick: e => e.stopPropagation()
|
|
69078
|
-
}, /*#__PURE__*/React__default.createElement(TitleContainer$1, null, /*#__PURE__*/React__default.createElement(Title$
|
|
69089
|
+
}, /*#__PURE__*/React__default.createElement(TitleContainer$1, null, /*#__PURE__*/React__default.createElement(Title$3, null, title), /*#__PURE__*/React__default.createElement(CloseXIconContainer, {
|
|
69079
69090
|
onClick: e => closePopupCharts(e)
|
|
69080
69091
|
}, /*#__PURE__*/React__default.createElement(CloseXIcon, null))), /*#__PURE__*/React__default.createElement(ChartsContainer, {
|
|
69081
69092
|
id: "ChartsContainer",
|
|
@@ -69173,7 +69184,7 @@ const TopToggleListMainContainer = dt.div`
|
|
|
69173
69184
|
padding: 0 24px;
|
|
69174
69185
|
width: ${props => props.width};
|
|
69175
69186
|
`;
|
|
69176
|
-
const Title$
|
|
69187
|
+
const Title$2 = dt.h4`
|
|
69177
69188
|
font-size: 14px;
|
|
69178
69189
|
font-weight: 600;
|
|
69179
69190
|
margin: 20px 0 12px;
|
|
@@ -69203,7 +69214,7 @@ const TopToggleList = props => {
|
|
|
69203
69214
|
} = props;
|
|
69204
69215
|
return /*#__PURE__*/React__default.createElement(TopToggleListMainContainer, {
|
|
69205
69216
|
width: width
|
|
69206
|
-
}, /*#__PURE__*/React__default.createElement(Title$
|
|
69217
|
+
}, /*#__PURE__*/React__default.createElement(Title$2, null, title), /*#__PURE__*/React__default.createElement(ListContainer, {
|
|
69207
69218
|
height: height
|
|
69208
69219
|
}, list.map(item => /*#__PURE__*/React__default.createElement(ListItem, {
|
|
69209
69220
|
key: item.value
|
|
@@ -80658,7 +80669,7 @@ const TitleContainer = dt.div`
|
|
|
80658
80669
|
justify-content: flex-start;
|
|
80659
80670
|
margin: 0 0 10px 0;
|
|
80660
80671
|
`;
|
|
80661
|
-
const Title = dt.h3`
|
|
80672
|
+
const Title$1 = dt.h3`
|
|
80662
80673
|
user-select: none;
|
|
80663
80674
|
text-align: left;
|
|
80664
80675
|
margin: 0;
|
|
@@ -80933,7 +80944,7 @@ const Heatmap = props => {
|
|
|
80933
80944
|
className: "HeatmapWrapper"
|
|
80934
80945
|
}, /*#__PURE__*/React__default.createElement(TitleContainer, {
|
|
80935
80946
|
className: "TitleContainer"
|
|
80936
|
-
}, /*#__PURE__*/React__default.createElement(Title, {
|
|
80947
|
+
}, /*#__PURE__*/React__default.createElement(Title$1, {
|
|
80937
80948
|
className: "Title"
|
|
80938
80949
|
}, title)), refreshRequired && renderBars(), !refreshRequired && renderBars(), renderLegend()));
|
|
80939
80950
|
};
|
|
@@ -80948,5 +80959,698 @@ Heatmap.propTypes = {
|
|
|
80948
80959
|
barHeight: PropTypes.string.isRequired
|
|
80949
80960
|
};
|
|
80950
80961
|
|
|
80951
|
-
|
|
80962
|
+
const ButtonWrapper = dt.div`
|
|
80963
|
+
width: fit-content;
|
|
80964
|
+
text-align: center;
|
|
80965
|
+
`;
|
|
80966
|
+
const IconButtonContainer = dt.a`
|
|
80967
|
+
font-size: 14px;
|
|
80968
|
+
font-weight: 400;
|
|
80969
|
+
display: flex;
|
|
80970
|
+
gap: 10px;
|
|
80971
|
+
align-items: center;
|
|
80972
|
+
justify-content: center;
|
|
80973
|
+
padding: 12px 20px;
|
|
80974
|
+
text-decoration: none;
|
|
80975
|
+
color: ${props => props.color};
|
|
80976
|
+
border-radius: ${props => props.borderRadius};
|
|
80977
|
+
border: 1px solid ${props => props.borderColor.toString()};
|
|
80978
|
+
background: ${props => props.backgroundColor.toString()};
|
|
80979
|
+
position: relative;
|
|
80980
|
+
transition: all .3s;
|
|
80981
|
+
${props => props.inProgress && lt`
|
|
80982
|
+
pointer-events: none;
|
|
80983
|
+
&:after {
|
|
80984
|
+
content: 'In progress';
|
|
80985
|
+
display: flex;
|
|
80986
|
+
align-items: center;
|
|
80987
|
+
justify-content: center;
|
|
80988
|
+
text-wrap: nowrap;
|
|
80989
|
+
position: absolute;
|
|
80990
|
+
background: linear-gradient(
|
|
80991
|
+
to right,
|
|
80992
|
+
#5FCC70 ${props.progress}%,
|
|
80993
|
+
#B1B1B1 ${props.progress + 1}%,
|
|
80994
|
+
#B1B1B1 100%
|
|
80995
|
+
);
|
|
80996
|
+
width: 100%;
|
|
80997
|
+
height: 100%;
|
|
80998
|
+
border-radius: ${props => props.borderRadius};
|
|
80999
|
+
border-width: 0;
|
|
81000
|
+
z-index: 9;
|
|
81001
|
+
}
|
|
81002
|
+
`}
|
|
81003
|
+
&:hover, &:focus {
|
|
81004
|
+
cursor: pointer;
|
|
81005
|
+
box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.1);
|
|
81006
|
+
}
|
|
81007
|
+
`;
|
|
81008
|
+
const SpanText = dt.span`
|
|
81009
|
+
`;
|
|
81010
|
+
const CancelClick = dt.span`
|
|
81011
|
+
display: inherit;
|
|
81012
|
+
font-family: "Lato", sans-serif;;
|
|
81013
|
+
font-size: 14px;
|
|
81014
|
+
color: #568202;
|
|
81015
|
+
cursor: pointer;
|
|
81016
|
+
margin-top: 5px;
|
|
81017
|
+
`;
|
|
81018
|
+
|
|
81019
|
+
/* IconButton */
|
|
81020
|
+
const IconButton = props => {
|
|
81021
|
+
const {
|
|
81022
|
+
// downloadStatus,
|
|
81023
|
+
// fileName,
|
|
81024
|
+
fileLink,
|
|
81025
|
+
showProcess,
|
|
81026
|
+
contentColor,
|
|
81027
|
+
buttonText,
|
|
81028
|
+
backgroundColor,
|
|
81029
|
+
borderColor,
|
|
81030
|
+
borderRadius,
|
|
81031
|
+
iconName,
|
|
81032
|
+
iconWidth,
|
|
81033
|
+
iconHeight,
|
|
81034
|
+
disabled,
|
|
81035
|
+
onClick,
|
|
81036
|
+
onCancelClick
|
|
81037
|
+
} = props;
|
|
81038
|
+
const [progress, setProgress] = useState(0);
|
|
81039
|
+
let interval;
|
|
81040
|
+
const incrementProgress = () => {
|
|
81041
|
+
if (showProcess && progress <= 90) {
|
|
81042
|
+
interval = setInterval(() => {
|
|
81043
|
+
setProgress(prevProgress => {
|
|
81044
|
+
const newProgress = prevProgress + 2;
|
|
81045
|
+
if (newProgress >= 90) {
|
|
81046
|
+
clearInterval(interval);
|
|
81047
|
+
}
|
|
81048
|
+
return newProgress;
|
|
81049
|
+
});
|
|
81050
|
+
}, 500);
|
|
81051
|
+
} else {
|
|
81052
|
+
setProgress(0);
|
|
81053
|
+
clearInterval(interval);
|
|
81054
|
+
}
|
|
81055
|
+
};
|
|
81056
|
+
useEffect(() => {
|
|
81057
|
+
incrementProgress();
|
|
81058
|
+
}, [showProcess]);
|
|
81059
|
+
const getIcon = icon => {
|
|
81060
|
+
switch (icon) {
|
|
81061
|
+
case 'download':
|
|
81062
|
+
return /*#__PURE__*/React__default.createElement(DownloadIcon, {
|
|
81063
|
+
height: iconHeight,
|
|
81064
|
+
width: iconWidth,
|
|
81065
|
+
color: contentColor
|
|
81066
|
+
});
|
|
81067
|
+
case 'document':
|
|
81068
|
+
return /*#__PURE__*/React__default.createElement(DocumentIcon, {
|
|
81069
|
+
height: iconHeight,
|
|
81070
|
+
width: iconWidth,
|
|
81071
|
+
color: contentColor
|
|
81072
|
+
});
|
|
81073
|
+
case 'fly':
|
|
81074
|
+
return /*#__PURE__*/React__default.createElement(FlyIcon, {
|
|
81075
|
+
height: iconHeight,
|
|
81076
|
+
width: iconWidth,
|
|
81077
|
+
color: contentColor
|
|
81078
|
+
});
|
|
81079
|
+
case 'bell':
|
|
81080
|
+
return /*#__PURE__*/React__default.createElement(BellIcon, {
|
|
81081
|
+
height: iconHeight,
|
|
81082
|
+
width: iconWidth,
|
|
81083
|
+
color: contentColor
|
|
81084
|
+
});
|
|
81085
|
+
case 'maintenance':
|
|
81086
|
+
return /*#__PURE__*/React__default.createElement(MaintenanceIcon, {
|
|
81087
|
+
height: iconHeight,
|
|
81088
|
+
width: iconWidth,
|
|
81089
|
+
color: contentColor
|
|
81090
|
+
});
|
|
81091
|
+
case 'exit':
|
|
81092
|
+
return /*#__PURE__*/React__default.createElement(ExitIcon, {
|
|
81093
|
+
height: iconHeight,
|
|
81094
|
+
width: iconWidth,
|
|
81095
|
+
color: contentColor
|
|
81096
|
+
});
|
|
81097
|
+
case 'eye':
|
|
81098
|
+
return /*#__PURE__*/React__default.createElement(EyeIcon, {
|
|
81099
|
+
height: iconHeight,
|
|
81100
|
+
width: iconWidth,
|
|
81101
|
+
color: contentColor
|
|
81102
|
+
});
|
|
81103
|
+
default:
|
|
81104
|
+
return '';
|
|
81105
|
+
}
|
|
81106
|
+
};
|
|
81107
|
+
const onClickHandler = event => {
|
|
81108
|
+
onClick(event);
|
|
81109
|
+
};
|
|
81110
|
+
const onCancelClickHandler = event => {
|
|
81111
|
+
onCancelClick(event);
|
|
81112
|
+
};
|
|
81113
|
+
return /*#__PURE__*/React__default.createElement(ButtonWrapper, {
|
|
81114
|
+
id: "ButtonWrapper"
|
|
81115
|
+
}, /*#__PURE__*/React__default.createElement(IconButtonContainer, {
|
|
81116
|
+
download: true,
|
|
81117
|
+
href: fileLink,
|
|
81118
|
+
backgroundColor: disabled ? '#E3E4E5' : backgroundColor,
|
|
81119
|
+
borderColor: disabled ? '#B1B1B1' : borderColor,
|
|
81120
|
+
borderRadius: borderRadius,
|
|
81121
|
+
color: disabled ? '#B1B1B1' : contentColor,
|
|
81122
|
+
inProgress: showProcess,
|
|
81123
|
+
progress: progress,
|
|
81124
|
+
onClick: event => {
|
|
81125
|
+
onClickHandler(event);
|
|
81126
|
+
}
|
|
81127
|
+
}, getIcon(iconName), buttonText !== '' && buttonText !== undefined && /*#__PURE__*/React__default.createElement(SpanText, null, buttonText)), showProcess && /*#__PURE__*/React__default.createElement(CancelClick, {
|
|
81128
|
+
onClick: event => onCancelClickHandler(event)
|
|
81129
|
+
}, "Click here to cancel"));
|
|
81130
|
+
};
|
|
81131
|
+
IconButton.propTypes = {
|
|
81132
|
+
// downloadStatus: PropTypes.string,
|
|
81133
|
+
// fileName: PropTypes.string,
|
|
81134
|
+
fileLink: PropTypes.string,
|
|
81135
|
+
showProcess: PropTypes.bool,
|
|
81136
|
+
buttonText: PropTypes.string,
|
|
81137
|
+
iconName: PropTypes.string,
|
|
81138
|
+
contentColor: PropTypes.string,
|
|
81139
|
+
backgroundColor: PropTypes.string,
|
|
81140
|
+
borderColor: PropTypes.string,
|
|
81141
|
+
borderRadius: PropTypes.string,
|
|
81142
|
+
iconHeight: PropTypes.number,
|
|
81143
|
+
iconWidth: PropTypes.number,
|
|
81144
|
+
disabled: PropTypes.bool,
|
|
81145
|
+
onClick: PropTypes.func,
|
|
81146
|
+
onCancelClick: PropTypes.func
|
|
81147
|
+
};
|
|
81148
|
+
IconButton.defaultProps = {
|
|
81149
|
+
// downloadStatus: '',
|
|
81150
|
+
// fileName: '',
|
|
81151
|
+
fileLink: '',
|
|
81152
|
+
showProcess: false,
|
|
81153
|
+
buttonText: '',
|
|
81154
|
+
iconName: 'eye',
|
|
81155
|
+
contentColor: '#212121',
|
|
81156
|
+
backgroundColor: '#FFFFFF',
|
|
81157
|
+
borderColor: '#B1B1B1',
|
|
81158
|
+
borderRadius: '12px',
|
|
81159
|
+
iconHeight: 18,
|
|
81160
|
+
iconWidth: 18,
|
|
81161
|
+
disabled: false,
|
|
81162
|
+
onClick: () => {},
|
|
81163
|
+
onCancelClick: () => {}
|
|
81164
|
+
};
|
|
81165
|
+
|
|
81166
|
+
const LinnerContainer = dt.div`
|
|
81167
|
+
font-family: "Poppins", sans-serif;
|
|
81168
|
+
display: grid;
|
|
81169
|
+
gap: 48px 0;
|
|
81170
|
+
grid-template-columns: repeat(5, 1fr);
|
|
81171
|
+
grid-template-rows: auto auto;
|
|
81172
|
+
width: ${props => props.width};
|
|
81173
|
+
height: ${props => props.height};
|
|
81174
|
+
background-color: ${props => props.backgroundColor};
|
|
81175
|
+
padding: 50px 20px 20px;
|
|
81176
|
+
box-sizing: border-box;
|
|
81177
|
+
`;
|
|
81178
|
+
const DataBox = dt.div`
|
|
81179
|
+
height: 100%;
|
|
81180
|
+
padding: 0 40px;
|
|
81181
|
+
border-left: 1px solid #d0d0d0;
|
|
81182
|
+
&:nth-child(1),
|
|
81183
|
+
&:nth-child(6) {
|
|
81184
|
+
border-left: none;
|
|
81185
|
+
padding-left: 0;
|
|
81186
|
+
}
|
|
81187
|
+
&:nth-child(5),
|
|
81188
|
+
&:nth-child(10) {
|
|
81189
|
+
padding-right: 0;
|
|
81190
|
+
}
|
|
81191
|
+
`;
|
|
81192
|
+
const CellItem = dt.div`
|
|
81193
|
+
display: flex;
|
|
81194
|
+
align-items: center;
|
|
81195
|
+
`;
|
|
81196
|
+
const DataBoxTitle = dt.span`
|
|
81197
|
+
font-size: 18px;
|
|
81198
|
+
display: block;
|
|
81199
|
+
margin: 0 0 12px;
|
|
81200
|
+
`;
|
|
81201
|
+
const BigValue = dt.span`
|
|
81202
|
+
font-size: 40px;
|
|
81203
|
+
font-weight: 500;
|
|
81204
|
+
margin-right: 5px;
|
|
81205
|
+
`;
|
|
81206
|
+
const CellItemValueSign = dt.span`
|
|
81207
|
+
font-size: 16px;
|
|
81208
|
+
font-weight: 400;
|
|
81209
|
+
`;
|
|
81210
|
+
const ValueChange = dt.span`
|
|
81211
|
+
font-size: 16px;
|
|
81212
|
+
font-weight: 400;
|
|
81213
|
+
`;
|
|
81214
|
+
const CellItemNoValue = dt.span`
|
|
81215
|
+
font-size: 40px;
|
|
81216
|
+
font-weight: 500;
|
|
81217
|
+
`;
|
|
81218
|
+
const PercentageChange = dt.div`
|
|
81219
|
+
display: flex;
|
|
81220
|
+
align-items: center;
|
|
81221
|
+
font-size: 16px;
|
|
81222
|
+
color: ${props => props.color};
|
|
81223
|
+
`;
|
|
81224
|
+
|
|
81225
|
+
const ArrowUpIcon = _ref => {
|
|
81226
|
+
let {
|
|
81227
|
+
clicked,
|
|
81228
|
+
width = '8',
|
|
81229
|
+
height = '9'
|
|
81230
|
+
} = _ref;
|
|
81231
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
81232
|
+
width: width,
|
|
81233
|
+
height: height,
|
|
81234
|
+
viewBox: "0 0 8 9",
|
|
81235
|
+
fill: "none",
|
|
81236
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
81237
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
81238
|
+
d: "M4.47065 0.188348C4.21033 -0.0627825 3.78758 -0.0627825 3.52727 0.188348L0.195236 3.40281C-0.0650787 3.65394 -0.0650787 4.06178 0.195236 4.31291C0.455551 4.56404 0.878303 4.56404 1.13862 4.31291L3.33359 2.19337V8.35711C3.33359 8.71271 3.63139 9 4 9C4.36861 9 4.66641 8.71271 4.66641 8.35711V2.19337L6.86138 4.3109C7.1217 4.56203 7.54445 4.56203 7.80476 4.3109C8.06508 4.05977 8.06508 3.65193 7.80476 3.4008L4.47273 0.186338L4.47065 0.188348Z",
|
|
81239
|
+
fill: "#5FCC70"
|
|
81240
|
+
}));
|
|
81241
|
+
};
|
|
81242
|
+
|
|
81243
|
+
const ArrowDownIcon = _ref => {
|
|
81244
|
+
let {
|
|
81245
|
+
clicked,
|
|
81246
|
+
width = '8',
|
|
81247
|
+
height = '9'
|
|
81248
|
+
} = _ref;
|
|
81249
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
81250
|
+
width: width,
|
|
81251
|
+
height: height,
|
|
81252
|
+
viewBox: "0 0 8 9",
|
|
81253
|
+
fill: "none",
|
|
81254
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
81255
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
81256
|
+
d: "M3.52935 8.81165C3.78967 9.06278 4.21242 9.06278 4.47273 8.81165L7.80476 5.59719C8.06508 5.34606 8.06508 4.93822 7.80476 4.68709C7.54445 4.43596 7.1217 4.43596 6.86138 4.68709L4.66641 6.80663L4.66641 0.642893C4.66641 0.287292 4.36861 -4.08657e-07 4 -4.40881e-07C3.63139 -4.73106e-07 3.33359 0.287292 3.33359 0.642893L3.33359 6.80663L1.13862 4.6891C0.878303 4.43797 0.455551 4.43797 0.195236 4.6891C-0.0650787 4.94023 -0.0650787 5.34807 0.195236 5.5992L3.52727 8.81366L3.52935 8.81165Z",
|
|
81257
|
+
fill: "#F00021"
|
|
81258
|
+
}));
|
|
81259
|
+
};
|
|
81260
|
+
|
|
81261
|
+
/* eslint-disable no-restricted-globals */
|
|
81262
|
+
const DoublePanelDataRow = props => {
|
|
81263
|
+
const {
|
|
81264
|
+
width,
|
|
81265
|
+
height,
|
|
81266
|
+
data,
|
|
81267
|
+
backgroundColor,
|
|
81268
|
+
className,
|
|
81269
|
+
customDataFormat,
|
|
81270
|
+
showPercentChange
|
|
81271
|
+
} = props;
|
|
81272
|
+
const getArrowSign = arrowSign => {
|
|
81273
|
+
if (!arrowSign) {
|
|
81274
|
+
return '-';
|
|
81275
|
+
}
|
|
81276
|
+
if (arrowSign === 'up') {
|
|
81277
|
+
return /*#__PURE__*/React__default.createElement(PercentageChange, {
|
|
81278
|
+
color: "#5FCC70",
|
|
81279
|
+
value: 34 // TODO: when ready, replace with actual value
|
|
81280
|
+
}, /*#__PURE__*/React__default.createElement(ArrowUpIcon, {
|
|
81281
|
+
width: 12,
|
|
81282
|
+
height: 12
|
|
81283
|
+
}), ' ', "(+34K)");
|
|
81284
|
+
}
|
|
81285
|
+
return /*#__PURE__*/React__default.createElement(PercentageChange, {
|
|
81286
|
+
color: "#D23630",
|
|
81287
|
+
value: 66 // TODO: when ready, replace with actual value
|
|
81288
|
+
}, /*#__PURE__*/React__default.createElement(ArrowDownIcon, {
|
|
81289
|
+
width: 12,
|
|
81290
|
+
height: 12
|
|
81291
|
+
}), ' ', "(-12K)");
|
|
81292
|
+
};
|
|
81293
|
+
return /*#__PURE__*/React__default.createElement(LinnerContainer, {
|
|
81294
|
+
className: className,
|
|
81295
|
+
backgroundColor: backgroundColor,
|
|
81296
|
+
width: width,
|
|
81297
|
+
height: height,
|
|
81298
|
+
customDataFormat: customDataFormat
|
|
81299
|
+
}, data.map(item => /*#__PURE__*/React__default.createElement(DataBox, {
|
|
81300
|
+
className: "data-box-item"
|
|
81301
|
+
}, item.title && /*#__PURE__*/React__default.createElement(DataBoxTitle, {
|
|
81302
|
+
className: "DataBoxTitle"
|
|
81303
|
+
}, item.title), /*#__PURE__*/React__default.createElement(CellItem, null, item.value !== null && item.value !== undefined && !isNaN(item.value) && item.value !== 'null' && item.value !== 'undefined' ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, item.sign && /*#__PURE__*/React__default.createElement(CellItemValueSign, null, item.sign), customDataFormat ? /*#__PURE__*/React__default.createElement(BigValue, {
|
|
81304
|
+
className: "DataBoxValue"
|
|
81305
|
+
}, ''.concat(formattedValue(item.value), getFormattedUnits(item.value)), item.isPercent && /*#__PURE__*/React__default.createElement(CellItemValueSign, null, "%")) : /*#__PURE__*/React__default.createElement(BigValue, null, ''.concat(getFormattedValue(item.value), getFormattedUnits(item.value)), item.isPercent && /*#__PURE__*/React__default.createElement(CellItemValueSign, null, "%")), showPercentChange && getArrowSign(item.value >= 0 ? 'up' : 'down')) : /*#__PURE__*/React__default.createElement(CellItemNoValue, null, "N/A")), /*#__PURE__*/React__default.createElement(ValueChange, null))));
|
|
81306
|
+
};
|
|
81307
|
+
DoublePanelDataRow.propTypes = {
|
|
81308
|
+
className: PropTypes.string,
|
|
81309
|
+
width: PropTypes.string,
|
|
81310
|
+
height: PropTypes.string,
|
|
81311
|
+
data: PropTypes.arrayOf(PropTypes.shape({
|
|
81312
|
+
title: PropTypes.string,
|
|
81313
|
+
value: PropTypes.number,
|
|
81314
|
+
sign: PropTypes.string
|
|
81315
|
+
})),
|
|
81316
|
+
backgroundColor: PropTypes.string,
|
|
81317
|
+
customDataFormat: PropTypes.bool,
|
|
81318
|
+
showPercentChange: PropTypes.bool
|
|
81319
|
+
};
|
|
81320
|
+
DoublePanelDataRow.defaultProps = {
|
|
81321
|
+
className: '',
|
|
81322
|
+
width: '100%',
|
|
81323
|
+
height: 'auto',
|
|
81324
|
+
data: [],
|
|
81325
|
+
backgroundColor: '#FFFFFF',
|
|
81326
|
+
customDataFormat: false,
|
|
81327
|
+
showPercentChange: false
|
|
81328
|
+
};
|
|
81329
|
+
|
|
81330
|
+
const ControlsContainer = dt.div`
|
|
81331
|
+
position: relative;
|
|
81332
|
+
font-family: "Poppins", sans-serif;
|
|
81333
|
+
color: #212121;
|
|
81334
|
+
width: ${props => props.width};
|
|
81335
|
+
height: ${props => props.height};
|
|
81336
|
+
min-width: 250px;
|
|
81337
|
+
`;
|
|
81338
|
+
const Controls = dt.div`
|
|
81339
|
+
height: 100%;
|
|
81340
|
+
width: 100%;
|
|
81341
|
+
background: white;
|
|
81342
|
+
display: flex;
|
|
81343
|
+
flex-direction: column;
|
|
81344
|
+
`;
|
|
81345
|
+
const TooltipDiv = dt.div`
|
|
81346
|
+
border-radius: 5px;
|
|
81347
|
+
padding: 8px 12px;
|
|
81348
|
+
background: white;
|
|
81349
|
+
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);
|
|
81350
|
+
margin: 0;
|
|
81351
|
+
`;
|
|
81352
|
+
const TooltipLabel = dt.div`
|
|
81353
|
+
color: #212121;
|
|
81354
|
+
font-size: 14px;
|
|
81355
|
+
font-weight: 400;
|
|
81356
|
+
width: fit-content;
|
|
81357
|
+
`;
|
|
81358
|
+
const TooltipTitle = dt.div`
|
|
81359
|
+
color: #212121;
|
|
81360
|
+
font-size: 14px;
|
|
81361
|
+
font-weight: 600;
|
|
81362
|
+
`;
|
|
81363
|
+
const Title = dt.h5`
|
|
81364
|
+
font-weight: 500;
|
|
81365
|
+
font-size: 18px;
|
|
81366
|
+
line-height: 20px;
|
|
81367
|
+
margin: 0 0 30px;
|
|
81368
|
+
@media (max-width: 1536px) {
|
|
81369
|
+
font-size: 16px;
|
|
81370
|
+
margin: 0 0 20px;
|
|
81371
|
+
}
|
|
81372
|
+
@media (max-width: 1366px) {
|
|
81373
|
+
font-size: 14px;
|
|
81374
|
+
}
|
|
81375
|
+
`;
|
|
81376
|
+
const LabelBoldText = dt.tspan`
|
|
81377
|
+
font-size: 0.7em;
|
|
81378
|
+
`;
|
|
81379
|
+
const LabelText = dt.tspan`
|
|
81380
|
+
font-size: 0.6em;
|
|
81381
|
+
`;
|
|
81382
|
+
|
|
81383
|
+
/* eslint-disable react/prop-types */
|
|
81384
|
+
const ICON_TYPE_SQUARE = 'Square';
|
|
81385
|
+
const ICON_TYPE_LEGEND_UNION_ICON = 'LegendUnionIcon';
|
|
81386
|
+
const ICON_TYPE_LEGEND_LINE_ICON = 'LegendLineIcon';
|
|
81387
|
+
|
|
81388
|
+
/* BarCharts */
|
|
81389
|
+
const BarChart = props => {
|
|
81390
|
+
const {
|
|
81391
|
+
className,
|
|
81392
|
+
title,
|
|
81393
|
+
barChartData,
|
|
81394
|
+
barSize,
|
|
81395
|
+
barFontSizeValue,
|
|
81396
|
+
isDollar,
|
|
81397
|
+
width,
|
|
81398
|
+
height,
|
|
81399
|
+
barChartColor,
|
|
81400
|
+
currentBarColor,
|
|
81401
|
+
showLegend,
|
|
81402
|
+
legendData,
|
|
81403
|
+
showDollarSign,
|
|
81404
|
+
showReferenceLine,
|
|
81405
|
+
referenceLinePoint,
|
|
81406
|
+
referenceLineColor,
|
|
81407
|
+
referenceLineDashed,
|
|
81408
|
+
showCurrentCampaignStyle,
|
|
81409
|
+
isPercent
|
|
81410
|
+
} = props;
|
|
81411
|
+
const controlsContainerRef = useRef();
|
|
81412
|
+
const areAllDatesEmpty = () => {
|
|
81413
|
+
if (!barChartData || barChartData?.length === 0) return true;
|
|
81414
|
+
return barChartData?.every(item => !item.date);
|
|
81415
|
+
};
|
|
81416
|
+
const displayFormattedValue = function (value) {
|
|
81417
|
+
let showFullNumber = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
81418
|
+
if (value === undefined || value === null) return '';
|
|
81419
|
+
let formattedValue = '';
|
|
81420
|
+
if (isPercent) {
|
|
81421
|
+
formattedValue = ''.concat(value.toFixed(1), '%');
|
|
81422
|
+
} else if (isDollar) {
|
|
81423
|
+
formattedValue = ''.concat(showDollarSign ? '$' : '', !showFullNumber ? getFormattedValue(value) : getNumberWithCommas(Number.isInteger(value) ? value : value.toFixed(1)), !showFullNumber ? getFormattedUnits(value) : '');
|
|
81424
|
+
} else {
|
|
81425
|
+
formattedValue = ''.concat(!showFullNumber ? getFormattedValue(value) : getNumberWithCommas(Number.isInteger(value) ? value : value.toFixed(1)), !showFullNumber ? getFormattedUnits(value) : '');
|
|
81426
|
+
}
|
|
81427
|
+
return formattedValue;
|
|
81428
|
+
};
|
|
81429
|
+
|
|
81430
|
+
// eslint-disable-next-line react/no-unstable-nested-components
|
|
81431
|
+
const CustomTooltip = tooltipData => {
|
|
81432
|
+
const {
|
|
81433
|
+
active,
|
|
81434
|
+
payload,
|
|
81435
|
+
label
|
|
81436
|
+
} = tooltipData;
|
|
81437
|
+
if (!active || !payload || payload?.length === 0) return null;
|
|
81438
|
+
let currentTooltipValue = 0;
|
|
81439
|
+
if (payload[0].payload?.value) currentTooltipValue = payload[0].payload?.value;
|
|
81440
|
+
return /*#__PURE__*/React__default.createElement(TooltipDiv, null, /*#__PURE__*/React__default.createElement(TooltipTitle, null, `${label}`), /*#__PURE__*/React__default.createElement(TooltipLabel, null, `${displayFormattedValue(currentTooltipValue, !!showCurrentCampaignStyle)}`));
|
|
81441
|
+
};
|
|
81442
|
+
const CustomizedTickBarChart = props => {
|
|
81443
|
+
const {
|
|
81444
|
+
x,
|
|
81445
|
+
y,
|
|
81446
|
+
payload
|
|
81447
|
+
} = props;
|
|
81448
|
+
if (barChartData && barChartData.length > 0 && payload) {
|
|
81449
|
+
const retailerData = barChartData.filter(item => item.title === payload.value);
|
|
81450
|
+
if (retailerData && retailerData.length > 0) {
|
|
81451
|
+
return /*#__PURE__*/React__default.createElement("g", {
|
|
81452
|
+
transform: `translate(${x},${y})`
|
|
81453
|
+
}, showCurrentCampaignStyle && retailerData[0].isCurrent && /*#__PURE__*/React__default.createElement("rect", {
|
|
81454
|
+
x: -56 // Adjust this to position the background properly
|
|
81455
|
+
,
|
|
81456
|
+
y: 5 // Adjust this for vertical alignment with your text
|
|
81457
|
+
,
|
|
81458
|
+
width: 112 // Adjust width based on the text length
|
|
81459
|
+
,
|
|
81460
|
+
height: 22 // Adjust height based on font size
|
|
81461
|
+
,
|
|
81462
|
+
fill: currentBarColor || '#90CE9C',
|
|
81463
|
+
rx: 12
|
|
81464
|
+
}), /*#__PURE__*/React__default.createElement("text", {
|
|
81465
|
+
x: 0,
|
|
81466
|
+
y: 0,
|
|
81467
|
+
dy: 16,
|
|
81468
|
+
fill: "#212121"
|
|
81469
|
+
}, /*#__PURE__*/React__default.createElement(LabelBoldText, {
|
|
81470
|
+
textAnchor: "middle",
|
|
81471
|
+
x: 0,
|
|
81472
|
+
dy: showCurrentCampaignStyle ? 20 : 50,
|
|
81473
|
+
fontSize: showCurrentCampaignStyle ? 12 : 16,
|
|
81474
|
+
fontWeight: showCurrentCampaignStyle ? 500 : 600,
|
|
81475
|
+
fill: showCurrentCampaignStyle && !retailerData[0].isCurrent ? '#8B8989' : '#212121'
|
|
81476
|
+
}, (() => {
|
|
81477
|
+
if (showCurrentCampaignStyle) {
|
|
81478
|
+
if (retailerData[0].isCurrent) {
|
|
81479
|
+
if (payload?.value?.length > 6) {
|
|
81480
|
+
return `${payload.value.slice(0, 6)}...-Current`;
|
|
81481
|
+
}
|
|
81482
|
+
return `${payload.value}-Current`;
|
|
81483
|
+
}
|
|
81484
|
+
if (payload?.value?.length > 10) {
|
|
81485
|
+
return `${payload.value.slice(0, 10)}...`;
|
|
81486
|
+
}
|
|
81487
|
+
return `${payload.value}`;
|
|
81488
|
+
}
|
|
81489
|
+
return payload?.value;
|
|
81490
|
+
})()), /*#__PURE__*/React__default.createElement(LabelText, {
|
|
81491
|
+
textAnchor: "middle",
|
|
81492
|
+
x: "0",
|
|
81493
|
+
dy: "30",
|
|
81494
|
+
fontSize: 14,
|
|
81495
|
+
fontWeight: 400
|
|
81496
|
+
}, retailerData[0].date)));
|
|
81497
|
+
}
|
|
81498
|
+
return null;
|
|
81499
|
+
}
|
|
81500
|
+
return null;
|
|
81501
|
+
};
|
|
81502
|
+
const CustomizedLabel = props => {
|
|
81503
|
+
const {
|
|
81504
|
+
x,
|
|
81505
|
+
y,
|
|
81506
|
+
stroke,
|
|
81507
|
+
value
|
|
81508
|
+
} = props;
|
|
81509
|
+
return /*#__PURE__*/React__default.createElement("text", {
|
|
81510
|
+
x: x + 30,
|
|
81511
|
+
y: y,
|
|
81512
|
+
dy: -8,
|
|
81513
|
+
fill: showCurrentCampaignStyle ? '#8B8989' : stroke,
|
|
81514
|
+
fontSize: barFontSizeValue,
|
|
81515
|
+
textAnchor: "middle"
|
|
81516
|
+
}, displayFormattedValue(value));
|
|
81517
|
+
};
|
|
81518
|
+
return /*#__PURE__*/React__default.createElement(ControlsContainer, {
|
|
81519
|
+
className: className,
|
|
81520
|
+
height: height,
|
|
81521
|
+
width: width,
|
|
81522
|
+
ref: controlsContainerRef
|
|
81523
|
+
}, /*#__PURE__*/React__default.createElement(Controls, null, /*#__PURE__*/React__default.createElement(Title, null, title), /*#__PURE__*/React__default.createElement(ResponsiveContainer, {
|
|
81524
|
+
width: "100%",
|
|
81525
|
+
height: 400
|
|
81526
|
+
}, /*#__PURE__*/React__default.createElement(BarChart$1, {
|
|
81527
|
+
width: width,
|
|
81528
|
+
height: height,
|
|
81529
|
+
data: barChartData,
|
|
81530
|
+
margin: {
|
|
81531
|
+
top: 20,
|
|
81532
|
+
right: 0,
|
|
81533
|
+
bottom: 0,
|
|
81534
|
+
left: -5
|
|
81535
|
+
}
|
|
81536
|
+
}, showCurrentCampaignStyle && /*#__PURE__*/React__default.createElement(CartesianGrid, {
|
|
81537
|
+
strokeDasharray: "3 3",
|
|
81538
|
+
vertical: false
|
|
81539
|
+
}), showCurrentCampaignStyle && /*#__PURE__*/React__default.createElement(YAxis, {
|
|
81540
|
+
tickCount: 10,
|
|
81541
|
+
interval: "preserveEnd",
|
|
81542
|
+
domain: [0, 'auto'],
|
|
81543
|
+
tick: {
|
|
81544
|
+
fill: '#8B8989'
|
|
81545
|
+
},
|
|
81546
|
+
axisLine: false,
|
|
81547
|
+
fontWeight: 400,
|
|
81548
|
+
fontSize: "12px",
|
|
81549
|
+
tickLine: false,
|
|
81550
|
+
tickFormatter: value => `${displayFormattedValue(value)}`
|
|
81551
|
+
}), showReferenceLine && /*#__PURE__*/React__default.createElement(ReferenceLine, {
|
|
81552
|
+
y: referenceLinePoint,
|
|
81553
|
+
stroke: referenceLineColor,
|
|
81554
|
+
strokeDasharray: referenceLineDashed
|
|
81555
|
+
}), /*#__PURE__*/React__default.createElement(XAxis, {
|
|
81556
|
+
dataKey: "title",
|
|
81557
|
+
tick: CustomizedTickBarChart,
|
|
81558
|
+
tickLine: false,
|
|
81559
|
+
height: areAllDatesEmpty() ? 50 : 120,
|
|
81560
|
+
stroke: "#D0D0D0",
|
|
81561
|
+
domain: [0, 'auto'],
|
|
81562
|
+
interval: 0
|
|
81563
|
+
}), /*#__PURE__*/React__default.createElement(Brush, {
|
|
81564
|
+
dataKey: "name",
|
|
81565
|
+
height: 30,
|
|
81566
|
+
stroke: "#8884d8"
|
|
81567
|
+
}), /*#__PURE__*/React__default.createElement(Tooltip$2, {
|
|
81568
|
+
content: /*#__PURE__*/React__default.createElement(CustomTooltip, null)
|
|
81569
|
+
}), /*#__PURE__*/React__default.createElement(Tooltip$2, null), /*#__PURE__*/React__default.createElement(Bar, {
|
|
81570
|
+
dataKey: "value",
|
|
81571
|
+
fill: barChartColor,
|
|
81572
|
+
minPointSize: 5,
|
|
81573
|
+
barSize: barSize ?? 60,
|
|
81574
|
+
radius: [5, 5, 0, 0]
|
|
81575
|
+
}, /*#__PURE__*/React__default.createElement(LabelList, {
|
|
81576
|
+
dataKey: "value",
|
|
81577
|
+
content: CustomizedLabel
|
|
81578
|
+
})))), showLegend && /*#__PURE__*/React__default.createElement(PerformanceAnalyticsLegend, {
|
|
81579
|
+
legendData: legendData
|
|
81580
|
+
})));
|
|
81581
|
+
};
|
|
81582
|
+
BarChart.propTypes = {
|
|
81583
|
+
title: PropTypes.string,
|
|
81584
|
+
barChartData: PropTypes.arrayOf(PropTypes.shape({
|
|
81585
|
+
title: PropTypes.string,
|
|
81586
|
+
date: PropTypes.string,
|
|
81587
|
+
value: PropTypes.number
|
|
81588
|
+
})),
|
|
81589
|
+
width: PropTypes.string,
|
|
81590
|
+
height: PropTypes.string,
|
|
81591
|
+
barSize: PropTypes.number,
|
|
81592
|
+
barFontSizeValue: PropTypes.string,
|
|
81593
|
+
barChartColor: PropTypes.string,
|
|
81594
|
+
showDollarSign: PropTypes.bool,
|
|
81595
|
+
isDollar: PropTypes.bool,
|
|
81596
|
+
showLegend: PropTypes.bool,
|
|
81597
|
+
legendData: PropTypes.arrayOf(PropTypes.shape({
|
|
81598
|
+
title: PropTypes.string.isRequired,
|
|
81599
|
+
iconType: PropTypes.oneOf([ICON_TYPE_SQUARE, ICON_TYPE_LEGEND_UNION_ICON, ICON_TYPE_LEGEND_LINE_ICON]).isRequired,
|
|
81600
|
+
iconColor: PropTypes.string.isRequired
|
|
81601
|
+
})),
|
|
81602
|
+
showReferenceLine: PropTypes.bool,
|
|
81603
|
+
referenceLinePoint: PropTypes.number,
|
|
81604
|
+
referenceLineColor: PropTypes.string,
|
|
81605
|
+
referenceLineDashed: PropTypes.string,
|
|
81606
|
+
showCurrentCampaignStyle: PropTypes.bool,
|
|
81607
|
+
currentBarColor: PropTypes.string,
|
|
81608
|
+
isPercent: PropTypes.bool
|
|
81609
|
+
};
|
|
81610
|
+
BarChart.defaultProps = {
|
|
81611
|
+
title: 'String',
|
|
81612
|
+
barChartData: [{
|
|
81613
|
+
title: 'Food Lion',
|
|
81614
|
+
date: '15.01.24-31.01.24',
|
|
81615
|
+
value: 542366
|
|
81616
|
+
}, {
|
|
81617
|
+
title: 'Hannaford',
|
|
81618
|
+
date: '15.01.24-31.01.24',
|
|
81619
|
+
value: 699511
|
|
81620
|
+
}, {
|
|
81621
|
+
title: 'The Giant Company',
|
|
81622
|
+
date: '15.01.24-31.01.24',
|
|
81623
|
+
value: 403092
|
|
81624
|
+
}, {
|
|
81625
|
+
title: 'Giant Food',
|
|
81626
|
+
date: '15.01.24-31.01.24',
|
|
81627
|
+
value: 396184
|
|
81628
|
+
}, {
|
|
81629
|
+
title: 'Stop&Shop',
|
|
81630
|
+
date: '15.01.24-31.01.24',
|
|
81631
|
+
value: 415317
|
|
81632
|
+
}],
|
|
81633
|
+
width: '100%',
|
|
81634
|
+
height: '100%',
|
|
81635
|
+
barSize: 60,
|
|
81636
|
+
barFontSizeValue: '0.6em',
|
|
81637
|
+
barChartColor: '#BD9EFF',
|
|
81638
|
+
showDollarSign: true,
|
|
81639
|
+
isDollar: true,
|
|
81640
|
+
showLegend: true,
|
|
81641
|
+
legendData: [{
|
|
81642
|
+
title: 'Incremental Sales',
|
|
81643
|
+
iconType: ICON_TYPE_SQUARE,
|
|
81644
|
+
iconColor: '#BD9EFF'
|
|
81645
|
+
}],
|
|
81646
|
+
showReferenceLine: false,
|
|
81647
|
+
referenceLinePoint: 0,
|
|
81648
|
+
referenceLineColor: '#212121',
|
|
81649
|
+
referenceLineDashed: '5',
|
|
81650
|
+
showCurrentCampaignStyle: false,
|
|
81651
|
+
currentBarColor: '#90CE9C',
|
|
81652
|
+
isPercent: false
|
|
81653
|
+
};
|
|
81654
|
+
|
|
81655
|
+
export { BannerEventBoxList, BarChart, BarChartsByWeeks, Button, CollapseHeader, DialogOverlay, DoublePanelDataRow, EventDetailsCard, EventList, FilterPanel, Heatmap, IconButton, LinnerDataBox, MarketShareDescription, OneColumnContainer, PieChart, PopupCharts, QuickFilter, ReportTable, TabMenu, TopToggleList, TotalDoughnutChart, TotalHorizontalCharts };
|
|
80952
81656
|
//# sourceMappingURL=index.esm.js.map
|