import { __decorate, __extends } from "tslib";
import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core';
import { mixinDisabled } from '@bravobit/bb-foundation';
var BbSpinnerBase = /** @class */ (function () {
    function BbSpinnerBase() {
    }
    return BbSpinnerBase;
}());
var BbSpinnerMixinBase = mixinDisabled(BbSpinnerBase);
var BbSpinner = /** @class */ (function (_super) {
    __extends(BbSpinner, _super);
    function BbSpinner() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        // Inputs.
        _this.color = '#303f9f';
        _this.alt = 'Loading...';
        return _this;
    }
    __decorate([
        Input()
    ], BbSpinner.prototype, "color", void 0);
    __decorate([
        Input()
    ], BbSpinner.prototype, "alt", void 0);
    BbSpinner = __decorate([
        Component({
            selector: 'bb-spinner',
            template: "<!--\n    The spinner element.\n\n    This element contains a circle with a 25% bar that spins\n    indefinitely. The border color can be set via the \"color\"\n    property.\n-->\n<div class=\"bb-spinner-container\">\n    <div [style.border-left-color]=\"color\"\n         [class.disabled]=\"disabled\"\n         class=\"bb-spinner-loader\"\n         aria-live=\"assertive\"\n         role=\"alert\">\n        {{ alt }}\n    </div>\n    <ng-content select=\"img\"></ng-content>\n</div>\n\n<!--\n    The content of the spinner.\n\n    This element contains the content of the spinner. The user\n    can set the content inside the tag.\n-->\n<span class=\"bb-spinner-content\">\n    <ng-content></ng-content>\n</span>\n",
            changeDetection: ChangeDetectionStrategy.OnPush,
            encapsulation: ViewEncapsulation.None,
            host: { 'class': 'bb-spinner' },
            inputs: ['color', 'alt', 'disabled'],
            preserveWhitespaces: false,
            styles: [".bb-spinner{color:#565656;padding:20px 0;text-align:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.bb-spinner.block{display:-webkit-box;display:-ms-flexbox;display:flex}.bb-spinner.inverse .bb-spinner-loader{border-color:rgba(255,255,255,.15)}.bb-spinner.inverse .bb-spinner-content{color:rgba(255,255,255,.5)}.bb-spinner.small .bb-spinner-loader,.bb-spinner.small .bb-spinner-loader:after{width:20px;height:20px;min-width:20px;min-height:20px}.bb-spinner.small .bb-spinner-loader{border-width:2px}.bb-spinner.small .bb-spinner-content{font-size:12px}.bb-spinner.medium .bb-spinner-loader,.bb-spinner.medium .bb-spinner-loader:after{width:60px;height:60px;min-width:60px;min-height:60px}.bb-spinner.medium .bb-spinner-loader{border-width:4px}.bb-spinner.medium .bb-spinner-content{font-size:16px}.bb-spinner.large .bb-spinner-loader,.bb-spinner.large .bb-spinner-loader:after{width:100px;height:100px;min-width:100px;min-height:100px}.bb-spinner.large .bb-spinner-loader{border-width:6px}.bb-spinner.large .bb-spinner-content{font-size:20px}.bb-spinner.horizontal{text-align:left;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.bb-spinner.horizontal .bb-spinner-content:not(:empty){margin-left:10px;margin-top:0}.bb-spinner.vertical{text-align:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.bb-spinner.vertical .bb-spinner-content:not(:empty){margin-left:0;margin-top:10px}.bb-spinner-container{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative}.bb-spinner-container>img{top:20%;left:20%;width:60%;height:60%;position:absolute}.bb-spinner-loader{margin:0;padding:0;overflow:hidden;text-indent:100%;color:transparent;position:relative;display:inline-block;vertical-align:middle;border:4px solid #f2f4f6;-webkit-animation:1s linear infinite spin;animation:1s linear infinite spin}.bb-spinner-loader,.bb-spinner-loader:after{width:60px;height:60px;min-width:60px;min-height:60px;border-radius:50%}.bb-spinner-loader.disabled{cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;-webkit-animation-play-state:paused;animation-play-state:paused}.bb-spinner-content:not(:empty){font-size:16px;margin-top:10px;font-weight:500}@-webkit-keyframes spin{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}"]
        })
    ], BbSpinner);
    return BbSpinner;
}(BbSpinnerMixinBase));
export { BbSpinner };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3Bpbm5lci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AYnJhdm9iaXQvYmItZm91bmRhdGlvbi9lbGVtZW50cy8iLCJzb3VyY2VzIjpbImxpYi9zcGlubmVyL3NwaW5uZXIuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQUMsdUJBQXVCLEVBQUUsU0FBUyxFQUFFLEtBQUssRUFBRSxpQkFBaUIsRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUMzRixPQUFPLEVBQW9DLGFBQWEsRUFBQyxNQUFNLHlCQUF5QixDQUFDO0FBRXpGO0lBQUE7SUFDQSxDQUFDO0lBQUQsb0JBQUM7QUFBRCxDQUFDLEFBREQsSUFDQztBQUVELElBQU0sa0JBQWtCLEdBRWxCLGFBQWEsQ0FBQyxhQUFhLENBQUMsQ0FBQztBQVluQztJQUErQiw2QkFBa0I7SUFBakQ7UUFBQSxxRUFNQztRQUpHLFVBQVU7UUFDRCxXQUFLLEdBQVcsU0FBUyxDQUFDO1FBQzFCLFNBQUcsR0FBVyxZQUFZLENBQUM7O0lBRXhDLENBQUM7SUFIWTtRQUFSLEtBQUssRUFBRTs0Q0FBMkI7SUFDMUI7UUFBUixLQUFLLEVBQUU7MENBQTRCO0lBSjNCLFNBQVM7UUFWckIsU0FBUyxDQUFDO1lBQ1AsUUFBUSxFQUFFLFlBQVk7WUFDdEIsMHRCQUF1QztZQUV2QyxlQUFlLEVBQUUsdUJBQXVCLENBQUMsTUF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