import { __decorate } from "tslib";
import { Component, Input } from '@angular/core';
import { NEVER } from 'rxjs';
import { MonitoringAppGenComponent } from '../../metadata/decorators';
import { GaugeCardComponent } from '../gauge-card/gauge-card.component';
import * as i0 from "@angular/core";
import * as i1 from "@swimlane/ngx-charts";
import * as i2 from "@angular/common";
import * as i3 from "@ionic/angular";
import * as i4 from "../../ui-directive/export-data.directive";
function TapVariableGaugeComponent_ion_fab_button_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "ion-fab-button", 4);
    i0.ɵɵelement(1, "ion-icon", 5);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("dataToExport", ctx_r1.results)("exportedFileName", ctx_r1.exportedFileName);
} }
let TapVariableGaugeComponent = class TapVariableGaugeComponent extends GaugeCardComponent {
    set variable(v) {
        if (v) {
            this.inputStream = v.values;
        }
        else {
            this.inputStream = NEVER;
        }
    }
};
/** @nocollapse */ TapVariableGaugeComponent.ɵfac = function TapVariableGaugeComponent_Factory(t) { return ɵTapVariableGaugeComponent_BaseFactory(t || TapVariableGaugeComponent); };
/** @nocollapse */ TapVariableGaugeComponent.ɵcmp = i0.ɵɵdefineComponent({ type: TapVariableGaugeComponent, selectors: [["tap-variable-gauge"]], inputs: { variable: "variable" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 4, vars: 15, consts: [[1, "chart-container", 2, "position", "relative"], [3, "scheme", "results", "min", "max", "angleSpan", "startAngle", "units", "bigSegments", "smallSegments", "legend", "legendTitle", "valueFormatting", "showText", "view", "select"], ["ngxChartsGauge", ""], ["id", "exportFabButton", "size", "small", "tapExportData", "", 3, "dataToExport", "exportedFileName", 4, "ngIf"], ["id", "exportFabButton", "size", "small", "tapExportData", "", 3, "dataToExport", "exportedFileName"], ["name", "download"]], template: function TapVariableGaugeComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "div", 0);
        i0.ɵɵelementStart(1, "ngx-charts-gauge", 1, 2);
        i0.ɵɵlistener("select", function TapVariableGaugeComponent_Template_ngx_charts_gauge_select_1_listener($event) { return ctx.onSelect($event); });
        i0.ɵɵelementEnd();
        i0.ɵɵtemplate(3, TapVariableGaugeComponent_ion_fab_button_3_Template, 2, 2, "ion-fab-button", 3);
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("scheme", ctx.colorScheme)("results", ctx.results)("min", ctx.min)("max", ctx.max)("angleSpan", ctx.angleSpan)("startAngle", ctx.startAngle)("units", ctx.units)("bigSegments", ctx.bigSegments)("smallSegments", ctx.smallSegments)("legend", ctx.legend)("legendTitle", ctx.legendTitle)("valueFormatting", ctx.valueFormatting)("showText", ctx.showText && ctx.loaded)("view", ctx.view);
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngIf", ctx.showExportButton);
    } }, directives: [i1.GaugeComponent, i2.NgIf, i3.IonFabButton, i4.ExportDataDirective, i3.IonIcon], styles: [".chart-container[_ngcontent-%COMP%]{display:grid}@media (prefers-color-scheme:dark){  span.legend-label-text{color:#ccc!important}  span.legend-label-text:hover{color:#fff!important}  .ngx-charts text{fill:#fff!important}}#exportFabButton[_ngcontent-%COMP%]{position:absolute;top:10px;right:10px}"] });
TapVariableGaugeComponent = __decorate([
    MonitoringAppGenComponent({
        constraints: {
            isNumber: 'YES',
        },
    })
], TapVariableGaugeComponent);
export { TapVariableGaugeComponent };
const ɵTapVariableGaugeComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(TapVariableGaugeComponent);
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TapVariableGaugeComponent, [{
        type: Component,
        args: [{
                selector: 'tap-variable-gauge',
                templateUrl: '../gauge-card/gauge-card.component.html',
                styleUrls: ['../gauge-card/gauge-card.component.scss'],
            }]
    }], null, { variable: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9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