UNPKG

ngx-input-color

Version:

Angular color input component and color picker (with HSL, HSV, RGB, CMYK, HEX, alpha, eye-dropper, etc)

81 lines (80 loc) 2.84 kB
import { ChangeDetectorRef, EventEmitter, OnDestroy, OnInit } from '@angular/core'; import { ColorFormats } from '../../models/ColorFormats.enum'; import { NgxColor, OutputType } from '../../utils/color-helper'; import { AbstractControl, ControlValueAccessor, ValidationErrors, Validator } from '@angular/forms'; import { ColorInspector } from '../../models/ColorInspector.enum'; import * as i0 from "@angular/core"; export declare class NgxInputColorComponent implements OnInit, OnDestroy, ControlValueAccessor, Validator { private cd; theme: 'light' | 'dark' | 'auto'; set setTheme(val: 'light' | 'dark' | 'auto'); /** Minifi UI */ simpleMode: boolean; outputType: OutputType; /** * default inspectors * - ColorInspector.Picker * - ColorInspector.RGB * - ColorInspector.HSL * * @alias defaultInspector */ defaultInspector: ColorInspector; /** Emitted when the color value changes */ change: EventEmitter<string>; /** @ignore */ format: ColorFormats; /** @ignore */ isDarkColor: boolean; /** @ignore */ rgbaColor: string; /** @ignore */ hexColor: string; outputColor: string; /** @ignore */ name: string; /** @ignore */ isSupportedEyeDrop: boolean; /** @ignore */ color: NgxColor; /** @ignore */ isDisabled: boolean; /**@ignore */ private _onChange; /**@ignore */ private _onTouched; /**@ignore */ private _onValidateChange; constructor(cd: ChangeDetectorRef); /** @ignore */ ngOnInit(): void; /** @ignore */ ngOnDestroy(): void; get ColorFormats(): typeof ColorFormats; get ColorInspector(): typeof ColorInspector; /** @ignore */ registerOnChange(fn: any): void; /** @ignore */ registerOnTouched(fn: any): void; /** @ignore */ setDisabledState(disabled: boolean): void; /** @ignore */ registerOnValidatorChange(fn: () => void): void; /** @ignore */ validate(control: AbstractControl): ValidationErrors | null; /** @ignore */ writeValue(value: any): void; /** @ignore */ openEyeDrop(): void; /** * call from directive /* @ignore */ initColor(c?: NgxColor): Promise<void>; /** @ignore */ stopPropagation(ev: Event): void; /** @ignore */ emitChange(): Promise<void>; static ɵfac: i0.ɵɵFactoryDeclaration<NgxInputColorComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<NgxInputColorComponent, "ngx-input-color", never, { "setTheme": { "alias": "theme"; "required": false; }; "simpleMode": { "alias": "simpleMode"; "required": false; }; "outputType": { "alias": "outputType"; "required": false; }; "defaultInspector": { "alias": "defaultInspector"; "required": false; }; }, { "change": "change"; }, never, never, false, never>; }