001package react4j.dom.proptypes.html;
002
003import javax.annotation.Nonnull;
004import javax.annotation.Nullable;
005import jsinterop.annotations.JsOverlay;
006import jsinterop.annotations.JsPackage;
007import jsinterop.annotations.JsType;
008import react4j.dom.events.DragEventHandler;
009import react4j.dom.events.FocusEventHandler;
010import react4j.dom.events.FormEventHandler;
011import react4j.dom.events.KeyboardEventHandler;
012import react4j.dom.events.MouseEventHandler;
013import react4j.dom.events.TouchEventHandler;
014import react4j.dom.proptypes.html.attributeTypes.FormMethod;
015import react4j.dom.proptypes.html.attributeTypes.OnOff;
016import react4j.dom.proptypes.html.attributeTypes.Target;
017
018/**
019 * Props for form elements. Refer to http://www.w3schools.com/tags/tag_form.asp
020 */
021@JsType( isNative = true, namespace = JsPackage.GLOBAL, name = "Object" )
022public class FormProps
023  extends HtmlGlobalFields<FormProps>
024{
025  @JsOverlay
026  @Nonnull
027  public final FormProps acceptCharset( String s )
028  {
029    setAcceptCharset( s );
030    return self();
031  }
032
033  @JsOverlay
034  @Nonnull
035  public final FormProps action( String s )
036  {
037    setAction( s );
038    return self();
039  }
040
041  @JsOverlay
042  @Nonnull
043  public final FormProps autoComplete( @OnOff final String value )
044  {
045    setAutoComplete( value );
046    return self();
047  }
048
049  @JsOverlay
050  @Nonnull
051  public final FormProps formEncType( String s )
052  {
053    setFormEncType( s );
054    return self();
055  }
056
057  @JsOverlay
058  @Nonnull
059  public final FormProps formMethod( @Nonnull @FormMethod final String method )
060  {
061    setFormMethod( method );
062    return self();
063  }
064
065  @JsOverlay
066  @Nonnull
067  public final FormProps name( String s )
068  {
069    setName( s );
070    return self();
071  }
072
073  @JsOverlay
074  @Nonnull
075  public final FormProps formNoValidate()
076  {
077    return formNoValidate( true );
078  }
079
080  @JsOverlay
081  @Nonnull
082  public final FormProps formNoValidate( boolean b )
083  {
084    setFormNoValidate( b );
085    return self();
086  }
087
088  @JsOverlay
089  @Nonnull
090  public final FormProps formTarget( @Nonnull @Target final String target )
091  {
092    setFormTarget( target );
093    return self();
094  }
095
096  //Applicable Event Handlers
097
098  // Focus Events
099  @JsOverlay
100  @Nonnull
101  public final FormProps onBlur( @Nullable final FocusEventHandler handler )
102  {
103    setOnBlur( handler );
104    return self();
105  }
106
107  @JsOverlay
108  @Nonnull
109  public final FormProps onFocus( @Nullable final FocusEventHandler handler )
110  {
111    setOnFocus( handler );
112    return self();
113  }
114
115  // Form Events
116  @JsOverlay
117  @Nonnull
118  public final FormProps onChange( @Nullable final FormEventHandler handler )
119  {
120    setOnChange( handler );
121    return self();
122  }
123
124  @JsOverlay
125  @Nonnull
126  public final FormProps onInput( @Nullable final FormEventHandler handler )
127  {
128    setOnInput( handler );
129    return self();
130  }
131
132  @JsOverlay
133  @Nonnull
134  public final FormProps onSubmit( @Nullable final FormEventHandler handler )
135  {
136    setOnSubmit( handler );
137    return self();
138  }
139
140  // Keyboard Events
141  @JsOverlay
142  @Nonnull
143  public final FormProps onKeyDown( @Nullable final KeyboardEventHandler handler )
144  {
145    setOnKeyDown( handler );
146    return self();
147  }
148
149  @JsOverlay
150  @Nonnull
151  public final FormProps onKeyPress( @Nullable final KeyboardEventHandler handler )
152  {
153    setOnKeyPress( handler );
154    return self();
155  }
156
157  @JsOverlay
158  @Nonnull
159  public final FormProps onKeyUp( @Nullable final KeyboardEventHandler handler )
160  {
161    setOnKeyUp( handler );
162    return self();
163  }
164
165  @JsOverlay
166  @Nonnull
167  public final FormProps onClick( @Nullable final MouseEventHandler handler )
168  {
169    setOnClick( handler );
170    return self();
171  }
172
173  @JsOverlay
174  @Nonnull
175  public final FormProps onContextMenu( @Nullable final MouseEventHandler handler )
176  {
177    setOnContextMenu( handler );
178    return self();
179  }
180
181  @JsOverlay
182  @Nonnull
183  public final FormProps onDoubleClick( @Nullable final MouseEventHandler handler )
184  {
185    setOnDoubleClick( handler );
186    return self();
187  }
188
189  @JsOverlay
190  @Nonnull
191  public final FormProps onDrag( @Nullable final DragEventHandler handler )
192  {
193    setOnDrag( handler );
194    return self();
195  }
196
197  @JsOverlay
198  @Nonnull
199  public final FormProps onDragEnd( @Nullable final DragEventHandler handler )
200  {
201    setOnDragEnd( handler );
202    return self();
203  }
204
205  @JsOverlay
206  @Nonnull
207  public final FormProps onDragEnter( @Nullable final DragEventHandler handler )
208  {
209    setOnDragEnter( handler );
210    return self();
211  }
212
213  @JsOverlay
214  @Nonnull
215  public final FormProps onDragExit( @Nullable final DragEventHandler handler )
216  {
217    setOnDragExit( handler );
218    return self();
219  }
220
221  @JsOverlay
222  @Nonnull
223  public final FormProps onDragLeave( @Nullable final DragEventHandler handler )
224  {
225    setOnDragLeave( handler );
226    return self();
227  }
228
229  @JsOverlay
230  @Nonnull
231  public final FormProps onDragOver( @Nullable final DragEventHandler handler )
232  {
233    setOnDragOver( handler );
234    return self();
235  }
236
237  @JsOverlay
238  @Nonnull
239  public final FormProps onDragStart( @Nullable final DragEventHandler handler )
240  {
241    setOnDragStart( handler );
242    return self();
243  }
244
245  @JsOverlay
246  @Nonnull
247  public final FormProps onDrop( @Nullable final DragEventHandler handler )
248  {
249    setOnDrop( handler );
250    return self();
251  }
252
253  @JsOverlay
254  @Nonnull
255  public final FormProps onMouseDown( @Nullable final MouseEventHandler handler )
256  {
257    setOnMouseDown( handler );
258    return self();
259  }
260
261  @JsOverlay
262  @Nonnull
263  public final FormProps onMouseEnter( @Nullable final MouseEventHandler handler )
264  {
265    setOnMouseEnter( handler );
266    return self();
267  }
268
269  @JsOverlay
270  @Nonnull
271  public final FormProps onMouseLeave( @Nullable final MouseEventHandler handler )
272  {
273    setOnMouseLeave( handler );
274    return self();
275  }
276
277  @JsOverlay
278  @Nonnull
279  public final FormProps onMouseMove( @Nullable final MouseEventHandler handler )
280  {
281    setOnMouseMove( handler );
282    return self();
283  }
284
285  @JsOverlay
286  @Nonnull
287  public final FormProps onMouseOut( @Nullable final MouseEventHandler handler )
288  {
289    setOnMouseOut( handler );
290    return self();
291  }
292
293  @JsOverlay
294  @Nonnull
295  public final FormProps onMouseOver( @Nullable final MouseEventHandler handler )
296  {
297    setOnMouseOver( handler );
298    return self();
299  }
300
301  @JsOverlay
302  @Nonnull
303  public final FormProps onMouseUp( @Nullable final MouseEventHandler handler )
304  {
305    setOnMouseUp( handler );
306    return self();
307  }
308
309  // Touch Events
310  @JsOverlay
311  @Nonnull
312  public final FormProps onTouchCancel( @Nullable final TouchEventHandler handler )
313  {
314    setOnTouchCancel( handler );
315    return self();
316  }
317
318  @JsOverlay
319  @Nonnull
320  public final FormProps onTouchEnd( @Nullable final TouchEventHandler handler )
321  {
322    setOnTouchEnd( handler );
323    return self();
324  }
325
326  @JsOverlay
327  @Nonnull
328  public final FormProps onTouchMove( @Nullable final TouchEventHandler handler )
329  {
330    setOnTouchMove( handler );
331    return self();
332  }
333
334  @JsOverlay
335  @Nonnull
336  public final FormProps onTouchStart( @Nullable final TouchEventHandler handler )
337  {
338    setOnTouchStart( handler );
339    return self();
340  }
341}