ng-zorro-antd-mobile
Version:
An enterprise-class mobile UI components based on Ant Design and Angular
81 lines (76 loc) • 4.17 kB
JavaScript
import * as i0 from '@angular/core';
import { Component, ViewEncapsulation, Input, NgModule } from '@angular/core';
import * as i2 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i1 from 'ng-zorro-antd-mobile/core';
import { IconHandler } from 'ng-zorro-antd-mobile/core';
class IconComponent {
get type() {
return this._type;
}
set type(value) {
this._type = value;
this.setClsMap();
}
get src() {
return this._src;
}
set src(value) {
this._src = value;
this.setClsMap();
}
get size() {
return this._size;
}
set size(value) {
this._size = value;
this.setClsMap();
}
constructor(_iconHandler) {
this._iconHandler = _iconHandler;
this.clsMap = {};
this._type = '';
this._size = 'md';
this._src = '';
this.color = '';
this._iconHandler.load();
}
setClsMap() {
this.clsMap = {
[`am-icon-${this._type}`]: true,
[`am-icon-${this._size}`]: true
};
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: IconComponent, deps: [{ token: i1.IconHandler }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: IconComponent, selector: "Icon, nzm-icon", inputs: { color: "color", type: "type", src: "src", size: "size" }, providers: [IconHandler], ngImport: i0, template: "<svg *ngIf=\"type\" class=\"am-icon\" [ngClass]=\"clsMap\" [ngStyle]=\"{ color: color }\">\n <use xmlns:xlink=\"https://www.w3.org/1999/xlink\" attr.xlink:href=\"#{{ type }}\"></use>\n</svg>\n<img *ngIf=\"src\" src=\"{{ src }}\" class=\"am-icon\" [ngClass]=\"clsMap\" />\n<ng-content></ng-content>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: IconComponent, decorators: [{
type: Component,
args: [{ selector: 'Icon, nzm-icon', encapsulation: ViewEncapsulation.None, providers: [IconHandler], template: "<svg *ngIf=\"type\" class=\"am-icon\" [ngClass]=\"clsMap\" [ngStyle]=\"{ color: color }\">\n <use xmlns:xlink=\"https://www.w3.org/1999/xlink\" attr.xlink:href=\"#{{ type }}\"></use>\n</svg>\n<img *ngIf=\"src\" src=\"{{ src }}\" class=\"am-icon\" [ngClass]=\"clsMap\" />\n<ng-content></ng-content>\n" }]
}], ctorParameters: () => [{ type: i1.IconHandler }], propDecorators: { color: [{
type: Input
}], type: [{
type: Input
}], src: [{
type: Input
}], size: [{
type: Input
}] } });
class IconModule {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: IconModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: IconModule, declarations: [IconComponent], imports: [CommonModule], exports: [IconComponent] }); }
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: IconModule, imports: [CommonModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: IconModule, decorators: [{
type: NgModule,
args: [{
imports: [CommonModule],
exports: [IconComponent],
declarations: [IconComponent]
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { IconComponent, IconModule };
//# sourceMappingURL=ng-zorro-antd-mobile-icon.mjs.map