nxt-color-picker
Version:
Color picker widget for Angular
100 lines (99 loc) • 3.76 kB
TypeScript
import { AfterViewChecked, ChangeDetectorRef, ElementRef, OnDestroy, OnInit } from '@angular/core';
import { Cmyk, Hsla, Rgba } from '../../util/formats';
import { ColorModeInternal, CursorEvent, DialogConfig, SliderPosition, TextEvent } from '../../util/helpers';
import { AlphaChannel, ColorFormat, DialogDisplay, OutputFormat } from '../../util/types';
import { ColorPickerService } from '../color-picker.service';
import * as i0 from "@angular/core";
/**
* @internal
*/
export declare class ColorPickerComponent implements OnInit, OnDestroy, AfterViewChecked {
private elRef;
private cdRef;
private service;
readonly colorModeInternal: typeof ColorModeInternal;
private hsva?;
private cmyk?;
private cmykColor;
private outputColor;
private initialColor;
private fallbackColor?;
private sliderH?;
private dialogInputFields;
private callbacks?;
show: boolean;
format: ColorFormat;
slider?: SliderPosition;
hexText?: string;
hexAlpha?: number;
cmykText?: Cmyk;
hslaText?: Hsla;
rgbaText?: Rgba;
selectedColor: string;
hueSliderColor?: string;
alphaSliderColor?: string;
svSliderLight: boolean;
hueSliderLight: boolean;
valueSliderLight: boolean;
alphaSliderLight: boolean;
width?: string;
height?: string;
mode: ColorModeInternal;
cmykEnabled: boolean;
alphaChannel: AlphaChannel;
outputFormat: OutputFormat;
disableInput: boolean;
dialogDisplay?: DialogDisplay;
ignoredElements?: any[];
saveClickOutside: boolean;
closeClickOutside: boolean;
okButton: boolean;
cancelButton: boolean;
presetLabel: boolean | string;
presetColors?: string[];
maxPresetColors?: number;
presetColorsEditable: boolean;
constructor(elRef: ElementRef, cdRef: ChangeDetectorRef, service: ColorPickerService);
onCancel(event: Event): void;
onAccept(event: Event): void;
onFocusChange(event: MouseEvent | FocusEvent): void;
ngOnInit(): void;
ngOnDestroy(): void;
ngAfterViewChecked(): void;
openDialog(color: any, emit?: boolean): void;
closeDialog(): void;
setupDialog(config: DialogConfig): void;
setInitialColor(color: string): void;
setPresetConfig(presetLabel: boolean | string, presetColors?: string[]): void;
setColorFromString(value: string, emit?: boolean, update?: boolean): void;
stringToRgba(value: string): string | undefined;
onDragEnd(slider: string): void;
onDragStart(slider: string): void;
onFormatToggle(change: number): void;
onColorChange(value: CursorEvent): void;
onHueChange(value: CursorEvent): void;
onValueChange(value: CursorEvent): void;
onAlphaChange(value: CursorEvent): void;
onHexInput(value?: TextEvent): void;
onRedInput(value: TextEvent): void;
onBlueInput(value: TextEvent): void;
onGreenInput(value: TextEvent): void;
onHueInput(value: TextEvent): void;
onValueInput(value: TextEvent): void;
onAlphaInput(value: TextEvent): void;
onLightnessInput(value: TextEvent): void;
onSaturationInput(value: TextEvent): void;
onCyanInput(value: TextEvent): void;
onMagentaInput(value: TextEvent): void;
onYellowInput(value: TextEvent): void;
onBlackInput(value: TextEvent): void;
onAddPresetColor(value: string): void;
onRemovePresetColor(value: string): void;
private openColorPicker;
private closeColorPicker;
private updateColorPicker;
fill(n: number): any[];
formatAlpha(a?: number): string | undefined;
static ɵfac: i0.ɵɵFactoryDeclaration<ColorPickerComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<ColorPickerComponent, "nxt-color-picker", never, {}, {}, never, never, false, never>;
}