@codeleap/mobile 3.2.9 → 3.2.10

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeleap/mobile",
3
- "version": "3.2.9",
3
+ "version": "3.2.10",
4
4
  "main": "src/index.ts",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -75,6 +75,7 @@ export const Autocomplete = <T extends string|number = string, Multi extends boo
75
75
  filterItems = defaultFilterFunction,
76
76
  searchInputProps: searchProps = {},
77
77
  onItemPressed = () => {},
78
+ style,
78
79
  ...listProps
79
80
  } = allProps
80
81
 
@@ -116,6 +117,8 @@ export const Autocomplete = <T extends string|number = string, Multi extends boo
116
117
 
117
118
  const listStyles = useNestedStylesByKey('list', variantStyles)
118
119
 
120
+ const searchInputStyles = useNestedStylesByKey('searchInput', variantStyles)
121
+
119
122
  const currentOptions = searchable ? filteredOptions : defaultOptions
120
123
 
121
124
  const select = (selectedValue) => {
@@ -197,7 +200,7 @@ export const Autocomplete = <T extends string|number = string, Multi extends boo
197
200
 
198
201
  const Search = searchComponent
199
202
 
200
- return <View style={variantStyles.wrapper}>
203
+ return <View style={[variantStyles.wrapper, style]}>
201
204
  <Search
202
205
  placeholder={placeholder}
203
206
  debugName={debugName}
@@ -209,6 +212,7 @@ export const Autocomplete = <T extends string|number = string, Multi extends boo
209
212
  debounce={!!loadOptions ? 800 : null}
210
213
  onSearchChange={onChangeSearch}
211
214
  hideErrorMessage
215
+ styles={searchInputStyles}
212
216
  {...searchProps}
213
217
  />
214
218
 
@@ -14,11 +14,15 @@ import { SearchInputProps, TextInputProps } from '../TextInput'
14
14
  import { Touchable } from '../Touchable'
15
15
  import { AutocompleteComposition } from './styles'
16
16
 
17
+ type AutocompleteOption<T = any> = FormTypes.Options<T> & {
18
+ item?: any
19
+ }
20
+
17
21
  export type AutocompleteRenderFNProps<T> = {
18
22
  styles: StylesOf<AutocompleteComposition>
19
23
  onPress: () => void
20
24
  isSelected?: boolean
21
- item: FormTypes.Options<T>[number]
25
+ item: AutocompleteOption<T>[number]
22
26
  touchableProps?: Partial<PropsOf<typeof Touchable>>
23
27
  textProps?: Partial<PropsOf<typeof Text>>
24
28
  iconProps?: Partial<PropsOf<typeof Icon>>