// © 2022 SolarWinds Worldwide, LLC. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to
//  deal in the Software without restriction, including without limitation the
//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
//  sell copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
import { Component, EventEmitter, Input, Output, TemplateRef, ViewEncapsulation, } from "@angular/core";
/**
 * <example-url>./../examples/index.html#/progress</example-url>
 */
export class ProgressComponent {
    constructor() {
        this.showProgress = true;
        this.ariaLabel = "Progress bar";
        this.cancel = new EventEmitter();
        this.isIndeterminate = false;
    }
    ngOnChanges() {
        this.isIndeterminate = this.percent === undefined;
    }
    cancelProgress() {
        this.cancel.emit();
    }
}
ProgressComponent.decorators = [
    { type: Component, args: [{
                selector: "nui-progress",
                template: "<div class=\"nui-progress\" [class.nui-progress--shown]=\"show\">\n    <div\n        class=\"nui-progress__header\"\n        *ngIf=\"message && !compactMode\"\n        [ngClass]=\"{ 'nui-progress__header--stacked': stacked }\"\n    >\n        <span\n            class=\"nui-progress__message nui-text-label nui-progress__header-item\"\n            >{{ message }}</span\n        >\n    </div>\n\n    <div\n        *ngIf=\"show && showProgress\"\n        class=\"nui-progress__container\"\n        role=\"progressbar\"\n        aria-valuemin=\"0\"\n        aria-valuemax=\"100\"\n        [attr.aria-label]=\"ariaLabel\"\n        [attr.aria-valuenow]=\"percent || null\"\n    >\n        <div\n            class=\"nui-progress__bar\"\n            [ngClass]=\"{\n                'nui-progress--indeterminate': isIndeterminate,\n                'nui-progress__bar--compact': compactMode\n            }\"\n        >\n            <div\n                class=\"nui-progress__bar-value\"\n                [ngStyle]=\"{ 'width.%': percent }\"\n            ></div>\n        </div>\n\n        <div\n            *ngIf=\"showNumber && !compactMode\"\n            class=\"nui-progress__number nui-progress__header-item nui-text-small\"\n        >\n            {{ percent }}%\n        </div>\n\n        <button\n            nui-button\n            type=\"button\"\n            class=\"nui-progress__cancel\"\n            icon=\"close\"\n            *ngIf=\"allowCancel && !compactMode\"\n            (click)=\"cancelProgress()\"\n            displayStyle=\"action\"\n            [nuiTooltip]=\"'Cancel'\"\n        ></button>\n    </div>\n\n    <div\n        *ngIf=\"!compactMode\"\n        class=\"nui-progress__hint\"\n        [class.nui-progress__hint--stacked]=\"stacked\"\n    >\n        <ng-container\n            [ngTemplateOutlet]=\"\n                helpTemplateRef ? helpTemplateRef : defaultHelpTemplateRef\n            \"\n        ></ng-container>\n    </div>\n</div>\n\n<ng-template #defaultHelpTemplateRef>\n    <span class=\"nui-text-small-secondary\">{{ helpText }}</span>\n</ng-template>\n",
                encapsulation: ViewEncapsulation.None,
                styles: [".nui-progress{display:none}.nui-progress--shown{display:block}.nui-progress__header{text-align:center}.nui-progress__header--stacked{text-align:left}.nui-progress__bar{width:100%;background-color:var(--nui-color-bg-workspace,#f0f0f0);height:5px;margin:5px 0}.nui-progress__bar-value{width:0;height:100%;background-color:var(--nui-color-progress,#00c4d2);transition:1s linear;position:relative;overflow:hidden}.nui-progress__bar--compact{margin:0}.nui-progress__bar:not(.nui-progress--indeterminate) .nui-progress__bar-value:before,.nui-progress__bar:not(.nui-progress--indeterminate) .nui-progress__bar-value:after{content:\"\";position:absolute;width:5px;height:5px;background-color:var(--nui-progress-ripple-color,rgba(255, 255, 255, .4));opacity:0;transform:scale(1);border-radius:100%;transform-origin:0 50%;transition:all .5s ease-in-out}.nui-progress__bar:not(.nui-progress--indeterminate) .nui-progress__bar-value:before{animation:progress-bar-ripple 1.2s ease-in-out .2s infinite}.nui-progress__bar:not(.nui-progress--indeterminate) .nui-progress__bar-value:after{animation:progress-bar-ripple 1.2s ease-in-out .4s infinite}@keyframes progress-bar-ripple{0%{transform:scaleX(0);opacity:.8}30%{opacity:.3}50%{transform:scaleX(200);opacity:0}to{transform:scaleX(200);opacity:0}}.nui-progress__message{display:block}.nui-progress__hint{text-align:center}.nui-progress__hint--stacked{text-align:left}.nui-progress__hint .nui-text-small-secondary{display:block}.nui-progress__number{position:relative;top:-1px;margin-left:5px}.nui-progress__container{max-height:15px;display:flex;align-items:center}.nui-progress--indeterminate .nui-progress__bar-value{animation-name:indeterminate-progress;animation-duration:1.6s;animation-iteration-count:infinite;animation-timing-function:cubic-bezier(.3,.5,.3,.9)}@keyframes indeterminate-progress{50%{margin-left:25%;width:50%}to{margin-left:100%}}.nui-progress__cancel.nui-button{position:relative;top:-1px;margin-left:5px}\n"]
            },] }
];
ProgressComponent.propDecorators = {
    show: [{ type: Input }],
    showProgress: [{ type: Input }],
    message: [{ type: Input }],
    showNumber: [{ type: Input }],
    percent: [{ type: Input }],
    allowCancel: [{ type: Input }],
    cancelText: [{ type: Input }],
    helpText: [{ type: Input }],
    stacked: [{ type: Input }],
    compactMode: [{ type: Input }],
    ariaLabel: [{ type: Input }],
    helpTemplateRef: [{ type: Input }],
    cancel: [{ type: Output }]
};
//# sourceMappingURL=data:application/json;base64, 