var _uuid, _fileName, _showTime, _TIME_FORMAT, _timeFormat, _getOption;
import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
import { Component, Input } from '@angular/core';
import { ZuiB, ZuiF } from '@material-zui/core';
import { ZuiPrintService } from './index.service';
export class ZuiPrintComponent {
    constructor(zuiPrintService) {
        this.zuiPrintService = zuiPrintService;
        _uuid.set(this, ZuiF.uuid());
        this.id = __classPrivateFieldGet(this, _uuid);
        _fileName.set(this, __classPrivateFieldGet(this, _uuid));
        _showTime.set(this, true);
        _TIME_FORMAT.set(this, 'dd/MM/yyyy HH:mm:ss');
        _timeFormat.set(this, __classPrivateFieldGet(this, _TIME_FORMAT));
        _getOption.set(this, () => (Object.assign({ showTime: __classPrivateFieldGet(this, _showTime), fileName: __classPrivateFieldGet(this, _fileName), timeFormat: __classPrivateFieldGet(this, _timeFormat) }, this.options)));
        this.print = () => this.zuiPrintService.print(this.id, __classPrivateFieldGet(this, _getOption).call(this));
        this.download = () => this.zuiPrintService.download(this.id, __classPrivateFieldGet(this, _getOption).call(this));
        this.getJsPdf = () => this.zuiPrintService.getJsPdf(this.id, __classPrivateFieldGet(this, _getOption).call(this));
        this.toBlob = () => this.zuiPrintService.toBlob(this.id, __classPrivateFieldGet(this, _getOption).call(this));
        this.toBuffer = () => this.zuiPrintService.toBuffer(this.id, __classPrivateFieldGet(this, _getOption).call(this));
    }
    set setId(id) {
        this.id = id !== null && id !== void 0 ? id : __classPrivateFieldGet(this, _uuid);
    }
    set setFileName(fileName) {
        __classPrivateFieldSet(this, _fileName, fileName !== null && fileName !== void 0 ? fileName : this.id);
    }
    set setShowTime(val) {
        __classPrivateFieldSet(this, _showTime, ZuiB.toBoolReverse(val));
    }
    set setTimeFormat(timeFormat) {
        __classPrivateFieldSet(this, _fileName, timeFormat !== null && timeFormat !== void 0 ? timeFormat : __classPrivateFieldGet(this, _TIME_FORMAT));
    }
}
_uuid = new WeakMap(), _fileName = new WeakMap(), _showTime = new WeakMap(), _TIME_FORMAT = new WeakMap(), _timeFormat = new WeakMap(), _getOption = new WeakMap();
ZuiPrintComponent.decorators = [
    { type: Component, args: [{
                selector: 'zui-print',
                template: "<div [id]=\"id\" class=\"zui-print\">\n  <ng-content></ng-content>\n</div>\n",
                styles: [""]
            },] }
];
ZuiPrintComponent.ctorParameters = () => [
    { type: ZuiPrintService }
];
ZuiPrintComponent.propDecorators = {
    setId: [{ type: Input, args: ['id',] }],
    setFileName: [{ type: Input, args: ['fileName',] }],
    setShowTime: [{ type: Input, args: ['hideTime',] }],
    setTimeFormat: [{ type: Input, args: ['timeFormat',] }],
    options: [{ type: Input }]
};
//# sourceMappingURL=index.component.js.map