sag_components 1.0.89 → 1.0.90
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.
|
@@ -69,6 +69,15 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
69
69
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
70
70
|
currentOption = _useState4[0],
|
|
71
71
|
setCurrentOption = _useState4[1];
|
|
72
|
+
// const [valueState, setValueState] = useState(null);
|
|
73
|
+
|
|
74
|
+
// useEffect(() => {
|
|
75
|
+
// {
|
|
76
|
+
// if (defaultValue && getOptionByLabel(defaultValue) != null)
|
|
77
|
+
// setValueState(getOptionByLabel(defaultValue));
|
|
78
|
+
// }
|
|
79
|
+
// }, []);
|
|
80
|
+
|
|
72
81
|
(0, _react.useEffect)(function () {
|
|
73
82
|
var delayDebounceFn = setTimeout(function () {
|
|
74
83
|
onInputChange(currentInputValue);
|
|
@@ -136,10 +145,12 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
136
145
|
});
|
|
137
146
|
};
|
|
138
147
|
var getOptionByLabel = function getOptionByLabel(label) {
|
|
148
|
+
if (!label) return null;
|
|
139
149
|
if (!options) return null;
|
|
140
150
|
var foundOption = options.find(function (item) {
|
|
141
151
|
return item.label == label;
|
|
142
152
|
});
|
|
153
|
+
console.log(foundOption);
|
|
143
154
|
if (!foundOption) return null;
|
|
144
155
|
return foundOption;
|
|
145
156
|
};
|
|
@@ -171,7 +182,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
171
182
|
onInputChangeHandler(event, newInputValue);
|
|
172
183
|
},
|
|
173
184
|
disablePortal: true,
|
|
174
|
-
defaultValue:
|
|
185
|
+
defaultValue: getOptionByLabel(defaultValue),
|
|
175
186
|
id: "combo-box",
|
|
176
187
|
options: options,
|
|
177
188
|
sx: {
|