/**
 * @fileoverview added by tsickle
 * Generated from: lib/button/button.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { mixinLoad, mixinDisabled } from '@bravobit/bb-foundation';
import { ChangeDetectionStrategy, Component, ElementRef, Input, ViewEncapsulation } from '@angular/core';
class BbButtonBase {
    /**
     * @param {?} _elementRef
     */
    constructor(_elementRef) {
        this._elementRef = _elementRef;
    }
}
if (false) {
    /** @type {?} */
    BbButtonBase.prototype._elementRef;
}
/** @type {?} */
const BbButtonMixinBase = mixinDisabled(mixinLoad(BbButtonBase));
export class BbButton extends BbButtonMixinBase {
    /**
     * @param {?} _elementRef
     */
    constructor(_elementRef) {
        super(_elementRef);
    }
    /**
     * @return {?}
     */
    get nativeElement() {
        return this._elementRef.nativeElement;
    }
    /**
     * @return {?}
     */
    focus() {
        this.nativeElement && this.nativeElement.focus();
    }
}
BbButton.decorators = [
    { type: Component, args: [{
                selector: 'button[bb-button]',
                template: "<bb-spinner [class.visible]=\"loading\"\r\n            class=\"bb-button-spinner small\">\r\n</bb-spinner>\r\n\r\n<ng-content></ng-content>\r\n",
                exportAs: 'bbButton',
                host: {
                    'class': 'bb-button',
                    '[class.loading]': 'loading',
                    '[attr.disabled]': 'disabled || loading || null'
                },
                inputs: ['disabled', 'loading'],
                encapsulation: ViewEncapsulation.None,
                changeDetection: ChangeDetectionStrategy.OnPush,
                styles: [".bb-button{height:38px;padding:0 8px;cursor:pointer;font-size:16px;font-weight:500;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;font-style:normal;border-radius:4px;text-align:center;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;text-decoration:none;-ms-flex-pack:center;justify-content:center;background-color:#fff;color:#2d3c4d!important;border:1px solid #d4d8e1;transition-duration:.2s;box-shadow:0 6px 6px -6px rgba(0,0,0,.1);transition-timing-function:cubic-bezier(0,0,.2,1);transition-property:padding-left,background-color,box-shadow}.bb-button:hover{background-color:#fcfcfb}.bb-button:active,.bb-button:focus{box-shadow:0 6px 6px -6px rgba(0,0,0,.1),0 0 0 3px rgba(220,224,233,.5)}.bb-button.full{width:100%}.bb-button.full.loading{padding-left:42px}.bb-button.primary{border-color:#2f2b85;color:#fff!important;background-color:#5b53ff}.bb-button.primary:hover{background-color:#564ee6}.bb-button.primary:active,.bb-button.primary:focus{box-shadow:0 6px 6px -6px rgba(0,0,0,.1),0 0 0 3px rgba(91,83,255,.5)}.bb-button.destructive{border-color:#8f2020;color:#fff!important;background-color:#d32f2f}.bb-button.destructive:hover{background-color:#c32929}.bb-button.destructive:active,.bb-button.destructive:focus{box-shadow:0 6px 6px -6px rgba(0,0,0,.1),0 0 0 3px rgba(211,47,47,.5)}.bb-button.loading,.bb-button.loading:active,.bb-button.loading:focus,.bb-button.loading:hover,.bb-button:disabled,.bb-button:disabled:active,.bb-button:disabled:focus,.bb-button:disabled:hover,.bb-button[disabled],.bb-button[disabled]:active,.bb-button[disabled]:focus,.bb-button[disabled]:hover{opacity:.4;cursor:default;box-shadow:none}.bb-button-spinner{width:0;opacity:0;overflow:hidden;visibility:hidden;padding:0!important;transition:width .2s cubic-bezier(0,0,.2,1),opacity .1s cubic-bezier(0,0,.2,1)}.bb-button-spinner.visible{opacity:1;width:20px;margin-right:8px;visibility:visible}.bb-button.loading.full>.bb-button-spinner{left:8px;margin-right:0;position:absolute}"]
            }] }
];
/** @nocollapse */
BbButton.ctorParameters = () => [
    { type: ElementRef }
];
export class BbAnchor extends BbButton {
    /**
     * @param {?} _elementRef
     */
    constructor(_elementRef) {
        super(_elementRef);
    }
    /**
     * @param {?} event
     * @return {?}
     */
    stopDisabledEvents(event) {
        // If the button is not disabled (and not loading) let all events pass.
        if (!this.disabled && !this.loading) {
            return;
        }
        // If the button is disabled and/or loading stop
        // the event from bubbling up.
        event.preventDefault();
        event.stopImmediatePropagation();
    }
}
BbAnchor.decorators = [
    { type: Component, args: [{
                selector: 'a[bb-button]',
                template: "<bb-spinner [class.visible]=\"loading\"\r\n            class=\"bb-button-spinner small\">\r\n</bb-spinner>\r\n\r\n<ng-content></ng-content>\r\n",
                exportAs: 'bbButton, bbAnchor',
                host: {
                    'class': 'bb-button',
                    '[attr.tabindex]': '(disabled || loading) ? -1 : (tabIndex || 0)',
                    '[attr.disabled]': 'disabled || loading || null',
                    '[attr.aria-disabled]': '(disabled || loading).toString()',
                    '(click)': 'stopDisabledEvents($event)'
                },
                inputs: ['disabled', 'loading'],
                encapsulation: ViewEncapsulation.None,
                changeDetection: ChangeDetectionStrategy.OnPush,
                styles: [".bb-button{height:38px;padding:0 8px;cursor:pointer;font-size:16px;font-weight:500;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;font-style:normal;border-radius:4px;text-align:center;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;text-decoration:none;-ms-flex-pack:center;justify-content:center;background-color:#fff;color:#2d3c4d!important;border:1px solid #d4d8e1;transition-duration:.2s;box-shadow:0 6px 6px -6px rgba(0,0,0,.1);transition-timing-function:cubic-bezier(0,0,.2,1);transition-property:padding-left,background-color,box-shadow}.bb-button:hover{background-color:#fcfcfb}.bb-button:active,.bb-button:focus{box-shadow:0 6px 6px -6px rgba(0,0,0,.1),0 0 0 3px rgba(220,224,233,.5)}.bb-button.full{width:100%}.bb-button.full.loading{padding-left:42px}.bb-button.primary{border-color:#2f2b85;color:#fff!important;background-color:#5b53ff}.bb-button.primary:hover{background-color:#564ee6}.bb-button.primary:active,.bb-button.primary:focus{box-shadow:0 6px 6px -6px rgba(0,0,0,.1),0 0 0 3px rgba(91,83,255,.5)}.bb-button.destructive{border-color:#8f2020;color:#fff!important;background-color:#d32f2f}.bb-button.destructive:hover{background-color:#c32929}.bb-button.destructive:active,.bb-button.destructive:focus{box-shadow:0 6px 6px -6px rgba(0,0,0,.1),0 0 0 3px rgba(211,47,47,.5)}.bb-button.loading,.bb-button.loading:active,.bb-button.loading:focus,.bb-button.loading:hover,.bb-button:disabled,.bb-button:disabled:active,.bb-button:disabled:focus,.bb-button:disabled:hover,.bb-button[disabled],.bb-button[disabled]:active,.bb-button[disabled]:focus,.bb-button[disabled]:hover{opacity:.4;cursor:default;box-shadow:none}.bb-button-spinner{width:0;opacity:0;overflow:hidden;visibility:hidden;padding:0!important;transition:width .2s cubic-bezier(0,0,.2,1),opacity .1s cubic-bezier(0,0,.2,1)}.bb-button-spinner.visible{opacity:1;width:20px;margin-right:8px;visibility:visible}.bb-button.loading.full>.bb-button-spinner{left:8px;margin-right:0;position:absolute}"]
            }] }
];
/** @nocollapse */
BbAnchor.ctorParameters = () => [
    { type: ElementRef }
];
BbAnchor.propDecorators = {
    tabIndex: [{ type: Input }]
};
if (false) {
    /** @type {?} */
    BbAnchor.prototype.tabIndex;
}
//# sourceMappingURL=data:application/json;base64, 