UNPKG

@obliczeniowo/elementary

Version:
88 lines (83 loc) 4.12 kB
import * as i0 from '@angular/core'; import { OnInit, AfterViewInit, EventEmitter, ElementRef } from '@angular/core'; import { ColorRGB } from '@obliczeniowo/elementary/classes'; import * as i4 from '@angular/forms'; import { ControlValueAccessor } from '@angular/forms'; import * as i3 from '@angular/common'; import * as i5 from '@angular/cdk/overlay'; import * as i6 from '@obliczeniowo/elementary/input'; import * as i7 from '@obliczeniowo/elementary/buttons'; interface ColorTranslations { red: string; green: string; blue: string; alpha: string; } declare class ColorComponent implements OnInit, AfterViewInit { private readonly elementRef; colorsCanvas: HTMLCanvasElement; colorBlue: HTMLCanvasElement; colorAlpha: HTMLCanvasElement; colorsCtx: CanvasRenderingContext2D; colorBlueCtx: CanvasRenderingContext2D; colorAlphaCtx: CanvasRenderingContext2D; colorsBitmap: ImageData; chosenColor: ColorRGB; inputBorder: i0.InputSignal<"outlined" | "underlined" | "none">; changed: EventEmitter<ColorRGB>; transparentImage: HTMLImageElement; pointer: HTMLDivElement; translations: ColorTranslations; constructor(elementRef: ElementRef<HTMLElement>); ngOnInit(): void; ngAfterViewInit(): void; valueChanged(event: any, value: string, emit?: boolean): void; redrawAll(): void; redrawColorsMap(): void; redrawBlueGradientMap(): void; refreshAlphaGradient(): void; colorsMapClicked(event: any): void; blueMapClicked(event: any): void; alphaMapClicked(event: any): void; input(event: any, field: string): void; static ɵfac: i0.ɵɵFactoryDeclaration<ColorComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<ColorComponent, "obl-color", never, { "chosenColor": { "alias": "chosenColor"; "required": false; }; "inputBorder": { "alias": "inputBorder"; "required": false; "isSignal": true; }; "translations": { "alias": "translations"; "required": false; }; }, { "changed": "changed"; }, never, ["*"], false, never>; } interface ColorPickerTranslations extends ColorTranslations { set: string; cancel: string; } type PickerColor = ColorRGB | { r: string | number; g: string | number; b: string | number; a: string | number; }; declare class ColorPickerControlComponent implements ControlValueAccessor { private pChosenColor; isOpen: boolean; translations: i0.InputSignal<ColorPickerTranslations>; set chosenColor(chosenColor: PickerColor); inputBorder: i0.InputSignal<"outlined" | "underlined" | "none">; buttonPos: ElementRef<HTMLElement>; colorComponent: ColorComponent; changed: EventEmitter<ColorRGB>; onChange: (value: ColorRGB | undefined) => void; onTouched: () => void; registerOnValidatorChange(fn: () => void): void; writeValue(set?: ColorRGB): void; registerOnChange(onChange: any): void; registerOnTouched(onTouched: any): void; save(): void; toggle(): void; color(): string; static ɵfac: i0.ɵɵFactoryDeclaration<ColorPickerControlComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<ColorPickerControlComponent, "obl-color-picker-control", never, { "translations": { "alias": "translations"; "required": false; "isSignal": true; }; "chosenColor": { "alias": "chosenColor"; "required": false; }; "inputBorder": { "alias": "inputBorder"; "required": false; "isSignal": true; }; }, { "changed": "changed"; }, never, never, false, never>; } declare class ColorPickerModule { static ɵfac: i0.ɵɵFactoryDeclaration<ColorPickerModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<ColorPickerModule, [typeof ColorComponent, typeof ColorPickerControlComponent], [typeof i3.CommonModule, typeof i4.FormsModule, typeof i5.OverlayModule, typeof i6.InputModule, typeof i7.ButtonsModule], [typeof ColorComponent, typeof ColorPickerControlComponent]>; static ɵinj: i0.ɵɵInjectorDeclaration<ColorPickerModule>; } export { ColorComponent, ColorPickerControlComponent, ColorPickerModule }; export type { ColorPickerTranslations, ColorTranslations, PickerColor };