sag_components 1.0.828 → 1.0.830
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.
|
@@ -38,6 +38,7 @@ const QuarterPicker = _ref => {
|
|
|
38
38
|
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
|
39
39
|
const [value, setValue] = (0, _react.useState)('');
|
|
40
40
|
const [startDateValue, setStartDateValue] = (0, _react.useState)(null);
|
|
41
|
+
const [availableQuartersList, setAvailableQuartersList] = (0, _react.useState)([]);
|
|
41
42
|
const inputRef = (0, _react.useRef)(null);
|
|
42
43
|
(0, _react.useEffect)(() => {
|
|
43
44
|
const handleClickOutside = event => {
|
|
@@ -62,6 +63,13 @@ const QuarterPicker = _ref => {
|
|
|
62
63
|
setValue(selectedValue);
|
|
63
64
|
}
|
|
64
65
|
}, [selectedValue]);
|
|
66
|
+
(0, _react.useEffect)(() => {
|
|
67
|
+
if (availableQuarters) {
|
|
68
|
+
setAvailableQuartersList(availableQuarters);
|
|
69
|
+
} else {
|
|
70
|
+
setAvailableQuartersList([]);
|
|
71
|
+
}
|
|
72
|
+
}, [availableQuarters]);
|
|
65
73
|
const onChangeDate = startDate => {
|
|
66
74
|
if (startDate) {
|
|
67
75
|
setIsOpen(!isOpen);
|
|
@@ -129,7 +137,7 @@ const QuarterPicker = _ref => {
|
|
|
129
137
|
value: value,
|
|
130
138
|
setValue: setValue,
|
|
131
139
|
startDateValue: startDateValue,
|
|
132
|
-
availableQuarters:
|
|
140
|
+
availableQuarters: availableQuartersList
|
|
133
141
|
}));
|
|
134
142
|
};
|
|
135
143
|
QuarterPicker.defaultProps = {
|