Lion Logo Lion Fundamentals Guides Components Blog Toggle darkmode

Select Rich: API Table

class: LionSelectInvoker, lion-select-invoker

Fields

NamePrivacyTypeDefaultDescriptionInherited From
activepublicbooleanfalseLionButton
disabledpublicbooleanfalseLionButton
hostElementpublicLionSelectRich | nullnullThe LionSelectRich element this invoker is part of. Will be set on connectedCallback of LionSelectRich
readOnlypublicbooleanfalseWhen the connected LionSelectRich instance is readOnly, this should be reflected in the invoker as well
selectedElementpublicLionOption | nullnullThe option element that is currently selected
singleOptionpublicbooleanfalseWhen the connected LionSelectRich instance has only one option, this should be reflected in the invoker as well
tabIndexpublicnumberLionButton
typepublicstring'button'LionButton
_buttonIdprotectedLionButton
_contentWrapperNodeprotected
_requestedToBeDisabledprotectedbooleanfalseLionButton

Methods

NamePrivacyDescriptionParametersReturnInherited From
clickpublicLionButton
makeRequestToBeDisabledpublicLionButton
retractRequestToBeDisabledpublicLionButton
_afterTemplateprotected
_beforeTemplateprotected
_contentTemplateprotectedTemplateResult|Node[]|string|null
_noSelectionTemplateprotectedTo be overriden for a placeholder, used when `hasNoDefaultSelected` is true on the select richTemplateResult

Attributes

NameFieldInherited From
selectedElementselectedElement
hostElementhostElement
readonlyreadOnly
single-optionsingleOption
tabindextabIndexLionButton
disableddisabledLionButton
activeactiveLionButton
typetypeLionButton

class: LionSelectRich, lion-select-rich

Fields

