UNPKG

@obliczeniowo/elementary

Version:
113 lines (107 loc) 6.66 kB
import * as _angular_core from '@angular/core'; import { TemplateRef, EventEmitter, OnInit, ElementRef, SimpleChanges } from '@angular/core'; import * as i5 from '@obliczeniowo/elementary/dropdown-select'; import { DragBarComponent } from '@obliczeniowo/elementary/dropdown-select'; import * as i10 from '@angular/forms'; import { ControlValueAccessor, Validator, ValidationErrors, FormControl, AbstractControl, ValidatorFn } from '@angular/forms'; import { AbstractSearchDomain, ClickDataEvent } from '@obliczeniowo/elementary/classes'; import { Subscription } from 'rxjs'; import * as i9 from '@obliczeniowo/elementary/input'; import { InputWrappersDefaultSettingsService } from '@obliczeniowo/elementary/input'; import * as i3 from '@angular/common'; import * as i4 from '@angular/cdk/overlay'; import * as i6 from '@obliczeniowo/elementary/checkbox'; import * as i7 from '@angular/cdk/drag-drop'; import * as i8 from '@obliczeniowo/elementary/buttons'; import * as i11 from '@obliczeniowo/elementary/numeric-pipes'; import * as i12 from '@obliczeniowo/elementary/array-pipes'; import * as i13 from '@obliczeniowo/elementary/async-pipes'; import * as i14 from '@obliczeniowo/elementary/animations'; interface DropdownMultiSelectItem<T> { id: string | number; text: string; selected?: boolean; templateData?: T; } declare class SingleSelectItemComponent { item: _angular_core.InputSignal<DropdownMultiSelectItem<any>>; templateSuffix: _angular_core.InputSignal<TemplateRef<any> | undefined>; remove: EventEmitter<void>; static ɵfac: _angular_core.ɵɵFactoryDeclaration<SingleSelectItemComponent, never>; static ɵcmp: _angular_core.ɵɵComponentDeclaration<SingleSelectItemComponent, "obl-single-select-item", never, { "item": { "alias": "item"; "required": true; "isSignal": true; }; "templateSuffix": { "alias": "templateSuffix"; "required": false; "isSignal": true; }; }, { "remove": "remove"; }, never, never, false, never>; } declare class DropdownMultiSelectComponent implements OnInit, ControlValueAccessor, Validator { private readonly elementRef; private readonly settings; touchedDragBar: boolean; value: (number | string)[]; label: _angular_core.InputSignal<string | undefined>; items: DropdownMultiSelectItem<any>[]; placeholder: _angular_core.InputSignal<string | undefined>; templateSuffix: _angular_core.InputSignal<TemplateRef<any> | undefined>; /** Define if search control should shows up */ search: boolean; /** * Enable type text animation for label */ labelAnimation: boolean; disabled: boolean; wrap: _angular_core.InputSignal<boolean>; regExp: _angular_core.InputSignal<{ on?: boolean; } | undefined>; /** * Control the select items data flow. * * If you want to override this one for getting data from BE source for example just create * own class that extends AbstractSearchModel and do what you need to do to filter out items * list */ model: AbstractSearchDomain<DropdownMultiSelectItem<any>>; get error(): ValidationErrors | null; changed: EventEmitter<DropdownMultiSelectItem<any>[]>; itemClicked: EventEmitter<ClickDataEvent<DropdownMultiSelectItem<any>>>; regChanged: EventEmitter<boolean>; /** search control */ searchControl: FormControl; protected abstractControl: AbstractControl | undefined; protected subscription: Subscription; selected: DropdownMultiSelectItem<any>[]; isOpen: boolean; onChange: (value: (string | number)[]) => void; onTouched: () => void; constructor(elementRef: ElementRef<HTMLElement>, settings: InputWrappersDefaultSettingsService); ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; getWidth(): number; validate(control: AbstractControl): ValidationErrors | null; registerOnValidatorChange(fn: () => void): void; toggleReg(): void; writeValue(ids: (number | string)[] | { value: (number | string)[]; }): void; registerOnChange(onChange: any): void; registerOnTouched(onTouched: any): void; ngOnInit(): void; close(touched?: boolean): void; open(): void; toggle(event: any, touched?: boolean): void; onSelect(item: DropdownMultiSelectItem<any>, dragBar: DragBarComponent): void; onTouchedDragBar(touched: boolean, element: any): void; onItemClicked(event: MouseEvent, item: DropdownMultiSelectItem<any>): void; setDisabledState(disabled: boolean): void; remove(item: DropdownMultiSelectItem<any>): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration<DropdownMultiSelectComponent, never>; static ɵcmp: _angular_core.ɵɵComponentDeclaration<DropdownMultiSelectComponent, "obl-dropdown-multi-select", never, { "value": { "alias": "value"; "required": false; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "templateSuffix": { "alias": "templateSuffix"; "required": false; "isSignal": true; }; "search": { "alias": "search"; "required": false; }; "labelAnimation": { "alias": "labelAnimation"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; "regExp": { "alias": "regExp"; "required": false; "isSignal": true; }; "model": { "alias": "model"; "required": false; }; }, { "changed": "changed"; "itemClicked": "itemClicked"; "regChanged": "regChanged"; }, never, never, false, never>; } declare class DropdownMultiSelectModule { static ɵfac: _angular_core.ɵɵFactoryDeclaration<DropdownMultiSelectModule, never>; static ɵmod: _angular_core.ɵɵNgModuleDeclaration<DropdownMultiSelectModule, [typeof DropdownMultiSelectComponent, typeof SingleSelectItemComponent], [typeof i3.CommonModule, typeof i4.OverlayModule, typeof i5.DropdownSelectModule, typeof i6.CheckboxModule, typeof i7.DragDropModule, typeof i8.ButtonsModule, typeof i9.InputModule, typeof i10.ReactiveFormsModule, typeof i11.UnitsPipe, typeof i12.TakePipe, typeof i13.ToAsyncPipe, typeof i14.AnimationsModule], [typeof DropdownMultiSelectComponent, typeof SingleSelectItemComponent]>; static ɵinj: _angular_core.ɵɵInjectorDeclaration<DropdownMultiSelectModule>; } declare class MultiSelectValidators { static min(min: number): ValidatorFn; static max(max: number): ValidatorFn; } export { DropdownMultiSelectComponent, DropdownMultiSelectModule, MultiSelectValidators, SingleSelectItemComponent }; export type { DropdownMultiSelectItem };