release: WRNexusJS 0.6.0
This commit is contained in:
@@ -1,38 +1,41 @@
|
||||
component Alert {
|
||||
props {
|
||||
size = "default"
|
||||
color = "info"
|
||||
variant = "soft"
|
||||
class = ""
|
||||
radius = "md"
|
||||
shadow = "sm"
|
||||
|
||||
title = "Alert"
|
||||
description = ""
|
||||
items = []
|
||||
actions = []
|
||||
|
||||
showIcon = false
|
||||
icon = ""
|
||||
dismissible = false
|
||||
dismissLabel = "Dismiss alert"
|
||||
role = "alert"
|
||||
live = "polite"
|
||||
|
||||
linkLabel = ""
|
||||
linkHref = ""
|
||||
actionLabel = ""
|
||||
actionHref = ""
|
||||
compact = false
|
||||
|
||||
@event dismiss = function
|
||||
@event action = function
|
||||
outputs {
|
||||
dismiss(payload: { sourceEvent?: Event; [key: string]: string | number | boolean | null | object })
|
||||
action(payload: { sourceEvent?: Event; [key: string]: string | number | boolean | null | object })
|
||||
}
|
||||
|
||||
state visible = true
|
||||
props {
|
||||
size: string = "default"
|
||||
color: string = "info"
|
||||
variant: string = "soft"
|
||||
class: string = ""
|
||||
radius: string = "md"
|
||||
shadow: string = "sm"
|
||||
|
||||
title: string = "Alert"
|
||||
description: string = ""
|
||||
items: unknown[] = []
|
||||
actions: unknown[] = []
|
||||
|
||||
showIcon: boolean = false
|
||||
icon: string = ""
|
||||
dismissible: boolean = false
|
||||
dismissLabel: string = "Dismiss alert"
|
||||
role: string = "alert"
|
||||
live: string = "polite"
|
||||
|
||||
linkLabel: string = ""
|
||||
linkHref: string = ""
|
||||
actionLabel: string = ""
|
||||
actionHref: string = ""
|
||||
compact: boolean = false
|
||||
|
||||
}
|
||||
|
||||
state visible: boolean = true
|
||||
|
||||
functions {
|
||||
function dispatchAlertEvent(sourceEvent, eventName, action, root, customEvent) {
|
||||
client function dispatchAlertEvent(sourceEvent, eventName, action, root, customEvent) {
|
||||
root = sourceEvent.currentTarget.closest("[data-wrn-alert]")
|
||||
|
||||
if (!root) {
|
||||
@@ -50,12 +53,12 @@ component Alert {
|
||||
root.dispatchEvent(customEvent)
|
||||
}
|
||||
|
||||
function dismissAlert(sourceEvent) {
|
||||
client function dismissAlert(sourceEvent) {
|
||||
visible = false
|
||||
dispatchAlertEvent(sourceEvent, "dismiss", null)
|
||||
}
|
||||
|
||||
function selectAction(sourceEvent, action) {
|
||||
client function selectAction(sourceEvent, action) {
|
||||
dispatchAlertEvent(sourceEvent, "action", action)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user