NamePrivacyTypeDefaultDescriptionInherited From
activeIndexpublicLionListbox
autofocuspublicbooleanfalseLionListbox
checkedIndexpublicnumber | number[]LionListbox
configpublicPartial<OverlayConfig>{}Configure the many options of the `OverlayController`OverlayMixin
defaultValidatorspublicValidator[][]Used by Subclassers to add default Validators to a particular FormControl. A date input for instance, always needs the isDate validator.LionListbox
dirtypublicbooleanfalseTrue when user has changed the value of the field.LionListbox
disabledpublicbooleanfalseLionListbox
donepublicbooleanfalseLionListbox
fieldNamepublicstringWill be used in validation messages to refer to the current fieldLionListbox
filledpublicbooleanfalseTrue when the modelValue is non-empty (see _isEmpty in FormControlMixin)LionListbox
focusedpublicbooleanfalseWhether the focusable element within (`._focusableNode`) is focused. Reflects to attribute '[focused]' as a styling hookLionListbox
focusedVisiblepublicbooleanfalseWhether the focusable element within (`._focusableNode`) matches ':focus-visible' Reflects to attribute '[focused-visible]' as a styling hook See: https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visibleLionListbox
formattedValuepublicLionListbox
formElementspublicFormControlsCollectionnew FormControlsCollection()Closely mimics the natively supported HTMLFormControlsCollection. It can be accessed both like an array and an object (based on control/element names).LionListbox
hasFeedbackForpublicValidationType[][]As soon as validation happens (after modelValue/validators/validator param change), this array is updated with the active ValidationTypes ('error'|'warning'|'success'|'info' etc.). Notice the difference with `.showsFeedbackFor`, which filters `.hasFeedbackFor` based on `.feedbackCondition()`. For styling purposes, will be reflected to [has-feedback-for="error warning"]. This can be useful for subtle visual feedback on keyup, like a red/green border around an input.LionListbox
hasNoDefaultSelectedpublicbooleanfalseWhen setting this to true, on initial render, no option will be selected. It is advisable to override `_noSelectionTemplate` method in the select-invoker to render some kind of placeholder initiallyLionListbox
helpTextpublicstring''The helpt text for the input node. When no value is defined, textContent of [slot=help-text] will be usedLionListbox
initCompletepublicPromise<any>new Promise((resolve, reject) => { this.__resolveInitComplete = resolve; this.__rejectInitComplete = reject; })initComplete resolves after all pending initialization logic (for instance `<form-group .serializedValue=$>`) is executedLionListbox
interactionModepublic'windows/linux'|'mac'|'auto''auto'Aligns behavior for 'selectionFollowFocus' and 'navigateWithinInvoker' with platform. When 'auto' (default), platform is automatically detected
isPendingpublicbooleanfalseFlag indicating whether async validation is pending. Creates attribute [is-pending] as a styling hookLionListbox
labelpublicstring''The label text for the input node. When no value is defined, textContent of [slot=label] will be usedLionListbox
labelSrOnlypublicbooleanfalseThe label will only be visible for srceen readers when trueLionListbox
modelValuepublicLionListbox
multipleChoicepublicbooleanfalseWhen false (default), modelValue and serializedValue will reflect the currently selected choice (usually a string). When true, modelValue will and serializedValue will be an array of strings.LionListbox
navigateWithinInvokerpublicBooleanfalseWhen invoker has focus, up and down arrow keys changes active state of listbox, without opening overlay.
openedpublicbooleanfalseIf you add the opened attribute a dialog will be opened on page load. The invoker can be left out in case the user does not need to be able to reopen the dialog.OverlayMixin
operationModepublicOperationModeTypes of input interaction of the FormControl (for instance 'enter'|'select'|'upload')LionListbox
orientationpublicstring'vertical'Informs screen reader and affects keyboard navigation. By default 'vertical'LionListbox
prefilledpublicbooleanfalseTrue when user has left non-empty field or input is prefilled. The name must be seen from the point of view of the input field: once the user enters the input field, the value is non-empty.LionListbox
readOnlypublicbooleanfalseA Boolean attribute which, if present, indicates that the user should not be able to edit the value of the input. The difference between disabled and readonly is that read-only controls can still function, whereas disabled controls generally do not function as controls until they are enabled. (From: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-readonly)LionListbox
registrationCompletepublicPromise<any> & {done?:boolean}new Promise((resolve, reject) => { this.__resolveRegistrationComplete = resolve; this.__rejectRegistrationComplete = reject; })registrationComplete waits for all children formElements to have registeredLionListbox
rotateKeyboardNavigationpublicbooleanfalseWill give first option active state when navigated to the next option from last option.LionListbox
selectionFollowsFocuspublicbooleanfalseWhen true, will synchronize activedescendant and selected element on arrow key navigation. This behavior can usually be seen on <select> on the Windows platform. Note that this behavior cannot be used when multiple-choice is true. See: https://www.w3.org/TR/wai-aria-practices/#kbd_selection_follows_focusLionListbox
serializedValuepublicLionListbox
showsFeedbackForpublicValidationType[][]Based on outcome of feedbackCondition, this array decides what ValidationTypes should be shown in validationFeedback, based on meta data like interaction states. For styling purposes, it reflects it `[shows-feedback-for="error warning"]`LionListbox
singleOptionpublicbooleanfalse
slotspublicSlotsMapAdds "._feedbackNode" as described belowLionListbox
submittedpublicLionListbox
touchedpublicbooleanfalseTrue when user has focused and left(blurred) the field.LionListbox
validationStatespublicValidationStates{}The outcome of a validation 'round'. Keyed by ValidationType and Validator nameLionListbox
validatorspublicValidator[][]Used by Application Developers to add Validators to a FormControl.LionListbox
_activeDescendantOwnerNodeprotectedHTMLElementLionListbox
_allValidatorsprotectedValidator[]Combination of validators provided by Application Developer and the default validatorsLionListbox
_ariaDescribedNodespublicHTMLElement[][]Contains all elements that should end up in aria-describedby of `._inputNode`LionListbox
_ariaLabelledNodespublicHTMLElement[][]Contains all elements that should end up in aria-labelledby of `._inputNode`LionListbox
_arrowWidthprotectednumber28
_feedbackConditionMetaprotectedAllows Subclassers to add meta info for feedbackConditionLionListbox
_feedbackNodeprotectedElement where validation feedback will be rendered toLionListbox
_focusableNodeprotectedHTMLElementThe focusable element: could be an input, textarea, select, button or any other element with tabindex > -1LionListbox
_helpTextNodeprotectedElement where help text will be rendered toLionListbox
_inputIdprotectedstringUnique id that can be used in all light domLionListbox
_inputNodeprotectedThe interactive (form) element. Can be a native element like input/textarea/select or an element with tabindex > -1LionListbox
_invokerNodeprotectedLionSelectInvoker
_isFormOrFieldsetprotectedbooleanfalseFlag that determines how ".formElements" should behave. For a regular fieldset (see LionFieldset) we expect ".formElements" to be accessible as an object. In case of a radio-group, a checkbox-group or a select/listbox, it should act like an array (see ChoiceGroupMixin). Usually, when false, we deal with a choice-group (radio-group, checkbox-group, (multi)select)LionListbox
_isRepropagationEndpointpublicbooleanfalseBy default, a field with _repropagationRole 'choice-group' will act as an 'endpoint'. This means it will be considered as an individual field: for a select, individual options will not be part of the formPath. They will. Similarly, components that (a11y wise) need to be fieldsets, but 'interaction wise' (from Application Developer perspective) need to be more like fields (think of an amount-input with a currency select box next to it), can set this to true to hide private internals in the formPath.LionListbox
_labelNodeprotectedElement where label will be rendered toLionListbox
_leaveEventprotectedstring'blur'The event that triggers the touched stateLionListbox
_listboxActiveDescendantprotectednumber | nullnullLionListbox
_listboxActiveDescendantNodeprotectedHTMLElementLionListbox
_listboxNodeprotectedLionListbox
_listboxReceivesNoFocusprotectedbooleanfalseWhen listbox is coupled to a textbox (in case we are dealing with a combobox), spaces should not select an element (they need to be put in the textbox)LionListbox
_listboxSlotprotectedHTMLElementLionListbox
_noTypeAheadpublicbooleanfalseWhen false, a user can type on which the focus will jump to the matching optionLionListbox
_oldModelValueprotectedstring | string[] | undefinedundefinedLionListbox
_overlayBackdropNodeprotectedOverlayMixin
_overlayContentNodeprotectedOverlayMixin
_overlayContentWrapperNodeprotectedOverlayMixin
_overlayInvokerNodeprotectedOverlayMixin
_overlayReferenceNodeprotectedOverlayMixin
_repropagationRolepublic'child'|'choice-group'|'fieldset''choice-group'Based on the role, details of handling model-value-changed repropagation differ.LionListbox
_requestedToBeDisabledprotectedbooleanfalseLionListbox
_scrollTargetNodeprotectedHTMLElementLionListbox
_typeAheadTimeoutprotectednumber1000The pending char sequence that will set active list itemLionListbox
_valueChangedEventprotectedstring'model-value-changed'The event that triggers the dirty stateLionListbox
_visibleMessagesAmountprotectednumber1The amount of feedback messages that will visible in LionValidationFeedbackLionListbox

