import { Component, Input } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@ionic/angular";
import * as i3 from "@iotize/app-common";
export class MonitoringActionsComponent {
    constructor() {
        this.segment = true;
        this.actions = [];
        this.disabled = false;
        this.color = 'primary';
    }
    set checkedButtonIndex(index) {
        if (index !== undefined) {
            this.value = this.actions[index]?.value;
        }
    }
}
/** @nocollapse */ MonitoringActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MonitoringActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
/** @nocollapse */ MonitoringActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: MonitoringActionsComponent, selector: "app-monitoring-actions", inputs: { segment: "segment", actions: "actions", checkedButtonIndex: "checkedButtonIndex", disabled: "disabled", color: "color" }, ngImport: i0, template: "<ion-buttons *ngIf=\"!segment\">\n  <ion-button\n    *ngFor=\"let action of actions\"\n    [disabled]=\"disabled || action.disabled\"\n    (click)=\"action.action()\"\n  >\n    <app-common-icon\n      *ngIf=\"action.icon\"\n      [image]=\"action.icon\"\n    ></app-common-icon>\n    {{ action.label }}\n  </ion-button>\n</ion-buttons>\n<ion-segment\n  *ngIf=\"segment\"\n  [value]=\"value\"\n  [scrollable]=\"true\"\n  [color]=\"color\"\n  style=\"overflow: auto; width: 100%\"\n>\n  <ion-segment-button\n    *ngFor=\"let action of actions; let i = index\"\n    [value]=\"action.value\"\n    [disabled]=\"disabled || action.disabled\"\n    (click)=\"action.action()\"\n  >\n    <app-common-icon\n      *ngIf=\"action.icon\"\n      [image]=\"action.icon\"\n    ></app-common-icon>\n    {{ action.label }}\n  </ion-segment-button>\n</ion-segment>\n", styles: [".input-wrapper{position:relative;z-index:9999}ion-buttons{margin-left:0}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i2.IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: i2.IonSegment, selector: "ion-segment", inputs: ["color", "disabled", "mode", "scrollable", "selectOnFocus", "swipeGesture", "value"] }, { kind: "component", type: i2.IonSegmentButton, selector: "ion-segment-button", inputs: ["disabled", "layout", "mode", "type", "value"] }, { kind: "directive", type: i2.SelectValueAccessor, selector: "ion-range, ion-select, ion-radio-group, ion-segment, ion-datetime" }, { kind: "component", type: i3.IconComponent, selector: "app-common-icon", inputs: ["imageSize", "color", "image"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MonitoringActionsComponent, decorators: [{
            type: Component,
            args: [{ selector: 'app-monitoring-actions', template: "<ion-buttons *ngIf=\"!segment\">\n  <ion-button\n    *ngFor=\"let action of actions\"\n    [disabled]=\"disabled || action.disabled\"\n    (click)=\"action.action()\"\n  >\n    <app-common-icon\n      *ngIf=\"action.icon\"\n      [image]=\"action.icon\"\n    ></app-common-icon>\n    {{ action.label }}\n  </ion-button>\n</ion-buttons>\n<ion-segment\n  *ngIf=\"segment\"\n  [value]=\"value\"\n  [scrollable]=\"true\"\n  [color]=\"color\"\n  style=\"overflow: auto; width: 100%\"\n>\n  <ion-segment-button\n    *ngFor=\"let action of actions; let i = index\"\n    [value]=\"action.value\"\n    [disabled]=\"disabled || action.disabled\"\n    (click)=\"action.action()\"\n  >\n    <app-common-icon\n      *ngIf=\"action.icon\"\n      [image]=\"action.icon\"\n    ></app-common-icon>\n    {{ action.label }}\n  </ion-segment-button>\n</ion-segment>\n", styles: [".input-wrapper{position:relative;z-index:9999}ion-buttons{margin-left:0}\n"] }]
        }], ctorParameters: function () { return []; }, propDecorators: { segment: [{
                type: Input
            }], actions: [{
                type: Input
            }], checkedButtonIndex: [{
                type: Input
            }], disabled: [{
                type: Input
            }], color: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9uaXRvcmluZy1hY3Rpb25zLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2lvdGl6ZS1pb25pYy9tb25pdG9yaW5nL3NyYy9saWIvdWktY29tcG9uZW50cy9tb25pdG9yaW5nLWFjdGlvbnMvbW9uaXRvcmluZy1hY3Rpb25zLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2lvdGl6ZS1pb25pYy9tb25pdG9yaW5nL3NyYy9saWIvdWktY29tcG9uZW50cy9tb25pdG9yaW5nLWFjdGlvbnMvbW9uaXRvcmluZy1hY3Rpb25zLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFFLE1BQU0sZUFBZSxDQUFDOzs7OztBQWVqRCxNQUFNLE9BQU8sMEJBQTBCO0lBaUJyQztRQWhCUyxZQUFPLEdBQUcsSUFBSSxDQUFDO1FBRWYsWUFBTyxHQUFpQixFQUFFLENBQUM7UUFVM0IsYUFBUSxHQUFHLEtBQUssQ0FBQztRQUVqQixVQUFLLEdBQVcsU0FBUyxDQUFDO0lBRXBCLENBQUM7SUFWaEIsSUFBYSxrQkFBa0IsQ0FBQyxLQUFhO1FBQzNDLElBQUksS0FBSyxLQUFLLFNBQVMsRUFBRTtZQUN2QixJQUFJLENBQUMsS0FBSyxHQUFHLElBQUksQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDL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