UNPKG

@obliczeniowo/elementary

Version:
166 lines (159 loc) 7.3 kB
import * as i0 from '@angular/core'; import { EventEmitter, SimpleChanges, ChangeDetectorRef, ElementRef } from '@angular/core'; import * as i7 from '@obliczeniowo/elementary/dropdown-select'; import { DropdownSelectItem, DropdownSelectComponent } from '@obliczeniowo/elementary/dropdown-select'; import { ControlValueAccessor } from '@angular/forms'; import * as i10 from '@obliczeniowo/elementary/input'; import { InputWrappersDefaultSettingsService } from '@obliczeniowo/elementary/input'; import * as i6 from '@angular/cdk/drag-drop'; import { CdkDragDrop } from '@angular/cdk/drag-drop'; import * as i4 from '@angular/common'; import * as i5 from '@angular/cdk/overlay'; import * as i8 from '@obliczeniowo/elementary/buttons'; import * as i9 from '@obliczeniowo/elementary/text-pipes'; import * as i11 from '@obliczeniowo/elementary/badge'; interface SortOption { id: number; name: string; order: 'ASC' | 'DESC'; } interface NameItem { name: string; text: string; } declare class SortingOptionComponent implements ControlValueAccessor { private readonly settings; option: SortOption; names: NameItem[]; translations: { [en: string]: string; }; mode: 'single' | 'add' | 'remove'; changed: EventEmitter<SortOption>; nameChanged: EventEmitter<SortOption>; orderChanged: EventEmitter<SortOption>; add: EventEmitter<SortOption>; remove: EventEmitter<SortOption>; protected nameItems: DropdownSelectItem<any>[]; order: DropdownSelectItem<any>[]; disabled: boolean; /** * Enable type text animation for label */ labelAnimation: boolean; constructor(settings: InputWrappersDefaultSettingsService); ngOnChanges(changes: SimpleChanges): void; setOrder(order: DropdownSelectItem<any>): void; setName(name: DropdownSelectItem<any>): void; onChange: (value: { sort: SortOption; names?: NameItem[]; }) => void; onTouched: () => void; writeValue(value: { sort: SortOption; names?: NameItem[]; }): void; registerOnChange(onChange: any): void; registerOnTouched(onTouched: any): void; setDisabledState(disabled: boolean): void; onAdd(): void; onRemove(): void; static ɵfac: i0.ɵɵFactoryDeclaration<SortingOptionComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<SortingOptionComponent, "obl-sorting-option", never, { "option": { "alias": "option"; "required": false; }; "names": { "alias": "names"; "required": false; }; "translations": { "alias": "translations"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "labelAnimation": { "alias": "labelAnimation"; "required": false; }; }, { "changed": "changed"; "nameChanged": "nameChanged"; "orderChanged": "orderChanged"; "add": "add"; "remove": "remove"; }, never, never, false, never>; } declare class SortComponent implements ControlValueAccessor { protected change: ChangeDetectorRef; private readonly globalSettings; protected touchedDragBar: boolean; protected settingsItems: DropdownSelectItem<SortOption>[]; protected errors: { [key: string]: { [key: string]: boolean; } | null; }; /** define if list is opened */ isOpen: boolean; /** define if element is touched */ touched: boolean; names: NameItem[]; options: SortOption[]; translations: { [en: string]: string; }; settings?: { [name: string]: SortOption[]; }; input?: { [key: string]: any; }[]; disabled: boolean; /** * Enable type text animation for label */ labelAnimation: boolean; settingsChanged: EventEmitter<{ [name: string]: SortOption[]; }>; output: EventEmitter<{ [key: string]: any; }[]>; changed: EventEmitter<SortOption[]>; selected?: DropdownSelectComponent; settingsName?: ElementRef<HTMLInputElement>; protected available: NameItem[]; constructor(change: ChangeDetectorRef, globalSettings: InputWrappersDefaultSettingsService); ngOnChanges(changes: SimpleChanges): void; toggle(event: any, touched?: boolean): void; close(touched?: boolean): void; open(): void; checkSettingSelection(): void; onTouchedDragBar(touched: boolean, element: any): void; add(option: SortOption): void; remove(option: SortOption): void; drop(event: CdkDragDrop<SortOption[]>): void; setAvailable(): void; sort(): void; onChange: (value: { sort: SortOption[]; names?: NameItem[]; }) => void; onTouched: () => void; writeValue(value: { sort: SortOption[]; names?: NameItem[]; }): void; changedOption(option: SortOption, index: number): void; registerOnChange(onChange: any): void; registerOnTouched(onTouched: any): void; setDisabledState(disabled: boolean): void; protected setSettings(item: DropdownSelectItem<SortOption[]>): void; check(): void; onChanged(): void; saveSettings(input: HTMLInputElement): void; protected removeSettings(name?: string | number): void; protected updateSettingsItems(): void; static ɵfac: i0.ɵɵFactoryDeclaration<SortComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<SortComponent, "obl-sort", never, { "names": { "alias": "names"; "required": false; }; "options": { "alias": "options"; "required": false; }; "translations": { "alias": "translations"; "required": false; }; "settings": { "alias": "settings"; "required": false; }; "input": { "alias": "input"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "labelAnimation": { "alias": "labelAnimation"; "required": false; }; }, { "settingsChanged": "settingsChanged"; "output": "output"; "changed": "changed"; }, never, never, false, never>; } declare class TableSortComponent { sortName: string; sortOrder?: 'ASC' | 'DESC'; position: number; sort: SortOption[]; changed: EventEmitter<SortOption[]>; order(): "↑" | "↓" | " "; ngOnChanges(changes: SimpleChanges): void; set(): void; change(): void; switchPos(event: MouseEvent): void; static ɵfac: i0.ɵɵFactoryDeclaration<TableSortComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<TableSortComponent, "thead td[obl-table-sort]", never, { "sortName": { "alias": "sortName"; "required": true; }; "sort": { "alias": "sort"; "required": false; }; }, { "changed": "changed"; }, never, ["*"], false, never>; } declare class SortingModule { static ɵfac: i0.ɵɵFactoryDeclaration<SortingModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<SortingModule, [typeof SortingOptionComponent, typeof SortComponent, typeof TableSortComponent], [typeof i4.CommonModule, typeof i5.OverlayModule, typeof i6.DragDropModule, typeof i7.DropdownSelectModule, typeof i8.ButtonsModule, typeof i9.TextPipesModule, typeof i10.InputModule, typeof i11.BadgeDirective], [typeof SortingOptionComponent, typeof SortComponent, typeof TableSortComponent]>; static ɵinj: i0.ɵɵInjectorDeclaration<SortingModule>; } export { SortComponent, SortingModule, SortingOptionComponent, TableSortComponent }; export type { NameItem, SortOption };