Skip to content

Add api json to Incubator.WheelPicker component #1726

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion generatedTypes/src/incubator/WheelPicker/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { TextStyle, ViewStyle } from 'react-native';
import { ItemProps } from './Item';
import { TextProps } from '../../components/text';
declare enum WheelPickerAlign {
export declare enum WheelPickerAlign {
CENTER = "center",
RIGHT = "right",
LEFT = "left"
Expand Down Expand Up @@ -80,3 +80,4 @@ declare const _default: React.ComponentClass<WheelPickerProps & {
displayName: string;
};
export default _default;
export { ItemProps as WheelPickerItemProps };
2 changes: 1 addition & 1 deletion generatedTypes/src/incubator/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export { default as ChipsInput, ChipsInputProps, ChipsInputChangeReason, ChipsIn
export { default as ExpandableOverlay } from './expandableOverlay';
export { default as TextField, TextFieldProps, FieldContextType } from './TextField';
export { default as TouchableOpacity, TouchableOpacityProps } from './TouchableOpacity';
export { default as WheelPicker, WheelPickerProps } from './WheelPicker';
export { default as WheelPicker, WheelPickerProps, WheelPickerAlign, WheelPickerItemProps } from './WheelPicker';
export { default as PanView, PanViewProps, PanViewDirections, PanViewDismissThreshold } from './panView';
export { default as TransitionView, TransitionViewProps, TransitionViewDirection, TransitionViewDirectionEnum, TransitionViewAnimationType } from './TransitionView';
export { default as Dialog, DialogProps } from './Dialog';
3 changes: 2 additions & 1 deletion src/incubator/WheelPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import usePresenter from './usePresenter';

const AnimatedFlatList = Animated.createAnimatedComponent(FlatList);

enum WheelPickerAlign {
export enum WheelPickerAlign {
CENTER = 'center',
RIGHT = 'right',
LEFT = 'left'
Expand Down Expand Up @@ -305,6 +305,7 @@ const WheelPicker = ({
WheelPicker.alignments = WheelPickerAlign;
WheelPicker.displayName = 'Incubator.WheelPicker';
export default asBaseComponent<WheelPickerProps, typeof WheelPicker>(WheelPicker);
export {ItemProps as WheelPickerItemProps};

const styles = StyleSheet.create({
separators: {
Expand Down
42 changes: 42 additions & 0 deletions src/incubator/WheelPicker/wheelPicker.api.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "WheelPicker",
"category": "incubator",
"description": "A customizable WheelPicker component",
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/incubatorScreens/WheelPickerScreen.tsx",
"images": [],
"props": [
{"name": "initialValue", "type": "number | string", "description": "Initial value (uncontrolled)"},
{"name": "items", "type": "WheelPickerItemProps[]", "description": "Data source for WheelPicker"},
{"name": "itemHeight", "type": "number", "description": "Height of each item in the WheelPicker", "default": "44"},
{"name": "numberOfVisibleRows", "type": "number", "description": "Number of rows visible", "default": "5"},
{"name": "activeTextColor", "type": "string", "description": "Text color for the focused row"},
{"name": "inactiveTextColor", "type": "string", "description": "Text color for other, non-focused rows"},
{"name": "textStyle", "type": "TextStyle", "description": "Row text custom style"},
{"name": "label", "type": "string", "description": "Additional label to render next to the items text"},
{"name": "labelStyle", "type": "TextStyle", "description": "Additional label's style"},
{"name": "labelProps", "type": "TextProps", "description": "Additional label's props"},
{
"name": "onChange",
"type": "(item: string | number, index: number) => void",
"description": "Change item event callback"
},
{
"name": "style",
"type": "ViewStyle",
"description": "Container's custom style",
"note": "height is computed according to itemHeight * numberOfVisibleRows"
},
{
"name": "children",
"type": "JSX.Element | JSX.Element[]",
"description": "Support passing items as children props"
},
{
"name": "align",
"type": "WheelPickerAlign",
"description": "Align the content to center, right ot left",
"default": "center"
},
{"name": "testID;", "type": "string", "description": "Align the content to center, right ot left"}
]
}
2 changes: 1 addition & 1 deletion src/incubator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export {default as ExpandableOverlay} from './expandableOverlay';
// @ts-ignore
export {default as TextField, TextFieldProps, FieldContextType} from './TextField';
export {default as TouchableOpacity, TouchableOpacityProps} from './TouchableOpacity';
export {default as WheelPicker, WheelPickerProps} from './WheelPicker';
export {default as WheelPicker, WheelPickerProps, WheelPickerAlign, WheelPickerItemProps} from './WheelPicker';
export {default as PanView, PanViewProps, PanViewDirections, PanViewDismissThreshold} from './panView';
export {
default as TransitionView,
Expand Down