@progress/kendo-angular-chart-wizard
Version:
Kendo UI Angular Chart Wizard component
72 lines (71 loc) • 3.73 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 { Component, Input } from "@angular/core";
import { StateService } from "./state.service";
import { ActionTypes, createState, mergeStates, updateState } from "./chart-wizard-state";
import { SVGIconComponent } from "@progress/kendo-angular-icons";
import * as i0 from "@angular/core";
import * as i1 from "./state.service";
/**
* @hidden
*/
export class ChartWizardSeriesTypeButtonComponent {
stateService;
title;
chartTypeIcon;
stack = false;
seriesType;
constructor(stateService) {
this.stateService = stateService;
}
onSelect() {
this.stateService.seriesType = this.seriesType;
if (this.stateService.data.length > 0) {
this.stateService.state = mergeStates(this.stateService.state, createState(this.stateService.data, this.stateService.seriesType));
this.stateService.currentSeries = {};
if (this.stack) {
this.stateService.state = updateState(this.stateService.state, ActionTypes.stacked, this.stack);
}
}
this.stateService.dataTab.detectChanges();
}
isSelected() {
return (this.stateService.state.seriesType === this.seriesType &&
this.stateService.state.series[0]?.stack === this.stack);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ChartWizardSeriesTypeButtonComponent, deps: [{ token: i1.StateService }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ChartWizardSeriesTypeButtonComponent, isStandalone: true, selector: "kendo-chartwizard-series-type-button", inputs: { title: "title", chartTypeIcon: "chartTypeIcon", stack: "stack", seriesType: "seriesType" }, ngImport: i0, template: `
<div class="k-icon-text-wrapper" [class.k-selected]="isSelected()" (click)="onSelect()">
<div class="k-icon-background-area">
<kendo-svgicon [icon]="chartTypeIcon" size="xlarge" themeColor="primary"> </kendo-svgicon>
</div>
{{ title }}
</div>
`, isInline: true, dependencies: [{ kind: "component", type: SVGIconComponent, selector: "kendo-svg-icon, kendo-svgicon", inputs: ["icon"], exportAs: ["kendoSVGIcon"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ChartWizardSeriesTypeButtonComponent, decorators: [{
type: Component,
args: [{
selector: 'kendo-chartwizard-series-type-button',
template: `
<div class="k-icon-text-wrapper" [class.k-selected]="isSelected()" (click)="onSelect()">
<div class="k-icon-background-area">
<kendo-svgicon [icon]="chartTypeIcon" size="xlarge" themeColor="primary"> </kendo-svgicon>
</div>
{{ title }}
</div>
`,
standalone: true,
imports: [SVGIconComponent]
}]
}], ctorParameters: function () { return [{ type: i1.StateService }]; }, propDecorators: { title: [{
type: Input
}], chartTypeIcon: [{
type: Input
}], stack: [{
type: Input
}], seriesType: [{
type: Input
}] } });