FileFieldListItem
File card rendered in list mode for each selected file. Displays name, human-readable size, an optional progress bar and a remove button. Renders as a semantic <li> element.
Structure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<origam-file-field-list-item> — renders as a semantic <li>. 5 internal parts: root card ①, file icon ②, content column ③ (name + meta + optional progress ④), and the actions zone ⑤ with the remove button.- 1.origam-file-field-list-item
- Root
- element. display: flex; align-items: center. Has background-color, border (1px solid), border-radius and padding from design tokens.
- 2.origam-file-field-list-item__icon
- OrigamIcon rendered from the fileIcon prop. flex-shrink: 0; color from --origam-file-field-list-item__icon---color.
- 3.origam-file-field-list-item__content
- Flex column: stacks __name, __meta and optional __progress. flex-grow: 1; min-width: 0 for truncation support.
- 4.origam-file-field-list-item__progress
- OrigamProgress bar. Rendered only when the progress prop is a number. height: 4px; rounded; has margin-top from token.
- 5.origam-file-field-list-item__actions
- Flex row of action buttons. flex-shrink: 0. Contains the remove OrigamBtn (flat, size="small").
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- filerequisFile—
- The native File object to display. Provides name and size.
- indexrequisnumber—
- Zero-based index of the file in the current selection. Passed back in the click:remove emit payload.
- progressnumber
- Upload progress from 0 to 100. When defined, an OrigamProgress bar is rendered below the file meta.
- fileIconstringMDI_ICONS.FILE
- MDI icon name for the file type indicator. Defaults to the generic file icon.
- removeIconstringMDI_ICONS.CLOSE
- MDI icon for the remove button. Defaults to mdi-close.
- downloadIconstring
- downloadableboolean
- disabledbooleanfalse
- Disables the remove button.
- readonlybooleanfalse
- Makes the remove button non-interactive without altering its visual state.
- showSizeboolean | 1000 | 1024
- Controls the SI base for the human-readable file size display. true uses the default base; 1000 = SI (kB), 1024 = IEC (KiB).
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- color
- Intent or custom color applied to the progress bar.
- fontSizeTFontSize
- fontWeightTFontWeight
API
Slots
Emplacements de contenu exposés par ce composant.
- #default
- Replaces the entire card content (icon + name + meta + progress + remove button) with custom markup.
API
Emits
Événements émis par ce composant.
- @click:remove{ file: File, index: number }
- Fired when the user clicks the remove button. Payload carries the File reference and its index so the parent can splice the selection array.
- @click:download{ file: File, index: number }
API
Membres exposés
Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.
- <T extends object>(props: T, exclude?: string[]) => Partial<T>
- Utility to forward a filtered subset of props to child components.
- Ref<string>
- Reactive CSS string generated by useStyle from the computed root styles.
- string
- Unique style-sheet ID for this instance.
- () => void
- Injects the computed style sheet into the document.
- () => void
- Removes the injected style sheet.
- Ref<boolean>
- True once the style sheet has been injected into the DOM.
Personnalisation
Variables CSS
Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.
- Card background color.
- Card border color.
- Card border width.
- Card border style.
- Card corner radius (6px as fallback in the .vue; closest token is radius.sm = 4px).
- Gap between the icon, content column and actions zone.
- Block (top/bottom) padding of the card.
- Inline (left/right) padding of the card.
- Color of the file type icon glyph.
- Font size for the file name label.
- Font weight for the file name label.
- Color of the file size / meta text.
- Font size for the file size / meta text.
- Top margin of the progress bar inside the content column.
Inclusion
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Rôles ARIA
Interactions clavier
| Touche | Action |
|---|---|
| Enter / Space | Activates the remove button when focused — native <button> behaviour. |
| Tab | Moves focus to the remove button and then to the next interactive element. |
Notes
- The root element is a semantic <li>. It must be used inside a <ul> (provided by OrigamFileField in list display mode) to satisfy the HTML content model.
- The remove button is a native <button> (via OrigamBtn). It is disabled when disabled=true or readonly=true.
Fondation
Design tokens
Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.
- colorvar(--origam-color__surface---overlay)
- Card background color.
- colorvar(--origam-color__border---subtle)
- Card border color.
- dimensionvar(--origam-radius---sm)
- Card corner radius.
- dimensionvar(--origam-space---3)
- Gap between icon, content and actions (12px).
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Standalone list item