@pdg/react-form 1.0.46 → 1.0.47
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/dist/index.js
CHANGED
|
@@ -7998,8 +7998,16 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
7998
7998
|
go();
|
|
7999
7999
|
}
|
|
8000
8000
|
}, [multiple, getFinalValue, value, setValue, onValueChangeByUser, name, onRequestSearchSubmit, onAddItem]);
|
|
8001
|
+
var handleGetOptionDisabled = React.useCallback(function (option) {
|
|
8002
|
+
if (getOptionDisabled) {
|
|
8003
|
+
return option.disabled || getOptionDisabled(option);
|
|
8004
|
+
}
|
|
8005
|
+
else {
|
|
8006
|
+
return !!option.disabled;
|
|
8007
|
+
}
|
|
8008
|
+
}, [getOptionDisabled]);
|
|
8001
8009
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
8002
|
-
return (React__default["default"].createElement(material.Autocomplete, { options: items || [], className: classNames$1(className, 'FormValueItem', 'FormAutocomplete'), sx: sx, multiple: multiple, fullWidth: !width && fullWidth, openOnFocus: openOnFocus, disableClearable: disableClearable, disablePortal: disablePortal, noOptionsText: noOptionsText, value: componentValue, style: style, isOptionEqualToValue: function (option, value) { return option.value === value.value; }, getOptionDisabled:
|
|
8010
|
+
return (React__default["default"].createElement(material.Autocomplete, { options: items || [], className: classNames$1(className, 'FormValueItem', 'FormAutocomplete'), sx: sx, multiple: multiple, fullWidth: !width && fullWidth, openOnFocus: openOnFocus, disableClearable: disableClearable, disablePortal: disablePortal, noOptionsText: noOptionsText, value: componentValue, style: style, isOptionEqualToValue: function (option, value) { return option.value === value.value; }, getOptionDisabled: handleGetOptionDisabled, disabled: disabled, readOnly: readOnly, loading: loading || isOnGetItemLoading, loadingText: loadingText, limitTags: limitTags, onChange: function (e, value, reason, details) { return handleChange(value, reason, details); }, renderOption: function (props, option) { return (React__default["default"].createElement("li", __assign$6({}, props, { key: option.value }), onRenderItem ? onRenderItem(option) : option.label)); }, onInputChange: function (event, newInputValue, reason) {
|
|
8003
8011
|
if (reason === 'input') {
|
|
8004
8012
|
setInputValue(newInputValue);
|
|
8005
8013
|
}
|