Skip to content

Latest commit

 

History

History
72 lines (58 loc) · 2.12 KB

File metadata and controls

72 lines (58 loc) · 2.12 KB

bc-field-file

Quick Start

<bc-field-file name="myfield" label="My Field" />

Props

Prop Type Default Description
name string '' Field identifier
label string '' Display label
value varies Field value
required boolean false Required
readonly boolean false Read-only
disabled boolean false Disabled
validation-status string 'none' Validation state
validation-message string '' Error message
hint string '' Helper text
size string 'md' sm/md/lg
clearable boolean false Clear button
tooltip string '' Tooltip
loading boolean false Loading state
autofocus boolean false Auto focus
default-value varies Default for reset
validate-on string 'blur' Validation trigger

Component-Specific Props

Prop Type Default Description
accept string '' Accepted file types
max-size string '10MB' Max file size
multiple boolean false Allow multiple files
preview boolean false Show file preview
show-download boolean true Show download button
model string '' Model for upload API
record-id string '' Record ID

Events

Event Payload
lcFieldChange {name, value, oldValue}
lcFieldFocus {name, value}
lcFieldBlur {name, value, dirty, touched}
lcFieldClear {name, oldValue}
lcFieldInvalid {name, value, errors}
lcFieldValid {name, value}

Methods

Method Returns
validate() Promise<{valid, errors}>
reset() Promise
clear() Promise
setValue(value, emit?) Promise
getValue() Promise
focusField() Promise
blurField() Promise
isDirty() Promise
isTouched() Promise
setError(msg) Promise
clearError() Promise

See validation, theming, data-fetching.