/**
 * @fileoverview added by tsickle
 * Generated from: components/progressbar/progressbar.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/*
 MIT License

 Copyright (c) 2019 Temainfo Software

 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, Input, } from '@angular/core';
export class TlProgressBar {
    constructor() {
        this.min = 0;
        this.max = 100;
        this.position = 0;
        this.unit = '';
        this.height = '15px';
        this.shape = 'rounded';
        this.progressInfo = 'percentage';
        this.mode = 'determinate';
        this.color = 'primary';
    }
    /**
     * @return {?}
     */
    ngOnInit() { }
    /**
     * @return {?}
     */
    getProgressDescription() {
        return Math.round(((this.position - this.min) / (this.max - this.min)) * 100);
    }
    /**
     * @param {?} change
     * @return {?}
     */
    ngOnChanges(change) {
        if (change.progress) {
            if (this.position < this.min) {
                this.position = this.min;
            }
            if ((!change.progress.firstChange) && isNaN(change.progress.currentValue)) {
                this.position = 0;
            }
        }
    }
}
TlProgressBar.decorators = [
    { type: Component, args: [{
                selector: 'tl-progressbar',
                template: "<div class=\"wrapper-content-progress\">\n  <div class=\"ui-progressbar-wrapper\" [class.border-rounded]=\"shape === 'rounded'\" [ngClass]=\"color\">\n    <div *ngIf=\"mode === 'determinate'\" class=\"ui-progress-description\" [style.lineHeight]=\"height\">\n      <span *ngIf=\"progressInfo === 'percentage' || progressInfo === 'detailed'\">{{getProgressDescription()}} %</span>\n      <span class=\"ui-progress-detail\" *ngIf=\"progressInfo === 'detailed'\" [style.lineHeight]=\"height\">({{position}} {{unit}} / {{max}} {{unit}})</span>\n    </div>\n    <div class=\"ui-progressbar\" [style.height]=\"height\">\n      <div *ngIf=\"mode === 'determinate'\" [style.transformOrigin]=\"'left'\"\n           [style.transform]=\"'scaleX(' + (position - min) / (max - min) + ')'\"\n           class=\"determinate-progress\">\n      </div>\n      <div *ngIf=\"mode === 'indeterminate'\" [style.transform]=\"'translate3d(' + (position - min / 100) + ', 0, 0)'\"\n           class=\"indeterminate-progress\">\n      </div>\n    </div>\n  </div>\n</div>\n",
                styles: [".ui-progressbar-wrapper{box-sizing:border-box;overflow:hidden;position:relative;width:100%}.border-rounded{border-radius:10px}.ui-progressbar{width:100%}.determinate-progress{height:inherit;transition:all .2s ease-in-out;width:100%}.indeterminate-progress{-webkit-animation-direction:normal;-webkit-animation-duration:2s;-webkit-animation-iteration-count:infinite;-webkit-animation-name:indeterminate;animation-direction:normal;animation-duration:2s;animation-iteration-count:infinite;animation-name:indeterminate;height:inherit;width:50%}.ui-progress-description{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;font-family:Segoe UI,Lato,\"sans-serif\",Arial;font-size:1em;font-weight:700;opacity:.5;position:absolute;text-align:center;user-select:none;width:100%;z-index:1000}.ui-progress-detail{font-size:.7em;font-style:italic;font-weight:400}@-webkit-keyframes indeterminate{0%{transform:translateX(-100%)}to{transform:translateX(210%)}}@keyframes indeterminate{0%{transform:translateX(-100%)}to{transform:translateX(210%)}}"]
            }] }
];
/** @nocollapse */
TlProgressBar.ctorParameters = () => [];
TlProgressBar.propDecorators = {
    min: [{ type: Input }],
    max: [{ type: Input }],
    position: [{ type: Input }],
    unit: [{ type: Input }],
    height: [{ type: Input }],
    shape: [{ type: Input }],
    progressInfo: [{ type: Input }],
    mode: [{ type: Input }],
    color: [{ type: Input }]
};
if (false) {
    /** @type {?} */
    TlProgressBar.prototype.min;
    /** @type {?} */
    TlProgressBar.prototype.max;
    /** @type {?} */
    TlProgressBar.prototype.position;
    /** @type {?} */
    TlProgressBar.prototype.unit;
    /** @type {?} */
    TlProgressBar.prototype.height;
    /** @type {?} */
    TlProgressBar.prototype.shape;
    /** @type {?} */
    TlProgressBar.prototype.progressInfo;
    /** @type {?} */
    TlProgressBar.prototype.mode;
    /** @type {?} */
    TlProgressBar.prototype.color;
}
//# sourceMappingURL=data:application/json;base64, 