TextField

Text field widget, wraps native <input type="text">. Supports two renditions, 'outlined' and 'filled':

Text field
// <code-header>
fiddle.title = 'Text field';
targetElement.toolbarItems = [
    {
        type : 'label',
        text : 'Label position'
    },
    {
        type        : 'buttongroup',
        toggleGroup : true,
        rendition   : 'tonal',
        items       : {
            before : {
                text    : 'Before',
                setting : 'before'
            },
            above : {
                text    : 'Above',
                pressed : true,
                setting : 'above'
            },
            default : {
                text    : 'Default',
                setting : null
            }
        },
        onToggle({ source }) {
            if (source.pressed) {
                for (const textField of source.up('fiddlepanel').widgets) {
                    textField.labelPosition = source.setting;
                }
            }
        }
    }
];
// </code-header>

const outlinedField = new TextField({
    appendTo      : targetElement,
    width         : '70%',
    label         : 'Outlined',
    labelPosition : 'above',
    labelWidth    : '5em',
    style         : 'margin-bottom :1em'
});

const filledField = new TextField({
    appendTo      : targetElement,
    width         : '70%',
    label         : 'Filled',
    rendition     : 'filled',
    labelPosition : 'above',
    labelWidth    : '5em'
});

// <code-footer>
targetElement.widgets = [outlinedField, filledField];
// </code-footer>

This field can be used as an editor for the Column. It is used as the default editor for the Column, TemplateColumn, TreeColumn, and for other columns if another editor is not specified explicitly, or disabled by setting false value.

Configs

110

Common

listenersEvents

Field

maxLength: Number

The max number of characters for the input field

minLength: Number

The min number of characters for the input field

Other

rendition: outlined | filled | StringAlso a property

Predefined style to use for the field. Possible values are:

  • 'outlined' (default)
  • 'filled'

The supplied value will be part of the field's class list, as b-text-field-{rendition}.

columnWidget
nameField
rtlRTL
spanWidget
valueField

Accessibility

ariaLabelWidget
keyMapKeyMap

Container

inlineField

CSS

clsWidget
colorWidget
htmlClsWidget
styleWidget
uiWidget

DOM

adoptWidget
appendToWidget
contentWidget
datasetWidget
htmlWidget
idWidget
tagWidget
titleWidget

Float & align

alignWidget
anchorWidget
centeredWidget
draggableWidget
floatingWidget
xWidget
yWidget

Input element

Label

hintField
labelLabelable
labelClsLabelable
labelPositionLabelable
labelsField
labelWidthLabelable

Layout

alignSelfWidget
dockWidget
flexWidget
heightWidget
hiddenWidget
marginWidget
maxHeightWidget
maxWidthWidget
minHeightWidget
minWidthWidget
textAlignWidget
weightWidget
widthWidget

Misc

badgeBadge
dataFieldWidget
disabledWidget
localeClassLocalizable
localizableLocalizable
maskedWidget
ownerWidget
refWidget
rippleWidget
tabWidget
tooltipWidget

Scrolling

Properties

85

Class hierarchy

isTextField: Boolean= truereadonly
Identifies an object as an instance of TextField class, or subclass thereof.
isTextField: Boolean= truereadonlystatic
Identifies an object as an instance of TextField class, or subclass thereof.
isBadgeBadge
isDelayableDelayable
isEventsEvents
isFieldField
isFormulaFieldFormulaField
isKeyMapKeyMap
isLabelableLabelable
isLocalizableLocalizable
isValidatableValidatable
isWidgetWidget

Other

rendition: outlined | filled | StringAlso a config

Predefined style to use for the field. Possible values are:

  • 'outlined' (default)
  • 'filled'

The supplied value will be part of the field's class list, as b-text-field-{rendition}.

$namestaticWidget
columnWidget
formulaFormulaField
inputField
isEmptyField
isValidField
rtlRTL
spanWidget
typestaticWidget
valueField

Accessibility

keyMapKeyMap

CSS

clsWidget

DOM

appendToWidget
contentWidget
datasetWidget
elementWidget
htmlWidget
idWidget
styleWidget

Float & align

xWidget
yWidget

Layout

alignSelfWidget
flexWidget
heightWidget
marginWidget
maxHeightWidget
maxWidthWidget
minHeightWidget
minWidthWidget
widthWidget

