import * as _angular_core from '@angular/core'; import { InjectionToken, Provider, OnInit, TemplateRef, PipeTransform, OnChanges, OnDestroy, Type, SimpleChanges, ElementRef, AfterViewInit, Signal, EventEmitter, WritableSignal, ChangeDetectorRef } from '@angular/core'; import * as _lucca_front_ng_filter_pills from '@lucca-front/ng/filter-pills'; import { FilterPillInputComponent } from '@lucca-front/ng/filter-pills'; import { OverlayConfig, OverlayRef } from '@angular/cdk/overlay'; import { ControlValueAccessor } from '@angular/forms'; import { PortalContent, LuTranslation } from '@lucca-front/ng/core'; import * as rxjs from 'rxjs'; import { BehaviorSubject, Observable, Subject, ReplaySubject } from 'rxjs'; import { Highlightable } from '@angular/cdk/a11y'; interface ILuOptionContext { isDisabled$: BehaviorSubject; option$: BehaviorSubject; destroy(): void; } declare const LU_OPTION_CONTEXT: InjectionToken>; declare function provideOptionContext(): Provider; declare class LuSimpleSelectDefaultOptionComponent { context: ILuOptionContext<{ name?: string; }>; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class LuDisabledOptionDirective { private context; set isDisabled(disabled: boolean | null); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface LuOptionContext { $implicit: T; } interface LuOptionGroupByContext { $implicit: LuOptionGroup; } interface LuOptionGroup { key: TGroup; options: T[]; } type LuOptionComparer = (a: T, b: T) => boolean; type CoreSelectAddOptionStrategy = 'never' | 'always' | 'if-empty-clue' | 'if-not-empty-clue'; declare const SELECT_ID: InjectionToken; declare const SELECT_LABEL: InjectionToken; declare const SELECT_LABEL_ID: InjectionToken; interface CoreSelectApiTotalCountProvider { totalCount$: Observable; } declare const CORE_SELECT_API_TOTAL_COUNT_PROVIDER: InjectionToken; declare abstract class ɵIsSelectedStrategy { abstract isSelected(option: TOption, selectedOptions: TOption[], optionComparer: LuOptionComparer): boolean; abstract isGroupSelected(options: TOption[], notSelectedOptions: TOption[]): boolean; static ɵfac: _angular_core.ɵɵFactoryDeclaration<ɵIsSelectedStrategy, never>; static ɵprov: _angular_core.ɵɵInjectableDeclaration<ɵIsSelectedStrategy>; } interface LuOptionGrouping { selector: (option: TOption) => TGroup; content: PortalContent>; } declare class LuOptionGroupDirective implements LuOptionGrouping, OnInit { select: ALuSelectInputComponent; selector: (option: TOption) => TGroup; readonly content: TemplateRef>; static ngTemplateContextGuard(_dir: LuOptionGroupDirective, ctx: unknown): ctx is LuOptionGroupByContext; ngOnInit(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[luOptionGroup]", never, { "select": { "alias": "luOptionGroupSelect"; "required": false; }; "selector": { "alias": "luOptionGroupBy"; "required": false; }; }, {}, never, never, true, never>; } /** * Generate groups with a O(n) complexity. Note that the options must be sorted by group. */ declare function generateGroups(options: T[], selector: (option: T) => TGroup): LuOptionGroup[]; declare class LuOptionGroupPipe implements PipeTransform { transform(options: T[], selector: (option: T) => TGroup): LuOptionGroup[]; transform(options: T, selector: (option: T) => TGroup): LuOptionGroup; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵpipe: _angular_core.ɵɵPipeDeclaration, "luOptionGroup", true>; } declare class LuOptionOutletDirective implements OnChanges, OnDestroy { luOptionOutlet?: Type | TemplateRef>; luOptionOutletValue: T | undefined; luOptionShowNull: boolean; private viewContainerRef; private injector; private embeddedViewRef?; private componentRef?; private optionContext; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; private clearContainer; private createComponent; private updateRefValue; static ngTemplateContextGuard(_dir: LuOptionOutletDirective, ctx: unknown): ctx is void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[luOptionOutlet]", never, { "luOptionOutlet": { "alias": "luOptionOutlet"; "required": false; }; "luOptionOutletValue": { "alias": "luOptionOutletValue"; "required": false; }; "luOptionShowNull": { "alias": "luOptionShowNull"; "required": false; }; }, {}, never, never, true, never>; } interface OptionTranslate { onlyParent: string; onlyChildren: string; } type GroupTemplateLocation = 'group-header' | 'option' | 'none'; /** * In order to avoid a blinking when we go from empty clue to a clue * We need to delay the change of group displayer location by waiting for the options to be updated. */ declare function getGroupTemplateLocation(hasGrouping$: Observable, clueChange$: Observable, options$: Observable, searchable?: boolean): Observable; declare class CoreSelectPanelElement implements Highlightable, OnDestroy { #private; readonly elementRef: ElementRef; id: _angular_core.WritableSignal; elementId: _angular_core.InputSignal; idAttribute: _angular_core.Signal; isSelected: _angular_core.ModelSignal; option: _angular_core.InputSignal; isHighlighted: _angular_core.WritableSignal; selected: _angular_core.OutputEmitterRef; disabled: boolean; constructor(); ngOnDestroy(): void; setActiveStyles(): void; setInactiveStyles(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[luCoreSelectPanelElement]", ["luCoreSelectPanelElement"], { "elementId": { "alias": "elementId"; "required": false; "isSignal": true; }; "isSelected": { "alias": "isSelected"; "required": false; "isSignal": true; }; "option": { "alias": "option"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "isSelected": "isSelectedChange"; "selected": "selected"; }, never, never, true, never>; } declare class LuOptionComponent implements AfterViewInit, OnDestroy, OnInit { protected selectableItem: CoreSelectPanelElement; readonly intl: _angular_core.InputSignalWithTransform>; hasOptionItemClass: boolean; optionTpl: TemplateRef> | Type | undefined; option?: T; grouping?: LuOptionGrouping; hasChildren: _angular_core.InputSignalWithTransform; onlyParent: _angular_core.OutputEmitterRef; onlyChildren: _angular_core.OutputEmitterRef; groupIndex: _angular_core.InputSignal; optionIndex: _angular_core.InputSignalWithTransform; scrollIntoViewOptions: ScrollIntoViewOptions; groupTemplateLocation: _angular_core.InputSignal; private optionContext?; private cdr; private subscription?; get id(): string; protected elementRef: ElementRef; protected selectId: number; constructor(); ngOnInit(): void; ngOnDestroy(): void; ngAfterViewInit(): void; selectOption($event: Event): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵcmp: _angular_core.ɵɵComponentDeclaration, "lu-select-option", never, { "intl": { "alias": "intl"; "required": false; "isSignal": true; }; "optionTpl": { "alias": "optionTpl"; "required": false; }; "option": { "alias": "option"; "required": false; }; "grouping": { "alias": "grouping"; "required": false; }; "hasChildren": { "alias": "hasChildren"; "required": false; "isSignal": true; }; "groupIndex": { "alias": "groupIndex"; "required": false; "isSignal": true; }; "optionIndex": { "alias": "optionIndex"; "required": true; "isSignal": true; }; "scrollIntoViewOptions": { "alias": "scrollIntoViewOptions"; "required": false; }; "groupTemplateLocation": { "alias": "groupTemplateLocation"; "required": false; "isSignal": true; }; }, { "onlyParent": "onlyParent"; "onlyChildren": "onlyChildren"; }, never, never, true, never>; } declare class LuOptionDirective { private templateRef; set select(select: ALuSelectInputComponent); constructor(templateRef: TemplateRef>); static ngTemplateContextGuard(_dir: LuOptionDirective, ctx: unknown): ctx is LuOptionContext; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[luOption]", never, { "select": { "alias": "luOptionSelect"; "required": false; }; }, {}, never, never, true, never>; } interface CoreSelectKeyManagerOptions { queryList: Signal[]>; options$: Observable; optionComparer: LuOptionComparer; activeOptionIdChanged$: EventEmitter; clueChange$: Observable; } declare class CoreSelectKeyManager { #private; init(options: CoreSelectKeyManagerOptions): void; onKeydown(event: KeyboardEvent): void; get activeItem(): CoreSelectPanelElement | undefined; get activeItemIndex(): number; setActiveItem(index: number): void; highlightOption(option: T): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵprov: _angular_core.ɵɵInjectableDeclaration>; } declare class LuCoreSelectPanelHeaderDirective { readonly templateRef: TemplateRef; readonly select: _angular_core.InputSignal | ALuSelectInputComponent>; constructor(); static ngTemplateContextGuard(_dir: LuCoreSelectPanelHeaderDirective, ctx: unknown): ctx is void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare abstract class LuSelectPanelRef { closed: EventEmitter; previousPage: EventEmitter; nextPage: EventEmitter; valueChanged: EventEmitter; clueChanged: EventEmitter; activeOptionIdChanged: EventEmitter; options$: Observable; abstract updatePosition(): void; abstract handleKeyManagerEvent(event: KeyboardEvent): void; abstract emitValue(value: TValue): void; abstract selectCurrentlyHighlightedValue(): void; close(): void; } interface CoreSelectPanelInstance { options: WritableSignal[]>; } declare const SELECT_PANEL_INSTANCE: InjectionToken>; declare const LU_CORE_SELECT_TRANSLATIONS: InjectionToken>; interface LuCoreSelectLabel { addOption: string; } declare const luCoreSelectTranslations: LuTranslation; type TreeGroupingFn = (value: T, array: T[]) => T | null; interface TreeNode { node: T; children?: TreeNode[]; } interface TreeGenerator> { generateTrees(items: T[]): R[]; } declare const coreSelectDefaultOptionComparer: LuOptionComparer; declare const coreSelectDefaultOptionKey: (option: unknown) => unknown; declare abstract class ALuSelectInputComponent implements OnDestroy, OnInit, ControlValueAccessor, FilterPillInputComponent { #private; parentInput: FilterPillInputComponent; protected changeDetectorRef: ChangeDetectorRef; protected overlayContainerRef: HTMLElement; protected labelElement: HTMLElement | undefined; protected labelId: string; protected abstract intl: Signal; protected filterPillHost: _lucca_front_ng_filter_pills.FilterPillComponent; protected afterCloseFn?: () => void; protected updatePositionFn?: () => void; protected filterPillMode: boolean; ignorePresentation: _angular_core.InputSignalWithTransform; selectParent$?: Subject; selectChildren$?: Subject; panelClosed: _angular_core.OutputEmitterRef; panelOpened: _angular_core.OutputEmitterRef; highlightedOption: _angular_core.OutputEmitterRef; private inputElementRef; placeholder$: BehaviorSubject; disabled$: BehaviorSubject; filterPillDisabled: Signal; prefix: _angular_core.InputSignal; set placeholder(value: string); set clearable(value: boolean); get clearable(): boolean; get searchable(): boolean; protected computedAddOptionLabel: Signal; set addOptionLabel(label: PortalContent); get addOptionLabel(): PortalContent; set addOptionStrategy(strategy: CoreSelectAddOptionStrategy); protected get isSelectedClass(): boolean; protected get isSearchFilledClass(): boolean; protected abstract hasValue(): boolean; get isPanelOpen(): boolean; isPanelOpen$: BehaviorSubject; activeDescendant$: BehaviorSubject; get ariaControls(): string; overlayConfig?: OverlayConfig; set loading(value: boolean); set options(options: readonly TOption[]); optionComparer: LuOptionComparer; optionKey: (option: TOption) => unknown; noClueIcon: _angular_core.InputSignalWithTransform; inputTabindex: _angular_core.InputSignal; compact: _angular_core.InputSignalWithTransform; colorPicker: _angular_core.InputSignalWithTransform; protected get isNoClueIconClass(): boolean; optionTpl: _angular_core.ModelSignal | TemplateRef>>; valueTpl: _angular_core.ModelSignal | TemplateRef>>; panelHeaderTpl: _angular_core.ModelSignal | TemplateRef>; panelFooterTpl: _angular_core.ModelSignal | TemplateRef>; displayerTpl: Signal | TemplateRef>>; groupingSignal: _angular_core.WritableSignal>; /** * @deprecated use groupingSignal */ get grouping(): LuOptionGrouping | undefined; /** * @deprecated use groupingSignal */ set grouping(grouping: LuOptionGrouping | undefined); treeGenerator?: TreeGenerator>; clueChange$: Subject; clueChange: _angular_core.OutputRef; nextPage$: Subject; nextPage: _angular_core.OutputRef; previousPage: _angular_core.OutputEmitterRef; addOption: _angular_core.OutputEmitterRef; valueSignal: _angular_core.WritableSignal; isFilterPillEmpty: Signal; isFilterPillClearable: Signal; get value(): TValue; protected set value(value: TValue); get inputPlaceholder(): string | null; clueChanged(clue: string, skipPanelOpen?: boolean): void; protected _value?: TValue; options$: ReplaySubject; loading$: BehaviorSubject; clue: string | null; lastEmittedClue: string; clue$: Observable; addOptionStrategy$: BehaviorSubject; shouldDisplayAddOption$: Observable; protected onChange?: (value: TValue | null) => void; protected onTouched?: () => void; get panelRef(): LuSelectPanelRef | undefined; protected _panelRef?: LuSelectPanelRef; protected destroyed$: Subject; constructor(); onClickOpenPanel($event: Event): void; onKeyDownNavigation(event: Event): void; registerOnChange(onChange: (value: TValue) => void): void; registerOnTouched(onTouched: () => void): void; setDisabledState(isDisabled: boolean): void; ngOnDestroy(): void; ngOnInit(): void; clearValue(event?: Event): void; openPanel(clue?: string): void; emitAddOption(): void; protected abstract buildPanelRef(): this['panelRef']; protected bindInputToPanelRefEvents(): void; focusInput(): void; protected emptyClue(): void; closePanel(): void; writeValue(value: TValue): void; updateValue(value: TValue, skipPanelOpen?: boolean, noClear?: boolean): void; clearFilterPillValue(): void; registerFilterPillClosePopover(closeFn: () => void): void; registerFilterPillUpdatePosition(updatePositionFn: () => void): void; enableFilterPillMode(): void; onFilterPillOpened(): void; onFilterPillClosed(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, never, never, { "ignorePresentation": { "alias": "ignorePresentation"; "required": false; "isSignal": true; }; "prefix": { "alias": "prefix"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "addOptionLabel": { "alias": "addOptionLabel"; "required": false; }; "addOptionStrategy": { "alias": "addOptionStrategy"; "required": false; }; "overlayConfig": { "alias": "overlayConfig"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "options": { "alias": "options"; "required": false; }; "optionComparer": { "alias": "optionComparer"; "required": false; }; "optionKey": { "alias": "optionKey"; "required": false; }; "noClueIcon": { "alias": "noClueIcon"; "required": false; "isSignal": true; }; "inputTabindex": { "alias": "inputTabindex"; "required": false; "isSignal": true; }; "compact": { "alias": "compact"; "required": false; "isSignal": true; }; "colorPicker": { "alias": "colorPicker"; "required": false; "isSignal": true; }; "optionTpl": { "alias": "optionTpl"; "required": false; "isSignal": true; }; "valueTpl": { "alias": "valueTpl"; "required": false; "isSignal": true; }; "panelHeaderTpl": { "alias": "panelHeaderTpl"; "required": false; "isSignal": true; }; "panelFooterTpl": { "alias": "panelFooterTpl"; "required": false; "isSignal": true; }; }, { "panelClosed": "panelClosed"; "panelOpened": "panelOpened"; "highlightedOption": "highlightedOption"; "optionTpl": "optionTplChange"; "valueTpl": "valueTplChange"; "panelHeaderTpl": "panelHeaderTplChange"; "panelFooterTpl": "panelFooterTplChange"; "clueChange": "clueChange"; "nextPage": "nextPage"; "previousPage": "previousPage"; "addOption": "addOption"; }, never, never, true, never>; static ngAcceptInputType_clearable: unknown; } declare function provideLuSelectLabelsAndIds(): Provider[]; declare function addAttributesOnCdkContainer(overlayRef: OverlayRef, selectLabelId: string, selectId: number): void; declare class LuCoreSelectTotalCountDirective implements CoreSelectApiTotalCountProvider { totalCount: _angular_core.InputSignal; totalCount$: rxjs.Observable; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class TreeDisplayPipe implements PipeTransform { transform(items: T[], treeGenerator: TreeGenerator>): TreeNode[]; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵpipe: _angular_core.ɵɵPipeDeclaration, "luTreeDisplay", true>; } declare class LuDisplayerDirective { private templateRef; set select(select: ALuSelectInputComponent); constructor(templateRef: TemplateRef>); static ngTemplateContextGuard(_dir: LuDisplayerDirective, ctx: unknown): ctx is LuOptionContext; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[luDisplayer]", never, { "select": { "alias": "luDisplayerSelect"; "required": false; }; }, {}, never, never, true, never>; } declare class LuCoreSelectNoClueDirective { constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare const applySearchDelimiter: (clue: string, delimiter: string) => string; declare class LuIsOptionSelectedPipe implements PipeTransform { #private; transform(option: T, comparer: LuOptionComparer, selectedOptions: T[]): boolean; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵpipe: _angular_core.ɵɵPipeDeclaration, "luIsOptionSelected", true>; } export { ALuSelectInputComponent, CORE_SELECT_API_TOTAL_COUNT_PROVIDER, CoreSelectKeyManager, LU_CORE_SELECT_TRANSLATIONS, LU_OPTION_CONTEXT, LuCoreSelectNoClueDirective, LuCoreSelectPanelHeaderDirective, LuCoreSelectTotalCountDirective, LuDisabledOptionDirective, LuDisplayerDirective, LuIsOptionSelectedPipe, LuOptionDirective, LuOptionGroupDirective, LuSelectPanelRef, LuSimpleSelectDefaultOptionComponent, SELECT_ID, SELECT_LABEL, SELECT_LABEL_ID, SELECT_PANEL_INSTANCE, TreeDisplayPipe, addAttributesOnCdkContainer, applySearchDelimiter, coreSelectDefaultOptionComparer, coreSelectDefaultOptionKey, luCoreSelectTranslations, provideLuSelectLabelsAndIds, provideOptionContext, CoreSelectPanelElement as ɵCoreSelectPanelElement, ɵIsSelectedStrategy, LuOptionComponent as ɵLuOptionComponent, LuOptionGroupPipe as ɵLuOptionGroupPipe, LuOptionOutletDirective as ɵLuOptionOutletDirective, generateGroups as ɵgenerateGroups, getGroupTemplateLocation as ɵgetGroupTemplateLocation }; export type { CoreSelectAddOptionStrategy, CoreSelectApiTotalCountProvider, CoreSelectPanelInstance, ILuOptionContext, LuCoreSelectLabel, LuOptionComparer, LuOptionContext, LuOptionGroup, LuOptionGroupByContext, LuOptionGrouping, TreeGenerator, TreeGroupingFn, TreeNode };