igniteui-webcomponents
Version:
Ignite UI for Web Components is a complete library of UI components, giving you the ability to build modern web applications using encapsulation and the concept of reusable components in a dependency-free approach.
63 lines • 2.87 kB
JavaScript
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var IgcLinearProgressComponent_1;
import { html } from 'lit';
import { property } from 'lit/decorators.js';
import { styleMap } from 'lit/directives/style-map.js';
import { themes } from '../../theming/theming-decorator.js';
import { registerComponent } from '../common/definitions/register.js';
import { partNameMap } from '../common/util.js';
import { IgcProgressBaseComponent } from './base.js';
import { styles } from './themes/linear/linear.progress.base.css.js';
import { styles as shared } from './themes/linear/shared/linear.progress.common.css.js';
import { all } from './themes/linear/themes.js';
let IgcLinearProgressComponent = IgcLinearProgressComponent_1 = class IgcLinearProgressComponent extends IgcProgressBaseComponent {
constructor() {
super(...arguments);
this.striped = false;
this.labelAlign = 'top-start';
}
static register() {
registerComponent(IgcLinearProgressComponent_1);
}
render() {
const parts = partNameMap({
fill: true,
striped: this.striped,
indeterminate: this.indeterminate,
primary: this.variant === 'primary',
success: this.variant === 'success',
danger: this.variant === 'danger',
warning: this.variant === 'warning',
info: this.variant === 'info',
});
const animation = {
width: `${this.progress * 100}%`,
'--duration': `${this.animationDuration}ms`,
};
return html `
<div part="track">
<div part=${parts} style=${styleMap(animation)}></div>
<div part="${parts} secondary"></div>
</div>
${this.renderDefaultSlot()}
`;
}
};
IgcLinearProgressComponent.tagName = 'igc-linear-progress';
IgcLinearProgressComponent.styles = [styles, shared];
__decorate([
property({ type: Boolean, reflect: true })
], IgcLinearProgressComponent.prototype, "striped", void 0);
__decorate([
property({ attribute: 'label-align', reflect: true })
], IgcLinearProgressComponent.prototype, "labelAlign", void 0);
IgcLinearProgressComponent = IgcLinearProgressComponent_1 = __decorate([
themes(all)
], IgcLinearProgressComponent);
export default IgcLinearProgressComponent;
//# sourceMappingURL=linear-progress.js.map