Methods

NamePrivacyDescriptionParametersReturnInherited From
addFormElementpublicchild: LionOption & FormControlHost, indexToInsertAt: NumberLionListbox
addToAriaDescribedBypublicAllows to add element references to aria-describedby attribute.element: HTMLElement, { idPrefix = '', reorder = true }, customConfig: {idPrefix?:string; reorder?: boolean}LionListbox
addToAriaLabelledBypublicAllows to add extra element references to aria-labelledby attribute.element: HTMLElement, { idPrefix = '', reorder = true }, customConfig: {idPrefix?:string; reorder?: boolean}LionListbox
attachShadowpublicoptions: ShadowRootInitShadowRootLionListbox
blurpublicCalls `blur()` on focusable element withinLionListbox
clearpublicLionListbox
clickpublicLionListbox
closepublicHides the overlayOverlayMixin
createScopedElementpublictagNameLionListbox
defineScopedElementpublicDefines a scoped element.tagName: string, classToBeRegistered: typeof HTMLElementLionListbox
feedbackConditionpublicAllows the Application Developer to specify when a feedback message should be showntype: string, meta: object, currentCondition: ((type: string, meta: object) => boolean)booleanLionListbox
focuspublicCalls `focus()` on focusable element withinLionListbox
initInteractionStatepublicEvaluations performed on connectedCallback. This method is public, so it can be called at a later moment (when we need to wait for registering children for instance) as well. Since this method will be called twice in last mentioned scenario, it must stay idempotent.LionListbox
isRegisteredFormElementpublicel: ElementWithParentFormGroupLionListbox
makeRequestToBeDisabledpublicLionListbox
openpublicShows the overlayOverlayMixin
removeFormElementpublicchild: FormRegisteringHostLionListbox
removeFromAriaDescribedBypublicAllows to remove element references from aria-describedby attribute.element: HTMLElementLionListbox
removeFromAriaLabelledBypublicAllows to remove element references from aria-labelledby attribute.element: HTMLElementLionListbox
repositionOverlaypublicSometimes it's needed to recompute Popper position of an overlay, for instance when we have an opened combobox and the surrounding context changes (the space consumed by the textbox increases vertically)OverlayMixin
resetpublicLionListbox
resetInteractionStatepublicResets touched and dirty, and recomputes prefilledLionListbox
retractRequestToBeDisabledpublicLionListbox
setCheckedIndexpublicIf an array is passed for multiple-choice, it will check the indexes in array, and uncheck the rest If a number is passed, the item with the passed index is checked without unchecking others For single choice, __onChildCheckedChanged we ensure that we uncheck siblingsindex: number|number[]LionListbox
togglepublicToggles the overlayOverlayMixin
updateSyncpublicAn abstraction that has the exact same api as `requestUpdate`, but taking into account: - [member order independence](https://github.com/webcomponents/gold-standard/wiki/Member-Order-Independence) - property effects start when all (light) dom has initialized (on firstUpdated) - property effects don't interrupt the first meaningful paint - compatible with propertyAccessor.`hasChanged`: no manual checks needed or accidentally run property effects / events when no change happened effects when values didn't change All code previously present in requestUpdate can be placed in this method.name: string, oldValue: ?LionListbox
validatepublicTriggered 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 }LionListbox
_alignInvokerWidthprotectedAlign invoker width with content width Make sure display is not set to "none" while calculating the content width
_checkSingleChoiceElementsprotectedev: CustomEvent & {target:FormControl}LionListbox
_completeRegistrationprotectedResolves the registrationComplete promise. Subclassers can delay if neededLionListbox
_connectSlotMixinprotectedLionListbox
_defineOverlayprotected{ contentNode, invokerNode, referenceNode, backdropNode, contentWrapperNode }, config: DefineOverlayConfigOverlayControllerOverlayMixin
_defineOverlayConfigprotectedOverlayConfigOverlayMixin
_dispatchInitialModelValueChangedEventprotectedLionListbox
_enhanceLightDomA11yprotectedLionListbox
_enhanceLightDomA11yForAdditionalSlotsprotectedEnhances 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-describedbyadditionalSlots: string[]LionListbox
_enhanceLightDomClassesprotectedLionListbox
_feedbackTemplateprotectedTemplateResultLionListbox
_getAriaDescriptionElementsprotectedThis function exposes descripion elements that a FormGroup should expose to its children. See FormGroupMixin.__getAllDescriptionElementsInParentChain()Array.<HTMLElement>LionListbox
_getCheckedElementsprotectedIn the select disabled options are still going to a possible value for example when prefilling or programmatically setting it.LionListbox
_getFromAllFormElementsprotectedImplicit :(property: string, filterFn: (el: FormControl, property?: string) => boolean{[name:string]: any}LionListbox
_getFromAllFormElementsFilterprotectedA 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 serializedValueel: FormControl, type: stringbooleanLionListbox
_getNextEnabledOptionprotectedcurrentIndex: number, offset: numberLionListbox
_getPreviousEnabledOptionprotectedcurrentIndex: number, offset: numberLionListbox
_groupOneTemplateprotectedTemplateResultLionListbox
_groupTwoTemplateprotectedTemplateResultLionListbox
_handleTypeAheadprotectedev: KeyboardEvent, { setAsChecked }, options: {setAsChecked:boolean}LionListbox
_hasFeedbackVisibleForprotectedUsed to translate `.hasFeedbackFor` and `.shouldShowFeedbackFor` to `.showsFeedbackFor`type: stringLionListbox
_helpTextTemplateprotectedTemplateResultLionListbox
_inputGroupAfterTemplateprotectedTemplateResultLionListbox
_inputGroupBeforeTemplateprotectedTemplateResultLionListbox
_inputGroupInputTemplateprotectedTemplateResultLionListbox
_inputGroupPrefixTemplateprotectedTemplateResult | nothingLionListbox
_inputGroupSuffixTemplateprotectedTemplateResult | nothingLionListbox
_inputGroupTemplateprotectedTemplateResultLionListbox
_isEmptyprotectedUsed for Required validation and computation of interaction statesmodelValue: anybooleanLionListbox
_isPermanentlyDisconnectedprotectedWhen we're moving around in dom, disconnectedCallback gets called. Before we decide to teardown, let's wait to see if we were not just moving nodes around.Promise<boolean>OverlayMixin
_isPrivateSlotprotectedslotName: stringbooleanLionListbox
_iStateOnLeaveprotectedSets touched value to true and reevaluates prefilled state. When false, on next interaction, user will start with a clean state.LionListbox
_iStateOnValueChangeprotectedSets dirty value and validates when already touched or invalidLionListbox
_labelTemplateprotectedTemplateResultLionListbox
_listboxOnClickprotectedev: MouseEventLionListbox
_listboxOnKeyDownprotectedev: KeyboardEventLionListbox
_listboxOnKeyUpprotectedev: KeyboardEventLionListbox
_noDefaultSelectedInheritsWidthprotectedWith no selected element, we should override the inheritsReferenceWidth in most cases. By default, we will set it to 'min', and then set it back to what it was initially when something is selected. As a subclasser you can override this behavior.
_onBeforeRepropagateChildrenValuesprotectedHook for Subclassers to add logic before repropagationev: CustomEventLionListbox
_onChildActiveChangedprotected{ target }, ev: Event & { target: LionOption }LionListbox
_onDirtyChangedprotectedDispatches event on touched state changeLionListbox
_onFormElementsChangedprotected
_onLabelClickprotectedLionListbox
_onListboxContentChangedprotectedA Subclasser can perform additional logic whenever the elements inside the listbox are updated. For instance, when a combobox does server side autocomplete, we want to match highlighted parts client side.LionListbox
_onRequestToAddFormElementprotectedHook for Subclassers to perform logic before an element is addedev: CustomEventLionListbox
_onRequestToChangeFormElementNameprotectedev: CustomEventLionListbox
_onRequestToRemoveFormElementprotectedev: CustomEventLionListbox
_onTouchedChangedprotectedDispatches event on touched state changeLionListbox
_onValidatorUpdatedprotectede: Event|CustomEventLionListbox
_prioritizeAndFilterFeedbackprotectedOrders all active validators in this.__validationResult. Can also filter out occurrences (based on interaction states){ validationResult }, opts: { validationResult: Validator[] }Validator[]LionListbox
_repropagationConditionprotectedBased on provided target, this condition determines whether received model-value-changed event should be repropagatedtarget: FormControlHostLionListbox
_scrollIntoViewprotectedel: HTMLElement, scrollTargetEl: HTMLElementLionListbox
_setCheckedElementsprotectedvalue: string | any[], check: FunctionLionListbox
_setOpenedWithoutPropertyEffectsprotectedWhen the opened state is changed by an Application Developer,cthe OverlayController is requested to show/hide. It might happen that this request is not honoured (intercepted in before-hide for instance), so that we need to sync the controller state to this webcomponent again, preventing eternal loops.newOpened: booleanOverlayMixin
_setupListboxNodeprotectedLionListbox
_setupOpenCloseListenersprotectedOverlayMixin
_setupOverlayCtrlprotectedOverlayMixin
_showFeedbackConditionForprotectedDefault 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 falsetype: string, meta: InteractionStatesLionListbox
_teardownListboxNodeprotectedLionListbox
_teardownOpenCloseListenersprotectedOverlayMixin
_teardownOverlayCtrlprotectedOverlayMixin
_throwWhenInvalidChildModelValueprotectedchild: FormControlLionListbox
_triggerInitialModelValueChangedEventprotectedLionListbox
_uncheckChildrenprotectedexclude: LionOption|LionOption[]LionListbox
_updateFeedbackComponentprotectedResponsible 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 trueLionListbox
_updateShouldShowFeedbackForprotectedLionListbox

Events

NameTypeDescriptionInherited From
blurEventLionListbox
opened-changedCustomEventOverlayMixin
model-value-changedCustomEventLionListbox
form-element-name-changedCustomEventLionListbox
focusEventLionListbox
focusinEventLionListbox
focusoutEventLionListbox
touched-changedEventLionListbox
dirty-changedEventLionListbox
showsFeedbackForChangedEventLionListbox
EventLionListbox
shouldShowFeedbackForChangedEventLionListbox
validate-performedEventprivate event that should be listened to by LionFieldSetLionListbox

Attributes

NameFieldInherited From
navigate-within-invokernavigateWithinInvoker
interaction-modeinteractionMode
single-optionsingleOption
openedopenedOverlayMixin
orientationorientationLionListbox
selection-follows-focusselectionFollowsFocusLionListbox
rotate-keyboard-navigationrotateKeyboardNavigationLionListbox
has-no-default-selectedhasNoDefaultSelectedLionListbox
_noTypeAhead_noTypeAheadLionListbox
readonlyreadOnlyLionListbox
labellabelLionListbox
label-sr-onlylabelSrOnlyLionListbox
help-texthelpTextLionListbox
multiple-choicemultipleChoiceLionListbox
_isFormOrFieldset_isFormOrFieldsetLionListbox
focusedfocusedLionListbox
focused-visiblefocusedVisibleLionListbox
autofocusautofocusLionListbox
touchedtouchedLionListbox
dirtydirtyLionListbox
filledfilledLionListbox
shows-feedback-forshowsFeedbackForLionListbox
is-pendingisPendingLionListbox
disableddisabledLionListbox