release: WRNexusJS 0.8.0
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
component FieldError {
|
||||
props {
|
||||
field: string = ""
|
||||
message: string = ""
|
||||
color: string = "danger"
|
||||
size: string = "sm"
|
||||
class: string = ""
|
||||
}
|
||||
view {
|
||||
<p {...attrs} id='{field ? field + "-error" : ""}' data-error='{field}' role="alert" hidden='{!message}' class='m-0 min-h-4 text-xs text-[var(--wire-color-danger)] {class}'>{message}</p>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
component ValidationSummary {
|
||||
props {
|
||||
errors: unknown[] = []
|
||||
title: string = "Please correct the following"
|
||||
color: string = "danger"
|
||||
size: string = "sm"
|
||||
class: string = ""
|
||||
}
|
||||
view {
|
||||
{#if errors.length > 0}
|
||||
<Alert {...attrs} title='{title}' icon="icon-[lucide--circle-alert]" color='{color}' size='{size}' variant="soft" class='{class}'>
|
||||
<ul class="m-0 mt-2 list-disc space-y-1 pl-5 text-sm">
|
||||
{#each errors as error}<li><a href='#{error.field}' class="underline underline-offset-2">{error.message}</a></li>{/each}
|
||||
</ul>
|
||||
</Alert>
|
||||
{/if}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user