ng-zorro-antd-mobile
Version:
An enterprise-class mobile UI components based on Ant Design and Angular
109 lines (104 loc) • 6.46 kB
JavaScript
import * as i0 from '@angular/core';
import { Component, Input, HostBinding, NgModule } from '@angular/core';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
class ActivityIndicatorComponent {
get animating() {
return this._animating;
}
set animating(v) {
this._animating = v;
this.setClass();
}
set size(v) {
this._size = v;
this.setClass();
}
get toast() {
return this._toast;
}
set toast(v) {
this._toast = v;
this.setClass();
}
get text() {
return this._text;
}
set text(v) {
this._text = v;
}
constructor() {
this.prefixCls = 'am-activity-indicator';
this.spinnerClass = {};
this._size = 'small';
this._toast = false;
this._animating = true;
this.clsActIndicator = true;
}
setClass() {
if (this._animating) {
this.clsActIndicator = true;
this.clsActIndicatorToast = !!this._toast;
this.clsActIndicatorLg = this._size === 'large';
this.clsActIndicatorSm = this._size === 'small';
this.spinnerClass = {
[`${this.prefixCls}-spinner`]: true,
[`${this.prefixCls}-spinner-lg`]: !!this._toast || this._size === 'large'
};
}
else {
this.clsActIndicator = false;
this.clsActIndicatorLg = false;
this.clsActIndicatorSm = false;
this.clsActIndicatorToast = false;
}
}
ngOnInit() {
this.setClass();
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ActivityIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: ActivityIndicatorComponent, selector: "ActivityIndicator , nzm-ctivity-indicator", inputs: { animating: "animating", size: "size", toast: "toast", text: "text" }, host: { properties: { "class.am-activity-indicator": "this.clsActIndicator", "class.am-activity-indicator-toast": "this.clsActIndicatorToast", "class.am-activity-indicator-lg": "this.clsActIndicatorLg", "class.am-activity-indicator-sm": "this.clsActIndicatorSm" } }, ngImport: i0, template: "<div *ngIf=\"animating && toast && text && text.length > 0\">\n <div class=\"{{ prefixCls }}-content\">\n <span [ngClass]=\"spinnerClass\" aria-hidden=\"'true'\"></span>\n <span class=\"{{ prefixCls }}-toast\">{{ text }}</span>\n </div>\n</div>\n<div *ngIf=\"animating && toast && !text\">\n <div class=\"{{ prefixCls }}-content\">\n <span [ngClass]=\"spinnerClass\" aria-label=\"'Loading'\"></span>\n </div>\n</div>\n<div *ngIf=\"animating && !toast && text && text.length > 0\">\n <span [ngClass]=\"spinnerClass\" aria-hidden=\"true\"></span>\n <span class=\"{{ prefixCls }}-tip\">{{ text }}</span>\n</div>\n<div *ngIf=\"animating && !toast && !text\">\n <span [ngClass]=\"spinnerClass\" aria-label=\"'loading'\"></span>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ActivityIndicatorComponent, decorators: [{
type: Component,
args: [{ selector: 'ActivityIndicator , nzm-ctivity-indicator', template: "<div *ngIf=\"animating && toast && text && text.length > 0\">\n <div class=\"{{ prefixCls }}-content\">\n <span [ngClass]=\"spinnerClass\" aria-hidden=\"'true'\"></span>\n <span class=\"{{ prefixCls }}-toast\">{{ text }}</span>\n </div>\n</div>\n<div *ngIf=\"animating && toast && !text\">\n <div class=\"{{ prefixCls }}-content\">\n <span [ngClass]=\"spinnerClass\" aria-label=\"'Loading'\"></span>\n </div>\n</div>\n<div *ngIf=\"animating && !toast && text && text.length > 0\">\n <span [ngClass]=\"spinnerClass\" aria-hidden=\"true\"></span>\n <span class=\"{{ prefixCls }}-tip\">{{ text }}</span>\n</div>\n<div *ngIf=\"animating && !toast && !text\">\n <span [ngClass]=\"spinnerClass\" aria-label=\"'loading'\"></span>\n</div>\n" }]
}], ctorParameters: () => [], propDecorators: { animating: [{
type: Input
}], size: [{
type: Input
}], toast: [{
type: Input
}], text: [{
type: Input
}], clsActIndicator: [{
type: HostBinding,
args: ['class.am-activity-indicator']
}], clsActIndicatorToast: [{
type: HostBinding,
args: ['class.am-activity-indicator-toast']
}], clsActIndicatorLg: [{
type: HostBinding,
args: ['class.am-activity-indicator-lg']
}], clsActIndicatorSm: [{
type: HostBinding,
args: ['class.am-activity-indicator-sm']
}] } });
class ActivityIndicatorModule {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ActivityIndicatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: ActivityIndicatorModule, declarations: [ActivityIndicatorComponent], imports: [CommonModule, FormsModule], exports: [ActivityIndicatorComponent] }); }
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ActivityIndicatorModule, imports: [CommonModule, FormsModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ActivityIndicatorModule, decorators: [{
type: NgModule,
args: [{
exports: [ActivityIndicatorComponent],
declarations: [ActivityIndicatorComponent],
imports: [CommonModule, FormsModule]
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { ActivityIndicatorComponent, ActivityIndicatorModule };
//# sourceMappingURL=ng-zorro-antd-mobile-activity-indicator.mjs.map