ngwr 0.0.1

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 (74) hide show
  1. package/button/button.component.ts +132 -0
  2. package/button/button.module.ts +11 -0
  3. package/button/index.ts +2 -0
  4. package/core/types/convert-input.ts +2 -0
  5. package/core/types/index.ts +3 -0
  6. package/core/types/indexable.ts +3 -0
  7. package/core/types/ng-class.ts +11 -0
  8. package/core/util/convert.ts +63 -0
  9. package/core/util/index.ts +1 -0
  10. package/divider/divider.component.ts +13 -0
  11. package/divider/divider.module.ts +10 -0
  12. package/divider/index.ts +2 -0
  13. package/extended-input/extended-input.component.html +13 -0
  14. package/extended-input/extended-input.component.ts +77 -0
  15. package/extended-input/extended-input.module.ts +17 -0
  16. package/extended-input/index.ts +2 -0
  17. package/form/form-error.component.ts +20 -0
  18. package/form/form-item.component.ts +60 -0
  19. package/form/form.module.ts +17 -0
  20. package/form/index.ts +3 -0
  21. package/icon/icon.component.ts +45 -0
  22. package/icon/icons.ts +229 -0
  23. package/icon/index.ts +3 -0
  24. package/icon/walrus-icons-registry.service.ts +20 -0
  25. package/icon/walrus-icons.module.ts +8 -0
  26. package/index.ts +1 -0
  27. package/input/index.ts +2 -0
  28. package/input/input.directive.ts +65 -0
  29. package/input/input.module.ts +16 -0
  30. package/ng-package.json +11 -0
  31. package/package.json +27 -0
  32. package/password-input/index.ts +2 -0
  33. package/password-input/password-input.component.html +10 -0
  34. package/password-input/password-input.component.ts +56 -0
  35. package/password-input/password-input.module.ts +28 -0
  36. package/public-api.ts +10 -0
  37. package/skeleton/index.ts +2 -0
  38. package/skeleton/skeleton.component.ts +38 -0
  39. package/skeleton/skeleton.module.ts +11 -0
  40. package/spinner/index.ts +2 -0
  41. package/spinner/spinner.component.ts +11 -0
  42. package/spinner/spinner.module.ts +10 -0
  43. package/styles/components/_index.scss +15 -0
  44. package/styles/components/alert.scss +28 -0
  45. package/styles/components/button.scss +115 -0
  46. package/styles/components/card.scss +41 -0
  47. package/styles/components/divider.scss +19 -0
  48. package/styles/components/dropdown.scss +128 -0
  49. package/styles/components/extended-input.scss +64 -0
  50. package/styles/components/form.scss +85 -0
  51. package/styles/components/heading.scss +25 -0
  52. package/styles/components/icon.scss +32 -0
  53. package/styles/components/input.scss +43 -0
  54. package/styles/components/password-input.scss +31 -0
  55. package/styles/components/skeleton.scss +58 -0
  56. package/styles/components/spinner.scss +44 -0
  57. package/styles/components/tag.scss +70 -0
  58. package/styles/components/tooltip.scss +60 -0
  59. package/styles/functions.scss +184 -0
  60. package/styles/grid.scss +177 -0
  61. package/styles/index.scss +165 -0
  62. package/styles/mixins/_index.scss +22 -0
  63. package/styles/mixins/alert.scss +7 -0
  64. package/styles/mixins/button.scss +56 -0
  65. package/styles/mixins/reset-component.scss +13 -0
  66. package/styles/mixins/tag.scss +68 -0
  67. package/styles/reset.scss +104 -0
  68. package/styles/root.scss +31 -0
  69. package/styles/vars.scss +1075 -0
  70. package/tag/index.ts +2 -0
  71. package/tag/tag.component.ts +92 -0
  72. package/tag/tag.module.ts +11 -0
  73. package/tsconfig.lib.json +15 -0
  74. package/tsconfig.lib.prod.json +10 -0
