|
1 | 1 | /* eslint-disable no-constant-condition */
|
2 | 2 | import * as React from 'react';
|
3 |
| -import PropTypes from 'prop-types'; |
4 | 3 | import {
|
5 | 4 | setRef,
|
6 | 5 | useEventCallback,
|
@@ -992,157 +991,3 @@ export default function useAutocomplete(props) {
|
992 | 991 | groupedOptions,
|
993 | 992 | };
|
994 | 993 | }
|
995 |
| - |
996 |
| -useAutocomplete.propTypes = { |
997 |
| - /** |
998 |
| - * If `true`, the portion of the selected suggestion that has not been typed by the user, |
999 |
| - * known as the completion string, appears inline after the input cursor in the textbox. |
1000 |
| - * The inline completion string is visually highlighted and has a selected state. |
1001 |
| - */ |
1002 |
| - autoComplete: PropTypes.bool, |
1003 |
| - /** |
1004 |
| - * If `true`, the first option is automatically highlighted. |
1005 |
| - */ |
1006 |
| - autoHighlight: PropTypes.bool, |
1007 |
| - /** |
1008 |
| - * If `true`, the selected option becomes the value of the input |
1009 |
| - * when the Autocomplete loses focus unless the user chooses |
1010 |
| - * a different option or changes the character string in the input. |
1011 |
| - */ |
1012 |
| - autoSelect: PropTypes.bool, |
1013 |
| - /** |
1014 |
| - * Override or extend the styles applied to the component. |
1015 |
| - * See [CSS API](#css) below for more details. |
1016 |
| - */ |
1017 |
| - classes: PropTypes.object, |
1018 |
| - /** |
1019 |
| - * @ignore |
1020 |
| - */ |
1021 |
| - className: PropTypes.string, |
1022 |
| - /** |
1023 |
| - * If `true`, clear all values when the user presses escape and the popup is closed. |
1024 |
| - */ |
1025 |
| - clearOnEscape: PropTypes.bool, |
1026 |
| - /** |
1027 |
| - * The component name that is using this hook. Used for warnings. |
1028 |
| - */ |
1029 |
| - componentName: PropTypes.string, |
1030 |
| - /** |
1031 |
| - * If `true`, the popup will ignore the blur event if the input is filled. |
1032 |
| - * You can inspect the popup markup with your browser tools. |
1033 |
| - * Consider this option when you need to customize the component. |
1034 |
| - */ |
1035 |
| - debug: PropTypes.bool, |
1036 |
| - /** |
1037 |
| - * The default input value. Use when the component is not controlled. |
1038 |
| - */ |
1039 |
| - defaultValue: PropTypes.any, |
1040 |
| - /** |
1041 |
| - * If `true`, the input can't be cleared. |
1042 |
| - */ |
1043 |
| - disableClearable: PropTypes.bool, |
1044 |
| - /** |
1045 |
| - * If `true`, the popup won't close when a value is selected. |
1046 |
| - */ |
1047 |
| - disableCloseOnSelect: PropTypes.bool, |
1048 |
| - /** |
1049 |
| - * If `true`, will allow focus on disabled items. |
1050 |
| - */ |
1051 |
| - disabledItemsFocusable: PropTypes.bool, |
1052 |
| - /** |
1053 |
| - * If `true`, the list box in the popup will not wrap focus. |
1054 |
| - */ |
1055 |
| - disableListWrap: PropTypes.bool, |
1056 |
| - /** |
1057 |
| - * A filter function that determins the options that are eligible. |
1058 |
| - * |
1059 |
| - * @param {any} options The options to render. |
1060 |
| - * @param {object} state The state of the component. |
1061 |
| - * @returns {boolean} |
1062 |
| - */ |
1063 |
| - filterOptions: PropTypes.func, |
1064 |
| - /** |
1065 |
| - * If `true`, hide the selected options from the list box. |
1066 |
| - */ |
1067 |
| - filterSelectedOptions: PropTypes.bool, |
1068 |
| - /** |
1069 |
| - * If `true`, the Autocomplete is free solo, meaning that the user input is not bound to provided options. |
1070 |
| - */ |
1071 |
| - freeSolo: PropTypes.bool, |
1072 |
| - /** |
1073 |
| - * Used to determine the disabled state for a given option. |
1074 |
| - */ |
1075 |
| - getOptionDisabled: PropTypes.func, |
1076 |
| - /** |
1077 |
| - * Used to determine the string value for a given option. |
1078 |
| - * It's used to fill the input (and the list box options if `renderOption` is not provided). |
1079 |
| - */ |
1080 |
| - getOptionLabel: PropTypes.func, |
1081 |
| - /** |
1082 |
| - * If provided, the options will be grouped under the returned string. |
1083 |
| - * The groupBy value is also used as the text for group headings when `renderGroup` is not provided. |
1084 |
| - * |
1085 |
| - * @param {any} options The option to group. |
1086 |
| - * @returns {string} |
1087 |
| - */ |
1088 |
| - groupBy: PropTypes.func, |
1089 |
| - /** |
1090 |
| - * This prop is used to help implement the accessibility logic. |
1091 |
| - * If you don't provide this prop. It falls back to a randomly generated id. |
1092 |
| - */ |
1093 |
| - id: PropTypes.string, |
1094 |
| - /** |
1095 |
| - * If `true`, the highlight can move to the input. |
1096 |
| - */ |
1097 |
| - includeInputInList: PropTypes.bool, |
1098 |
| - /** |
1099 |
| - * If `true`, `value` must be an array and the menu will support multiple selections. |
1100 |
| - */ |
1101 |
| - multiple: PropTypes.bool, |
1102 |
| - /** |
1103 |
| - * Callback fired when the value changes. |
1104 |
| - * |
1105 |
| - * @param {object} event The event source of the callback |
1106 |
| - * @param {any} value |
1107 |
| - * @param {string} reason One of "create-option", "select-option", "remove-option", "blur" or "clear". |
1108 |
| - */ |
1109 |
| - onChange: PropTypes.func, |
1110 |
| - /** |
1111 |
| - * Callback fired when the popup requests to be closed. |
1112 |
| - * Use in controlled mode (see open). |
1113 |
| - * |
1114 |
| - * @param {object} event The event source of the callback. |
1115 |
| - */ |
1116 |
| - onClose: PropTypes.func, |
1117 |
| - /** |
1118 |
| - * Callback fired when the text input value changes. |
1119 |
| - * |
1120 |
| - * @param {object} event The event source of the callback. |
1121 |
| - * @param {string} value The new value of the text input. |
1122 |
| - * @param {string} reason One of "input" (user input) or "reset" (programmatic change). |
1123 |
| - */ |
1124 |
| - onInputChange: PropTypes.func, |
1125 |
| - /** |
1126 |
| - * Callback fired when the popup requests to be opened. |
1127 |
| - * Use in controlled mode (see open). |
1128 |
| - * |
1129 |
| - * @param {object} event The event source of the callback. |
1130 |
| - */ |
1131 |
| - onOpen: PropTypes.func, |
1132 |
| - /** |
1133 |
| - * Control the popup` open state. |
1134 |
| - */ |
1135 |
| - open: PropTypes.bool, |
1136 |
| - /** |
1137 |
| - * If `true`, the popup will open on input focus. |
1138 |
| - */ |
1139 |
| - openOnFocus: PropTypes.bool, |
1140 |
| - /** |
1141 |
| - * Array of options. |
1142 |
| - */ |
1143 |
| - options: PropTypes.array, |
1144 |
| - /** |
1145 |
| - * The input value. |
1146 |
| - */ |
1147 |
| - value: PropTypes.any, |
1148 |
| -}; |
0 commit comments