Mixins / foldkit-mixins-ui

FileInputView

interface · packages/mixins-ui/src/fileInput.ts:144

interface FileInputView<Message> {
  readonly id: string
  readonly label: string
  readonly files: ReadonlyArray<File>
  readonly onChange: (files: ReadonlyArray<File>) => NoInfer<Message>
  readonly onRemove: (file: File) => NoInfer<Message>
  readonly name?: string | undefined
  readonly accept?: ReadonlyArray<string> | undefined
  readonly multiple?: boolean | undefined
  readonly disabled?: boolean | undefined
  readonly required?: boolean | undefined
  readonly invalid?: boolean | undefined
  readonly description?: string | undefined
  readonly words?: FileInputWords | undefined
  readonly style?: NamedStyle<typeof FileInputSlots> | undefined
  readonly mixins?: MixinList<Message> | undefined
}

Members

FileInputView.id

property · packages/mixins-ui/src/fileInput.ts:146

readonly id: string

Prefixes the ids the field draws, unique on the page.

FileInputView.label

property · packages/mixins-ui/src/fileInput.ts:148

readonly label: string

The trigger's words, and the input's accessible name: what the files are for.

FileInputView.files

property · packages/mixins-ui/src/fileInput.ts:150

readonly files: ReadonlyArray<File>

The chosen files, as the application keeps them.

FileInputView.onChange

property · packages/mixins-ui/src/fileInput.ts:152

readonly onChange: (files: ReadonlyArray<File>) => NoInfer<Message>

Sent with the files a pick chose (none when the dialog is cancelled); fold them in with added and answer with Sync.

FileInputView.onRemove

property · packages/mixins-ui/src/fileInput.ts:154

readonly onRemove: (file: File) => NoInfer<Message>

Sent with the file whose remove button was pressed, which the list holds by identity; answer with Sync and Focus.

FileInputView.name

property · packages/mixins-ui/src/fileInput.ts:156

readonly name?: string | undefined

The form field the files submit under.

FileInputView.accept

property · packages/mixins-ui/src/fileInput.ts:158

readonly accept?: ReadonlyArray<string> | undefined

The kinds the dialog offers: .ext, type/* or type/subtype tokens, joined with , for the attribute.

FileInputView.multiple

property · packages/mixins-ui/src/fileInput.ts:159

readonly multiple?: boolean | undefined

FileInputView.disabled

property · packages/mixins-ui/src/fileInput.ts:161

readonly disabled?: boolean | undefined

The input takes no pick, the trigger looks off, and the rows cannot be removed.

FileInputView.required

property · packages/mixins-ui/src/fileInput.ts:163

readonly required?: boolean | undefined

The field must hold a file to submit: the native required.

FileInputView.invalid

property · packages/mixins-ui/src/fileInput.ts:164

readonly invalid?: boolean | undefined

FileInputView.description

property · packages/mixins-ui/src/fileInput.ts:166

readonly description?: string | undefined

Help or the reason it is invalid, read after the name.

FileInputView.words

property · packages/mixins-ui/src/fileInput.ts:167

readonly words?: FileInputWords | undefined

FileInputView.style

property · packages/mixins-ui/src/fileInput.ts:169

readonly style?: NamedStyle<typeof FileInputSlots> | undefined

A style of FileInputSlots, for the field's look.

FileInputView.mixins

property · packages/mixins-ui/src/fileInput.ts:171

readonly mixins?: MixinList<Message> | undefined

Mixins beside the style.