@ng-icons/core 14.0.0 → 14.1.0
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 +1 -0
- package/esm2020/index.mjs +3 -3
- package/esm2020/lib/icon.component.mjs +67 -67
- package/esm2020/lib/icon.module.mjs +33 -33
- package/esm2020/lib/icon.service.mjs +25 -25
- package/esm2020/lib/utils/format.mjs +22 -22
- package/esm2020/ng-icons-core.mjs +4 -4
- package/fesm2015/ng-icons-core.mjs +127 -127
- package/fesm2015/ng-icons-core.mjs.map +1 -1
- package/fesm2020/ng-icons-core.mjs +127 -127
- package/fesm2020/ng-icons-core.mjs.map +1 -1
- package/index.d.ts +2 -2
- package/lib/icon.component.d.ts +24 -24
- package/lib/icon.module.d.ts +17 -17
- package/lib/icon.service.d.ts +13 -13
- package/lib/utils/format.d.ts +12 -12
- package/ng-icons-core.d.ts +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
package/esm2020/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './lib/icon.component';
|
|
2
|
-
export * from './lib/icon.module';
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
export * from './lib/icon.component';
|
|
2
|
+
export * from './lib/icon.module';
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wYWNrYWdlcy9jb3JlL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLHNCQUFzQixDQUFDO0FBQ3JDLGNBQWMsbUJBQW1CLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2xpYi9pY29uLmNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9pY29uLm1vZHVsZSc7XG4iXX0=
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, ElementRef, HostBinding, Input, } from '@angular/core';
|
|
2
|
-
import { DomSanitizer } from '@angular/platform-browser';
|
|
3
|
-
import { toUpperCamelCase } from './utils/format';
|
|
4
|
-
import { IconService } from './icon.service';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
import * as i1 from "@angular/platform-browser";
|
|
7
|
-
import * as i2 from "./icon.service";
|
|
8
|
-
export class IconComponent {
|
|
9
|
-
constructor(elementRef, sanitizer, iconService) {
|
|
10
|
-
this.elementRef = elementRef;
|
|
11
|
-
this.sanitizer = sanitizer;
|
|
12
|
-
this.iconService = iconService;
|
|
13
|
-
this._size = '1em';
|
|
14
|
-
}
|
|
15
|
-
/** Define the name of the icon to display */
|
|
16
|
-
set name(name) {
|
|
17
|
-
name = toUpperCamelCase(name);
|
|
18
|
-
// if there is no icon with this name warn the user as they probably forgot to import it
|
|
19
|
-
if (!this.iconService.icons.hasOwnProperty(name)) {
|
|
20
|
-
console.warn(`No icon named ${name} was found. You may need to import it using the withIcons function.`);
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
// insert the SVG into the template
|
|
24
|
-
this.template = this.sanitizer.bypassSecurityTrustHtml(this.iconService.icons[name]);
|
|
25
|
-
}
|
|
26
|
-
/** Define the size of the icon */
|
|
27
|
-
set size(size) {
|
|
28
|
-
// if the size only contains numbers, assume it is in pixels
|
|
29
|
-
this._size = coerceCssPixelValue(size);
|
|
30
|
-
}
|
|
31
|
-
get size() {
|
|
32
|
-
return this._size;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
IconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconComponent, deps: [{ token: i0.ElementRef }, { token: i1.DomSanitizer }, { token: i2.IconService }], target: i0.ɵɵFactoryTarget.Component });
|
|
36
|
-
IconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: IconComponent, selector: "ng-icon", inputs: { name: "name", size: "size", strokeWidth: "strokeWidth", color: "color" }, host: { properties: { "innerHTML": "this.template", "style.--ng-icon__size": "this.size", "style.--ng-icon__stroke-width": "this.strokeWidth", "style.color": "this.color" } }, ngImport: i0, template: '', isInline: true, styles: [":host{display:inline-block;width:var(--ng-icon__size);height:var(--ng-icon__size)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconComponent, decorators: [{
|
|
38
|
-
type: Component,
|
|
39
|
-
args: [{ selector: 'ng-icon', template: '', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-block;width:var(--ng-icon__size);height:var(--ng-icon__size)}\n"] }]
|
|
40
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.DomSanitizer }, { type: i2.IconService }]; }, propDecorators: { name: [{
|
|
41
|
-
type: Input
|
|
42
|
-
}], template: [{
|
|
43
|
-
type: HostBinding,
|
|
44
|
-
args: ['innerHTML']
|
|
45
|
-
}], size: [{
|
|
46
|
-
type: HostBinding,
|
|
47
|
-
args: ['style.--ng-icon__size']
|
|
48
|
-
}, {
|
|
49
|
-
type: Input
|
|
50
|
-
}], strokeWidth: [{
|
|
51
|
-
type: HostBinding,
|
|
52
|
-
args: ['style.--ng-icon__stroke-width']
|
|
53
|
-
}, {
|
|
54
|
-
type: Input
|
|
55
|
-
}], color: [{
|
|
56
|
-
type: HostBinding,
|
|
57
|
-
args: ['style.color']
|
|
58
|
-
}, {
|
|
59
|
-
type: Input
|
|
60
|
-
}] } });
|
|
61
|
-
function coerceCssPixelValue(value) {
|
|
62
|
-
if (value == null) {
|
|
63
|
-
return '';
|
|
64
|
-
}
|
|
65
|
-
return /^\d+$/.test(value) ? `${value}px` : value;
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { ChangeDetectionStrategy, Component, ElementRef, HostBinding, Input, } from '@angular/core';
|
|
2
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
3
|
+
import { toUpperCamelCase } from './utils/format';
|
|
4
|
+
import { IconService } from './icon.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
import * as i1 from "@angular/platform-browser";
|
|
7
|
+
import * as i2 from "./icon.service";
|
|
8
|
+
export class IconComponent {
|
|
9
|
+
constructor(elementRef, sanitizer, iconService) {
|
|
10
|
+
this.elementRef = elementRef;
|
|
11
|
+
this.sanitizer = sanitizer;
|
|
12
|
+
this.iconService = iconService;
|
|
13
|
+
this._size = '1em';
|
|
14
|
+
}
|
|
15
|
+
/** Define the name of the icon to display */
|
|
16
|
+
set name(name) {
|
|
17
|
+
name = toUpperCamelCase(name);
|
|
18
|
+
// if there is no icon with this name warn the user as they probably forgot to import it
|
|
19
|
+
if (!this.iconService.icons.hasOwnProperty(name)) {
|
|
20
|
+
console.warn(`No icon named ${name} was found. You may need to import it using the withIcons function.`);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
// insert the SVG into the template
|
|
24
|
+
this.template = this.sanitizer.bypassSecurityTrustHtml(this.iconService.icons[name]);
|
|
25
|
+
}
|
|
26
|
+
/** Define the size of the icon */
|
|
27
|
+
set size(size) {
|
|
28
|
+
// if the size only contains numbers, assume it is in pixels
|
|
29
|
+
this._size = coerceCssPixelValue(size);
|
|
30
|
+
}
|
|
31
|
+
get size() {
|
|
32
|
+
return this._size;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
IconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconComponent, deps: [{ token: i0.ElementRef }, { token: i1.DomSanitizer }, { token: i2.IconService }], target: i0.ɵɵFactoryTarget.Component });
|
|
36
|
+
IconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: IconComponent, selector: "ng-icon", inputs: { name: "name", size: "size", strokeWidth: "strokeWidth", color: "color" }, host: { properties: { "innerHTML": "this.template", "style.--ng-icon__size": "this.size", "style.--ng-icon__stroke-width": "this.strokeWidth", "style.color": "this.color" } }, ngImport: i0, template: '', isInline: true, styles: [":host{display:inline-block;width:var(--ng-icon__size);height:var(--ng-icon__size)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconComponent, decorators: [{
|
|
38
|
+
type: Component,
|
|
39
|
+
args: [{ selector: 'ng-icon', template: '', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-block;width:var(--ng-icon__size);height:var(--ng-icon__size)}\n"] }]
|
|
40
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.DomSanitizer }, { type: i2.IconService }]; }, propDecorators: { name: [{
|
|
41
|
+
type: Input
|
|
42
|
+
}], template: [{
|
|
43
|
+
type: HostBinding,
|
|
44
|
+
args: ['innerHTML']
|
|
45
|
+
}], size: [{
|
|
46
|
+
type: HostBinding,
|
|
47
|
+
args: ['style.--ng-icon__size']
|
|
48
|
+
}, {
|
|
49
|
+
type: Input
|
|
50
|
+
}], strokeWidth: [{
|
|
51
|
+
type: HostBinding,
|
|
52
|
+
args: ['style.--ng-icon__stroke-width']
|
|
53
|
+
}, {
|
|
54
|
+
type: Input
|
|
55
|
+
}], color: [{
|
|
56
|
+
type: HostBinding,
|
|
57
|
+
args: ['style.color']
|
|
58
|
+
}, {
|
|
59
|
+
type: Input
|
|
60
|
+
}] } });
|
|
61
|
+
function coerceCssPixelValue(value) {
|
|
62
|
+
if (value == null) {
|
|
63
|
+
return '';
|
|
64
|
+
}
|
|
65
|
+
return /^\d+$/.test(value) ? `${value}px` : value;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJza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cjtcblxuICAvKiogRGVmaW5lIHRoZSBjb2xvciBvZiB0aGUgaWNvbiAqL1xuICBASG9zdEJpbmRpbmcoJ3N0eWxlLmNvbG9yJylcbiAgQElucHV0KClcbiAgY29sb3I/OiBzdHJpbmc7XG5cbiAgY29uc3RydWN0b3IoXG4gICAgcHJpdmF0ZSByZWFkb25seSBlbGVtZW50UmVmOiBFbGVtZW50UmVmPEhUTUxFbGVtZW50PixcbiAgICBwcml2YXRlIHJlYWRvbmx5IHNhbml0aXplcjogRG9tU2FuaXRpemVyLFxuICAgIHByaXZhdGUgcmVhZG9ubHkgaWNvblNlcnZpY2U6IEljb25TZXJ2aWNlLFxuICApIHt9XG59XG5cbmZ1bmN0aW9uIGNvZXJjZUNzc1BpeGVsVmFsdWUodmFsdWU6IHN0cmluZyk6IHN0cmluZyB7XG4gIGlmICh2YWx1ZSA9PSBudWxsKSB7XG4gICAgcmV0dXJuICcnO1xuICB9XG5cbiAgcmV0dXJuIC9eXFxkKyQvLnRlc3QodmFsdWUpID8gYCR7dmFsdWV9cHhgIDogdmFsdWU7XG59XG4iXX0=
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { IconComponent } from './icon.component';
|
|
3
|
-
import { IconService } from './icon.service';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
import * as i1 from "./icon.service";
|
|
6
|
-
export class NgIconsModule {
|
|
7
|
-
constructor(iconService) {
|
|
8
|
-
this.iconService = iconService;
|
|
9
|
-
if (Object.keys(this.iconService.icons).length === 0) {
|
|
10
|
-
throw new Error('No icons have been provided. Ensure to include some icons by importing them using NgIconsModule.withIcons({ ... }).');
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Define the icons that will be included in the application. This allows unused icons to
|
|
15
|
-
* be tree-shaken away to reduce bundle size
|
|
16
|
-
* @param icons The object containing the required icons
|
|
17
|
-
*/
|
|
18
|
-
static withIcons(icons) {
|
|
19
|
-
IconService.addIcons(icons);
|
|
20
|
-
return { ngModule: NgIconsModule };
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
NgIconsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule, deps: [{ token: i1.IconService }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
24
|
-
NgIconsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule, declarations: [IconComponent], exports: [IconComponent] });
|
|
25
|
-
NgIconsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule });
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule, decorators: [{
|
|
27
|
-
type: NgModule,
|
|
28
|
-
args: [{
|
|
29
|
-
declarations: [IconComponent],
|
|
30
|
-
exports: [IconComponent],
|
|
31
|
-
}]
|
|
32
|
-
}], ctorParameters: function () { return [{ type: i1.IconService }]; } });
|
|
33
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { IconComponent } from './icon.component';
|
|
3
|
+
import { IconService } from './icon.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import * as i1 from "./icon.service";
|
|
6
|
+
export class NgIconsModule {
|
|
7
|
+
constructor(iconService) {
|
|
8
|
+
this.iconService = iconService;
|
|
9
|
+
if (Object.keys(this.iconService.icons).length === 0) {
|
|
10
|
+
throw new Error('No icons have been provided. Ensure to include some icons by importing them using NgIconsModule.withIcons({ ... }).');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Define the icons that will be included in the application. This allows unused icons to
|
|
15
|
+
* be tree-shaken away to reduce bundle size
|
|
16
|
+
* @param icons The object containing the required icons
|
|
17
|
+
*/
|
|
18
|
+
static withIcons(icons) {
|
|
19
|
+
IconService.addIcons(icons);
|
|
20
|
+
return { ngModule: NgIconsModule };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
NgIconsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule, deps: [{ token: i1.IconService }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
24
|
+
NgIconsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule, declarations: [IconComponent], exports: [IconComponent] });
|
|
25
|
+
NgIconsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule });
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule, decorators: [{
|
|
27
|
+
type: NgModule,
|
|
28
|
+
args: [{
|
|
29
|
+
declarations: [IconComponent],
|
|
30
|
+
exports: [IconComponent],
|
|
31
|
+
}]
|
|
32
|
+
}], ctorParameters: function () { return [{ type: i1.IconService }]; } });
|
|
33
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWNvbi5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb3JlL3NyYy9saWIvaWNvbi5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUF1QixRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDOUQsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBQ2pELE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQzs7O0FBTTdDLE1BQU0sT0FBTyxhQU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ZSByZWFkb25seSBpY29uU2VydmljZTogSWNvblNlcnZpY2UpIHtcbiAgICBpZiAoT2JqZWN0LmtleXModGhpcy5pY29uU2VydmljZS5pY29ucykubGVuZ3RoID09PSAwKSB7XG4gICAgICB0aHJvdyBuZXcgRXJyb3IoXG4gICAgICAgICdObyBpY29ucyBoYXZlIGJlZW4gcHJvdmlkZWQuIEVuc3VyZSB0byBpbmNsdWRlIHNvbWUgaWNvbnMgYnkgaW1wb3J0aW5nIHRoZW0gdXNpbmcgTmdJY29uc01vZHVsZS53aXRoSWNvbnMoeyAuLi4gfSkuJyxcbiAgICAgICk7XG4gICAgfVxuICB9XG5cbiAgLyoqXG4gICAqIERlZmluZSB0aGUgaWNvbnMgdGhhdCB3aWxsIGJlIGluY2x1ZGVkIGluIHRoZSBhcHBsaWNhdGlvbi4gVGhpcyBhbGxvd3MgdW51c2VkIGljb25zIHRvXG4gICAqIGJlIHRyZWUtc2hha2VuIGF3YXkgdG8gcmVkdWNlIGJ1bmRsZSBzaXplXG4gICAqIEBwYXJhbSBpY29ucyBUaGUgb2JqZWN0IGNvbnRhaW5pbmcgdGhlIHJlcXVpcmVkIGljb25zXG4gICAqL1xuICBzdGF0aWMgd2l0aEljb25zKFxuICAgIGljb25zOiBSZWNvcmQ8c3RyaW5nLCBzdHJpbmc+LFxuICApOiBNb2R1bGVXaXRoUHJvdmlkZXJzPE5nSWNvbnNNb2R1bGU+IHtcbiAgICBJY29uU2VydmljZS5hZGRJY29ucyhpY29ucyk7XG5cbiAgICByZXR1cm4geyBuZ01vZHVsZTogTmdJY29uc01vZHVsZSB9O1xuICB9XG59XG4iXX0=
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export class IconService {
|
|
4
|
-
/** Access the icons in the class. */
|
|
5
|
-
get icons() {
|
|
6
|
-
return IconService.icons;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Insert icons into the iconset
|
|
10
|
-
*/
|
|
11
|
-
static addIcons(icons) {
|
|
12
|
-
IconService.icons = { ...IconService.icons, ...icons };
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
/** Store the available icons. */
|
|
16
|
-
IconService.icons = {};
|
|
17
|
-
IconService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
18
|
-
IconService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconService, providedIn: 'root' });
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconService, decorators: [{
|
|
20
|
-
type: Injectable,
|
|
21
|
-
args: [{
|
|
22
|
-
providedIn: 'root',
|
|
23
|
-
}]
|
|
24
|
-
}] });
|
|
25
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export class IconService {
|
|
4
|
+
/** Access the icons in the class. */
|
|
5
|
+
get icons() {
|
|
6
|
+
return IconService.icons;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Insert icons into the iconset
|
|
10
|
+
*/
|
|
11
|
+
static addIcons(icons) {
|
|
12
|
+
IconService.icons = { ...IconService.icons, ...icons };
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/** Store the available icons. */
|
|
16
|
+
IconService.icons = {};
|
|
17
|
+
IconService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
18
|
+
IconService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconService, providedIn: 'root' });
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconService, decorators: [{
|
|
20
|
+
type: Injectable,
|
|
21
|
+
args: [{
|
|
22
|
+
providedIn: 'root',
|
|
23
|
+
}]
|
|
24
|
+
}] });
|
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWNvbi5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29yZS9zcmMvbGliL2ljb24uc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDOztBQUszQyxNQUFNLE9BQU8sV0FBVztJQUl0QixxQ0FBcUM7SUFDckMsSUFBSSxLQUFLO1FBQ1AsT0FBTyxXQUFXLENBQUMsS0FBSyxDQUFDO0lBQzNCLENBQUM7SUFFRDs7T0FFRztJQUNILE1BQU0sQ0FBQyxRQUFRLENBQUMsS0FBNkI7UUFDM0MsV0FBVyxDQUFDLEtBQUssR0FBRyxFQUFFLEdBQUcsV0FBVyxDQUFDLEtBQUssRUFBRSxHQUFHLEtBQUssRUFBRSxDQUFDO0lBQ3pELENBQUM7O0FBYkQsaUNBQWlDO0FBQ2xCLGlCQUFLLEdBQXFDLEVBQUcsQ0FBQTt3R0FGakQsV0FBVzs0R0FBWCxXQUFXLGNBRlYsTUFBTTsyRkFFUCxXQUFXO2tCQUh2QixVQUFVO21CQUFDO29CQUNWLFVBQVUsRUFBRSxNQUFNO2lCQUNuQiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEluamVjdGFibGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcblxuQEluamVjdGFibGUoe1xuICBwcm92aWRlZEluOiAncm9vdCcsXG59KVxuZXhwb3J0IGNsYXNzIEljb25TZXJ2aWNlIHtcbiAgLyoqIFN0b3JlIHRoZSBhdmFpbGFibGUgaWNvbnMuICovXG4gIHByaXZhdGUgc3RhdGljIGljb25zOiBSZWFkb25seTxSZWNvcmQ8c3RyaW5nLCBzdHJpbmc+PiA9IHt9O1xuXG4gIC8qKiBBY2Nlc3MgdGhlIGljb25zIGluIHRoZSBjbGFzcy4gKi9cbiAgZ2V0IGljb25zKCk6IFJlYWRvbmx5PFJlY29yZDxzdHJpbmcsIHN0cmluZz4+IHtcbiAgICByZXR1cm4gSWNvblNlcnZpY2UuaWNvbnM7XG4gIH1cblxuICAvKipcbiAgICogSW5zZXJ0IGljb25zIGludG8gdGhlIGljb25zZXRcbiAgICovXG4gIHN0YXRpYyBhZGRJY29ucyhpY29uczogUmVjb3JkPHN0cmluZywgc3RyaW5nPik6IHZvaWQge1xuICAgIEljb25TZXJ2aWNlLmljb25zID0geyAuLi5JY29uU2VydmljZS5pY29ucywgLi4uaWNvbnMgfTtcbiAgfVxufVxuIl19
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hyphenated to UpperCamelCase
|
|
3
|
-
*/
|
|
4
|
-
export function toUpperCamelCase(str) {
|
|
5
|
-
return toCapitalCase(toPropertyName(str));
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Hyphenated to lowerCamelCase
|
|
9
|
-
*/
|
|
10
|
-
export function toPropertyName(str) {
|
|
11
|
-
return str
|
|
12
|
-
.replace(/([^a-zA-Z0-9])+(.)?/g, (_, __, chr) => chr ? chr.toUpperCase() : '')
|
|
13
|
-
.replace(/[^a-zA-Z\d]/g, '')
|
|
14
|
-
.replace(/^([A-Z])/, m => m.toLowerCase());
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Capitalizes the first letter of a string
|
|
18
|
-
*/
|
|
19
|
-
export function toCapitalCase(str) {
|
|
20
|
-
return str.charAt(0).toUpperCase() + str.substr(1);
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
/**
|
|
2
|
+
* Hyphenated to UpperCamelCase
|
|
3
|
+
*/
|
|
4
|
+
export function toUpperCamelCase(str) {
|
|
5
|
+
return toCapitalCase(toPropertyName(str));
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Hyphenated to lowerCamelCase
|
|
9
|
+
*/
|
|
10
|
+
export function toPropertyName(str) {
|
|
11
|
+
return str
|
|
12
|
+
.replace(/([^a-zA-Z0-9])+(.)?/g, (_, __, chr) => chr ? chr.toUpperCase() : '')
|
|
13
|
+
.replace(/[^a-zA-Z\d]/g, '')
|
|
14
|
+
.replace(/^([A-Z])/, m => m.toLowerCase());
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Capitalizes the first letter of a string
|
|
18
|
+
*/
|
|
19
|
+
export function toCapitalCase(str) {
|
|
20
|
+
return str.charAt(0).toUpperCase() + str.substr(1);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybWF0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29yZS9zcmMvbGliL3V0aWxzL2Zvcm1hdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUNILE1BQU0sVUFBVSxnQkFBZ0IsQ0FBQyxHQUFXO0lBQzFDLE9BQU8sYUFBYSxDQUFDLGNBQWMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDO0FBQzVDLENBQUM7QUFFRDs7R0FFRztBQUNILE1BQU0sVUFBVSxjQUFjLENBQUMsR0FBVztJQUN4QyxPQUFPLEdBQUc7U0FDUCxPQUFPLENBQUMsc0JBQXNCLEVBQUUsQ0FBQyxDQUFDLEVBQUUsRUFBRSxFQUFFLEdBQUcsRUFBRSxFQUFFLENBQzlDLEdBQUcsQ0FBQyxDQUFDLENBQUMsR0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YXBpdGFsaXplcyB0aGUgZmlyc3QgbGV0dGVyIG9mIGEgc3RyaW5nXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiB0b0NhcGl0YWxDYXNlKHN0cjogc3RyaW5nKTogc3RyaW5nIHtcbiAgcmV0dXJuIHN0ci5jaGFyQXQoMCkudG9VcHBlckNhc2UoKSArIHN0ci5zdWJzdHIoMSk7XG59XG4iXX0=
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './index';
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './index';
|
|
5
5
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmctaWNvbnMtY29yZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvcmUvc3JjL25nLWljb25zLWNvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLFNBQVMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9pbmRleCc7XG4iXX0=
|
|
@@ -2,141 +2,141 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Injectable, Component, ChangeDetectionStrategy, Input, HostBinding, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/platform-browser';
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* Hyphenated to UpperCamelCase
|
|
7
|
-
*/
|
|
8
|
-
function toUpperCamelCase(str) {
|
|
9
|
-
return toCapitalCase(toPropertyName(str));
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Hyphenated to lowerCamelCase
|
|
13
|
-
*/
|
|
14
|
-
function toPropertyName(str) {
|
|
15
|
-
return str
|
|
16
|
-
.replace(/([^a-zA-Z0-9])+(.)?/g, (_, __, chr) => chr ? chr.toUpperCase() : '')
|
|
17
|
-
.replace(/[^a-zA-Z\d]/g, '')
|
|
18
|
-
.replace(/^([A-Z])/, m => m.toLowerCase());
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Capitalizes the first letter of a string
|
|
22
|
-
*/
|
|
23
|
-
function toCapitalCase(str) {
|
|
24
|
-
return str.charAt(0).toUpperCase() + str.substr(1);
|
|
5
|
+
/**
|
|
6
|
+
* Hyphenated to UpperCamelCase
|
|
7
|
+
*/
|
|
8
|
+
function toUpperCamelCase(str) {
|
|
9
|
+
return toCapitalCase(toPropertyName(str));
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Hyphenated to lowerCamelCase
|
|
13
|
+
*/
|
|
14
|
+
function toPropertyName(str) {
|
|
15
|
+
return str
|
|
16
|
+
.replace(/([^a-zA-Z0-9])+(.)?/g, (_, __, chr) => chr ? chr.toUpperCase() : '')
|
|
17
|
+
.replace(/[^a-zA-Z\d]/g, '')
|
|
18
|
+
.replace(/^([A-Z])/, m => m.toLowerCase());
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Capitalizes the first letter of a string
|
|
22
|
+
*/
|
|
23
|
+
function toCapitalCase(str) {
|
|
24
|
+
return str.charAt(0).toUpperCase() + str.substr(1);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
class IconService {
|
|
28
|
-
/** Access the icons in the class. */
|
|
29
|
-
get icons() {
|
|
30
|
-
return IconService.icons;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Insert icons into the iconset
|
|
34
|
-
*/
|
|
35
|
-
static addIcons(icons) {
|
|
36
|
-
IconService.icons = Object.assign(Object.assign({}, IconService.icons), icons);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
/** Store the available icons. */
|
|
40
|
-
IconService.icons = {};
|
|
41
|
-
IconService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
42
|
-
IconService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconService, providedIn: 'root' });
|
|
43
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconService, decorators: [{
|
|
44
|
-
type: Injectable,
|
|
45
|
-
args: [{
|
|
46
|
-
providedIn: 'root',
|
|
47
|
-
}]
|
|
27
|
+
class IconService {
|
|
28
|
+
/** Access the icons in the class. */
|
|
29
|
+
get icons() {
|
|
30
|
+
return IconService.icons;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Insert icons into the iconset
|
|
34
|
+
*/
|
|
35
|
+
static addIcons(icons) {
|
|
36
|
+
IconService.icons = Object.assign(Object.assign({}, IconService.icons), icons);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/** Store the available icons. */
|
|
40
|
+
IconService.icons = {};
|
|
41
|
+
IconService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
42
|
+
IconService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconService, providedIn: 'root' });
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconService, decorators: [{
|
|
44
|
+
type: Injectable,
|
|
45
|
+
args: [{
|
|
46
|
+
providedIn: 'root',
|
|
47
|
+
}]
|
|
48
48
|
}] });
|
|
49
49
|
|
|
50
|
-
class IconComponent {
|
|
51
|
-
constructor(elementRef, sanitizer, iconService) {
|
|
52
|
-
this.elementRef = elementRef;
|
|
53
|
-
this.sanitizer = sanitizer;
|
|
54
|
-
this.iconService = iconService;
|
|
55
|
-
this._size = '1em';
|
|
56
|
-
}
|
|
57
|
-
/** Define the name of the icon to display */
|
|
58
|
-
set name(name) {
|
|
59
|
-
name = toUpperCamelCase(name);
|
|
60
|
-
// if there is no icon with this name warn the user as they probably forgot to import it
|
|
61
|
-
if (!this.iconService.icons.hasOwnProperty(name)) {
|
|
62
|
-
console.warn(`No icon named ${name} was found. You may need to import it using the withIcons function.`);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
// insert the SVG into the template
|
|
66
|
-
this.template = this.sanitizer.bypassSecurityTrustHtml(this.iconService.icons[name]);
|
|
67
|
-
}
|
|
68
|
-
/** Define the size of the icon */
|
|
69
|
-
set size(size) {
|
|
70
|
-
// if the size only contains numbers, assume it is in pixels
|
|
71
|
-
this._size = coerceCssPixelValue(size);
|
|
72
|
-
}
|
|
73
|
-
get size() {
|
|
74
|
-
return this._size;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
IconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconComponent, deps: [{ token: i0.ElementRef }, { token: i1.DomSanitizer }, { token: IconService }], target: i0.ɵɵFactoryTarget.Component });
|
|
78
|
-
IconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: IconComponent, selector: "ng-icon", inputs: { name: "name", size: "size", strokeWidth: "strokeWidth", color: "color" }, host: { properties: { "innerHTML": "this.template", "style.--ng-icon__size": "this.size", "style.--ng-icon__stroke-width": "this.strokeWidth", "style.color": "this.color" } }, ngImport: i0, template: '', isInline: true, styles: [":host{display:inline-block;width:var(--ng-icon__size);height:var(--ng-icon__size)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
79
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconComponent, decorators: [{
|
|
80
|
-
type: Component,
|
|
81
|
-
args: [{ selector: 'ng-icon', template: '', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-block;width:var(--ng-icon__size);height:var(--ng-icon__size)}\n"] }]
|
|
82
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.DomSanitizer }, { type: IconService }]; }, propDecorators: { name: [{
|
|
83
|
-
type: Input
|
|
84
|
-
}], template: [{
|
|
85
|
-
type: HostBinding,
|
|
86
|
-
args: ['innerHTML']
|
|
87
|
-
}], size: [{
|
|
88
|
-
type: HostBinding,
|
|
89
|
-
args: ['style.--ng-icon__size']
|
|
90
|
-
}, {
|
|
91
|
-
type: Input
|
|
92
|
-
}], strokeWidth: [{
|
|
93
|
-
type: HostBinding,
|
|
94
|
-
args: ['style.--ng-icon__stroke-width']
|
|
95
|
-
}, {
|
|
96
|
-
type: Input
|
|
97
|
-
}], color: [{
|
|
98
|
-
type: HostBinding,
|
|
99
|
-
args: ['style.color']
|
|
100
|
-
}, {
|
|
101
|
-
type: Input
|
|
102
|
-
}] } });
|
|
103
|
-
function coerceCssPixelValue(value) {
|
|
104
|
-
if (value == null) {
|
|
105
|
-
return '';
|
|
106
|
-
}
|
|
107
|
-
return /^\d+$/.test(value) ? `${value}px` : value;
|
|
50
|
+
class IconComponent {
|
|
51
|
+
constructor(elementRef, sanitizer, iconService) {
|
|
52
|
+
this.elementRef = elementRef;
|
|
53
|
+
this.sanitizer = sanitizer;
|
|
54
|
+
this.iconService = iconService;
|
|
55
|
+
this._size = '1em';
|
|
56
|
+
}
|
|
57
|
+
/** Define the name of the icon to display */
|
|
58
|
+
set name(name) {
|
|
59
|
+
name = toUpperCamelCase(name);
|
|
60
|
+
// if there is no icon with this name warn the user as they probably forgot to import it
|
|
61
|
+
if (!this.iconService.icons.hasOwnProperty(name)) {
|
|
62
|
+
console.warn(`No icon named ${name} was found. You may need to import it using the withIcons function.`);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
// insert the SVG into the template
|
|
66
|
+
this.template = this.sanitizer.bypassSecurityTrustHtml(this.iconService.icons[name]);
|
|
67
|
+
}
|
|
68
|
+
/** Define the size of the icon */
|
|
69
|
+
set size(size) {
|
|
70
|
+
// if the size only contains numbers, assume it is in pixels
|
|
71
|
+
this._size = coerceCssPixelValue(size);
|
|
72
|
+
}
|
|
73
|
+
get size() {
|
|
74
|
+
return this._size;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
IconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconComponent, deps: [{ token: i0.ElementRef }, { token: i1.DomSanitizer }, { token: IconService }], target: i0.ɵɵFactoryTarget.Component });
|
|
78
|
+
IconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: IconComponent, selector: "ng-icon", inputs: { name: "name", size: "size", strokeWidth: "strokeWidth", color: "color" }, host: { properties: { "innerHTML": "this.template", "style.--ng-icon__size": "this.size", "style.--ng-icon__stroke-width": "this.strokeWidth", "style.color": "this.color" } }, ngImport: i0, template: '', isInline: true, styles: [":host{display:inline-block;width:var(--ng-icon__size);height:var(--ng-icon__size)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
79
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconComponent, decorators: [{
|
|
80
|
+
type: Component,
|
|
81
|
+
args: [{ selector: 'ng-icon', template: '', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-block;width:var(--ng-icon__size);height:var(--ng-icon__size)}\n"] }]
|
|
82
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.DomSanitizer }, { type: IconService }]; }, propDecorators: { name: [{
|
|
83
|
+
type: Input
|
|
84
|
+
}], template: [{
|
|
85
|
+
type: HostBinding,
|
|
86
|
+
args: ['innerHTML']
|
|
87
|
+
}], size: [{
|
|
88
|
+
type: HostBinding,
|
|
89
|
+
args: ['style.--ng-icon__size']
|
|
90
|
+
}, {
|
|
91
|
+
type: Input
|
|
92
|
+
}], strokeWidth: [{
|
|
93
|
+
type: HostBinding,
|
|
94
|
+
args: ['style.--ng-icon__stroke-width']
|
|
95
|
+
}, {
|
|
96
|
+
type: Input
|
|
97
|
+
}], color: [{
|
|
98
|
+
type: HostBinding,
|
|
99
|
+
args: ['style.color']
|
|
100
|
+
}, {
|
|
101
|
+
type: Input
|
|
102
|
+
}] } });
|
|
103
|
+
function coerceCssPixelValue(value) {
|
|
104
|
+
if (value == null) {
|
|
105
|
+
return '';
|
|
106
|
+
}
|
|
107
|
+
return /^\d+$/.test(value) ? `${value}px` : value;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
class NgIconsModule {
|
|
111
|
-
constructor(iconService) {
|
|
112
|
-
this.iconService = iconService;
|
|
113
|
-
if (Object.keys(this.iconService.icons).length === 0) {
|
|
114
|
-
throw new Error('No icons have been provided. Ensure to include some icons by importing them using NgIconsModule.withIcons({ ... }).');
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Define the icons that will be included in the application. This allows unused icons to
|
|
119
|
-
* be tree-shaken away to reduce bundle size
|
|
120
|
-
* @param icons The object containing the required icons
|
|
121
|
-
*/
|
|
122
|
-
static withIcons(icons) {
|
|
123
|
-
IconService.addIcons(icons);
|
|
124
|
-
return { ngModule: NgIconsModule };
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
NgIconsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule, deps: [{ token: IconService }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
128
|
-
NgIconsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule, declarations: [IconComponent], exports: [IconComponent] });
|
|
129
|
-
NgIconsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule });
|
|
130
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule, decorators: [{
|
|
131
|
-
type: NgModule,
|
|
132
|
-
args: [{
|
|
133
|
-
declarations: [IconComponent],
|
|
134
|
-
exports: [IconComponent],
|
|
135
|
-
}]
|
|
110
|
+
class NgIconsModule {
|
|
111
|
+
constructor(iconService) {
|
|
112
|
+
this.iconService = iconService;
|
|
113
|
+
if (Object.keys(this.iconService.icons).length === 0) {
|
|
114
|
+
throw new Error('No icons have been provided. Ensure to include some icons by importing them using NgIconsModule.withIcons({ ... }).');
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Define the icons that will be included in the application. This allows unused icons to
|
|
119
|
+
* be tree-shaken away to reduce bundle size
|
|
120
|
+
* @param icons The object containing the required icons
|
|
121
|
+
*/
|
|
122
|
+
static withIcons(icons) {
|
|
123
|
+
IconService.addIcons(icons);
|
|
124
|
+
return { ngModule: NgIconsModule };
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
NgIconsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule, deps: [{ token: IconService }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
128
|
+
NgIconsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule, declarations: [IconComponent], exports: [IconComponent] });
|
|
129
|
+
NgIconsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule });
|
|
130
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule, decorators: [{
|
|
131
|
+
type: NgModule,
|
|
132
|
+
args: [{
|
|
133
|
+
declarations: [IconComponent],
|
|
134
|
+
exports: [IconComponent],
|
|
135
|
+
}]
|
|
136
136
|
}], ctorParameters: function () { return [{ type: IconService }]; } });
|
|
137
137
|
|
|
138
|
-
/**
|
|
139
|
-
* Generated bundle index. Do not edit.
|
|
138
|
+
/**
|
|
139
|
+
* Generated bundle index. Do not edit.
|
|
140
140
|
*/
|
|
141
141
|
|
|
142
142
|
export { IconComponent, NgIconsModule };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-icons-core.mjs","sources":["../../../../packages/core/src/lib/utils/format.ts","../../../../packages/core/src/lib/icon.service.ts","../../../../packages/core/src/lib/icon.component.ts","../../../../packages/core/src/lib/icon.module.ts","../../../../packages/core/src/ng-icons-core.ts"],"sourcesContent":["/**\
|
|
1
|
+
{"version":3,"file":"ng-icons-core.mjs","sources":["../../../../packages/core/src/lib/utils/format.ts","../../../../packages/core/src/lib/icon.service.ts","../../../../packages/core/src/lib/icon.component.ts","../../../../packages/core/src/lib/icon.module.ts","../../../../packages/core/src/ng-icons-core.ts"],"sourcesContent":["/**\n * Hyphenated to UpperCamelCase\n */\nexport function toUpperCamelCase(str: string): string {\n return toCapitalCase(toPropertyName(str));\n}\n\n/**\n * Hyphenated to lowerCamelCase\n */\nexport function toPropertyName(str: string): string {\n return str\n .replace(/([^a-zA-Z0-9])+(.)?/g, (_, __, chr) =>\n chr ? chr.toUpperCase() : '',\n )\n .replace(/[^a-zA-Z\\d]/g, '')\n .replace(/^([A-Z])/, m => m.toLowerCase());\n}\n\n/**\n * Capitalizes the first letter of a string\n */\nexport function toCapitalCase(str: string): string {\n return str.charAt(0).toUpperCase() + str.substr(1);\n}\n","import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class IconService {\n /** Store the available icons. */\n private static icons: Readonly<Record<string, string>> = {};\n\n /** Access the icons in the class. */\n get icons(): Readonly<Record<string, string>> {\n return IconService.icons;\n }\n\n /**\n * Insert icons into the iconset\n */\n static addIcons(icons: Record<string, string>): void {\n IconService.icons = { ...IconService.icons, ...icons };\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Input,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { toUpperCamelCase } from './utils/format';\nimport { IconService } from './icon.service';\n\n@Component({\n selector: 'ng-icon',\n template: '',\n styleUrls: ['./icon.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class IconComponent {\n /** Define the name of the icon to display */\n @Input() set name(name: string) {\n name = toUpperCamelCase(name);\n\n // if there is no icon with this name warn the user as they probably forgot to import it\n if (!this.iconService.icons.hasOwnProperty(name)) {\n console.warn(\n `No icon named ${name} was found. You may need to import it using the withIcons function.`,\n );\n return;\n }\n\n // insert the SVG into the template\n this.template = this.sanitizer.bypassSecurityTrustHtml(\n this.iconService.icons[name],\n );\n }\n\n /** Store the formatted icon name */\n @HostBinding('innerHTML') template?: SafeHtml;\n\n /** Define the size of the icon */\n @HostBinding('style.--ng-icon__size')\n @Input()\n set size(size: string) {\n // if the size only contains numbers, assume it is in pixels\n this._size = coerceCssPixelValue(size);\n }\n\n get size(): string {\n return this._size;\n }\n\n private _size: string = '1em';\n\n /** Define the stroke-width of the icon */\n @HostBinding('style.--ng-icon__stroke-width')\n @Input()\n strokeWidth?: string | number;\n\n /** Define the color of the icon */\n @HostBinding('style.color')\n @Input()\n color?: string;\n\n constructor(\n private readonly elementRef: ElementRef<HTMLElement>,\n private readonly sanitizer: DomSanitizer,\n private readonly iconService: IconService,\n ) {}\n}\n\nfunction coerceCssPixelValue(value: string): string {\n if (value == null) {\n return '';\n }\n\n return /^\\d+$/.test(value) ? `${value}px` : value;\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { IconComponent } from './icon.component';\nimport { IconService } from './icon.service';\n\n@NgModule({\n declarations: [IconComponent],\n exports: [IconComponent],\n})\nexport class NgIconsModule {\n constructor(private readonly iconService: IconService) {\n if (Object.keys(this.iconService.icons).length === 0) {\n throw new Error(\n 'No icons have been provided. Ensure to include some icons by importing them using NgIconsModule.withIcons({ ... }).',\n );\n }\n }\n\n /**\n * Define the icons that will be included in the application. This allows unused icons to\n * be tree-shaken away to reduce bundle size\n * @param icons The object containing the required icons\n */\n static withIcons(\n icons: Record<string, string>,\n ): ModuleWithProviders<NgIconsModule> {\n IconService.addIcons(icons);\n\n return { ngModule: NgIconsModule };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;;;SAGgB,gBAAgB,CAAC,GAAW;IAC1C,OAAO,aAAa,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED;;;SAGgB,cAAc,CAAC,GAAW;IACxC,OAAO,GAAG;SACP,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,KAC1C,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,GAAG,EAAE,CAC7B;SACA,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;SAC3B,OAAO,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAC/C,CAAC;AAED;;;SAGgB,aAAa,CAAC,GAAW;IACvC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACrD;;MCnBa,WAAW;;IAKtB,IAAI,KAAK;QACP,OAAO,WAAW,CAAC,KAAK,CAAC;KAC1B;;;;IAKD,OAAO,QAAQ,CAAC,KAA6B;QAC3C,WAAW,CAAC,KAAK,mCAAQ,WAAW,CAAC,KAAK,GAAK,KAAK,CAAE,CAAC;KACxD;;AAbD;AACe,iBAAK,GAAqC,EAAG,CAAA;wGAFjD,WAAW;4GAAX,WAAW,cAFV,MAA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I,IAAI,EAAE;QACjB,OAAO,EAAE,CAAC;KACX;IAED,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,KAAK,IAAI,GAAG,KAAK,CAAC;AACpD;;MCpEa,aAAa;IACxB,YAA6B,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;QACnD,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;YACpD,MAAM,IAAI,KAAK,CACb,qHAAqH,CACtH,CAAC;SACH;KACF;;;;;;IAOD,OAAO,SAAS,CACd,KAA6B;QAE7B,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAE5B,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;KACpC;;0GApBU,aAAa;2GAAb,aAAa,iBAHT,aAAa,aAClB,aAAa;2GAEZ,aAAa;2FAAb,aAAa;kBAJzB,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,aAAa,CAAC;oBAC7B,OAAO,EAAE,CAAC,aAAa,CAAC;iBACzB;;;ACPD;;;;;;"}
|
|
@@ -2,141 +2,141 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Injectable, Component, ChangeDetectionStrategy, Input, HostBinding, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/platform-browser';
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* Hyphenated to UpperCamelCase
|
|
7
|
-
*/
|
|
8
|
-
function toUpperCamelCase(str) {
|
|
9
|
-
return toCapitalCase(toPropertyName(str));
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Hyphenated to lowerCamelCase
|
|
13
|
-
*/
|
|
14
|
-
function toPropertyName(str) {
|
|
15
|
-
return str
|
|
16
|
-
.replace(/([^a-zA-Z0-9])+(.)?/g, (_, __, chr) => chr ? chr.toUpperCase() : '')
|
|
17
|
-
.replace(/[^a-zA-Z\d]/g, '')
|
|
18
|
-
.replace(/^([A-Z])/, m => m.toLowerCase());
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Capitalizes the first letter of a string
|
|
22
|
-
*/
|
|
23
|
-
function toCapitalCase(str) {
|
|
24
|
-
return str.charAt(0).toUpperCase() + str.substr(1);
|
|
5
|
+
/**
|
|
6
|
+
* Hyphenated to UpperCamelCase
|
|
7
|
+
*/
|
|
8
|
+
function toUpperCamelCase(str) {
|
|
9
|
+
return toCapitalCase(toPropertyName(str));
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Hyphenated to lowerCamelCase
|
|
13
|
+
*/
|
|
14
|
+
function toPropertyName(str) {
|
|
15
|
+
return str
|
|
16
|
+
.replace(/([^a-zA-Z0-9])+(.)?/g, (_, __, chr) => chr ? chr.toUpperCase() : '')
|
|
17
|
+
.replace(/[^a-zA-Z\d]/g, '')
|
|
18
|
+
.replace(/^([A-Z])/, m => m.toLowerCase());
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Capitalizes the first letter of a string
|
|
22
|
+
*/
|
|
23
|
+
function toCapitalCase(str) {
|
|
24
|
+
return str.charAt(0).toUpperCase() + str.substr(1);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
class IconService {
|
|
28
|
-
/** Access the icons in the class. */
|
|
29
|
-
get icons() {
|
|
30
|
-
return IconService.icons;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Insert icons into the iconset
|
|
34
|
-
*/
|
|
35
|
-
static addIcons(icons) {
|
|
36
|
-
IconService.icons = { ...IconService.icons, ...icons };
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
/** Store the available icons. */
|
|
40
|
-
IconService.icons = {};
|
|
41
|
-
IconService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
42
|
-
IconService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconService, providedIn: 'root' });
|
|
43
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconService, decorators: [{
|
|
44
|
-
type: Injectable,
|
|
45
|
-
args: [{
|
|
46
|
-
providedIn: 'root',
|
|
47
|
-
}]
|
|
27
|
+
class IconService {
|
|
28
|
+
/** Access the icons in the class. */
|
|
29
|
+
get icons() {
|
|
30
|
+
return IconService.icons;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Insert icons into the iconset
|
|
34
|
+
*/
|
|
35
|
+
static addIcons(icons) {
|
|
36
|
+
IconService.icons = { ...IconService.icons, ...icons };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/** Store the available icons. */
|
|
40
|
+
IconService.icons = {};
|
|
41
|
+
IconService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
42
|
+
IconService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconService, providedIn: 'root' });
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconService, decorators: [{
|
|
44
|
+
type: Injectable,
|
|
45
|
+
args: [{
|
|
46
|
+
providedIn: 'root',
|
|
47
|
+
}]
|
|
48
48
|
}] });
|
|
49
49
|
|
|
50
|
-
class IconComponent {
|
|
51
|
-
constructor(elementRef, sanitizer, iconService) {
|
|
52
|
-
this.elementRef = elementRef;
|
|
53
|
-
this.sanitizer = sanitizer;
|
|
54
|
-
this.iconService = iconService;
|
|
55
|
-
this._size = '1em';
|
|
56
|
-
}
|
|
57
|
-
/** Define the name of the icon to display */
|
|
58
|
-
set name(name) {
|
|
59
|
-
name = toUpperCamelCase(name);
|
|
60
|
-
// if there is no icon with this name warn the user as they probably forgot to import it
|
|
61
|
-
if (!this.iconService.icons.hasOwnProperty(name)) {
|
|
62
|
-
console.warn(`No icon named ${name} was found. You may need to import it using the withIcons function.`);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
// insert the SVG into the template
|
|
66
|
-
this.template = this.sanitizer.bypassSecurityTrustHtml(this.iconService.icons[name]);
|
|
67
|
-
}
|
|
68
|
-
/** Define the size of the icon */
|
|
69
|
-
set size(size) {
|
|
70
|
-
// if the size only contains numbers, assume it is in pixels
|
|
71
|
-
this._size = coerceCssPixelValue(size);
|
|
72
|
-
}
|
|
73
|
-
get size() {
|
|
74
|
-
return this._size;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
IconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconComponent, deps: [{ token: i0.ElementRef }, { token: i1.DomSanitizer }, { token: IconService }], target: i0.ɵɵFactoryTarget.Component });
|
|
78
|
-
IconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: IconComponent, selector: "ng-icon", inputs: { name: "name", size: "size", strokeWidth: "strokeWidth", color: "color" }, host: { properties: { "innerHTML": "this.template", "style.--ng-icon__size": "this.size", "style.--ng-icon__stroke-width": "this.strokeWidth", "style.color": "this.color" } }, ngImport: i0, template: '', isInline: true, styles: [":host{display:inline-block;width:var(--ng-icon__size);height:var(--ng-icon__size)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
79
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconComponent, decorators: [{
|
|
80
|
-
type: Component,
|
|
81
|
-
args: [{ selector: 'ng-icon', template: '', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-block;width:var(--ng-icon__size);height:var(--ng-icon__size)}\n"] }]
|
|
82
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.DomSanitizer }, { type: IconService }]; }, propDecorators: { name: [{
|
|
83
|
-
type: Input
|
|
84
|
-
}], template: [{
|
|
85
|
-
type: HostBinding,
|
|
86
|
-
args: ['innerHTML']
|
|
87
|
-
}], size: [{
|
|
88
|
-
type: HostBinding,
|
|
89
|
-
args: ['style.--ng-icon__size']
|
|
90
|
-
}, {
|
|
91
|
-
type: Input
|
|
92
|
-
}], strokeWidth: [{
|
|
93
|
-
type: HostBinding,
|
|
94
|
-
args: ['style.--ng-icon__stroke-width']
|
|
95
|
-
}, {
|
|
96
|
-
type: Input
|
|
97
|
-
}], color: [{
|
|
98
|
-
type: HostBinding,
|
|
99
|
-
args: ['style.color']
|
|
100
|
-
}, {
|
|
101
|
-
type: Input
|
|
102
|
-
}] } });
|
|
103
|
-
function coerceCssPixelValue(value) {
|
|
104
|
-
if (value == null) {
|
|
105
|
-
return '';
|
|
106
|
-
}
|
|
107
|
-
return /^\d+$/.test(value) ? `${value}px` : value;
|
|
50
|
+
class IconComponent {
|
|
51
|
+
constructor(elementRef, sanitizer, iconService) {
|
|
52
|
+
this.elementRef = elementRef;
|
|
53
|
+
this.sanitizer = sanitizer;
|
|
54
|
+
this.iconService = iconService;
|
|
55
|
+
this._size = '1em';
|
|
56
|
+
}
|
|
57
|
+
/** Define the name of the icon to display */
|
|
58
|
+
set name(name) {
|
|
59
|
+
name = toUpperCamelCase(name);
|
|
60
|
+
// if there is no icon with this name warn the user as they probably forgot to import it
|
|
61
|
+
if (!this.iconService.icons.hasOwnProperty(name)) {
|
|
62
|
+
console.warn(`No icon named ${name} was found. You may need to import it using the withIcons function.`);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
// insert the SVG into the template
|
|
66
|
+
this.template = this.sanitizer.bypassSecurityTrustHtml(this.iconService.icons[name]);
|
|
67
|
+
}
|
|
68
|
+
/** Define the size of the icon */
|
|
69
|
+
set size(size) {
|
|
70
|
+
// if the size only contains numbers, assume it is in pixels
|
|
71
|
+
this._size = coerceCssPixelValue(size);
|
|
72
|
+
}
|
|
73
|
+
get size() {
|
|
74
|
+
return this._size;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
IconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconComponent, deps: [{ token: i0.ElementRef }, { token: i1.DomSanitizer }, { token: IconService }], target: i0.ɵɵFactoryTarget.Component });
|
|
78
|
+
IconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: IconComponent, selector: "ng-icon", inputs: { name: "name", size: "size", strokeWidth: "strokeWidth", color: "color" }, host: { properties: { "innerHTML": "this.template", "style.--ng-icon__size": "this.size", "style.--ng-icon__stroke-width": "this.strokeWidth", "style.color": "this.color" } }, ngImport: i0, template: '', isInline: true, styles: [":host{display:inline-block;width:var(--ng-icon__size);height:var(--ng-icon__size)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
79
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: IconComponent, decorators: [{
|
|
80
|
+
type: Component,
|
|
81
|
+
args: [{ selector: 'ng-icon', template: '', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-block;width:var(--ng-icon__size);height:var(--ng-icon__size)}\n"] }]
|
|
82
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.DomSanitizer }, { type: IconService }]; }, propDecorators: { name: [{
|
|
83
|
+
type: Input
|
|
84
|
+
}], template: [{
|
|
85
|
+
type: HostBinding,
|
|
86
|
+
args: ['innerHTML']
|
|
87
|
+
}], size: [{
|
|
88
|
+
type: HostBinding,
|
|
89
|
+
args: ['style.--ng-icon__size']
|
|
90
|
+
}, {
|
|
91
|
+
type: Input
|
|
92
|
+
}], strokeWidth: [{
|
|
93
|
+
type: HostBinding,
|
|
94
|
+
args: ['style.--ng-icon__stroke-width']
|
|
95
|
+
}, {
|
|
96
|
+
type: Input
|
|
97
|
+
}], color: [{
|
|
98
|
+
type: HostBinding,
|
|
99
|
+
args: ['style.color']
|
|
100
|
+
}, {
|
|
101
|
+
type: Input
|
|
102
|
+
}] } });
|
|
103
|
+
function coerceCssPixelValue(value) {
|
|
104
|
+
if (value == null) {
|
|
105
|
+
return '';
|
|
106
|
+
}
|
|
107
|
+
return /^\d+$/.test(value) ? `${value}px` : value;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
class NgIconsModule {
|
|
111
|
-
constructor(iconService) {
|
|
112
|
-
this.iconService = iconService;
|
|
113
|
-
if (Object.keys(this.iconService.icons).length === 0) {
|
|
114
|
-
throw new Error('No icons have been provided. Ensure to include some icons by importing them using NgIconsModule.withIcons({ ... }).');
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Define the icons that will be included in the application. This allows unused icons to
|
|
119
|
-
* be tree-shaken away to reduce bundle size
|
|
120
|
-
* @param icons The object containing the required icons
|
|
121
|
-
*/
|
|
122
|
-
static withIcons(icons) {
|
|
123
|
-
IconService.addIcons(icons);
|
|
124
|
-
return { ngModule: NgIconsModule };
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
NgIconsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule, deps: [{ token: IconService }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
128
|
-
NgIconsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule, declarations: [IconComponent], exports: [IconComponent] });
|
|
129
|
-
NgIconsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule });
|
|
130
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule, decorators: [{
|
|
131
|
-
type: NgModule,
|
|
132
|
-
args: [{
|
|
133
|
-
declarations: [IconComponent],
|
|
134
|
-
exports: [IconComponent],
|
|
135
|
-
}]
|
|
110
|
+
class NgIconsModule {
|
|
111
|
+
constructor(iconService) {
|
|
112
|
+
this.iconService = iconService;
|
|
113
|
+
if (Object.keys(this.iconService.icons).length === 0) {
|
|
114
|
+
throw new Error('No icons have been provided. Ensure to include some icons by importing them using NgIconsModule.withIcons({ ... }).');
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Define the icons that will be included in the application. This allows unused icons to
|
|
119
|
+
* be tree-shaken away to reduce bundle size
|
|
120
|
+
* @param icons The object containing the required icons
|
|
121
|
+
*/
|
|
122
|
+
static withIcons(icons) {
|
|
123
|
+
IconService.addIcons(icons);
|
|
124
|
+
return { ngModule: NgIconsModule };
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
NgIconsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule, deps: [{ token: IconService }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
128
|
+
NgIconsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule, declarations: [IconComponent], exports: [IconComponent] });
|
|
129
|
+
NgIconsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule });
|
|
130
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgIconsModule, decorators: [{
|
|
131
|
+
type: NgModule,
|
|
132
|
+
args: [{
|
|
133
|
+
declarations: [IconComponent],
|
|
134
|
+
exports: [IconComponent],
|
|
135
|
+
}]
|
|
136
136
|
}], ctorParameters: function () { return [{ type: IconService }]; } });
|
|
137
137
|
|
|
138
|
-
/**
|
|
139
|
-
* Generated bundle index. Do not edit.
|
|
138
|
+
/**
|
|
139
|
+
* Generated bundle index. Do not edit.
|
|
140
140
|
*/
|
|
141
141
|
|
|
142
142
|
export { IconComponent, NgIconsModule };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-icons-core.mjs","sources":["../../../../packages/core/src/lib/utils/format.ts","../../../../packages/core/src/lib/icon.service.ts","../../../../packages/core/src/lib/icon.component.ts","../../../../packages/core/src/lib/icon.module.ts","../../../../packages/core/src/ng-icons-core.ts"],"sourcesContent":["/**\
|
|
1
|
+
{"version":3,"file":"ng-icons-core.mjs","sources":["../../../../packages/core/src/lib/utils/format.ts","../../../../packages/core/src/lib/icon.service.ts","../../../../packages/core/src/lib/icon.component.ts","../../../../packages/core/src/lib/icon.module.ts","../../../../packages/core/src/ng-icons-core.ts"],"sourcesContent":["/**\n * Hyphenated to UpperCamelCase\n */\nexport function toUpperCamelCase(str: string): string {\n return toCapitalCase(toPropertyName(str));\n}\n\n/**\n * Hyphenated to lowerCamelCase\n */\nexport function toPropertyName(str: string): string {\n return str\n .replace(/([^a-zA-Z0-9])+(.)?/g, (_, __, chr) =>\n chr ? chr.toUpperCase() : '',\n )\n .replace(/[^a-zA-Z\\d]/g, '')\n .replace(/^([A-Z])/, m => m.toLowerCase());\n}\n\n/**\n * Capitalizes the first letter of a string\n */\nexport function toCapitalCase(str: string): string {\n return str.charAt(0).toUpperCase() + str.substr(1);\n}\n","import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class IconService {\n /** Store the available icons. */\n private static icons: Readonly<Record<string, string>> = {};\n\n /** Access the icons in the class. */\n get icons(): Readonly<Record<string, string>> {\n return IconService.icons;\n }\n\n /**\n * Insert icons into the iconset\n */\n static addIcons(icons: Record<string, string>): void {\n IconService.icons = { ...IconService.icons, ...icons };\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Input,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { toUpperCamelCase } from './utils/format';\nimport { IconService } from './icon.service';\n\n@Component({\n selector: 'ng-icon',\n template: '',\n styleUrls: ['./icon.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class IconComponent {\n /** Define the name of the icon to display */\n @Input() set name(name: string) {\n name = toUpperCamelCase(name);\n\n // if there is no icon with this name warn the user as they probably forgot to import it\n if (!this.iconService.icons.hasOwnProperty(name)) {\n console.warn(\n `No icon named ${name} was found. You may need to import it using the withIcons function.`,\n );\n return;\n }\n\n // insert the SVG into the template\n this.template = this.sanitizer.bypassSecurityTrustHtml(\n this.iconService.icons[name],\n );\n }\n\n /** Store the formatted icon name */\n @HostBinding('innerHTML') template?: SafeHtml;\n\n /** Define the size of the icon */\n @HostBinding('style.--ng-icon__size')\n @Input()\n set size(size: string) {\n // if the size only contains numbers, assume it is in pixels\n this._size = coerceCssPixelValue(size);\n }\n\n get size(): string {\n return this._size;\n }\n\n private _size: string = '1em';\n\n /** Define the stroke-width of the icon */\n @HostBinding('style.--ng-icon__stroke-width')\n @Input()\n strokeWidth?: string | number;\n\n /** Define the color of the icon */\n @HostBinding('style.color')\n @Input()\n color?: string;\n\n constructor(\n private readonly elementRef: ElementRef<HTMLElement>,\n private readonly sanitizer: DomSanitizer,\n private readonly iconService: IconService,\n ) {}\n}\n\nfunction coerceCssPixelValue(value: string): string {\n if (value == null) {\n return '';\n }\n\n return /^\\d+$/.test(value) ? `${value}px` : value;\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { IconComponent } from './icon.component';\nimport { IconService } from './icon.service';\n\n@NgModule({\n declarations: [IconComponent],\n exports: [IconComponent],\n})\nexport class NgIconsModule {\n constructor(private readonly iconService: IconService) {\n if (Object.keys(this.iconService.icons).length === 0) {\n throw new Error(\n 'No icons have been provided. Ensure to include some icons by importing them using NgIconsModule.withIcons({ ... }).',\n );\n }\n }\n\n /**\n * Define the icons that will be included in the application. This allows unused icons to\n * be tree-shaken away to reduce bundle size\n * @param icons The object containing the required icons\n */\n static withIcons(\n icons: Record<string, string>,\n ): ModuleWithProviders<NgIconsModule> {\n IconService.addIcons(icons);\n\n return { ngModule: NgIconsModule };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;;;SAGgB,gBAAgB,CAAC,GAAW;IAC1C,OAAO,aAAa,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED;;;SAGgB,cAAc,CAAC,GAAW;IACxC,OAAO,GAAG;SACP,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,KAC1C,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,GAAG,EAAE,CAC7B;SACA,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;SAC3B,OAAO,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAC/C,CAAC;AAED;;;SAGgB,aAAa,CAAC,GAAW;IACvC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACrD;;MCnBa,WAAW;;IAKtB,IAAI,KAAK;QACP,OAAO,WAAW,CAAC,KAAK,CAAC;KAC1B;;;;IAKD,OAAO,QAAQ,CAAC,KAA6B;QAC3C,WAAW,CAAC,KAAK,GAAG,EAAE,GAAG,WAAW,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC;KACxD;;AAbD;AACe,iBAAK,GAAqC,EAAG,CAAA;wGAFjD,WAAW;4GAAX,WAAW,cAFV,MAAM;2FAEP,WAAW;kBAHvB,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;MCaY,aAAa;IA8CxB,YACmB,UAAmC,EACnC,SAAuB,EACvB,WAAwB;QAFxB,eAAU,GAAV,UAAU,CAAyB;QACnC,cAAS,GAAT,SAAS,CAAc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,WAAW,CAAa;QACnD,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;YACpD,MAAM,IAAI,KAAK,CACb,qHAAqH,CACtH,CAAC;SACH;KACF;;;;;;IAOD,OAAO,SAAS,CACd,KAA6B;QAE7B,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAE5B,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;KACpC;;0GApBU,aAAa;2GAAb,aAAa,iBAHT,aAAa,aAClB,aAAa;2GAEZ,aAAa;2FAAb,aAAa;kBAJzB,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,aAAa,CAAC;oBAC7B,OAAO,EAAE,CAAC,aAAa,CAAC;iBACzB;;;ACPD;;;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './lib/icon.component';
|
|
2
|
-
export * from './lib/icon.module';
|
|
1
|
+
export * from './lib/icon.component';
|
|
2
|
+
export * from './lib/icon.module';
|
package/lib/icon.component.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { ElementRef } from '@angular/core';
|
|
2
|
-
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
3
|
-
import { IconService } from './icon.service';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class IconComponent {
|
|
6
|
-
private readonly elementRef;
|
|
7
|
-
private readonly sanitizer;
|
|
8
|
-
private readonly iconService;
|
|
9
|
-
/** Define the name of the icon to display */
|
|
10
|
-
set name(name: string);
|
|
11
|
-
/** Store the formatted icon name */
|
|
12
|
-
template?: SafeHtml;
|
|
13
|
-
/** Define the size of the icon */
|
|
14
|
-
set size(size: string);
|
|
15
|
-
get size(): string;
|
|
16
|
-
private _size;
|
|
17
|
-
/** Define the stroke-width of the icon */
|
|
18
|
-
strokeWidth?: string | number;
|
|
19
|
-
/** Define the color of the icon */
|
|
20
|
-
color?: string;
|
|
21
|
-
constructor(elementRef: ElementRef<HTMLElement>, sanitizer: DomSanitizer, iconService: IconService);
|
|
22
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<IconComponent, never>;
|
|
23
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<IconComponent, "ng-icon", never, { "name": "name"; "size": "size"; "strokeWidth": "strokeWidth"; "color": "color"; }, {}, never, never>;
|
|
24
|
-
}
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
3
|
+
import { IconService } from './icon.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class IconComponent {
|
|
6
|
+
private readonly elementRef;
|
|
7
|
+
private readonly sanitizer;
|
|
8
|
+
private readonly iconService;
|
|
9
|
+
/** Define the name of the icon to display */
|
|
10
|
+
set name(name: string);
|
|
11
|
+
/** Store the formatted icon name */
|
|
12
|
+
template?: SafeHtml;
|
|
13
|
+
/** Define the size of the icon */
|
|
14
|
+
set size(size: string);
|
|
15
|
+
get size(): string;
|
|
16
|
+
private _size;
|
|
17
|
+
/** Define the stroke-width of the icon */
|
|
18
|
+
strokeWidth?: string | number;
|
|
19
|
+
/** Define the color of the icon */
|
|
20
|
+
color?: string;
|
|
21
|
+
constructor(elementRef: ElementRef<HTMLElement>, sanitizer: DomSanitizer, iconService: IconService);
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<IconComponent, never>;
|
|
23
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<IconComponent, "ng-icon", never, { "name": "name"; "size": "size"; "strokeWidth": "strokeWidth"; "color": "color"; }, {}, never, never>;
|
|
24
|
+
}
|
package/lib/icon.module.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
-
import { IconService } from './icon.service';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "./icon.component";
|
|
5
|
-
export declare class NgIconsModule {
|
|
6
|
-
private readonly iconService;
|
|
7
|
-
constructor(iconService: IconService);
|
|
8
|
-
/**
|
|
9
|
-
* Define the icons that will be included in the application. This allows unused icons to
|
|
10
|
-
* be tree-shaken away to reduce bundle size
|
|
11
|
-
* @param icons The object containing the required icons
|
|
12
|
-
*/
|
|
13
|
-
static withIcons(icons: Record<string, string>): ModuleWithProviders<NgIconsModule>;
|
|
14
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NgIconsModule, never>;
|
|
15
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<NgIconsModule, [typeof i1.IconComponent], never, [typeof i1.IconComponent]>;
|
|
16
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<NgIconsModule>;
|
|
17
|
-
}
|
|
1
|
+
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
+
import { IconService } from './icon.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "./icon.component";
|
|
5
|
+
export declare class NgIconsModule {
|
|
6
|
+
private readonly iconService;
|
|
7
|
+
constructor(iconService: IconService);
|
|
8
|
+
/**
|
|
9
|
+
* Define the icons that will be included in the application. This allows unused icons to
|
|
10
|
+
* be tree-shaken away to reduce bundle size
|
|
11
|
+
* @param icons The object containing the required icons
|
|
12
|
+
*/
|
|
13
|
+
static withIcons(icons: Record<string, string>): ModuleWithProviders<NgIconsModule>;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgIconsModule, never>;
|
|
15
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgIconsModule, [typeof i1.IconComponent], never, [typeof i1.IconComponent]>;
|
|
16
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgIconsModule>;
|
|
17
|
+
}
|
package/lib/icon.service.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class IconService {
|
|
3
|
-
/** Store the available icons. */
|
|
4
|
-
private static icons;
|
|
5
|
-
/** Access the icons in the class. */
|
|
6
|
-
get icons(): Readonly<Record<string, string>>;
|
|
7
|
-
/**
|
|
8
|
-
* Insert icons into the iconset
|
|
9
|
-
*/
|
|
10
|
-
static addIcons(icons: Record<string, string>): void;
|
|
11
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<IconService, never>;
|
|
12
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<IconService>;
|
|
13
|
-
}
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class IconService {
|
|
3
|
+
/** Store the available icons. */
|
|
4
|
+
private static icons;
|
|
5
|
+
/** Access the icons in the class. */
|
|
6
|
+
get icons(): Readonly<Record<string, string>>;
|
|
7
|
+
/**
|
|
8
|
+
* Insert icons into the iconset
|
|
9
|
+
*/
|
|
10
|
+
static addIcons(icons: Record<string, string>): void;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<IconService, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<IconService>;
|
|
13
|
+
}
|
package/lib/utils/format.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hyphenated to UpperCamelCase
|
|
3
|
-
*/
|
|
4
|
-
export declare function toUpperCamelCase(str: string): string;
|
|
5
|
-
/**
|
|
6
|
-
* Hyphenated to lowerCamelCase
|
|
7
|
-
*/
|
|
8
|
-
export declare function toPropertyName(str: string): string;
|
|
9
|
-
/**
|
|
10
|
-
* Capitalizes the first letter of a string
|
|
11
|
-
*/
|
|
12
|
-
export declare function toCapitalCase(str: string): string;
|
|
1
|
+
/**
|
|
2
|
+
* Hyphenated to UpperCamelCase
|
|
3
|
+
*/
|
|
4
|
+
export declare function toUpperCamelCase(str: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* Hyphenated to lowerCamelCase
|
|
7
|
+
*/
|
|
8
|
+
export declare function toPropertyName(str: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Capitalizes the first letter of a string
|
|
11
|
+
*/
|
|
12
|
+
export declare function toCapitalCase(str: string): string;
|
package/ng-icons-core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
/// <amd-module name="@ng-icons/core" />
|
|
5
|
-
export * from './index';
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
/// <amd-module name="@ng-icons/core" />
|
|
5
|
+
export * from './index';
|