Code Editor Field
Form field wrapping ab-code-editor: label, language type, helpers accordion, suggestions.
HTML tag: c-eebd2684dc31e403e9729ccb761ddcfde
When to use
Section titled “When to use”- labeled code field in a form
- expression/script with helper panels
- language-typed source input
| Prop | Type | Default | Description |
|---|---|---|---|
label | String | ||
type | String | ||
value | String | ||
readonly | Boolean | false | |
helper_sections | Array | ||
suggestions | Array | ||
disabled | Boolean | false | |
label_position | String | ||
theme | String | ||
minimap | Boolean | ||
font_size | String | ||
word_wrap | Boolean | ||
placeholder | String |
- type sets editor language; bind .value.
- Listen value-changed (form contract), not change on host.
- helper_sections embed helper widgets; suggestions merge from helpers.
- readonly/disabled/label/label_position like other fields.
Events
Section titled “Events”| Event | Detail |
|---|---|
value-changed |
What to avoid
Section titled “What to avoid”Do not use raw ab-code-editor in standard entity forms when this field exists. Do not listen for change on the field host.
Example
Section titled “Example”<c-eebd2684dc31e403e9729ccb761ddcfde .label=${'Script'} .type=${'javascript'} .value=${code} @value-changed=${onCode}></c-eebd2684dc31e403e9729ccb761ddcfde>