@arquimedes.co/eureka-forms 2.0.37 → 2.0.38-test
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.
|
@@ -19,7 +19,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
19
19
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
20
|
};
|
|
21
21
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
-
import React, { useContext, useMemo } from 'react';
|
|
22
|
+
import React, { useContext, useEffect, useMemo } from 'react';
|
|
23
23
|
import { ClassifierOptionTypes } from '../../../constants/FormStepTypes';
|
|
24
24
|
import StepComponent from '../../Step';
|
|
25
25
|
import RoundedSmartSelect from '../../../Shared/RoundedSmartSelect/RoundedSmartSelect';
|
|
@@ -95,6 +95,11 @@ function ClassifierSelectorStep(_a) {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
|
+
useEffect(function () {
|
|
99
|
+
if (value && !options.find(function (option) { return option.value === (value === null || value === void 0 ? void 0 : value.value); })) {
|
|
100
|
+
onChange('');
|
|
101
|
+
}
|
|
102
|
+
}, [options]);
|
|
98
103
|
return (_jsxs(StepFillerContainer, __assign({ step: step }, { children: [_jsx(MaterialInputContainer, __assign({ step: step, editable: editable }, { children: _jsx(RoundedSmartSelect, __assign({}, field, { inputRef: ref, value: value, disabled: false, loading: false, options: options, cantEdit: !editable || postview, fullWidth: true, backgroundColor: (_c = formStyle.stepBackgroundColor) !== null && _c !== void 0 ? _c : 'white', label: step.label ? step.label : classifier.name, required: step.required, height: '31px', searchable: step.searchable, icon: undefined, helperTextColor: formStyle.descriptionTextColor, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, errorColor: formStyle.errorColor, color: formStyle.textColor, containerMargin: "0px", handleUpdate: onChange, getOptionSelected: function (option, value) {
|
|
99
104
|
return option.value === (value === null || value === void 0 ? void 0 : value.value);
|
|
100
105
|
}, helperText: (_e = (_d = error === null || error === void 0 ? void 0 : error.message) === null || _d === void 0 ? void 0 : _d.toString()) !== null && _e !== void 0 ? _e : step.description, error: !!error })) })), mapNestedOption()] })));
|
|
@@ -82,8 +82,8 @@ function SelectorStep(_a) {
|
|
|
82
82
|
});
|
|
83
83
|
}, idDependencies.map(function (id) { return dependencies[id].value; }));
|
|
84
84
|
useEffect(function () {
|
|
85
|
-
if (
|
|
86
|
-
|
|
85
|
+
if (value &&
|
|
86
|
+
!filteredOptions.find(function (option) { return option.value === (value === null || value === void 0 ? void 0 : value.value); })) {
|
|
87
87
|
onChange('');
|
|
88
88
|
}
|
|
89
89
|
}, [filteredOptions]);
|
package/package.json
CHANGED