@pdg/react-form 1.0.40 → 1.0.42
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.
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const IconFormIcon: import("@emotion/styled").StyledComponent<
|
|
2
|
+
export declare const IconFormIcon: import("@emotion/styled").StyledComponent<import("../FormIcon").FormIconProps & import("react").RefAttributes<HTMLAnchorElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
3
3
|
export declare const ChildrenSpan: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
@@ -33,6 +33,7 @@ export interface FormAutocompleteProps extends CommonSxProps, Omit<FormValueItem
|
|
|
33
33
|
onRenderTag?: (item: FormAutocompleteItem) => ReactNode;
|
|
34
34
|
onValue?: (value: FormAutocompleteValue) => FormAutocompleteValue;
|
|
35
35
|
onAddItem?: (item: FormAutocompleteItem) => boolean | Promise<boolean>;
|
|
36
|
+
getOptionDisabled?: (item: FormAutocompleteItem) => boolean;
|
|
36
37
|
}
|
|
37
38
|
export declare const FormAutocompleteDefaultProps: Pick<FormAutocompleteProps, 'formValueSeparator' | 'noOptionsText'>;
|
|
38
39
|
export interface FormAutocompleteCommands extends FormValueItemBaseCommands, FormArrayValueItemCommands, FormItemsValueItemCommands<FormAutocompleteItem>, FormMultipleValueItemCommands, FormLoadingValueItemCommands {
|
package/dist/index.esm.js
CHANGED
|
@@ -4151,12 +4151,12 @@ NumberFormatCustom.displayName = 'NumberFormatCustom';var FormNumberDefaultProps
|
|
|
4151
4151
|
var muiInputProps = useMemo(function () {
|
|
4152
4152
|
var inputProps = {
|
|
4153
4153
|
className: readOnly ? 'Mui-disabled' : undefined,
|
|
4154
|
-
allowLeadingZeros: allowLeadingZeros,
|
|
4155
|
-
allowNegative: allowNegative,
|
|
4154
|
+
allowLeadingZeros: !!allowLeadingZeros,
|
|
4155
|
+
allowNegative: !!allowNegative,
|
|
4156
4156
|
thousandSeparator: thousandSeparator,
|
|
4157
4157
|
prefix: prefix,
|
|
4158
4158
|
suffix: suffix,
|
|
4159
|
-
readOnly: readOnly,
|
|
4159
|
+
readOnly: !!readOnly,
|
|
4160
4160
|
tabIndex: readOnly ? -1 : tabIndex,
|
|
4161
4161
|
};
|
|
4162
4162
|
if (allowDecimal) {
|
|
@@ -7566,7 +7566,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
7566
7566
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
7567
7567
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
7568
7568
|
//----------------------------------------------------------------------------------------------------------------
|
|
7569
|
-
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, initLoading = _a.loading, initItems = _a.items, initValue = _a.value, initData = _a.data, initError = _a.error, initHelperText = _a.helperText, initDisabled = _a.disabled, readOnly = _a.readOnly, required = _a.required, exceptValue = _a.exceptValue, width = _a.width, placeholder = _a.placeholder, multiple = _a.multiple, formValueSeparator = _a.formValueSeparator, formValueSort = _a.formValueSort, disablePortal = _a.disablePortal, noOptionsText = _a.noOptionsText, loadingText = _a.loadingText, limitTags = _a.limitTags, openOnFocus = _a.openOnFocus, disableClearable = _a.disableClearable, async = _a.async, hidden = _a.hidden, onLoadItems = _a.onLoadItems, onAsyncLoadValueItem = _a.onAsyncLoadValueItem, onRenderItem = _a.onRenderItem, onRenderTag = _a.onRenderTag, onAddItem = _a.onAddItem,
|
|
7569
|
+
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, initLoading = _a.loading, initItems = _a.items, initValue = _a.value, initData = _a.data, initError = _a.error, initHelperText = _a.helperText, initDisabled = _a.disabled, readOnly = _a.readOnly, required = _a.required, exceptValue = _a.exceptValue, width = _a.width, placeholder = _a.placeholder, multiple = _a.multiple, formValueSeparator = _a.formValueSeparator, formValueSort = _a.formValueSort, disablePortal = _a.disablePortal, noOptionsText = _a.noOptionsText, loadingText = _a.loadingText, limitTags = _a.limitTags, openOnFocus = _a.openOnFocus, disableClearable = _a.disableClearable, async = _a.async, hidden = _a.hidden, onLoadItems = _a.onLoadItems, onAsyncLoadValueItem = _a.onAsyncLoadValueItem, onRenderItem = _a.onRenderItem, onRenderTag = _a.onRenderTag, onAddItem = _a.onAddItem, getOptionDisabled = _a.getOptionDisabled,
|
|
7570
7570
|
//----------------------------------------------------------------------------------------------------------------
|
|
7571
7571
|
onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate,
|
|
7572
7572
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -7997,7 +7997,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
7997
7997
|
}
|
|
7998
7998
|
}, [multiple, getFinalValue, value, setValue, onValueChangeByUser, name, onRequestSearchSubmit, onAddItem]);
|
|
7999
7999
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
8000
|
-
return (React__default.createElement(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; }, 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.createElement("li", __assign$6({}, props, { key: option.value }), onRenderItem ? onRenderItem(option) : option.label)); }, onInputChange: function (event, newInputValue, reason) {
|
|
8000
|
+
return (React__default.createElement(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: getOptionDisabled, 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.createElement("li", __assign$6({}, props, { key: option.value }), onRenderItem ? onRenderItem(option) : option.label)); }, onInputChange: function (event, newInputValue, reason) {
|
|
8001
8001
|
if (reason === 'input') {
|
|
8002
8002
|
setInputValue(newInputValue);
|
|
8003
8003
|
}
|