All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.raquo.laminar.defs.eventProps.EventProps.scala Maven / Gradle / Ivy

The newest version!
package com.raquo.laminar.defs.eventProps

import com.raquo.laminar.keys.EventProp
import org.scalajs.dom

// #NOTE: GENERATED CODE
//  - This file is generated at compile time from the data in Scala DOM Types
//  - See `project/DomDefsGenerator.scala` for code generation params
//  - Contribute to https://github.com/raquo/scala-dom-types to add missing tags / attrs / props / etc.

trait EventProps {


  def eventProp[Ev <: dom.Event](key: String): EventProp[Ev] = new EventProp(key)


  // -- Mouse Events --


  /**
    * The click event is raised when the user clicks on an element. The click
    * event will occur after the mousedown and mouseup events.
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
    */
  lazy val onClick: EventProp[dom.MouseEvent] = eventProp("click")


  /**
    * The dblclick event is fired when a pointing device button (usually a
    * mouse button) is clicked twice on a single element.
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/dblclick_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
    */
  lazy val onDblClick: EventProp[dom.MouseEvent] = eventProp("dblclick")


  /**
    * The mousedown event is raised when the user presses the mouse button.
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/mousedown_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
    */
  lazy val onMouseDown: EventProp[dom.MouseEvent] = eventProp("mousedown")


  /**
    * The mousemove event is raised when the user moves the mouse.
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/mousemove_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
    */
  lazy val onMouseMove: EventProp[dom.MouseEvent] = eventProp("mousemove")


  /**
    * The mouseout event is raised when the mouse leaves an element (e.g, when
    * the mouse moves off of an image in the web page, the mouseout event is
    * raised for that image element).
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/mouseout_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
    */
  lazy val onMouseOut: EventProp[dom.MouseEvent] = eventProp("mouseout")


  /**
    * The mouseover event is raised when the user moves the mouse over a
    * particular element.
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/mouseover_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
    */
  lazy val onMouseOver: EventProp[dom.MouseEvent] = eventProp("mouseover")


  /**
    * The mouseleave event is fired when the pointer of a pointing device (usually a mouse) is
    * moved out of an element.
    * 
    * mouseleave and mouseout are similar but differ in that mouseleave does not bubble and mouseout does.
    * 
    * This means that mouseleave is fired when the pointer has exited the element and all of its descendants,
    * whereas mouseout is fired when the pointer leaves the element or leaves one of the element's
    * descendants (even if the pointer is still within the element).
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/mouseleave_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
    */
  lazy val onMouseLeave: EventProp[dom.MouseEvent] = eventProp("mouseleave")


  /**
    * The mouseenter event is fired when a pointing device (usually a mouse) is moved over
    * the element that has the listener attached.
    * 
    * Similar to mouseover, it differs in that it doesn't bubble and that it isn't sent
    * when the pointer is moved from one of its descendants' physical space to its own physical space.
    * 
    * With deep hierarchies, the amount of mouseenter events sent can be quite huge and cause
    * significant performance problems. In such cases, it is better to listen for mouseover events.
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/mouseenter_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
    */
  lazy val onMouseEnter: EventProp[dom.MouseEvent] = eventProp("mouseenter")


  /**
    * The mouseup event is raised when the user releases the mouse button.
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/mouseup_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
    */
  lazy val onMouseUp: EventProp[dom.MouseEvent] = eventProp("mouseup")


  /**
    * Fires when the mouse wheel rolls up or down over an element
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/wheel_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent
    */
  lazy val onWheel: EventProp[dom.WheelEvent] = eventProp("wheel")


  /**
    * Script to be run when a context menu is triggered
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/contextmenu_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
    */
  lazy val onContextMenu: EventProp[dom.MouseEvent] = eventProp("contextmenu")


  /**
    * Script to be run when an element is dragged
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/drag_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/DragEvent
    */
  lazy val onDrag: EventProp[dom.DragEvent] = eventProp("drag")


  /**
    * Script to be run at the end of a drag operation
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dragend_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/DragEvent
    */
  lazy val onDragEnd: EventProp[dom.DragEvent] = eventProp("dragend")


