SelectElement.hx 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /*
  2. * Copyright (C)2005-2017 Haxe Foundation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. // This file is generated from mozilla\HTMLSelectElement.webidl. Do not edit!
  23. package js.html;
  24. /**
  25. The `HTMLSelectElement` interface represents a `select` HTML Element. These elements also share all of the properties and methods of other HTML elements via the `HTMLElement` interface.
  26. Documentation [HTMLSelectElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/).
  27. @see <https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement>
  28. **/
  29. @:native("HTMLSelectElement")
  30. extern class SelectElement extends Element implements ArrayAccess<Element>
  31. {
  32. /**
  33. Is a `Boolean` that reflects the `autofocus` HTML attribute, which indicates whether the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. Only one form-associated element in a document can have this attribute specified. `2.0`
  34. **/
  35. var autofocus : Bool;
  36. /**
  37. Is a `Boolean` that reflects the `disabled` HTML attribute, which indicates whether the control is disabled. If it is disabled, it does not accept clicks.
  38. **/
  39. var disabled : Bool;
  40. /**
  41. Returns a `HTMLFormElement` representing the form that this element is associated with. If the element is not associated with of a `form` element, then it returns `null`.
  42. **/
  43. var form(default,null) : FormElement;
  44. /**
  45. Is a `Boolean` that reflects the `multiple` HTML attribute, which indicates whether multiple items can be selected.
  46. **/
  47. var multiple : Bool;
  48. /**
  49. Is a `DOMString` that reflects the `name` HTML attribute, containing the name of this control used by servers and DOM search functions.
  50. **/
  51. var name : String;
  52. /**
  53. Is a `Boolean` that reflects the `required` HTML attribute, which indicates whether the user is required to select a value before submitting the form. `2.0`
  54. **/
  55. var required : Bool;
  56. /**
  57. Is a `long` that reflects the `size` HTML attribute, which contains the number of visible items in the control. The default is 1, unless `multiple` is true, in which case it is 4.
  58. **/
  59. var size : Int;
  60. /**
  61. Returns a `DOMString` the form control's type. When `multiple` is `true`, it returns `"select-multiple"`; otherwise, it returns `"select-one"`.
  62. **/
  63. var type(default,null) : String;
  64. /**
  65. Returns a `HTMLOptionsCollection` containing the set of `option` elements contained by this element.
  66. **/
  67. var options(default,null) : HTMLOptionsCollection;
  68. /**
  69. Is a `unsigned long` representing the number of `option` elements in this `select` element.
  70. **/
  71. var length : Int;
  72. /**
  73. Returns a live `HTMLCollection` containing the set of options that are selected.
  74. **/
  75. var selectedOptions(default,null) : HTMLCollection;
  76. /**
  77. Is a `long` that reflects the index of the first selected `option` element. The value `-1` indicates no element is selected.
  78. **/
  79. var selectedIndex : Int;
  80. /**
  81. Is a `DOMString` representing the value of the form control (the first selected option).
  82. **/
  83. var value : String;
  84. /**
  85. Is a `Boolean` that indicates whether the button is a candidate for constraint validation. It is false if any conditions bar it from constraint validation.
  86. **/
  87. var willValidate(default,null) : Bool;
  88. /**
  89. Returns a `ValidityState` representing the validity state that this control is in.
  90. **/
  91. var validity(default,null) : ValidityState;
  92. /**
  93. Returns a `DOMString` containing a localized message that describes the validation constraints that the control does not satisfy (if any). This attribute is the empty string if the control is not a candidate for constraint validation (`willValidate` is false), or it satisfies its constraints.
  94. **/
  95. var validationMessage(default,null) : String;
  96. /**
  97. Gets an item from the options collection for this `select` element. You can also access an item by specifying the index in array-style brackets or parentheses, without calling this method explicitly.
  98. **/
  99. function item( index : Int ) : Element;
  100. /**
  101. Gets the item in the options collection with the specified name. The name string can match either the `id` or the `name` attribute of an option node. You can also access an item by specifying the name in array-style brackets or parentheses, without calling this method explicitly.
  102. **/
  103. function namedItem( name : String ) : OptionElement;
  104. /** @throws DOMError */
  105. /**
  106. Adds an element to the collection of `option` elements for this `select` element.
  107. **/
  108. function add( element : haxe.extern.EitherType<OptionElement,OptGroupElement>, ?before : haxe.extern.EitherType<Element,Int> ) : Void;
  109. /**
  110. Checks whether the element has any constraints and whether it satisfies them. If the element fails its constraints, the browser fires a cancelable `invalid` event at the element (and returns `false`).
  111. **/
  112. function checkValidity() : Bool;
  113. /**
  114. Sets the custom validity message for the selection element to the specified message. Use the empty string to indicate that the element does not have a custom validity error.
  115. **/
  116. function setCustomValidity( error : String ) : Void;
  117. }