import { Component, Input } from '@angular/core';
import { ButtonDirectiveDirective } from '../..//directive/button-directive.directive';
import { ButtonEditorDirective } from '../../directive/button-editor.directive';
import { CommonModule } from '@angular/common';
import * as i0 from "@angular/core";
import * as i1 from "../../services/events.service";
import * as i2 from "@angular/common";
export class SimpoButtonComponent {
    constructor(_eventService) {
        this._eventService = _eventService;
        this.buttonId = '';
        this.sectionId = '';
        this.edit = false;
        this.disabled = false;
        this.loading = false;
        this.isFullWidth = false;
    }
    ngOnInit() {
    }
    redirectTo() {
        if (!this.buttonContent?.pageId && !this.buttonContent?.redirectionUrl)
            return;
        this._eventService.buttonRedirection.emit({ data: this.buttonContent });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SimpoButtonComponent, deps: [{ token: i1.EventsService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: SimpoButtonComponent, isStandalone: true, selector: "app-button-element", inputs: { buttonContent: "buttonContent", buttonStyle: "buttonStyle", buttonId: "buttonId", color: "color", sectionId: "sectionId", edit: "edit", backgroundInfo: "backgroundInfo", disabled: "disabled", loading: "loading", isFullWidth: "isFullWidth" }, ngImport: i0, template: "<button class=\"button gap-2\" (click)=\"redirectTo()\" simpoButtonDirective [id]=\"sectionId+buttonId\"\r\n  [buttonStyle]=\"buttonStyle\" [color]=\"color\" [appButtonEditor]=\"edit ?? false\" [buttonData]=\"buttonContent\"\r\n  [backgroundInfo]=\"backgroundInfo\" [sectionId]=\"sectionId\" [buttonId]=\"buttonId\"\r\n  [class.flex-row-reverse]=\"buttonContent?.icon?.iconPosition === 'left'\" [ngClass]=\"{'w-max-content':!isFullWidth}\">\r\n  <div>{{loading ? \"Loading...\" : buttonContent?.label}}</div>\r\n  <div class=\"btn-icon\" *ngIf=\"buttonContent?.showIcon\" [ngStyle]=\"{\r\n    'background':  buttonStyle?.type == 'Text' ? buttonStyle?.background : buttonStyle?.textColor,\r\n    'mask-image': 'url(' + buttonContent?.icon?.url + ')',\r\n    'mask-repeat': 'no-repeat',\r\n    'mask-size': 'cover',\r\n    'width': '26px',\r\n    'height': '26px',\r\n  }\">\r\n  </div>\r\n</button>", styles: [".button{font-size:16px!important;padding:8px 20px;display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-family:var(--website-font-family);height:43px}.w-max-content{width:max-content!important}*{font-family:var(--website-font-family)}mat-icon{font-family:Material Icons!important}.button:hover{box-shadow:#32325d40 0 13px 27px -5px,#0000004d 0 8px 16px -8px;transform:translateY(-3px);transition:all .3s ease-in-out}\n"], dependencies: [{ kind: "directive", type: ButtonDirectiveDirective, selector: "[simpoButtonDirective]", inputs: ["buttonStyle", "color", "scrollValue", "backgroundInfo"] }, { kind: "directive", type: ButtonEditorDirective, selector: "button[appButtonEditor]", inputs: ["appButtonEditor", "buttonData", "buttonStyle", "backgroundInfo", "sectionId", "buttonId", "itemIndex"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SimpoButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'app-button-element', standalone: true, imports: [ButtonDirectiveDirective, ButtonEditorDirective, CommonModule], template: "<button class=\"button gap-2\" (click)=\"redirectTo()\" simpoButtonDirective [id]=\"sectionId+buttonId\"\r\n  [buttonStyle]=\"buttonStyle\" [color]=\"color\" [appButtonEditor]=\"edit ?? false\" [buttonData]=\"buttonContent\"\r\n  [backgroundInfo]=\"backgroundInfo\" [sectionId]=\"sectionId\" [buttonId]=\"buttonId\"\r\n  [class.flex-row-reverse]=\"buttonContent?.icon?.iconPosition === 'left'\" [ngClass]=\"{'w-max-content':!isFullWidth}\">\r\n  <div>{{loading ? \"Loading...\" : buttonContent?.label}}</div>\r\n  <div class=\"btn-icon\" *ngIf=\"buttonContent?.showIcon\" [ngStyle]=\"{\r\n    'background':  buttonStyle?.type == 'Text' ? buttonStyle?.background : buttonStyle?.textColor,\r\n    'mask-image': 'url(' + buttonContent?.icon?.url + ')',\r\n    'mask-repeat': 'no-repeat',\r\n    'mask-size': 'cover',\r\n    'width': '26px',\r\n    'height': '26px',\r\n  }\">\r\n  </div>\r\n</button>", styles: [".button{font-size:16px!important;padding:8px 20px;display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-family:var(--website-font-family);height:43px}.w-max-content{width:max-content!important}*{font-family:var(--website-font-family)}mat-icon{font-family:Material Icons!important}.button:hover{box-shadow:#32325d40 0 13px 27px -5px,#0000004d 0 8px 16px -8px;transform:translateY(-3px);transition:all .3s ease-in-out}\n"] }]
        }], ctorParameters: () => [{ type: i1.EventsService }], propDecorators: { buttonContent: [{
                type: Input
            }], buttonStyle: [{
                type: Input
            }], buttonId: [{
                type: Input
            }], color: [{
                type: Input
            }], sectionId: [{
                type: Input
            }], edit: [{
                type: Input
            }], backgroundInfo: [{
                type: Input
            }], disabled: [{
                type: Input
            }], loading: [{
                type: Input
            }], isFullWidth: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 