UNPKG

@hashicorp/design-system-components

Version:
34 lines (31 loc) 3.37 kB
import Component from '@glimmer/component'; import { concat, hash } from '@ember/helper'; import { ID_PREFIX } from '../../label/index.js'; import HdsFormSuperSelectSingleBase from './base.js'; import HdsFormField from '../../field/index.js'; import HdsYield from '../../../yield/index.js'; import { precompileTemplate } from '@ember/template-compilation'; import { setComponentTemplate } from '@ember/component'; /** * Copyright IBM Corp. 2021, 2025 * SPDX-License-Identifier: MPL-2.0 */ class HdsFormSuperSelectSingleField extends Component { get idPrefix() { return ID_PREFIX; } static { setComponentTemplate(precompileTemplate("<HdsFormField @layout=\"vertical\" @extraAriaDescribedBy={{@extraAriaDescribedBy}} @isRequired={{@isRequired}} @isOptional={{@isOptional}} @id={{@id}} as |F|>\n {{!-- Notice: the order of the elements is not relevant here, because is controlled at \"HdsFormField\" component level --}}\n {{yield (hash Label=F.Label HelperText=F.HelperText Error=F.Error)}}\n <F.Control>\n {{!-- Important: if an argument is added in base.hbs, it must also be added/processed here --}}\n <HdsFormSuperSelectSingleBase @afterOptionsComponent={{@afterOptionsComponent}} @afterOptionsContent={{@afterOptionsContent}} @ariaDescribedBy={{F.ariaDescribedBy}} @ariaInvalid={{@ariaInvalid}} @ariaLabel={{@ariaLabel}} @ariaLabelledBy={{(concat this.idPrefix F.id)}} @beforeOptionsComponent={{@beforeOptionsComponent}} @closeOnSelect={{@closeOnSelect}} @disabled={{@disabled}} @dropdownClass={{@dropdownClass}} @dropdownMaxWidth={{@dropdownMaxWidth}} @extra={{@extra}} @groupComponent={{@groupComponent}} @horizontalPosition={{@horizontalPosition}} @initiallyOpened={{@initiallyOpened}} @labelText={{@labelText}} @loadingMessage={{@loadingMessage}} @matcher={{@matcher}} @matchTriggerWidth={{@matchTriggerWidth}} @noMatchesMessage={{@noMatchesMessage}} @onBlur={{@onBlur}} @onChange={{@onChange}} @onClose={{@onClose}} @onFocus={{@onFocus}} @onInput={{@onInput}} @onKeydown={{@onKeydown}} @onOpen={{@onOpen}} @options={{@options}} @optionsComponent={{@optionsComponent}} @placeholder={{@placeholder}} @placeholderComponent={{@placeholderComponent}} @preventScroll={{@preventScroll}} @registerAPI={{@registerAPI}} @renderInPlace={{true}} @resultCountMessage={{@resultCountMessage}} @scrollTo={{@scrollTo}} @search={{@search}} @searchEnabled={{@searchEnabled}} @searchField={{@searchField}} @searchFieldPosition=\"before-options\" @searchMessage={{@searchMessage}} @searchPlaceholder={{@searchPlaceholder}} @selected={{@selected}} @selectedItemComponent={{@selectedItemComponent}} @showAfterOptions={{@showAfterOptions}} @tabindex={{@tabindex}} @triggerClass={{@triggerClass}} @triggerComponent={{@triggerComponent}} @triggerId={{F.id}} @triggerRole={{@triggerRole}} @typeAheadOptionMatcher={{@typeAheadOptionMatcher}} @verticalPosition={{@verticalPosition}} @isInvalid={{@isInvalid}} ...attributes as |options select|>\n {{yield (hash options=options select=select Options=HdsYield)}}\n </HdsFormSuperSelectSingleBase>\n </F.Control>\n</HdsFormField>", { strictMode: true, scope: () => ({ HdsFormField, hash, HdsFormSuperSelectSingleBase, concat, HdsYield }) }), this); } } export { HdsFormSuperSelectSingleField as default }; //# sourceMappingURL=field.js.map