@ssplib/react-components 0.0.154 → 0.0.155
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.
|
@@ -92,7 +92,6 @@ function FetchAutoComplete({ name, url, title, customLoadingText, shouldRefetch
|
|
|
92
92
|
function handleAutoCompleteChange(element, value) {
|
|
93
93
|
context === null || context === void 0 ? void 0 : context.formSetValue(name, value ? value.id : '');
|
|
94
94
|
onChange(value ? value.id : -1);
|
|
95
|
-
console.log('Elemento: ', element);
|
|
96
95
|
}
|
|
97
96
|
if (defaultValue && list.length <= 0 && !dValue)
|
|
98
97
|
return (react_1.default.createElement(material_1.Grid, Object.assign({ item: true }, { xs, sm, md }),
|
|
@@ -107,7 +106,11 @@ function FetchAutoComplete({ name, url, title, customLoadingText, shouldRefetch
|
|
|
107
106
|
}), { hidden: true })),
|
|
108
107
|
react_1.default.createElement(material_1.Autocomplete, { loading: loading, loadingText: loadingText, options: list, defaultValue: dValue, isOptionEqualToValue: (op, value) => op.id === value.id, onChange: (e, v) => handleAutoCompleteChange(e.currentTarget, v), renderInput: (params) => {
|
|
109
108
|
var _a;
|
|
110
|
-
return (react_1.default.createElement(material_1.TextField, Object.assign({}, params, { size: 'small', fullWidth: true, placeholder: title, onFocus: onFocus, required: true, error: (0, lodash_get_1.default)(context === null || context === void 0 ? void 0 : context.errors, name) ? true : false, helperText: (_a = (0, lodash_get_1.default)(context === null || context === void 0 ? void 0 : context.errors, name)) === null || _a === void 0 ? void 0 : _a.message
|
|
109
|
+
return (react_1.default.createElement(material_1.TextField, Object.assign({}, params, { size: 'small', fullWidth: true, placeholder: title, onFocus: onFocus, required: true, error: (0, lodash_get_1.default)(context === null || context === void 0 ? void 0 : context.errors, name) ? true : false, helperText: (_a = (0, lodash_get_1.default)(context === null || context === void 0 ? void 0 : context.errors, name)) === null || _a === void 0 ? void 0 : _a.message, onChange: (e) => {
|
|
110
|
+
if (context) {
|
|
111
|
+
context.formRA = e.currentTarget.value;
|
|
112
|
+
}
|
|
113
|
+
} })));
|
|
111
114
|
}, size: 'small', fullWidth: true })));
|
|
112
115
|
}
|
|
113
116
|
exports.default = FetchAutoComplete;
|
package/context/form.d.ts
CHANGED