Skip to content

Commit 2379f4a

Browse files
authored
Add api json to Incubator.WheelPicker component (#1726)
1 parent 58be7db commit 2379f4a

File tree

5 files changed

+48
-4
lines changed

5 files changed

+48
-4
lines changed

generatedTypes/src/incubator/WheelPicker/index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { TextStyle, ViewStyle } from 'react-native';
33
import { ItemProps } from './Item';
44
import { TextProps } from '../../components/text';
5-
declare enum WheelPickerAlign {
5+
export declare enum WheelPickerAlign {
66
CENTER = "center",
77
RIGHT = "right",
88
LEFT = "left"
@@ -80,3 +80,4 @@ declare const _default: React.ComponentClass<WheelPickerProps & {
8080
displayName: string;
8181
};
8282
export default _default;
83+
export { ItemProps as WheelPickerItemProps };

generatedTypes/src/incubator/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export { default as ChipsInput, ChipsInputProps, ChipsInputChangeReason, ChipsIn
22
export { default as ExpandableOverlay } from './expandableOverlay';
33
export { default as TextField, TextFieldProps, FieldContextType } from './TextField';
44
export { default as TouchableOpacity, TouchableOpacityProps } from './TouchableOpacity';
5-
export { default as WheelPicker, WheelPickerProps } from './WheelPicker';
5+
export { default as WheelPicker, WheelPickerProps, WheelPickerAlign, WheelPickerItemProps } from './WheelPicker';
66
export { default as PanView, PanViewProps, PanViewDirections, PanViewDismissThreshold } from './panView';
77
export { default as TransitionView, TransitionViewProps, TransitionViewDirection, TransitionViewDirectionEnum, TransitionViewAnimationType } from './TransitionView';
88
export { default as Dialog, DialogProps } from './Dialog';

src/incubator/WheelPicker/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import usePresenter from './usePresenter';
1313

1414
const AnimatedFlatList = Animated.createAnimatedComponent(FlatList);
1515

16-
enum WheelPickerAlign {
16+
export enum WheelPickerAlign {
1717
CENTER = 'center',
1818
RIGHT = 'right',
1919
LEFT = 'left'
@@ -305,6 +305,7 @@ const WheelPicker = ({
305305
WheelPicker.alignments = WheelPickerAlign;
306306
WheelPicker.displayName = 'Incubator.WheelPicker';
307307
export default asBaseComponent<WheelPickerProps, typeof WheelPicker>(WheelPicker);
308+
export {ItemProps as WheelPickerItemProps};
308309

309310
const styles = StyleSheet.create({
310311
separators: {
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "WheelPicker",
3+
"category": "incubator",
4+
"description": "A customizable WheelPicker component",
5+
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/incubatorScreens/WheelPickerScreen.tsx",
6+
"images": [],
7+
"props": [
8+
{"name": "initialValue", "type": "number | string", "description": "Initial value (uncontrolled)"},
9+
{"name": "items", "type": "WheelPickerItemProps[]", "description": "Data source for WheelPicker"},
10+
{"name": "itemHeight", "type": "number", "description": "Height of each item in the WheelPicker", "default": "44"},
11+
{"name": "numberOfVisibleRows", "type": "number", "description": "Number of rows visible", "default": "5"},
12+
{"name": "activeTextColor", "type": "string", "description": "Text color for the focused row"},
13+
{"name": "inactiveTextColor", "type": "string", "description": "Text color for other, non-focused rows"},
14+
{"name": "textStyle", "type": "TextStyle", "description": "Row text custom style"},
15+
{"name": "label", "type": "string", "description": "Additional label to render next to the items text"},
16+
{"name": "labelStyle", "type": "TextStyle", "description": "Additional label's style"},
17+
{"name": "labelProps", "type": "TextProps", "description": "Additional label's props"},
18+
{
19+
"name": "onChange",
20+
"type": "(item: string | number, index: number) => void",
21+
"description": "Change item event callback"
22+
},
23+
{
24+
"name": "style",
25+
"type": "ViewStyle",
26+
"description": "Container's custom style",
27+
"note": "height is computed according to itemHeight * numberOfVisibleRows"
28+
},
29+
{
30+
"name": "children",
31+
"type": "JSX.Element | JSX.Element[]",
32+
"description": "Support passing items as children props"
33+
},
34+
{
35+
"name": "align",
36+
"type": "WheelPickerAlign",
37+
"description": "Align the content to center, right ot left",
38+
"default": "center"
39+
},
40+
{"name": "testID;", "type": "string", "description": "Align the content to center, right ot left"}
41+
]
42+
}

src/incubator/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export {default as ExpandableOverlay} from './expandableOverlay';
33
// @ts-ignore
44
export {default as TextField, TextFieldProps, FieldContextType} from './TextField';
55
export {default as TouchableOpacity, TouchableOpacityProps} from './TouchableOpacity';
6-
export {default as WheelPicker, WheelPickerProps} from './WheelPicker';
6+
export {default as WheelPicker, WheelPickerProps, WheelPickerAlign, WheelPickerItemProps} from './WheelPicker';
77
export {default as PanView, PanViewProps, PanViewDirections, PanViewDismissThreshold} from './panView';
88
export {
99
default as TransitionView,

0 commit comments

Comments
 (0)