Skip to content
fandhe-frontend
GitHub

File Upload

fandhe-frontend-pre-styled-uifile_upload mod が提供するスタイル済み File Upload 部品です。

関連 API: fandhe-frontend-pre-styled-ui API / fandhe-frontend-headless-ui API

Demo

ファイルメタデータ(name/size/mime type)のみを扱い、File オブジェクト自体は headless 層で保持しません。実 File API 接触は wasm-full 側の配線層に隔離されています。

  • report.pdf
    200.0 KB
  • locked.txt
    1.0 KB

Features

  • headless-ui の `file_upload::root` へ委譲し、`size` variant クラスのみを付与する。
  • `disabled` の単一状態フラグを直接引数で受け取る。

Anatomy

root
  label
  dropzone
    trigger
    hidden-input
  item-group
    item
      item-name
      item-size-text
      item-delete-trigger
  clear-trigger

API Reference

Arguments

NameTypeDefaultDescription
sizeSizeSize::Mdサイズ variant。
disabledboolfalse無効化状態。
attrsVec<(&str, &str)>root パーツへ合成する追加属性。
childrenVec<Node>root 配下の子ノード(ドロップゾーン・トリガー等)。

Data Attributes

PartAttributeObserved Values
clear-triggerdata-disabled
dropzonedata-disabled
hidden-inputdata-disabled
itemdata-disabled
item-delete-triggerdata-disabled
rootdata-disabled
triggerdata-disabled

CSS Variables

VariableDefault
--fandhe-file-upload-dropzone-paddingvar(--fandhe-space-6)
--fandhe-file-upload-font-sizevar(--fandhe-font-font-size-sm)