Lifecycle

configBase

Misc

badgeBadge
cellInfoWidget
disabledWidget
errorTipValidatable
labelLabelable
localeHelperLocalizable
localeManagerLocalizable
refWidget
tabWidget
tooltipWidget

Visibility

hiddenWidget
isVisibleWidget

Widget hierarchy

ownerWidget
parentWidget

Functions

64

Configuration

applyDefaultsstaticBase

Events

Float & align

alignToWidget
setXYWidget
showByWidget
toFrontWidget

Lifecycle

createstaticWidget
destroystaticBase
initClassstaticWidget

Misc

attachTooltipstaticWidget
fromElementstaticWidget
fromSelectorstaticWidget
getByIdstaticWidget
isOfTypeNamestaticBase
mixinstaticBase
optionalLstaticLocalizable

Other

clearField
clearErrorValidatable
composeWidget
createOnFrameDelayable
disableWidget
enableWidget
focusWidget
getErrorsValidatable
LstaticLocalizable
maskWidget
onEvents
recomposeWidget
relayAllEvents
selectField
setErrorValidatable
triggerEvents
unEvents
unmaskWidget

Visibility

hideWidget
showWidget

Widget hierarchy

closestWidget
containsWidget
ownsWidget
queryWidget
queryAllWidget
upWidget

Events

19
actionField
catchAllEvents
changeField
clearField
destroyEvents
focusInWidget
focusOutWidget
hideWidget
inputField
paintWidget
readOnlyWidget
recomposeWidget
resizeWidget
showWidget
triggerField

Event handlers

19

Typedefs

7

CSS variables

