@codeleap/mobile 3.6.0 → 3.6.2
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/package.json
CHANGED
|
@@ -26,7 +26,7 @@ const defaultFilterFunction = (search: string, options: FormTypes.Options<any>)
|
|
|
26
26
|
})
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
const defaultProps:Partial<AutocompleteProps<any, boolean>> = {
|
|
29
|
+
const defaultProps: Partial<AutocompleteProps<any, boolean>> = {
|
|
30
30
|
getLabel(option) {
|
|
31
31
|
|
|
32
32
|
if (TypeGuards.isArray(option)) {
|
|
@@ -45,7 +45,7 @@ const defaultProps:Partial<AutocompleteProps<any, boolean>> = {
|
|
|
45
45
|
searchComponent: SearchInput,
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
export const Autocomplete = <T extends string|number = string, Multi extends boolean = false>(autocomplete:AutocompleteProps<T, Multi>) => {
|
|
48
|
+
export const Autocomplete = <T extends string | number = string, Multi extends boolean = false>(autocomplete: AutocompleteProps<T, Multi>) => {
|
|
49
49
|
const allProps = {
|
|
50
50
|
...defaultProps,
|
|
51
51
|
...autocomplete,
|
|
@@ -74,11 +74,11 @@ export const Autocomplete = <T extends string|number = string, Multi extends boo
|
|
|
74
74
|
searchComponent,
|
|
75
75
|
filterItems = defaultFilterFunction,
|
|
76
76
|
searchInputProps: searchProps = {},
|
|
77
|
-
onItemPressed = () => {},
|
|
77
|
+
onItemPressed = () => { },
|
|
78
78
|
listPlaceholder,
|
|
79
79
|
style,
|
|
80
80
|
loading: loadingProp = false,
|
|
81
|
-
|
|
81
|
+
listProps = {},
|
|
82
82
|
} = allProps
|
|
83
83
|
|
|
84
84
|
const isValueArray = TypeGuards.isArray(value) && multiple
|
|
@@ -207,7 +207,7 @@ export const Autocomplete = <T extends string|number = string, Multi extends boo
|
|
|
207
207
|
placeholder={placeholder}
|
|
208
208
|
debugName={debugName}
|
|
209
209
|
onTypingChange={(isTyping) => {
|
|
210
|
-
if (searchable && !!loadOptions) {
|
|
210
|
+
if (searchable && !!loadOptions && isTyping) {
|
|
211
211
|
setLoading(isTyping)
|
|
212
212
|
}
|
|
213
213
|
}}
|
|
@@ -54,7 +54,7 @@ export type AutocompleteProps<T = any, Multi extends boolean = false> = {
|
|
|
54
54
|
styles?: StylesOf<AutocompleteComposition>
|
|
55
55
|
style?: TextInputProps['style']
|
|
56
56
|
closeOnSelect?: boolean
|
|
57
|
-
|
|
57
|
+
|
|
58
58
|
keyboardAware?: GetKeyboardAwarePropsOptions
|
|
59
59
|
multiple?: Multi
|
|
60
60
|
itemProps?: Partial<
|
|
@@ -70,6 +70,7 @@ export type AutocompleteProps<T = any, Multi extends boolean = false> = {
|
|
|
70
70
|
debugName: string
|
|
71
71
|
searchComponent?: React.ComponentType<SearchInputProps>
|
|
72
72
|
listPlaceholder?: Partial<EmptyPlaceholderProps>
|
|
73
|
+
listProps?: Partial<Omit<FlatListProps<T>, 'renderItem'|'styles'|'style'>>
|
|
73
74
|
loading: boolean | ((isLoading: boolean) => boolean)
|
|
74
75
|
}
|
|
75
76
|
& Omit<FlatListProps<T>, 'renderItem'|'styles'|'style'>
|