SelectElement.hx 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /*
  2. * Copyright (C)2005-2019 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. A `Boolean` reflecting 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`
  33. **/
  34. var autofocus : Bool;
  35. var autocomplete : String;
  36. /**
  37. A `Boolean` reflecting 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. An `HTMLFormElement` referencing 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. A `Boolean` reflecting the `multiple` HTML attribute, which indicates whether multiple items can be selected.
  46. **/
  47. var multiple : Bool;
  48. /**
  49. A `DOMString` reflecting the `name` HTML attribute, containing the name of this control used by servers and DOM search functions.
  50. **/
  51. var name : String;
  52. /**
  53. A `Boolean` reflecting 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. A `long` reflecting 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. A `DOMString` represeting 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. An `HTMLOptionsCollection` representing the set of `option` elements contained by this element.
  66. **/
  67. var options(default,null) : HTMLOptionsCollection;
  68. /**
  69. An `unsigned long `The number of `option` elements in this `select` element.
  70. **/
  71. var length : Int;
  72. /**
  73. An `HTMLCollection` representing the set of `option` elements that are selected.
  74. **/
  75. var selectedOptions(default,null) : HTMLCollection;
  76. /**
  77. A `long` reflecting the index of the first selected `option` element. The value `-1` indicates no element is selected.
  78. **/
  79. var selectedIndex : Int;
  80. /**
  81. A `DOMString` reflecting the value of the form control (the first selected option). Returns the value attribute of the option element or if it is missing, the text attribute.
  82. **/
  83. var value : String;
  84. /**
  85. 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. A `ValidityState` reflecting the validity state that this control is in.
  90. **/
  91. var validity(default,null) : ValidityState;
  92. /**
  93. A `DOMString` representing 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. A `NodeList` of `label` elements associated with the element.
  98. **/
  99. var labels(default,null) : NodeList;
  100. /**
  101. 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.
  102. **/
  103. function item( index : Int ) : Element;
  104. /**
  105. 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.
  106. **/
  107. function namedItem( name : String ) : OptionElement;
  108. /**
  109. Adds an element to the collection of `option` elements for this `select` element.
  110. @throws DOMError
  111. **/
  112. function add( element : haxe.extern.EitherType<OptionElement,OptGroupElement>, ?before : haxe.extern.EitherType<Element,Int> ) : Void;
  113. /**
  114. Removes the element at the specified index from the options collection for this select element.
  115. **/
  116. @:overload( function( index : Int ) : Void {} )
  117. function remove() : Void;
  118. /**
  119. 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`).
  120. **/
  121. function checkValidity() : Bool;
  122. function reportValidity() : Bool;
  123. /**
  124. 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.
  125. **/
  126. function setCustomValidity( error : String ) : Void;
  127. }