Skip to content

Commit 631f576

Browse files
sgnycknitt
authored andcommitted
Add CheckBox component (Android-only) (#464)
1 parent 12aa9dd commit 631f576

3 files changed

Lines changed: 197 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
'use strict';
2+
3+
var NativeElement$ReactNative = require("../elements/NativeElement.bs.js");
4+
5+
6+
/* NativeElement-ReactNative Not a pure module */
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
id: components/CheckBox
3+
title: CheckBox
4+
wip: true
5+
---
6+
7+
```reason
8+
include NativeElement;
9+
10+
type checkBoxEvent =
11+
Event.syntheticEvent({
12+
.
13+
"target": int,
14+
"value": bool,
15+
});
16+
17+
[@react.component] [@bs.module "react-native"]
18+
external make:
19+
(
20+
~ref: ref=?,
21+
// CheckBox props
22+
~disabled: bool=?,
23+
~onChange: checkBoxEvent => unit=?,
24+
~onValueChange: bool => unit=?,
25+
~value: bool=?,
26+
// View props
27+
~accessibilityComponentType: [@bs.string] [
28+
| `none
29+
| `button
30+
| `radiobutton_checked
31+
| `radiobutton_unchecked
32+
]
33+
=?,
34+
~accessibilityElementsHidden: bool=?,
35+
~accessibilityHint: string=?,
36+
~accessibilityIgnoresInvertColors: bool=?,
37+
~accessibilityLabel: string=?,
38+
~accessibilityLiveRegion: [@bs.string] [ | `none | `polite | `assertive]=?,
39+
~accessibilityRole: [@bs.string] [
40+
| `none
41+
| `button
42+
| `link
43+
| `search
44+
| `image
45+
| `keyboardkey
46+
| `text
47+
| `adjustable
48+
| `header
49+
| `summary
50+
| `imagebutton
51+
]
52+
=?,
53+
~accessibilityStates: array(AccessibilityState.t)=?,
54+
~accessibilityTraits: array(AccessibilityTrait.t)=?,
55+
~accessibilityViewIsModal: bool=?,
56+
~accessible: bool=?,
57+
~collapsable: bool=?,
58+
~hitSlop: Types.edgeInsets=?,
59+
~importantForAccessibility: [@bs.string] [
60+
| `auto
61+
| `yes
62+
| `no
63+
| [@bs.as "no-hide-descendants"]
64+
`noHideDescendants
65+
]
66+
=?,
67+
~nativeID: string=?,
68+
~needsOffscreenAlphaCompositing: bool=?,
69+
~onAccessibilityEscape: unit => unit=?,
70+
~onAccessibilityTap: unit => unit=?,
71+
~onLayout: Event.layoutEvent => unit=?,
72+
~onMagicTap: unit => unit=?,
73+
// Gesture Responder props
74+
~onMoveShouldSetResponder: Event.pressEvent => bool=?,
75+
~onMoveShouldSetResponderCapture: Event.pressEvent => bool=?,
76+
~onResponderGrant: Event.pressEvent => unit=?,
77+
~onResponderMove: Event.pressEvent => unit=?,
78+
~onResponderReject: Event.pressEvent => unit=?,
79+
~onResponderRelease: Event.pressEvent => unit=?,
80+
~onResponderTerminate: Event.pressEvent => unit=?,
81+
~onResponderTerminationRequest: Event.pressEvent => unit=?,
82+
~onStartShouldSetResponder: Event.pressEvent => bool=?,
83+
~onStartShouldSetResponderCapture: Event.pressEvent => bool=?,
84+
~pointerEvents: [@bs.string] [
85+
| `auto
86+
| `none
87+
| [@bs.as "box-none"] `boxNone
88+
| [@bs.as "box-only"] `boxOnly
89+
]
90+
=?,
91+
~removeClippedSubviews: bool=?,
92+
~renderToHardwareTextureAndroid: bool=?,
93+
~shouldRasterizeIOS: bool=?,
94+
~style: Style.t=?,
95+
~testID: string=?
96+
) =>
97+
React.element =
98+
"CheckBox";
99+
100+
```
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
include NativeElement;
2+
3+
type checkBoxEvent =
4+
Event.syntheticEvent({
5+
.
6+
"target": int,
7+
"value": bool,
8+
});
9+
10+
[@react.component] [@bs.module "react-native"]
11+
external make:
12+
(
13+
~ref: ref=?,
14+
// CheckBox props
15+
~disabled: bool=?,
16+
~onChange: checkBoxEvent => unit=?,
17+
~onValueChange: bool => unit=?,
18+
~value: bool=?,
19+
// View props
20+
~accessibilityComponentType: [@bs.string] [
21+
| `none
22+
| `button
23+
| `radiobutton_checked
24+
| `radiobutton_unchecked
25+
]
26+
=?,
27+
~accessibilityElementsHidden: bool=?,
28+
~accessibilityHint: string=?,
29+
~accessibilityIgnoresInvertColors: bool=?,
30+
~accessibilityLabel: string=?,
31+
~accessibilityLiveRegion: [@bs.string] [ | `none | `polite | `assertive]=?,
32+
~accessibilityRole: [@bs.string] [
33+
| `none
34+
| `button
35+
| `link
36+
| `search
37+
| `image
38+
| `keyboardkey
39+
| `text
40+
| `adjustable
41+
| `header
42+
| `summary
43+
| `imagebutton
44+
]
45+
=?,
46+
~accessibilityStates: array(AccessibilityState.t)=?,
47+
~accessibilityTraits: array(AccessibilityTrait.t)=?,
48+
~accessibilityViewIsModal: bool=?,
49+
~accessible: bool=?,
50+
~collapsable: bool=?,
51+
~hitSlop: Types.edgeInsets=?,
52+
~importantForAccessibility: [@bs.string] [
53+
| `auto
54+
| `yes
55+
| `no
56+
| [@bs.as "no-hide-descendants"]
57+
`noHideDescendants
58+
]
59+
=?,
60+
~nativeID: string=?,
61+
~needsOffscreenAlphaCompositing: bool=?,
62+
~onAccessibilityEscape: unit => unit=?,
63+
~onAccessibilityTap: unit => unit=?,
64+
~onLayout: Event.layoutEvent => unit=?,
65+
~onMagicTap: unit => unit=?,
66+
// Gesture Responder props
67+
~onMoveShouldSetResponder: Event.pressEvent => bool=?,
68+
~onMoveShouldSetResponderCapture: Event.pressEvent => bool=?,
69+
~onResponderGrant: Event.pressEvent => unit=?,
70+
~onResponderMove: Event.pressEvent => unit=?,
71+
~onResponderReject: Event.pressEvent => unit=?,
72+
~onResponderRelease: Event.pressEvent => unit=?,
73+
~onResponderTerminate: Event.pressEvent => unit=?,
74+
~onResponderTerminationRequest: Event.pressEvent => unit=?,
75+
~onStartShouldSetResponder: Event.pressEvent => bool=?,
76+
~onStartShouldSetResponderCapture: Event.pressEvent => bool=?,
77+
~pointerEvents: [@bs.string] [
78+
| `auto
79+
| `none
80+
| [@bs.as "box-none"] `boxNone
81+
| [@bs.as "box-only"] `boxOnly
82+
]
83+
=?,
84+
~removeClippedSubviews: bool=?,
85+
~renderToHardwareTextureAndroid: bool=?,
86+
~shouldRasterizeIOS: bool=?,
87+
~style: Style.t=?,
88+
~testID: string=?
89+
) =>
90+
React.element =
91+
"CheckBox";

0 commit comments

Comments
 (0)