import * as i0 from '@angular/core'; import { AfterContentInit, OnInit, EventEmitter } from '@angular/core'; import { ControlValueAccessor, AbstractControl } from '@angular/forms'; import { Subject } from 'rxjs'; /** * Event emitted when the SearchField is submitted. */ type SearchTrigger = { /** Reference to the emitting SearchField component */ source: SearchFieldComponent; /** Current value of the SearchInput */ value: string; }; /** * Event emitted when SearchField's `clear` button (×) clicked. * * ### Import * * ```typescript * import { SearchClear } from '@talenra/ngx-base/search'; * ``` * * @see {@link SearchFieldComponent} */ interface SearchClear { /** Reference to the emitting SearchField component */ source: SearchFieldComponent; } /** * Values accepted by the `SearchField`'s `spacing` property. * * ### Import * * ```typescript * import { SearchFieldSize } from '@talenra/ngx-base/search'; * ``` * * @see {@link SearchField} * @see {@link TSearchFieldSize} */ declare const SearchFieldSize: { readonly S: "s"; readonly M: "m"; }; /** * Type of values accepted by the `SearchField`'s `spacing` property. * * ### Import * * ```typescript * import { TSearchFieldSize } from '@talenra/ngx-base/search'; * ``` * * @see {@link SearchField} * @see {@link SearchFieldSize} */ type TSearchFieldSize = (typeof SearchFieldSize)[keyof typeof SearchFieldSize]; /** * Values accepted by the `kind` property of the SearchInput component. * * ```html * * ``` * * ### Import * * ```typescript * import { SearchKind } from '@talenra/ngx-base/search'; * ``` * * @see {@link SearchInput} * @see {@link TSearchKind} */ declare const SearchKind: { readonly Default: "default"; readonly NoIndent: "no-indent"; }; /** * Type of values accepted by the `kind` property of the SearchInput component. * * ### Import * * ```typescript * import { TSearchKind } from '@talenra/ngx-base/search'; * ``` * * @see {@link SearchInput} * @see {@link SearchKind} */ type TSearchKind = (typeof SearchKind)[keyof typeof SearchKind]; /** * SearchInput provides consistent styling and behaviour for different kinds of search inputs. * It is typically wrapped by a SearchField. * * #### Reactive form * * ```typescript * // Component class * protected searchForm: FormGroup = new FormGroup({ * query: new FormControl(''), * }); * ``` * * ```html * *
* * * *
* ``` * * #### Template driven form * * ```typescript * // Component class * protected query = ''; * ``` * * ```html * * * * * ``` * * ### Import * * ```typescript * import { SearchModule } from '@talenra/ngx-base/search'; * ``` * * ../../#/search * * @see {@link SearchFieldComponent} */ declare class SearchInputComponent implements ControlValueAccessor, AfterContentInit { /** * Determinates the kind (or style) of the input. Used to support style variations. * * NoIndent: Render a search without horizontal indent / padding. * * ```html * * ``` */ kind: TSearchKind; /** @internal */ value: string | null; private tabindex; /** @internal */ hasFocus: boolean; /** @internal */ stateChanges: Subject; /** @internal */ control: AbstractControl | null; /** * Determines whether the control is disabled/enabled. * * ```html * * ``` */ get disabled(): null | true; /** Set the control's disabled state */ set disabled(value: null | true); private _disabled; /** * Determines whether the control's value is empty. * * @internal */ get isEmpty(): boolean; /** Reference to the wrapping SearchField */ private searchField?; private readonly destroyRef; private injector; private elementRef; /** @internal */ constructor(); /** @internal */ ngAfterContentInit(): void; /** @internal */ private onChange; /** @internal */ private onTouched; /** @internal */ writeValue(value: string | null): void; /** @internal */ registerOnChange(fn: (value: string | null) => void): void; /** @internal */ registerOnTouched(fn: () => void): void; /** @internal */ setDisabledState(isDisabled: boolean): void; /** @internal */ clearValue(): void; private inputHandler; private focusHandler; /** * Sets the focus to the input. */ focus(): void; /** @internal */ get hostClass(): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_disabled: unknown; } /** * SearchField is a wrapper for SearchField. The wrapper/field-architecture gives the consuming app direct access to and * thus full control over the wrapped field. * * Example: * * ```typescript * // Component class * protected searchForm: FormGroup = new FormGroup({ * query: new FormControl(''), * }); * ``` * * ```html * * * * * ``` * * ### Import * * ```typescript * import { SearchFieldComponent } from '@talenra/ngx-base/search'; * ``` * * ../../#/search * * @see {@link SearchInputComponent} */ declare class SearchFieldComponent implements OnInit, AfterContentInit { /** * Determines whether the magnifying glass icons is displayed. * * ```html * * * * * ``` */ showIcon: boolean; /** * Determines whether the search button is displayed. * * ```html * * * * * ``` */ showButton: boolean; /** * Determines the size of SearchField. Defaults to 'm'. * * ```html * * ``` * * @see {@link SearchFieldSize} */ size: i0.InputSignal; /** * Event emitted when the SearchField is submitted. * * ```typescript * // Component class * import { SearchTrigger } from '@talenra/ngx-base/search'; * * protected searchForm: FormGroup = new FormGroup({ * query: new FormControl(''), * }); * * onSearch: (search: SearchTrigger) => { * console.log(`SearchField (id: ${search.source.id}) is submitted with value ${search.value}.`); * } * ``` * * ```html * *
* * * *
* ``` */ search: EventEmitter; /** * Event emitted when SearchField's `clear` button (×) clicked. */ clear: EventEmitter; /** @internal */ id: string; /** * Reference to the associated search field component. * * @internal */ protected searchInput?: SearchInputComponent; private useTransition; private readonly changeDetector; private readonly destroyRef; /** @internal */ ngOnInit(): void; /** @internal */ ngAfterContentInit(): void; protected onEnter(event: Event): void; protected onClear(): void; protected onSearch(): void; /** @internal */ get hostClass(): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_showIcon: unknown; static ngAcceptInputType_showButton: unknown; } export { SearchFieldComponent, SearchFieldSize, SearchInputComponent, SearchKind }; export type { SearchClear, SearchTrigger, TSearchFieldSize, TSearchKind };