@progress/kendo-angular-inputs
Version:
Kendo UI for Angular Inputs Package - Everything you need to build professional form functionality (Checkbox, ColorGradient, ColorPalette, ColorPicker, FlatColorPicker, FormField, MaskedTextBox, NumericTextBox, RadioButton, RangeSlider, Slider, Switch, Te
56 lines (55 loc) • 1.65 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
/**
* Fires when you click the left side of the ColorPicker wrapper.
* The event triggers whether you set a ColorPicker icon or not.
*
* Provides information about the current active color and lets you prevent the popup from opening.
*
* @example
* ```typescript
* @Component({
* selector: 'my-app',
* template: `
* <kendo-colorpicker
* [icon]="'edit-tools'"
* [value]="'#900'"
* (activeColorClick)="onColorClick($event)"
* >
* </kendo-colorpicker>
* `
* })
* class AppComponent {
* public onColorClick(event: ActiveColorClickEvent): void {
* event.preventOpen();
* }
* }
* ```
*/
export class ActiveColorClickEvent {
color;
openPrevented = false;
/**
* @hidden
* @param color Represents the current value of the ColorPicker.
*/
constructor(color) {
this.color = color;
}
/**
* Prevents the popup from opening.
*/
preventOpen() {
this.openPrevented = true;
}
/**
* Returns `true` if the popup opening is prevented by any of its subscribers.
*
* @returns Returns `true` if the open action was prevented. Otherwise, returns `false`.
*/
isOpenPrevented() {
return this.openPrevented;
}
}