@nova-ui/bits
Version:
SolarWinds Nova Framework
57 lines (56 loc) • 2.59 kB
TypeScript
import { Overlay, OverlayConfig } from "@angular/cdk/overlay";
import { AfterViewInit, ChangeDetectorRef, OnChanges, OnDestroy, SimpleChanges } from "@angular/core";
import { ControlValueAccessor } from "@angular/forms";
import { ColorService } from "./color.service";
import { IPaletteColor } from "./../../constants/color-picker.constants";
import { IOptionValueObject, NuiFormFieldControl, OverlayUtilitiesService } from "../public-api";
import { SelectV2Component } from "../select-v2/select/select-v2.component";
import * as i0 from "@angular/core";
export declare class ColorPickerComponent implements NuiFormFieldControl, ControlValueAccessor, OnChanges, AfterViewInit, OnDestroy {
protected changeDetection: ChangeDetectorRef;
private colorService;
private cdkOverlay;
/**
* Colors to be displayed as array of strings
*/
colors: string[];
/**
* Color pallete which should be displayed
*/
colorPalette: IPaletteColor[];
/**
* Number of columns in the color picker
*/
cols: number | undefined;
/**
* Determine if the color picket should be displayed as select
*/
isSelect: boolean | undefined;
select: SelectV2Component;
overlayConfig: OverlayConfig;
value: string | IOptionValueObject;
defaultColor: string;
maxWidth: string;
palette: Partial<IPaletteColor[]>;
isBlackTick: boolean;
isInErrorState: boolean;
ariaLabel?: string | undefined;
protected overlayUtilities: OverlayUtilitiesService;
private selectResizeObserver;
private destroy$;
constructor(changeDetection: ChangeDetectorRef, colorService: ColorService, cdkOverlay: Overlay);
ngOnChanges(changes: SimpleChanges): void;
ngAfterViewInit(): void;
ngOnDestroy(): void;
onChange(value: any): void;
_onTouched(): void;
writeValue(value: string | IOptionValueObject): void;
registerOnChange(fn: () => void): void;
registerOnTouched(fn: () => void): void;
setStyles: (color: string) => Record<string, any>;
determineBlackTick(color: string): boolean;
private initOverlayUtilities;
private getContrastOnBgColor;
static ɵfac: i0.ɵɵFactoryDeclaration<ColorPickerComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<ColorPickerComponent, "nui-color-picker", never, { "colors": { "alias": "colors"; "required": false; }; "colorPalette": { "alias": "colorPalette"; "required": false; }; "cols": { "alias": "cols"; "required": false; }; "isSelect": { "alias": "isSelect"; "required": false; }; }, {}, never, never, false, never>;
}