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(ImagePreviewComponent, {
            title: 'label.preview',
            modalSize: ModalSize.SMALL,
            init: (modal) => {
                modal.source = this.source;
                modal.name = this.name;
            },
        }, this._elementRef);
    }
}
ImagePreviewButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ImagePreviewButtonComponent, deps: [{ token: i1.OverlayService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
ImagePreviewButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", 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: "15.1.5", 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: function () { return [{ type: i1.OverlayService }, { type: i0.ElementRef }]; }, propDecorators: { source: [{
                type: Input
            }], name: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW1hZ2UtcHJldmlldy1idXR0b24uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL2ltYWdlLXByZXZpZXctYnV0dG9uL2ltYWdlLXByZXZpZXctYnV0dG9uLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL2xpYnMvY29tcG9uZW50cy9pbWFnZS1wcmV2aWV3LWJ1dHRvbi9pbWFnZS1wcmV2aWV3LWJ1dHRvbi5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsdUJBQXVCLEVBQUUsU0FBUyxFQUFFLFVBQVUsRUFBRSxLQUFLLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFFcEYsT0FBTyxFQUFDLFNBQVMsRUFBRSxjQUFjLEVBQUMsTUFBTSw0QkFBNEIsQ0FBQztBQUVyRSxPQUFPLEVBQUMscUJBQXFCLEVBQUMsTUFBTSx5Q0FBeUMsQ0FBQzs7Ozs7O0FBUTlFLE1BQU0s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