release: WRNexusJS 0.8.0
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
component UploadDropzone {
|
||||
props {
|
||||
store: string = "default"
|
||||
endpoint: string = "/api/upload"
|
||||
accept: string = ""
|
||||
maxBytes: number = 0
|
||||
multiple: boolean = false
|
||||
field: string = "file"
|
||||
label: string = "Drag files here or click to browse"
|
||||
title: string = "Upload files"
|
||||
description: string = "Files are validated and uploaded securely."
|
||||
color: string = "primary"
|
||||
size: string = "md"
|
||||
class: string = ""
|
||||
}
|
||||
view {
|
||||
<Card {...attrs} title='{title}' description='{description}' color='{color}' size='{size}' class='{class}'>
|
||||
<div data-uploader='{store}' data-endpoint='{endpoint}' data-accept='{accept}' data-max='{maxBytes}' data-multiple='{multiple}' data-field='{field}' data-label='{label}'></div>
|
||||
</Card>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
component UploadStatus {
|
||||
props {
|
||||
files: unknown[] = []
|
||||
title: string = "Uploaded files"
|
||||
emptyMessage: string = "No files uploaded yet."
|
||||
color: string = "primary"
|
||||
size: string = "sm"
|
||||
class: string = ""
|
||||
}
|
||||
view {
|
||||
<Card {...attrs} title='{title}' color='{color}' size='{size}' class='{class}'>
|
||||
{#if files.length == 0}<Alert title="Waiting for files" description='{emptyMessage}' color="info" variant="soft" size='{size}' />{/if}
|
||||
<div class="space-y-2">
|
||||
{#each files as file}
|
||||
<div class="flex items-center gap-3 rounded-[var(--wire-radius-sm)] border border-[var(--wire-color-border)] p-3">
|
||||
<span class="icon-[lucide--file-check-2] size-5 text-[var(--wire-color-success)]"></span>
|
||||
<div class="min-w-0 flex-1"><p class="m-0 truncate text-sm font-semibold">{file.name}</p><p class="m-0 text-xs text-[var(--wire-color-muted)]">{file.type || "File"} · {file.size || 0} bytes</p></div>
|
||||
<Badge label='{file.status || "uploaded"}' color='{file.status == "error" ? "danger" : "success"}' variant="soft" size='{size}' />
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</Card>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user