ecabs-components 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 (125) hide show
  1. package/README.md +24 -0
  2. package/esm2020/ecabs-components.mjs +5 -0
  3. package/esm2020/lib/base/directives/digits-only.directive.mjs +130 -0
  4. package/esm2020/lib/base/element-base.mjs +100 -0
  5. package/esm2020/lib/base/element-wrapper/element-wrapper.component.mjs +53 -0
  6. package/esm2020/lib/base/element-wrapper/element-wrapper.module.mjs +52 -0
  7. package/esm2020/lib/base/hint/hint.component.mjs +21 -0
  8. package/esm2020/lib/base/hint/hint.module.mjs +20 -0
  9. package/esm2020/lib/base/validation/validation.component.mjs +158 -0
  10. package/esm2020/lib/base/validation/validation.module.mjs +20 -0
  11. package/esm2020/lib/ecabs-buttons/ecabs-buttons.component.mjs +65 -0
  12. package/esm2020/lib/ecabs-buttons/ecabs-buttons.module.mjs +21 -0
  13. package/esm2020/lib/ecabs-input/ecabs-input.component.mjs +81 -0
  14. package/esm2020/lib/ecabs-input/ecabs-input.module.mjs +22 -0
  15. package/esm2020/lib/ecabs-loading/ecabs-loading.component.mjs +24 -0
  16. package/esm2020/lib/ecabs-loading/ecabs-loading.module.mjs +19 -0
  17. package/esm2020/lib/ecabs-loading/spinner/spinner.component.mjs +16 -0
  18. package/esm2020/public-api.mjs +8 -0
  19. package/fesm2015/ecabs-components.mjs +744 -0
  20. package/fesm2015/ecabs-components.mjs.map +1 -0
  21. package/fesm2020/ecabs-components.mjs +742 -0
  22. package/fesm2020/ecabs-components.mjs.map +1 -0
  23. package/index.d.ts +5 -0
  24. package/lib/base/directives/digits-only.directive.d.ts +26 -0
  25. package/lib/base/directives/digits-only.directive.ts +129 -0
  26. package/lib/base/element-base.d.ts +28 -0
  27. package/lib/base/element-base.ts +72 -0
  28. package/lib/base/element-wrapper/element-wrapper.component.d.ts +19 -0
  29. package/lib/base/element-wrapper/element-wrapper.component.html +30 -0
  30. package/lib/base/element-wrapper/element-wrapper.component.ts +33 -0
  31. package/lib/base/element-wrapper/element-wrapper.module.d.ts +16 -0
  32. package/lib/base/element-wrapper/element-wrapper.module.ts +30 -0
  33. package/lib/base/hint/hint.component.d.ts +8 -0
  34. package/lib/base/hint/hint.component.html +1 -0
  35. package/lib/base/hint/hint.component.scss +0 -0
  36. package/lib/base/hint/hint.component.ts +12 -0
  37. package/lib/base/hint/hint.module.d.ts +10 -0
  38. package/lib/base/hint/hint.module.ts +13 -0
  39. package/lib/base/validation/validation.component.d.ts +22 -0
  40. package/lib/base/validation/validation.component.html +8 -0
  41. package/lib/base/validation/validation.component.scss +0 -0
  42. package/lib/base/validation/validation.component.ts +171 -0
  43. package/lib/base/validation/validation.module.d.ts +10 -0
  44. package/lib/base/validation/validation.module.ts +12 -0
  45. package/lib/ecabs-buttons/ecabs-buttons.component.d.ts +21 -0
  46. package/lib/ecabs-buttons/ecabs-buttons.component.html +18 -0
  47. package/lib/ecabs-buttons/ecabs-buttons.component.ts +54 -0
  48. package/lib/ecabs-buttons/ecabs-buttons.module.d.ts +11 -0
  49. package/lib/ecabs-buttons/ecabs-buttons.module.ts +13 -0
  50. package/lib/ecabs-input/ecabs-input.component.d.ts +27 -0
  51. package/lib/ecabs-input/ecabs-input.component.html +26 -0
  52. package/lib/ecabs-input/ecabs-input.component.ts +83 -0
  53. package/lib/ecabs-input/ecabs-input.module.d.ts +12 -0
  54. package/lib/ecabs-input/ecabs-input.module.ts +14 -0
  55. package/lib/ecabs-loading/ecabs-loading.component.d.ts +8 -0
  56. package/lib/ecabs-loading/ecabs-loading.component.html +7 -0
  57. package/lib/ecabs-loading/ecabs-loading.component.spec.ts +24 -0
  58. package/lib/ecabs-loading/ecabs-loading.component.ts +11 -0
  59. package/lib/ecabs-loading/ecabs-loading.module.d.ts +9 -0
  60. package/lib/ecabs-loading/ecabs-loading.module.ts +11 -0
  61. package/lib/ecabs-loading/spinner/spinner.component.d.ts +6 -0
  62. package/lib/ecabs-loading/spinner/spinner.component.html +5 -0
  63. package/lib/ecabs-loading/spinner/spinner.component.scss +61 -0
  64. package/lib/ecabs-loading/spinner/spinner.component.spec.ts +24 -0
  65. package/lib/ecabs-loading/spinner/spinner.component.ts +11 -0
  66. package/package.json +33 -0
  67. package/public-api.d.ts +7 -0
  68. package/public-api.ts +7 -0
  69. package/styles/material/_theme.scss +99 -0
  70. package/styles/material/overrides/_autocomplete.scss +11 -0
  71. package/styles/material/overrides/_button.scss +81 -0
  72. package/styles/material/overrides/_card.scss +17 -0
  73. package/styles/material/overrides/_chip.scss +108 -0
  74. package/styles/material/overrides/_datepicker.scss +145 -0
  75. package/styles/material/overrides/_dialog.scss +8 -0
  76. package/styles/material/overrides/_divider.scss +3 -0
  77. package/styles/material/overrides/_expansion.scss +31 -0
  78. package/styles/material/overrides/_form.scss +47 -0
  79. package/styles/material/overrides/_icon.scss +3 -0
  80. package/styles/material/overrides/_menu.scss +3 -0
  81. package/styles/material/overrides/_paginator.scss +0 -0
  82. package/styles/material/overrides/_phone.scss +24 -0
  83. package/styles/material/overrides/_select.scss +36 -0
  84. package/styles/material/overrides/_tab.scss +23 -0
  85. package/styles/material/overrides/_table.scss +12 -0
  86. package/styles/material/overrides/_toaster.scss +38 -0
  87. package/styles/material/overrides/_toggle.scss +10 -0
  88. package/styles/material/overrides/_tooltip.scss +3 -0
  89. package/styles/material/overrides/index.scss +19 -0
  90. package/styles/scss/base/_heading.scss +17 -0
  91. package/styles/scss/base/_normalize.scss +78 -0
  92. package/styles/scss/base/index.scss +2 -0
  93. package/styles/scss/modules/_autocomplete.scss +29 -0
  94. package/styles/scss/modules/_button.scss +221 -0
  95. package/styles/scss/modules/_card.scss +23 -0
  96. package/styles/scss/modules/_chip.scss +56 -0
  97. package/styles/scss/modules/_datepicker.scss +422 -0
  98. package/styles/scss/modules/_dialog.scss +14 -0
  99. package/styles/scss/modules/_divider.scss +3 -0
  100. package/styles/scss/modules/_form.scss +221 -0
  101. package/styles/scss/modules/_icon.scss +30 -0
  102. package/styles/scss/modules/_img.scss +32 -0
  103. package/styles/scss/modules/_legend.scss +64 -0
  104. package/styles/scss/modules/_list.scss +17 -0
  105. package/styles/scss/modules/_map.scss +112 -0
  106. package/styles/scss/modules/_percentage.scss +33 -0
  107. package/styles/scss/modules/_phone.scss +21 -0
  108. package/styles/scss/modules/_select.scss +21 -0
  109. package/styles/scss/modules/_statuses.scss +31 -0
  110. package/styles/scss/modules/_tab.scss +16 -0
  111. package/styles/scss/modules/_table.scss +107 -0
  112. package/styles/scss/modules/_timepicker.scss +96 -0
  113. package/styles/scss/modules/_toaster.scss +53 -0
  114. package/styles/scss/modules/_tooltip.scss +7 -0
  115. package/styles/scss/modules/drag-drop.scss +31 -0
  116. package/styles/scss/modules/index.scss +23 -0
  117. package/styles/scss/utilities/_colors.scss +52 -0
  118. package/styles/scss/utilities/_fonts.scss +26 -0
  119. package/styles/scss/utilities/_functions.scss +27 -0
  120. package/styles/scss/utilities/_helpers.scss +5 -0
  121. package/styles/scss/utilities/_mixins.scss +65 -0
  122. package/styles/scss/utilities/_variables.scss +19 -0
  123. package/styles/scss/utilities/index.scss +6 -0
  124. package/styles/styles.scss +5 -0
  125. package/test.ts +27 -0
