angular-matecu 2.0.6 → 2.0.9

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 (104) hide show
  1. package/README.md +29 -0
  2. package/angular-matecu.code-workspace +10 -0
  3. package/karma.conf.js +44 -0
  4. package/ng-package.json +13 -0
  5. package/package.json +7 -15
  6. package/src/lib/modules/matecu-alert-box/components/matecu-alert-box/matecu-alert-box.component.html +11 -0
  7. package/src/lib/modules/matecu-alert-box/components/matecu-alert-box/matecu-alert-box.component.scss +39 -0
  8. package/src/lib/modules/matecu-alert-box/components/matecu-alert-box/matecu-alert-box.component.spec.ts +25 -0
  9. package/src/lib/modules/matecu-alert-box/components/matecu-alert-box/matecu-alert-box.component.ts +56 -0
  10. package/src/lib/modules/matecu-alert-box/components/matecu-alert-dialog/matecu-alert-dialog.component.html +14 -0
  11. package/src/lib/modules/matecu-alert-box/components/matecu-alert-dialog/matecu-alert-dialog.component.scss +5 -0
  12. package/src/lib/modules/matecu-alert-box/components/matecu-alert-dialog/matecu-alert-dialog.component.spec.ts +25 -0
  13. package/src/lib/modules/matecu-alert-box/components/matecu-alert-dialog/matecu-alert-dialog.component.ts +47 -0
  14. package/src/lib/modules/matecu-alert-box/matecu-alert-box.module.ts +17 -0
  15. package/src/lib/modules/matecu-alert-box/matecu-alert-snack-bar/matecu-alert-snack-bar.component.css +0 -0
  16. package/src/lib/modules/matecu-alert-box/matecu-alert-snack-bar/matecu-alert-snack-bar.component.html +1 -0
  17. package/src/lib/modules/matecu-alert-box/matecu-alert-snack-bar/matecu-alert-snack-bar.component.spec.ts +25 -0
  18. package/src/lib/modules/matecu-alert-box/matecu-alert-snack-bar/matecu-alert-snack-bar.component.ts +15 -0
  19. package/src/lib/modules/matecu-alert-box/matecu-snack-bar-alert/matecu-snack-bar-alert.component.html +8 -0
  20. package/src/lib/modules/matecu-alert-box/matecu-snack-bar-alert/matecu-snack-bar-alert.component.scss +34 -0
  21. package/src/lib/modules/matecu-alert-box/matecu-snack-bar-alert/matecu-snack-bar-alert.component.spec.ts +25 -0
  22. package/src/lib/modules/matecu-alert-box/matecu-snack-bar-alert/matecu-snack-bar-alert.component.ts +41 -0
  23. package/src/lib/modules/matecu-alert-box/services/matecu-snack-bar.service.spec.ts +16 -0
  24. package/src/lib/modules/matecu-alert-box/services/matecu-snack-bar.service.ts +66 -0
  25. package/src/lib/modules/matecu-alert-box/types/matecu-alert-dialog.ts +10 -0
  26. package/src/lib/modules/matecu-alert-box/types/matecu-alert-snackbar.ts +8 -0
  27. package/src/lib/modules/matecu-alert-box/types/matecu-altert-box-type.ts +6 -0
  28. package/src/lib/modules/matecu-spinner/components/matecu-spinner/matecu-spinner.component.css +15 -0
  29. package/src/lib/modules/matecu-spinner/components/matecu-spinner/matecu-spinner.component.html +35 -0
  30. package/src/lib/modules/matecu-spinner/components/matecu-spinner/matecu-spinner.component.spec.ts +25 -0
  31. package/src/lib/modules/matecu-spinner/components/matecu-spinner/matecu-spinner.component.ts +47 -0
  32. package/src/lib/modules/matecu-spinner/components/matecu-spinner/spinner-loader.component.scss +13 -0
  33. package/src/lib/modules/matecu-spinner/matecu-spinner.module.ts +17 -0
  34. package/src/lib/modules/matecu-spinner/services/matecu-spinner.service.spec.ts +16 -0
  35. package/src/lib/modules/matecu-spinner/services/matecu-spinner.service.ts +40 -0
  36. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-actions/matecu-topbar-actions.component.html +1 -0
  37. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-actions/matecu-topbar-actions.component.scss +8 -0
  38. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-actions/matecu-topbar-actions.component.spec.ts +25 -0
  39. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-actions/matecu-topbar-actions.component.ts +12 -0
  40. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-body/matecu-topbar-body.component.html +1 -0
  41. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-body/matecu-topbar-body.component.scss +9 -0
  42. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-body/matecu-topbar-body.component.spec.ts +25 -0
  43. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-body/matecu-topbar-body.component.ts +23 -0
  44. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-fab/matecu-topbar-fab.component.html +3 -0
  45. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-fab/matecu-topbar-fab.component.scss +26 -0
  46. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-fab/matecu-topbar-fab.component.spec.ts +25 -0
  47. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-fab/matecu-topbar-fab.component.ts +27 -0
  48. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-layout/matecu-topbar-layout.component.html +23 -0
  49. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-layout/matecu-topbar-layout.component.scss +48 -0
  50. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-layout/matecu-topbar-layout.component.spec.ts +25 -0
  51. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-layout/matecu-topbar-layout.component.ts +93 -0
  52. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-search/matecu-topbar-search.component.html +12 -0
  53. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-search/matecu-topbar-search.component.scss +101 -0
  54. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-search/matecu-topbar-search.component.spec.ts +25 -0
  55. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-search/matecu-topbar-search.component.ts +79 -0
  56. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-title/matecu-topbar-title.component.html +1 -0
  57. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-title/matecu-topbar-title.component.scss +13 -0
  58. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-title/matecu-topbar-title.component.spec.ts +25 -0
  59. package/src/lib/modules/matecu-topbar-layout/components/matecu-topbar-title/matecu-topbar-title.component.ts +16 -0
  60. package/src/lib/modules/matecu-topbar-layout/matecu-topbar-layout.module.ts +40 -0
  61. package/src/lib/modules/matecu-topbar-layout/scss/variables.scss +2 -0
  62. package/{public-api.d.ts → src/public-api.ts} +8 -0
  63. package/src/test.ts +28 -0
  64. package/tsconfig.lib.json +25 -0
  65. package/tsconfig.lib.prod.json +10 -0
  66. package/tsconfig.spec.json +17 -0
  67. package/tslint.json +17 -0
  68. package/angular-matecu.d.ts +0 -5
  69. package/bundles/angular-matecu.umd.js +0 -681
  70. package/bundles/angular-matecu.umd.js.map +0 -1
  71. package/esm2015/angular-matecu.js +0 -5
  72. package/esm2015/lib/modules/matecu-alert-box/components/matecu-alert-box/matecu-alert-box.component.js +0 -69
  73. package/esm2015/lib/modules/matecu-alert-box/components/matecu-alert-dialog/matecu-alert-dialog.component.js +0 -55
  74. package/esm2015/lib/modules/matecu-alert-box/matecu-alert-box.module.js +0 -23
  75. package/esm2015/lib/modules/matecu-alert-box/types/matecu-alert-dialog.js +0 -2
  76. package/esm2015/lib/modules/matecu-alert-box/types/matecu-altert-box-type.js +0 -8
  77. package/esm2015/lib/modules/matecu-spinner/components/matecu-spinner/matecu-spinner.component.js +0 -61
  78. package/esm2015/lib/modules/matecu-spinner/matecu-spinner.module.js +0 -24
  79. package/esm2015/lib/modules/matecu-spinner/services/matecu-spinner.service.js +0 -44
  80. package/esm2015/lib/modules/matecu-topbar-layout/components/matecu-topbar-actions/matecu-topbar-actions.component.js +0 -17
  81. package/esm2015/lib/modules/matecu-topbar-layout/components/matecu-topbar-body/matecu-topbar-body.component.js +0 -32
  82. package/esm2015/lib/modules/matecu-topbar-layout/components/matecu-topbar-fab/matecu-topbar-fab.component.js +0 -36
  83. package/esm2015/lib/modules/matecu-topbar-layout/components/matecu-topbar-layout/matecu-topbar-layout.component.js +0 -103
  84. package/esm2015/lib/modules/matecu-topbar-layout/components/matecu-topbar-search/matecu-topbar-search.component.js +0 -85
  85. package/esm2015/lib/modules/matecu-topbar-layout/components/matecu-topbar-title/matecu-topbar-title.component.js +0 -23
  86. package/esm2015/lib/modules/matecu-topbar-layout/matecu-topbar-layout.module.js +0 -70
  87. package/esm2015/public-api.js +0 -28
  88. package/fesm2015/angular-matecu.js +0 -603
  89. package/fesm2015/angular-matecu.js.map +0 -1
  90. package/lib/modules/matecu-alert-box/components/matecu-alert-box/matecu-alert-box.component.d.ts +0 -19
  91. package/lib/modules/matecu-alert-box/components/matecu-alert-dialog/matecu-alert-dialog.component.d.ts +0 -22
  92. package/lib/modules/matecu-alert-box/matecu-alert-box.module.d.ts +0 -12
  93. package/lib/modules/matecu-alert-box/types/matecu-alert-dialog.d.ts +0 -9
  94. package/lib/modules/matecu-alert-box/types/matecu-altert-box-type.d.ts +0 -6
  95. package/lib/modules/matecu-spinner/components/matecu-spinner/matecu-spinner.component.d.ts +0 -20
  96. package/lib/modules/matecu-spinner/matecu-spinner.module.d.ts +0 -8
  97. package/lib/modules/matecu-spinner/services/matecu-spinner.service.d.ts +0 -15
  98. package/lib/modules/matecu-topbar-layout/components/matecu-topbar-actions/matecu-topbar-actions.component.d.ts +0 -8
  99. package/lib/modules/matecu-topbar-layout/components/matecu-topbar-body/matecu-topbar-body.component.d.ts +0 -11
  100. package/lib/modules/matecu-topbar-layout/components/matecu-topbar-fab/matecu-topbar-fab.component.d.ts +0 -13
  101. package/lib/modules/matecu-topbar-layout/components/matecu-topbar-layout/matecu-topbar-layout.component.d.ts +0 -30
  102. package/lib/modules/matecu-topbar-layout/components/matecu-topbar-search/matecu-topbar-search.component.d.ts +0 -26
  103. package/lib/modules/matecu-topbar-layout/components/matecu-topbar-title/matecu-topbar-title.component.d.ts +0 -9
  104. package/lib/modules/matecu-topbar-layout/matecu-topbar-layout.module.d.ts +0 -17