124
NameDescription
--b-text-field-font-weightField's font-weight
--b-text-field-paddingField's padding
--b-text-field-input-font-sizeInput font-size
--b-text-field-input-paddingInput padding
--b-text-field-border-styleField's border-style
--b-text-field-outlined-border-radiusOutlinedOutlined field's border-radius
--b-field-trigger-gapField trigger's gap (applied as padding to be clickable)
--b-field-trigger-edge-gapGap between first / last field trigger and field edge (applied as padding to be clickable)
--b-text-field-default-template-areasTemplate areas to use when no `labelPosition` is set
--b-text-field-default-template-columnsTemplate columns to use when no `labelPosition` is set
--b-text-field-default-label-paddingLabel padding to use when no `labelPosition` is set
--b-text-field-border-radiusField's border-radius
--b-text-field-label-grid-areaLabel grid-area, normally determined by used rendition
--b-text-field-label-paddingLabel padding
--b-text-field-label-colorLabel color
--b-text-field-backgroundField background, normally determined by used rendition
--b-text-field-input-colorInput color (color of entered text)
--b-text-field-input-heightInput height
--b-text-field-border-colorField border-color
--b-text-field-label-above-grid-areaLabel grid-area when the placed above
--b-text-field-label-font-sizeLabel font-size
--b-text-field-empty-label-font-sizeLabel font-size when field is empty
--b-text-field-label-backgroundLabel background
--b-text-field-label-scaleLabel scale (used by material)
--b-text-field-empty-label-scaleLabel scale when empty (used by material)
--b-text-field-filled-backgroundFilledField background, when using filled rendition
--b-text-field-filled-border-widthFilledField border-width, when using filled rendition
--b-text-field-filled-border-radiusFilledField border-radius, when using filled rendition
--b-text-field-filled-input-paddingFilledInput padding, when using filled rendition
--b-text-field-filled-no-label-input-paddingFilledInput padding for field without label, when using filled rendition
--b-text-field-filled-label-paddingFilledLabel padding, when using filled rendition
--b-text-field-filled-label-before-paddingFilledPadding for label positioned before the field, when using filled rendition
--b-text-field-filled-label-above-paddingFilledPadding for label positioned above the field, when using filled rendition
--b-text-field-filled-empty-label-paddingFilledPadding for label of an empty field, when using filled rendition
--b-text-field-outlined-backgroundOutlinedField background, when using outlined rendition
--b-text-field-outlined-border-widthOutlinedField border-width, when using outlined rendition
--b-text-field-outlined-border-colorOutlinedField border-color, when using outlined rendition
--b-text-field-outlined-input-paddingOutlinedField input padding, when using outlined rendition
--b-text-field-outlined-focus-border-widthOutlinedFocused field's border-width, when using outlined rendition
--b-text-field-outlined-label-backgroundOutlinedLabel background, when using outlined rendition
--b-text-field-outlined-label-paddingOutlinedLabel padding, when using outlined rendition
--b-text-field-outlined-label-before-paddingOutlinedPadding for label positioned before the field, when using outlined rendition
--b-text-field-outlined-label-above-paddingOutlinedPadding for label positioned above the field, when using outlined rendition
--b-text-field-outlined-empty-label-paddingOutlinedPadding for label of an empty field, when using outlined rendition
--b-text-field-material-label-positionLabel position (material)
--b-text-field-material-label-topLabel top (material)
--b-text-field-material-label-leftLabel left (material)
--b-text-field-material-label-cursorLabel cursor (material)
--b-text-field-filled-material-label-positionFilledLabel position property, using filled rendition in material
--b-text-field-filled-material-label-topFilledLabel top, using filled rendition in material
--b-text-field-filled-material-label-leftFilledLabel left, using filled rendition in material
--b-text-field-filled-material-label-cursorFilledLabel cursor, using filled rendition in material
--b-text-field-filled-material-empty-label-font-sizeFilledFont-size for empty field's label, using filled rendition in material
--b-text-field-filled-material-empty-label-topFilledLabel top for empty field, using filled rendition in material
--b-text-field-filled-material-empty-label-leftFilledLabel left for empty field, using filled rendition in material
--b-text-field-filled-material-trigger-label-leftFilledLabel left for field with trigger, using filled rendition in material
--b-text-field-filled-material-trigger-empty-label-leftFilledLabel left for empty field with trigger, using filled rendition in material
--b-text-field-outlined-material-label-positionOutlinedLabel position property, using outlined rendition in material
--b-text-field-outlined-material-label-topOutlinedLabel top, using outlined rendition in material
--b-text-field-outlined-material-label-leftOutlinedLabel left, using outlined rendition in material
--b-text-field-outlined-material-label-cursorOutlinedLabel cursor, using outlined rendition in material
--b-text-field-outlined-material-empty-label-backgroundOutlinedBackground for empty field's label, using outlined rendition in material
--b-text-field-outlined-material-empty-label-topOutlinedLabel top for empty field, using outlined rendition in material
--b-text-field-outlined-material-empty-label-leftOutlinedLabel left for empty field, using outlined rendition in material
--b-text-field-outlined-material-trigger-empty-label-leftOutlinedLabel left for field with trigger, using outlined rendition in material
--b-text-field-outlined-material-empty-label-paddingOutlinedLabel padding for empty field, using outlined rendition in material
--b-field-trigger-colorField trigger color
--b-spin-trigger-font-sizeSpin trigger icon font-size (number field)
--b-text-field-colorField color
--b-text-field-default-widthDefault width applied to a text field's is used in a toolbar, or not used in a Bryntum container (includes the label)
--b-text-field-selection-backgroundBackground for selected text
Disabled
--b-text-field-disabled-opacityField's opacity when disabled
--b-text-field-trigger-disabled-colorField trigger's color when disabled
Focused
--b-text-field-focus-border-styleField's border-style when focused
--b-text-field-filled-focus-backgroundFilledFocused field's background, when using filled rendition
--b-text-field-filled-focus-border-widthFilledFocused field's border-width, when using filled rendition
--b-text-field-filled-focus-label-colorFilledFocused field's label color, when using filled rendition
--b-text-field-outlined-focus-backgroundOutlinedBackground for focused field, when using outlined rendition
--b-text-field-outlined-focus-label-colorOutlinedLabel color for focused field, when using outlined rendition
--b-text-field-focus-border-colorFocused field's border-color
Hovered
--b-text-field-hover-border-colorField border-color when hovered
--b-text-field-filled-hover-backgroundFilledHovered field's background, when using filled rendition
--b-text-field-outlined-hover-border-colorOutlinedBorder color for hovered field, when using outlined rendition
--b-text-field-outlined-hover-backgroundOutlinedBackground for hovered field, when using outlined rendition
Invalid
--b-text-field-invalid-border-colorInvalid field's border-color
--b-text-field-invalid-label-colorInvalid field's label color
Read-only
--b-text-field-trigger-read-only-colorField trigger's color when readonly

Inherited