@dartech/arsenal-ui 1.3.42 → 1.3.44
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/index.js +5 -6
- package/package.json +1 -1
package/index.js
CHANGED
@@ -3869,7 +3869,8 @@ const PropertyFiller = ({
|
|
3869
3869
|
}) => {
|
3870
3870
|
const {
|
3871
3871
|
control,
|
3872
|
-
clearErrors
|
3872
|
+
clearErrors,
|
3873
|
+
setValue
|
3873
3874
|
} = useFormContext();
|
3874
3875
|
const {
|
3875
3876
|
field: {
|
@@ -3905,11 +3906,9 @@ const PropertyFiller = ({
|
|
3905
3906
|
const handleFillOptionChange = useCallback(event => {
|
3906
3907
|
const selectedType = event.target.value;
|
3907
3908
|
if (selectedType === 'null') {
|
3908
|
-
|
3909
|
+
setValue(name, null);
|
3909
3910
|
clearErrors(name);
|
3910
|
-
// register(name, { value: null });
|
3911
3911
|
} else if (selectedType === 'widget') {
|
3912
|
-
clearErrors(name);
|
3913
3912
|
if (propertyType === PropertyType.JSON && value && typeof value !== 'string' && fillOption === 'dem_builder' && 'properties' in value) {
|
3914
3913
|
const definitionValue = Object.assign(Object.assign({}, value), {
|
3915
3914
|
properties: propertiesArrayToObject(value.property || [])
|
@@ -3920,7 +3919,7 @@ const PropertyFiller = ({
|
|
3920
3919
|
console.log('Stringify failed');
|
3921
3920
|
}
|
3922
3921
|
} else {
|
3923
|
-
|
3922
|
+
setValue(name, null);
|
3924
3923
|
}
|
3925
3924
|
} else if (selectedType === 'expression' || selectedType === 'string') {
|
3926
3925
|
onChange('');
|
@@ -3946,7 +3945,7 @@ const PropertyFiller = ({
|
|
3946
3945
|
}
|
3947
3946
|
setFillOption(selectedType);
|
3948
3947
|
clearErrors(name);
|
3949
|
-
}, [name, clearErrors, value, setFillOption, onChange, fillOption, propertyType]);
|
3948
|
+
}, [name, clearErrors, value, setFillOption, onChange, fillOption, propertyType, setValue]);
|
3950
3949
|
useEffect(() => {
|
3951
3950
|
if (value === undefined) {
|
3952
3951
|
onChange(null);
|