/*
 * Copyright 2015-2024 Ritense BV, the Netherlands.
 *
 * Licensed under EUPL, Version 1.2 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import { Component, Input } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
/**
 * Component used to display a widget element
 */
export class WidgetComponent {
    ngOnInit() {
        this.setCardClassName();
        this.setType();
        this.setAdditionalClasses();
        this.setContrast();
        this.setDivider();
        this.setCollapse();
    }
    toggleContent() {
        if (this.collapseAble) {
            this.isCollapsed = !this.isCollapsed;
        }
    }
    setCardClassName() {
        this.cardClassName = 'card-full-default';
    }
    setType() {
        if (this.type) {
            this.cardClassName = `card-full-${this.type}`;
        }
    }
    setAdditionalClasses() {
        if (this.additionalClasses) {
            this.cardClassName = `${this.cardClassName} ${this.additionalClasses}`;
        }
    }
    setContrast() {
        if (this.contrast) {
            this.contrastClass = 'card-header-contrast';
        }
    }
    setDivider() {
        if (this.divider) {
            this.dividerClass = 'card-header-divider';
        }
    }
    setCollapse() {
        this.isCollapsed = !(this.collapseAble && this.collapse === 'hide');
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: WidgetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: WidgetComponent, selector: "valtimo-widget", inputs: { type: "type", name: "name", icon: "icon", contrast: "contrast", divider: "divider", title: "title", subtitle: "subtitle", collapseAble: "collapseAble", collapse: "collapse", additionalClasses: "additionalClasses" }, ngImport: i0, template: "<!--\n  ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n  ~\n  ~ Licensed under EUPL, Version 1.2 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" basis,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<div class=\"card card-border card-contrast {{ cardClassName }}\">\n  <div class=\"card-header {{ contrastClass }} {{ dividerClass }}\" *ngIf=\"title || subtitle\">\n    <div class=\"row\">\n      <div class=\"col-7\" [ngClass]=\"{clickable: collapseAble}\" (click)=\"toggleContent()\">\n        <!-- Title -->\n        <div *ngIf=\"title\" class=\"text-truncate\">{{ title }}</div>\n        <!-- Sub title -->\n        <div *ngIf=\"subtitle\" class=\"card-subtitle text-truncate\">{{ subtitle }}</div>\n      </div>\n\n      <!-- Tools-->\n      <div class=\"tools col-5 text-right\">\n        <!-- Collapse content -->\n        <a\n          class=\"icon mdi\"\n          *ngIf=\"collapseAble\"\n          [ngClass]=\"{'mdi-chevron-up': isCollapsed, 'mdi-chevron-down': !isCollapsed}\"\n          (click)=\"toggleContent()\"\n        ></a>\n      </div>\n    </div>\n  </div>\n  <!-- content -->\n  <div [hidden]=\"!isCollapsed\">\n    <ng-content></ng-content>\n  </div>\n</div>\n", styles: [".card-contrast .card-header{padding:20px!important}.card-subtitle{margin-bottom:0}.card-full,.card-full .tools .icon,.card-full .card-subtitle{color:#6b6b6b!important}.card-full-warning,.card-full-warning .tools .icon,.card-full-warning .card-subtitle{color:#343a40!important}.card-full-info,.card-full-danger,.card-full-success,.card-full-primary,.card-full-dark,.card-full-info .tools .icon,.card-full-danger .tools .icon,.card-full-success .tools .icon,.card-full-primary .tools .icon,.card-full-dark .tools .icon,.card-full-info .card-subtitle,.card-full-danger .card-subtitle,.card-full-success .card-subtitle,.card-full-primary .card-subtitle,.card-full-dark .card-subtitle{color:#fff!important}.card-contrast .card-body{padding-top:15px}.card-body{padding:15px 20px}.pie-label{font-size:16px!important}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: WidgetComponent, decorators: [{
            type: Component,
            args: [{ selector: 'valtimo-widget', template: "<!--\n  ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n  ~\n  ~ Licensed under EUPL, Version 1.2 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" basis,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<div class=\"card card-border card-contrast {{ cardClassName }}\">\n  <div class=\"card-header {{ contrastClass }} {{ dividerClass }}\" *ngIf=\"title || subtitle\">\n    <div class=\"row\">\n      <div class=\"col-7\" [ngClass]=\"{clickable: collapseAble}\" (click)=\"toggleContent()\">\n        <!-- Title -->\n        <div *ngIf=\"title\" class=\"text-truncate\">{{ title }}</div>\n        <!-- Sub title -->\n        <div *ngIf=\"subtitle\" class=\"card-subtitle text-truncate\">{{ subtitle }}</div>\n      </div>\n\n      <!-- Tools-->\n      <div class=\"tools col-5 text-right\">\n        <!-- Collapse content -->\n        <a\n          class=\"icon mdi\"\n          *ngIf=\"collapseAble\"\n          [ngClass]=\"{'mdi-chevron-up': isCollapsed, 'mdi-chevron-down': !isCollapsed}\"\n          (click)=\"toggleContent()\"\n        ></a>\n      </div>\n    </div>\n  </div>\n  <!-- content -->\n  <div [hidden]=\"!isCollapsed\">\n    <ng-content></ng-content>\n  </div>\n</div>\n", styles: [".card-contrast .card-header{padding:20px!important}.card-subtitle{margin-bottom:0}.card-full,.card-full .tools .icon,.card-full .card-subtitle{color:#6b6b6b!important}.card-full-warning,.card-full-warning .tools .icon,.card-full-warning .card-subtitle{color:#343a40!important}.card-full-info,.card-full-danger,.card-full-success,.card-full-primary,.card-full-dark,.card-full-info .tools .icon,.card-full-danger .tools .icon,.card-full-success .tools .icon,.card-full-primary .tools .icon,.card-full-dark .tools .icon,.card-full-info .card-subtitle,.card-full-danger .card-subtitle,.card-full-success .card-subtitle,.card-full-primary .card-subtitle,.card-full-dark .card-subtitle{color:#fff!important}.card-contrast .card-body{padding-top:15px}.card-body{padding:15px 20px}.pie-label{font-size:16px!important}\n"] }]
        }], propDecorators: { type: [{
                type: Input
            }], name: [{
                type: Input
            }], icon: [{
                type: Input
            }], contrast: [{
                type: Input
            }], divider: [{
                type: Input
            }], title: [{
                type: Input
            }], subtitle: [{
                type: Input
            }], collapseAble: [{
                type: Input
            }], collapse: [{
                type: Input
            }], additionalClasses: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 