Skip to main content
Version: 5.0.0

Text inputs

The text criteria collect free text: a line (text), a secret (password), several lines (textarea), formatted text (markdown-editor), a value to read (text-view) or a color (color). Below are the real criteria of the AWE React client: pick a type, change its attributes and the XML below follows. Type in them, too: they are real fields.

Live preview
XML
<criteria id="demo" component="text" label="Field" />

The controls above write these attributes. The reference lists every attribute, its type and default. Attributes in the XSD reference

AttributeControlValues
componentComponenttextpasswordtextareamarkdown-editortext-viewcolor
labelLabeltext
placeholderPlaceholdertext
iconIconlucide:userlucide:maillucide:searchlucide:calendar
sizeSizesmlg
area-rowsRowstext
unitUnittext
valueText to showtext
validationRequiredtrue / false
readonlyRead onlytrue / false

The attributes shared by every criterion (label, placeholder, icon, size, validation) are in the criteria overview. The markdown-editor has no label of its own: it takes the width of its row and shows its placeholder while empty. The text-view shows its value as text and is not an input: it sends nothing to the server.

Recipes​

Common fields, rendered by the same components.

Password with a show button​

Every password has a button at the end that shows or hides what was typed; the value and its validation do not change.

<criteria id="secret" component="password" label="Password" placeholder="At least 12 characters"
icon="lucide:lock" validation="required" />

Markdown editor​

The markdown-editor offers a toolbar for headings, emphasis, lists and links. Its value is the HTML the editor writes.

<criteria id="notes" component="markdown-editor" placeholder="Write the release notes" />

Color with a picker​

A color criterion is a hexadecimal text with a button that opens a color picker. The value is the color the criterion starts with.

<criteria id="brand" component="color" label="Brand color" value="#4f46e5" />

Events and actions​

A criterion has no event of its own to listen to: every change of its value checks the dependencies whose dependency-element names it, and pressing Enter in a text field runs the submit button of its window. The actions that work on criteria:

ActionDescription
resetEmpties the value of the criterion
restorePuts back the initial value of the criterion
validateRuns the validation of the criterion and shows its error
set-invalidMarks the criterion as invalid with the message of the action
set-validClears the validation error of the criterion
copy-criterion-value-clipboardCopies the value of the criterion to the clipboard

More​