package/tag/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './tag.module';
2
+ export * from './tag.component';
@@ -0,0 +1,92 @@
1
+ import {
2
+ ChangeDetectionStrategy,
3
+ Component,
4
+ ElementRef,
5
+ Input, OnChanges,
6
+ OnDestroy,
7
+ OnInit,
8
+ Renderer2, SimpleChanges,
9
+ ViewEncapsulation
10
+ } from '@angular/core';
11
+ import { Subject } from 'rxjs';
12
+ import { InputBoolean } from '../core/util';
13
+
14
+ export type WalrusTagColor = 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'dark';
15
+
16
+ @Component({
17
+ selector: 'wr-tag',
18
+ exportAs: 'wrTag',
19
+ preserveWhitespaces: false,
20
+ template: '<wr-spin *ngIf="loading"></wr-spin><ng-content></ng-content>',
21
+ changeDetection: ChangeDetectionStrategy.OnPush,
22
+ encapsulation: ViewEncapsulation.None
23
+ })
24
+ export class WalrusTagComponent implements OnInit, OnDestroy, OnChanges {
25
+ // add color class
26
+ @Input() color: WalrusTagColor = 'default';
27
+
28
+ // Is tag transparent
29
+ @Input() @InputBoolean() transparent = false;
30
+
31
+ @Input() @InputBoolean() loading = false;
32
+
33
+ // Is tag outlined
34
+ @Input() @InputBoolean() outline = false;
35
+
36
+ // Is tag outlined
37
+ @Input() @InputBoolean() round = false;
38
+
39
+ // Is tag hoverable
40
+ @Input() @InputBoolean() hoverable = false;
41
+
42
+ private destroy$ = new Subject<void>();
43
+
44
+ constructor(
45
+ private readonly elementRef: ElementRef,
46
+ private readonly r2: Renderer2
47
+ ) {
48
+ }
49
+
50
+ ngOnInit(): void {
51
+ this.setClasses();
52
+ }
53
+
54
+ ngOnDestroy(): void {
55
+ this.destroy$.next();
56
+ this.destroy$.complete();
57
+ }
58
+
59
+ ngOnChanges(changes: SimpleChanges) {
60
+ if (changes) {
61
+ this.setClasses();
62
+ }
63
+ }
64
+
65
+ private setClasses(): void {
66
+ const baseClass = 'wr-tag';
67
+ const el = this.elementRef.nativeElement;
68
+ const add = (klass: string) => this.r2.addClass(el, `${baseClass}-${klass}`);
69
+ const rm = (klass: string) => this.r2.removeClass(el, `${baseClass}-${klass}`);
70
+
71
+ el.classList = [];
72
+
73
+ this.r2.addClass(el, baseClass);
74
+ add(this.color);
75
+
76
+ if (this.round) {
77
+ add(`-round`);
78
+ }
79
+
80
+ if (this.transparent) {
81
+ add(`-transparent`);
82
+ }
83
+
84
+ if (this.hoverable) {
85
+ add(`-hoverable`);
86
+ }
87
+
88
+ if (this.outline) {
89
+ add(`-outline`);
90
+ }
91
+ }
92
+ }
@@ -0,0 +1,11 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { NgModule } from '@angular/core';
3
+ import { WalrusTagComponent } from './tag.component';
4
+ import { WalrusSpinnerModule } from '../spinner';
5
+
6
+ @NgModule({
7
+ imports: [CommonModule, WalrusSpinnerModule],
8
+ declarations: [WalrusTagComponent],
9
+ exports: [WalrusTagComponent]
10
+ })
11
+ export class WalrusTagModule {}
@@ -0,0 +1,15 @@
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "../../tsconfig.json",
4
+ "compilerOptions": {
5
+ "outDir": "../../out-tsc/lib",
6
+ "declaration": true,
7
+ "declarationMap": true,
8
+ "inlineSources": true,
9
+ "types": []
10
+ },
11
+ "exclude": [
12
+ "src/test.ts",
13
+ "**/*.spec.ts"
14
+ ]
15
+ }
@@ -0,0 +1,10 @@
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "./tsconfig.lib.json",
4
+ "compilerOptions": {
5
+ "declarationMap": false
6
+ },
7
+ "angularCompilerOptions": {
8
+ "compilationMode": "partial"
9
+ }
10
+ }