input<L, V> function

DomElement<L, V> input<L, V>({
  1. String? key,
  2. List<String>? classes,
  3. Map<String, String>? attributes,
  4. Map<String, String>? styles,
  5. String? accept,
  6. String? accesskey,
  7. String? alt,
  8. String? autocapitalize,
  9. String? autocomplete,
  10. String? capture,
  11. bool? checked,
  12. String? contenteditable,
  13. String? dir,
  14. String? dirname,
  15. bool? disabled,
  16. String? draggable,
  17. String? form,
  18. String? formaction,
  19. String? formenctype,
  20. String? formmethod,
  21. bool? formnovalidate,
  22. String? formtarget,
  23. String? height,
  24. String? hidden,
  25. String? id,
  26. String? itemprop,
  27. String? lang,
  28. String? list,
  29. String? max,
  30. String? maxlength,
  31. String? min,
  32. String? minlength,
  33. bool? multiple,
  34. String? name,
  35. String? pattern,
  36. String? placeholder,
  37. bool? readonly,
  38. bool? required,
  39. String? role,
  40. String? size,
  41. String? slot,
  42. String? spellcheck,
  43. String? src,
  44. String? step,
  45. String? tabindex,
  46. String? title,
  47. String? translate,
  48. String? type,
  49. String? usemap,
  50. String? value,
  51. String? width,
  52. Map<String, DomEventFn<L, V>>? events,
  53. DomLifecycleEventFn<L>? onCreate,
  54. DomLifecycleEventFn<L>? onUpdate,
  55. DomLifecycleEventFn<L>? onRemove,
  56. Iterable<DomNode<L, V>>? children,
  57. DomNode<L, V>? child,
  58. String? text,
})

Used to create interactive controls for web-based forms to accept data from the user; a wide variety of types of input data and control widgets are available, depending on the device and user agent. The element is one of the most powerful and complex in all of HTML due to the sheer number of combinations of input types and attributes.

Implementation

