import * as i0 from '@angular/core'; import { ChangeDetectorRef, ElementRef, Injector, ViewContainerRef, OnDestroy, OnInit, Type, TemplateRef, Signal, InjectionToken, DestroyRef } from '@angular/core'; import * as _lucca_front_ng_multi_select from '@lucca-front/ng/multi-select'; import * as _lucca_front_ng_core_select from '@lucca-front/ng/core-select'; import { LuSelectPanelRef, ALuSelectInputComponent, LuOptionContext, ɵIsSelectedStrategy as _IsSelectedStrategy, ILuOptionContext } from '@lucca-front/ng/core-select'; import { ControlValueAccessor, AbstractControl, ValidationErrors } from '@angular/forms'; import * as rxjs from 'rxjs'; import { Subject, BehaviorSubject } from 'rxjs'; import { Overlay, OverlayPositionBuilder, ScrollStrategyOptions, OverlayConfig, ConnectedPosition } from '@angular/cdk/overlay'; import { LuTranslation } from '@lucca-front/ng/core'; import * as i1 from '@lucca-front/ng/form-field'; import { LuOptionComparer } from '@lucca-front/ng/option'; type LuMultiSelection = { mode: 'include'; values: T[]; } | { mode: 'exclude'; values: T[]; } | { mode: 'none'; } | { mode: 'all'; }; type LuMultiSelectionMode = LuMultiSelection['mode']; declare abstract class LuMultiSelectPanelRef extends LuSelectPanelRef { abstract changeDetectorRef?: ChangeDetectorRef; abstract updateSelectedOptions(selectedOptions: T[]): void; abstract useDefaultPosition(): void; } declare class LuMultiSelectPanelRefFactory { protected overlay: Overlay; protected elementRef: ElementRef; protected positionBuilder: OverlayPositionBuilder; protected scrollStrategies: ScrollStrategyOptions; protected parentInjector: Injector; private selectLabelId; private selectId; buildPanelRef(selectInput: LuMultiSelectInputComponent, defaultOverlayConfigOverride?: OverlayConfig): LuMultiSelectPanelRef; buildAndAttachPanelRef(selectInput: LuMultiSelectInputComponent, host: ViewContainerRef): LuMultiSelectPanelRef; protected buildDefaultOverlayConfig(overlayConfigOverride?: OverlayConfig): OverlayConfig; protected buildPosition(yDirection: 'top' | 'bottom', xDirection: 'left' | 'right', config: { offsetX?: number; offsetY?: number; overlapInput: boolean; }): ConnectedPosition; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class LuMultiSelectInputComponent extends ALuSelectInputComponent implements ControlValueAccessor, OnDestroy, OnInit { intl: i0.InputSignalWithTransform<_lucca_front_ng_core_select.LuCoreSelectLabel & _lucca_front_ng_multi_select.ILuMultiSelectLabel, Partial<_lucca_front_ng_core_select.LuCoreSelectLabel & _lucca_front_ng_multi_select.ILuMultiSelectLabel>>; showColon: false; valuesTpl: i0.ModelSignal | TemplateRef>>; maxValuesShown: number; keepSearchAfterSelection: boolean; filterPillLabelPlural: string; selectParent$: Subject; selectChildren$: Subject; get filterPillClass(): boolean; hideCombobox: Signal; filterPillPanelAnchorRef: Signal; isFilterPillEmpty: Signal; valueLength: Signal; useSingleOptionDisplayer: Signal; _value: T[]; get panelRef(): LuMultiSelectPanelRef | undefined; protected _panelRef?: LuMultiSelectPanelRef; protected panelRefFactory: LuMultiSelectPanelRefFactory; /** * This is used to tell the displayer to focus on the input element * keepClue is used to avoid triggering an update which would open the panel, * mainly for when we want to focus without opening the panel */ readonly focusInput$: Subject; readonly emptyClue$: Subject; selectParentOnly(): void; selectChildrenOnly(): void; focusInput(): void; emptyClue(): void; writeValue(value: T[]): void; updateValue(value: T[], skipFocus?: boolean): void; updatePosition(): void; protected buildPanelRef(): LuMultiSelectPanelRef; protected bindInputToPanelRefEvents(): void; enableFilterPillMode(): void; hasValue(): boolean; clearValue(event?: Event): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "lu-multi-select", never, { "intl": { "alias": "intl"; "required": false; "isSignal": true; }; "valuesTpl": { "alias": "valuesTpl"; "required": false; "isSignal": true; }; "maxValuesShown": { "alias": "maxValuesShown"; "required": false; }; "keepSearchAfterSelection": { "alias": "keepSearchAfterSelection"; "required": false; }; "filterPillLabelPlural": { "alias": "filterPillLabelPlural"; "required": false; }; }, { "valuesTpl": "valuesTplChange"; }, never, never, true, never>; static ngAcceptInputType_maxValuesShown: unknown; static ngAcceptInputType_keepSearchAfterSelection: unknown; } declare const LU_MULTI_SELECT_TRANSLATIONS: InjectionToken>; interface ILuMultiSelectLabel { placeholder: string; search: string; clear: string; clearSearch: string; emptyResults: string; emptyOptions: string; emptySelection: string; expand: string; reduce: string; selectAll: string; unselectAll: string; loading: string; } declare const luMultiSelectTranslations: LuTranslation; interface LuMultiSelectWithSelectAllContext { setSelectAll(value: boolean): void; mode: Signal; values: Signal; displayerLabel: Signal; totalCount: Signal; displayerCount: Signal; intl: Signal; } declare class LuMultiSelectWithSelectAllDirective extends _IsSelectedStrategy implements LuMultiSelectWithSelectAllContext { #private; readonly select: LuMultiSelectInputComponent; readonly intl: i0.InputSignalWithTransform<_lucca_front_ng_core_select.LuCoreSelectLabel & _lucca_front_ng_multi_select.ILuMultiSelectLabel, Partial<_lucca_front_ng_core_select.LuCoreSelectLabel & _lucca_front_ng_multi_select.ILuMultiSelectLabel>>; readonly displayerLabel: i0.InputSignal; readonly mode: i0.Signal<"include" | "exclude" | "none" | "all">; readonly values: i0.Signal; readonly totalCount: i0.Signal; readonly displayerCount: i0.Signal; constructor(); setSelectAll(selectAll: boolean): void; isSelected(option: TValue, selectedOptions: TValue[], optionComparer: LuOptionComparer): boolean; isGroupSelected(_options: TValue[], notSelectedOptions: TValue[]): boolean; registerOnChange(fn: (value: TValue[] | LuMultiSelection) => void): void; writeValue(value: TValue[] | LuMultiSelection): void; clearValue($event: Event): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "lu-multi-select[withSelectAll]", never, { "displayerLabel": { "alias": "withSelectAllDisplayerLabel"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>; } declare class LuMultiSelectContentDisplayerComponent { select: LuMultiSelectInputComponent; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "lu-multi-select-content-displayer", never, {}, {}, never, ["*"], true, never>; } declare class LuMultiSelectCounterDisplayerComponent implements OnInit { select: LuMultiSelectInputComponent; context: ILuOptionContext; protected destroyRef: DestroyRef; inputElementRef: ElementRef; get value(): T[]; selectedOptions$: BehaviorSubject; set selected(options: T[]); label: string; ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "lu-multi-select-counter-displayer", never, { "selected": { "alias": "selected"; "required": false; }; "label": { "alias": "label"; "required": true; }; }, {}, never, never, true, never>; } declare class LuMultiSelectDefaultDisplayerComponent implements OnInit { select: LuMultiSelectInputComponent; intl: i0.InputSignalWithTransform<_lucca_front_ng_multi_select.ILuMultiSelectDisplayerLabel, Partial<_lucca_front_ng_multi_select.ILuMultiSelectDisplayerLabel>>; protected destroyRef: DestroyRef; inputElementRef: ElementRef; get value(): T[]; context: ILuOptionContext; displayedOptions$: rxjs.Observable; overflowOptions$: rxjs.Observable; unselectOption(option: T, $event?: Event): void; inputBackspace(): void; inputSpace(event: Event): void; ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "lu-multi-select-default-displayer", never, { "intl": { "alias": "intl"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>; } declare const LU_MULTI_SELECT_DISPLAYER_TRANSLATIONS: InjectionToken>; interface ILuMultiSelectDisplayerLabel { otherResult: string; otherResults: string; showResultsDetails: string; removeOption: string; } declare const luMultiSelectDisplayerTranslations: LuTranslation; declare class LuMultiSelectDisplayerInputDirective implements OnInit { #private; select: LuMultiSelectInputComponent; readonly selectAllContext: LuMultiSelectWithSelectAllContext; contentDisplayer: LuMultiSelectContentDisplayerComponent; context: ILuOptionContext; elementRef: ElementRef; destroyRef: DestroyRef; get panelOpen(): boolean; get activeDescendant(): string; get controls(): string; get disabled(): boolean; get placeholder(): string; get readonly(): boolean; onInput(): void; constructor(); ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "[luMultiSelectDisplayerInput]", never, {}, {}, never, never, true, [{ directive: typeof i1.InputDirective; inputs: {}; outputs: {}; }]>; } declare class LuMultiDisplayerDirective { private templateRef; set select(select: LuMultiSelectInputComponent); constructor(templateRef: TemplateRef>); static ngTemplateContextGuard(_dir: LuMultiDisplayerDirective, ctx: unknown): ctx is LuOptionContext; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "[luMultiDisplayer]", never, { "select": { "alias": "luMultiDisplayerSelect"; "required": false; }; }, {}, never, never, true, never>; } declare function selectionToQueryParams(key: Key, value: LuMultiSelection, selector: (value: T) => unknown): Partial>; /** * Transforms a selection from withSelectAll, the complete list of options and a getKey function to a list of options. * * @example * ```ts * const selection = { mode: 'exclude', values: [{ id: 1, name: 'foo' }] }; * const allOptions = [{ id: 1, name: 'foo' }, { id: 2, name: 'bar' }, { id: 3, name: 'baz' }]; * * const selectedOptions = selectionToOptions(selection, allOptions, (o) => o.id); * ``` */ declare function selectionToOptions(selection: LuMultiSelection, options: T[], getKeyFn: (value: T) => unknown): T[]; declare const LuMultiSelectionValidators: { required: (control: AbstractControl>) => ValidationErrors | null; }; export { LU_MULTI_SELECT_DISPLAYER_TRANSLATIONS, LU_MULTI_SELECT_TRANSLATIONS, LuMultiDisplayerDirective, LuMultiSelectContentDisplayerComponent, LuMultiSelectCounterDisplayerComponent, LuMultiSelectDefaultDisplayerComponent, LuMultiSelectDisplayerInputDirective, LuMultiSelectInputComponent, LuMultiSelectWithSelectAllDirective, LuMultiSelectionValidators, luMultiSelectDisplayerTranslations, luMultiSelectTranslations, selectionToOptions, selectionToQueryParams }; export type { ILuMultiSelectDisplayerLabel, ILuMultiSelectLabel, LuMultiSelection, LuMultiSelectionMode };