/**
 * @fileoverview added by tsickle
 * Generated from: lib/dialog-confirm/dialog-confirm.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { ChangeDetectionStrategy, Component, ViewChild, ViewEncapsulation } from '@angular/core';
import { BbButton } from '@bravobit/bb-foundation/elements';
import { BbDialogConfig } from '../dialog.interfaces';
import { BbDialogRef } from '../dialog.ref';
/** @type {?} */
var nextUniqueId = 0;
var BbDialogConfirm = /** @class */ (function () {
    function BbDialogConfirm(config, dialogRef) {
        this.config = config;
        this.dialogRef = dialogRef;
        // Id.
        this.dialogId = "bb-dialog-confirm-" + nextUniqueId++;
    }
    /**
     * @return {?}
     */
    BbDialogConfirm.prototype.ngAfterViewInit = /**
     * @return {?}
     */
    function () {
        // Initial focus the button.
        this.confirmButton.focus();
    };
    /**
     * @param {?} result
     * @return {?}
     */
    BbDialogConfirm.prototype.onClose = /**
     * @param {?} result
     * @return {?}
     */
    function (result) {
        this.dialogRef.close(result);
    };
    BbDialogConfirm.decorators = [
        { type: Component, args: [{
                    selector: 'bb-dialog-confirm',
                    template: "<div [attr.aria-labelledby]=\"dialogId\"\r\n     bb-dialog-modal\r\n     bbFocusTrap>\r\n    <header bb-dialog-header>\r\n        <h1 *ngIf=\"config?.data?.title as title\"\r\n            [id]=\"dialogId\">\r\n            {{ title | bbLocalize:{optional: true} }}\r\n        </h1>\r\n    </header>\r\n\r\n    <p>\r\n        {{ config?.data?.description | bbLocalize:{optional: true} }}\r\n    </p>\r\n\r\n    <footer bb-dialog-actions>\r\n        <button *ngIf=\"config?.data?.cancelButtonText as cancelButtonText\"\r\n                (click)=\"onClose(false)\"\r\n                bb-button\r\n                type=\"button\">\r\n            {{ cancelButtonText | bbLocalize:{optional: true} }}\r\n        </button>\r\n        <button #confirm\r\n                *ngIf=\"config?.data?.confirmButtonText as confirmButtonText\"\r\n                (click)=\"onClose(true)\"\r\n                bb-button\r\n                type=\"button\"\r\n                class=\"destructive\">\r\n            {{ confirmButtonText | bbLocalize:{optional: true} }}\r\n        </button>\r\n    </footer>\r\n</div>\r\n",
                    changeDetection: ChangeDetectionStrategy.OnPush,
                    encapsulation: ViewEncapsulation.None,
                    preserveWhitespaces: false,
                    host: { 'class': 'bb-dialog-confirm' },
                    styles: [".bb-dialog-confirm{display:block}"]
                }] }
    ];
    /** @nocollapse */
    BbDialogConfirm.ctorParameters = function () { return [
        { type: BbDialogConfig },
        { type: BbDialogRef }
    ]; };
    BbDialogConfirm.propDecorators = {
        confirmButton: [{ type: ViewChild, args: ['confirm', { read: BbButton, static: false },] }]
    };
    return BbDialogConfirm;
}());
export { BbDialogConfirm };
if (false) {
    /** @type {?} */
    BbDialogConfirm.prototype.confirmButton;
    /** @type {?} */
    BbDialogConfirm.prototype.dialogId;
    /** @type {?} */
    BbDialogConfirm.prototype.config;
    /** @type {?} */
    BbDialogConfirm.prototype.dialogRef;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlhbG9nLWNvbmZpcm0uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQGJyYXZvYml0L2JiLWZvdW5kYXRpb24vZGlhbG9nLyIsInNvdXJjZXMiOlsibGliL2RpYWxvZy1jb25maXJtL2RpYWxvZy1jb25maXJtLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLE9BQU8sRUFBZ0IsdUJBQXVCLEVBQUUsU0FBUyxFQUFFLFNBQVMsRUFBRSxpQkFBaUIsRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUM5RyxPQUFPLEVBQUMsUUFBUSxFQUFDLE1BQU0sa0NBQWtDLENBQUM7QUFDMUQsT0FBTyxFQUFDLGNBQWMsRUFBQyxNQUFNLHNCQUFzQixDQUFDO0FBQ3BELE9BQU8sRUFBQyxXQUFXLEVBQUMsTUFBTSxlQUFlLENBQUM7O0lBRXRDLFlBQVksR0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