@coreui/icons-angular 3.0.0-alpha.3 → 3.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -3
- package/{esm2015/coreui-icons-angular.js → esm2020/coreui-icons-angular.mjs} +0 -0
- package/esm2020/lib/icon/icon.component.mjs +110 -0
- package/esm2020/lib/icon/icon.directive.mjs +127 -0
- package/{esm2015/lib/icon/icon.interface.js → esm2020/lib/icon/icon.interface.mjs} +0 -0
- package/{esm2015/lib/icon/icon.module.js → esm2020/lib/icon/icon.module.mjs} +5 -5
- package/{esm2015/lib/icon-set/icon-set.module.js → esm2020/lib/icon-set/icon-set.module.mjs} +5 -5
- package/{esm2015/lib/icon-set/icon-set.service.js → esm2020/lib/icon-set/icon-set.service.mjs} +4 -4
- package/{esm2015/lib/icon-set/index.js → esm2020/lib/icon-set/index.mjs} +0 -0
- package/{esm2015/lib/icon-set/public_api.js → esm2020/lib/icon-set/public_api.mjs} +0 -0
- package/{esm2015/lib/shared/html-attr.directive.js → esm2020/lib/shared/html-attr.directive.mjs} +4 -4
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +1 -1
- package/fesm2015/{coreui-icons-angular.js → coreui-icons-angular.mjs} +29 -31
- package/fesm2015/coreui-icons-angular.mjs.map +1 -0
- package/fesm2020/coreui-icons-angular.mjs +393 -0
- package/fesm2020/coreui-icons-angular.mjs.map +1 -0
- package/package.json +21 -8
- package/bundles/coreui-icons-angular.umd.js +0 -528
- package/bundles/coreui-icons-angular.umd.js.map +0 -1
- package/esm2015/lib/icon/icon.component.js +0 -117
- package/esm2015/lib/icon/icon.directive.js +0 -131
- package/fesm2015/coreui-icons-angular.js.map +0 -1
|
@@ -30,9 +30,9 @@ class IconSetService {
|
|
|
30
30
|
return this.icons[name];
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
IconSetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
34
|
-
IconSetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
35
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
33
|
+
IconSetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconSetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
34
|
+
IconSetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconSetService, providedIn: 'root' });
|
|
35
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconSetService, decorators: [{
|
|
36
36
|
type: Injectable,
|
|
37
37
|
args: [{
|
|
38
38
|
providedIn: 'root'
|
|
@@ -54,14 +54,14 @@ class IconSetModule {
|
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
IconSetModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
58
|
-
IconSetModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "
|
|
59
|
-
IconSetModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
57
|
+
IconSetModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconSetModule, deps: [{ token: IconSetModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
58
|
+
IconSetModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconSetModule, imports: [CommonModule] });
|
|
59
|
+
IconSetModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconSetModule, providers: [
|
|
60
60
|
IconSetService
|
|
61
61
|
], imports: [[
|
|
62
62
|
CommonModule
|
|
63
63
|
]] });
|
|
64
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconSetModule, decorators: [{
|
|
65
65
|
type: NgModule,
|
|
66
66
|
args: [{
|
|
67
67
|
imports: [
|
|
@@ -71,11 +71,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImpo
|
|
|
71
71
|
IconSetService
|
|
72
72
|
]
|
|
73
73
|
}]
|
|
74
|
-
}], ctorParameters: function () {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
}], ctorParameters: function () {
|
|
75
|
+
return [{ type: IconSetModule, decorators: [{
|
|
76
|
+
type: Optional
|
|
77
|
+
}, {
|
|
78
|
+
type: SkipSelf
|
|
79
|
+
}] }];
|
|
80
|
+
} });
|
|
79
81
|
|
|
80
82
|
class IconDirective {
|
|
81
83
|
constructor(renderer, elementRef, sanitizer, iconSet) {
|
|
@@ -152,9 +154,9 @@ class IconDirective {
|
|
|
152
154
|
});
|
|
153
155
|
}
|
|
154
156
|
}
|
|
155
|
-
IconDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
156
|
-
IconDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
157
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
157
|
+
IconDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1.DomSanitizer }, { token: IconSetService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
158
|
+
IconDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.3", type: IconDirective, selector: "svg[cIcon]", inputs: { content: ["cIcon", "content"], size: "size", title: "title", customClasses: "customClasses", width: "width", height: "height", name: "name", viewBox: "viewBox", xmlns: "xmlns", pointerEvents: ["pointer-events", "pointerEvents"], role: "role" }, host: { properties: { "attr.viewBox": "this.viewBox", "attr.xmlns": "this.xmlns", "attr.pointer-events": "this.pointerEvents", "attr.role": "this.role", "class": "this.hostClasses", "innerHtml": "this.innerHtml" } }, exportAs: ["cIcon"], ngImport: i0 });
|
|
159
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconDirective, decorators: [{
|
|
158
160
|
type: Directive,
|
|
159
161
|
args: [{
|
|
160
162
|
selector: 'svg[cIcon]',
|
|
@@ -241,9 +243,9 @@ class HtmlAttributesDirective {
|
|
|
241
243
|
this.renderer.removeAttribute(this.el.nativeElement, key);
|
|
242
244
|
}
|
|
243
245
|
}
|
|
244
|
-
HtmlAttributesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
245
|
-
HtmlAttributesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
246
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
246
|
+
HtmlAttributesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: HtmlAttributesDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
247
|
+
HtmlAttributesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.3", type: HtmlAttributesDirective, selector: "[cHtmlAttr]", inputs: { cHtmlAttr: "cHtmlAttr" }, exportAs: ["cHtmlAttr"], ngImport: i0 });
|
|
248
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: HtmlAttributesDirective, decorators: [{
|
|
247
249
|
type: Directive,
|
|
248
250
|
args: [{
|
|
249
251
|
selector: '[cHtmlAttr]',
|
|
@@ -330,15 +332,11 @@ class IconComponent {
|
|
|
330
332
|
});
|
|
331
333
|
}
|
|
332
334
|
}
|
|
333
|
-
IconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
334
|
-
IconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "
|
|
335
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
335
|
+
IconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1.DomSanitizer }, { token: IconSetService }], target: i0.ɵɵFactoryTarget.Component });
|
|
336
|
+
IconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.3", type: IconComponent, selector: "c-icon", inputs: { attributes: "attributes", content: "content", size: "size", title: "title", use: "use", customClasses: "customClasses", width: "width", height: "height", name: "name", viewBox: "viewBox" }, viewQueries: [{ propertyName: "svgElementRef", first: true, predicate: ["svgElement"], descendants: true, read: ElementRef }], ngImport: i0, template: "<svg *ngIf=\"(!use) && (!!code)\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n [attr.width]=\"width\"\r\n [attr.height]=\"height || width\"\r\n [attr.viewBox]=\"viewBox\"\r\n [innerHtml]=\"innerHtml\"\r\n [ngClass]=\"computedClasses\"\r\n [cHtmlAttr]=\"attributes\"\r\n role=\"img\"\r\n pointer-events=\"none\"\r\n #svgElement\r\n>\r\n</svg>\r\n\r\n<svg *ngIf=\"use\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n [attr.width]=\"width\"\r\n [attr.height]=\"height || width\"\r\n [ngClass]=\"computedClasses\"\r\n [cHtmlAttr]=\"attributes\"\r\n role=\"img\"\r\n pointer-events=\"none\"\r\n>\r\n <use [attr.href]=\"use\"></use>\r\n</svg>\r\n", styles: [".icon{display:inline-block;color:inherit;text-align:center;vertical-align:-.125rem;fill:currentColor}.icon:not(.icon-c-s):not(.icon-custom-size){width:1rem;height:1rem;font-size:1rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-xxl{width:2rem;height:2rem;font-size:2rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-xl{width:1.5rem;height:1.5rem;font-size:1.5rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-lg{width:1.25rem;height:1.25rem;font-size:1.25rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-sm{width:.875rem;height:.875rem;font-size:.875rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-3xl{width:3rem;height:3rem;font-size:3rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-4xl{width:4rem;height:4rem;font-size:4rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-5xl{width:5rem;height:5rem;font-size:5rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-6xl{width:6rem;height:6rem;font-size:6rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-7xl{width:7rem;height:7rem;font-size:7rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-8xl{width:8rem;height:8rem;font-size:8rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-9xl{width:9rem;height:9rem;font-size:9rem}\n"], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: HtmlAttributesDirective, selector: "[cHtmlAttr]", inputs: ["cHtmlAttr"], exportAs: ["cHtmlAttr"] }] });
|
|
337
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconComponent, decorators: [{
|
|
336
338
|
type: Component,
|
|
337
|
-
args: [{
|
|
338
|
-
selector: 'c-icon',
|
|
339
|
-
templateUrl: './icon.component.svg',
|
|
340
|
-
styleUrls: ['./icon.component.scss']
|
|
341
|
-
}]
|
|
339
|
+
args: [{ selector: 'c-icon', template: "<svg *ngIf=\"(!use) && (!!code)\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n [attr.width]=\"width\"\r\n [attr.height]=\"height || width\"\r\n [attr.viewBox]=\"viewBox\"\r\n [innerHtml]=\"innerHtml\"\r\n [ngClass]=\"computedClasses\"\r\n [cHtmlAttr]=\"attributes\"\r\n role=\"img\"\r\n pointer-events=\"none\"\r\n #svgElement\r\n>\r\n</svg>\r\n\r\n<svg *ngIf=\"use\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n [attr.width]=\"width\"\r\n [attr.height]=\"height || width\"\r\n [ngClass]=\"computedClasses\"\r\n [cHtmlAttr]=\"attributes\"\r\n role=\"img\"\r\n pointer-events=\"none\"\r\n>\r\n <use [attr.href]=\"use\"></use>\r\n</svg>\r\n", styles: [".icon{display:inline-block;color:inherit;text-align:center;vertical-align:-.125rem;fill:currentColor}.icon:not(.icon-c-s):not(.icon-custom-size){width:1rem;height:1rem;font-size:1rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-xxl{width:2rem;height:2rem;font-size:2rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-xl{width:1.5rem;height:1.5rem;font-size:1.5rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-lg{width:1.25rem;height:1.25rem;font-size:1.25rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-sm{width:.875rem;height:.875rem;font-size:.875rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-3xl{width:3rem;height:3rem;font-size:3rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-4xl{width:4rem;height:4rem;font-size:4rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-5xl{width:5rem;height:5rem;font-size:5rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-6xl{width:6rem;height:6rem;font-size:6rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-7xl{width:7rem;height:7rem;font-size:7rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-8xl{width:8rem;height:8rem;font-size:8rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-9xl{width:9rem;height:9rem;font-size:9rem}\n"] }]
|
|
342
340
|
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1.DomSanitizer }, { type: IconSetService }]; }, propDecorators: { attributes: [{
|
|
343
341
|
type: Input
|
|
344
342
|
}], content: [{
|
|
@@ -366,15 +364,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImpo
|
|
|
366
364
|
|
|
367
365
|
class IconModule {
|
|
368
366
|
}
|
|
369
|
-
IconModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
370
|
-
IconModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "
|
|
367
|
+
IconModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
368
|
+
IconModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconModule, declarations: [IconComponent,
|
|
371
369
|
HtmlAttributesDirective,
|
|
372
370
|
IconDirective], imports: [CommonModule], exports: [IconComponent,
|
|
373
371
|
IconDirective] });
|
|
374
|
-
IconModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
372
|
+
IconModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconModule, imports: [[
|
|
375
373
|
CommonModule,
|
|
376
374
|
]] });
|
|
377
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
375
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconModule, decorators: [{
|
|
378
376
|
type: NgModule,
|
|
379
377
|
args: [{
|
|
380
378
|
declarations: [
|
|
@@ -401,4 +399,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImpo
|
|
|
401
399
|
*/
|
|
402
400
|
|
|
403
401
|
export { IconComponent, IconDirective, IconModule, IconSetModule, IconSetService };
|
|
404
|
-
//# sourceMappingURL=coreui-icons-angular.
|
|
402
|
+
//# sourceMappingURL=coreui-icons-angular.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coreui-icons-angular.mjs","sources":["../../../projects/coreui-icons-angular/src/lib/icon-set/icon-set.service.ts","../../../projects/coreui-icons-angular/src/lib/icon-set/icon-set.module.ts","../../../projects/coreui-icons-angular/src/lib/icon/icon.directive.ts","../../../projects/coreui-icons-angular/src/lib/shared/html-attr.directive.ts","../../../projects/coreui-icons-angular/src/lib/icon/icon.component.ts","../../../projects/coreui-icons-angular/src/lib/icon/icon.component.svg","../../../projects/coreui-icons-angular/src/lib/icon/icon.module.ts","../../../projects/coreui-icons-angular/src/public-api.ts","../../../projects/coreui-icons-angular/src/coreui-icons-angular.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\nexport interface IIconSet {\r\n [iconName: string]: string[];\r\n}\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class IconSetService {\r\n\r\n constructor() {}\r\n\r\n public get iconNames() {\r\n return this._iconNames;\r\n };\r\n private _iconNames: { [key: string]: string } = {};\r\n\r\n get icons(): IIconSet {\r\n return this._icons;\r\n }\r\n set icons(iconSet) {\r\n for (const iconsKey in iconSet) {\r\n this._iconNames[iconsKey] = iconsKey;\r\n }\r\n this._icons = iconSet;\r\n }\r\n private _icons: IIconSet = {};\r\n\r\n public getIcon(name: string): string[] {\r\n const icon = this.icons[name];\r\n if (!icon) {\r\n console.warn(`CoreUI WARN: Icon ${name} is not registered in IconService`);\r\n }\r\n return this.icons[name];\r\n }\r\n}\r\n","import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { IconSetService } from './icon-set.service';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule\r\n ],\r\n providers: [\r\n IconSetService\r\n ]\r\n})\r\nexport class IconSetModule {\r\n constructor(@Optional() @SkipSelf() parentModule?: IconSetModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'CoreUI IconSetModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n\r\n static forRoot(): ModuleWithProviders<IconSetModule> {\r\n return {\r\n ngModule: IconSetModule,\r\n providers: [\r\n { provide: IconSetService }\r\n ]\r\n };\r\n }\r\n}\r\n","import { Directive, ElementRef, HostBinding, Input, Renderer2 } from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { IconSetService } from '../icon-set';\n\nimport { IconSize, IIcon } from './icon.interface';\n\n@Directive({\n selector: 'svg[cIcon]',\n exportAs: 'cIcon'\n})\nexport class IconDirective implements IIcon {\n\n @Input('cIcon') content?: string | string[] | any[];\n @Input() size: IconSize = '';\n @Input() title?: string;\n @Input() customClasses?: string | string[] | Set<string> | { [klass: string]: any };\n @Input() width?: string;\n @Input() height?: string;\n\n @Input()\n set name(name: string) {\n this._name = name?.includes('-') ? this.toCamelCase(name) : name;\n }\n get name(): string {\n return this._name;\n }\n private _name!: string;\n\n @HostBinding('attr.viewBox')\n @Input()\n set viewBox(viewBox: string) {\n this._viewBox = viewBox;\n }\n get viewBox(): string {\n return this._viewBox ?? this.scale;\n }\n private _viewBox!: string;\n\n @HostBinding('attr.xmlns')\n @Input() xmlns = 'http://www.w3.org/2000/svg';\n\n @HostBinding('attr.pointer-events')\n @Input('pointer-events') pointerEvents = 'none';\n\n @HostBinding('attr.role')\n @Input() role = 'img';\n\n @HostBinding('class')\n get hostClasses() {\n const classes = {\n icon: true,\n [`icon-${this.computedSize}`]: !!this.computedSize\n };\n return this.customClasses ?? classes;\n }\n\n @HostBinding('innerHtml')\n get innerHtml() {\n const code = Array.isArray(this.code) ? this.code[1] || this.code[0] : this.code ?? '';\n // todo proper sanitize\n // const sanitized = this.sanitizer.sanitize(SecurityContext.HTML, code);\n return this.sanitizer.bypassSecurityTrustHtml((this.titleCode + code) ?? '');\n }\n\n constructor(\n private renderer: Renderer2,\n private elementRef: ElementRef,\n private sanitizer: DomSanitizer,\n private iconSet: IconSetService\n ) { }\n\n get titleCode(): string {\n return this.title ? `<title>${this.title}</title>` : '';\n }\n\n get code(): string | string[] | undefined {\n if (this.content) {\n return this.content;\n }\n if (this.iconSet && this.name) {\n return this.iconSet.getIcon(this.name);\n }\n if (this.name && !this.iconSet?.icons[this.name])\n console.warn(`c-icon component: icon name '${this.name}' does not exist for IconSet service. ` +\n `To use icon by 'name' prop you need to add it to IconSet service. \\n`,\n this.name\n );\n return undefined;\n }\n\n get scale(): string {\n return Array.isArray(this.code) && this.code.length > 1 ? `0 0 ${this.code[0]}` : '0 0 64 64';\n }\n\n get computedSize(): Exclude<IconSize, 'custom'> | undefined {\n const addCustom = !this.size && (this.width || this.height);\n return this.size === 'custom' || addCustom ? 'custom-size' : this.size;\n }\n\n get computedClasses(): any {\n const classes = {\n icon: true,\n [`icon-${this.computedSize}`]: !!this.computedSize\n };\n return !!this.customClasses ? this.customClasses : classes;\n }\n\n toCamelCase(str: string): any {\n return str.replace(/([-_][a-z0-9])/ig, ($1: string) => {\n return $1.toUpperCase().replace('-', '');\n });\n }\n}\n","import { Directive, ElementRef, Input, OnInit, Renderer2 } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[cHtmlAttr]',\r\n exportAs: 'cHtmlAttr'\r\n})\r\nexport class HtmlAttributesDirective implements OnInit {\r\n\r\n @Input() cHtmlAttr?: { [key: string]: any };\r\n\r\n constructor(\r\n private renderer: Renderer2,\r\n private el: ElementRef\r\n ) {}\r\n\r\n ngOnInit(): void {\r\n const attribs = this.cHtmlAttr;\r\n for (const attr in attribs) {\r\n if (attr === 'style' && typeof (attribs[attr]) === 'object') {\r\n this.setStyle(attribs[attr]);\r\n } else if (attr === 'class') {\r\n this.addClass(attribs[attr]);\r\n } else {\r\n this.setAttrib(attr, attribs[attr]);\r\n }\r\n }\r\n }\r\n\r\n private setStyle(styles: any): void {\r\n // tslint:disable-next-line:forin\r\n for (const style in styles) {\r\n this.renderer.setStyle(this.el.nativeElement, style, styles[style]);\r\n }\r\n }\r\n\r\n private addClass(classes: string | string[]): void {\r\n const classArray = (Array.isArray(classes) ? classes : classes.split(' '));\r\n classArray.filter((element) => element.length > 0).forEach(element => {\r\n this.renderer.addClass(this.el.nativeElement, element);\r\n });\r\n }\r\n\r\n private setAttrib(key: string, value: string | null): void {\r\n value !== null ?\r\n this.renderer.setAttribute(this.el.nativeElement, key, value) :\r\n this.renderer.removeAttribute(this.el.nativeElement, key);\r\n }\r\n}\r\n","import { AfterViewInit, Component, ElementRef, Input, Renderer2, ViewChild } from '@angular/core';\r\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\r\nimport { IconSetService } from '../icon-set/icon-set.service';\r\nimport { IconSize, IIcon } from './icon.interface';\r\n\r\n@Component({\r\n selector: 'c-icon',\r\n templateUrl: './icon.component.svg',\r\n styleUrls: ['./icon.component.scss']\r\n})\r\nexport class IconComponent implements IIcon, AfterViewInit {\r\n\r\n @Input() attributes: any = {role: 'img'};\r\n @Input() content?: string | string[] | any[];\r\n @Input() size: IconSize = '';\r\n @Input() title?: string;\r\n @Input() use = '';\r\n @Input() customClasses?: string | string[] | Set<string> | { [klass: string]: any } = '';\r\n @Input() width?: string;\r\n @Input() height?: string;\r\n\r\n @Input()\r\n set name(name: string) {\r\n this._name = name.includes('-') ? this.toCamelCase(name) : name;\r\n }\r\n get name(): string {\r\n return this._name;\r\n }\r\n private _name!: string;\r\n\r\n @Input()\r\n set viewBox(viewBox: string) {\r\n this._viewBox = viewBox;\r\n }\r\n get viewBox(): string {\r\n return this._viewBox ?? this.scale;\r\n }\r\n private _viewBox!: string;\r\n\r\n @ViewChild('svgElement', {read: ElementRef}) svgElementRef!: ElementRef;\r\n\r\n get innerHtml(): SafeHtml {\r\n const code = Array.isArray(this.code) ? this.code[1] || this.code[0] : this.code ?? '';\r\n // todo proper sanitize\r\n // const sanitized = this.sanitizer.sanitize(SecurityContext.HTML, code);\r\n return this.sanitizer.bypassSecurityTrustHtml((this.titleCode + code) ?? '');\r\n }\r\n\r\n constructor(\r\n private renderer: Renderer2,\r\n private elementRef: ElementRef,\r\n private sanitizer: DomSanitizer,\r\n private iconSet: IconSetService\r\n ) {\r\n this.renderer.setStyle(this.elementRef.nativeElement, 'display', 'none');\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n this.elementRef.nativeElement.classList.forEach((item: string) => {\r\n this.renderer.addClass(this.svgElementRef.nativeElement, item);\r\n });\r\n const parentElement = this.renderer.parentNode(this.elementRef.nativeElement);\r\n const svgElement = this.svgElementRef.nativeElement;\r\n this.renderer.insertBefore(parentElement, svgElement, this.elementRef.nativeElement);\r\n this.renderer.removeChild(parentElement, this.elementRef.nativeElement);\r\n }\r\n\r\n get titleCode(): string {\r\n return this.title ? `<title>${this.title}</title>` : '';\r\n }\r\n\r\n get code(): string | string[] | undefined {\r\n if (this.content) {\r\n return this.content;\r\n }\r\n if (this.iconSet && this.name) {\r\n return this.iconSet.getIcon(this.name);\r\n }\r\n if (this.name && !this.iconSet?.icons[this.name])\r\n console.warn(`c-icon component: icon name '${this.name}' does not exist for IconSet service. ` +\r\n `To use icon by 'name' prop you need to add it to IconSet service. \\n`,\r\n this.name\r\n );\r\n return undefined;\r\n }\r\n\r\n get scale(): string {\r\n return Array.isArray(this.code) && this.code.length > 1 ? `0 0 ${this.code[0]}` : '0 0 64 64';\r\n }\r\n\r\n get computedSize(): Exclude<IconSize, 'custom'> | undefined {\r\n const addCustom = !this.size && (this.width || this.height);\r\n return this.size === 'custom' || addCustom ? 'custom-size' : this.size;\r\n }\r\n\r\n get computedClasses(): any {\r\n const classes = {\r\n icon: true,\r\n [`icon-${this.computedSize}`]: !!this.computedSize\r\n };\r\n return !!this.customClasses ? this.customClasses : classes;\r\n }\r\n\r\n toCamelCase(str: string): any {\r\n return str.replace(/([-_][a-z0-9])/ig, ($1: string) => {\r\n return $1.toUpperCase().replace('-', '');\r\n });\r\n }\r\n}\r\n","<svg *ngIf=\"(!use) && (!!code)\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n [attr.width]=\"width\"\r\n [attr.height]=\"height || width\"\r\n [attr.viewBox]=\"viewBox\"\r\n [innerHtml]=\"innerHtml\"\r\n [ngClass]=\"computedClasses\"\r\n [cHtmlAttr]=\"attributes\"\r\n role=\"img\"\r\n pointer-events=\"none\"\r\n #svgElement\r\n>\r\n</svg>\r\n\r\n<svg *ngIf=\"use\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n [attr.width]=\"width\"\r\n [attr.height]=\"height || width\"\r\n [ngClass]=\"computedClasses\"\r\n [cHtmlAttr]=\"attributes\"\r\n role=\"img\"\r\n pointer-events=\"none\"\r\n>\r\n <use [attr.href]=\"use\"></use>\r\n</svg>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { IconComponent } from './icon.component';\r\nimport { IconDirective } from './icon.directive';\r\nimport { HtmlAttributesDirective } from '../shared/html-attr.directive';\r\n\r\n@NgModule({\r\n declarations: [\r\n IconComponent,\r\n HtmlAttributesDirective,\r\n IconDirective\r\n ],\r\n imports: [\r\n CommonModule,\r\n ],\r\n exports: [\r\n IconComponent,\r\n IconDirective\r\n ],\r\n})\r\nexport class IconModule {\r\n}\r\n","/*\n * Public API Surface of @coreui/icons-angular\n */\nexport { IconDirective } from './lib/icon/icon.directive';\nexport { IconComponent } from './lib/icon/icon.component';\nexport { IconModule } from './lib/icon/icon.module';\nexport { IconSetService, IIconSet } from './lib/icon-set/icon-set.service';\nexport { IconSetModule } from './lib/icon-set/icon-set.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './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Ab,KAAK;gBACG,GAAG;sBAAX,KAAK;gBACG,aAAa;sBAArB,KAAK;gBACG,KAAK;sBAAb,KAAK;gBACG,MAAM;sBAAd,KAAK;gBAGF,IAAI;sBADP,KAAK;gBAUF,OAAO;sBADV,KAAK;gBASuC,aAAa;sBAAzD,SAAS;uBAAC,YAAY,EAAE,EAAC,IAAI,EAAE,UAAU,EAAC;;;MElBhC,UAAU;;uGAAV,UAAU;wGAAV,UAAU,iBAZnB,aAAa;QACb,uBAAuB;QACvB,aAAa,aAGb,YAAY,aAGZ,aAAa;QACb,aAAa;wGAGJ,UAAU,YARZ;YACP,YAAY;SACb;2FAMU,UAAU;kBAdtB,QAAQ;mBAAC;oBACR,YAAY,EAAE;wBACZ,aAAa;wBACb,uBAAuB;wBACvB,aAAa;qBACd;oBACD,OAAO,EAAE;wBACP,YAAY;qBACb;oBACD,OAAO,EAAE;wBACP,aAAa;wBACb,aAAa;qBACd;iBACF;;;ACpBD;;;;ACAA;;;;;;"}
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, NgModule, Optional, SkipSelf, Directive, Input, HostBinding, ElementRef, Component, ViewChild } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/platform-browser';
|
|
4
|
+
import * as i3 from '@angular/common';
|
|
5
|
+
import { CommonModule } from '@angular/common';
|
|
6
|
+
|
|
7
|
+
class IconSetService {
|
|
8
|
+
constructor() {
|
|
9
|
+
this._iconNames = {};
|
|
10
|
+
this._icons = {};
|
|
11
|
+
}
|
|
12
|
+
get iconNames() {
|
|
13
|
+
return this._iconNames;
|
|
14
|
+
}
|
|
15
|
+
;
|
|
16
|
+
get icons() {
|
|
17
|
+
return this._icons;
|
|
18
|
+
}
|
|
19
|
+
set icons(iconSet) {
|
|
20
|
+
for (const iconsKey in iconSet) {
|
|
21
|
+
this._iconNames[iconsKey] = iconsKey;
|
|
22
|
+
}
|
|
23
|
+
this._icons = iconSet;
|
|
24
|
+
}
|
|
25
|
+
getIcon(name) {
|
|
26
|
+
const icon = this.icons[name];
|
|
27
|
+
if (!icon) {
|
|
28
|
+
console.warn(`CoreUI WARN: Icon ${name} is not registered in IconService`);
|
|
29
|
+
}
|
|
30
|
+
return this.icons[name];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
IconSetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconSetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
34
|
+
IconSetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconSetService, providedIn: 'root' });
|
|
35
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconSetService, decorators: [{
|
|
36
|
+
type: Injectable,
|
|
37
|
+
args: [{
|
|
38
|
+
providedIn: 'root'
|
|
39
|
+
}]
|
|
40
|
+
}], ctorParameters: function () { return []; } });
|
|
41
|
+
|
|
42
|
+
class IconSetModule {
|
|
43
|
+
constructor(parentModule) {
|
|
44
|
+
if (parentModule) {
|
|
45
|
+
throw new Error('CoreUI IconSetModule is already loaded. Import it in the AppModule only');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
static forRoot() {
|
|
49
|
+
return {
|
|
50
|
+
ngModule: IconSetModule,
|
|
51
|
+
providers: [
|
|
52
|
+
{ provide: IconSetService }
|
|
53
|
+
]
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
IconSetModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconSetModule, deps: [{ token: IconSetModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
58
|
+
IconSetModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconSetModule, imports: [CommonModule] });
|
|
59
|
+
IconSetModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconSetModule, providers: [
|
|
60
|
+
IconSetService
|
|
61
|
+
], imports: [[
|
|
62
|
+
CommonModule
|
|
63
|
+
]] });
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconSetModule, decorators: [{
|
|
65
|
+
type: NgModule,
|
|
66
|
+
args: [{
|
|
67
|
+
imports: [
|
|
68
|
+
CommonModule
|
|
69
|
+
],
|
|
70
|
+
providers: [
|
|
71
|
+
IconSetService
|
|
72
|
+
]
|
|
73
|
+
}]
|
|
74
|
+
}], ctorParameters: function () { return [{ type: IconSetModule, decorators: [{
|
|
75
|
+
type: Optional
|
|
76
|
+
}, {
|
|
77
|
+
type: SkipSelf
|
|
78
|
+
}] }]; } });
|
|
79
|
+
|
|
80
|
+
class IconDirective {
|
|
81
|
+
constructor(renderer, elementRef, sanitizer, iconSet) {
|
|
82
|
+
this.renderer = renderer;
|
|
83
|
+
this.elementRef = elementRef;
|
|
84
|
+
this.sanitizer = sanitizer;
|
|
85
|
+
this.iconSet = iconSet;
|
|
86
|
+
this.size = '';
|
|
87
|
+
this.xmlns = 'http://www.w3.org/2000/svg';
|
|
88
|
+
this.pointerEvents = 'none';
|
|
89
|
+
this.role = 'img';
|
|
90
|
+
}
|
|
91
|
+
set name(name) {
|
|
92
|
+
this._name = name?.includes('-') ? this.toCamelCase(name) : name;
|
|
93
|
+
}
|
|
94
|
+
get name() {
|
|
95
|
+
return this._name;
|
|
96
|
+
}
|
|
97
|
+
set viewBox(viewBox) {
|
|
98
|
+
this._viewBox = viewBox;
|
|
99
|
+
}
|
|
100
|
+
get viewBox() {
|
|
101
|
+
return this._viewBox ?? this.scale;
|
|
102
|
+
}
|
|
103
|
+
get hostClasses() {
|
|
104
|
+
const classes = {
|
|
105
|
+
icon: true,
|
|
106
|
+
[`icon-${this.computedSize}`]: !!this.computedSize
|
|
107
|
+
};
|
|
108
|
+
return this.customClasses ?? classes;
|
|
109
|
+
}
|
|
110
|
+
get innerHtml() {
|
|
111
|
+
const code = Array.isArray(this.code) ? this.code[1] || this.code[0] : this.code ?? '';
|
|
112
|
+
// todo proper sanitize
|
|
113
|
+
// const sanitized = this.sanitizer.sanitize(SecurityContext.HTML, code);
|
|
114
|
+
return this.sanitizer.bypassSecurityTrustHtml((this.titleCode + code) ?? '');
|
|
115
|
+
}
|
|
116
|
+
get titleCode() {
|
|
117
|
+
return this.title ? `<title>${this.title}</title>` : '';
|
|
118
|
+
}
|
|
119
|
+
get code() {
|
|
120
|
+
if (this.content) {
|
|
121
|
+
return this.content;
|
|
122
|
+
}
|
|
123
|
+
if (this.iconSet && this.name) {
|
|
124
|
+
return this.iconSet.getIcon(this.name);
|
|
125
|
+
}
|
|
126
|
+
if (this.name && !this.iconSet?.icons[this.name])
|
|
127
|
+
console.warn(`c-icon component: icon name '${this.name}' does not exist for IconSet service. ` +
|
|
128
|
+
`To use icon by 'name' prop you need to add it to IconSet service. \n`, this.name);
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
get scale() {
|
|
132
|
+
return Array.isArray(this.code) && this.code.length > 1 ? `0 0 ${this.code[0]}` : '0 0 64 64';
|
|
133
|
+
}
|
|
134
|
+
get computedSize() {
|
|
135
|
+
const addCustom = !this.size && (this.width || this.height);
|
|
136
|
+
return this.size === 'custom' || addCustom ? 'custom-size' : this.size;
|
|
137
|
+
}
|
|
138
|
+
get computedClasses() {
|
|
139
|
+
const classes = {
|
|
140
|
+
icon: true,
|
|
141
|
+
[`icon-${this.computedSize}`]: !!this.computedSize
|
|
142
|
+
};
|
|
143
|
+
return !!this.customClasses ? this.customClasses : classes;
|
|
144
|
+
}
|
|
145
|
+
toCamelCase(str) {
|
|
146
|
+
return str.replace(/([-_][a-z0-9])/ig, ($1) => {
|
|
147
|
+
return $1.toUpperCase().replace('-', '');
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
IconDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1.DomSanitizer }, { token: IconSetService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
152
|
+
IconDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.3", type: IconDirective, selector: "svg[cIcon]", inputs: { content: ["cIcon", "content"], size: "size", title: "title", customClasses: "customClasses", width: "width", height: "height", name: "name", viewBox: "viewBox", xmlns: "xmlns", pointerEvents: ["pointer-events", "pointerEvents"], role: "role" }, host: { properties: { "attr.viewBox": "this.viewBox", "attr.xmlns": "this.xmlns", "attr.pointer-events": "this.pointerEvents", "attr.role": "this.role", "class": "this.hostClasses", "innerHtml": "this.innerHtml" } }, exportAs: ["cIcon"], ngImport: i0 });
|
|
153
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconDirective, decorators: [{
|
|
154
|
+
type: Directive,
|
|
155
|
+
args: [{
|
|
156
|
+
selector: 'svg[cIcon]',
|
|
157
|
+
exportAs: 'cIcon'
|
|
158
|
+
}]
|
|
159
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1.DomSanitizer }, { type: IconSetService }]; }, propDecorators: { content: [{
|
|
160
|
+
type: Input,
|
|
161
|
+
args: ['cIcon']
|
|
162
|
+
}], size: [{
|
|
163
|
+
type: Input
|
|
164
|
+
}], title: [{
|
|
165
|
+
type: Input
|
|
166
|
+
}], customClasses: [{
|
|
167
|
+
type: Input
|
|
168
|
+
}], width: [{
|
|
169
|
+
type: Input
|
|
170
|
+
}], height: [{
|
|
171
|
+
type: Input
|
|
172
|
+
}], name: [{
|
|
173
|
+
type: Input
|
|
174
|
+
}], viewBox: [{
|
|
175
|
+
type: HostBinding,
|
|
176
|
+
args: ['attr.viewBox']
|
|
177
|
+
}, {
|
|
178
|
+
type: Input
|
|
179
|
+
}], xmlns: [{
|
|
180
|
+
type: HostBinding,
|
|
181
|
+
args: ['attr.xmlns']
|
|
182
|
+
}, {
|
|
183
|
+
type: Input
|
|
184
|
+
}], pointerEvents: [{
|
|
185
|
+
type: HostBinding,
|
|
186
|
+
args: ['attr.pointer-events']
|
|
187
|
+
}, {
|
|
188
|
+
type: Input,
|
|
189
|
+
args: ['pointer-events']
|
|
190
|
+
}], role: [{
|
|
191
|
+
type: HostBinding,
|
|
192
|
+
args: ['attr.role']
|
|
193
|
+
}, {
|
|
194
|
+
type: Input
|
|
195
|
+
}], hostClasses: [{
|
|
196
|
+
type: HostBinding,
|
|
197
|
+
args: ['class']
|
|
198
|
+
}], innerHtml: [{
|
|
199
|
+
type: HostBinding,
|
|
200
|
+
args: ['innerHtml']
|
|
201
|
+
}] } });
|
|
202
|
+
|
|
203
|
+
class HtmlAttributesDirective {
|
|
204
|
+
constructor(renderer, el) {
|
|
205
|
+
this.renderer = renderer;
|
|
206
|
+
this.el = el;
|
|
207
|
+
}
|
|
208
|
+
ngOnInit() {
|
|
209
|
+
const attribs = this.cHtmlAttr;
|
|
210
|
+
for (const attr in attribs) {
|
|
211
|
+
if (attr === 'style' && typeof (attribs[attr]) === 'object') {
|
|
212
|
+
this.setStyle(attribs[attr]);
|
|
213
|
+
}
|
|
214
|
+
else if (attr === 'class') {
|
|
215
|
+
this.addClass(attribs[attr]);
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
this.setAttrib(attr, attribs[attr]);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
setStyle(styles) {
|
|
223
|
+
// tslint:disable-next-line:forin
|
|
224
|
+
for (const style in styles) {
|
|
225
|
+
this.renderer.setStyle(this.el.nativeElement, style, styles[style]);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
addClass(classes) {
|
|
229
|
+
const classArray = (Array.isArray(classes) ? classes : classes.split(' '));
|
|
230
|
+
classArray.filter((element) => element.length > 0).forEach(element => {
|
|
231
|
+
this.renderer.addClass(this.el.nativeElement, element);
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
setAttrib(key, value) {
|
|
235
|
+
value !== null ?
|
|
236
|
+
this.renderer.setAttribute(this.el.nativeElement, key, value) :
|
|
237
|
+
this.renderer.removeAttribute(this.el.nativeElement, key);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
HtmlAttributesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: HtmlAttributesDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
241
|
+
HtmlAttributesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.3", type: HtmlAttributesDirective, selector: "[cHtmlAttr]", inputs: { cHtmlAttr: "cHtmlAttr" }, exportAs: ["cHtmlAttr"], ngImport: i0 });
|
|
242
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: HtmlAttributesDirective, decorators: [{
|
|
243
|
+
type: Directive,
|
|
244
|
+
args: [{
|
|
245
|
+
selector: '[cHtmlAttr]',
|
|
246
|
+
exportAs: 'cHtmlAttr'
|
|
247
|
+
}]
|
|
248
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { cHtmlAttr: [{
|
|
249
|
+
type: Input
|
|
250
|
+
}] } });
|
|
251
|
+
|
|
252
|
+
class IconComponent {
|
|
253
|
+
constructor(renderer, elementRef, sanitizer, iconSet) {
|
|
254
|
+
this.renderer = renderer;
|
|
255
|
+
this.elementRef = elementRef;
|
|
256
|
+
this.sanitizer = sanitizer;
|
|
257
|
+
this.iconSet = iconSet;
|
|
258
|
+
this.attributes = { role: 'img' };
|
|
259
|
+
this.size = '';
|
|
260
|
+
this.use = '';
|
|
261
|
+
this.customClasses = '';
|
|
262
|
+
this.renderer.setStyle(this.elementRef.nativeElement, 'display', 'none');
|
|
263
|
+
}
|
|
264
|
+
set name(name) {
|
|
265
|
+
this._name = name.includes('-') ? this.toCamelCase(name) : name;
|
|
266
|
+
}
|
|
267
|
+
get name() {
|
|
268
|
+
return this._name;
|
|
269
|
+
}
|
|
270
|
+
set viewBox(viewBox) {
|
|
271
|
+
this._viewBox = viewBox;
|
|
272
|
+
}
|
|
273
|
+
get viewBox() {
|
|
274
|
+
return this._viewBox ?? this.scale;
|
|
275
|
+
}
|
|
276
|
+
get innerHtml() {
|
|
277
|
+
const code = Array.isArray(this.code) ? this.code[1] || this.code[0] : this.code ?? '';
|
|
278
|
+
// todo proper sanitize
|
|
279
|
+
// const sanitized = this.sanitizer.sanitize(SecurityContext.HTML, code);
|
|
280
|
+
return this.sanitizer.bypassSecurityTrustHtml((this.titleCode + code) ?? '');
|
|
281
|
+
}
|
|
282
|
+
ngAfterViewInit() {
|
|
283
|
+
this.elementRef.nativeElement.classList.forEach((item) => {
|
|
284
|
+
this.renderer.addClass(this.svgElementRef.nativeElement, item);
|
|
285
|
+
});
|
|
286
|
+
const parentElement = this.renderer.parentNode(this.elementRef.nativeElement);
|
|
287
|
+
const svgElement = this.svgElementRef.nativeElement;
|
|
288
|
+
this.renderer.insertBefore(parentElement, svgElement, this.elementRef.nativeElement);
|
|
289
|
+
this.renderer.removeChild(parentElement, this.elementRef.nativeElement);
|
|
290
|
+
}
|
|
291
|
+
get titleCode() {
|
|
292
|
+
return this.title ? `<title>${this.title}</title>` : '';
|
|
293
|
+
}
|
|
294
|
+
get code() {
|
|
295
|
+
if (this.content) {
|
|
296
|
+
return this.content;
|
|
297
|
+
}
|
|
298
|
+
if (this.iconSet && this.name) {
|
|
299
|
+
return this.iconSet.getIcon(this.name);
|
|
300
|
+
}
|
|
301
|
+
if (this.name && !this.iconSet?.icons[this.name])
|
|
302
|
+
console.warn(`c-icon component: icon name '${this.name}' does not exist for IconSet service. ` +
|
|
303
|
+
`To use icon by 'name' prop you need to add it to IconSet service. \n`, this.name);
|
|
304
|
+
return undefined;
|
|
305
|
+
}
|
|
306
|
+
get scale() {
|
|
307
|
+
return Array.isArray(this.code) && this.code.length > 1 ? `0 0 ${this.code[0]}` : '0 0 64 64';
|
|
308
|
+
}
|
|
309
|
+
get computedSize() {
|
|
310
|
+
const addCustom = !this.size && (this.width || this.height);
|
|
311
|
+
return this.size === 'custom' || addCustom ? 'custom-size' : this.size;
|
|
312
|
+
}
|
|
313
|
+
get computedClasses() {
|
|
314
|
+
const classes = {
|
|
315
|
+
icon: true,
|
|
316
|
+
[`icon-${this.computedSize}`]: !!this.computedSize
|
|
317
|
+
};
|
|
318
|
+
return !!this.customClasses ? this.customClasses : classes;
|
|
319
|
+
}
|
|
320
|
+
toCamelCase(str) {
|
|
321
|
+
return str.replace(/([-_][a-z0-9])/ig, ($1) => {
|
|
322
|
+
return $1.toUpperCase().replace('-', '');
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
IconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1.DomSanitizer }, { token: IconSetService }], target: i0.ɵɵFactoryTarget.Component });
|
|
327
|
+
IconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.3", type: IconComponent, selector: "c-icon", inputs: { attributes: "attributes", content: "content", size: "size", title: "title", use: "use", customClasses: "customClasses", width: "width", height: "height", name: "name", viewBox: "viewBox" }, viewQueries: [{ propertyName: "svgElementRef", first: true, predicate: ["svgElement"], descendants: true, read: ElementRef }], ngImport: i0, template: "<svg *ngIf=\"(!use) && (!!code)\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n [attr.width]=\"width\"\r\n [attr.height]=\"height || width\"\r\n [attr.viewBox]=\"viewBox\"\r\n [innerHtml]=\"innerHtml\"\r\n [ngClass]=\"computedClasses\"\r\n [cHtmlAttr]=\"attributes\"\r\n role=\"img\"\r\n pointer-events=\"none\"\r\n #svgElement\r\n>\r\n</svg>\r\n\r\n<svg *ngIf=\"use\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n [attr.width]=\"width\"\r\n [attr.height]=\"height || width\"\r\n [ngClass]=\"computedClasses\"\r\n [cHtmlAttr]=\"attributes\"\r\n role=\"img\"\r\n pointer-events=\"none\"\r\n>\r\n <use [attr.href]=\"use\"></use>\r\n</svg>\r\n", styles: [".icon{display:inline-block;color:inherit;text-align:center;vertical-align:-.125rem;fill:currentColor}.icon:not(.icon-c-s):not(.icon-custom-size){width:1rem;height:1rem;font-size:1rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-xxl{width:2rem;height:2rem;font-size:2rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-xl{width:1.5rem;height:1.5rem;font-size:1.5rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-lg{width:1.25rem;height:1.25rem;font-size:1.25rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-sm{width:.875rem;height:.875rem;font-size:.875rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-3xl{width:3rem;height:3rem;font-size:3rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-4xl{width:4rem;height:4rem;font-size:4rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-5xl{width:5rem;height:5rem;font-size:5rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-6xl{width:6rem;height:6rem;font-size:6rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-7xl{width:7rem;height:7rem;font-size:7rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-8xl{width:8rem;height:8rem;font-size:8rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-9xl{width:9rem;height:9rem;font-size:9rem}\n"], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: HtmlAttributesDirective, selector: "[cHtmlAttr]", inputs: ["cHtmlAttr"], exportAs: ["cHtmlAttr"] }] });
|
|
328
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconComponent, decorators: [{
|
|
329
|
+
type: Component,
|
|
330
|
+
args: [{ selector: 'c-icon', template: "<svg *ngIf=\"(!use) && (!!code)\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n [attr.width]=\"width\"\r\n [attr.height]=\"height || width\"\r\n [attr.viewBox]=\"viewBox\"\r\n [innerHtml]=\"innerHtml\"\r\n [ngClass]=\"computedClasses\"\r\n [cHtmlAttr]=\"attributes\"\r\n role=\"img\"\r\n pointer-events=\"none\"\r\n #svgElement\r\n>\r\n</svg>\r\n\r\n<svg *ngIf=\"use\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n [attr.width]=\"width\"\r\n [attr.height]=\"height || width\"\r\n [ngClass]=\"computedClasses\"\r\n [cHtmlAttr]=\"attributes\"\r\n role=\"img\"\r\n pointer-events=\"none\"\r\n>\r\n <use [attr.href]=\"use\"></use>\r\n</svg>\r\n", styles: [".icon{display:inline-block;color:inherit;text-align:center;vertical-align:-.125rem;fill:currentColor}.icon:not(.icon-c-s):not(.icon-custom-size){width:1rem;height:1rem;font-size:1rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-xxl{width:2rem;height:2rem;font-size:2rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-xl{width:1.5rem;height:1.5rem;font-size:1.5rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-lg{width:1.25rem;height:1.25rem;font-size:1.25rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-sm{width:.875rem;height:.875rem;font-size:.875rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-3xl{width:3rem;height:3rem;font-size:3rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-4xl{width:4rem;height:4rem;font-size:4rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-5xl{width:5rem;height:5rem;font-size:5rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-6xl{width:6rem;height:6rem;font-size:6rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-7xl{width:7rem;height:7rem;font-size:7rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-8xl{width:8rem;height:8rem;font-size:8rem}.icon:not(.icon-c-s):not(.icon-custom-size).icon-9xl{width:9rem;height:9rem;font-size:9rem}\n"] }]
|
|
331
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1.DomSanitizer }, { type: IconSetService }]; }, propDecorators: { attributes: [{
|
|
332
|
+
type: Input
|
|
333
|
+
}], content: [{
|
|
334
|
+
type: Input
|
|
335
|
+
}], size: [{
|
|
336
|
+
type: Input
|
|
337
|
+
}], title: [{
|
|
338
|
+
type: Input
|
|
339
|
+
}], use: [{
|
|
340
|
+
type: Input
|
|
341
|
+
}], customClasses: [{
|
|
342
|
+
type: Input
|
|
343
|
+
}], width: [{
|
|
344
|
+
type: Input
|
|
345
|
+
}], height: [{
|
|
346
|
+
type: Input
|
|
347
|
+
}], name: [{
|
|
348
|
+
type: Input
|
|
349
|
+
}], viewBox: [{
|
|
350
|
+
type: Input
|
|
351
|
+
}], svgElementRef: [{
|
|
352
|
+
type: ViewChild,
|
|
353
|
+
args: ['svgElement', { read: ElementRef }]
|
|
354
|
+
}] } });
|
|
355
|
+
|
|
356
|
+
class IconModule {
|
|
357
|
+
}
|
|
358
|
+
IconModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
359
|
+
IconModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconModule, declarations: [IconComponent,
|
|
360
|
+
HtmlAttributesDirective,
|
|
361
|
+
IconDirective], imports: [CommonModule], exports: [IconComponent,
|
|
362
|
+
IconDirective] });
|
|
363
|
+
IconModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconModule, imports: [[
|
|
364
|
+
CommonModule,
|
|
365
|
+
]] });
|
|
366
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: IconModule, decorators: [{
|
|
367
|
+
type: NgModule,
|
|
368
|
+
args: [{
|
|
369
|
+
declarations: [
|
|
370
|
+
IconComponent,
|
|
371
|
+
HtmlAttributesDirective,
|
|
372
|
+
IconDirective
|
|
373
|
+
],
|
|
374
|
+
imports: [
|
|
375
|
+
CommonModule,
|
|
376
|
+
],
|
|
377
|
+
exports: [
|
|
378
|
+
IconComponent,
|
|
379
|
+
IconDirective
|
|
380
|
+
],
|
|
381
|
+
}]
|
|
382
|
+
}] });
|
|
383
|
+
|
|
384
|
+
/*
|
|
385
|
+
* Public API Surface of @coreui/icons-angular
|
|
386
|
+
*/
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Generated bundle index. Do not edit.
|
|
390
|
+
*/
|
|
391
|
+
|
|
392
|
+
export { IconComponent, IconDirective, IconModule, IconSetModule, IconSetService };
|
|
393
|
+
//# sourceMappingURL=coreui-icons-angular.mjs.map
|