DomElement<L, V> input<L, V>({
  String? key,
  List<String>? classes,
  Map<String, String>? attributes,
  Map<String, String>? styles,

  /// List of types the server accepts, typically a file type.
  String? accept,

  /// Keyboard shortcut to activate or add focus to the element.
  String? accesskey,

  /// Alternative text in case an image can't be displayed.
  String? alt,

  /// Sets whether input is automatically capitalized when entered by user
  String? autocapitalize,

  /// Indicates whether controls in this form can by default have their values
  /// automatically completed by the browser.
  String? autocomplete,

  /// From the Media Capture specification,
  /// specifies a new file can be captured.
  String? capture,

  /// Indicates whether the element should be checked on page load.
  bool? checked,

  /// Indicates whether the element's content is editable.
  String? contenteditable,

  /// Defines the text direction. Allowed values are ltr (Left-To-Right) or
  /// rtl (Right-To-Left)
  String? dir,

  ///
  String? dirname,

  /// Indicates whether the user can interact with the element.
  bool? disabled,

  /// Defines whether the element can be dragged.
  String? draggable,

  /// Indicates the form that is the owner of the element.
  String? form,

  /// Indicates the action of the element, overriding the action defined in
  /// the <form>.
  String? formaction,

  /// If the button/input is a submit button (e.g. type="submit"),
  /// this attribute sets the encoding type to use during form submission. If
  /// this attribute is specified, it overrides the
  /// enctype attribute of the button's
  /// form owner.
  String? formenctype,

  /// If the button/input is a submit button (e.g. type="submit"),
  /// this attribute sets the submission method to use during form submission
  /// (GET, POST, etc.). If this attribute is
  /// specified, it overrides the method attribute of the
  /// button's form owner.
  String? formmethod,

  /// If the button/input is a submit button (e.g. type="submit"),
  /// this boolean attribute specifies that the form is not to be validated
  /// when it is submitted. If this attribute is specified, it overrides the
  /// novalidate attribute of the button's
  /// form owner.
  bool? formnovalidate,

  /// If the button/input is a submit button (e.g. type="submit"),
  /// this attribute specifies the browsing context (for example, tab, window,
  /// or inline frame) in which to display the response that is received after
  /// submitting the form. If this attribute is specified, it overrides the
  /// target attribute of the button's
  /// form owner.
  String? formtarget,

  /// Specifies the height of elements listed here. For all other elements,
  /// use the CSS height property.
  ///
  ///
  ///
  /// Note: In some instances, such as
  /// <div>, this is a legacy attribute, in
  /// which case the CSS height property should
  /// be used instead.
  String? height,

  /// Prevents rendering of given element, while keeping child elements, e.g.
  /// script elements, active.
  String? hidden,

  /// Often used with CSS to style a specific element. The value of this
  /// attribute must be unique.
  String? id,

  ///
  String? itemprop,

  /// Defines the language used in the element.
  String? lang,

  /// Identifies a list of pre-defined options to suggest to the user.
  String? list,

  /// Indicates the maximum value allowed.
  String? max,

  /// Defines the maximum number of characters allowed in the element.
  String? maxlength,

  /// Indicates the minimum value allowed.
  String? min,

  /// Defines the minimum number of characters allowed in the element.
  String? minlength,

  /// Indicates whether multiple values can be entered in an input of the type
  /// email or file.
  bool? multiple,

  /// Name of the element. For example used by the server to identify the
  /// fields in form submits.
  String? name,

  /// Defines a regular expression which the element's value will be validated
  /// against.
  String? pattern,

  /// Provides a hint to the user of what can be entered in the field.
  String? placeholder,

  /// Indicates whether the element can be edited.
  bool? readonly,

  /// Indicates whether this element is required to fill out or not.
  bool? required,

  /// Defines an explicit role for an element for use by assistive technologies.
  String? role,

  /// Defines the width of the element (in pixels). If the element's
  /// type attribute is text or
  /// password then it's the number of characters.
  String? size,

  /// Assigns a slot in a shadow DOM shadow tree to an element.
  String? slot,

  /// Indicates whether spell checking is allowed for the element.
  String? spellcheck,

  /// The URL of the embeddable content.
  String? src,

  ///
  String? step,

  /// Overrides the browser's default tab order and follows the one specified
  /// instead.
  String? tabindex,

  /// Text to be displayed in a tooltip when hovering over the element.
  String? title,

  /// Specify whether an element's attribute values and the values of its
  /// Text node
  /// children are to be translated when the page is localized, or whether to
  /// leave them unchanged.
  String? translate,

  /// Defines the type of the element.
  String? type,

  ///
  String? usemap,

  /// Defines a default value which will be displayed in the element on page
  /// load.
  String? value,

  /// For the elements listed here, this establishes the element's width.
  ///
  ///
  /// Note: For all other instances, such as
  /// <div>, this is a legacy attribute, in
  /// which case the CSS width property should be
  /// used instead.
  String? width,
  Map<String, DomEventFn<L, V>>? events,
  DomLifecycleEventFn<L>? onCreate,
  DomLifecycleEventFn<L>? onUpdate,
  DomLifecycleEventFn<L>? onRemove,
  Iterable<DomNode<L, V>>? children,
  DomNode<L, V>? child,
  String? text,
}) {
  return DomElement<L, V>(
    'input',
    key: key,
    classes: classes,
    attributes: <String, String>{
      if (accept != null) 'accept': accept,
      if (accesskey != null) 'accesskey': accesskey,
      if (alt != null) 'alt': alt,
      if (autocapitalize != null) 'autocapitalize': autocapitalize,
      if (autocomplete != null) 'autocomplete': autocomplete,
      if (capture != null) 'capture': capture,
      if (checked ?? false) 'checked': 'checked',
      if (contenteditable != null) 'contenteditable': contenteditable,
      if (dir != null) 'dir': dir,
      if (dirname != null) 'dirname': dirname,
      if (disabled ?? false) 'disabled': 'disabled',
      if (draggable != null) 'draggable': draggable,
      if (form != null) 'form': form,
      if (formaction != null) 'formaction': formaction,
      if (formenctype != null) 'formenctype': formenctype,
      if (formmethod != null) 'formmethod': formmethod,
      if (formnovalidate ?? false) 'formnovalidate': 'formnovalidate',
      if (formtarget != null) 'formtarget': formtarget,
      if (height != null) 'height': height,
      if (hidden != null) 'hidden': hidden,
      if (id != null) 'id': id,
      if (itemprop != null) 'itemprop': itemprop,
      if (lang != null) 'lang': lang,
      if (list != null) 'list': list,
      if (max != null) 'max': max,
      if (maxlength != null) 'maxlength': maxlength,
      if (min != null) 'min': min,
      if (minlength != null) 'minlength': minlength,
      if (multiple ?? false) 'multiple': 'multiple',
      if (name != null) 'name': name,
      if (pattern != null) 'pattern': pattern,
      if (placeholder != null) 'placeholder': placeholder,
      if (readonly ?? false) 'readonly': 'readonly',
      if (required ?? false) 'required': 'required',
      if (role != null) 'role': role,
      if (size != null) 'size': size,
      if (slot != null) 'slot': slot,
      if (spellcheck != null) 'spellcheck': spellcheck,
      if (src != null) 'src': src,
      if (step != null) 'step': step,
      if (tabindex != null) 'tabindex': tabindex,
      if (title != null) 'title': title,
      if (translate != null) 'translate': translate,
      if (type != null) 'type': type,
      if (usemap != null) 'usemap': usemap,
      if (value != null) 'value': value,
      if (width != null) 'width': width,
      ...?attributes,
    },
    styles: styles,
    events: events,
    onCreate: onCreate,
    onUpdate: onUpdate,
    onRemove: onRemove,
    children: children,
    child: child,
    text: text,
  );
}