@@ -1,603 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, Component, HostBinding, Input, NgModule, EventEmitter, Output, Inject } from '@angular/core';
3
- import * as i2 from '@angular/common';
4
- import { CommonModule } from '@angular/common';
5
- import { BehaviorSubject, Subject, of, fromEvent } from 'rxjs';
6
- import { tap, takeUntil, map, debounceTime, distinctUntilChanged } from 'rxjs/operators';
7
- import * as i4 from '@angular/forms';
8
- import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
9
- import * as i1 from '@angular/material/toolbar';
10
- import { MatToolbarModule } from '@angular/material/toolbar';
11
- import * as i1$1 from '@angular/material/button';
12
- import { MatButtonModule } from '@angular/material/button';
13
- import * as i3 from '@angular/material/icon';
14
- import { MatIconModule } from '@angular/material/icon';
15
- import * as i1$2 from '@angular/material/dialog';
16
- import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
17
-
18
- class MatecuSpinnerService {
19
- constructor() {
20
- this.active$ = new BehaviorSubject(false);
21
- this.requestsKeys = [];
22
- }
23
- watch() {
24
- return this.active$.pipe();
25
- }
26
- add(customKey) {
27
- const key = (typeof (customKey) === 'string' && customKey.length > 0) ? customKey : this.createKey();
28
- this.requestsKeys.push(key);
29
- this.updateStatus();
30
- return key;
31
- }
32
- remove(key) {
33
- this.requestsKeys = this.requestsKeys.filter((requestKey) => requestKey !== key);
34
- this.updateStatus();
35
- }
36
- clear() {
37
- this.requestsKeys = [];
38
- this.updateStatus();
39
- }
40
- updateStatus() {
41
- const active = this.requestsKeys.length > 0;
42
- this.active$.next(active);
43
- }
44
- createKey() {
45
- const time = new Date().getTime();
46
- const complement = Math.random();
47
- return `${time}__${complement}`;
48
- }
49
- }
50
- MatecuSpinnerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuSpinnerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
51
- MatecuSpinnerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuSpinnerService, providedIn: 'root' });
52
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuSpinnerService, decorators: [{
53
- type: Injectable,
54
- args: [{
55
- providedIn: 'root',
56
- }]
57
- }], ctorParameters: function () { return []; } });
58
-
59
- class MatecuSpinnerComponent {
60
- constructor(spinnerService) {
61
- this.spinnerService = spinnerService;
62
- this.destroy$ = new Subject();
63
- this.hiddenClass = 'matecu-spinner--hidden';
64
- this.activeCache = false;
65
- this.className = 'matecu-spinner';
66
- this.color = '#2196F3';
67
- this.global = false;
68
- this.size = '70px';
69
- }
70
- get active() {
71
- return this.activeCache;
72
- }
73
- set active(value) {
74
- if (this.global) {
75
- return;
76
- }
77
- this.activeCache = value;
78
- this.className = value
79
- ? this.className.replace(` ${this.hiddenClass}`, '')
80
- : (this.className += ` ${this.hiddenClass}`);
81
- }
82
- ngOnDestroy() {
83
- this.destroy$.next();
84
- this.destroy$.complete();
85
- }
86
- ngOnInit() {
87
- if (this.global) {
88
- this.spinnerService.watch().pipe(tap(value => this.activeCache = value), takeUntil(this.destroy$)).subscribe();
89
- }
90
- }
91
- }
92
- MatecuSpinnerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuSpinnerComponent, deps: [{ token: MatecuSpinnerService }], target: i0.ɵɵFactoryTarget.Component });
93
- MatecuSpinnerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.4", type: MatecuSpinnerComponent, selector: "matecu-spinner", inputs: { color: "color", global: "global", active: "active", size: "size" }, host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<ng-container *ngIf=\"active\">\n <svg xmlns:svg=\"http://www.w3.org/2000/svg\" [attr.width]=\"size\" [attr.height]=\"size\"\n xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.0\" viewBox=\"0 0 128 128\" xml:space=\"preserve\">\n <rect x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" fill=\"transparent\" />\n <g>\n <path class=\"matecu-spinner__100\" d=\"M122.5 69.25H96.47a33.1 33.1 0 0 0 0-10.5h26.05a5.25 5.25 0 0 1 0 10.5z\" [attr.fill]=\"color\"\n fill-opacity=\"1\" />\n <path class=\"matecu-spinner__30\" d=\"M112.04 97.83L89.47 84.8a33.1 33.1 0 0 0 5.25-9.1l22.57 13.03a5.25 5.25 0 0 1-5.28 9.1z\" [attr.fill]=\"color\"\n fill-opacity=\"0.3\" />\n <path class=\"matecu-spinner__30\" d=\"M88.68 117.35L75.65 94.78a33.1 33.1 0 0 0 9.1-5.25l13.02 22.57a5.25 5.25 0 1 1-9.1 5.25z\"\n [attr.fill]=\"color\" fill-opacity=\"0.3\" />\n <path class=\"matecu-spinner__30\" d=\"M58.7 122.57V96.5a33.1 33.1 0 0 0 10.5 0v26.07a5.25 5.25 0 0 1-10.5 0z\" [attr.fill]=\"color\"\n fill-opacity=\"0.3\" />\n <path class=\"matecu-spinner__30\" d=\"M30.1 112.1l13.04-22.57a33.1 33.1 0 0 0 9.1 5.25L39.2 117.35a5.25 5.25 0 1 1-9.1-5.25z\" [attr.fill]=\"color\"\n fill-opacity=\"0.3\" />\n <path class=\"matecu-spinner__30\" d=\"M10.6 88.74L33.16 75.7a33.1 33.1 0 0 0 5.25 9.1L15.88 97.83a5.25 5.25 0 1 1-5.25-9.1z\" [attr.fill]=\"color\"\n fill-opacity=\"0.3\" />\n <path class=\"matecu-spinner__40\" d=\"M5.37 58.75h26.06a33.1 33.1 0 0 0 0 10.5H5.37a5.25 5.25 0 0 1 0-10.5z\" [attr.fill]=\"color\"\n fill-opacity=\"0.4\" />\n <path class=\"matecu-spinner__50\" d=\"M15.85 30.17L38.4 43.2a33.1 33.1 0 0 0-5.24 9.1L10.6 39.25a5.25 5.25 0 1 1 5.25-9.1z\" [attr.fill]=\"color\"\n fill-opacity=\"0.5\" />\n <path class=\"matecu-spinner__60\" d=\"M39.2 10.65l13.03 22.57a33.1 33.1 0 0 0-9.1 5.25l-13-22.57a5.25 5.25 0 1 1 9.1-5.25z\" [attr.fill]=\"color\"\n fill-opacity=\"0.6\" />\n <path class=\"matecu-spinner__70\" d=\"M69.2 5.43V31.5a33.1 33.1 0 0 0-10.5 0V5.42a5.25 5.25 0 1 1 10.5 0z\" [attr.fill]=\"color\"\n fill-opacity=\"0.7\" />\n <path class=\"matecu-spinner__80\" d=\"M97.77 15.9L84.75 38.47a33.1 33.1 0 0 0-9.1-5.25l13.03-22.57a5.25 5.25 0 1 1 9.1 5.25z\" [attr.fill]=\"color\"\n fill-opacity=\"0.8\" />\n <path class=\"matecu-spinner__90\" d=\"M117.3 39.26L94.7 52.3a33.1 33.1 0 0 0-5.25-9.1l22.57-13.03a5.25 5.25 0 0 1 5.25 9.1z\" [attr.fill]=\"color\"\n fill-opacity=\"0.9\" />\n <animateTransform attributeName=\"transform\" type=\"rotate\"\n values=\"0 64 64;30 64 64;60 64 64;90 64 64;120 64 64;150 64 64;180 64 64;210 64 64;240 64 64;270 64 64;300 64 64;330 64 64\"\n calcMode=\"discrete\" dur=\"600ms\" repeatCount=\"indefinite\"></animateTransform>\n </g>\n</svg>\n</ng-container>", styles: [".matecu-spinner{display:flex;align-items:center;justify-content:center}.matecu-spinner>svg{width:80px;height:80px}.matecu-spinner__hidden{display:none}"], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
94
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuSpinnerComponent, decorators: [{
95
- type: Component,
96
- args: [{
97
- selector: 'matecu-spinner',
98
- templateUrl: './matecu-spinner.component.html',
99
- styleUrls: ['./matecu-spinner.component.css']
100
- }]
101
- }], ctorParameters: function () { return [{ type: MatecuSpinnerService }]; }, propDecorators: { className: [{
102
- type: HostBinding,
103
- args: ['class']
104
- }], color: [{
105
- type: Input
106
- }], global: [{
107
- type: Input
108
- }], active: [{
109
- type: Input
110
- }], size: [{
111
- type: Input
112
- }] } });
113
-
114
- class MatecuSpinnerModule {
115
- }
116
- MatecuSpinnerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuSpinnerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
117
- MatecuSpinnerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuSpinnerModule, declarations: [MatecuSpinnerComponent], imports: [CommonModule], exports: [MatecuSpinnerComponent] });
118
- MatecuSpinnerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuSpinnerModule, imports: [[
119
- CommonModule
120
- ]] });
121
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuSpinnerModule, decorators: [{
122
- type: NgModule,
123
- args: [{
124
- declarations: [MatecuSpinnerComponent],
125
- imports: [
126
- CommonModule
127
- ],
128
- exports: [
129
- MatecuSpinnerComponent
130
- ]
131
- }]
132
- }] });
133
-
134
- class MatecuTopbarLayoutComponent {
135
- constructor() {
136
- this.className = 'matecu-topbar-layout';
137
- this.showSearchInput = false;
138
- this.search = false;
139
- this.searchInput = new FormControl();
140
- this.isProminent = false;
141
- this.scrollingClass = 'matecu-topbar-layout--scrolling';
142
- this.prominentClass = 'matecu-topbar-layout--prominent';
143
- this.color = 'primary';
144
- this.navMenu = true;
145
- this.actionMenu = false;
146
- this.clickNavMenu = new EventEmitter();
147
- this.clickActionMenu = new EventEmitter();
148
- }
149
- set prominent(value) {
150
- this.isProminent = value;
151
- if (value) {
152
- this.className += ' ' + this.prominentClass;
153
- }
154
- else {
155
- const regex = new RegExp(this.prominentClass, 'ig');
156
- this.className = this.className.replace(regex, '').trim();
157
- }
158
- }
159
- ngAfterViewInit() {
160
- this.spyScroll().subscribe();
161
- }
162
- toogleSearch() {
163
- this.showSearchInput = !this.showSearchInput;
164
- }
165
- closeSearch() {
166
- this.showSearchInput = false;
167
- this.searchInput.reset();
168
- }
169
- onMenuClick() { }
170
- onClickNavMenu() {
171
- this.clickNavMenu.emit();
172
- }
173
- onClickActionMenu() {
174
- this.clickActionMenu.emit();
175
- }
176
- spyScroll() {
177
- const scrollabe = document.querySelector('.matecu-topbar-body');
178
- if (!scrollabe) {
179
- return of(null);
180
- }
181
- return fromEvent(scrollabe, 'scroll').pipe(tap(() => this.applyScrollStyles(scrollabe)), map(() => scrollabe));
182
- }
183
- applyScrollStyles(scrollabe) {
184
- if (!scrollabe) {
185
- return;
186
- }
187
- const maxScrollHeight = scrollabe.scrollHeight;
188
- const screenHeight = screen.availHeight;
189
- if (screenHeight > maxScrollHeight) {
190
- return;
191
- }
192
- const scrollPosition = scrollabe.scrollTop;
193
- if (scrollPosition > 20) {
194
- this.className += ' ' + this.scrollingClass;
195
- }
196
- if (scrollPosition < 10) {
197
- const regexp = new RegExp(this.scrollingClass, 'ig');
198
- this.className = this.className.replace(regexp, '').trim();
199
- }
200
- }
201
- }
202
- MatecuTopbarLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuTopbarLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
203
- MatecuTopbarLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.4", type: MatecuTopbarLayoutComponent, selector: "matecu-topbar-layout", inputs: { color: "color", navMenu: "navMenu", actionMenu: "actionMenu", prominent: "prominent" }, outputs: { clickNavMenu: "clickNavMenu", clickActionMenu: "clickActionMenu" }, host: { properties: { "class": "this.className" } }, ngImport: i0, template: " <mat-toolbar [color]=\"color\">\n <ng-container *ngIf=\"navMenu\">\n <div class=\"matecu-topbar-layout__menu-btn\">\n <button mat-icon-button type=\"button\" (click)=\"onClickNavMenu()\">\n <mat-icon>menu</mat-icon>\n </button>\n </div>\n </ng-container>\n <ng-content select=\"matecu-topbar-fab\"></ng-content>\n <ng-content select=\"matecu-topbar-title\"></ng-content>\n <ng-content select=\"matecu-topbar-search\"></ng-content>\n <ng-content select=\"matecu-topbar-actions\"></ng-content>\n <ng-container *ngIf=\"actionMenu\">\n <div class=\"matecu-topbar-layout__more-actions-btn\">\n <button type=\"button\" (click)=\"onClickActionMenu()\" mat-icon-button>\n <mat-icon>more_vert</mat-icon>\n </button>\n </div>\n </ng-container>\n\n\n </mat-toolbar>\n <ng-content select=\"matecu-topbar-body\"></ng-content>\n", styles: [".matecu-topbar-layout,:host{display:grid;height:100vh;max-width:100vw;overflow:hidden;grid-template-rows:auto 1fr;position:relative}.matecu-topbar-layout,.matecu-topbar-layout *,:host,:host *{box-sizing:border-box}.matecu-topbar-layout mat-toolbar,:host mat-toolbar{position:relative;height:64px;max-height:64px;transition:all .3s;align-items:flex-start}.matecu-topbar-layout__menu-btn,.matecu-topbar-layout__more-actions-btn,:host__menu-btn,:host__more-actions-btn{min-height:64px;display:flex;align-items:center}@media screen and (max-width:425px){.matecu-topbar-layout__menu-btn,:host__menu-btn{margin-right:auto}}:host.matecu-topbar-layout--prominent .mat-toolbar{height:128px;max-height:128px}:host.matecu-topbar-layout--scrolling .mat-toolbar{height:64px;max-height:64px;box-shadow:0 3px 5px -1px #0003,0 6px 10px 0 #00000024,0 1px 18px 0 #0000001f}"], components: [{ type: i1.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { type: i1$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
204
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuTopbarLayoutComponent, decorators: [{
205
- type: Component,
206
- args: [{
207
- selector: 'matecu-topbar-layout',
208
- templateUrl: './matecu-topbar-layout.component.html',
209
- styleUrls: ['./matecu-topbar-layout.component.scss'],
210
- }]
211
- }], ctorParameters: function () { return []; }, propDecorators: { className: [{
212
- type: HostBinding,
213
- args: ['class']
214
- }], color: [{
215
- type: Input
216
- }], navMenu: [{
217
- type: Input
218
- }], actionMenu: [{
219
- type: Input
220
- }], clickNavMenu: [{
221
- type: Output
222
- }], clickActionMenu: [{
223
- type: Output
224
- }], prominent: [{
225
- type: Input
226
- }] } });
227
-
228
- class MatecuTopbarTitleComponent {
229
- constructor() {
230
- this.className = 'title';
231
- }
232
- ngOnInit() {
233
- }
234
- }
235
- MatecuTopbarTitleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuTopbarTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
236
- MatecuTopbarTitleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.4", type: MatecuTopbarTitleComponent, selector: "matecu-topbar-title", host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<ng-content></ng-content>", styles: [":host{display:flex;align-items:center;margin-right:auto;padding:7px 1rem;min-height:64px;box-sizing:border-box;align-self:center}@media screen and (max-width:425px){:host{display:none}}"] });
237
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuTopbarTitleComponent, decorators: [{
238
- type: Component,
239
- args: [{
240
- selector: 'matecu-topbar-title',
241
- templateUrl: './matecu-topbar-title.component.html',
242
- styleUrls: ['./matecu-topbar-title.component.scss']
243
- }]
244
- }], ctorParameters: function () { return []; }, propDecorators: { className: [{
245
- type: HostBinding,
246
- args: ['class']
247
- }] } });
248
-
249
- class MatecuTopbarBodyComponent {
250
- constructor(elementRef) {
251
- this.elementRef = elementRef;
252
- this.className = 'matecu-topbar-body';
253
- }
254
- ngOnInit() { }
255
- scrollTop() {
256
- const element = this.elementRef.nativeElement;
257
- if (!!element) {
258
- element.scroll({
259
- top: 0,
260
- behavior: 'smooth',
261
- });
262
- }
263
- }
264
- }
265
- MatecuTopbarBodyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuTopbarBodyComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
266
- MatecuTopbarBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.4", type: MatecuTopbarBodyComponent, selector: "matecu-topbar-body", host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<ng-content></ng-content>", styles: [":host{display:block;padding:2rem 0 0;overflow-y:auto}@media screen and (max-width:770px){:host{padding-bottom:80px}}"] });
267
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuTopbarBodyComponent, decorators: [{
268
- type: Component,
269
- args: [{
270
- selector: 'matecu-topbar-body',
271
- templateUrl: './matecu-topbar-body.component.html',
272
- styleUrls: ['./matecu-topbar-body.component.scss'],
273
- }]
274
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { className: [{
275
- type: HostBinding,
276
- args: ['class']
277
- }] } });
278
-
279
- class MatecuTopbarFabComponent {
280
- constructor() {
281
- this.color = 'accent';
282
- this.extended = false;
283
- this.clickAction = new EventEmitter();
284
- this.className = 'matecu-topbar-fab';
285
- }
286
- ngOnInit() { }
287
- onClickAction() {
288
- this.clickAction.emit();
289
- }
290
- }
291
- MatecuTopbarFabComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuTopbarFabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
292
- MatecuTopbarFabComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.4", type: MatecuTopbarFabComponent, selector: "matecu-topbar-fab", inputs: { color: "color", extended: "extended" }, outputs: { clickAction: "clickAction" }, host: { properties: { "class": "this.className" } }, ngImport: i0, template: " <button type=\"button\" mat-fab [ngClass]=\"{'extended': extended}\" [color]=\"color\" (click)=\"onClickAction()\">\n <ng-content></ng-content>\n </button>\n", styles: [":host{display:flex;align-items:flex-end;height:100%;position:relative;z-index:2}:host button{transform:translateY(50%)}:host button.extended{border-radius:27px;height:55px;width:auto;padding:0 1rem!important}@media screen and (max-width:768px){:host{height:auto;position:fixed;bottom:1rem;right:1rem;transform:none}:host button{transform:translateY(0)}}"], components: [{ type: i1$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
293
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuTopbarFabComponent, decorators: [{
294
- type: Component,
295
- args: [{
296
- selector: 'matecu-topbar-fab',
297
- templateUrl: './matecu-topbar-fab.component.html',
298
- styleUrls: ['./matecu-topbar-fab.component.scss'],
299
- }]
300
- }], ctorParameters: function () { return []; }, propDecorators: { color: [{
301
- type: Input
302
- }], extended: [{
303
- type: Input
304
- }], clickAction: [{
305
- type: Output
306
- }], className: [{
307
- type: HostBinding,
308
- args: ['class']
309
- }] } });
310
-
311
- class MatecuTopbarSearchComponent {
312
- constructor() {
313
- this.showMobileInput = false;
314
- this.searchInput = new FormControl();
315
- this.showDescktopCleanBtn = false;
316
- this.destroy = new Subject();
317
- this.searchPlaceholder = 'Buscar';
318
- this.debounceTime = 500;
319
- this.inputType = 'text';
320
- this.cleanWhenClose = true;
321
- this.valueChange = new EventEmitter();
322
- this.whenSearchChanges = new EventEmitter();
323
- this.className = 'matecu-topbar-search';
324
- }
325
- set value(val) {
326
- if (typeof val === 'string') {
327
- this.searchInput.setValue(val);
328
- }
329
- else {
330
- this.searchInput.reset();
331
- }
332
- }
333
- ngOnInit() {
334
- this.watchSearch();
335
- }
336
- toogleSearch() {
337
- this.showMobileInput = !this.showMobileInput;
338
- }
339
- closeMobile() {
340
- if (this.cleanWhenClose) {
341
- this.searchInput.reset();
342
- }
343
- this.showMobileInput = false;
344
- }
345
- watchSearch() {
346
- this.searchInput.valueChanges
347
- .pipe(tap((value) => this.setShowDescktopCleanBtn(value)), debounceTime(this.debounceTime), distinctUntilChanged(), tap((value) => this.searchChanges(value)), takeUntil(this.destroy))
348
- .subscribe();
349
- }
350
- searchChanges(searchVal) {
351
- const value = typeof searchVal === 'string' && searchVal.length > 0 ? searchVal : '';
352
- this.whenSearchChanges.emit(value);
353
- this.valueChange.emit(value);
354
- }
355
- setShowDescktopCleanBtn(value) {
356
- this.showDescktopCleanBtn = typeof value === 'string' && value.length > 0;
357
- }
358
- }
359
- MatecuTopbarSearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuTopbarSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
360
- MatecuTopbarSearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.4", type: MatecuTopbarSearchComponent, selector: "matecu-topbar-search", inputs: { searchPlaceholder: "searchPlaceholder", debounceTime: "debounceTime", inputType: "inputType", cleanWhenClose: "cleanWhenClose", value: "value" }, outputs: { valueChange: "valueChange", whenSearchChanges: "whenSearchChanges" }, host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<button mat-icon-button class=\"only-mobile\" (click)=\"toogleSearch()\">\n <mat-icon>search</mat-icon>\n</button>\n\n<div class=\"matecu-topbar-search__input\" [ngClass]=\"{'mobile-input-active': showMobileInput}\">\n <mat-icon>search</mat-icon>\n <input [type]=\"inputType\" [formControl]=\"searchInput\" [placeholder]=\"searchPlaceholder\" />\n <button mat-icon-button (click)=\"closeMobile()\" [ngClass]=\"{'show-btn': showDescktopCleanBtn}\">\n <mat-icon>close</mat-icon>\n </button>\n\n</div>\n", styles: [":host{display:flex;align-items:center;position:relative;padding:7px;min-height:64px;box-sizing:border-box}:host .matecu-topbar-search__input{display:block;position:relative;z-index:2}:host .matecu-topbar-search__input input{border:#0000;border-radius:4px;padding:5px 20px 5px 40px;background-color:#ffffff4d;min-width:200px;width:200px;transition:all .3s ease-in-out;height:39px;color:currentColor}:host .matecu-topbar-search__input input:focus{min-width:290px}:host .matecu-topbar-search__input input::placeholder{color:currentColor}:host .matecu-topbar-search__input input[type=search]::-webkit-search-cancel-button,:host .matecu-topbar-search__input input[type=search]::-webkit-search-decoration,:host .matecu-topbar-search__input input[type=search]::-webkit-search-results-button,:host .matecu-topbar-search__input input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none}:host .matecu-topbar-search__input>mat-icon{position:absolute;left:12px;top:10px}:host .matecu-topbar-search__input button{position:absolute;right:0;top:0;transform:scale(0);transition:transform .3s ease-in-out}:host .matecu-topbar-search__input button mat-icon{font-size:1.2rem}:host .matecu-topbar-search__input button.show-btn{transform:scale(100%)}@media screen and (max-width:768px){:host .matecu-topbar-search__input{position:fixed;top:0;left:0;right:0;height:64px;color:#333;transform:translateY(-110%);transition:all .3s ease-in-out}:host .matecu-topbar-search__input input{width:100%;height:100%;background-color:#fff;border-radius:0;padding-right:30px}:host .matecu-topbar-search__input input:focus{min-width:100%}:host .matecu-topbar-search__input>mat-icon{top:20px}:host .matecu-topbar-search__input button{position:absolute;right:5px;top:10px;transform:scale(100%)}}:host .matecu-topbar-search__input.mobile-input-active{transform:translateY(0)}@media screen and (max-width:768px){:host .matecu-topbar-search__input.mobile-input-active{display:block}}:host .only-mobile{display:none}@media screen and (max-width:768px){:host .only-mobile{display:block}}"], components: [{ type: i1$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
361
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuTopbarSearchComponent, decorators: [{
362
- type: Component,
363
- args: [{
364
- selector: 'matecu-topbar-search',
365
- templateUrl: './matecu-topbar-search.component.html',
366
- styleUrls: ['./matecu-topbar-search.component.scss'],
367
- }]
368
- }], ctorParameters: function () { return []; }, propDecorators: { searchPlaceholder: [{
369
- type: Input
370
- }], debounceTime: [{
371
- type: Input
372
- }], inputType: [{
373
- type: Input
374
- }], cleanWhenClose: [{
375
- type: Input
376
- }], value: [{
377
- type: Input
378
- }], valueChange: [{
379
- type: Output
380
- }], whenSearchChanges: [{
381
- type: Output
382
- }], className: [{
383
- type: HostBinding,
384
- args: ['class']
385
- }] } });
386
-
387
- class MatecuTopbarActionsComponent {
388
- constructor() { }
389
- ngOnInit() { }
390
- }
391
- MatecuTopbarActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuTopbarActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
392
- MatecuTopbarActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.4", type: MatecuTopbarActionsComponent, selector: "matecu-topbar-actions", ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{display:flex;align-items:center;padding:7px;min-height:64px;box-sizing:border-box}"] });
393
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuTopbarActionsComponent, decorators: [{
394
- type: Component,
395
- args: [{
396
- selector: 'matecu-topbar-actions',
397
- templateUrl: './matecu-topbar-actions.component.html',
398
- styleUrls: ['./matecu-topbar-actions.component.scss'],
399
- }]
400
- }], ctorParameters: function () { return []; } });
401
-
402
- class MatecuTopbarLayoutModule {
403
- }
404
- MatecuTopbarLayoutModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuTopbarLayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
405
- MatecuTopbarLayoutModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuTopbarLayoutModule, declarations: [MatecuTopbarLayoutComponent,
406
- MatecuTopbarTitleComponent,
407
- MatecuTopbarBodyComponent,
408
- MatecuTopbarFabComponent,
409
- MatecuTopbarSearchComponent,
410
- MatecuTopbarActionsComponent], imports: [CommonModule,
411
- MatToolbarModule,
412
- MatIconModule,
413
- FormsModule,
414
- ReactiveFormsModule,
415
- MatButtonModule], exports: [MatecuTopbarLayoutComponent,
416
- MatecuTopbarTitleComponent,
417
- MatecuTopbarBodyComponent,
418
- MatecuTopbarFabComponent,
419
- MatecuTopbarSearchComponent,
420
- MatecuTopbarActionsComponent] });
421
- MatecuTopbarLayoutModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuTopbarLayoutModule, imports: [[
422
- CommonModule,
423
- MatToolbarModule,
424
- MatIconModule,
425
- FormsModule,
426
- ReactiveFormsModule,
427
- MatButtonModule,
428
- ]] });
429
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuTopbarLayoutModule, decorators: [{
430
- type: NgModule,
431
- args: [{
432
- declarations: [
433
- MatecuTopbarLayoutComponent,
434
- MatecuTopbarTitleComponent,
435
- MatecuTopbarBodyComponent,
436
- MatecuTopbarFabComponent,
437
- MatecuTopbarSearchComponent,
438
- MatecuTopbarActionsComponent,
439
- ],
440
- imports: [
441
- CommonModule,
442
- MatToolbarModule,
443
- MatIconModule,
444
- FormsModule,
445
- ReactiveFormsModule,
446
- MatButtonModule,
447
- ],
448
- exports: [
449
- MatecuTopbarLayoutComponent,
450
- MatecuTopbarTitleComponent,
451
- MatecuTopbarBodyComponent,
452
- MatecuTopbarFabComponent,
453
- MatecuTopbarSearchComponent,
454
- MatecuTopbarActionsComponent,
455
- ],
456
- }]
457
- }] });
458
-
459
- var MatecuAlertBoxType;
460
- (function (MatecuAlertBoxType) {
461
- MatecuAlertBoxType["warning"] = "warning";
462
- MatecuAlertBoxType["success"] = "success";
463
- MatecuAlertBoxType["danger"] = "danger";
464
- MatecuAlertBoxType["info"] = "info";
465
- })(MatecuAlertBoxType || (MatecuAlertBoxType = {}));
466
-
467
- class MatecuAlertBoxComponent {
468
- constructor() {
469
- this.classNameBase = 'matecu-alert-box';
470
- this.alertIcon = false;
471
- this.className = this.classNameBase;
472
- }
473
- get color() {
474
- return this.alertColor;
475
- }
476
- set color(value) {
477
- this.alertColor = value;
478
- if (!!value) {
479
- this.className = `${this.classNameBase} ${this.classNameBase}--${value}`;
480
- }
481
- else {
482
- this.className = this.classNameBase;
483
- }
484
- this.updateIcon();
485
- }
486
- get icon() {
487
- return this.alertIcon;
488
- }
489
- set icon(value) {
490
- this.alertIcon = value;
491
- }
492
- ngOnInit() { }
493
- updateIcon() {
494
- switch (this.color) {
495
- case MatecuAlertBoxType.danger:
496
- this.iconValue = 'dangerous';
497
- break;
498
- case MatecuAlertBoxType.warning:
499
- this.iconValue = 'warning';
500
- break;
501
- case MatecuAlertBoxType.success:
502
- this.iconValue = 'check_circle';
503
- break;
504
- case MatecuAlertBoxType.info:
505
- this.iconValue = 'info';
506
- break;
507
- default:
508
- this.iconValue = null;
509
- break;
510
- }
511
- }
512
- }
513
- MatecuAlertBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuAlertBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
514
- MatecuAlertBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.4", type: MatecuAlertBoxComponent, selector: "matecu-alert-box", inputs: { color: "color", icon: "icon" }, host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<ng-container *ngIf=\"icon && iconValue\">\n <div class=\"matecu-alert-box__icon\">\n <mat-icon>{{iconValue}}</mat-icon>\n </div>\n</ng-container>\n<div class=\"matecu-alert-box__content\">\n <ng-content>\n\n\n </ng-content>\n</div>\n", styles: [":host.matecu-alert-box{display:flex;padding:1rem;border-radius:.25rem;position:relative;border:1px solid #e0e0e0;box-sizing:border-box;margin:1rem 0}:host.matecu-alert-box--success{color:#0f5032;background-color:#d2e6dc;border-color:#badccd}:host.matecu-alert-box--danger{color:#821e28;background-color:#f8d7da;border-color:#f5c2c7}:host.matecu-alert-box--warning{color:#644d03;background-color:#fff3cd;border-color:#ffecb4}:host.matecu-alert-box--info{color:#055160;background-color:#cff4fc;border-color:#b6effb}:host.matecu-alert-box .matecu-alert-box__icon{display:flex;margin-right:1rem}:host.matecu-alert-box .matecu-alert-box__content{align-self:center}"], components: [{ type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
515
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuAlertBoxComponent, decorators: [{
516
- type: Component,
517
- args: [{
518
- selector: 'matecu-alert-box',
519
- templateUrl: './matecu-alert-box.component.html',
520
- styleUrls: ['./matecu-alert-box.component.scss'],
521
- }]
522
- }], ctorParameters: function () { return []; }, propDecorators: { color: [{
523
- type: Input
524
- }], icon: [{
525
- type: Input
526
- }], className: [{
527
- type: HostBinding,
528
- args: ['class']
529
- }] } });
530
-
531
- class MatecuAlertDialogComponent {
532
- constructor(dialogData, dialogRef) {
533
- this.dialogData = dialogData;
534
- this.dialogRef = dialogRef;
535
- this.hasTitle = false;
536
- this.hasDismissBtn = false;
537
- this.hasActionBtn = false;
538
- this.showActions = false;
539
- this.setHasTitle();
540
- this.setHasDismissBtn();
541
- this.setHasActionBtn();
542
- this.setShowActions();
543
- }
544
- ngOnInit() { }
545
- activateAction() {
546
- this.dialogRef.close(true);
547
- }
548
- setHasTitle() {
549
- this.hasTitle = this.isValidString(this.dialogData.title);
550
- }
551
- setHasDismissBtn() {
552
- this.hasDismissBtn = this.isValidString(this.dialogData.dismissText);
553
- }
554
- setHasActionBtn() {
555
- this.hasActionBtn = this.isValidString(this.dialogData.action);
556
- }
557
- setShowActions() {
558
- this.showActions = this.hasActionBtn || this.hasDismissBtn;
559
- }
560
- isValidString(str) {
561
- const isValid = typeof str === 'string' && str.trim().length > 0;
562
- return isValid;
563
- }
564
- }
565
- MatecuAlertDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuAlertDialogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1$2.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
566
- MatecuAlertDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.4", type: MatecuAlertDialogComponent, selector: "matecu-alert-dialog", ngImport: i0, template: "<h2 mat-dialog-title *ngIf=\"hasTitle\">{{dialogData.title}}</h2>\n<mat-dialog-content>\n\n <matecu-alert-box [color]=\"dialogData.type\" [icon]=\"!!dialogData.icon\">\n {{dialogData.message}}\n </matecu-alert-box>\n\n</mat-dialog-content>\n<mat-dialog-actions *ngIf=\"showActions\" align=\"end\">\n <button mat-button color=\"primary\" tabindex=\"-1\" mat-dialog-close\n *ngIf=\"hasDismissBtn\">{{dialogData.dismissText}}</button>\n <button mat-button color=\"primary\" tabindex=\"-2\" (click)=\"activateAction()\"\n *ngIf=\"hasActionBtn\">{{dialogData.action}}</button>\n</mat-dialog-actions>\n", styles: [":host matecu-alert-box{max-width:900px}"], components: [{ type: MatecuAlertBoxComponent, selector: "matecu-alert-box", inputs: ["color", "icon"] }, { type: i1$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i1$2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }] });
567
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuAlertDialogComponent, decorators: [{
568
- type: Component,
569
- args: [{
570
- selector: 'matecu-alert-dialog',
571
- templateUrl: './matecu-alert-dialog.component.html',
572
- styleUrls: ['./matecu-alert-dialog.component.scss'],
573
- }]
574
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
575
- type: Inject,
576
- args: [MAT_DIALOG_DATA]
577
- }] }, { type: i1$2.MatDialogRef }]; } });
578
-
579
- class MatecuAlertBoxModule {
580
- }
581
- MatecuAlertBoxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuAlertBoxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
582
- MatecuAlertBoxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuAlertBoxModule, declarations: [MatecuAlertBoxComponent, MatecuAlertDialogComponent], imports: [CommonModule, MatIconModule, MatDialogModule, MatButtonModule], exports: [MatecuAlertBoxComponent] });
583
- MatecuAlertBoxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuAlertBoxModule, imports: [[CommonModule, MatIconModule, MatDialogModule, MatButtonModule]] });
584
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0, type: MatecuAlertBoxModule, decorators: [{
585
- type: NgModule,
586
- args: [{
587
- declarations: [MatecuAlertBoxComponent, MatecuAlertDialogComponent],
588
- imports: [CommonModule, MatIconModule, MatDialogModule, MatButtonModule],
589
- exports: [MatecuAlertBoxComponent],
590
- entryComponents: [MatecuAlertDialogComponent],
591
- }]
592
- }] });
593
-
594
- /*
595
- * Public API Surface of angular-matecu
596
- */
597
-
598
- /**
599
- * Generated bundle index. Do not edit.
600
- */
601
-
602
- export { MatecuAlertBoxComponent, MatecuAlertBoxModule, MatecuAlertBoxType, MatecuAlertDialogComponent, MatecuSpinnerComponent, MatecuSpinnerModule, MatecuSpinnerService, MatecuTopbarActionsComponent, MatecuTopbarBodyComponent, MatecuTopbarFabComponent, MatecuTopbarLayoutComponent, MatecuTopbarLayoutModule, MatecuTopbarSearchComponent, MatecuTopbarTitleComponent };
603
- //# sourceMappingURL=angular-matecu.js.map