  /**
    * Script to be run when an element has been dragged to a valid drop target
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dragenter_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/DragEvent
    */
  lazy val onDragEnter: EventProp[dom.DragEvent] = eventProp("dragenter")


  /**
    * Script to be run when an element leaves a valid drop target
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dragleave_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/DragEvent
    */
  lazy val onDragLeave: EventProp[dom.DragEvent] = eventProp("dragleave")


  /**
    * Script to be run when an element is being dragged over a valid drop target
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dragover_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/DragEvent
    */
  lazy val onDragOver: EventProp[dom.DragEvent] = eventProp("dragover")


  /**
    * Script to be run at the start of a drag operation
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dragstart_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/DragEvent
    */
  lazy val onDragStart: EventProp[dom.DragEvent] = eventProp("dragstart")


  /**
    * Script to be run when dragged element is being dropped
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/drop_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/DragEvent
    */
  lazy val onDrop: EventProp[dom.DragEvent] = eventProp("drop")


  // -- Pointer Events --


  /**
    * fired when a pointing device is moved into an element's hit test boundaries.
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/pointerover_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent
    */
  lazy val onPointerOver: EventProp[dom.PointerEvent] = eventProp("pointerover")


  /**
    * fired when a pointing device is moved into the hit test boundaries of an element
    * or one of its descendants, including as a result of a pointerdown event
    * from a device that does not support hover (see pointerdown).
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/pointerenter_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent
    */
  lazy val onPointerEnter: EventProp[dom.PointerEvent] = eventProp("pointerenter")


  /**
    * fired when a pointer becomes active.
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/pointerdown_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent
    */
  lazy val onPointerDown: EventProp[dom.PointerEvent] = eventProp("pointerdown")


  /**
    * fired when a pointer changes coordinates.
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/pointermove_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent
    */
  lazy val onPointerMove: EventProp[dom.PointerEvent] = eventProp("pointermove")


  /**
    * fired when a pointer is no longer active.
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/pointerup_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent
    */
  lazy val onPointerUp: EventProp[dom.PointerEvent] = eventProp("pointerup")


  /**
    * a browser fires this event if it concludes the pointer will no longer be able
    * to generate events (for example the related device is deactived).
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/pointercancel_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent
    */
  lazy val onPointerCancel: EventProp[dom.PointerEvent] = eventProp("pointercancel")


  /**
    * fired for several reasons including: pointing device is moved out of
    * the hit test boundaries of an element;
    * firing the pointerup event for a device that does not support hover (see pointerup);
    * after firing the pointercancel event (see pointercancel);
    * when a pen stylus leaves the hover range detectable by the digitizer.
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/pointerout_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent
    */
  lazy val onPointerOut: EventProp[dom.PointerEvent] = eventProp("pointerout")


  /**
    * fired when a pointing device is moved out of the hit test boundaries of an element.
    * For pen devices, this event is fired when the stylus leaves the hover range detectable by the digitizer.
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/pointerleave_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent
    */
  lazy val onPointerLeave: EventProp[dom.PointerEvent] = eventProp("pointerleave")


  /**
    * fired when an element receives pointer capture.
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/gotpointercapture_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent
    */
  lazy val gotPointerCapture: EventProp[dom.PointerEvent] = eventProp("gotpointercapture")


  /**
    * Fired after pointer capture is released for a pointer.
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/lostpointercapture_event
    * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent
    */
  lazy val lostPointerCapture: EventProp[dom.PointerEvent] = eventProp("lostpointercapture")


  // -- Form Events --


  /**
    * The change event is fired for input, select, and textarea elements
    * when a change to the element's value is committed by the user.
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/change_event
    */
  lazy val onChange: EventProp[dom.Event] = eventProp("change")


  /**
    * The select event only fires when text inside a text input or textarea is
    * selected. The event is fired after the text has been selected.
    * 
    * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/select_event
    */
  lazy val onSelect: EventProp[dom.Event] = eventProp("select")


  /**
    * The DOM beforeinput event fires when the value of an , or