package vdom

// DOM event-name constants for On / OnEvent.
const (
	EVENT_CLICK       = "click"
	EVENT_DBLCLICK    = "dblclick"
	EVENT_INPUT       = "input"
	EVENT_CHANGE      = "change"
	EVENT_SUBMIT      = "submit"
	EVENT_KEYDOWN     = "keydown"
	EVENT_KEYUP       = "keyup"
	EVENT_FOCUS       = "focus"
	EVENT_BLUR        = "blur"
	EVENT_MOUSEDOWN   = "mousedown"
	EVENT_MOUSEUP     = "mouseup"
	EVENT_MOUSEMOVE   = "mousemove"
	EVENT_MOUSEENTER  = "mouseenter"
	EVENT_MOUSELEAVE  = "mouseleave"
	EVENT_CONTEXTMENU = "contextmenu"

	// Pointer events unify mouse, touch and pen behind one set of handlers that all
	// carry clientX/clientY. A component that wants to be drawn on — the signature pad —
	// needs exactly one code path, not a mouse one and a touch one that drift apart.
	EVENT_POINTERDOWN   = "pointerdown"
	EVENT_POINTERMOVE   = "pointermove"
	EVENT_POINTERUP     = "pointerup"
	EVENT_POINTERCANCEL = "pointercancel"
	EVENT_POINTERLEAVE  = "pointerleave"

	EVENT_SCROLL = "scroll"
	EVENT_RESIZE = "resize"
	EVENT_WHEEL  = "wheel"

	// focusin/focusout BUBBLE; focus/blur do not. Anything that needs to know a
	// subtree gained focus (a tooltip staying open while a child is focused) must
	// use these.
	EVENT_FOCUSIN  = "focusin"
	EVENT_FOCUSOUT = "focusout"

	// HTML5 drag-and-drop. The handler's Event carries the DataTransfer via
	// SetData / GetData.
	EVENT_DRAGSTART = "dragstart"
	EVENT_DRAGOVER  = "dragover"
	EVENT_DRAGENTER = "dragenter"
	EVENT_DRAGLEAVE = "dragleave"
	EVENT_DROP      = "drop"
	EVENT_DRAGEND   = "dragend"
)

// KeyboardEvent.key values, for Event.Key().
const (
	KEY_ESCAPE      = "Escape"
	KEY_ENTER       = "Enter"
	KEY_SPACE       = " "
	KEY_TAB         = "Tab"
	KEY_BACKSPACE   = "Backspace"
	KEY_DELETE      = "Delete"
	KEY_ARROW_UP    = "ArrowUp"
	KEY_ARROW_DOWN  = "ArrowDown"
	KEY_ARROW_LEFT  = "ArrowLeft"
	KEY_ARROW_RIGHT = "ArrowRight"
	KEY_HOME        = "Home"
	KEY_END         = "End"
	KEY_PAGE_UP     = "PageUp"
	KEY_PAGE_DOWN   = "PageDown"
)
