@progress/kendo-angular-spreadsheet
Version:
A Spreadsheet Component for Angular
32 lines (31 loc) • 1.35 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { SpreadsheetCommandBaseDirective } from './spreadsheet-command-base';
/**
* @hidden
*/
export class SpreadsheetCommandButton extends SpreadsheetCommandBaseDirective {
command;
button;
localization;
spreadsheetService;
toolsService;
commandOptions;
constructor(command, button, localization, spreadsheetService, toolsService, commandOptions) {
super(command, button, localization, spreadsheetService, toolsService);
this.command = command;
this.button = button;
this.localization = localization;
this.spreadsheetService = spreadsheetService;
this.toolsService = toolsService;
this.commandOptions = commandOptions;
}
clickHandler() {
if (this.commandOptions.command === 'PropertyChangeCommand') {
this.commandOptions.options.value = !this.toolsService.toolsState[this.command];
}
this.spreadsheetService.spreadsheet.executeCommand(this.commandOptions);
}
}