import * as i0 from '@angular/core'; import { OnInit, AfterViewInit, OnDestroy, OnChanges, EventEmitter, SimpleChanges } from '@angular/core'; import { EuiLanguage, EuiAppShellService } from '@eui/core'; /** * @description A component that provides language selection functionality for applications. * * This component displays available languages and allows users to select their preferred language. * It adapts its display based on the number of available languages: * - For 1 language: No selector is shown * - For 2-3 languages: Displays a dropdown menu * - For 4+ languages: Opens a modal dialog with the full list * * The component integrates with EuiAppShellService to manage language state * and uses TranslateService for localization. * * @usageNotes * ### Basic Usage * ```html * * ``` * * ### In Toolbar * ```html * * * * ``` * * ### Accessibility * - Provides default `aria-label` indicating current language * - Custom `aria-label` can be set via input * - Keyboard navigable dropdown and modal interfaces * * ### Notes * - Automatically detects toolbar parent and adjusts styling * - Language list is managed through EuiAppShellService * - Supports 2-3 languages via dropdown, 4+ via modal */ declare class EuiLanguageSelectorComponent implements OnInit, AfterViewInit, OnDestroy, OnChanges { get cssClasses(): string; languages: EuiLanguage[]; selectedLanguage: EuiLanguage; /** * @property hasLanguageSelection - Enables/disables language selection functionality. * @default true */ hasLanguageSelection: boolean; /** * @property isToolbarSelector - When true, applies styling for toolbar integration. * @default false */ isToolbarSelector: boolean; /** * @property euiPrimary - When true, applies primary styling. * @default false */ euiPrimary: boolean; /** * @property ariaLabel - Accessibility label for the language selector. * If not provided, defaults to "Change Language - Current Language: [selected language]" */ ariaLabel: string; /** * @event languageSelectorClick - Emitted when the language selector is clicked. */ languageSelectorClick: EventEmitter; appShellService: EuiAppShellService; private destroy$; private isAriaLabelChanged; private cd; private euiDialogService; private translateService; private elRef; /** * returns true if there are at least one and max four languages. */ get isShowDropDown(): boolean; /** * returns true if there are at least five languages. */ get isShowModal(): boolean; ngOnChanges(changes: SimpleChanges): void; ngOnInit(): void; ngAfterViewInit(): void; ngOnDestroy(): void; /** * Updates the active language in the application. * @param language - The language object to set as active. */ onLanguageChanged(language: EuiLanguage): void; /** * Opens a modal dialog with the full list of available languages. * @param [titleLabel] - Optional custom title for the modal. */ onOpen(titleLabel?: string): void; onClick(): void; /** * Retrieves a language object by its code. * * @param languageCode - Two-character language code. */ protected getLanguage(languageCode: string): EuiLanguage; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_hasLanguageSelection: unknown; static ngAcceptInputType_isToolbarSelector: unknown; static ngAcceptInputType_euiPrimary: unknown; } interface ModelConfig { /** * Available languages to select from */ languages: EuiLanguage[]; /** * Currently selected language */ selectedLanguage: EuiLanguage; /** * Callback when language selection changes * @param language */ languageChanged: (language: EuiLanguage) => void; } /** * Modal component for language selection. * Displays EU and non-EU languages in a grid layout with 4 languages per row. */ declare class EuiModalSelectorComponent implements OnInit { /** * Configuration injected from the dialog service */ config: ModelConfig; /** EU languages organized in rows of up to 4 languages */ languageRows: EuiLanguage[][]; /** * Non-EU languages organized in rows of up to 4 languages * @deprecated use {@link additionalLanguageRows} */ additionaLanguageRows: EuiLanguage[][]; /** Non-EU languages organized in rows of up to 4 languages */ additionalLanguageRows: EuiLanguage[][]; /** Currently selected language */ private selectedLanguage; /** Dialog service for handling modal operations */ private euiDialogService; /** * Initializes language rows by separating EU and non-EU languages */ ngOnInit(): void; /** * Handles language selection * @param {EuiLanguage} languageCode - The language being selected */ selectLanguage(languageCode: EuiLanguage): void; /** * Organizes languages into rows of up to 4 languages each * @param {EuiLanguage[]} languages - Array of languages to organize * @returns {EuiLanguage[][]} 2D array of languages organized in rows */ private prepareLanguageRows; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare const EUI_LANGUAGE_SELECTOR: readonly [typeof EuiLanguageSelectorComponent, typeof EuiModalSelectorComponent]; export { EUI_LANGUAGE_SELECTOR, EuiLanguageSelectorComponent, EuiModalSelectorComponent }; export type { ModelConfig }; //# sourceMappingURL=eui-components-eui-language-selector.d.ts.map