Skip to content

Commit 4c4abd5

Browse files
czystylgrabbou
authored andcommitted
Add date picker doc (rescript-react-native#271)
1 parent 19a7642 commit 4c4abd5

1 file changed

Lines changed: 257 additions & 0 deletions

File tree

src/components/datePickerIOS.rei

Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,260 @@
1+
/**
2+
3+
Date/time picker for ios in {{:https://facebook.github.io/react-native/docs/datepickerios} React Native DOC},
4+
requires date and onDateChange props to be rendered:
5+
6+
{2 Example}
7+
8+
{3 default}
9+
{[
10+
let component = ReasonReact.statelessComponent("MyComponent");
11+
12+
let make = _children => {
13+
...component,
14+
render: _self =>
15+
<DatePickerIOS
16+
date=(Js.Date.fromString("February 12, 1990 17:40"))
17+
onDateChange=(date => Js.log(date))
18+
/>,
19+
};
20+
]}
21+
22+
Here you can find BuckleScript's {{:https://bucklescript.github.io/bucklescript/api/Js_date.html} Js.Date API}
23+
24+
{{:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date} The JavaScript Date API} might also be a useful resource.
25+
26+
{3 mode}
27+
{[
28+
let component = ReasonReact.statelessComponent("MyComponent");
29+
30+
let make = _children => {
31+
...component,
32+
render: _self =>
33+
<DatePickerIOS
34+
date=(Js.Date.fromString("February 12, 1990 17:40"))
35+
onDateChange=(date => Js.log(date))
36+
mode=`date
37+
/>,
38+
};
39+
]}
40+
41+
{2 Props}
42+
43+
{3 date}
44+
{[
45+
~date: Js.Date.t
46+
]}
47+
48+
{3 onDateChange}
49+
{[
50+
~onDateChange: Js.Date.t => unit
51+
]}
52+
53+
{3 maximumDate}
54+
{[
55+
maximumDate: Js.Date.t=?
56+
]}
57+
58+
{3 minimumDate}
59+
{[
60+
~minimumDate: Js.Date.t=?
61+
]}
62+
63+
{3 mode}
64+
{[
65+
~mode: [
66+
| `date
67+
| `datetime
68+
| `time
69+
]=?
70+
]}
71+
72+
{3 minuteInterval}
73+
{[
74+
~minuteInterval: int=?
75+
]}
76+
77+
{3 timeZoneOffsetInMinutes}
78+
{[
79+
~timeZoneOffsetInMinutes: int=?
80+
]}
81+
82+
{3 accessibilityLabel}
83+
{[
84+
~accessibilityLabel: ReasonReact.reactElement=?
85+
]}
86+
87+
{3 accessible}
88+
{[
89+
~accessible: bool=?
90+
]}
91+
92+
{3 hitSlop}
93+
{[
94+
~hitSlop: Types.insets=?
95+
]}
96+
97+
{4 reference:}
98+
Types.rei
99+
{[
100+
type insets = {
101+
.
102+
"left": int,
103+
"right": int,
104+
"top": int,
105+
"bottom": int,
106+
};
107+
]}
108+
109+
{3 onAccessibilityTap}
110+
{[
111+
~onAccessibilityTap: unit => unit=?
112+
]}
113+
114+
{3 onLayout}
115+
{[
116+
~onLayout: RNEvent.NativeLayoutEvent.t => unit=?
117+
]}
118+
119+
{3 onMagicTap}
120+
{[
121+
~onMagicTap: unit => unit=?
122+
]}
123+
124+
{3 responderHandlers}
125+
{[
126+
~responderHandlers: Types.touchResponderHandlers=?
127+
]}
128+
129+
{4 reference:}
130+
Types.rei
131+
{[
132+
type insets = {
133+
.
134+
"left": int,
135+
"right": int,
136+
"top": int,
137+
"bottom": int,
138+
};
139+
]}
140+
141+
RNEvent.rei
142+
{[
143+
module NativeEvent: {
144+
type t;
145+
let changedTouches: t => array(Js.t({..}));
146+
let identifier: t => int;
147+
let locationX: t => float;
148+
let locationY: t => float;
149+
let pageX: t => float;
150+
let pageY: t => float;
151+
let target: t => Js.t({..});
152+
let touches: t => array(Js.t({..}));
153+
let timestamp: t => int;
154+
let data: t => string;
155+
};
156+
]}
157+
158+
{3 pointerEvents}
159+
{[
160+
~pointerEvents: [
161+
| `auto
162+
| `none
163+
| `boxNone
164+
| `boxOnly
165+
]=?
166+
]}
167+
168+
{3 style}
169+
{[
170+
~style: Style.t=?
171+
]}
172+
173+
{3 testID}
174+
{[
175+
~testID: string=?
176+
]}
177+
178+
{3 accessibilityComponentType}
179+
{[
180+
~accessibilityComponentType: [
181+
| `none
182+
| `button
183+
| `radiobutton_checked
184+
| `radiobutton_unchecked
185+
]=?
186+
]}
187+
188+
{3 accessibilityLiveRegion}
189+
{[
190+
~accessibilityLiveRegion: [
191+
| `none
192+
| `polite
193+
| `assertive
194+
]=?
195+
]}
196+
197+
{3 collapsable}
198+
{[
199+
~collapsable: bool=?
200+
]}
201+
202+
{3 importantForAccessibility}
203+
{[
204+
~importantForAccessibility: [
205+
| `auto
206+
| `yes
207+
| `no
208+
| `noHideDescendants
209+
]=?
210+
]}
211+
212+
{3 needsOffscreenAlphaCompositing}
213+
{[
214+
~needsOffscreenAlphaCompositing: bool=?
215+
]}
216+
217+
{3 renderToHardwareTextureAndroid}
218+
{[
219+
~renderToHardwareTextureAndroid: bool=?
220+
]}
221+
222+
{3 accessibilityTraits}
223+
{[
224+
~accessibilityTraits:
225+
list(
226+
[
227+
| `adjustable
228+
| `allowsDirectInteraction
229+
| `button
230+
| `disabled
231+
| `frequentUpdates
232+
| `header
233+
| `image
234+
| `key
235+
| `link
236+
| `none
237+
| `pageTurn
238+
| `plays
239+
| `search
240+
| `selected
241+
| `startsMedia
242+
| `summary
243+
| `text
244+
],
245+
)=?
246+
]}
247+
248+
{3 accessibilityViewIsModal}
249+
{[
250+
~accessibilityViewIsModal: bool=?
251+
]}
252+
253+
{3 accessibilityViewIsModal}
254+
{[
255+
~shouldRasterizeIOS: bool=?
256+
]}
257+
*/
1258
let make:
2259
(
3260
~date: Js.Date.t,

0 commit comments

Comments
 (0)