sag_components 1.0.725 → 1.0.727
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.
|
@@ -10,7 +10,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
10
10
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
|
|
11
11
|
/* eslint-disable no-nested-ternary */
|
|
12
12
|
const DropdownWrapper = exports.DropdownWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n display: flex;\n flex-direction: column;\n align-content: center;\n justify-content: center;\n align-items: flex-start;\n width: ", "; \n font-family: \"Poppins\", sans-serif;\n font-weight: 400;\n font-size: 14px;\n border-radius: 10px;\n"])), props => props.width || '300px');
|
|
13
|
-
const Label = exports.Label = _styledComponents.default.label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\n font-size: ", ";\n font-weight: 400;\n padding-inline-end: 5px;\n padding-inline-start: 5px;\n margin-right: 10px;\n z-index: 2;\n color: ", ";\n background-color:
|
|
13
|
+
const Label = exports.Label = _styledComponents.default.label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\n font-size: ", ";\n font-weight: 400;\n padding-inline-end: 5px;\n padding-inline-start: 5px;\n margin-right: 10px;\n z-index: 2;\n color: ", ";\n background-color: ", " ;\n position: absolute;\n top: ", ";\n left: ", ";\n font-family: Poppins; \n transform: translateY(-50%);\n transition: ", " ;\n display: flex;\n align-items: center;\n box-sizing: border-box;\n gap: 4px;\n &:hover {\n cursor: ", ";\n }\n"])), props => props.isFocused || props.hasValue ? '14px' : '14px', props => props.error ? 'red' : props.disabled ? '#888' : props.labelColor, props => props.showLabelOnTop ? 'white' : 'transparent', props => props.isFocused || props.hasValue ? '0px' : '27px', props => props.isFocused || props.hasValue ? '23px' : '10px', props => props.showLabelOnTop ? 'top 0.3s ease, font-size 0.3s ease, color 0.3s ease' : '', props => props.disabled ? 'not-allowed' : 'pointer');
|
|
14
14
|
const InputContainer = exports.InputContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\n display: flex; \n flex-direction: row;\n flex-wrap: nowrap; \n justify-content: flex-start;\n align-content: center; \n white-space: pre-wrap;\n align-items: center;\n overflow: hidden;\n padding: 0 5px 0 0;\n margin-bottom: 8px;\n gap: 4px;\n width: 100%;\n height: 100%; \n box-sizing: border-box;\n background-color: transparent; \n border: 1px solid ", ";\n font-family: \"Poppins\", sans-serif;\n font-weight: 400;\n font-size: 14px;\n border-radius: 12px;\n outline: none;\n color: ", ";\n \n &:hover {\n border: 1px solid ", ";\n cursor: ", ";\n }\n\n &:focus { \n border: 1px solid ", "; \n }\n \n"])), props => props.disabled ? '#bdbdbd' : props.error ? 'red' : '#B1B1B1', props => props.disabled ? '#888' : '#212121', props => props.disabled ? '#bdbdbd' : props.error ? 'red' : props.labelColor || '#212121', props => props.disabled ? 'not-allowed' : 'pointer', props => props.disabled ? '#bdbdbd' : props.error ? 'red' : props.labelColor || '#212121');
|
|
15
15
|
const InputSubContainer = exports.InputSubContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n\n display: flex; \n flex-direction: column;\n flex-wrap: nowrap; \n align-content: center; \n align-items: flex-start;\n justify-content: center;\n white-space: pre-wrap;\n overflow: hidden;\n padding: 10px 4px 10px 10px;\n width: 100%;\n height: 100%;\n min-height: 53px;\n box-sizing: border-box;\n background-color: transparent; \n border-radius: 12px;\n outline: none;\n color: ", "; \n"])), props => props.disabled ? '#888' : '#212121');
|
|
16
16
|
const StyledInput = exports.StyledInput = _styledComponents.default.input(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n width: calc(100% - 20px);\n height: 25px;\n font-family: Poppins;\n font-weight: 400;\n font-size: 14px;\n outline: none; \n background-color: transparent; \n color: ", "; \n border: none; \n"])), props => props.disabled ? '#888' : '#212121');
|
|
@@ -163,7 +163,8 @@ const DropdownSingleNew = _ref => {
|
|
|
163
163
|
disabled: disabled,
|
|
164
164
|
error: error,
|
|
165
165
|
errorMessage: errorMessage,
|
|
166
|
-
onClick: handleLabelClick
|
|
166
|
+
onClick: handleLabelClick,
|
|
167
|
+
showLabelOnTop: showLabelOnTop
|
|
167
168
|
}, getLabel(), getRequired()), /*#__PURE__*/_react.default.createElement(_DropdownSingleNew.StyledInput, {
|
|
168
169
|
className: "StyledInput",
|
|
169
170
|
ref: inputRef
|
|
@@ -10,7 +10,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
10
10
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
11
11
|
/* eslint-disable no-nested-ternary */
|
|
12
12
|
const DropdownWrapper = exports.DropdownWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n display: flex;\n flex-direction: column;\n align-content: center;\n justify-content: center;\n align-items: flex-start;\n width: ", "; \n font-family: \"Poppins\", sans-serif;\n font-weight: 400;\n font-size: 14px;\n border-radius: 10px; \n"])), props => props.width || '300px');
|
|
13
|
-
const Label = exports.Label = _styledComponents.default.label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", ";\n font-weight: 400;\n padding-inline-end: 5px;\n padding-inline-start: 5px;\n margin-right: 10px; \n z-index: 2;\n color: ", "
|
|
13
|
+
const Label = exports.Label = _styledComponents.default.label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", ";\n font-weight: 400;\n padding-inline-end: 5px;\n padding-inline-start: 5px;\n margin-right: 10px; \n z-index: 2;\n color: ", "; \n background-color: ", " ;\n position: absolute;\n top: ", ";\n left: ", ";\n font-family: Poppins; \n transform: translateY(-50%); \n transition: ", " ;\n display: flex;\n align-items: center;\n box-sizing: border-box;\n gap: 4px;\n &:hover {\n cursor: ", ";\n }\n"])), props => props.isFocused || props.hasValue ? '14px' : '14px', props => props.error ? 'red' : props.disabled ? '#888' : props.labelColor, props => props.showLabelOnTop ? 'white' : 'transparent', props => props.isFocused || props.hasValue ? '0px' : '28px', props => props.isFocused || props.hasValue ? '23px' : '10px', props => props.showLabelOnTop ? 'top 0.3s ease, font-size 0.3s ease, color 0.3s ease' : '', props => props.disabled ? 'not-allowed' : 'pointer');
|
|
14
14
|
const InputContainer = exports.InputContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\n display: flex; \n flex-direction: row;\n flex-wrap: nowrap; \n justify-content: flex-start;\n align-content: center; \n white-space: pre-wrap;\n align-items: center;\n overflow: hidden;\n padding: 0 5px 0 0;\n margin-bottom: 8px;\n gap: 4px;\n width: 100%;\n height: 100%; \n box-sizing: border-box;\n background-color: transparent; \n border: 1px solid ", ";\n font-family: \"Poppins\", sans-serif;\n font-weight: 400;\n font-size: 14px;\n border-radius: 12px;\n outline: none;\n color: ", ";\n \n &:hover {\n border: 1px solid ", ";\n cursor: ", ";\n }\n\n &:focus { \n border: 1px solid ", "; \n }\n \n"])), props => props.disabled ? '#bdbdbd' : props.error ? 'red' : '#B1B1B1', props => props.disabled ? '#888' : '#212121', props => props.disabled ? '#bdbdbd' : props.error ? 'red' : props.labelColor || '#212121', props => props.disabled ? 'not-allowed' : 'pointer', props => props.disabled ? '#bdbdbd' : props.error ? 'red' : props.labelColor || '#212121');
|
|
15
15
|
const InputSubContainer = exports.InputSubContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n\n display: flex; \n flex-direction: column;\n flex-wrap: nowrap; \n align-content: center; \n align-items: flex-start;\n justify-content: center;\n white-space: pre-wrap;\n overflow: hidden;\n padding: 10px 4px 10px 10px;\n width: 100%;\n height: 100%;\n min-height: 53px;\n box-sizing: border-box;\n background-color: transparent; \n border-radius: 12px;\n outline: none;\n color: ", "; \n"])), props => props.disabled ? '#888' : '#212121');
|
|
16
16
|
const StyledInput = exports.StyledInput = _styledComponents.default.input(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n width: calc(100% - 10px);\n height: 20px;\n font-family: Poppins;\n font-weight: 400;\n font-size: 14px;\n outline: none; \n background-color: transparent; \n color: ", "; \n border: none;\n"])), props => props.disabled ? '#888' : '#212121');
|
|
@@ -10,7 +10,6 @@ var _recharts = require("recharts");
|
|
|
10
10
|
var _CommonFunctions = require("./CommonFunctions");
|
|
11
11
|
var _TotalDoughnutChart = require("./TotalDoughnutChart.style");
|
|
12
12
|
var _Benchmark = require("./Benchmark");
|
|
13
|
-
/* TotalDoughnutChart */
|
|
14
13
|
const TotalDoughnutChart = props => {
|
|
15
14
|
var _DoughnutChartContain, _DoughnutChartContain2;
|
|
16
15
|
const {
|
|
@@ -63,15 +62,11 @@ const TotalDoughnutChart = props => {
|
|
|
63
62
|
}, []);
|
|
64
63
|
(0, _react.useEffect)(() => {
|
|
65
64
|
const MIN_RADIUS = 45;
|
|
66
|
-
if (!DoughnutChartContainerRef)
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
65
|
+
if (!DoughnutChartContainerRef) return;
|
|
69
66
|
const {
|
|
70
67
|
current
|
|
71
68
|
} = DoughnutChartContainerRef;
|
|
72
|
-
if (!current)
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
69
|
+
if (!current) return;
|
|
75
70
|
const DoughnutChartContainerWidth = current === null || current === void 0 ? void 0 : current.clientWidth;
|
|
76
71
|
const DoughnutChartContainerHeight = current === null || current === void 0 ? void 0 : current.clientHeight;
|
|
77
72
|
const resolutionFactor = zoomResolution && zoomResolution >= 1 ? zoomResolution : 1;
|
|
@@ -79,18 +74,15 @@ const TotalDoughnutChart = props => {
|
|
|
79
74
|
if (radius < MIN_RADIUS) {
|
|
80
75
|
radius = MIN_RADIUS;
|
|
81
76
|
}
|
|
82
|
-
console.log('radius', radius);
|
|
83
77
|
setDoughnutChartRadius(radius);
|
|
84
78
|
}, [height, width, DoughnutChartContainerRef === null || DoughnutChartContainerRef === void 0 ? void 0 : (_DoughnutChartContain = DoughnutChartContainerRef.current) === null || _DoughnutChartContain === void 0 ? void 0 : _DoughnutChartContain.clientWidth, DoughnutChartContainerRef === null || DoughnutChartContainerRef === void 0 ? void 0 : (_DoughnutChartContain2 = DoughnutChartContainerRef.current) === null || _DoughnutChartContain2 === void 0 ? void 0 : _DoughnutChartContain2.clientHeight, zoomResolution]);
|
|
85
79
|
const displayLegendValue = row => /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.LegendFormattedValue, {
|
|
86
|
-
id: "LegendFormattedValue",
|
|
87
80
|
style: {
|
|
88
81
|
fontWeight: itemsBoldedValues ? '700' : '500'
|
|
89
82
|
}
|
|
90
|
-
}, !isPercent && row.value && currencySign ? (0, _CommonFunctions.getCurrencySign)(currencyType, row.value) : '', !isPercent && row.value ? dotCutTrenty(row) : !isPercent && 'No Data', !isPercent && row.value && dotCut ? (0, _CommonFunctions.getFormattedUnits)(row.value) : '', !isPercent && row.value && itemsPercentagesValueAside && " (".concat(Math.round(row.value / value * 100), "%)"), isPercent && row.value && "".concat(row.value.toFixed(1), "%"));
|
|
83
|
+
}, !isPercent && row.value && currencySign ? (0, _CommonFunctions.getCurrencySign)(currencyType, row.value) : '', !isPercent && row.value !== undefined && row.value !== null ? dotCutTrenty(row) : !isPercent && 'No Data', !isPercent && row.value && dotCut ? (0, _CommonFunctions.getFormattedUnits)(row.value) : '', !isPercent && row.value && itemsPercentagesValueAside && " (".concat(Math.round(row.value / value * 100), "%)"), isPercent && row.value && "".concat(row.value.toFixed(1), "%"));
|
|
91
84
|
return /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.ControlsContainer, {
|
|
92
85
|
className: className,
|
|
93
|
-
id: "ControlsContainer",
|
|
94
86
|
height: height,
|
|
95
87
|
width: width,
|
|
96
88
|
textcolor: textcolor
|
|
@@ -98,22 +90,11 @@ const TotalDoughnutChart = props => {
|
|
|
98
90
|
id: "Controls",
|
|
99
91
|
height: height,
|
|
100
92
|
width: width
|
|
101
|
-
}, !hideTitleAndValue && /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.TitleAndValueContainer, {
|
|
102
|
-
id: "TitleAndValueContainer"
|
|
103
|
-
}, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.Title, {
|
|
104
|
-
id: "Title",
|
|
93
|
+
}, !hideTitleAndValue && /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.TitleAndValueContainer, null, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.Title, {
|
|
105
94
|
width: width
|
|
106
|
-
}, title), /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.CurrencySignAndFormattedValueContainer, {
|
|
107
|
-
id: "CurrencySignAndFormattedValueContainer"
|
|
108
|
-
}, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.FormattedValue, {
|
|
109
|
-
id: "FormattedValue",
|
|
95
|
+
}, title), /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.CurrencySignAndFormattedValueContainer, null, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.FormattedValue, {
|
|
110
96
|
width: width
|
|
111
|
-
}, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.CurrencySign, {
|
|
112
|
-
id: "CurrencySign"
|
|
113
|
-
}, currencySign ? (0, _CommonFunctions.getCurrencySign)(currencyType, value) : ''), dotCut ? (0, _CommonFunctions.getFormattedValue)(value && Math.abs(value) > 0 && value % 1 !== 0 ? value === null || value === void 0 ? void 0 : value.toFixed(2) : value) : (0, _CommonFunctions.getNumberWithCommas)(value), dotCut ? (0, _CommonFunctions.getFormattedUnits)(value) : ''), addingBenchmark && /*#__PURE__*/_react.default.createElement(_Benchmark.Benchmark, null))), /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.DoughnutChartAndLegendContainer, {
|
|
114
|
-
id: "DoughnutChartAndLegendContainer"
|
|
115
|
-
}, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.DoughnutChartContainer, {
|
|
116
|
-
id: "DoughnutChartContainer",
|
|
97
|
+
}, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.CurrencySign, null, currencySign ? (0, _CommonFunctions.getCurrencySign)(currencyType, value) : ''), dotCut ? (0, _CommonFunctions.getFormattedValue)(value && Math.abs(value) > 0 && value % 1 !== 0 ? value === null || value === void 0 ? void 0 : value.toFixed(2) : value) : (0, _CommonFunctions.getNumberWithCommas)(value), dotCut ? (0, _CommonFunctions.getFormattedUnits)(value) : ''), addingBenchmark && /*#__PURE__*/_react.default.createElement(_Benchmark.Benchmark, null))), /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.DoughnutChartAndLegendContainer, null, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.DoughnutChartContainer, {
|
|
117
98
|
width: width,
|
|
118
99
|
height: height,
|
|
119
100
|
ref: DoughnutChartContainerRef
|
|
@@ -133,18 +114,11 @@ const TotalDoughnutChart = props => {
|
|
|
133
114
|
value: value,
|
|
134
115
|
isPercent: isPercent
|
|
135
116
|
})
|
|
136
|
-
}), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, null)))), /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.LegendContainer, {
|
|
137
|
-
id: "LegendContainer"
|
|
138
|
-
}, legendData.map(row => /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.LegendControlsContainer, {
|
|
139
|
-
id: "LegendControlsContainer",
|
|
117
|
+
}), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, null)))), /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.LegendContainer, null, legendData.map(row => /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.LegendControlsContainer, {
|
|
140
118
|
key: row.name
|
|
141
119
|
}, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.LegendColorRectangle, {
|
|
142
|
-
id: "LegendColorRectangle",
|
|
143
120
|
color: row.color
|
|
144
|
-
}), /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.LegendTitleAndFormatedValueContainer, {
|
|
145
|
-
id: "LegendTitleAndFormatedValueContainer"
|
|
146
|
-
}, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.LegendTitle, {
|
|
147
|
-
id: "LegendTitle",
|
|
121
|
+
}), /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.LegendTitleAndFormatedValueContainer, null, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.LegendTitle, {
|
|
148
122
|
style: {
|
|
149
123
|
flexDirection: itemsValuesSeparateLine ? 'column' : 'row',
|
|
150
124
|
alignItems: itemsValuesSeparateLine ? 'baseline' : 'center'
|
|
@@ -154,6 +128,7 @@ const TotalDoughnutChart = props => {
|
|
|
154
128
|
exports.TotalDoughnutChart = TotalDoughnutChart;
|
|
155
129
|
var _default = exports.default = TotalDoughnutChart;
|
|
156
130
|
TotalDoughnutChart.defaultProps = {
|
|
131
|
+
className: '',
|
|
157
132
|
title: '',
|
|
158
133
|
value: 0,
|
|
159
134
|
addingBenchmark: false,
|