/**
 * @fileoverview added by tsickle
 * Generated from: common/loading/loading-indicator.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/*!
 * Copyright 2020 VMware, Inc.
 * SPDX-License-Identifier: BSD-2-Clause
 */
import { Component, Input } from '@angular/core';
/** @enum {string} */
const SIZES = {
    sm: "sm",
    md: "md",
    lg: "lg",
};
export { SIZES };
/**
 * Loading indicator for blocking modal dialogs while loading.
 */
export class LoadingIndicatorComponent {
    constructor() {
        /**
         * Default spinner size set to "md" - medium used within the modal dialogs
         */
        this.defaultSpinnerSize = SIZES.md;
        /**
         * Spinner size.
         *
         * Spinners can be displayed in three sizes:
         *
         *  - sm(Small): This is the required sizing for inline spinners (see above). It measures 18x18 pixels.
         *  - md(Medium): Medium spinners measure 36x36 pixels. Default.
         *  - lg(Large): This is the default size for page spinners (see above).
         *
         */
        this._size = this.defaultSpinnerSize;
        /**
         * Show/hide the spinner if only an overlay is required.
         */
        this.showSpinner = true;
        /**
         * Text to show next to the spinner.
         */
        this.loadingTextKey = null;
    }
    /**
     * Spinner size setter.
     * Sets default size if provided value is not from specified sized.
     * @param {?} size
     * @return {?}
     */
    set size(size) {
        if (!size || Object.keys(SIZES).indexOf(size) === -1) {
            this._size = this.defaultSpinnerSize;
        }
        else {
            this._size = size;
        }
    }
    /**
     * Gives the size of this loading indicator.
     * @return {?}
     */
    get size() {
        return this._size;
    }
}
LoadingIndicatorComponent.decorators = [
    { type: Component, args: [{
                selector: 'vcd-loading-indicator',
                template: "<ng-container *ngIf=\"isLoading\">\n    <div class=\"overlay\"></div>\n    <div *ngIf=\"showSpinner\" class=\"indicator-container\">\n        <div>\n            <span [ngClass]=\"['spinner', loadingTextKey ? 'spinner-inline' : 'spinner-' + size]\"> </span>\n            <span class=\"qa-loading-text\" *ngIf=\"loadingTextKey\">{{ loadingTextKey | translate }}</span>\n        </div>\n    </div>\n</ng-container>\n<ng-content></ng-content>\n",
                styles: [":host{display:block;position:relative}:host-context(.modal-body) .overlay{background-color:rgba(255,255,255,.5)}.overlay{background-color:rgba(250,250,250,.5);position:absolute;top:0;left:0;right:0;bottom:0;z-index:10}.indicator-container{z-index:600;display:flex;flex-direction:row;justify-content:center;align-items:center;position:absolute;top:0;left:0;right:0;bottom:0}"]
            }] }
];
LoadingIndicatorComponent.propDecorators = {
    isLoading: [{ type: Input }],
    showSpinner: [{ type: Input }],
    loadingTextKey: [{ type: Input }],
    size: [{ type: Input }]
};
if (false) {
    /**
     * Default spinner size set to "md" - medium used within the modal dialogs
     * @type {?}
     * @private
     */
    LoadingIndicatorComponent.prototype.defaultSpinnerSize;
    /**
     * Spinner size.
     *
     * Spinners can be displayed in three sizes:
     *
     *  - sm(Small): This is the required sizing for inline spinners (see above). It measures 18x18 pixels.
     *  - md(Medium): Medium spinners measure 36x36 pixels. Default.
     *  - lg(Large): This is the default size for page spinners (see above).
     *
     * @type {?}
     * @private
     */
    LoadingIndicatorComponent.prototype._size;
    /**
     * Show/hide the loading indicator.
     * @type {?}
     */
    LoadingIndicatorComponent.prototype.isLoading;
    /**
     * Show/hide the spinner if only an overlay is required.
     * @type {?}
     */
    LoadingIndicatorComponent.prototype.showSpinner;
    /**
     * Text to show next to the spinner.
     * @type {?}
     */
    LoadingIndicatorComponent.prototype.loadingTextKey;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZGluZy1pbmRpY2F0b3IuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHZjZC91aS1jb21wb25lbnRzLyIsInNvdXJjZXMiOlsiY29tbW9uL2xvYWRpbmcvbG9hZGluZy1pbmRpY2F0b3IuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQUtBLE9BQU8sRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFFLE1BQU0sZUFBZSxDQUFDOztBQUVqRCxNQUFZLE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