-
Notifications
You must be signed in to change notification settings - Fork 734
Keyboard components - add docs #1984
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
5 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,6 @@ buck-out/ | |
\.buckd/ | ||
*.keystore | ||
|
||
lib/ | ||
.vscode | ||
|
||
# fastlane | ||
|
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
97 changes: 97 additions & 0 deletions
97
lib/components/Keyboard/KeyboardInput/keyboardAccessoryView.api.json
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,97 @@ | ||
{ | ||
"name": "KeyboardAccessoryView", | ||
"category": "keyboard", | ||
"description": "View that allows replacing the default keyboard with other components", | ||
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/nativeComponentScreens/keyboardInput/KeyboardInputViewScreen.js", | ||
"images": [ | ||
"https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/KeyboardAccessoryView/KeyboardAccessoryView.gif?raw=true" | ||
], | ||
"props": [ | ||
{ | ||
"name": "renderContent", | ||
"type": "() => React.ReactElement", | ||
"description": "Content to be rendered above the keyboard" | ||
}, | ||
{ | ||
"name": "onHeightChanged", | ||
"type": "(height: number) => void", | ||
"description": "A callback for when the height is changed" | ||
}, | ||
{ | ||
"name": "kbInputRef", | ||
"type": "any", | ||
"description": "The reference to the actual text input (or the keyboard may not reset when instructed to, etc.).\niOS only.", | ||
"required": true | ||
}, | ||
{ | ||
"name": "kbComponent", | ||
"type": "string", | ||
"description": "The keyboard ID (the componentID sent to KeyboardRegistry)" | ||
}, | ||
{"name": "kbInitialProps", "type": "any", "description": "The props that will be sent to the KeyboardComponent"}, | ||
{ | ||
"name": "onItemSelected", | ||
"type": "() => void", | ||
"description": "Callback that will be called when an item on the keyboard has been pressed." | ||
}, | ||
{ | ||
"name": "onRequestShowKeyboard", | ||
"type": "() => void", | ||
"description": "Callback that will be called if KeyboardRegistry.requestShowKeyboard is called." | ||
}, | ||
{ | ||
"name": "onKeyboardResigned", | ||
"type": "() => void", | ||
"description": "Callback that will be called once the keyboard has been closed" | ||
}, | ||
{ | ||
"name": "iOSScrollBehavior", | ||
"type": "number", | ||
"description": "The scrolling behavior, use KeyboardAccessoryView.iosScrollBehaviors.X where X is:\nNONE, SCROLL_TO_BOTTOM_INVERTED_ONLY or FIXED_OFFSET\niOS only.", | ||
"default": "FIXED_OFFSET" | ||
}, | ||
{ | ||
"name": "revealKeyboardInteractive", | ||
"type": "boolean", | ||
"description": "Show the keyboard on a negative scroll\niOS only.", | ||
"default": "false" | ||
}, | ||
{ | ||
"name": "manageScrollView", | ||
"type": "boolean", | ||
"description": "Set to false to turn off inset management and manage it yourself\niOS only.", | ||
"default": "true" | ||
}, | ||
{ | ||
"name": "requiresSameParentToManageScrollView", | ||
"type": "boolean", | ||
"description": "Set to true manageScrollView is set to true and still does not work,\nit means that the ScrollView found is the wrong one and you'll have\nto have the KeyboardAccessoryView and the ScrollView as siblings\nand set this to true\niOS only.", | ||
"default": "false" | ||
}, | ||
{ | ||
"name": "addBottomView", | ||
"type": "boolean", | ||
"description": "Add a (white) SafeArea view beneath the KeyboardAccessoryView\niOS only.", | ||
"default": "false" | ||
}, | ||
{ | ||
"name": "allowHitsOutsideBounds", | ||
"type": "boolean", | ||
"description": "Allow hitting sub-views that are placed beyond the view bounds\niOS only.", | ||
"default": "false" | ||
}, | ||
{ | ||
"name": "useSafeArea", | ||
"type": "boolean", | ||
"description": "Whether or not to handle SafeArea\niOS only.", | ||
"default": "true" | ||
}, | ||
{ | ||
"name": "usesBottomTabs", | ||
"type": "boolean", | ||
"description": "Whether or not to include bottom tab bar inset\niOS only.", | ||
"default": "false" | ||
} | ||
], | ||
"snippet": ["KeyboardRegistry.registerKeyboard('keyboardName$1', () => KeyboardComponent$2)"] | ||
} |
50 changes: 50 additions & 0 deletions
50
lib/components/Keyboard/KeyboardInput/keyboardRegistry.api.json
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,50 @@ | ||
{ | ||
"name": "KeyboardRegistry", | ||
"category": "keyboard", | ||
"description": "used for registering keyboards and performing certain actions on the keyboards.", | ||
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/nativeComponentScreens/keyboardInput/demoKeyboards.js", | ||
"props": [ | ||
{ | ||
"name": "registerKeyboard", | ||
"type": "static function", | ||
"description": "Register a new keyboard.\ncomponentID (string) - the ID of the keyboard.\ngenerator (function) - a function for the creation of the keyboard.\nparams (object) - to be returned when using other methods (i.e. getKeyboards and getAllKeyboards)." | ||
}, | ||
{ | ||
"name": "getKeyboard", | ||
"type": "static function", | ||
"description": "Get a specific keyboard\ncomponentID (string) - the ID of the keyboard." | ||
}, | ||
{ | ||
"name": "getKeyboards", | ||
"type": "static function", | ||
"description": "Get keyboards by IDs\ncomponentIDs (string[]) - the ID of the keyboard." | ||
}, | ||
{"name": "getAllKeyboards", "type": "static function", "description": "Get all keyboards"}, | ||
{ | ||
"name": "addListener", | ||
"type": "static function", | ||
"description": "Add a listener for a callback.\nglobalID (string) - ID that includes the componentID and the event name\n (i.e. if componentID='kb1' globalID='kb1.onItemSelected')\ncallback (function) - the callback to be called when the said event happens" | ||
}, | ||
{ | ||
"name": "notifyListeners", | ||
"type": "static function", | ||
"description": "Notify that an event has occurred.\nglobalID (string) - ID that includes the componentID and the event name\n (i.e. if componentID='kb1' globalID='kb1.onItemSelected')\nargs (object) - data to be sent to the listener." | ||
}, | ||
{ | ||
"name": "removeListeners", | ||
"type": "static function", | ||
"description": "Remove a listener for a callback.\nglobalID (string) - ID that includes the componentID and the event name\n (i.e. if componentID='kb1' globalID='kb1.onItemSelected')" | ||
}, | ||
{ | ||
"name": "onItemSelected", | ||
"type": "static function", | ||
"description": "Default event to be used for when an item on the keyboard has been pressed.\ncomponentID (string) - the ID of the keyboard.\nargs (object) - data to be sent to the listener." | ||
}, | ||
{ | ||
"name": "requestShowKeyboard", | ||
"type": "static function", | ||
"description": "Request to show the keyboard\ncomponentID (string) - the ID of the keyboard." | ||
} | ||
], | ||
"snippet": ["KeyboardRegistry.registerKeyboard('keyboardName$1', () => KeyboardComponent$2)"] | ||
} |
37 changes: 37 additions & 0 deletions
37
lib/components/Keyboard/KeyboardTracking/KeyboardTrackingView/keyboardTracking.api.json
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,37 @@ | ||
{ | ||
"name": "KeyboardTrackingView", | ||
"category": "keyboard", | ||
"description": "A UI component that enables 'keyboard tracking' for this view and it's sub-views.\nWould typically be used when you have a TextField or TextInput inside this view.", | ||
"notes": "This view is useful only for iOS.", | ||
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/nativeComponentScreens/KeyboardTrackingViewScreen.js", | ||
"images": [ | ||
"https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/KeyboardTrackingView/KeyboardTrackingView.gif?raw=true" | ||
], | ||
"props": [ | ||
{ | ||
"name": "trackInteractive", | ||
"type": "boolean", | ||
"description": "Enables tracking of the keyboard when it's dismissed interactively (false by default).\nWhy? When using an external keyboard (BT),\nyou still get the keyboard events and the view just hovers when you focus the input.\nAlso, if you're not using interactive style of dismissing the keyboard\n(or if you don't have an input inside this view) it doesn't make sense to track it anyway.\n(This is caused because of the usage of inputAccessory to be able to track the keyboard interactive change and it introduces this bug)" | ||
}, | ||
{"name": "useSafeArea", "type": "boolean", "description": "Allow control safe area"}, | ||
{"name": "usesBottomTabs", "type": "boolean", "description": "Whether or not to include bottom tab bar inset"}, | ||
{"name": "scrollToFocusedInput", "type": "boolean", "description": ""}, | ||
{"name": "scrollBehavior", "type": "number", "description": ""}, | ||
{"name": "revealKeyboardInteractive", "type": "boolean", "description": ""}, | ||
{"name": "manageScrollView", "type": "", "description": "boolean"}, | ||
{"name": "requiresSameParentToManageScrollView", "type": "", "description": "boolean"}, | ||
{"name": "addBottomView", "type": "", "description": "boolean"}, | ||
{"name": "allowHitsOutsideBounds", "type": "", "description": "boolean"}, | ||
{"name": "ref", "type": "any", "description": ""}, | ||
{"name": "style", "type": "ViewStyle", "description": ""} | ||
], | ||
"snippet": [ | ||
"<KeyboardTrackingView", | ||
"style={$1}", | ||
"trackInteractive", | ||
"useSafeArea", | ||
">", | ||
"%2", | ||
"</KeyboardTrackingView>" | ||
] | ||
} |
11 changes: 11 additions & 0 deletions
11
lib/components/Keyboard/KeyboardTracking/keyboardAwareInsetsView.api.json
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,11 @@ | ||
{ | ||
"name": "KeyboardAwareInsetsView", | ||
"category": "keyboard", | ||
"description": "Used to add an inset when a keyboard is used and might hide part of the screen.", | ||
"notes": "This view is useful only for iOS.", | ||
"extends": "KeyboardTrackingView", | ||
"extendsLink": [ | ||
"https://github.com/wix/react-native-ui-lib/blob/master/lib/components/Keyboard/KeyboardTracking/KeyboardTrackingView/index.tsx" | ||
], | ||
"snippet": ["<KeyboardAwareInsetsView/>"] | ||
} |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extends:
KeyboardTrackingView
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It technically does, but for the user it is not true (all
KeyboardTrackingView
props are passed literally in theKeyboardAccessoryViewProps
and there's noextends
\others
used).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right... I'm not sure why thought