@updevs/icons 1.0.1 → 1.0.2

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.
Files changed (34) hide show
  1. package/ng-package.json +1 -1
  2. package/package.json +6 -6
  3. package/src/assets/{icons → hero-icons}/icons.ts +294 -294
  4. package/src/assets/hero-icons/icons.type.ts +2 -0
  5. package/src/assets/hero-icons/v2.0.18.txt +1 -0
  6. package/src/assets/tabler-icons/icons.ts +50101 -0
  7. package/src/assets/tabler-icons/icons.type.ts +2 -0
  8. package/src/assets/tabler-icons/v2.22.0.txt +1 -0
  9. package/src/lib/icon/base-icon.component.html +1 -0
  10. package/src/lib/icon/base-icon.component.ts +31 -0
  11. package/src/lib/icon/hero-icon/hero-icon.component.scss +15 -0
  12. package/src/lib/icon/{icon.component.spec.ts → hero-icon/hero-icon.component.spec.ts} +5 -5
  13. package/src/lib/icon/hero-icon/hero-icon.component.ts +49 -0
  14. package/src/lib/icon/icon/icon.component.html +6 -0
  15. package/src/lib/icon/icon/icon.component.scss +0 -0
  16. package/src/lib/icon/icon/icon.component.spec.ts +21 -0
  17. package/src/lib/icon/icon/icon.component.ts +51 -0
  18. package/src/lib/icon/{icon.model.ts → models/content-icon.model.ts} +3 -2
  19. package/src/lib/icon/models/icon.model.ts +15 -0
  20. package/src/lib/icon/tabler-icon/tabler-icon.component.scss +0 -0
  21. package/src/lib/icon/tabler-icon/tabler-icon.component.spec.ts +21 -0
  22. package/src/lib/icon/tabler-icon/tabler-icon.component.ts +33 -0
  23. package/src/lib/icon/types/icon-library.type.ts +1 -0
  24. package/src/lib/icon/types/size.type.ts +1 -0
  25. package/src/lib/icon/types/structure.type.ts +1 -0
  26. package/src/lib/upd-icons.module.ts +5 -1
  27. package/src/public-api.ts +8 -4
  28. package/tsconfig.lib.json +1 -1
  29. package/src/assets/icons/v2.0.13.txt +0 -1
  30. package/src/lib/icon/icon.component.html +0 -1
  31. package/src/lib/icon/icon.component.scss +0 -13
  32. package/src/lib/icon/icon.component.ts +0 -49
  33. package/src/lib/icon/size.enum.ts +0 -4
  34. package/src/lib/icon/type.enum.ts +0 -4
@@ -1 +0,0 @@
1
- <span *ngIf="!!icon" [innerHTML]="icon" [class]="size" [style.color]="color"></span>
@@ -1,13 +0,0 @@
1
- :host ::ng-deep .small {
2
- svg {
3
- width: 20px;
4
- height: 20px;
5
- }
6
- }
7
-
8
- :host ::ng-deep .regular {
9
- svg {
10
- width: 24px;
11
- height: 24px;
12
- }
13
- }
@@ -1,49 +0,0 @@
1
- import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';
2
- import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
3
-
4
- import { SizeEnum } from './size.enum';
5
- import { TypeEnum } from './type.enum';
6
- import { icons } from '../../assets/icons/icons';
7
-
8
- @Component({
9
- selector: 'upd-icon',
10
- templateUrl: './icon.component.html',
11
- styleUrls: ['./icon.component.scss']
12
- })
13
- export class IconComponent implements OnChanges {
14
- @Input() name!: string;
15
- @Input() size: 'small' | 'regular' = SizeEnum.Regular;
16
- @Input() type: 'solid' | 'outline' = TypeEnum.Solid;
17
- @Input() color = 'black';
18
-
19
- icon?: SafeHtml;
20
-
21
- constructor(private sanitizer: DomSanitizer) {
22
- }
23
-
24
- ngOnChanges(changes: SimpleChanges): void {
25
- if (!!changes) {
26
- this.generateIcon();
27
- }
28
- }
29
-
30
- private generateIcon(): void {
31
- if (!this.name || !this.size || !this.type) {
32
- return;
33
- }
34
-
35
- const iconModel = icons[this.name];
36
- let iconContent = '';
37
-
38
- switch (this.size) {
39
- case SizeEnum.Small:
40
- iconContent = iconModel.smallSolid || '';
41
- break;
42
- case SizeEnum.Regular:
43
- iconContent = (this.type === TypeEnum.Solid ? iconModel.regularSolid : iconModel.regularOutline) || '';
44
- break;
45
- }
46
-
47
- this.icon = this.sanitizer.bypassSecurityTrustHtml(iconContent);
48
- }
49
- }
@@ -1,4 +0,0 @@
1
- export enum SizeEnum {
2
- Small = 'small',
3
- Regular = 'regular'
4
- }
@@ -1,4 +0,0 @@
1
- export enum TypeEnum {
2
- Solid = 'solid',
3
- Outline = 'outline'
4
- }