Skip to content

Latest commit

 

History

History
69 lines (55 loc) · 2 KB

File metadata and controls

69 lines (55 loc) · 2 KB

bc-field-code

Quick Start

<bc-field-code 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
language string 'javascript' Code language (javascript, python, json, html, sql)
toolbar string 'full' Toolbar mode
min-length number 0 Min length
max-length number 0 Max length

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.