/* * Copyright (c) 2025, Salesforce, Inc. * All rights reserved. * For full license text, see the LICENSE.txt file */ /** * The `lightning/combobox` component represents a widget that provides an input field that is readonly, accompanied by a dropdown list of selectable options. * @see {@link https://developer.salesforce.com/docs/component-library/bundle/lightning-combobox/documentation |Lightning Combobox Documentation} */ declare module "lightning/combobox" { import { LightningElement } from "lwc"; /** * A widget that provides an input field that is readonly, * accompanied by a dropdown list of selectable options. */ export default class LightningCombobox extends LightningElement { /** * Reserved for internal use. Controls auto-filling of the field. */ autocomplete: string | undefined; /** * A String value for aria-invalid. */ ariaInvalid: string; /** * Text label for the combobox. */ label: string | undefined; /** * Specifies where the drop-down list is aligned with or anchored to * the selection field. By default the list is aligned with the * selection field at the top left so the list opens down. Use bottom-left * to make the selection field display at the bottom so the list opens * above it. Use auto to let the component determine where to open * the list based on space available. */ dropdownAlignment: "left" | "bottom-left" | "auto"; /** * Text that is displayed before an option is selected, to prompt the user * to select an option. The default is "Select an Option". */ placeholder: string; /** * Error message to be displayed when the value is missing and input is required. */ messageWhenValueMissing: string | undefined; /** * Specifies the name of the combobox. */ name: string | undefined; /** * Reserved for internal use. Use the standard aria-labelledby instead. * A space-separated list of element IDs that provide labels for the combobox. */ ariaLabelledBy: string; /** * Reserved for internal use. Use the standard aria-describedby instead. * A space-separated list of element IDs that provide descriptive labels for the combobox. */ ariaDescribedBy: string; /** * Help text detailing the purpose and function of the combobox. */ fieldLevelHelp: string; /** * The variant changes the appearance of the combobox. * Accepted variants include standard, label-hidden, label-inline, and label-stacked. * This value defaults to standard. * Use label-hidden to hide the label but make it available to assistive technology. * Use label-inline to horizontally align the label and combobox. * Use label-stacked to place the label above the combobox. */ variant: "standard" | "label-hidden" | "label-inline" | "label-stacked"; /** * Specifies the value of an input element. */ value: string | undefined; /** * A list of options that are available for selection. Each option has the following attributes: label and value. */ options: Array<{ label: string; value: string }>; /** * If present, the combobox is disabled and users cannot interact with it. */ disabled: boolean; /** * If present, the combobox is read-only. * A read-only combobox is also disabled. */ readOnly: boolean; /** * If present, a value must be selected before the form can be submitted. */ required: boolean; /** * If present, a spinner is displayed below the menu items to indicate loading activity. */ spinnerActive: boolean; /** * Sets focus on the combobox. */ focus(): void; /** * Removes focus from the combobox. */ blur(): void; /** * Represents the validity states that an element can be in, with respect to constraint validation. */ validity: ValidityState; /** * Returns the valid attribute value (Boolean) on the ValidityState object. */ checkValidity(): boolean; /** * Displays the error messages and returns false if the input is invalid. * If the input is valid, reportValidity() clears displayed error messages and returns true. */ reportValidity(): boolean; /** * Sets a custom error message to be displayed when the combobox value is submitted. */ setCustomValidity(message: string): void; /** * Shows the help message if the combobox is in an invalid state. */ showHelpMessageIfInvalid(): void; } }