-
Notifications
You must be signed in to change notification settings - Fork 202
/
index.d.ts
165 lines (160 loc) · 5.39 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
import * as React from 'react'
import * as ReactNative from 'react-native'
type IconProps = {
name: string
size?: number
[x: string]: any
}
export interface Styles {
container?: ReactNative.StyleProp<ReactNative.ViewStyle>
modalWrapper?: ReactNative.StyleProp<ReactNative.ViewStyle>
selectToggle?: ReactNative.StyleProp<ReactNative.ViewStyle>
selectToggleText?: ReactNative.StyleProp<ReactNative.TextStyle>
item?: ReactNative.StyleProp<ReactNative.ViewStyle>
subItem?: ReactNative.StyleProp<ReactNative.ViewStyle>
itemText?: ReactNative.StyleProp<ReactNative.TextStyle>
selectedItemText?: ReactNative.StyleProp<ReactNative.TextStyle>
selectedSubItemText?: ReactNative.StyleProp<ReactNative.TextStyle>
subItemText?: ReactNative.StyleProp<ReactNative.TextStyle>
searchBar?: ReactNative.StyleProp<ReactNative.ViewStyle>
center?: ReactNative.StyleProp<ReactNative.ViewStyle>
separator?: ReactNative.StyleProp<ReactNative.ViewStyle>
subSeparator?: ReactNative.StyleProp<ReactNative.ViewStyle>
chipsWrapper?: ReactNative.StyleProp<ReactNative.ViewStyle>
chipContainer?: ReactNative.StyleProp<ReactNative.ViewStyle>
chipText?: ReactNative.StyleProp<ReactNative.TextStyle>
chipIcon?: ReactNative.StyleProp<ReactNative.ViewStyle>
searchTextInput?: ReactNative.StyleProp<ReactNative.TextStyle>
scrollView?: ReactNative.StyleProp<ReactNative.ViewStyle>
button?: ReactNative.StyleProp<ReactNative.ViewStyle>
cancelButton?: ReactNative.StyleProp<ReactNative.ViewStyle>
confirmText?: ReactNative.StyleProp<ReactNative.TextStyle>
toggleIcon?: ReactNative.StyleProp<ReactNative.ViewStyle>
selectedItem?: ReactNative.StyleProp<ReactNative.ViewStyle>
selectedSubItem?: ReactNative.StyleProp<ReactNative.ViewStyle>
backdrop?: ReactNative.StyleProp<ReactNative.ViewStyle>
listContainer?: ReactNative.StyleProp<ReactNative.ViewStyle>
}
export interface Colors {
primary?: string
success?: string
cancel?: string
text?: string
subText?: string
selectToggleTextColor?: string
searchPlaceholderTextColor?: string
searchSelectionColor?: string
chipColor?: string
itemBackground?: string
subItemBackground?: string
disabled?: string
}
export interface SectionedMultiSelectProps<ItemType> {
single?: boolean
selectedItems?: any[]
items?: ItemType[]
displayKey?: string
uniqueKey: string
subKey?: string
onSelectedItemsChange: (items: any[]) => void
showDropDowns?: boolean
showChips?: boolean
readOnlyHeadings?: boolean
selectText?: string
selectedText?: string | (() => void)
renderSelectText?: (props: this) => void
confirmText?: string
hideConfirm?: boolean
styles?: Styles
colors?: Colors
searchPlaceholderText?: string
noResultsComponent?: React.ReactNode
loadingComponent?: React.ReactNode
loading?: boolean
subItemFontFamily?: object
itemFontFamily?: object
searchTextFontFamily?: object
confirmFontFamily?: object
showRemoveAll?: boolean
removeAllText?: string
modalSupportedOrientations?: ReactNative.ModalProps['supportedOrientations']
modalAnimationType?: string
modalWithSafeAreaView?: boolean
modalWithTouchable?: boolean
hideSearch?: boolean
footerComponent?: React.ReactNode
stickyFooterComponent?: React.ReactNode
selectToggleIconComponent?: React.ReactNode
cancelIconComponent?: React.ReactNode
searchIconComponent?: React.ReactNode
selectedIconComponent?: React.ReactNode
unselectedIconComponent?: React.ReactNode
dropDownToggleIconUpComponent?: React.ReactNode
dropDownToggleIconDownComponent?: React.ReactNode
chipRemoveIconComponent?: React.ReactNode
selectChildren?: boolean
highlightChildren?: boolean
onSelectedItemObjectsChange?: (items: ItemType[]) => void
itemNumberOfLines?: number
selectLabelNumberOfLines?: number
showCancelButton?: boolean
hideSelect?: boolean
onConfirm?: () => void
onCancel?: () => void
headerComponent?: React.ReactNode
alwaysShowSelectText?: boolean
searchAdornment?: (searchText: string) => void
expandDropDowns?: boolean
animateDropDowns?: boolean
customLayoutAnimation?: object
onChangeSearchText?: (searchTerm: string) => void
filterItems?: (searchTerm: string) => void
onToggleSelector?: (selected: boolean) => void
noItemsComponent?: React.ReactNode
customChipsRenderer?: (chipProperties: {
colors: Colors
displayKey: string
items: ItemType[]
selectedItems: any[]
styles: Styles
subKey: string
uniqueKey: string
}) => void
chipsPosition?: 'top' | 'bottom'
autoFocus?: boolean
iconKey?: string
disabled?: boolean
selectedIconOnLeft?: boolean
parentChipsRemoveChildren?: boolean
hideChipRemove?: boolean
IconRenderer: React.ReactNode
itemsFlatListProps?: Omit<
ReactNative.FlatListProps<ItemType>,
'data' | 'renderItem'
>
subItemsFlatListProps?: Omit<
ReactNative.FlatListProps<ItemType>,
'data' | 'renderItem'
>
icons?: Partial<{
search: IconProps
arrowUp: IconProps
arrowDown: IconProps
close: IconProps
check: IconProps
cancel: IconProps
}>
}
export default class SectionedMultiSelect<ItemType> extends React.Component<
SectionedMultiSelectProps<ItemType>
> {
_toggleSelector: () => void
_removeAllItems: () => void
_removeItem: (item: ItemType) => void
_selectAllItems: () => void
_findItem: (id: any) => ItemType | undefined
_itemSelected: (item: ItemType) => boolean
_getSearchTerm: () => string
_submitSelection: () => void
_cancelSelection: () => void
}