/*
 * 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, Output, EventEmitter, Input, } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@ngx-translate/core";
/**
 * @deprecated Migrate old design to Carbon
 */
export class ButtonComponent {
    constructor() {
        this.type = 'primary';
        this.title = '';
        this.titleTranslationKey = '';
        this.clickEvent = new EventEmitter();
    }
    ngOnInit() {
        this.setIconTypes();
    }
    ngOnChanges(changes) {
        if (changes?.type || changes?.mdiIcon) {
            this.setIconTypes();
        }
    }
    buttonClick() {
        if (!this.disabled) {
            this.clickEvent.emit();
        }
    }
    setIconTypes() {
        switch (this.type) {
            case 'primary':
                this.isPrimary = true;
                break;
            case 'secondary':
                this.isSecondary = true;
                break;
            case 'success':
                this.isSuccess = true;
                break;
            case 'text':
                this.isText = true;
                break;
            case 'danger':
                this.isDanger = true;
                break;
            case 'icon-danger':
                this.isIcon = true;
                this.isIconDanger = true;
                break;
            case 'icon-grey':
                this.isIcon = true;
                this.isIconGrey = true;
                break;
            case 'icon-danger-small':
                this.isIconSmall = true;
                this.isIcon = true;
                this.isIconDanger = true;
                break;
            case 'icon-grey-small':
                this.isIconSmall = true;
                this.isIcon = true;
                this.isIconGrey = true;
                break;
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ButtonComponent, selector: "v-button", inputs: { type: "type", mdiIcon: "mdiIcon", disabled: "disabled", title: "title", titleTranslationKey: "titleTranslationKey" }, outputs: { clickEvent: "clickEvent" }, usesOnChanges: true, 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<button\n  class=\"v-button\"\n  role=\"button\"\n  (click)=\"buttonClick()\"\n  [title]=\"\n    (titleTranslationKey || title) && titleTranslationKey\n      ? (titleTranslationKey | translate)\n      : title\n  \"\n  [ngClass]=\"{\n    'v-button--primary': isPrimary,\n    'v-button--secondary': isSecondary,\n    'v-button--success': isSuccess,\n    'v-button--danger': isDanger,\n    'v-button--disabled': !isText && disabled,\n    'v-button--text': isText,\n    'v-button--text-disabled': isText && disabled,\n    'v-button--icon': isIcon,\n    'v-button--icon-small': isIconSmall,\n    'v-button--icon-danger': isIconDanger,\n    'v-button--icon-grey': isIconGrey,\n  }\"\n  [disabled]=\"disabled\"\n>\n  <ng-container *ngIf=\"!isIcon\">\n    <ng-content></ng-content>\n  </ng-container>\n  <ng-container *ngTemplateOutlet=\"buttonIcon\"></ng-container>\n</button>\n\n<ng-template #buttonIcon>\n  <span\n    *ngIf=\"!isText && (disabled || mdiIcon)\"\n    class=\"v-button__icon-container\"\n    [ngClass]=\"[!disabled && isSecondary ? 'v-button__icon-container--secondary' : '']\"\n  >\n    <i\n      [ngClass]=\"[\n        !disabled && isPrimary ? 'v-button__icon--primary' : '',\n        !disabled && isSecondary ? 'v-button__icon--secondary' : '',\n        !disabled && isSuccess ? 'v-button__icon--success' : '',\n        !disabled && isDanger ? 'v-button__icon--danger' : '',\n        !disabled && mdiIcon ? 'v-button__icon mdi mdi-' + mdiIcon : '',\n        disabled ? 'mdi mdi-cancel v-button__icon--disabled' : '',\n      ]\"\n    ></i>\n  </span>\n</ng-template>\n", styles: [".v-button{position:relative;display:flex;border:none;color:var(--v-button-font-color);font-weight:var(--v-font-weight-bold);padding-inline-start:var(--v-spacing-inline-3xl);padding-inline-end:var(--v-spacing-inline-3xl);padding-block-start:var(--v-spacing-block-md);padding-block-end:var(--v-spacing-block-md);font-size:var(--v-font-size-default);border-radius:var(--v-border-radius-md);transition:var(--v-transition-bg-fast),var(--v-transition-color-fast),var(--v-transition-border-fast);cursor:var(--v-cursor-clickable)}.v-button--primary{background-color:var(--v-button-primary-bg-color)}.v-button--primary:hover{background-color:var(--v-button-primary-hover-bg-color)}.v-button--primary:hover .v-button__icon--primary{color:var(--v-button-primary-hover-bg-color)}.v-button--primary:active{background-color:var(--v-button-primary-active-bg-color)}.v-button--primary:active .v-button__icon--primary{color:var(--v-button-primary-active-bg-color)}.v-button--secondary{background-color:var(--v-button-secondary-bg-color);color:var(--v-button-secondary-font-color);border:var(--v-button-secondary-border);margin:var(--v-button-secondary-margin)}.v-button--secondary.v-button--disabled{margin:0;border:none}.v-button--secondary:hover{background-color:var(--v-button-primary-bg-color);color:var(--v-button-font-color)}.v-button--secondary:hover .v-button__icon--secondary{color:var(--v-button-primary-bg-color)}.v-button--secondary:hover .v-button__icon-container--secondary{background-color:var(--v-button-icon-container-bg-color)}.v-button--secondary:active{color:var(--v-button-font-color);border:var(--v-button-secondary-active-border);background-color:var(--v-button-primary-active-bg-color)}.v-button--secondary:active .v-button__icon--secondary{color:var(--v-button-primary-active-bg-color)}.v-button--secondary:active .v-button__icon-container--secondary{background-color:var(--v-button-icon-container-bg-color)}.v-button--success{background-color:var(--v-button-success-bg-color)}.v-button--success:hover{background-color:var(--v-button-success-hover-bg-color)}.v-button--success:hover .v-button__icon--success{color:var(--v-button-success-hover-bg-color)}.v-button--success:active{background-color:var(--v-button-success-active-bg-color)}.v-button--success:active .v-button__icon--success{color:var(--v-button-success-active-bg-color)}.v-button--danger{background-color:var(--v-button-danger-bg-color)}.v-button--danger:hover{background-color:var(--v-button-danger-hover-bg-color)}.v-button--danger:hover .v-button__icon--danger{color:var(--v-button-danger-hover-bg-color)}.v-button--danger:active{background-color:var(--v-button-danger-active-bg-color)}.v-button--danger:active .v-button__icon--danger{color:var(--v-button-danger-active-bg-color)}.v-button--text{padding:0;background-color:transparent;color:var(--v-button-primary-bg-color);font-size:var(--v-button-text-font-size)}.v-button--text:hover{background-color:transparent;color:var(--v-button-primary-hover-bg-color)}.v-button--text:active{background-color:transparent;color:var(--v-button-primary-active-bg-color)}.v-button--text-disabled{cursor:var(--v-cursor-disabled);color:var(--v-button-disabled-font-color)}.v-button--text-disabled:hover,.v-button--text-disabled:active{color:var(--v-button-disabled-font-color)}.v-button__icon-container{position:absolute;display:inline-flex;justify-content:center;align-items:center;right:var(--v-spacing-inline-md);top:50%;transform:translateY(-50%);width:var(--v-button-icon-circle-width);height:var(--v-button-icon-circle-width);background-color:var(--v-button-icon-container-bg-color);border-radius:50%;transition:var(--v-transition-bg-fast)}.v-button__icon-container--secondary{background-color:var(--v-button-secondary-icon-container-bg-color)}.v-button__icon{font-size:var(--v-font-size-larger);line-height:var(--v-line-height-default);transition:var(--v-transition-color-fast),var(--v-transition-font-size-fast)}.v-button__icon--primary{color:var(--v-button-primary-bg-color)}.v-button__icon--secondary{color:var(--v-button-secondary-icon-color)}.v-button__icon--success{color:var(--v-button-success-bg-color)}.v-button__icon--danger{color:var(--v-button-danger-bg-color)}.v-button--disabled{background-color:var(--v-button-disabled-bg-color);color:var(--v-button-disabled-font-color);cursor:var(--v-cursor-disabled)}.v-button--disabled:hover,.v-button--disabled:active{background-color:var(--v-button-disabled-bg-color);color:var(--v-button-disabled-font-color)}.v-button--disabled .v-button__icon-container{background-color:transparent}.v-button__icon--disabled{color:var(--v-button-disabled-font-color);font-size:var(--v-button-icon-circle-width);line-height:var(--v-button-icon-circle-width)}.v-button--icon-danger{color:var(--v-button-type-icon-danger-color)}.v-button--icon-danger .v-button__icon-container{background-color:var(--v-button-type-icon-danger-bg-color)}.v-button--icon-danger:hover{color:var(--v-button-type-icon-danger-color-hover)}.v-button--icon-danger:hover .v-button__icon-container{background-color:var(--v-button-type-icon-danger-bg-color-hover)}.v-button--icon-danger:active{color:var(--v-button-type-icon-danger-color-active)}.v-button--icon-danger:active .v-button__icon-container{background-color:var(--v-button-type-icon-danger-bg-color-active)}.v-button--icon-grey{color:var(--v-button-type-icon-grey-color)}.v-button--icon-grey .v-button__icon-container{background-color:var(--v-button-type-icon-grey-bg-color)}.v-button--icon-grey:hover{color:var(--v-button-type-icon-grey-color-hover)}.v-button--icon-grey:hover .v-button__icon-container{background-color:var(--v-button-type-icon-grey-bg-color-hover)}.v-button--icon-grey:active{color:var(--v-button-type-icon-grey-color-active)}.v-button--icon-grey:active .v-button__icon-container{background-color:var(--v-button-type-icon-grey-bg-color-active)}.v-button--icon{padding-inline-start:0;padding-inline-end:0;padding-block-start:0;padding-block-end:0;border-radius:0;width:var(--v-button-type-icon-width);height:var(--v-button-type-icon-height);background:transparent}.v-button--icon .v-button__icon-container{position:relative;display:inline-flex;justify-content:center;align-items:center;right:0;top:0;transform:none;width:var(--v-button-type-icon-width);height:var(--v-button-type-icon-height);border-radius:50%}.v-button--icon .v-button__icon--disabled{font-size:var(--v-font-size-larger);line-height:var(--v-line-height-default)}.v-button--icon.v-button--disabled{background:transparent}.v-button--icon.v-button--disabled .v-button__icon-container{background-color:var(--v-button-disabled-bg-color)}.v-button--icon-small,.v-button--icon-small .v-button__icon-container{width:var(--v-button-type-icon-small-width);height:var(--v-button-type-icon-small-height)}\n/*!\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"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'v-button', 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<button\n  class=\"v-button\"\n  role=\"button\"\n  (click)=\"buttonClick()\"\n  [title]=\"\n    (titleTranslationKey || title) && titleTranslationKey\n      ? (titleTranslationKey | translate)\n      : title\n  \"\n  [ngClass]=\"{\n    'v-button--primary': isPrimary,\n    'v-button--secondary': isSecondary,\n    'v-button--success': isSuccess,\n    'v-button--danger': isDanger,\n    'v-button--disabled': !isText && disabled,\n    'v-button--text': isText,\n    'v-button--text-disabled': isText && disabled,\n    'v-button--icon': isIcon,\n    'v-button--icon-small': isIconSmall,\n    'v-button--icon-danger': isIconDanger,\n    'v-button--icon-grey': isIconGrey,\n  }\"\n  [disabled]=\"disabled\"\n>\n  <ng-container *ngIf=\"!isIcon\">\n    <ng-content></ng-content>\n  </ng-container>\n  <ng-container *ngTemplateOutlet=\"buttonIcon\"></ng-container>\n</button>\n\n<ng-template #buttonIcon>\n  <span\n    *ngIf=\"!isText && (disabled || mdiIcon)\"\n    class=\"v-button__icon-container\"\n    [ngClass]=\"[!disabled && isSecondary ? 'v-button__icon-container--secondary' : '']\"\n  >\n    <i\n      [ngClass]=\"[\n        !disabled && isPrimary ? 'v-button__icon--primary' : '',\n        !disabled && isSecondary ? 'v-button__icon--secondary' : '',\n        !disabled && isSuccess ? 'v-button__icon--success' : '',\n        !disabled && isDanger ? 'v-button__icon--danger' : '',\n        !disabled && mdiIcon ? 'v-button__icon mdi mdi-' + mdiIcon : '',\n        disabled ? 'mdi mdi-cancel v-button__icon--disabled' : '',\n      ]\"\n    ></i>\n  </span>\n</ng-template>\n", styles: [".v-button{position:relative;display:flex;border:none;color:var(--v-button-font-color);font-weight:var(--v-font-weight-bold);padding-inline-start:var(--v-spacing-inline-3xl);padding-inline-end:var(--v-spacing-inline-3xl);padding-block-start:var(--v-spacing-block-md);padding-block-end:var(--v-spacing-block-md);font-size:var(--v-font-size-default);border-radius:var(--v-border-radius-md);transition:var(--v-transition-bg-fast),var(--v-transition-color-fast),var(--v-transition-border-fast);cursor:var(--v-cursor-clickable)}.v-button--primary{background-color:var(--v-button-primary-bg-color)}.v-button--primary:hover{background-color:var(--v-button-primary-hover-bg-color)}.v-button--primary:hover .v-button__icon--primary{color:var(--v-button-primary-hover-bg-color)}.v-button--primary:active{background-color:var(--v-button-primary-active-bg-color)}.v-button--primary:active .v-button__icon--primary{color:var(--v-button-primary-active-bg-color)}.v-button--secondary{background-color:var(--v-button-secondary-bg-color);color:var(--v-button-secondary-font-color);border:var(--v-button-secondary-border);margin:var(--v-button-secondary-margin)}.v-button--secondary.v-button--disabled{margin:0;border:none}.v-button--secondary:hover{background-color:var(--v-button-primary-bg-color);color:var(--v-button-font-color)}.v-button--secondary:hover .v-button__icon--secondary{color:var(--v-button-primary-bg-color)}.v-button--secondary:hover .v-button__icon-container--secondary{background-color:var(--v-button-icon-container-bg-color)}.v-button--secondary:active{color:var(--v-button-font-color);border:var(--v-button-secondary-active-border);background-color:var(--v-button-primary-active-bg-color)}.v-button--secondary:active .v-button__icon--secondary{color:var(--v-button-primary-active-bg-color)}.v-button--secondary:active .v-button__icon-container--secondary{background-color:var(--v-button-icon-container-bg-color)}.v-button--success{background-color:var(--v-button-success-bg-color)}.v-button--success:hover{background-color:var(--v-button-success-hover-bg-color)}.v-button--success:hover .v-button__icon--success{color:var(--v-button-success-hover-bg-color)}.v-button--success:active{background-color:var(--v-button-success-active-bg-color)}.v-button--success:active .v-button__icon--success{color:var(--v-button-success-active-bg-color)}.v-button--danger{background-color:var(--v-button-danger-bg-color)}.v-button--danger:hover{background-color:var(--v-button-danger-hover-bg-color)}.v-button--danger:hover .v-button__icon--danger{color:var(--v-button-danger-hover-bg-color)}.v-button--danger:active{background-color:var(--v-button-danger-active-bg-color)}.v-button--danger:active .v-button__icon--danger{color:var(--v-button-danger-active-bg-color)}.v-button--text{padding:0;background-color:transparent;color:var(--v-button-primary-bg-color);font-size:var(--v-button-text-font-size)}.v-button--text:hover{background-color:transparent;color:var(--v-button-primary-hover-bg-color)}.v-button--text:active{background-color:transparent;color:var(--v-button-primary-active-bg-color)}.v-button--text-disabled{cursor:var(--v-cursor-disabled);color:var(--v-button-disabled-font-color)}.v-button--text-disabled:hover,.v-button--text-disabled:active{color:var(--v-button-disabled-font-color)}.v-button__icon-container{position:absolute;display:inline-flex;justify-content:center;align-items:center;right:var(--v-spacing-inline-md);top:50%;transform:translateY(-50%);width:var(--v-button-icon-circle-width);height:var(--v-button-icon-circle-width);background-color:var(--v-button-icon-container-bg-color);border-radius:50%;transition:var(--v-transition-bg-fast)}.v-button__icon-container--secondary{background-color:var(--v-button-secondary-icon-container-bg-color)}.v-button__icon{font-size:var(--v-font-size-larger);line-height:var(--v-line-height-default);transition:var(--v-transition-color-fast),var(--v-transition-font-size-fast)}.v-button__icon--primary{color:var(--v-button-primary-bg-color)}.v-button__icon--secondary{color:var(--v-button-secondary-icon-color)}.v-button__icon--success{color:var(--v-button-success-bg-color)}.v-button__icon--danger{color:var(--v-button-danger-bg-color)}.v-button--disabled{background-color:var(--v-button-disabled-bg-color);color:var(--v-button-disabled-font-color);cursor:var(--v-cursor-disabled)}.v-button--disabled:hover,.v-button--disabled:active{background-color:var(--v-button-disabled-bg-color);color:var(--v-button-disabled-font-color)}.v-button--disabled .v-button__icon-container{background-color:transparent}.v-button__icon--disabled{color:var(--v-button-disabled-font-color);font-size:var(--v-button-icon-circle-width);line-height:var(--v-button-icon-circle-width)}.v-button--icon-danger{color:var(--v-button-type-icon-danger-color)}.v-button--icon-danger .v-button__icon-container{background-color:var(--v-button-type-icon-danger-bg-color)}.v-button--icon-danger:hover{color:var(--v-button-type-icon-danger-color-hover)}.v-button--icon-danger:hover .v-button__icon-container{background-color:var(--v-button-type-icon-danger-bg-color-hover)}.v-button--icon-danger:active{color:var(--v-button-type-icon-danger-color-active)}.v-button--icon-danger:active .v-button__icon-container{background-color:var(--v-button-type-icon-danger-bg-color-active)}.v-button--icon-grey{color:var(--v-button-type-icon-grey-color)}.v-button--icon-grey .v-button__icon-container{background-color:var(--v-button-type-icon-grey-bg-color)}.v-button--icon-grey:hover{color:var(--v-button-type-icon-grey-color-hover)}.v-button--icon-grey:hover .v-button__icon-container{background-color:var(--v-button-type-icon-grey-bg-color-hover)}.v-button--icon-grey:active{color:var(--v-button-type-icon-grey-color-active)}.v-button--icon-grey:active .v-button__icon-container{background-color:var(--v-button-type-icon-grey-bg-color-active)}.v-button--icon{padding-inline-start:0;padding-inline-end:0;padding-block-start:0;padding-block-end:0;border-radius:0;width:var(--v-button-type-icon-width);height:var(--v-button-type-icon-height);background:transparent}.v-button--icon .v-button__icon-container{position:relative;display:inline-flex;justify-content:center;align-items:center;right:0;top:0;transform:none;width:var(--v-button-type-icon-width);height:var(--v-button-type-icon-height);border-radius:50%}.v-button--icon .v-button__icon--disabled{font-size:var(--v-font-size-larger);line-height:var(--v-line-height-default)}.v-button--icon.v-button--disabled{background:transparent}.v-button--icon.v-button--disabled .v-button__icon-container{background-color:var(--v-button-disabled-bg-color)}.v-button--icon-small,.v-button--icon-small .v-button__icon-container{width:var(--v-button-type-icon-small-width);height:var(--v-button-type-icon-small-height)}\n/*!\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"] }]
        }], propDecorators: { type: [{
                type: Input
            }], mdiIcon: [{
                type: Input
            }], disabled: [{
                type: Input
            }], title: [{
                type: Input
            }], titleTranslationKey: [{
                type: Input
            }], clickEvent: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 