ng-zorro-antd-mobile
Version:
An enterprise-class mobile UI components based on Ant Design and Angular
99 lines (94 loc) • 4.71 kB
JavaScript
import * as i0 from '@angular/core';
import { Component, ViewEncapsulation, Input, HostBinding, NgModule } from '@angular/core';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
class ProgressComponent {
get percent() {
return this._percent;
}
set percent(value) {
this._percent = value;
if (value > 100) {
this._exceedance = true;
}
else {
this._exceedance = false;
}
}
get value() {
return this.percent;
}
get fixOuter() {
return 'fixed' === this.position;
}
get hideOuter() {
return !this.unfilled && !this._exceedance;
}
get exceedance() {
return this._exceedance;
}
constructor() {
this.prefixCls = 'am-progress';
this._percent = 0;
this._exceedance = false;
this.unfilled = true;
this.position = 'fixed';
this.barStyle = {};
this.max = 100;
this.amProgress = true;
this.outer = true;
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ProgressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: ProgressComponent, selector: "Progress, nzm-progress", inputs: { unfilled: "unfilled", position: "position", barStyle: "barStyle", percent: "percent" }, host: { properties: { "attr.max": "this.max", "attr.value": "this.value", "class.am-progress": "this.amProgress", "class.am-progress-outer": "this.outer", "class.am-progress-fixed-outer": "this.fixOuter", "class.am-progress-hide-outer": "this.hideOuter", "class.am-progress-exceedance": "this.exceedance" } }, ngImport: i0, template: "<div\n class=\"{{ prefixCls }}-bar\"\n [ngStyle]=\"barStyle\"\n [style.width.%]=\"percent <= 100 ? percent : 10000 / percent\"\n></div>\n", dependencies: [{ kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ProgressComponent, decorators: [{
type: Component,
args: [{ selector: 'Progress, nzm-progress', encapsulation: ViewEncapsulation.None, template: "<div\n class=\"{{ prefixCls }}-bar\"\n [ngStyle]=\"barStyle\"\n [style.width.%]=\"percent <= 100 ? percent : 10000 / percent\"\n></div>\n" }]
}], ctorParameters: () => [], propDecorators: { unfilled: [{
type: Input
}], position: [{
type: Input
}], barStyle: [{
type: Input
}], percent: [{
type: Input
}], max: [{
type: HostBinding,
args: ['attr.max']
}], value: [{
type: HostBinding,
args: ['attr.value']
}], amProgress: [{
type: HostBinding,
args: ['class.am-progress']
}], outer: [{
type: HostBinding,
args: ['class.am-progress-outer']
}], fixOuter: [{
type: HostBinding,
args: ['class.am-progress-fixed-outer']
}], hideOuter: [{
type: HostBinding,
args: ['class.am-progress-hide-outer']
}], exceedance: [{
type: HostBinding,
args: ['class.am-progress-exceedance']
}] } });
class ProgressModule {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ProgressModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: ProgressModule, declarations: [ProgressComponent], imports: [CommonModule], exports: [ProgressComponent] }); }
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ProgressModule, imports: [CommonModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ProgressModule, decorators: [{
type: NgModule,
args: [{
imports: [CommonModule],
declarations: [ProgressComponent],
exports: [ProgressComponent]
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { ProgressComponent, ProgressModule };
//# sourceMappingURL=ng-zorro-antd-mobile-progress.mjs.map