import { Component, Input, TemplateRef } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "../quadrant-label/quadrant-label.component";
export class QuadrantRegionComponent {
    constructor() { }
    ngOnChanges(changes) {
        if (changes && (changes['axisConfigs'] || changes['view'])) {
            this.drawQuadrantRegion();
        }
    }
    ngOnInit() {
        this.drawQuadrantRegion();
    }
    drawQuadrantRegion() {
        if (this.view && this.view.height) {
            this.quadrantHeight = (this.view.height - this.axisConfigs.axisMargin - this.axisConfigs.originPosition.bottom) / 2;
        }
        if (this.view && this.view.width) {
            this.quadrantWidth = (this.view.width - this.axisConfigs.axisMargin - this.axisConfigs.originPosition.left) / 2;
        }
    }
    getQuadrantTopValue(index) {
        let height = 0;
        if (index + 1 === 3 || index + 1 === 4) {
            height = this.quadrantHeight;
        }
        return this.axisConfigs.axisMargin + height;
    }
    getQuadrantLeftValue(index) {
        let width = 0;
        if (index + 1 === 1 || index + 1 === 4) {
            width = this.quadrantWidth;
        }
        return this.axisConfigs.originPosition.left + width;
    }
}
QuadrantRegionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: QuadrantRegionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
QuadrantRegionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: QuadrantRegionComponent, selector: "d-quadrant-region", inputs: { quadrantConfigs: "quadrantConfigs", axisConfigs: "axisConfigs", view: "view", labelData: "labelData", normalLabelTemplate: "normalLabelTemplate", largeLabelTemplate: "largeLabelTemplate", smallLabelTemplate: "smallLabelTemplate", currentLabelSize: "currentLabelSize", showQuadrants: "showQuadrants", dropScope: "dropScope", diagramId: "diagramId" }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"showQuadrants\">\n  <div\n    *ngFor=\"let item of quadrantConfigs; let i = index\"\n    class=\"devui-quadrant-region devui-quadrant-region-{{ i + 1 }}\"\n    [style.background-color]=\"item?.backgroundColor\"\n    [style.height.px]=\"quadrantHeight\"\n    [style.width.px]=\"quadrantWidth\"\n    [style.top.px]=\"getQuadrantTopValue(i)\"\n    [style.left.px]=\"getQuadrantLeftValue(i)\"\n  >\n    <div class=\"devui-quadrant-title\" [style.color]=\"item?.color\">\n      <span>{{ item?.title }}</span>\n    </div>\n  </div>\n</ng-container>\n<d-quadrant-label\n  [currentLabelSize]=\"currentLabelSize\"\n  [labelData]=\"labelData\"\n  [axisConfigs]=\"axisConfigs\"\n  [view]=\"view\"\n  [dropScope]=\"dropScope\"\n  [diagramId]=\"diagramId\"\n></d-quadrant-label>\n", styles: [".devui-font-size-base{font-size:12px;font-size:var(--devui-font-size, 12px)}.devui-font-base{font-size:12px;font-size:var(--devui-font-size, 12px);font-weight:400;line-height:1.5}.devui-font-size-modal-title{font-size:18px;font-size:var(--devui-font-size-modal-title, 18px)}.devui-font-modal-title{font-size:18px;font-size:var(--devui-font-size-modal-title, 18px);font-weight:700;line-height:1.5}.devui-font-size-page-title{font-size:16px;font-size:var(--devui-font-size-page-title, 16px)}.devui-font-page-title{font-size:16px;font-size:var(--devui-font-size-page-title, 16px);font-weight:700;line-height:1.5}.devui-font-size-secondary-title{font-size:14px;font-size:var(--devui-font-size-card-title, 14px)}.devui-font-secondary-title{font-size:14px;font-size:var(--devui-font-size-card-title, 14px);font-weight:700;line-height:1.5}.devui-quadrant-region{position:absolute}.devui-quadrant-title{font-size:24px;font-size:var(--devui-font-size-data-overview, 24px);line-height:32px;margin:20px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.devui-quadrant-title span{display:block}.devui-quadrant-region-1{background:rgba(246,111,106,.04);border-bottom:1px solid #f2f2f3;border-bottom:1px solid var(--devui-dividing-line, #f2f2f3);border-left:1px solid #f2f2f3;border-left:1px solid var(--devui-dividing-line, #f2f2f3)}.devui-quadrant-region-1 .devui-quadrant-title{color:#f66f6a4d}.devui-quadrant-region-2{background:rgba(250,194,10,.04);border-bottom:1px solid #f2f2f3;border-bottom:1px solid var(--devui-dividing-line, #f2f2f3)}.devui-quadrant-region-2 .devui-quadrant-title{color:#fac20a4d}.devui-quadrant-region-3{background:rgba(80,212,171,.04)}.devui-quadrant-region-3 .devui-quadrant-title{color:#50d4ab4d}.devui-quadrant-region-4{background:rgba(81,112,255,.04);border-left:1px solid #f2f2f3;border-left:1px solid var(--devui-dividing-line, #f2f2f3)}.devui-quadrant-region-4 .devui-quadrant-title{color:#5170ff4d}\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.QuadrantLabelComponent, selector: "d-quadrant-label", inputs: ["currentLabelSize", "labelData", "axisConfigs", "view", "normalLabelTemplate", "largeLabelTemplate", "smallLabelTemplate", "dropScope", "diagramId"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: QuadrantRegionComponent, decorators: [{
            type: Component,
            args: [{ selector: 'd-quadrant-region', template: "<ng-container *ngIf=\"showQuadrants\">\n  <div\n    *ngFor=\"let item of quadrantConfigs; let i = index\"\n    class=\"devui-quadrant-region devui-quadrant-region-{{ i + 1 }}\"\n    [style.background-color]=\"item?.backgroundColor\"\n    [style.height.px]=\"quadrantHeight\"\n    [style.width.px]=\"quadrantWidth\"\n    [style.top.px]=\"getQuadrantTopValue(i)\"\n    [style.left.px]=\"getQuadrantLeftValue(i)\"\n  >\n    <div class=\"devui-quadrant-title\" [style.color]=\"item?.color\">\n      <span>{{ item?.title }}</span>\n    </div>\n  </div>\n</ng-container>\n<d-quadrant-label\n  [currentLabelSize]=\"currentLabelSize\"\n  [labelData]=\"labelData\"\n  [axisConfigs]=\"axisConfigs\"\n  [view]=\"view\"\n  [dropScope]=\"dropScope\"\n  [diagramId]=\"diagramId\"\n></d-quadrant-label>\n", styles: [".devui-font-size-base{font-size:12px;font-size:var(--devui-font-size, 12px)}.devui-font-base{font-size:12px;font-size:var(--devui-font-size, 12px);font-weight:400;line-height:1.5}.devui-font-size-modal-title{font-size:18px;font-size:var(--devui-font-size-modal-title, 18px)}.devui-font-modal-title{font-size:18px;font-size:var(--devui-font-size-modal-title, 18px);font-weight:700;line-height:1.5}.devui-font-size-page-title{font-size:16px;font-size:var(--devui-font-size-page-title, 16px)}.devui-font-page-title{font-size:16px;font-size:var(--devui-font-size-page-title, 16px);font-weight:700;line-height:1.5}.devui-font-size-secondary-title{font-size:14px;font-size:var(--devui-font-size-card-title, 14px)}.devui-font-secondary-title{font-size:14px;font-size:var(--devui-font-size-card-title, 14px);font-weight:700;line-height:1.5}.devui-quadrant-region{position:absolute}.devui-quadrant-title{font-size:24px;font-size:var(--devui-font-size-data-overview, 24px);line-height:32px;margin:20px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.devui-quadrant-title span{display:block}.devui-quadrant-region-1{background:rgba(246,111,106,.04);border-bottom:1px solid #f2f2f3;border-bottom:1px solid var(--devui-dividing-line, #f2f2f3);border-left:1px solid #f2f2f3;border-left:1px solid var(--devui-dividing-line, #f2f2f3)}.devui-quadrant-region-1 .devui-quadrant-title{color:#f66f6a4d}.devui-quadrant-region-2{background:rgba(250,194,10,.04);border-bottom:1px solid #f2f2f3;border-bottom:1px solid var(--devui-dividing-line, #f2f2f3)}.devui-quadrant-region-2 .devui-quadrant-title{color:#fac20a4d}.devui-quadrant-region-3{background:rgba(80,212,171,.04)}.devui-quadrant-region-3 .devui-quadrant-title{color:#50d4ab4d}.devui-quadrant-region-4{background:rgba(81,112,255,.04);border-left:1px solid #f2f2f3;border-left:1px solid var(--devui-dividing-line, #f2f2f3)}.devui-quadrant-region-4 .devui-quadrant-title{color:#5170ff4d}\n"] }]
        }], ctorParameters: function () { return []; }, propDecorators: { quadrantConfigs: [{
                type: Input
            }], axisConfigs: [{
                type: Input
            }], view: [{
                type: Input
            }], labelData: [{
                type: Input
            }], normalLabelTemplate: [{
                type: Input
            }], largeLabelTemplate: [{
                type: Input
            }], smallLabelTemplate: [{
                type: Input
            }], currentLabelSize: [{
                type: Input
            }], showQuadrants: [{
                type: Input
            }], dropScope: [{
                type: Input
            }], diagramId: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 