sag_components 2.0.0-beta61 → 2.0.0-beta63
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.esm.js +77 -56
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +77 -56
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31488,7 +31488,20 @@ const SeparatedLineBarChart = ({
|
|
|
31488
31488
|
payload
|
|
31489
31489
|
} = props;
|
|
31490
31490
|
const label = payload.value;
|
|
31491
|
-
const
|
|
31491
|
+
const words = label.split(' ');
|
|
31492
|
+
const chunks = [];
|
|
31493
|
+
let currentChunk = '';
|
|
31494
|
+
words.forEach(word => {
|
|
31495
|
+
if (currentChunk.length + word.length > 15) {
|
|
31496
|
+
chunks.push(currentChunk.trim());
|
|
31497
|
+
currentChunk = word;
|
|
31498
|
+
} else {
|
|
31499
|
+
currentChunk += (currentChunk ? ' ' : '') + word;
|
|
31500
|
+
}
|
|
31501
|
+
});
|
|
31502
|
+
if (currentChunk) {
|
|
31503
|
+
chunks.push(currentChunk.trim());
|
|
31504
|
+
}
|
|
31492
31505
|
return /*#__PURE__*/React__default["default"].createElement("g", {
|
|
31493
31506
|
transform: `translate(${x},${y})`
|
|
31494
31507
|
}, /*#__PURE__*/React__default["default"].createElement("text", {
|
|
@@ -31497,16 +31510,13 @@ const SeparatedLineBarChart = ({
|
|
|
31497
31510
|
dy: 16,
|
|
31498
31511
|
textAnchor: "middle",
|
|
31499
31512
|
fill: "#212121",
|
|
31500
|
-
fontSize:
|
|
31501
|
-
fontWeight: 400,
|
|
31513
|
+
fontSize: 10,
|
|
31502
31514
|
fontFamily: "Poppins"
|
|
31503
|
-
}, /*#__PURE__*/React__default["default"].createElement("tspan", {
|
|
31504
|
-
|
|
31505
|
-
dy: 8
|
|
31506
|
-
}, "Vendor Selling"), /*#__PURE__*/React__default["default"].createElement("tspan", {
|
|
31515
|
+
}, chunks.map((chunk, i) => /*#__PURE__*/React__default["default"].createElement("tspan", {
|
|
31516
|
+
key: i,
|
|
31507
31517
|
x: 0,
|
|
31508
|
-
dy:
|
|
31509
|
-
},
|
|
31518
|
+
dy: i === 0 ? "0.71em" : "1.2em"
|
|
31519
|
+
}, chunk))));
|
|
31510
31520
|
};
|
|
31511
31521
|
const CustomTooltip = ({
|
|
31512
31522
|
active,
|
|
@@ -31613,7 +31623,7 @@ const SeparatedLineBarChart = ({
|
|
|
31613
31623
|
dataKey: "label",
|
|
31614
31624
|
tick: /*#__PURE__*/React__default["default"].createElement(CustomizedTick, null),
|
|
31615
31625
|
interval: 0,
|
|
31616
|
-
height:
|
|
31626
|
+
height: 80,
|
|
31617
31627
|
tickLine: false
|
|
31618
31628
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
|
|
31619
31629
|
tickFormatter: v => `${v / 1000}k`,
|
|
@@ -31673,7 +31683,20 @@ function SingleChart({
|
|
|
31673
31683
|
payload
|
|
31674
31684
|
}) => {
|
|
31675
31685
|
const label = dataWithIndex[payload.value]?.label ?? "";
|
|
31676
|
-
const
|
|
31686
|
+
const words = label.split(' ');
|
|
31687
|
+
const chunks = [];
|
|
31688
|
+
let currentChunk = '';
|
|
31689
|
+
words.forEach(word => {
|
|
31690
|
+
if (currentChunk.length + word.length > 15) {
|
|
31691
|
+
chunks.push(currentChunk.trim());
|
|
31692
|
+
currentChunk = word;
|
|
31693
|
+
} else {
|
|
31694
|
+
currentChunk += (currentChunk ? ' ' : '') + word;
|
|
31695
|
+
}
|
|
31696
|
+
});
|
|
31697
|
+
if (currentChunk) {
|
|
31698
|
+
chunks.push(currentChunk.trim());
|
|
31699
|
+
}
|
|
31677
31700
|
return /*#__PURE__*/React__default["default"].createElement("g", {
|
|
31678
31701
|
transform: `translate(${x},${y})`
|
|
31679
31702
|
}, /*#__PURE__*/React__default["default"].createElement("text", {
|
|
@@ -31682,16 +31705,13 @@ function SingleChart({
|
|
|
31682
31705
|
dy: 16,
|
|
31683
31706
|
textAnchor: "middle",
|
|
31684
31707
|
fill: "#212121",
|
|
31685
|
-
fontSize:
|
|
31686
|
-
fontWeight: "400",
|
|
31708
|
+
fontSize: 10,
|
|
31687
31709
|
fontFamily: "Poppins"
|
|
31688
|
-
}, /*#__PURE__*/React__default["default"].createElement("tspan", {
|
|
31689
|
-
|
|
31690
|
-
dy: 8
|
|
31691
|
-
}, "Vendor Selling"), /*#__PURE__*/React__default["default"].createElement("tspan", {
|
|
31710
|
+
}, chunks.map((chunk, i) => /*#__PURE__*/React__default["default"].createElement("tspan", {
|
|
31711
|
+
key: i,
|
|
31692
31712
|
x: 0,
|
|
31693
|
-
dy:
|
|
31694
|
-
},
|
|
31713
|
+
dy: i === 0 ? "0.71em" : "1.2em"
|
|
31714
|
+
}, chunk))));
|
|
31695
31715
|
};
|
|
31696
31716
|
const CustomTooltip = ({
|
|
31697
31717
|
active,
|
|
@@ -31700,7 +31720,6 @@ function SingleChart({
|
|
|
31700
31720
|
if (!active || !payload || !payload.length) return null;
|
|
31701
31721
|
const data = payload[0]?.payload;
|
|
31702
31722
|
if (!data) return null;
|
|
31703
|
-
console.log(data);
|
|
31704
31723
|
return /*#__PURE__*/React__default["default"].createElement(TooltipContainer, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle, null, `${data.label}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `${data.description}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `${data.typeTitle}: ${getFormattedValue(data.value)}${getFormattedUnits(data.value)}`));
|
|
31705
31724
|
};
|
|
31706
31725
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -31725,7 +31744,7 @@ function SingleChart({
|
|
|
31725
31744
|
dataKey: "index",
|
|
31726
31745
|
tick: /*#__PURE__*/React__default["default"].createElement(CustomizedTick, null),
|
|
31727
31746
|
interval: 0,
|
|
31728
|
-
height:
|
|
31747
|
+
height: 80,
|
|
31729
31748
|
padding: {
|
|
31730
31749
|
left: 20,
|
|
31731
31750
|
right: 20
|
|
@@ -31996,13 +32015,6 @@ SegmentedButton.defaultProps = {
|
|
|
31996
32015
|
function InnerBarChart({
|
|
31997
32016
|
brushInnerBarData
|
|
31998
32017
|
}) {
|
|
31999
|
-
const processedData = brushInnerBarData.map(item => {
|
|
32000
|
-
const parts = item.label.replace("Vendor Selling Event:", "").trim();
|
|
32001
|
-
return {
|
|
32002
|
-
...item,
|
|
32003
|
-
shortLabel: parts
|
|
32004
|
-
};
|
|
32005
|
-
});
|
|
32006
32018
|
const BarWithInner = props => {
|
|
32007
32019
|
const {
|
|
32008
32020
|
x,
|
|
@@ -32065,7 +32077,23 @@ function InnerBarChart({
|
|
|
32065
32077
|
y,
|
|
32066
32078
|
payload
|
|
32067
32079
|
} = props;
|
|
32068
|
-
const
|
|
32080
|
+
const label = payload.value;
|
|
32081
|
+
|
|
32082
|
+
// Split the label into chunks of words
|
|
32083
|
+
const words = label.split(' ');
|
|
32084
|
+
const chunks = [];
|
|
32085
|
+
let currentChunk = '';
|
|
32086
|
+
words.forEach(word => {
|
|
32087
|
+
if (currentChunk.length + word.length > 15) {
|
|
32088
|
+
chunks.push(currentChunk.trim());
|
|
32089
|
+
currentChunk = word;
|
|
32090
|
+
} else {
|
|
32091
|
+
currentChunk += ' ' + word;
|
|
32092
|
+
}
|
|
32093
|
+
});
|
|
32094
|
+
if (currentChunk) {
|
|
32095
|
+
chunks.push(currentChunk.trim());
|
|
32096
|
+
}
|
|
32069
32097
|
return /*#__PURE__*/React__default["default"].createElement("g", {
|
|
32070
32098
|
transform: `translate(${x},${y})`
|
|
32071
32099
|
}, /*#__PURE__*/React__default["default"].createElement("text", {
|
|
@@ -32076,37 +32104,30 @@ function InnerBarChart({
|
|
|
32076
32104
|
fill: "#212121",
|
|
32077
32105
|
fontSize: 10,
|
|
32078
32106
|
fontFamily: "Poppins"
|
|
32079
|
-
}, /*#__PURE__*/React__default["default"].createElement("tspan", {
|
|
32080
|
-
|
|
32081
|
-
dy: "0.71em"
|
|
32082
|
-
}, "Vendor"), /*#__PURE__*/React__default["default"].createElement("tspan", {
|
|
32107
|
+
}, chunks.map((chunk, i) => /*#__PURE__*/React__default["default"].createElement("tspan", {
|
|
32108
|
+
key: i,
|
|
32083
32109
|
x: 0,
|
|
32084
|
-
dy: "1.2em"
|
|
32085
|
-
},
|
|
32086
|
-
x: 0,
|
|
32087
|
-
dy: "1.2em"
|
|
32088
|
-
}, labelText)));
|
|
32110
|
+
dy: i === 0 ? "0.71em" : "1.2em"
|
|
32111
|
+
}, chunk))));
|
|
32089
32112
|
};
|
|
32090
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
32091
|
-
className: "w-full"
|
|
32092
|
-
}, /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
|
|
32113
|
+
return /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
|
|
32093
32114
|
width: "100%",
|
|
32094
|
-
height:
|
|
32115
|
+
height: "100%"
|
|
32095
32116
|
}, /*#__PURE__*/React__default["default"].createElement(recharts.BarChart, {
|
|
32096
|
-
data:
|
|
32117
|
+
data: brushInnerBarData,
|
|
32097
32118
|
margin: {
|
|
32098
32119
|
top: 30,
|
|
32099
32120
|
right: 30,
|
|
32100
32121
|
left: 20,
|
|
32101
|
-
bottom:
|
|
32122
|
+
bottom: 80
|
|
32102
32123
|
}
|
|
32103
32124
|
}, /*#__PURE__*/React__default["default"].createElement(recharts.CartesianGrid, {
|
|
32104
32125
|
strokeDasharray: "3 3",
|
|
32105
32126
|
vertical: false
|
|
32106
32127
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.XAxis, {
|
|
32107
|
-
dataKey: "
|
|
32128
|
+
dataKey: "label",
|
|
32108
32129
|
tick: /*#__PURE__*/React__default["default"].createElement(CustomizedTick, null),
|
|
32109
|
-
height:
|
|
32130
|
+
height: 80,
|
|
32110
32131
|
interval: 0
|
|
32111
32132
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
|
|
32112
32133
|
type: "number",
|
|
@@ -32114,17 +32135,16 @@ function InnerBarChart({
|
|
|
32114
32135
|
hide: true
|
|
32115
32136
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, {
|
|
32116
32137
|
content: /*#__PURE__*/React__default["default"].createElement(CustomTooltip, null)
|
|
32117
|
-
}), /*#__PURE__*/React__default["default"].createElement(recharts.Brush, {
|
|
32118
|
-
height: 30,
|
|
32119
|
-
travellerWidth: 10,
|
|
32120
|
-
startIndex: 0,
|
|
32121
|
-
endIndex: Math.min(6, processedData.length - 1),
|
|
32122
|
-
y: 380
|
|
32123
32138
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
|
|
32124
32139
|
dataKey: "total",
|
|
32125
32140
|
shape: /*#__PURE__*/React__default["default"].createElement(BarWithInner, null),
|
|
32126
32141
|
barSize: 36
|
|
32127
|
-
})
|
|
32142
|
+
}), /*#__PURE__*/React__default["default"].createElement(recharts.Brush, {
|
|
32143
|
+
height: 30,
|
|
32144
|
+
travellerWidth: 10,
|
|
32145
|
+
startIndex: 0,
|
|
32146
|
+
endIndex: Math.min(6, brushInnerBarData.length - 1)
|
|
32147
|
+
})));
|
|
32128
32148
|
}
|
|
32129
32149
|
|
|
32130
32150
|
const BrushChart = props => {
|
|
@@ -32132,7 +32152,8 @@ const BrushChart = props => {
|
|
|
32132
32152
|
width,
|
|
32133
32153
|
height,
|
|
32134
32154
|
brushInnerBarData,
|
|
32135
|
-
|
|
32155
|
+
brushBarIncData,
|
|
32156
|
+
brushBarBasketData,
|
|
32136
32157
|
brushAreaBarData,
|
|
32137
32158
|
title
|
|
32138
32159
|
} = props;
|
|
@@ -32157,9 +32178,9 @@ const BrushChart = props => {
|
|
|
32157
32178
|
}), selectedOption === "INC Sales & ROI" && /*#__PURE__*/React__default["default"].createElement(SeparatedLineBarChart, {
|
|
32158
32179
|
brushAreaBarData: brushAreaBarData
|
|
32159
32180
|
}), selectedOption === "INC Units" && /*#__PURE__*/React__default["default"].createElement(SingleChart, {
|
|
32160
|
-
barData:
|
|
32181
|
+
barData: brushBarIncData
|
|
32161
32182
|
}), selectedOption === "Basket Lift" && /*#__PURE__*/React__default["default"].createElement(SingleChart, {
|
|
32162
|
-
barData:
|
|
32183
|
+
barData: brushBarBasketData
|
|
32163
32184
|
}));
|
|
32164
32185
|
};
|
|
32165
32186
|
|