Skip to content

Latest commit

 

History

History
68 lines (53 loc) · 1.97 KB

File metadata and controls

68 lines (53 loc) · 1.97 KB

bc-field-json

Quick Start

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

Uses the same editor chrome as bc-field-code, with JSON-oriented token coloring and a cleaner IDE-style surface in both light and dark themes.

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
(none) Auto-validates JSON syntax

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.