__initInteractionStates | protected | | | | FormGroupMixin |
_triggerInitialModelValueChangedEvent | protected | | | | FormControlMixin |
__setupOutsideClickHandling | protected | | | | FormGroupMixin |
_checkForOutsideClick | protected | | event: Event | | FormGroupMixin |
__requestChildrenToBeDisabled | protected | | | | FormGroupMixin |
__retractRequestChildrenToBeDisabled | protected | | | | FormGroupMixin |
_inputGroupTemplate | protected | | | TemplateResult | FormControlMixin |
submitGroup | public | Handles interaction state 'submitted'.
This allows children to enable visibility of validation feedback | | | FormGroupMixin |
resetGroup | public | Resets to initial/prefilled values and interaction states of all FormControls in group, | | | FormGroupMixin |
clearGroup | public | Clears all values and resets all interaction states of all FormControls in group, | | | FormGroupMixin |
resetInteractionState | public | Resets all interaction states for all formElements | | | FormGroupMixin |
_getFromAllFormElementsFilter | protected | A filter function which will exclude a form field when returning false
By default, exclude form fields which are disabled
The type is be passed as well for more fine grained control, e.g.
distinguish the filter when fetching modelValue versus serializedValue | el: FormControl, type: string | boolean | FormGroupMixin |
_getFromAllFormElements | protected | Gets a keyed be name object for requested property (like modelValue/serializedValue) | property: string, filterFn: (el: FormControl, property?: string) => boolean | {[name:string]: any} | FormGroupMixin |
_setValueForAllFormElements | protected | Sets the same value for requested property in all formElements | property: string | number, value: any | | FormGroupMixin |
_setValueMapForAllFormElements | protected | Allows to set formElements values via a keyed object structure | property: string, values: { [x: string]: any; } | | FormGroupMixin |
_anyFormElementHas | protected | Returns true when one of the formElements has requested | property: string | | FormGroupMixin |
_anyFormElementHasFeedbackFor | protected | | state: string | | FormGroupMixin |
_everyFormElementHas | protected | Returns true when all of the formElements have requested property | property: string | | FormGroupMixin |
__onChildValidatePerformed | protected | Gets triggered by event 'validate-performed' which enabled us to handle 2 different situations
- react on modelValue change, which says something about the validity as a whole
(at least two checkboxes for instance) and nothing about the children's values
- children validity states have changed, so fieldset needs to update itself based on that | ev: Event | | FormGroupMixin |
_syncFocused | protected | | | | FormGroupMixin |
_onFocusOut | protected | | ev: Event | | FormGroupMixin |
_syncDirty | protected | | | | FormGroupMixin |
__storeAllDescriptionElementsInParentChain | protected | Traverses the _parentFormGroup tree, and gathers all aria description elements
(feedback) that should be provided to children.
In the example below, when the input for 'street' has focus, a screenreader user
would hear the #group-error.
In case one of the inputs was in error state as well, the SR user would
first hear the local error, followed by #group-error | | | FormGroupMixin |
__linkParentMessages | protected | | child: FormControl | | FormGroupMixin |
__unlinkParentMessages | protected | | child: FormControl | | FormGroupMixin |
addFormElement | public | | child: FormControl & {serializedValue:string|object}, indexToInsertAt: number | | FormRegistrarMixin |
removeFormElement | public | | el: FormRegisteringHost & FormControl | | FormRegistrarMixin |
_isEmpty | protected | Used for Required validation and computation of interaction states | modelValue: any | boolean | FormControlMixin |
_completeRegistration | protected | Resolves the registrationComplete promise. Subclassers can delay if needed | | | FormRegistrarMixin |
isRegisteredFormElement | public | | el: ElementWithParentFormGroup | | FormRegistrarMixin |
_onRequestToAddFormElement | protected | Hook for Subclassers to perform logic before an element is added | ev: CustomEvent | | FormRegistrarMixin |
_onRequestToChangeFormElementName | protected | | ev: CustomEvent | | FormRegistrarMixin |
_onRequestToRemoveFormElement | protected | | ev: CustomEvent | | FormRegistrarMixin |
_enhanceLightDomClasses | protected | | | | FormControlMixin |
_enhanceLightDomA11y | protected | | | | FormControlMixin |
_enhanceLightDomA11yForAdditionalSlots | protected | Enhances additional slots(prefix, suffix, before, after) defined by developer.
When boolean attribute data-label or data-description is found,
the slot element will be connected to the input via aria-labelledby or aria-describedby | additionalSlots: string[] | | FormControlMixin |
__reflectAriaAttr | protected | Will handle help text, validation feedback and character counter,
prefix/suffix/before/after (if they contain data-description flag attr).
Also, contents of id references that will be put in the <lion-field>._ariaDescribedby property
from an external context, will be read by a screen reader. | attrName: string, nodes: Element[], reorder: boolean|undefined | | FormControlMixin |
_groupOneTemplate | protected | | | TemplateResult | FormControlMixin |
_groupTwoTemplate | protected | | | TemplateResult | FormControlMixin |
_labelTemplate | protected | | | TemplateResult | FormControlMixin |
_helpTextTemplate | protected | | | TemplateResult | FormControlMixin |
_inputGroupBeforeTemplate | protected | | | TemplateResult | FormControlMixin |
_inputGroupPrefixTemplate | protected | | | TemplateResult | nothing | FormControlMixin |
_inputGroupInputTemplate | protected | | | TemplateResult | FormControlMixin |
_inputGroupSuffixTemplate | protected | | | TemplateResult | nothing | FormControlMixin |
_inputGroupAfterTemplate | protected | | | TemplateResult | FormControlMixin |
_feedbackTemplate | protected | | | TemplateResult | FormControlMixin |
_getAriaDescriptionElements | protected | This function exposes descripion elements that a FormGroup should expose to its
children. See FormGroupMixin.__getAllDescriptionElementsInParentChain() | | Array.<HTMLElement> | FormControlMixin |
addToAriaLabelledBy | public | Allows to add extra element references to aria-labelledby attribute. | element: HTMLElement, { idPrefix = '', reorder = true }, customConfig: {idPrefix?:string; reorder?: boolean} | | FormControlMixin |
removeFromAriaLabelledBy | public | Allows to remove element references from aria-labelledby attribute. | element: HTMLElement | | FormControlMixin |
addToAriaDescribedBy | public | Allows to add element references to aria-describedby attribute. | element: HTMLElement, { idPrefix = '', reorder = true }, customConfig: {idPrefix?:string; reorder?: boolean} | | FormControlMixin |
removeFromAriaDescribedBy | public | Allows to remove element references from aria-describedby attribute. | element: HTMLElement | | FormControlMixin |
__getDirectSlotChild | protected | | slotName: string | HTMLElement | undefined | FormControlMixin |
_dispatchInitialModelValueChangedEvent | protected | | | | FormControlMixin |
_onBeforeRepropagateChildrenValues | protected | Hook for Subclassers to add logic before repropagation | ev: CustomEvent | | FormControlMixin |
__repropagateChildrenValues | protected | | ev: CustomEvent | | FormControlMixin |
_repropagationCondition | protected | Based on provided target, this condition determines whether received model-value-changed
event should be repropagated | target: FormControlHost | | FormControlMixin |
_onLabelClick | protected | | | | FormControlMixin |
updateSync | public | | name: string, oldValue: ? | | ValidateMixin |
validate | public | Triggered by:
- modelValue change
- change in the 'validators' array
- change in the config of an individual Validator
Three situations are handled:
- a1) the FormControl is empty: further execution is halted. When the Required Validator
(being mutually exclusive to the other Validators) is applied, it will end up in the
validation result (as the only Validator, since further execution was halted).
- a2) there are synchronous Validators: this is the most common flow. When modelValue hasn't
changed since last async results were generated, 'sync results' are merged with the
'async results'.
- a3) there are asynchronous Validators: for instance when server side evaluation is needed.
Executions are scheduled and awaited and the 'async results' are merged with the
'sync results'.
- b) there are MetaValidators. After steps a1, a2, or a3 are finished, the holistic
MetaValidators (evaluating the total result of the 'regular' (a1, a2 and a3) validators)
will be run...
Situations a2 and a3 are not mutually exclusive and can be triggered within one `validate()`
call. Situation b will occur after every call. | { clearCurrentResult = false }, opts: { clearCurrentResult?: boolean } | | ValidateMixin |
__executeValidators | protected | | | | ValidateMixin |
_onValidatorUpdated | protected | | e: Event|CustomEvent | | ValidateMixin |
_updateFeedbackComponent | protected | Responsible for retrieving messages from Validators and
(delegation of) rendering them.
For `._feedbackNode` (extension of LionValidationFeedback):
- retrieve messages from highest prio Validators
- provide the result to custom feedback node and let the
custom node decide on their renderings
In both cases:
- we compute the 'show' flag (like 'hasErrorVisible') for all types
- we set the customValidity message of the highest prio Validator
- we set aria-invalid="true" in case hasErrorVisible is true | | | ValidateMixin |
_showFeedbackConditionFor | protected | Default feedbackCondition condition, used by Subclassers, that will be used when
`feedbackCondition()` is not overridden by Application Developer.
Show the validity feedback when returning true, don't show when false | type: string, meta: object | | ValidateMixin |
feedbackCondition | public | Allows the Application Developer to specify when a feedback message should be shown | type: string, meta: object, currentCondition: ((type: string, meta: object) => boolean) | boolean | ValidateMixin |
_hasFeedbackVisibleFor | protected | Used to translate `.hasFeedbackFor` and `.shouldShowFeedbackFor` to `.showsFeedbackFor` | type: string | | ValidateMixin |
_updateShouldShowFeedbackFor | protected | | | | ValidateMixin |
_prioritizeAndFilterFeedback | protected | Orders all active validators in this.__validationResult.
Can also filter out occurrences (based on interaction states) | { validationResult }, opts: { validationResult: Validator[] } | Validator[] | ValidateMixin |
makeRequestToBeDisabled | public | | | | DisabledMixin |
retractRequestToBeDisabled | public | | | | DisabledMixin |