import { ChangeDetectionStrategy, Component, ElementRef, Input } from '@angular/core';
import { ModalSize, OverlayService } from '@aztrix/components/overlay';
import { ImagePreviewComponent } from './image-preview/image-preview.component';
import * as i0 from "@angular/core";
import * as i1 from "@aztrix/components/overlay";
import * as i2 from "@aztrix/components/button";
import * as i3 from "@aztrix/components/image-source";
import * as i4 from "@aztrix/icons";
export class ImagePreviewButtonComponent {
    constructor(_overlay, _elementRef) {
        this._overlay = _overlay;
        this._elementRef = _elementRef;
    }
    preview() {
        this._overlay.createModal(this._elementRef, ImagePreviewComponent, {
            title: 'label.preview',
            modalSize: ModalSize.SMALL,
            init: (modal) => {
                modal.source = this.source;
                modal.name = this.name;
            },
        });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ImagePreviewButtonComponent, deps: [{ token: i1.OverlayService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ImagePreviewButtonComponent, selector: "ax-image-preview-button", inputs: { source: "source", name: "name" }, ngImport: i0, template: "<button axButton button-filled color=\"white\" [hidden]=\"!source\" (click)=\"preview()\">\n  <ax-image-source [source]=\"source\">\n    <ax-icon class=\"icon\" name=\"image\"></ax-icon>\n  </ax-image-source>\n</button>\n", styles: ["button{width:1.5rem;height:1.5rem;min-width:0;padding:0;overflow:hidden}button[hidden]{display:none}\n"], dependencies: [{ kind: "directive", type: i2.ButtonDirective, selector: "[axButton]", inputs: ["color", "labelHideMobile", "smallButton", "bigButton", "fullWidth", "filled", "outline", "icon-button", "hoverLabel", "hover", "lowercase", "disabled"] }, { kind: "component", type: i3.ImageSourceComponent, selector: "ax-image-source", inputs: ["source", "fallbackSource", "actualSize", "alt", "round", "rounded", "border"] }, { kind: "component", type: i4.IconComponent, selector: "ax-icon", inputs: ["name", "inline"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ImagePreviewButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-image-preview-button', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button axButton button-filled color=\"white\" [hidden]=\"!source\" (click)=\"preview()\">\n  <ax-image-source [source]=\"source\">\n    <ax-icon class=\"icon\" name=\"image\"></ax-icon>\n  </ax-image-source>\n</button>\n", styles: ["button{width:1.5rem;height:1.5rem;min-width:0;padding:0;overflow:hidden}button[hidden]{display:none}\n"] }]
        }], ctorParameters: () => [{ type: i1.OverlayService }, { type: i0.ElementRef }], propDecorators: { source: [{
                type: Input
            }], name: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW1hZ2UtcHJldmlldy1idXR0b24uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL2ltYWdlLXByZXZpZXctYnV0dG9uL2ltYWdlLXByZXZpZXctYnV0dG9uLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL2xpYnMvY29tcG9uZW50cy9pbWFnZS1wcmV2aWV3LWJ1dHRvbi9pbWFnZS1wcmV2aWV3LWJ1dHRvbi5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsdUJBQXVCLEVBQUUsU0FBUyxFQUFFLFVBQVUsRUFBRSxLQUFLLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFFcEYsT0FBTyxFQUFDLFNBQVMsRUFBRSxjQUFjLEVBQUMsTUFBTSw0QkFBNEIsQ0FBQztBQUVyRSxPQUFPLEVBQUMscUJBQXFCLEVBQUMsTUFBTSx5Q0FBeUMsQ0FBQzs7Ozs7O0FBUTlFLE1BQU0sT0FBTywyQkFBMkI7SUFJd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