Components
AttachmentsToolbar
Barra di azioni per gestire allegati — upload, ricerca, filtri, switch list/grid, refresh, delete bulk.
Panoramica
AttachmentsToolbar è la barra superiore mostrata da AttachmentsManager ma può essere usata standalone per costruire layout custom. Espone:
- Pulsante upload con file picker (
FileUploaddi@pzeta/vue-components) - Campo ricerca + filtri (tipo, size, sort)
- Toggle list/grid (
v-model:viewMode) - Pulsante refresh
- Delete bulk (visibile se
selectedCount > 0)
Props
| Prop | Tipo | Default | Descrizione |
|---|---|---|---|
viewMode | 'grid' | 'list' | — | Modalità (v-model:view-mode) |
filters | FiltersState | — | Stato filtri (v-model:filters) |
stats | StatsState | — | Statistiche (totalSize, totalCount, typeDistribution) |
selectedCount | number | — | Numero elementi selezionati (per pulsante delete bulk) |
multiple | boolean | true | Permette upload multipli |
maxSize | number | 100 MB | Dimensione max upload |
allowedTypes | string[] | [] | MIME accepted |
enableFilters | boolean | true | Mostra filtri tipo/size/sort |
enableSearch | boolean | true | Mostra campo ricerca |
enableViewSwitch | boolean | true | Mostra toggle list/grid |
enableUpload | boolean | true | Mostra pulsante upload |
Tipi
interface FiltersState {
search: string
type?: string
size?: string
sortBy?: string
sortDir?: 'asc' | 'desc'
}
interface StatsState {
totalSize: number
totalCount: number
typeDistribution: Record<string, number>
}
Eventi
| Evento | Payload | Descrizione |
|---|---|---|
update:viewMode | 'grid' | 'list' | |
update:filters | FiltersState | |
upload | FileUploadFile[] | Selezione file dal picker |
delete-selected | — | Click pulsante "elimina selezionati" |
refresh | — | Click pulsante refresh |