Skip to content

Commit d99ea6a

Browse files
Keyboard components - add docs (#1984)
* Keyboard components - add docs * Damn you copy-paste * Fix typo Co-authored-by: Inbal Tish <[email protected]> * Fix names Co-authored-by: Inbal Tish <[email protected]>
1 parent 56cc759 commit d99ea6a

File tree

7 files changed

+197
-2
lines changed

7 files changed

+197
-2
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ buck-out/
4444
\.buckd/
4545
*.keystore
4646

47-
lib/
4847
.vscode
4948

5049
# fastlane

lib/components/Keyboard/KeyboardInput/KeyboardRegistry.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export default class KeyboardRegistry {
115115
};
116116

117117
/**
118+
* @deprecated
118119
* iOS only (experimental)
119120
* Call to make the keyboard full screen
120121
* componentID (string) - the ID of the keyboard.
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{
2+
"name": "KeyboardAccessoryView",
3+
"category": "keyboard",
4+
"description": "View that allows replacing the default keyboard with other components",
5+
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/nativeComponentScreens/keyboardInput/KeyboardInputViewScreen.js",
6+
"images": [
7+
"https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/KeyboardAccessoryView/KeyboardAccessoryView.gif?raw=true"
8+
],
9+
"props": [
10+
{
11+
"name": "renderContent",
12+
"type": "() => React.ReactElement",
13+
"description": "Content to be rendered above the keyboard"
14+
},
15+
{
16+
"name": "onHeightChanged",
17+
"type": "(height: number) => void",
18+
"description": "A callback for when the height is changed"
19+
},
20+
{
21+
"name": "kbInputRef",
22+
"type": "any",
23+
"description": "The reference to the actual text input (or the keyboard may not reset when instructed to, etc.).\niOS only.",
24+
"required": true
25+
},
26+
{
27+
"name": "kbComponent",
28+
"type": "string",
29+
"description": "The keyboard ID (the componentID sent to KeyboardRegistry)"
30+
},
31+
{"name": "kbInitialProps", "type": "any", "description": "The props that will be sent to the KeyboardComponent"},
32+
{
33+
"name": "onItemSelected",
34+
"type": "() => void",
35+
"description": "Callback that will be called when an item on the keyboard has been pressed."
36+
},
37+
{
38+
"name": "onRequestShowKeyboard",
39+
"type": "() => void",
40+
"description": "Callback that will be called if KeyboardRegistry.requestShowKeyboard is called."
41+
},
42+
{
43+
"name": "onKeyboardResigned",
44+
"type": "() => void",
45+
"description": "Callback that will be called once the keyboard has been closed"
46+
},
47+
{
48+
"name": "iOSScrollBehavior",
49+
"type": "number",
50+
"description": "The scrolling behavior, use KeyboardAccessoryView.iosScrollBehaviors.X where X is:\nNONE, SCROLL_TO_BOTTOM_INVERTED_ONLY or FIXED_OFFSET\niOS only.",
51+
"default": "FIXED_OFFSET"
52+
},
53+
{
54+
"name": "revealKeyboardInteractive",
55+
"type": "boolean",
56+
"description": "Show the keyboard on a negative scroll\niOS only.",
57+
"default": "false"
58+
},
59+
{
60+
"name": "manageScrollView",
61+
"type": "boolean",
62+
"description": "Set to false to turn off inset management and manage it yourself\niOS only.",
63+
"default": "true"
64+
},
65+
{
66+
"name": "requiresSameParentToManageScrollView",
67+
"type": "boolean",
68+
"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.",
69+
"default": "false"
70+
},
71+
{
72+
"name": "addBottomView",
73+
"type": "boolean",
74+
"description": "Add a (white) SafeArea view beneath the KeyboardAccessoryView\niOS only.",
75+
"default": "false"
76+
},
77+
{
78+
"name": "allowHitsOutsideBounds",
79+
"type": "boolean",
80+
"description": "Allow hitting sub-views that are placed beyond the view bounds\niOS only.",
81+
"default": "false"
82+
},
83+
{
84+
"name": "useSafeArea",
85+
"type": "boolean",
86+
"description": "Whether or not to handle SafeArea\niOS only.",
87+
"default": "true"
88+
},
89+
{
90+
"name": "usesBottomTabs",
91+
"type": "boolean",
92+
"description": "Whether or not to include bottom tab bar inset\niOS only.",
93+
"default": "false"
94+
}
95+
],
96+
"snippet": ["KeyboardRegistry.registerKeyboard('keyboardName$1', () => KeyboardComponent$2)"]
97+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "KeyboardRegistry",
3+
"category": "keyboard",
4+
"description": "used for registering keyboards and performing certain actions on the keyboards.",
5+
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/nativeComponentScreens/keyboardInput/demoKeyboards.js",
6+
"props": [
7+
{
8+
"name": "registerKeyboard",
9+
"type": "static function",
10+
"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)."
11+
},
12+
{
13+
"name": "getKeyboard",
14+
"type": "static function",
15+
"description": "Get a specific keyboard\ncomponentID (string) - the ID of the keyboard."
16+
},
17+
{
18+
"name": "getKeyboards",
19+
"type": "static function",
20+
"description": "Get keyboards by IDs\ncomponentIDs (string[]) - the ID of the keyboard."
21+
},
22+
{"name": "getAllKeyboards", "type": "static function", "description": "Get all keyboards"},
23+
{
24+
"name": "addListener",
25+
"type": "static function",
26+
"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"
27+
},
28+
{
29+
"name": "notifyListeners",
30+
"type": "static function",
31+
"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."
32+
},
33+
{
34+
"name": "removeListeners",
35+
"type": "static function",
36+
"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')"
37+
},
38+
{
39+
"name": "onItemSelected",
40+
"type": "static function",
41+
"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."
42+
},
43+
{
44+
"name": "requestShowKeyboard",
45+
"type": "static function",
46+
"description": "Request to show the keyboard\ncomponentID (string) - the ID of the keyboard."
47+
}
48+
],
49+
"snippet": ["KeyboardRegistry.registerKeyboard('keyboardName$1', () => KeyboardComponent$2)"]
50+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "KeyboardTrackingView",
3+
"category": "keyboard",
4+
"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.",
5+
"notes": "This view is useful only for iOS.",
6+
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/nativeComponentScreens/KeyboardTrackingViewScreen.js",
7+
"images": [
8+
"https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/KeyboardTrackingView/KeyboardTrackingView.gif?raw=true"
9+
],
10+
"props": [
11+
{
12+
"name": "trackInteractive",
13+
"type": "boolean",
14+
"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)"
15+
},
16+
{"name": "useSafeArea", "type": "boolean", "description": "Allow control safe area"},
17+
{"name": "usesBottomTabs", "type": "boolean", "description": "Whether or not to include bottom tab bar inset"},
18+
{"name": "scrollToFocusedInput", "type": "boolean", "description": ""},
19+
{"name": "scrollBehavior", "type": "number", "description": ""},
20+
{"name": "revealKeyboardInteractive", "type": "boolean", "description": ""},
21+
{"name": "manageScrollView", "type": "", "description": "boolean"},
22+
{"name": "requiresSameParentToManageScrollView", "type": "", "description": "boolean"},
23+
{"name": "addBottomView", "type": "", "description": "boolean"},
24+
{"name": "allowHitsOutsideBounds", "type": "", "description": "boolean"},
25+
{"name": "ref", "type": "any", "description": ""},
26+
{"name": "style", "type": "ViewStyle", "description": ""}
27+
],
28+
"snippet": [
29+
"<KeyboardTrackingView",
30+
"style={$1}",
31+
"trackInteractive",
32+
"useSafeArea",
33+
">",
34+
"%2",
35+
"</KeyboardTrackingView>"
36+
]
37+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "KeyboardAwareInsetsView",
3+
"category": "keyboard",
4+
"description": "Used to add an inset when a keyboard is used and might hide part of the screen.",
5+
"notes": "This view is useful only for iOS.",
6+
"extends": "KeyboardTrackingView",
7+
"extendsLink": [
8+
"https://github.com/wix/react-native-ui-lib/blob/master/lib/components/Keyboard/KeyboardTracking/KeyboardTrackingView/index.tsx"
9+
],
10+
"snippet": ["<KeyboardAwareInsetsView/>"]
11+
}

src/components/gridListItem/gridListItem.api.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"name": "renderCustomItem",
1515
"type": "() => React.ReactElement",
1616
"description": "Custom GridListItem to be rendered in the GridView",
17-
"required": ""
17+
"required": true
1818
},
1919
{"name": "itemSize", "type": "number | ImageSize", "description": "The item size"},
2020
{"name": "title", "type": "string | React.ReactElement", "description": "Title content text"},

0 commit comments

Comments
 (0)