-
Notifications
You must be signed in to change notification settings - Fork 734
Feat/new wheel picker integration #1083
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
Changes from all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
a3c353e
Change prop name to match current picker
mendyEdri 3addf5e
Fix Container type, when no panDirection set - fixing scrollable cont…
mendyEdri 18361d4
Merge branch 'master' of github.com:wix/react-native-ui-lib
mendyEdri d0fc5a7
added logic to support the current WheelPicker api and behaviour, add…
mendyEdri 416f7f0
Support integrating new WeelPicker
mendyEdri 0f64d32
New WheelPicker integration
mendyEdri cf182bc
WIP - picker item needs to be created
mendyEdri 59ea97d
Fix build issue by reorder methods
mendyEdri 3026c2b
Using reanimated tests stub to fix failing tests
mendyEdri b6ed3db
Merge branch 'master' of github.com:wix/react-native-ui-lib
mendyEdri 3f7f1e5
fix WheelPicker demo screen
mendyEdri e289672
align items in demo screen
mendyEdri ba507b1
showcase both options to manage WeelPicker style
mendyEdri bc505f7
Merge branch 'master' of github.com:wix/react-native-ui-lib
mendyEdri 3c30f46
Merge branch 'master' into feat/new-wheel-picker-integration
mendyEdri 6d14cd7
typescript
mendyEdri 35deda4
Fix extra space on the bottom of the wheel, use onLayout for starting…
mendyEdri 9f8e50f
replace native WheelPicker in android with our new WheelPicker
mendyEdri 01c95ea
replaced Android's WheelPicker when useNativePicker - with our new W…
mendyEdri 25cb8b2
support WheelPicker to be fully controlled
mendyEdri 714571f
added WheelPicker presenter
mendyEdri 55528d1
implement WheelPicker presenter
mendyEdri b7894f3
WheelPicker unittests
mendyEdri 3041c69
lint fix
mendyEdri 5dda43c
ts file
mendyEdri ae3eb14
Merge branch 'master' into feat/new-wheel-picker-integration
ethanshar 3e7eb77
fix android import
mendyEdri 0303fbe
Merge branch 'feat/new-wheel-picker-integration' of github.com:wix/re…
mendyEdri 312da06
wheel-picker import style
mendyEdri 1ce4958
Fixing demo screen
mendyEdri 139b30b
ts fix
mendyEdri d44a820
PR Comments - naming
mendyEdri e6deee1
Demo screen structure code
mendyEdri 2cb3f07
PR Comment - spacing
mendyEdri 2c3f0ef
Avoid check when offset send is -1 (prior render)
mendyEdri 796c3e2
API naming
mendyEdri 0174030
API naming + demo fixes
mendyEdri 03e6eb9
PR Comments - added component memo, remove unnecessary memo from sepa…
mendyEdri 0a06813
Style is based on parent, so no need for extra
mendyEdri 0759a9d
Merge branch 'master' of github.com:wix/react-native-ui-lib
mendyEdri f8dfd17
Merge branch 'master' into feat/new-wheel-picker-integration
mendyEdri b56821c
fix lint errors
mendyEdri b045a30
Merge branch 'master' into feat/new-wheel-picker-integration
mendyEdri 5052368
Merge branch 'master' into feat/new-wheel-picker-integration
mendyEdri 8832dce
Merge branch 'master' into feat/new-wheel-picker-integration
ethanshar 1b6235f
Merge branch 'master' into feat/new-wheel-picker-integration
mendyEdri 5dca309
Merge branch 'master' into feat/new-wheel-picker-integration
mendyEdri e0e4ac2
merge master
mendyEdri 5cd4107
Merge branch 'master' into feat/new-wheel-picker-integration
mendyEdri 418c9f7
Merge branch 'master' into feat/new-wheel-picker-integration
mendyEdri cce289d
Fixing issue when not passing back the onChange event
mendyEdri c460bb2
lint
mendyEdri 0742539
Merge branch 'master' into feat/new-wheel-picker-integration
mendyEdri b45f0db
Merge branch 'master' into feat/new-wheel-picker-integration
ethanshar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,56 @@ | ||
/// <reference types="react" /> | ||
import { TextStyle } from 'react-native'; | ||
import { ItemProps } from './Item'; | ||
import {TextStyle} from 'react-native'; | ||
import {ItemProps} from './Item'; | ||
export interface WheelPickerProps { | ||
/** | ||
* Data source for WheelPicker | ||
*/ | ||
items?: ItemProps[]; | ||
/** | ||
* Describe the height of each item in the WheelPicker | ||
*/ | ||
itemHeight?: number; | ||
/** | ||
* Text color for the focused row | ||
*/ | ||
activeTextColor?: string; | ||
/** | ||
* Text color for other, non-focused rows | ||
*/ | ||
inactiveTextColor?: string; | ||
/** | ||
* Row text style | ||
*/ | ||
textStyle?: TextStyle; | ||
/** | ||
* Event, on active row change | ||
*/ | ||
onChange: (index: number, item?: ItemProps) => void; | ||
/** | ||
* Data source for WheelPicker | ||
*/ | ||
items?: ItemProps[]; | ||
/** | ||
* Describe the height of each item in the WheelPicker | ||
* default value: 44 | ||
*/ | ||
itemHeight?: number; | ||
/** | ||
* Describe the number of rows visible | ||
* default value: 5 | ||
*/ | ||
numberOfVisibleRows?: number; | ||
/** | ||
* Text color for the focused row | ||
*/ | ||
activeTextColor?: string; | ||
/** | ||
* Text color for other, non-focused rows | ||
*/ | ||
inactiveTextColor?: string; | ||
/** | ||
* Row text style | ||
*/ | ||
textStyle?: TextStyle; | ||
/** | ||
* Event, on active row change | ||
*/ | ||
onChange?: (item: string | undefined, index: number) => void; | ||
/** | ||
* Container's ViewStyle, height is computed according to itemHeight * numberOfVisibleRows | ||
*/ | ||
style?: Omit<ViewStyle, 'height'>; | ||
/** | ||
* Support passing items as children props | ||
*/ | ||
children?: JSX.Element | JSX.Element[]; | ||
/** | ||
* WheelPicker initial value, can be ItemProps.value, number as index | ||
*/ | ||
selectedValue?: ItemProps | string | number; | ||
} | ||
declare const WheelPicker: ({ items, itemHeight, activeTextColor, inactiveTextColor, textStyle, onChange: onChangeEvent }: WheelPickerProps) => JSX.Element; | ||
declare const WheelPicker: ({ | ||
items, | ||
itemHeight, | ||
activeTextColor, | ||
inactiveTextColor, | ||
textStyle, | ||
onChange: onChangeEvent | ||
}: WheelPickerProps) => JSX.Element; | ||
export default WheelPicker; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/// <reference types="react" /> | ||
import { ItemProps } from './Item'; | ||
declare type ItemValueTypes = ItemProps | number | string; | ||
export { ItemValueTypes }; | ||
declare type PropTypes = { | ||
selectedValue: ItemValueTypes; | ||
children?: JSX.Element | JSX.Element[]; | ||
items?: ItemProps[]; | ||
itemHeight: number; | ||
preferredNumVisibleRows: number; | ||
}; | ||
declare type RowItem = { | ||
value: string | number; | ||
index: number; | ||
}; | ||
interface Presenter { | ||
items: ItemProps[]; | ||
shouldControlComponent: (offset: number) => boolean; | ||
index: number; | ||
height: number; | ||
getRowItemAtOffset: (offset: number) => RowItem; | ||
} | ||
declare const usePresenter: ({ selectedValue, children, items: propItems, itemHeight, preferredNumVisibleRows }: PropTypes) => Presenter; | ||
export default usePresenter; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.