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