release: WRNexusJS 0.6.0
This commit is contained in:
@@ -1,52 +1,55 @@
|
||||
component Input {
|
||||
outputs {
|
||||
input(payload: { sourceEvent?: Event; value: string | number | boolean | null | object; [key: string]: string | number | boolean | null | object } | string | number | boolean | null | object[])
|
||||
change(payload: { sourceEvent?: Event; value: string | number | boolean | null | object; [key: string]: string | number | boolean | null | object } | string | number | boolean | null | object[])
|
||||
focus(payload: { sourceEvent?: Event; value: string | number | boolean | null | object; [key: string]: string | number | boolean | null | object } | string | number | boolean | null | object[])
|
||||
blur(payload: { sourceEvent?: Event; value: string | number | boolean | null | object; [key: string]: string | number | boolean | null | object } | string | number | boolean | null | object[])
|
||||
invalid(payload: { value: string | number | boolean | null | object; name: string; message: string; sourceEvent: Event })
|
||||
keydown(payload: { key: string; value: string | number | boolean | null | object; name: string; sourceEvent: Event })
|
||||
keyup(payload: { key: string; value: string | number | boolean | null | object; name: string; sourceEvent: Event })
|
||||
}
|
||||
|
||||
props {
|
||||
@event input = function
|
||||
@event change = function
|
||||
@event focus = function
|
||||
@event blur = function
|
||||
@event invalid = function
|
||||
@event keydown = function
|
||||
@event keyup = function
|
||||
size = "default"
|
||||
color = "primary"
|
||||
id = ""
|
||||
name = ""
|
||||
label = "Input"
|
||||
hiddenLabel = false
|
||||
placeholder = ""
|
||||
value = ""
|
||||
type = "text"
|
||||
variant = "normal"
|
||||
icon = ""
|
||||
iconPosition = "start"
|
||||
helperText = ""
|
||||
cornerHint = ""
|
||||
error = ""
|
||||
inline = false
|
||||
readonly = false
|
||||
disabled = false
|
||||
required = false
|
||||
autocomplete = ""
|
||||
inputmode = ""
|
||||
minlength = ""
|
||||
maxlength = ""
|
||||
pattern = ""
|
||||
min = ""
|
||||
max = ""
|
||||
step = ""
|
||||
class = ""
|
||||
size: string = "default"
|
||||
color: string = "primary"
|
||||
id: string = ""
|
||||
name: string = ""
|
||||
label: string = "Input"
|
||||
hiddenLabel: boolean = false
|
||||
placeholder: string = ""
|
||||
value: string = ""
|
||||
type: string = "text"
|
||||
variant: string = "normal"
|
||||
icon: string = ""
|
||||
iconPosition: string = "start"
|
||||
helperText: string = ""
|
||||
cornerHint: string = ""
|
||||
error: string = ""
|
||||
inline: boolean = false
|
||||
readonly: boolean = false
|
||||
disabled: boolean = false
|
||||
required: boolean = false
|
||||
autocomplete: string = ""
|
||||
inputmode: string = ""
|
||||
minlength: string = ""
|
||||
maxlength: string = ""
|
||||
pattern: string = ""
|
||||
min: string = ""
|
||||
max: string = ""
|
||||
step: string = ""
|
||||
class: string = ""
|
||||
}
|
||||
functions {
|
||||
function detail(sourceEvent) {
|
||||
client function detail(sourceEvent) {
|
||||
return { value: sourceEvent.currentTarget.value, name: name, sourceEvent: sourceEvent }
|
||||
}
|
||||
function handleInput(sourceEvent) { sourceEvent.stopPropagation(); $emit("input", detail(sourceEvent)) }
|
||||
function handleChange(sourceEvent) { sourceEvent.stopPropagation(); $emit("change", detail(sourceEvent)) }
|
||||
function handleFocus(sourceEvent) { sourceEvent.stopPropagation(); $emit("focus", detail(sourceEvent)) }
|
||||
function handleBlur(sourceEvent) { sourceEvent.stopPropagation(); $emit("blur", detail(sourceEvent)) }
|
||||
function handleInvalid(sourceEvent) { sourceEvent.stopPropagation(); $emit("invalid", { value: sourceEvent.currentTarget.value, name: name, message: sourceEvent.currentTarget.validationMessage, sourceEvent: sourceEvent }) }
|
||||
function handleKeydown(sourceEvent) { sourceEvent.stopPropagation(); $emit("keydown", { key: sourceEvent.key, value: sourceEvent.currentTarget.value, name: name, sourceEvent: sourceEvent }) }
|
||||
function handleKeyup(sourceEvent) { sourceEvent.stopPropagation(); $emit("keyup", { key: sourceEvent.key, value: sourceEvent.currentTarget.value, name: name, sourceEvent: sourceEvent }) }
|
||||
client function handleInput(sourceEvent) { sourceEvent.stopPropagation(); output.input(detail(sourceEvent)) }
|
||||
client function handleChange(sourceEvent) { sourceEvent.stopPropagation(); output.change(detail(sourceEvent)) }
|
||||
client function handleFocus(sourceEvent) { sourceEvent.stopPropagation(); output.focus(detail(sourceEvent)) }
|
||||
client function handleBlur(sourceEvent) { sourceEvent.stopPropagation(); output.blur(detail(sourceEvent)) }
|
||||
client function handleInvalid(sourceEvent) { sourceEvent.stopPropagation(); output.invalid({ value: sourceEvent.currentTarget.value, name: name, message: sourceEvent.currentTarget.validationMessage, sourceEvent: sourceEvent }) }
|
||||
client function handleKeydown(sourceEvent) { sourceEvent.stopPropagation(); output.keydown({ key: sourceEvent.key, value: sourceEvent.currentTarget.value, name: name, sourceEvent: sourceEvent }) }
|
||||
client function handleKeyup(sourceEvent) { sourceEvent.stopPropagation(); output.keyup({ key: sourceEvent.key, value: sourceEvent.currentTarget.value, name: name, sourceEvent: sourceEvent }) }
|
||||
}
|
||||
view {
|
||||
<div {...attrs} class="wire-next wire-next--color-{color} wire-next--size-{size} wire-next--field wire-next--input {class}" data-variant="{variant}" data-inline="{inline}" data-floating="{variant === 'floating'}" data-invalid="{error ? 'true' : 'false'}">
|
||||
|
||||
Reference in New Issue
Block a user