@@ -0,0 +1,744 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, Input, HostBinding, NgModule, EventEmitter, Output, Directive, HostListener } from '@angular/core';
3
+ import * as i1 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import * as i2 from '@angular/material/button';
6
+ import { MatButtonModule } from '@angular/material/button';
7
+ import * as i4 from '@angular/material/icon';
8
+ import { MatIconModule } from '@angular/material/icon';
9
+ import * as i3 from '@angular/forms';
10
+ import { NgControl, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
11
+ import * as i5 from '@angular/material/tooltip';
12
+ import { MatTooltipModule } from '@angular/material/tooltip';
13
+ import { MatInputModule } from '@angular/material/input';
14
+ import { MatFormFieldModule } from '@angular/material/form-field';
15
+
16
+ class EcabsSpinnerComponent {
17
+ constructor() {
18
+ this.size = 'medium';
19
+ }
20
+ }
21
+ EcabsSpinnerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsSpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
22
+ EcabsSpinnerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: EcabsSpinnerComponent, selector: "ecabs-loading-spinner", inputs: { size: "size" }, ngImport: i0, template: "<div class=\"loadingio-spinner-rolling {{ size }}\">\r\n <div class=\"ldio-inner\">\r\n <div></div>\r\n </div>\r\n</div>\r\n", styles: [":host{line-height:0}@keyframes ldio-inner{0%{transform:translate(-50%,-50%) rotate(0)}to{transform:translate(-50%,-50%) rotate(360deg)}}.loadingio-spinner-rolling{width:27px;height:27px;display:inline-block;overflow:hidden;background:none}.loadingio-spinner-rolling .ldio-inner{width:100%;height:100%;position:relative;transform:translateZ(0) scale(1);-webkit-backface-visibility:hidden;backface-visibility:hidden;transform-origin:0 0}.loadingio-spinner-rolling .ldio-inner div{position:absolute;width:9px;height:9px;border:4px solid #85a2b6;border-top-color:transparent;border-radius:50%;animation:ldio-inner 1s linear infinite;top:14px;left:14px;box-sizing:content-box}.loadingio-spinner-rolling.medium{width:40px;height:40px}.loadingio-spinner-rolling.medium .ldio-inner div{width:20px;height:20px;border-width:6px;top:19px;left:19px}.loadingio-spinner-rolling.large{width:60px;height:60px}.loadingio-spinner-rolling.large .ldio-inner div{width:35px;height:35px;border-width:9px;top:29px;left:29px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
23
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsSpinnerComponent, decorators: [{
24
+ type: Component,
25
+ args: [{ selector: 'ecabs-loading-spinner', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"loadingio-spinner-rolling {{ size }}\">\r\n <div class=\"ldio-inner\">\r\n <div></div>\r\n </div>\r\n</div>\r\n", styles: [":host{line-height:0}@keyframes ldio-inner{0%{transform:translate(-50%,-50%) rotate(0)}to{transform:translate(-50%,-50%) rotate(360deg)}}.loadingio-spinner-rolling{width:27px;height:27px;display:inline-block;overflow:hidden;background:none}.loadingio-spinner-rolling .ldio-inner{width:100%;height:100%;position:relative;transform:translateZ(0) scale(1);-webkit-backface-visibility:hidden;backface-visibility:hidden;transform-origin:0 0}.loadingio-spinner-rolling .ldio-inner div{position:absolute;width:9px;height:9px;border:4px solid #85a2b6;border-top-color:transparent;border-radius:50%;animation:ldio-inner 1s linear infinite;top:14px;left:14px;box-sizing:content-box}.loadingio-spinner-rolling.medium{width:40px;height:40px}.loadingio-spinner-rolling.medium .ldio-inner div{width:20px;height:20px;border-width:6px;top:19px;left:19px}.loadingio-spinner-rolling.large{width:60px;height:60px}.loadingio-spinner-rolling.large .ldio-inner div{width:35px;height:35px;border-width:9px;top:29px;left:29px}\n"] }]
26
+ }], propDecorators: { size: [{
27
+ type: Input
28
+ }] } });
29
+
30
+ class ButtonsComponent {
31
+ constructor() {
32
+ this.size = 'default';
33
+ this.type = 'button';
34
+ this.raised = false;
35
+ this.stroked = false;
36
+ this.full = false;
37
+ this.color = 'primary';
38
+ this.borderWidth = '';
39
+ this.classAttr = '';
40
+ }
41
+ ngOnInit() {
42
+ if (this.full) {
43
+ this.borderWidth = '100%';
44
+ }
45
+ }
46
+ ngOnChanges(changes) {
47
+ var _a, _b;
48
+ const disabled = ((_a = changes['disabled']) === null || _a === void 0 ? void 0 : _a.currentValue) !== undefined ? changes['disabled'].currentValue : this.disabled;
49
+ const loading = ((_b = changes['loading']) === null || _b === void 0 ? void 0 : _b.currentValue) !== undefined ? changes['loading'].currentValue : this.loading;
50
+ if (disabled || loading) {
51
+ this.classAttr = 'pointer-events-none';
52
+ }
53
+ else {
54
+ this.classAttr = '';
55
+ }
56
+ }
57
+ }
58
+ ButtonsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ButtonsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
59
+ ButtonsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ButtonsComponent, selector: "ecabs-buttons", inputs: { label: "label", disabled: "disabled", loading: "loading", form: "form", size: "size", type: "type", raised: "raised", stroked: "stroked", full: "full", color: "color" }, host: { properties: { "style.width": "this.borderWidth", "class": "this.classAttr" } }, usesOnChanges: true, ngImport: i0, template: "<button\r\n mat-button\r\n [ngClass]=\"{\r\n '!w-full': full,\r\n 'mat-stroked-button': stroked,\r\n 'mat-raised-button': raised\r\n }\"\r\n [color]=\"color\"\r\n [disabled]=\"disabled\"\r\n [type]=\"type\"\r\n [attr.form]=\"form\"\r\n>\r\n <ecabs-loading-spinner size=\"tiny\" *ngIf=\"loading\"></ecabs-loading-spinner>\r\n <ng-container *ngIf=\"!loading\">\r\n <ng-content select=\"mat-icon\"></ng-content>\r\n <ng-content></ng-content>\r\n </ng-container>\r\n</button>\r\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.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"] }, { kind: "component", type: EcabsSpinnerComponent, selector: "ecabs-loading-spinner", inputs: ["size"] }] });
60
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ButtonsComponent, decorators: [{
61
+ type: Component,
62
+ args: [{ selector: 'ecabs-buttons', template: "<button\r\n mat-button\r\n [ngClass]=\"{\r\n '!w-full': full,\r\n 'mat-stroked-button': stroked,\r\n 'mat-raised-button': raised\r\n }\"\r\n [color]=\"color\"\r\n [disabled]=\"disabled\"\r\n [type]=\"type\"\r\n [attr.form]=\"form\"\r\n>\r\n <ecabs-loading-spinner size=\"tiny\" *ngIf=\"loading\"></ecabs-loading-spinner>\r\n <ng-container *ngIf=\"!loading\">\r\n <ng-content select=\"mat-icon\"></ng-content>\r\n <ng-content></ng-content>\r\n </ng-container>\r\n</button>\r\n" }]
63
+ }], propDecorators: { label: [{
64
+ type: Input
65
+ }], disabled: [{
66
+ type: Input
67
+ }], loading: [{
68
+ type: Input
69
+ }], form: [{
70
+ type: Input
71
+ }], size: [{
72
+ type: Input
73
+ }], type: [{
74
+ type: Input
75
+ }], raised: [{
76
+ type: Input
77
+ }], stroked: [{
78
+ type: Input
79
+ }], full: [{
80
+ type: Input
81
+ }], color: [{
82
+ type: Input
83
+ }], borderWidth: [{
84
+ type: HostBinding,
85
+ args: ['style.width']
86
+ }], classAttr: [{
87
+ type: HostBinding,
88
+ args: ['class']
89
+ }] } });
90
+
91
+ class EcabsLoadingComponent {
92
+ constructor() {
93
+ this.loading = false;
94
+ this.backgroundColor = 'white';
95
+ this.size = 'medium';
96
+ }
97
+ }
98
+ EcabsLoadingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsLoadingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
99
+ EcabsLoadingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: EcabsLoadingComponent, selector: "ecabs-ecabs-loading", inputs: { loading: "loading", backgroundColor: "backgroundColor", size: "size" }, ngImport: i0, template: "<div\r\n class=\"flex absolute left-0 top-0 right-0 bottom-0 z-50 items-center justify-center\"\r\n [ngStyle]=\"{ backgroundColor: backgroundColor }\"\r\n *ngIf=\"loading\"\r\n>\r\n <ecabs-loading-spinner [size]=\"size\" *ngIf=\"loading\"></ecabs-loading-spinner>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: EcabsSpinnerComponent, selector: "ecabs-loading-spinner", inputs: ["size"] }] });
100
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsLoadingComponent, decorators: [{
101
+ type: Component,
102
+ args: [{ selector: 'ecabs-ecabs-loading', template: "<div\r\n class=\"flex absolute left-0 top-0 right-0 bottom-0 z-50 items-center justify-center\"\r\n [ngStyle]=\"{ backgroundColor: backgroundColor }\"\r\n *ngIf=\"loading\"\r\n>\r\n <ecabs-loading-spinner [size]=\"size\" *ngIf=\"loading\"></ecabs-loading-spinner>\r\n</div>\r\n" }]
103
+ }], propDecorators: { loading: [{
104
+ type: Input
105
+ }], backgroundColor: [{
106
+ type: Input
107
+ }], size: [{
108
+ type: Input
109
+ }] } });
110
+
111
+ class EcabsLoadingModule {
112
+ }
113
+ EcabsLoadingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsLoadingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
114
+ EcabsLoadingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: EcabsLoadingModule, declarations: [EcabsLoadingComponent, EcabsSpinnerComponent], imports: [CommonModule], exports: [EcabsLoadingComponent, EcabsSpinnerComponent] });
115
+ EcabsLoadingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsLoadingModule, imports: [CommonModule] });
116
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsLoadingModule, decorators: [{
117
+ type: NgModule,
118
+ args: [{
119
+ declarations: [EcabsLoadingComponent, EcabsSpinnerComponent],
120
+ imports: [CommonModule],
121
+ exports: [EcabsLoadingComponent, EcabsSpinnerComponent],
122
+ }]
123
+ }] });
124
+
125
+ class EcabsButtonsModule {
126
+ }
127
+ EcabsButtonsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsButtonsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
128
+ EcabsButtonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: EcabsButtonsModule, declarations: [ButtonsComponent], imports: [CommonModule, MatButtonModule, EcabsLoadingModule, MatIconModule], exports: [ButtonsComponent] });
129
+ EcabsButtonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsButtonsModule, imports: [CommonModule, MatButtonModule, EcabsLoadingModule, MatIconModule] });
130
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsButtonsModule, decorators: [{
131
+ type: NgModule,
132
+ args: [{
133
+ declarations: [ButtonsComponent],
134
+ imports: [CommonModule, MatButtonModule, EcabsLoadingModule, MatIconModule],
135
+ exports: [ButtonsComponent],
136
+ }]
137
+ }] });
138
+
139
+ class ElementBaseComponent {
140
+ constructor() {
141
+ this.placeholder = '';
142
+ this.disabled = false;
143
+ this.showValidation = true;
144
+ this.showValidationOnNotTouched = false;
145
+ this.hideValidationMessage = false;
146
+ this.iconClass = '';
147
+ this.loading = false;
148
+ this.showHint = false;
149
+ this.showAsterisk = true;
150
+ this.focused = new EventEmitter();
151
+ this.focusOuted = new EventEmitter();
152
+ this.required = false;
153
+ this.isRequired = (ctrl) => {
154
+ if (ctrl === null || ctrl === void 0 ? void 0 : ctrl.validator) {
155
+ const validator = ctrl.validator({});
156
+ if (validator && validator['required']) {
157
+ return true;
158
+ }
159
+ }
160
+ if (ctrl === null || ctrl === void 0 ? void 0 : ctrl['controls']) {
161
+ for (const name in ctrl['controls']) {
162
+ if (ctrl['controls'][name]) {
163
+ if (this.isRequired(ctrl['controls'][name])) {
164
+ return true;
165
+ }
166
+ }
167
+ }
168
+ }
169
+ return false;
170
+ };
171
+ }
172
+ getData() {
173
+ return {
174
+ type: this.type || 'text',
175
+ label: this.label,
176
+ placeholder: this.placeholder,
177
+ validationLabel: this.validationLabel,
178
+ disabled: this.disabled,
179
+ showValidation: this.showValidation,
180
+ showValidationOnNotTouched: this.showValidationOnNotTouched,
181
+ hideValidationMessage: this.hideValidationMessage,
182
+ iconClass: this.iconClass,
183
+ control: this.control,
184
+ loading: this.loading,
185
+ showHint: this.showHint,
186
+ maxLength: this.maxLength,
187
+ tooltip: this.tooltip,
188
+ name: this.name,
189
+ required: this.isRequired(this.control),
190
+ showAsterisk: this.showAsterisk,
191
+ };
192
+ }
193
+ }
194
+ ElementBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ElementBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
195
+ ElementBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ElementBaseComponent, selector: "ng-component", inputs: { type: "type", name: "name", label: "label", placeholder: "placeholder", validationLabel: "validationLabel", disabled: "disabled", showValidation: "showValidation", showValidationOnNotTouched: "showValidationOnNotTouched", hideValidationMessage: "hideValidationMessage", iconClass: "iconClass", loading: "loading", showHint: "showHint", maxLength: "maxLength", tooltip: "tooltip", showAsterisk: "showAsterisk" }, outputs: { focused: "focused", focusOuted: "focusOuted" }, ngImport: i0, template: '', isInline: true });
196
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ElementBaseComponent, decorators: [{
197
+ type: Component,
198
+ args: [{
199
+ template: '',
200
+ }]
201
+ }], propDecorators: { type: [{
202
+ type: Input
203
+ }], name: [{
204
+ type: Input
205
+ }], label: [{
206
+ type: Input
207
+ }], placeholder: [{
208
+ type: Input
209
+ }], validationLabel: [{
210
+ type: Input
211
+ }], disabled: [{
212
+ type: Input
213
+ }], showValidation: [{
214
+ type: Input
215
+ }], showValidationOnNotTouched: [{
216
+ type: Input
217
+ }], hideValidationMessage: [{
218
+ type: Input
219
+ }], iconClass: [{
220
+ type: Input
221
+ }], loading: [{
222
+ type: Input
223
+ }], showHint: [{
224
+ type: Input
225
+ }], maxLength: [{
226
+ type: Input
227
+ }], tooltip: [{
228
+ type: Input
229
+ }], showAsterisk: [{
230
+ type: Input
231
+ }], focused: [{
232
+ type: Output
233
+ }], focusOuted: [{
234
+ type: Output
235
+ }] } });
236
+
237
+ class ValidationComponent {
238
+ constructor() {
239
+ this.showValidationOnNotTouched = false;
240
+ this.errorMessages = [];
241
+ this._messages = {};
242
+ // this.errorMessages = [
243
+ // {
244
+ // type: 'required',
245
+ // message: this.translateService.instant(
246
+ // 'FORMS.VALIDATION.LABEL_REQUIRED'
247
+ // ),
248
+ // },
249
+ // {
250
+ // type: 'minlength',
251
+ // message: this.translateService.instant('FORMS.VALIDATION.MIN_LENGTH'),
252
+ // },
253
+ // {
254
+ // type: 'maxlength',
255
+ // message: this.translateService.instant('FORMS.VALIDATION.MAX_LENGTH'),
256
+ // },
257
+ // {
258
+ // type: 'min',
259
+ // message: this.translateService.instant('FORMS.VALIDATION.MIN'),
260
+ // },
261
+ // {
262
+ // type: 'max',
263
+ // message: this.translateService.instant('FORMS.VALIDATION.MAX'),
264
+ // },
265
+ // {
266
+ // type: 'minValue',
267
+ // message: this.translateService.instant('FORMS.VALIDATION.MIN_VALUE'),
268
+ // },
269
+ // {
270
+ // type: 'maxValue',
271
+ // message: this.translateService.instant('FORMS.VALIDATION.MAX_VALUE'),
272
+ // },
273
+ // {
274
+ // type: 'validatePhoneNumber',
275
+ // message: this.translateService.instant(
276
+ // 'FORMS.VALIDATION.VALIDATE_PHONE_NUMBER'
277
+ // ),
278
+ // },
279
+ // {
280
+ // type: 'pastDate',
281
+ // message: this.translateService.instant('FORMS.VALIDATION.PAST_DATE'),
282
+ // },
283
+ // {
284
+ // type: 'affectsError',
285
+ // message: this.translateService.instant(
286
+ // 'FORMS.VALIDATION.AFFECTS_ERROR'
287
+ // ),
288
+ // },
289
+ // {
290
+ // type: 'moreThan',
291
+ // message: this.translateService.instant('FORMS.VALIDATION.MORE_THAN'),
292
+ // },
293
+ // {
294
+ // type: 'lessThan',
295
+ // message: this.translateService.instant('FORMS.VALIDATION.LESS_THAN'),
296
+ // },
297
+ // {
298
+ // type: 'iban',
299
+ // message: this.translateService.instant('FORMS.VALIDATION.INVALID'),
300
+ // },
301
+ // {
302
+ // type: 'email',
303
+ // message: this.translateService.instant('FORMS.VALIDATION.EMAIL'),
304
+ // },
305
+ // {
306
+ // type: 'numberMoreThan',
307
+ // message: this.translateService.instant(
308
+ // 'FORMS.VALIDATION.VALUE_MORE_THAN'
309
+ // ),
310
+ // },
311
+ // {
312
+ // type: 'numberLessThan',
313
+ // message: this.translateService.instant(
314
+ // 'FORMS.VALIDATION.VALUE_LESS_THAN'
315
+ // ),
316
+ // },
317
+ // {
318
+ // type: 'outOfRange',
319
+ // message: this.translateService.instant('FORMS.VALIDATION.OUT_OF_RANGE'),
320
+ // },
321
+ // {
322
+ // type: 'iban',
323
+ // message: this.translateService.instant('FORMS.VALIDATION.IBAN'),
324
+ // },
325
+ // {
326
+ // type: 'timeIsAfter',
327
+ // message: this.translateService.instant(
328
+ // 'FORMS.VALIDATION.LESS_THAN_TIME'
329
+ // ),
330
+ // },
331
+ // ];
332
+ }
333
+ get messages() {
334
+ if (this.element) {
335
+ for (const errorKey in this.element.errors) {
336
+ for (const key in this.element.errors[errorKey]) {
337
+ if (this._messages[errorKey]) {
338
+ this._messages[errorKey] = this._messages[errorKey].replace(`[${key}]`, this.element.errors[errorKey][key]);
339
+ }
340
+ }
341
+ }
342
+ }
343
+ return this._messages;
344
+ }
345
+ set messages(m) {
346
+ this._messages = m;
347
+ }
348
+ ngOnChanges(changes) {
349
+ const { updatedErrors } = changes;
350
+ if (updatedErrors &&
351
+ updatedErrors.currentValue &&
352
+ updatedErrors.currentValue.length > 0) {
353
+ for (const error of updatedErrors.currentValue) {
354
+ this.messages[error.type] = error.message;
355
+ }
356
+ }
357
+ }
358
+ ngOnInit() {
359
+ for (const error of this.errorMessages) {
360
+ this.messages[error.type] = this.replaceTokens(error.message);
361
+ }
362
+ }
363
+ replaceTokens(message) {
364
+ let retMessage;
365
+ if (this.label) {
366
+ retMessage = message.replace('[label]', this.label);
367
+ }
368
+ else {
369
+ retMessage = message;
370
+ }
371
+ return retMessage;
372
+ }
373
+ getMessageDetail(key) {
374
+ return this.messages[key];
375
+ }
376
+ }
377
+ ValidationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ValidationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
378
+ ValidationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ValidationComponent, selector: "app-validations-messages", inputs: { element: "element", label: "label", showValidationOnNotTouched: "showValidationOnNotTouched", updatedErrors: "updatedErrors" }, usesOnChanges: true, ngImport: i0, template: "<div\r\n class=\"form-field__validation\"\r\n *ngIf=\"element && (element?.touched || showValidationOnNotTouched) && element?.invalid\"\r\n>\r\n <div class=\"form-field__validation__item\" *ngFor=\"let item of element?.errors | keyvalue\">\r\n {{ getMessageDetail(item.key) }}\r\n </div>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.KeyValuePipe, name: "keyvalue" }] });
379
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ValidationComponent, decorators: [{
380
+ type: Component,
381
+ args: [{ selector: 'app-validations-messages', template: "<div\r\n class=\"form-field__validation\"\r\n *ngIf=\"element && (element?.touched || showValidationOnNotTouched) && element?.invalid\"\r\n>\r\n <div class=\"form-field__validation__item\" *ngFor=\"let item of element?.errors | keyvalue\">\r\n {{ getMessageDetail(item.key) }}\r\n </div>\r\n</div>\r\n" }]
382
+ }], ctorParameters: function () { return []; }, propDecorators: { element: [{
383
+ type: Input
384
+ }], label: [{
385
+ type: Input
386
+ }], showValidationOnNotTouched: [{
387
+ type: Input
388
+ }], updatedErrors: [{
389
+ type: Input
390
+ }] } });
391
+
392
+ class HintComponent {
393
+ constructor() {
394
+ this.showHint = false;
395
+ }
396
+ }
397
+ HintComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: HintComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
398
+ HintComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: HintComponent, selector: "app-hint", inputs: { element: "element", maxValue: "maxValue", showHint: "showHint" }, ngImport: i0, template: "<div class=\"hint\" *ngIf=\"element && showHint\">{{ element?.value?.length || 0 }}/{{ this.maxValue }}</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
399
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: HintComponent, decorators: [{
400
+ type: Component,
401
+ args: [{ selector: 'app-hint', template: "<div class=\"hint\" *ngIf=\"element && showHint\">{{ element?.value?.length || 0 }}/{{ this.maxValue }}</div>\r\n" }]
402
+ }], propDecorators: { element: [{
403
+ type: Input
404
+ }], maxValue: [{
405
+ type: Input
406
+ }], showHint: [{
407
+ type: Input
408
+ }] } });
409
+
410
+ class ElementWrapperComponent {
411
+ constructor() {
412
+ this.showHidePassword = new EventEmitter();
413
+ this.clear = new EventEmitter();
414
+ this.increase = new EventEmitter();
415
+ this.decrease = new EventEmitter();
416
+ }
417
+ showHidePasswordFn(event) {
418
+ this.showHidePassword.emit(event);
419
+ }
420
+ clearFn() {
421
+ this.clear.emit();
422
+ }
423
+ increaseFn() {
424
+ this.increase.emit();
425
+ }
426
+ decreaseFn() {
427
+ this.decrease.emit();
428
+ }
429
+ }
430
+ ElementWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ElementWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
431
+ ElementWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ElementWrapperComponent, selector: "app-element-wrapper", inputs: { data: "data", showCloseIcon: "showCloseIcon", focusedFlag: "focusedFlag", showPassword: "showPassword", control: "control" }, outputs: { showHidePassword: "showHidePassword", clear: "clear", increase: "increase", decrease: "decrease" }, ngImport: i0, template: "<div\r\n class=\"form-field\"\r\n [ngClass]=\"{\r\n 'form-field--invalid':\r\n data?.showValidation && (data?.control?.touched || data?.showValidationOnNotTouched) && data?.control?.invalid,\r\n disabled: data?.disabled,\r\n 'form-field--required': data?.required && data?.showAsterisk\r\n }\"\r\n>\r\n <div>\r\n <label class=\"form-field__label\" [attr.for]=\"data?.name\" *ngIf=\"data?.label\">\r\n <span [innerHTML]=\"data?.label\"></span>\r\n <mat-icon class=\"icon\" *ngIf=\"data?.tooltip\" [matTooltip]=\"data?.tooltip\">error_outline</mat-icon>\r\n </label>\r\n </div>\r\n\r\n <ng-content></ng-content>\r\n\r\n <ecabs-loading-spinner class=\"spinner\" size=\"tiny\" *ngIf=\"data.loading\"></ecabs-loading-spinner>\r\n\r\n <app-hint [element]=\"data?.control\" [showHint]=\"data?.showHint\" [maxValue]=\"data?.maxLength\"></app-hint>\r\n\r\n <app-validations-messages\r\n *ngIf=\"data?.showValidation && !data?.hideValidationMessage\"\r\n [element]=\"data?.control\"\r\n [label]=\"data?.label ? data?.label : data?.placeholder ? data.placeholder : data?.validationLabel\"\r\n [showValidationOnNotTouched]=\"data?.showValidationOnNotTouched\"\r\n >\r\n </app-validations-messages>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: EcabsSpinnerComponent, selector: "ecabs-loading-spinner", inputs: ["size"] }, { kind: "component", type: ValidationComponent, selector: "app-validations-messages", inputs: ["element", "label", "showValidationOnNotTouched", "updatedErrors"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: HintComponent, selector: "app-hint", inputs: ["element", "maxValue", "showHint"] }] });
432
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ElementWrapperComponent, decorators: [{
433
+ type: Component,
434
+ args: [{ selector: 'app-element-wrapper', template: "<div\r\n class=\"form-field\"\r\n [ngClass]=\"{\r\n 'form-field--invalid':\r\n data?.showValidation && (data?.control?.touched || data?.showValidationOnNotTouched) && data?.control?.invalid,\r\n disabled: data?.disabled,\r\n 'form-field--required': data?.required && data?.showAsterisk\r\n }\"\r\n>\r\n <div>\r\n <label class=\"form-field__label\" [attr.for]=\"data?.name\" *ngIf=\"data?.label\">\r\n <span [innerHTML]=\"data?.label\"></span>\r\n <mat-icon class=\"icon\" *ngIf=\"data?.tooltip\" [matTooltip]=\"data?.tooltip\">error_outline</mat-icon>\r\n </label>\r\n </div>\r\n\r\n <ng-content></ng-content>\r\n\r\n <ecabs-loading-spinner class=\"spinner\" size=\"tiny\" *ngIf=\"data.loading\"></ecabs-loading-spinner>\r\n\r\n <app-hint [element]=\"data?.control\" [showHint]=\"data?.showHint\" [maxValue]=\"data?.maxLength\"></app-hint>\r\n\r\n <app-validations-messages\r\n *ngIf=\"data?.showValidation && !data?.hideValidationMessage\"\r\n [element]=\"data?.control\"\r\n [label]=\"data?.label ? data?.label : data?.placeholder ? data.placeholder : data?.validationLabel\"\r\n [showValidationOnNotTouched]=\"data?.showValidationOnNotTouched\"\r\n >\r\n </app-validations-messages>\r\n</div>\r\n" }]
435
+ }], propDecorators: { data: [{
436
+ type: Input
437
+ }], showCloseIcon: [{
438
+ type: Input
439
+ }], focusedFlag: [{
440
+ type: Input
441
+ }], showPassword: [{
442
+ type: Input
443
+ }], control: [{
444
+ type: Input
445
+ }], showHidePassword: [{
446
+ type: Output
447
+ }], clear: [{
448
+ type: Output
449
+ }], increase: [{
450
+ type: Output
451
+ }], decrease: [{
452
+ type: Output
453
+ }] } });
454
+
455
+ class DigitsOnlyDirective {
456
+ constructor(el) {
457
+ this.el = el;
458
+ this.digitsOnly = false;
459
+ this.allowHyphen = false;
460
+ this.decimal = false;
461
+ this.decimalSeparator = '.';
462
+ this.unit = 0;
463
+ this.minus = '-';
464
+ this.minusCounter = 0;
465
+ this.decimalCounter = 0;
466
+ this.navigationKeys = [
467
+ 'Backspace',
468
+ 'Delete',
469
+ 'Tab',
470
+ 'Escape',
471
+ 'Enter',
472
+ 'Home',
473
+ 'End',
474
+ 'ArrowLeft',
475
+ 'ArrowRight',
476
+ 'Clear',
477
+ 'Copy',
478
+ 'Paste',
479
+ ];
480
+ this.inputElement = el.nativeElement;
481
+ }
482
+ onKeyDown(e) {
483
+ if (this.digitsOnly) {
484
+ if (this.navigationKeys.indexOf(e.key) > -1 || // Allow: navigation keys: backspace, delete, arrows etc.
485
+ (e.key === 'a' && e.ctrlKey) || // Allow: Ctrl+A
486
+ (e.key === 'c' && e.ctrlKey) || // Allow: Ctrl+C
487
+ (e.key === 'v' && e.ctrlKey) || // Allow: Ctrl+V
488
+ (e.key === 'x' && e.ctrlKey) || // Allow: Ctrl+X
489
+ (e.key === 'a' && e.metaKey) || // Allow: Cmd+A (Mac)
490
+ (e.key === 'c' && e.metaKey) || // Allow: Cmd+C (Mac)
491
+ (e.key === 'v' && e.metaKey) || // Allow: Cmd+V (Mac)
492
+ (e.key === 'x' && e.metaKey) || // Allow: Cmd+X (Mac)
493
+ (this.decimal && e.key === this.decimalSeparator && this.decimalCounter < 1) || // Allow: only one decimal point
494
+ (this.decimal && e.key === this.minus && this.minusCounter < 1) // Allow: only one minus
495
+ ) {
496
+ return;
497
+ }
498
+ // Ensure that it is a number and stop the keypress
499
+ if (e.key === ' ' || !this.regex.test(e.key)) {
500
+ e.preventDefault();
501
+ }
502
+ }
503
+ }
504
+ onKeyUp() {
505
+ if (this.digitsOnly) {
506
+ if (!this.decimal) {
507
+ return;
508
+ }
509
+ this.decimalCounter = this.el.nativeElement.value.split(this.decimalSeparator).length - 1;
510
+ this.minusCounter = this.el.nativeElement.value.split(this.minus).length - 1;
511
+ if (isNaN(+this.inputElement.value)) {
512
+ this.inputElement.value = this.sanitizeInput(this.inputElement.value);
513
+ }
514
+ }
515
+ }
516
+ onPaste(event) {
517
+ var _a;
518
+ if (this.digitsOnly) {
519
+ const pastedInput = (_a = event.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text/plain');
520
+ this.pasteData(pastedInput);
521
+ event.preventDefault();
522
+ }
523
+ }
524
+ ngOnInit() {
525
+ this.regex = new RegExp(this.allowHyphen ? '^[\\d -]+$' : '\\d');
526
+ }
527
+ pasteData(pastedContent) {
528
+ const sanitizedContent = isNaN(+pastedContent) ? this.sanitizeInput(pastedContent) : pastedContent;
529
+ const pasted = document.execCommand('insertText', false, sanitizedContent);
530
+ if (!pasted) {
531
+ const { selectionStart: start, selectionEnd: end } = this.inputElement;
532
+ this.inputElement.setRangeText(sanitizedContent, start, end, 'end');
533
+ }
534
+ }
535
+ sanitizeInput(input) {
536
+ let result = '';
537
+ if (this.decimal && this.isValidDecimal(input)) {
538
+ const regex = new RegExp(`^[\d -${this.decimalSeparator}]+$`, 'g');
539
+ result = input.replace(regex, '');
540
+ }
541
+ else {
542
+ result = input.replace(`/${this.regex}/g`, '');
543
+ }
544
+ const maxLength = this.inputElement.maxLength;
545
+ if (maxLength > 0) {
546
+ // the input element has maxLength limit
547
+ const allowedLength = maxLength - this.inputElement.value.length;
548
+ result = allowedLength > 0 ? result.substring(0, allowedLength) : '';
549
+ }
550
+ return result;
551
+ }
552
+ isValidDecimal(inputString) {
553
+ return inputString.split(this.decimalSeparator).length <= 2;
554
+ }
555
+ }
556
+ DigitsOnlyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DigitsOnlyDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
557
+ DigitsOnlyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: DigitsOnlyDirective, selector: "[appDigitsOnly]", inputs: { digitsOnly: "digitsOnly", allowHyphen: "allowHyphen", decimal: "decimal", decimalSeparator: "decimalSeparator", unit: "unit" }, host: { listeners: { "keydown": "onKeyDown($event)", "keyup": "onKeyUp($event)", "paste": "onPaste($event)" } }, ngImport: i0 });
558
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DigitsOnlyDirective, decorators: [{
559
+ type: Directive,
560
+ args: [{
561
+ selector: '[appDigitsOnly]',
562
+ }]
563
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { digitsOnly: [{
564
+ type: Input
565
+ }], allowHyphen: [{
566
+ type: Input
567
+ }], decimal: [{
568
+ type: Input
569
+ }], decimalSeparator: [{
570
+ type: Input
571
+ }], unit: [{
572
+ type: Input
573
+ }], onKeyDown: [{
574
+ type: HostListener,
575
+ args: ['keydown', ['$event']]
576
+ }], onKeyUp: [{
577
+ type: HostListener,
578
+ args: ['keyup', ['$event']]
579
+ }], onPaste: [{
580
+ type: HostListener,
581
+ args: ['paste', ['$event']]
582
+ }] } });
583
+
584
+ class EcabsInputComponent extends ElementBaseComponent {
585
+ constructor(injector) {
586
+ super();
587
+ this.injector = injector;
588
+ this.onblur = new EventEmitter();
589
+ this.onChange = () => { };
590
+ this.onTouch = () => { };
591
+ }
592
+ get value() {
593
+ return this.val;
594
+ }
595
+ set value(val) {
596
+ if (val !== undefined && this.val !== val) {
597
+ this.val = val;
598
+ this.onChange(val);
599
+ this.onTouch(val);
600
+ }
601
+ }
602
+ ngOnInit() {
603
+ if (this.type === 'number') {
604
+ this.digitsOnly = true;
605
+ }
606
+ }
607
+ ngAfterViewInit() {
608
+ const ngControl = this.injector.get(NgControl, null);
609
+ if (ngControl) {
610
+ this.control = ngControl.control;
611
+ }
612
+ }
613
+ writeValue(value) {
614
+ this.value = value;
615
+ }
616
+ registerOnChange(fn) {
617
+ this.onChange = fn;
618
+ }
619
+ registerOnTouched(fn) {
620
+ this.onTouch = fn;
621
+ }
622
+ blurChange(e) {
623
+ this.onblur.emit(e);
624
+ }
625
+ }
626
+ EcabsInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsInputComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
627
+ EcabsInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: EcabsInputComponent, selector: "ecabs-input", inputs: { digitsOnly: "digitsOnly", allowDecimal: "allowDecimal", allowHyphen: "allowHyphen", max: "max", step: "step" }, outputs: { onblur: "onblur" }, providers: [
628
+ {
629
+ provide: NG_VALUE_ACCESSOR,
630
+ useExisting: EcabsInputComponent,
631
+ multi: true,
632
+ },
633
+ ], usesInheritance: true, ngImport: i0, template: "<app-element-wrapper [data]=\"getData()\">\r\n <div class=\"form-field__input--wrapper\">\r\n <input\r\n appDigitsOnly\r\n [digitsOnly]=\"digitsOnly\"\r\n [decimal]=\"allowDecimal\"\r\n [allowHyphen]=\"allowHyphen\"\r\n class=\"form-field__input\"\r\n [type]=\"type\"\r\n [id]=\"name\"\r\n [(ngModel)]=\"value\"\r\n [placeholder]=\"placeholder\"\r\n (blur)=\"onTouch()\"\r\n [disabled]=\"disabled\"\r\n [maxlength]=\"maxLength\"\r\n [max]=\"max\"\r\n [step]=\"step\"\r\n (blur)=\"blurChange($event)\"\r\n />\r\n\r\n <div class=\"form-field__input--suffix\" *ngIf=\"type !== 'number'\">\r\n <ng-content select=\"mat-icon\"></ng-content>\r\n <ng-content select=\".suffix\"></ng-content>\r\n </div>\r\n </div>\r\n</app-element-wrapper>\r\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ElementWrapperComponent, selector: "app-element-wrapper", inputs: ["data", "showCloseIcon", "focusedFlag", "showPassword", "control"], outputs: ["showHidePassword", "clear", "increase", "decrease"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: DigitsOnlyDirective, selector: "[appDigitsOnly]", inputs: ["digitsOnly", "allowHyphen", "decimal", "decimalSeparator", "unit"] }] });
634
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsInputComponent, decorators: [{
635
+ type: Component,
636
+ args: [{ selector: 'ecabs-input', providers: [
637
+ {
638
+ provide: NG_VALUE_ACCESSOR,
639
+ useExisting: EcabsInputComponent,
640
+ multi: true,
641
+ },
642
+ ], template: "<app-element-wrapper [data]=\"getData()\">\r\n <div class=\"form-field__input--wrapper\">\r\n <input\r\n appDigitsOnly\r\n [digitsOnly]=\"digitsOnly\"\r\n [decimal]=\"allowDecimal\"\r\n [allowHyphen]=\"allowHyphen\"\r\n class=\"form-field__input\"\r\n [type]=\"type\"\r\n [id]=\"name\"\r\n [(ngModel)]=\"value\"\r\n [placeholder]=\"placeholder\"\r\n (blur)=\"onTouch()\"\r\n [disabled]=\"disabled\"\r\n [maxlength]=\"maxLength\"\r\n [max]=\"max\"\r\n [step]=\"step\"\r\n (blur)=\"blurChange($event)\"\r\n />\r\n\r\n <div class=\"form-field__input--suffix\" *ngIf=\"type !== 'number'\">\r\n <ng-content select=\"mat-icon\"></ng-content>\r\n <ng-content select=\".suffix\"></ng-content>\r\n </div>\r\n </div>\r\n</app-element-wrapper>\r\n" }]
643
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { digitsOnly: [{
644
+ type: Input
645
+ }], allowDecimal: [{
646
+ type: Input
647
+ }], allowHyphen: [{
648
+ type: Input
649
+ }], max: [{
650
+ type: Input
651
+ }], step: [{
652
+ type: Input
653
+ }], onblur: [{
654
+ type: Output
655
+ }] } });
656
+
657
+ class HintModule {
658
+ }
659
+ HintModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: HintModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
660
+ HintModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: HintModule, declarations: [HintComponent], imports: [CommonModule, FormsModule, MatFormFieldModule], exports: [HintComponent] });
661
+ HintModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: HintModule, imports: [CommonModule, FormsModule, MatFormFieldModule] });
662
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: HintModule, decorators: [{
663
+ type: NgModule,
664
+ args: [{
665
+ declarations: [HintComponent],
666
+ imports: [CommonModule, FormsModule, MatFormFieldModule],
667
+ exports: [HintComponent],
668
+ }]
669
+ }] });
670
+
671
+ class ValidationModule {
672
+ }
673
+ ValidationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ValidationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
674
+ ValidationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: ValidationModule, declarations: [ValidationComponent], imports: [CommonModule, FormsModule, MatFormFieldModule], exports: [ValidationComponent] });
675
+ ValidationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ValidationModule, imports: [CommonModule, FormsModule, MatFormFieldModule] });
676
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ValidationModule, decorators: [{
677
+ type: NgModule,
678
+ args: [{
679
+ declarations: [ValidationComponent],
680
+ imports: [CommonModule, FormsModule, MatFormFieldModule],
681
+ exports: [ValidationComponent],
682
+ }]
683
+ }] });
684
+
685
+ class ElementWrapperModule {
686
+ }
687
+ ElementWrapperModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ElementWrapperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
688
+ ElementWrapperModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: ElementWrapperModule, declarations: [ElementWrapperComponent], imports: [CommonModule,
689
+ FormsModule,
690
+ EcabsLoadingModule,
691
+ ValidationModule,
692
+ MatFormFieldModule,
693
+ MatInputModule,
694
+ MatIconModule,
695
+ MatTooltipModule,
696
+ HintModule], exports: [ElementWrapperComponent] });
697
+ ElementWrapperModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ElementWrapperModule, imports: [CommonModule,
698
+ FormsModule,
699
+ EcabsLoadingModule,
700
+ ValidationModule,
701
+ MatFormFieldModule,
702
+ MatInputModule,
703
+ MatIconModule,
704
+ MatTooltipModule,
705
+ HintModule] });
706
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ElementWrapperModule, decorators: [{
707
+ type: NgModule,
708
+ args: [{
709
+ declarations: [ElementWrapperComponent],
710
+ imports: [
711
+ CommonModule,
712
+ FormsModule,
713
+ EcabsLoadingModule,
714
+ ValidationModule,
715
+ MatFormFieldModule,
716
+ MatInputModule,
717
+ MatIconModule,
718
+ MatTooltipModule,
719
+ HintModule,
720
+ ],
721
+ exports: [ElementWrapperComponent],
722
+ }]
723
+ }] });
724
+
725
+ class EcabsInputModule {
726
+ }
727
+ EcabsInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
728
+ EcabsInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: EcabsInputModule, declarations: [EcabsInputComponent, DigitsOnlyDirective], imports: [CommonModule, MatInputModule, ElementWrapperModule, FormsModule], exports: [EcabsInputComponent] });
729
+ EcabsInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsInputModule, imports: [CommonModule, MatInputModule, ElementWrapperModule, FormsModule] });
730
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EcabsInputModule, decorators: [{
731
+ type: NgModule,
732
+ args: [{
733
+ declarations: [EcabsInputComponent, DigitsOnlyDirective],
734
+ imports: [CommonModule, MatInputModule, ElementWrapperModule, FormsModule],
735
+ exports: [EcabsInputComponent],
736
+ }]
737
+ }] });
738
+
739
+ /**
740
+ * Generated bundle index. Do not edit.
741
+ */
742
+
743
+ export { ButtonsComponent, EcabsButtonsModule, EcabsInputComponent, EcabsInputModule, EcabsLoadingComponent, EcabsLoadingModule, EcabsSpinnerComponent };
744
+ //# sourceMappingURL=ecabs-components.mjs.map