ValidatableControlShell
Input elements like a single-line text field (ValidatableControlShell(type="text")), a multi-line text input (textarea), a dropdown list (select) and so on are usually not used alone, but surrounded by auxiliary elements:
- Caption (usually a
labelelement) - Comment (for example, "dashes and brackets are optional" for a phone number input field)
- "Required" or "optional" labels
- Validation messages
According to one of the principles of quality design, all these surrounding elements should be made in a single style, so there is a need for a template component whose content will surround the input element. In YDF, such a component is ValidatableControlShell — literally, "the shell of a validatable component". As the name implies, this component is not independent, but must be part of other components, or more precisely, be a shell for them.
ValidatableControlShellitself is not a validatable component, because it only displays the validation messages passed to it, but at the same time it does not validate anything itself, since validation is the task of the main component thatValidatableControlShellsurrounds.- When choosing the name, the word "wrapper" was avoided as it is much more polysemantic than "shell". Thus, in relation to user interface components, "wrapper" can mean not only literally wrapping the main component on both sides with its elements, but also extending the functionality of the main component.
Overview
- Pug mixin
ValidatableControlShell--YDF- Live templates of Pug Mixin (IntelliJ IDEA IDEs family official plugin)
- Autocomplete-like
ValidatableControlShell--YDF- Abbreviation
vsc-ydf- Loading Placeholder
- Stylus mixin for styles generating
generateValidatableControlShellYDF_GUI_ComponentStyles- Pre-made themes
ValidatableControlShell__YDF.Themes.regular- Regular (Default)
- Pre-made geometric variations
ValidatableControlShell__YDF.GeometricVariations.regular- Regular (Default)
ValidatableControlShell__YDF.GeometricVariations.small- Small
- Pre-made decorative variations
ValidatableControlShell__YDF.DecorativeVariations.regular- Regular (Default)
- Loading placeholder
- Unavailable
Usage
Markup
Including to Project
The markup of this GUI Component is been provided by the Pug mixin with name ValidatableControlShell--YDF. The including method is standard, by other words, the including of the Pug file Components.pug to your Pug file, herewith it is also required to include preliminary the Functionality.pug file (the last one already included to pages templates so if it include them one more time, the error will occur).
include ../../node_modules/@yamato-daiwa/frontend/Functionality.pug
include ../../node_modules/@yamato-daiwa/frontend/Components.pugIn your case the relative path to node_modules directory could differ depending on how deep below the project root directory your Pug file including above code been stored.
Recall that just including of these files will not give any output HTML code because to get the output HTML code of ValidatableControlShell it is required to call ValidatableControlShell--YDF Pug mixin. Besides this, if currently the styles has not been provided yet, although the HTML code will be generated, the displaying will be incorrect. If you don't know how to provide styles yet, don't worry — it will be explained below.
Pug Mixin ValidatableControlShell--YDF
- Generic technical name
- properties
- Localized name
- Properties
- Type
- Properties
- Generic technical name
- statesSimulations
- Localized name
- States Simulations
- Type
- StatesSimulations
- 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
- 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
- coreElementHTML_ID
- Type
- string
- Is Undefined Forbidden
- No
- Is Null Forbidden
- Yes
- Minimal Characters
- 1
- labelElementHTML_ID
- Type
- string
- Is Undefined Forbidden
- No
- Is Null Forbidden
- Yes
- Minimal Characters
- 1
- mainSlotWrapperAdditionalCSS_Classes
- Type
- Indexed array
- Undefined Value Substitution
- []
- Is Null Forbidden
- Yes
- Are Undefined Elements Forbidden
- Yes
- Are Null Elements Forbidden
- Yes
- Array Elements
- Type
- string
- Minimal Characters
- 1
- theme
- Type
- string
- Undefined Value Substitution
- ValidatableControlShell__YDF.Themes.regular
- Is Null Forbidden
- Yes
- Allowed Alternatives
- ValidatableControlShell__YDF.Themes.regular
- (Any of ones defined via `ValidatableControlShell__YDF.defineThemes(themesNames)`)
- areThemesCSS_ClassesCommon
- Type
- boolean
- Undefined Value Substitution
- ValidatableControlShell__YDF.areThemesCSS_ClassesCommon
- Is Null Forbidden
- Yes
- geometricVariation
- Type
- string
- Undefined Value Substitution
- ValidatableControlShell__YDF.GeometricVariations.regular
- Is Null Forbidden
- Yes
- Allowed Alternatives
- ValidatableControlShell__YDF.GeometricVariations.regular
- ValidatableControlShell__YDF.GeometricVariations.small
- (Any of ones defined via `ValidatableControlShell__YDF.defineGeometricVariations(geometricVariationsNames)`)
- decorativeVariation
- Type
- string
- Undefined Value Substitution
- ValidatableControlShell__YDF.DecorativeVariations.regular
- Is Null Forbidden
- Yes
- Allowed Alternatives
- ValidatableControlShell__YDF.DecorativeVariations.regular
- (Any of ones defined via `ValidatableControlShell__YDF.defineDecorativeVariations(decorativeVariationsNames)`)
- validationErrorsMessages
- Type
- Polymorphic
- Undefined Value Substitution
- false
- Is Null Forbidden
- Yes
- Variants
- Type
- Indexed array
- Are Undefined Elements Forbidden
- Yes
- Are Null Elements Forbidden
- Yes
- Array Elements
- Type
- string
- Minimal Characters
- 1
- Type
- boolean
- asynchronousValidationsStatuses
- Type
- Polymorphic
- Undefined Value Substitution
- false
- Is Null Forbidden
- Yes
- Variants
- Type
- Indexed array
- Are Undefined Elements Forbidden
- Yes
- Are Null Elements Forbidden
- Yes
- Array Elements
- Type
- Object of fixed schema
- Schema
- {
- ID
- Type
- string
- Is Undefined Forbidden
- Yes
- Is Null Forbidden
- Yes
- Allowed Alternatives
- IN_PROGRESS
- FINISHED_AND_VALID
- FINISHED_BUT_INVALID
- MALFUNCTION
- message
- Type
- string
- Is Undefined Forbidden
- Yes
- Is Null Forbidden
- Yes
- Minimal Characters
- 1
- Type
- boolean