UNPKG

@c8y/ngx-components

Version:

Angular modules for Cumulocity IoT applications

130 lines (122 loc) 5.83 kB
import * as i0 from '@angular/core'; import { EventEmitter, PipeTransform } from '@angular/core'; import * as i1 from '@c8y/ngx-components'; import { GainsightService } from '@c8y/ngx-components'; import * as i2 from '@angular/forms'; import { ControlValueAccessor } from '@angular/forms'; import * as i3 from 'ngx-bootstrap/tooltip'; import { Observable, BehaviorSubject } from 'rxjs'; import { DefaultIconDefinition } from '@c8y/ngx-components/icon-selector/model'; import { SupportedIconsSuggestions } from '@c8y/ngx-components/icon-selector/icons'; import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal'; declare class IconSelectorComponent { iconCategoriesToExclude: string[]; showIconClass: boolean; onSelect: EventEmitter<string>; selectedIcon: SupportedIconsSuggestions; icons$: Observable<DefaultIconDefinition[]>; filteredIcons$: Observable<DefaultIconDefinition[]>; searchTerm$: BehaviorSubject<string>; selectedIconCategory$: BehaviorSubject<string>; availableIconCategories$: Observable<string[]>; constructor(); loadIconDefinitions(): Promise<DefaultIconDefinition[]>; filterIconsByCategoryAndSearchTerm(iconCategories: DefaultIconDefinition[], selectedCategory: string, searchTerm: string): DefaultIconDefinition[]; onSearchChange(searchTerm: string): void; onCategoryFilterChanged(categoryChange: string): void; onIconClicked(icon: ReadonlyArray<string>): void; static ɵfac: i0.ɵɵFactoryDeclaration<IconSelectorComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<IconSelectorComponent, "c8y-icon-selector", never, { "iconCategoriesToExclude": { "alias": "iconCategoriesToExclude"; "required": false; }; "showIconClass": { "alias": "showIconClass"; "required": false; }; "selectedIcon": { "alias": "selectedIcon"; "required": false; }; }, { "onSelect": "onSelect"; }, never, never, true, never>; } declare class IconSelectorModalComponent { private bsModal; title: string; currentSelection: string; saveButtonLabel: string; iconCategoriesToExclude: string[]; showIconClass: boolean; readonly result: Promise<string>; private save; private cancel; constructor(bsModal: BsModalRef); close(): void; saveChanges(): void; selectionChange(newSelection: string): void; static ɵfac: i0.ɵɵFactoryDeclaration<IconSelectorModalComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<IconSelectorModalComponent, "c8y-icon-selector-modal", never, {}, {}, never, never, true, never>; } declare class IconNamePipe implements PipeTransform { transform(icon: string): string; static ɵfac: i0.ɵɵFactoryDeclaration<IconNamePipe, never>; static ɵpipe: i0.ɵɵPipeDeclaration<IconNamePipe, "iconName", true>; } declare class IconSelectorService { protected modal: BsModalService; constructor(modal: BsModalService); selectIcon(initialState?: Partial<Pick<IconSelectorModalComponent, 'currentSelection' | 'title' | 'saveButtonLabel' | 'iconCategoriesToExclude' | 'showIconClass'>>): Promise<string>; static ɵfac: i0.ɵɵFactoryDeclaration<IconSelectorService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<IconSelectorService>; } /** * A component which acts as a wrapper for the icon selector. * * Example 1: * ``` <c8y-icon-selector-wrapper [selectedIcon]="'water'" (onSelect)="selectIcon($event)" ></c8y-icon-selector-wrapper> * ``` * OR as a part of a formGroup * Example 2: * ``` <c8y-icon-selector-wrapper name="icon" formControlName="icon"> </c8y-icon-selector-wrapper> * ``` */ declare class IconSelectorWrapperComponent implements ControlValueAccessor { private iconSelector; private gainsightService; canRemoveIcon: boolean; selectedIcon: string; /** * The displayed icon size, the value has to be multiple of 8. */ iconSize: number; onSelect: EventEmitter<string>; /** * @ignore */ onTouched: () => void; constructor(iconSelector: IconSelectorService, gainsightService: GainsightService); /** * @ignore */ onChange: (value: string) => void; /** * @ignore * @param icon The value to update */ writeValue(icon: string): void; /** * @ignore * @param fn The function to register for changes */ registerOnChange(fn: () => void): void; /** * @ignore * @param fn The function to register for changes */ registerOnTouched(fn: () => void): void; removeIcon(): void; openIconSelector(): Promise<void>; static ɵfac: i0.ɵɵFactoryDeclaration<IconSelectorWrapperComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<IconSelectorWrapperComponent, "c8y-icon-selector-wrapper", never, { "canRemoveIcon": { "alias": "canRemoveIcon"; "required": false; }; "selectedIcon": { "alias": "selectedIcon"; "required": false; }; "iconSize": { "alias": "iconSize"; "required": false; }; }, { "onSelect": "onSelect"; }, never, never, true, never>; } declare class IconSelectorModule { static ɵfac: i0.ɵɵFactoryDeclaration<IconSelectorModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<IconSelectorModule, never, [typeof i1.CommonModule, typeof i2.FormsModule, typeof i1.DropAreaModule, typeof i3.TooltipModule, typeof IconSelectorComponent, typeof IconSelectorModalComponent, typeof IconNamePipe, typeof IconSelectorWrapperComponent], [typeof IconSelectorComponent, typeof IconSelectorModalComponent, typeof IconNamePipe, typeof IconSelectorWrapperComponent]>; static ɵinj: i0.ɵɵInjectorDeclaration<IconSelectorModule>; } export { IconNamePipe, IconSelectorComponent, IconSelectorModalComponent, IconSelectorModule, IconSelectorService, IconSelectorWrapperComponent }; //# sourceMappingURL=index.d.ts.map