TextBox (Vue)
Along with the button component (Button), the text box is one of the most basic and popular components of a graphical user interface. We are talking about entering text without formatting (such as bold or italics), and a text editor with support for text formatting is a separate and rather complex topic. But despite the lack of formatting, there is a lot of data that is accepted from the user through this component: names, addresses, all sorts of titles. Moreover, "text" means not only a set of completed sentences, but also any information that can be represented as a sequence of characters:
- Email addresses
- Passwords
- Links
In addition, this component is sometimes used for entering numeric data, although often these are not numbers, but sequences of digits sometimes mixed with auxiliary characters:
- Phone numbers
- Postal codes
- Credit card numbers
In most cases, this component does not provide for line breaks, and when a large number of characters is entered, only a part of them is displayed, although scrolling is possible using the arrow keys. However, in cases where the user is required to enter exactly completed sentences (maybe even paragraphs), the possibility of line breaks is required, which can sometimes be considered as simple text formatting. From the point of view of HTML, a separate type of element is used for multi-line text (and automatic height adjustment is not initially provided), but in YDF to support multi-line mode, you only need to specify the corresponding option, and automatic height adjustment is also available.
As in the case of buttons, the simplicity of the text field is deceptive. Firstly, the text input field is a validatable component, and therefore all the complexity of the task of validation of input data has a direct relation to it. In YDF, a text input field, like other components wrapped in the ValidatableControlShell component, includes optional auxiliary elements such as a label, a comment, a list of validation errors, and so on, although from the point of view of HTML these are all separate elements.
The text input field has many states. Visually distinguishable should be at least:
:hover- Activated when the mouse cursor is hovered over, letting the user know that the system is responding to their actions and if they click on the input field, they will be able to start typing.
:focus- Activated when the text field has taken focus, that is, keyboard input will be accepted inside this text field.
:readonly/:disabled- Active when the input field is read-only. This functionality is not as rare as it seems, because many applications have a view mode and an edit mode.
- Invalid state
- Active when the entered value is not valid, and also if the validity display mode is active. If the input field is initially empty and mandatory, the empty value is invalid from the beginning, however, before highlighting the field in red and informing the user who has not yet done anything about validation errors, the user should be allowed to fill in this field, and only when they remove focus from the input field can the validity display mode be activated. Note that such a concept from the HTML/CSS point of view does not exist, and therefore if validation is defined through HTML attributes like
requiredandminlengthand styles for the pseudoclass:invalid, then these styles will be applied regardless of whether the user has started entering data into empty fields or not yet.
Moreover, some of these states can occur simultaneously. For example, the hover state can occur simultaneously with focus, and both of these states can occur on top of invalid. This raises the question of style priority.
Also, in practice, the following additional functionality is in demand for the input field:
- Icons, which, depending on the design, can be either on the left or on the right
- Password show/hide button
- Button for copying the entered value
All this functionality is available in the TextBox component.
Overview
- Component class
TextBox- Live templates of Vue Component (IntelliJ IDEA IDEs family official plugin)
- Autocomplete-like
- Pug Syntax
TextBox--YDF-Vue-Pug- HTML Syntax
TextBox--YDF-Vue-HTML
- Abbreviation
- Pug Syntax
tb-ydf-vue-pug- HTML Syntax
tb-ydf-vue-html
- Stylus mixin for styles generating
generateTextBoxYDF_GUI_ComponentStyles- Pre-made themes
TextBox.Themes.regular- Regular (Default)
- Pre-made geometric variations
TextBox.GeometricVariations.regular- Regular (Default)
TextBox.GeometricVariations.small- Small
TextBox.GeometricVariations.labelLike- Label like
- Geometric modifiers
TextBox.GeometricModifiers.noRoundings- No roundings
- Pre-made decorative variations
TextBox.DecorativeVariations.regular- Regular (Default)
TextBox.DecorativeVariations.labelLike- Label like
- Loading placeholder
- Unavailable
TextBox Class
Vue Properties
- HTML_Type
- Interpretation
- HTML type
- Type
- string
- Undefined Value Substitution
- "text"
- Is Null Forbidden
- Yes
- Allowed Alternatives
- TextBox__YDF.HTML_Types.regular
- TextBox__YDF.HTML_Types.email
- TextBox__YDF.HTML_Types.number
- TextBox__YDF.HTML_Types.password
- TextBox__YDF.HTML_Types.phoneNumber
- TextBox__YDF.HTML_Types.URI
- label
- Type
- string
- Is Undefined Forbidden
- No
- Is Null Forbidden
- Yes
- Minimal Characters
- 1
- guidance
- Type
- string
- Is Undefined Forbidden
- No
- Is Null Forbidden
- Yes
- Minimal Characters
- 1
- accessibilityGuidance
- Type
- string
- Is Undefined Forbidden
- No
- Is Null Forbidden
- Yes
- Minimal Characters
- 1
- externalLabelHTML_ID
- Interpretation
- HTML ID of external header label
- Type
- string
- Is Undefined Forbidden
- No
- Is Null Forbidden
- Yes
- Minimal Characters
- 1
- placeholder
- Type
- string
- Is Undefined Forbidden
- No
- Is Null Forbidden
- Yes
- Minimal Characters
- 1
- autocomplete
- Interpretation
- Value of the "autocomplete" attribute
- Type
- string
- Is Undefined Forbidden
- No
- Is Null Forbidden
- Yes
- value
- Interpretation
- Initial value
- Type
- string
- Undefined Value Substitution
- ""
- Is Null Forbidden
- Yes
- multiline
- Interpretation
- Whether multi-line support is needed
- Type
- boolean
- Undefined Value Substitution
- false
- Is Null Forbidden
- Yes
- autoResizingForMultilineMode
- Interpretation
- Whether automatic height adjustment is needed in multi-line mode
- Type
- boolean
- Undefined Value Substitution
- true
- Is Null Forbidden
- Yes
- disabled
- Type
- boolean
- Is Undefined Forbidden
- No
- Is Null Forbidden
- Yes
- readonly
- Type
- boolean
- Is Undefined Forbidden
- No
- Is Null Forbidden
- Yes
- required
- Type
- boolean
- Undefined Value Substitution
- false
- Is Null Forbidden
- Yes
- mustDisplayAppropriateBadgeIfInputIsRequired
- Type
- boolean
- Undefined Value Substitution
- false
- Is Null Forbidden
- Yes
- mustDisplayAppropriateBadgeIfInputIsOptional
- Type
- boolean
- Undefined Value Substitution
- false
- Is Null Forbidden
- Yes
- mustAddInvisibleBadgeForHeightEqualizingWhenNoBadge
- Type
- boolean
- Undefined Value Substitution
- false
- Is Null Forbidden
- Yes
- minimalCharactersCount
- Interpretation
- Minimal characters count
- Type
- number
- Is Undefined Forbidden
- No
- Is Null Forbidden
- Yes
- Numbers Set
- positive integer or zero
- maximalCharactersCount
- Interpretation
- Maximal characters count
- Type
- number
- Is Undefined Forbidden
- No
- Is Null Forbidden
- Yes
- Numbers Set
- positive integer or zero
- minimalNumericValue
- Interpretation
- Minimal numeric value
- Type
- number
- Is Undefined Forbidden
- No
- Is Null Forbidden
- Yes
- Numbers Set
- positive integer or zero
- maximalNumericValue
- Interpretation
- Maximal numeric value
- Type
- number
- Is Undefined Forbidden
- No
- Is Null Forbidden
- Yes
- Numbers Set
- positive integer or zero
- hasValueCopyingButton
- Interpretation
- Whether the value copying button is needed
- Type
- boolean
- Undefined Value Substitution
- false
- Is Null Forbidden
- Yes
- hasPasswordDisplayingToggle
- Interpretation
- Whether the password display toggle is needed
- Type
- boolean
- Undefined Value Substitution
- false
- Is Null Forbidden
- Yes
- instanceID_UniqueDynamicPart
- Type
- string
- Is Undefined Forbidden
- No
- Is Null Forbidden
- Yes
- Minimal Characters
- 1
- HTML_IDs
- Type
- Object of fixed schema
- Is Undefined Forbidden
- No
- Is Null Forbidden
- Yes
- Schema
- {
- inputOrTextArea
- Type
- string
- Is Undefined Forbidden
- No
- Is Null Forbidden
- Yes
- Minimal Characters
- 1
- label
- Type
- string
- Is Undefined Forbidden
- No
- Is Null Forbidden
- Yes
- Minimal Characters
- 1
- theme
- Type
- string
- Undefined Value Substitution
- TextBox.Themes.regular
- Is Null Forbidden
- Yes
- Allowed Alternatives
- TextBox.Themes.regular
- (Any of ones defined via `TextBox.defineThemes(themesNames)`)
- areThemesCSS_ClassesCommon
- Type
- boolean
- Undefined Value Substitution
- TextBox.areThemesCSS_ClassesCommon
- Is Null Forbidden
- Yes
- geometricVariation
- Type
- string
- Undefined Value Substitution
- TextBox.GeometricVariations.regular
- Is Null Forbidden
- Yes
- Allowed Alternatives
- TextBox.GeometricVariations.regular
- TextBox.GeometricVariations.small
- TextBox.GeometricVariations.labelLike
- (Any of ones defined via `TextBox.defineGeometricVariations(geometricVariationsNames)`)
- geometricModifiers
- Type
- Indexed array
- Undefined Value Substitution
- []
- Is Null Forbidden
- Yes
- Are Undefined Elements Forbidden
- Yes
- Are Null Elements Forbidden
- Yes
- Array Elements
- Type
- string
- Allowed Alternatives
- TextBox.GeometricModifiers.pillShape
- TextBox.GeometricModifiers.squareShape
- TextBox.GeometricModifiers.squareShapeUnlessOverflowed
- TextBox.GeometricModifiers.singleLine
- TextBox.GeometricModifiers.noLeftBorderAndRoundings
- TextBox.GeometricModifiers.noRightBorderAndRoundings
- TextBox.GeometricModifiers.noTopBorderAndRoundings
- TextBox.GeometricModifiers.noBottomBorderAndRoundings
- TextBox.GeometricModifiers.noRoundings
- TextBox.GeometricModifiers.horizontallyShrinkable
- decorativeVariation
- Type
- string
- Undefined Value Substitution
- TextBox.DecorativeVariations.regular
- Is Null Forbidden
- Yes
- Allowed Alternatives
- Button.DecorativeVariations.regular
- Button.DecorativeVariations.labelLike
- (Any of ones defined via `TextBox.defineDecorativeVariations(decorativeVariationsNames)`)