react-native-auto-positioned-popup 1.2.19 → 1.2.21
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/lib/AutoPositionedPopup.d.ts.map +1 -1
- package/lib/AutoPositionedPopup.js +129 -12
- package/lib/AutoPositionedPopup.js.map +1 -1
- package/lib/AutoPositionedPopup.style.d.ts +10 -1
- package/lib/AutoPositionedPopup.style.d.ts.map +1 -1
- package/lib/AutoPositionedPopup.style.js +11 -2
- package/lib/AutoPositionedPopup.style.js.map +1 -1
- package/lib/AutoPositionedPopupProps.d.ts +1 -0
- package/lib/AutoPositionedPopupProps.d.ts.map +1 -1
- package/lib/KeyboardManager.js +1 -2
- package/lib/RootViewContext.js +2 -3
- package/package.json +1 -1
- package/src/AutoPositionedPopup.style.ts +12 -3
- package/src/AutoPositionedPopup.tsx +253 -88
- package/src/AutoPositionedPopupProps.ts +16 -14
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React, {RefObject} from 'react';
|
|
2
|
-
import {StyleProp, TextInputProps, TextStyle, ViewStyle} from 'react-native';
|
|
3
|
-
import {TextInputSubmitEditingEventData} from 'react-native/Libraries/Components/TextInput/TextInput';
|
|
4
|
-
import {NativeSyntheticEvent} from 'react-native/Libraries/Types/CoreEventTypes';
|
|
5
|
-
import {KeyboardAwareScrollView} from 'react-native-keyboard-aware-scroll-view';
|
|
1
|
+
import React, { RefObject } from 'react';
|
|
2
|
+
import { StyleProp, TextInputProps, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
import { TextInputSubmitEditingEventData } from 'react-native/Libraries/Components/TextInput/TextInput';
|
|
4
|
+
import { NativeSyntheticEvent } from 'react-native/Libraries/Types/CoreEventTypes';
|
|
5
|
+
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
|
|
6
6
|
|
|
7
7
|
export interface SelectedItem {
|
|
8
8
|
id: string;
|
|
@@ -22,7 +22,7 @@ export interface Data {
|
|
|
22
22
|
export interface RNAutoPositionedPopupCustomRowProps {
|
|
23
23
|
children?: React.ReactNode;
|
|
24
24
|
selectedItem?: SelectedItem | any | null | undefined;
|
|
25
|
-
selectList?: string | any
|
|
25
|
+
selectList?: string | any[];
|
|
26
26
|
onAdded?: (textToAdd: string) => void;
|
|
27
27
|
clearSelectedItem?: () => void;
|
|
28
28
|
disabled?: boolean;
|
|
@@ -64,15 +64,15 @@ export interface AutoPositionedPopupProps {
|
|
|
64
64
|
* @param searchQuery
|
|
65
65
|
*/
|
|
66
66
|
fetchData?: ({
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
pageIndex,
|
|
68
|
+
pageSize,
|
|
69
|
+
searchQuery,
|
|
70
|
+
}: {
|
|
71
71
|
pageIndex: number;
|
|
72
72
|
pageSize: number;
|
|
73
73
|
searchQuery?: string;
|
|
74
74
|
}) => Promise<Data | null>;
|
|
75
|
-
renderItem?: ({item, index}: { item: SelectedItem; index: number }) => React.ReactElement;
|
|
75
|
+
renderItem?: ({ item, index }: { item: SelectedItem; index: number }) => React.ReactElement;
|
|
76
76
|
onItemSelected?: (item: SelectedItem & any) => void;
|
|
77
77
|
/**
|
|
78
78
|
* onSubmitEditing={(e: NativeSyntheticEvent<TextInputSubmitEditingEventData>) => {
|
|
@@ -157,9 +157,9 @@ export interface AutoPositionedPopupProps {
|
|
|
157
157
|
*/
|
|
158
158
|
CustomPopView?: () => React.ComponentType<
|
|
159
159
|
ViewStyle & {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
children?: React.ReactNode;
|
|
161
|
+
selectedItem?: SelectedItem | any;
|
|
162
|
+
}
|
|
163
163
|
>;
|
|
164
164
|
CustomPopViewStyle?: ViewStyle;
|
|
165
165
|
forceRemoveAllRootViewOnItemSelected?: boolean;
|
|
@@ -210,4 +210,6 @@ export interface AutoPositionedPopupProps {
|
|
|
210
210
|
* Default: 100
|
|
211
211
|
*/
|
|
212
212
|
scrollExtraHeight?: number;
|
|
213
|
+
// 是否在 AutoPositionedPopupList 组件内部就行搜索
|
|
214
|
+
internalSearch?: boolean;
|
|
213
215
|
}
|