@pepperi-addons/ngx-lib 0.4.1-yaron.1 → 0.4.2-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/chips/chips.component.d.ts +13 -2
  2. package/chips/chips.component.theme.scss +22 -8
  3. package/chips/chips.model.d.ts +1 -0
  4. package/core/common/directives/div-loader.directive.d.ts +21 -0
  5. package/core/common/directives/public-api.d.ts +1 -0
  6. package/core/common/model/wapi.model.d.ts +1 -0
  7. package/core/common/services/addon.service.d.ts +5 -0
  8. package/core/common/services/data-convertor.service.d.ts +1 -0
  9. package/core/common/services/utilities.service.d.ts +8 -6
  10. package/core/customization/customization.model.d.ts +1 -3
  11. package/date/date.component.d.ts +3 -2
  12. package/dialog/dialog.model.d.ts +7 -7
  13. package/dialog/dialog.module.d.ts +7 -9
  14. package/esm2020/address/address.component.mjs +3 -3
  15. package/esm2020/chips/chips.component.mjs +45 -13
  16. package/esm2020/chips/chips.model.mjs +1 -1
  17. package/esm2020/chips/chips.service.mjs +2 -1
  18. package/esm2020/color/color-picker.component.mjs +3 -3
  19. package/esm2020/core/common/directives/div-loader.directive.mjs +61 -0
  20. package/esm2020/core/common/directives/public-api.mjs +2 -1
  21. package/esm2020/core/common/model/wapi.model.mjs +2 -1
  22. package/esm2020/core/common/services/addon.service.mjs +52 -1
  23. package/esm2020/core/common/services/data-convertor.service.mjs +4 -1
  24. package/esm2020/core/common/services/utilities.service.mjs +80 -42
  25. package/esm2020/core/common/services/validator.service.mjs +3 -3
  26. package/esm2020/core/customization/customization.model.mjs +5 -3
  27. package/esm2020/core/http/interceptors/loader.interceptor.mjs +2 -2
  28. package/esm2020/date/date.component.mjs +28 -11
  29. package/esm2020/dialog/dialog.component.mjs +1 -1
  30. package/esm2020/dialog/dialog.model.mjs +4 -4
  31. package/esm2020/dialog/dialog.module.mjs +1 -9
  32. package/esm2020/field-title/field-title.component.mjs +2 -2
  33. package/esm2020/form/field-generator.component.mjs +8 -9
  34. package/esm2020/form/form.component.mjs +16 -6
  35. package/esm2020/form/form.module.mjs +4 -1
  36. package/esm2020/form/internal-field-generator.component.mjs +8 -9
  37. package/esm2020/form/internal-form.component.mjs +4 -4
  38. package/esm2020/icon/icon-generated-all.model.mjs +10 -4
  39. package/esm2020/icon/icon-generated.model.mjs +28 -4
  40. package/esm2020/link/link.component.mjs +19 -33
  41. package/esm2020/link/public-api.mjs +2 -1
  42. package/esm2020/list/list-pager.component.mjs +3 -3
  43. package/esm2020/list/list.component.mjs +55 -25
  44. package/esm2020/list/virtual-scroller.mjs +21 -13
  45. package/esm2020/ngx-lib.module.mjs +7 -3
  46. package/esm2020/profile-data-views-list/profile-data-views-list.component.mjs +1 -1
  47. package/esm2020/quantity-selector/quantity-selector-validation.directive.mjs +7 -5
  48. package/esm2020/quantity-selector/quantity-selector.component.mjs +89 -45
  49. package/esm2020/query-builder/common/model/type-map.mjs +2 -2
  50. package/esm2020/query-builder/query-builder-item/query-builder-item.component.mjs +1 -1
  51. package/esm2020/remote-loader/addon-block-loader.component.mjs +1 -1
  52. package/esm2020/remote-loader/remote-loader-element.component.mjs +14 -7
  53. package/esm2020/rich-html-textarea/rich-html-textarea.component.mjs +3 -3
  54. package/esm2020/select/select.component.mjs +7 -7
  55. package/esm2020/select-panel/pepperi-addons-ngx-lib-select-panel.mjs +5 -0
  56. package/esm2020/select-panel/public-api.mjs +7 -0
  57. package/esm2020/select-panel/select-panel.component.mjs +159 -0
  58. package/esm2020/select-panel/select-panel.model.mjs +2 -0
  59. package/esm2020/select-panel/select-panel.module.mjs +70 -0
  60. package/esm2020/smart-filters/boolean-filter/boolean-filter.component.mjs +3 -3
  61. package/esm2020/smart-filters/common/model/base-filter-component.mjs +5 -4
  62. package/esm2020/smart-filters/date-filter/date-filter.component.mjs +3 -3
  63. package/esm2020/smart-filters/multi-select-filter/multi-select-filter.component.mjs +1 -1
  64. package/esm2020/smart-filters/number-filter/number-filter.component.mjs +13 -3
  65. package/esm2020/smart-filters/text-filter/text-filter.component.mjs +4 -3
  66. package/esm2020/textarea/textarea.component.mjs +9 -3
  67. package/esm2020/textbox/textbox-validation.directive.mjs +9 -5
  68. package/esm2020/textbox/textbox.component.mjs +171 -78
  69. package/fesm2015/pepperi-addons-ngx-lib-address.mjs +2 -2
  70. package/fesm2015/pepperi-addons-ngx-lib-address.mjs.map +1 -1
  71. package/fesm2015/pepperi-addons-ngx-lib-chips.mjs +46 -13
  72. package/fesm2015/pepperi-addons-ngx-lib-chips.mjs.map +1 -1
  73. package/fesm2015/pepperi-addons-ngx-lib-color.mjs +2 -2
  74. package/fesm2015/pepperi-addons-ngx-lib-color.mjs.map +1 -1
  75. package/fesm2015/pepperi-addons-ngx-lib-date.mjs +27 -10
  76. package/fesm2015/pepperi-addons-ngx-lib-date.mjs.map +1 -1
  77. package/fesm2015/pepperi-addons-ngx-lib-dialog.mjs +3 -11
  78. package/fesm2015/pepperi-addons-ngx-lib-dialog.mjs.map +1 -1
  79. package/fesm2015/pepperi-addons-ngx-lib-field-title.mjs +2 -2
  80. package/fesm2015/pepperi-addons-ngx-lib-field-title.mjs.map +1 -1
  81. package/fesm2015/pepperi-addons-ngx-lib-form.mjs +35 -24
  82. package/fesm2015/pepperi-addons-ngx-lib-form.mjs.map +1 -1
  83. package/fesm2015/pepperi-addons-ngx-lib-icon.mjs +37 -7
  84. package/fesm2015/pepperi-addons-ngx-lib-icon.mjs.map +1 -1
  85. package/fesm2015/pepperi-addons-ngx-lib-link.mjs +19 -33
  86. package/fesm2015/pepperi-addons-ngx-lib-link.mjs.map +1 -1
  87. package/fesm2015/pepperi-addons-ngx-lib-list.mjs +121 -83
  88. package/fesm2015/pepperi-addons-ngx-lib-list.mjs.map +1 -1
  89. package/fesm2015/pepperi-addons-ngx-lib-profile-data-views-list.mjs +1 -1
  90. package/fesm2015/pepperi-addons-ngx-lib-profile-data-views-list.mjs.map +1 -1
  91. package/fesm2015/pepperi-addons-ngx-lib-quantity-selector.mjs +96 -50
  92. package/fesm2015/pepperi-addons-ngx-lib-quantity-selector.mjs.map +1 -1
  93. package/fesm2015/pepperi-addons-ngx-lib-query-builder.mjs +2 -2
  94. package/fesm2015/pepperi-addons-ngx-lib-query-builder.mjs.map +1 -1
  95. package/fesm2015/pepperi-addons-ngx-lib-remote-loader.mjs +13 -6
  96. package/fesm2015/pepperi-addons-ngx-lib-remote-loader.mjs.map +1 -1
  97. package/fesm2015/pepperi-addons-ngx-lib-rich-html-textarea.mjs +2 -2
  98. package/fesm2015/pepperi-addons-ngx-lib-rich-html-textarea.mjs.map +1 -1
  99. package/fesm2015/pepperi-addons-ngx-lib-select-panel.mjs +237 -0
  100. package/fesm2015/pepperi-addons-ngx-lib-select-panel.mjs.map +1 -0
  101. package/fesm2015/pepperi-addons-ngx-lib-select.mjs +6 -6
  102. package/fesm2015/pepperi-addons-ngx-lib-select.mjs.map +1 -1
  103. package/fesm2015/pepperi-addons-ngx-lib-smart-filters.mjs +24 -12
  104. package/fesm2015/pepperi-addons-ngx-lib-smart-filters.mjs.map +1 -1
  105. package/fesm2015/pepperi-addons-ngx-lib-textarea.mjs +8 -2
  106. package/fesm2015/pepperi-addons-ngx-lib-textarea.mjs.map +1 -1
  107. package/fesm2015/pepperi-addons-ngx-lib-textbox.mjs +180 -83
  108. package/fesm2015/pepperi-addons-ngx-lib-textbox.mjs.map +1 -1
  109. package/fesm2015/pepperi-addons-ngx-lib.mjs +2994 -2831
  110. package/fesm2015/pepperi-addons-ngx-lib.mjs.map +1 -1
  111. package/fesm2020/pepperi-addons-ngx-lib-address.mjs +2 -2
  112. package/fesm2020/pepperi-addons-ngx-lib-address.mjs.map +1 -1
  113. package/fesm2020/pepperi-addons-ngx-lib-chips.mjs +45 -13
  114. package/fesm2020/pepperi-addons-ngx-lib-chips.mjs.map +1 -1
  115. package/fesm2020/pepperi-addons-ngx-lib-color.mjs +2 -2
  116. package/fesm2020/pepperi-addons-ngx-lib-color.mjs.map +1 -1
  117. package/fesm2020/pepperi-addons-ngx-lib-date.mjs +27 -10
  118. package/fesm2020/pepperi-addons-ngx-lib-date.mjs.map +1 -1
  119. package/fesm2020/pepperi-addons-ngx-lib-dialog.mjs +3 -11
  120. package/fesm2020/pepperi-addons-ngx-lib-dialog.mjs.map +1 -1
  121. package/fesm2020/pepperi-addons-ngx-lib-field-title.mjs +2 -2
  122. package/fesm2020/pepperi-addons-ngx-lib-field-title.mjs.map +1 -1
  123. package/fesm2020/pepperi-addons-ngx-lib-form.mjs +35 -24
  124. package/fesm2020/pepperi-addons-ngx-lib-form.mjs.map +1 -1
  125. package/fesm2020/pepperi-addons-ngx-lib-icon.mjs +37 -7
  126. package/fesm2020/pepperi-addons-ngx-lib-icon.mjs.map +1 -1
  127. package/fesm2020/pepperi-addons-ngx-lib-link.mjs +19 -33
  128. package/fesm2020/pepperi-addons-ngx-lib-link.mjs.map +1 -1
  129. package/fesm2020/pepperi-addons-ngx-lib-list.mjs +121 -82
  130. package/fesm2020/pepperi-addons-ngx-lib-list.mjs.map +1 -1
  131. package/fesm2020/pepperi-addons-ngx-lib-profile-data-views-list.mjs +1 -1
  132. package/fesm2020/pepperi-addons-ngx-lib-profile-data-views-list.mjs.map +1 -1
  133. package/fesm2020/pepperi-addons-ngx-lib-quantity-selector.mjs +96 -50
  134. package/fesm2020/pepperi-addons-ngx-lib-quantity-selector.mjs.map +1 -1
  135. package/fesm2020/pepperi-addons-ngx-lib-query-builder.mjs +2 -2
  136. package/fesm2020/pepperi-addons-ngx-lib-query-builder.mjs.map +1 -1
  137. package/fesm2020/pepperi-addons-ngx-lib-remote-loader.mjs +13 -6
  138. package/fesm2020/pepperi-addons-ngx-lib-remote-loader.mjs.map +1 -1
  139. package/fesm2020/pepperi-addons-ngx-lib-rich-html-textarea.mjs +2 -2
  140. package/fesm2020/pepperi-addons-ngx-lib-rich-html-textarea.mjs.map +1 -1
  141. package/fesm2020/pepperi-addons-ngx-lib-select-panel.mjs +236 -0
  142. package/fesm2020/pepperi-addons-ngx-lib-select-panel.mjs.map +1 -0
  143. package/fesm2020/pepperi-addons-ngx-lib-select.mjs +6 -6
  144. package/fesm2020/pepperi-addons-ngx-lib-select.mjs.map +1 -1
  145. package/fesm2020/pepperi-addons-ngx-lib-smart-filters.mjs +24 -12
  146. package/fesm2020/pepperi-addons-ngx-lib-smart-filters.mjs.map +1 -1
  147. package/fesm2020/pepperi-addons-ngx-lib-textarea.mjs +8 -2
  148. package/fesm2020/pepperi-addons-ngx-lib-textarea.mjs.map +1 -1
  149. package/fesm2020/pepperi-addons-ngx-lib-textbox.mjs +180 -82
  150. package/fesm2020/pepperi-addons-ngx-lib-textbox.mjs.map +1 -1
  151. package/fesm2020/pepperi-addons-ngx-lib.mjs +2970 -2816
  152. package/fesm2020/pepperi-addons-ngx-lib.mjs.map +1 -1
  153. package/form/field-generator.component.d.ts +1 -3
  154. package/form/form.component.d.ts +1 -1
  155. package/form/form.module.d.ts +9 -8
  156. package/form/internal-field-generator.component.d.ts +1 -3
  157. package/form/internal-form.component.d.ts +1 -1
  158. package/icon/icon-generated-all.model.d.ts +6 -0
  159. package/icon/icon-generated.model.d.ts +25 -1
  160. package/link/link.component.d.ts +2 -10
  161. package/link/public-api.d.ts +1 -0
  162. package/list/list.component.d.ts +6 -3
  163. package/list/virtual-scroller.d.ts +5 -5
  164. package/ngx-lib.module.d.ts +10 -9
  165. package/package.json +9 -1
  166. package/quantity-selector/quantity-selector-validation.directive.d.ts +3 -2
  167. package/quantity-selector/quantity-selector.component.d.ts +11 -6
  168. package/remote-loader/remote-loader-element.component.d.ts +5 -3
  169. package/select/select.component.d.ts +2 -2
  170. package/select-panel/index.d.ts +5 -0
  171. package/select-panel/public-api.d.ts +3 -0
  172. package/select-panel/select-panel.component.d.ts +51 -0
  173. package/select-panel/select-panel.component.theme.scss +25 -0
  174. package/select-panel/select-panel.model.d.ts +5 -0
  175. package/select-panel/select-panel.module.d.ts +19 -0
  176. package/smart-filters/common/model/base-filter-component.d.ts +3 -2
  177. package/src/core/style/base/typography.scss +1 -1
  178. package/src/core/style/components/checkbox.scss +4 -0
  179. package/src/core/style/components/radio-button.scss +1 -0
  180. package/src/core/style/components/textarea.scss +8 -2
  181. package/textarea/textarea.component.d.ts +3 -1
  182. package/textbox/textbox-validation.directive.d.ts +3 -2
  183. package/textbox/textbox.component.d.ts +21 -22
  184. package/theming-offline.scss +79 -0
  185. package/theming.scss +4 -31
@@ -3,7 +3,7 @@ import { Directive, Input, HostListener, EventEmitter, Component, ChangeDetectio
3
3
  import * as i3 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i4 from '@angular/forms';
6
- import { FormControl, ReactiveFormsModule } from '@angular/forms';
6
+ import { ReactiveFormsModule } from '@angular/forms';
7
7
  import { MatCommonModule } from '@angular/material/core';
8
8
  import * as i5 from '@angular/material/button';
9
9
  import { MatButtonModule } from '@angular/material/button';
@@ -21,11 +21,14 @@ import * as i11 from '@pepperi-addons/ngx-lib/textbox-icon';
21
21
  import { PepTextboxIconModule } from '@pepperi-addons/ngx-lib/textbox-icon';
22
22
  import * as i10 from '@pepperi-addons/ngx-lib/field-title';
23
23
  import { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';
24
+ import { BehaviorSubject, distinctUntilChanged } from 'rxjs';
25
+ import { coerceNumberProperty } from '@angular/cdk/coercion';
24
26
  import * as i2 from '@ngx-translate/core';
25
27
 
26
28
  class PepTextboxValidationDirective {
27
- constructor(hostElement, validatorService) {
29
+ constructor(hostElement, utilitiesService, validatorService) {
28
30
  this.hostElement = hostElement;
31
+ this.utilitiesService = utilitiesService;
29
32
  this.validatorService = validatorService;
30
33
  this.type = 'text';
31
34
  this.previousValue = '';
@@ -75,9 +78,12 @@ class PepTextboxValidationDirective {
75
78
  }
76
79
  }
77
80
  validateValue(value) {
81
+ console.log(`validateValue start value is - ${value}`);
78
82
  if (this.isNumber()) {
79
83
  const newValue = this.validatorService.validateNumber(value, this.isDecimal());
80
- this.hostElement.nativeElement['value'] = newValue ? newValue : 0;
84
+ console.log(`after validateNumber newValue is - ${newValue}`);
85
+ // Always set to the value input number with '.' decomal separator.
86
+ this.hostElement.nativeElement['value'] = newValue ? this.utilitiesService.changeDecimalSeparatorWhenItsComma(newValue) : 0;
81
87
  }
82
88
  else if (this.isPhone()) {
83
89
  // test phone with regular expression, when
@@ -92,14 +98,14 @@ class PepTextboxValidationDirective {
92
98
  }
93
99
  }
94
100
  }
95
- PepTextboxValidationDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepTextboxValidationDirective, deps: [{ token: i0.ElementRef }, { token: i1.PepValidatorService }], target: i0.ɵɵFactoryTarget.Directive });
101
+ PepTextboxValidationDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepTextboxValidationDirective, deps: [{ token: i0.ElementRef }, { token: i1.PepUtilitiesService }, { token: i1.PepValidatorService }], target: i0.ɵɵFactoryTarget.Directive });
96
102
  PepTextboxValidationDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.2", type: PepTextboxValidationDirective, selector: "[pepTextboxValidation]", inputs: { type: "type" }, host: { listeners: { "change": "onChange($event)", "keydown": "onKeyDown($event)" } }, ngImport: i0 });
97
103
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepTextboxValidationDirective, decorators: [{
98
104
  type: Directive,
99
105
  args: [{
100
106
  selector: '[pepTextboxValidation]',
101
107
  }]
102
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.PepValidatorService }]; }, propDecorators: { type: [{
108
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.PepUtilitiesService }, { type: i1.PepValidatorService }]; }, propDecorators: { type: [{
103
109
  type: Input
104
110
  }], onChange: [{
105
111
  type: HostListener,
@@ -109,14 +115,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImpor
109
115
  args: ['keydown', ['$event']]
110
116
  }] } });
111
117
 
112
- /** error when invalid control is dirty or touched */
113
- class TextErrorStateMatcher {
114
- isErrorState(control, form) {
115
- var _a, _b, _c;
116
- const validateOnDirty = (_c = (_b = (_a = form === null || form === void 0 ? void 0 : form.form) === null || _a === void 0 ? void 0 : _a.controls) === null || _b === void 0 ? void 0 : _b['validateOnDirty']) === null || _c === void 0 ? void 0 : _c.value;
117
- return !!(validateOnDirty && control && control.invalid && (control.dirty || control.touched));
118
- }
119
- }
118
+ // Not in use - I don't know why we need this???
119
+ // /** error when invalid control is dirty or touched */
120
+ // export class TextErrorStateMatcher implements ErrorStateMatcher {
121
+ // isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {
122
+ // const validateOnDirty = form?.form?.controls?.['validateOnDirty']?.value;
123
+ // return !!(validateOnDirty && control && control.invalid && (control.dirty || control.touched));
124
+ // }
125
+ // }
120
126
  /**
121
127
  * This is a text box input component that can be use to
122
128
  *
@@ -136,7 +142,27 @@ class PepTextboxComponent {
136
142
  this.dataQa = '';
137
143
  this._key = '';
138
144
  this._value = '';
139
- this._formattedValue = '';
145
+ this.formattedValue = '';
146
+ // private _formattedValue = '';
147
+ // /**
148
+ // * The formatted value.
149
+ // *
150
+ // * @memberof PepTextboxComponent
151
+ // */
152
+ // @Input()
153
+ // set formattedValue(value: string) {
154
+ // // Do nothing.
155
+ // // if (!value) {
156
+ // // value = '';
157
+ // // }
158
+ // // if (this._calculateFormattedValue) {
159
+ // // this._calculateFormattedValue = false;
160
+ // // }
161
+ // // this.setFormattedValue(value);
162
+ // }
163
+ // get formattedValue(): string {
164
+ // return this._formattedValue;
165
+ // }
140
166
  this._minFractionDigits = NaN;
141
167
  this._maxFractionDigits = NaN;
142
168
  /**
@@ -164,12 +190,13 @@ class PepTextboxComponent {
164
190
  * @memberof PepTextboxComponent
165
191
  */
166
192
  this._type = 'text';
193
+ this.inputMode = 'text';
167
194
  /**
168
195
  * If the textbox is mandatory
169
196
  *
170
197
  * @memberof PepTextboxComponent
171
198
  */
172
- this.mandatory = false;
199
+ this._mandatory = false;
173
200
  // TODO: Check if should remove disabled and keep only readonly.
174
201
  /**
175
202
  * If the textbox is disabled.
@@ -198,6 +225,7 @@ class PepTextboxComponent {
198
225
  this.renderSymbol = true;
199
226
  this.layoutType = 'form';
200
227
  this.parentFieldKey = null;
228
+ this.regex = null;
201
229
  this.regexError = '';
202
230
  /**
203
231
  * The value change event.
@@ -206,12 +234,17 @@ class PepTextboxComponent {
206
234
  * @memberof PepTextboxComponent
207
235
  */
208
236
  this.valueChange = new EventEmitter();
209
- this.formValidationChange = new EventEmitter();
237
+ // @Output()
238
+ // formValidationChange: EventEmitter<boolean> = new EventEmitter<boolean>();
239
+ this.keyup = new EventEmitter();
210
240
  this._calculateFormattedValue = true;
211
241
  this.controlType = 'textbox';
212
242
  this.standAlone = false;
213
243
  this.isInEditMode = false;
214
- this.matcher = new TextErrorStateMatcher();
244
+ this._isInFocus = false;
245
+ // matcher = new TextErrorStateMatcher();
246
+ // protected displayValue$:
247
+ this._displayValueSubject = new BehaviorSubject('');
215
248
  this.isInFocus = false;
216
249
  }
217
250
  /**
@@ -235,33 +268,28 @@ class PepTextboxComponent {
235
268
  if (!value) {
236
269
  value = '';
237
270
  }
238
- this._value = value;
239
- this.setFormattedValue(value);
271
+ if (this.isDifferentValue(value)) {
272
+ // console.log(`set value, value is - ${value}`)
273
+ this._value = value;
274
+ }
275
+ this.setFormattedValue(this.value);
276
+ this.changeDisplayValue();
240
277
  }
241
278
  get value() {
242
279
  return this._value;
243
280
  }
244
- /**
245
- * The formatted value.
246
- *
247
- * @memberof PepTextboxComponent
248
- */
249
- set formattedValue(value) {
250
- // Do nothing.
251
- // if (!value) {
252
- // value = '';
281
+ get valueAsCurrentCulture() {
282
+ return this.utilitiesService.changeDecimalSeparatorWhenItsComma(this.value, true);
283
+ // let res = this.value;
284
+ // if (this.isDecimal()) {
285
+ // res = this.utilitiesService.formatDecimal(this.value, this.minFractionDigits, this.maxFractionDigits, false);
253
286
  // }
254
- // if (this._calculateFormattedValue) {
255
- // this._calculateFormattedValue = false;
256
- // }
257
- // this.setFormattedValue(value);
258
- }
259
- get formattedValue() {
260
- return this._formattedValue;
287
+ // return res;
261
288
  }
262
289
  set minFractionDigits(value) {
263
290
  this._minFractionDigits = value;
264
291
  this.setFormattedValue(this.value);
292
+ this.changeDisplayValue();
265
293
  }
266
294
  get minFractionDigits() {
267
295
  return this._minFractionDigits;
@@ -269,6 +297,7 @@ class PepTextboxComponent {
269
297
  set maxFractionDigits(value) {
270
298
  this._maxFractionDigits = value;
271
299
  this.setFormattedValue(this.value);
300
+ this.changeDisplayValue();
272
301
  }
273
302
  get maxFractionDigits() {
274
303
  return this._maxFractionDigits;
@@ -277,11 +306,19 @@ class PepTextboxComponent {
277
306
  this._type = value;
278
307
  if (this.value) {
279
308
  this.setFormattedValue(this.value);
309
+ this.changeDisplayValue();
310
+ this.setInputModeAttribute();
280
311
  }
281
312
  }
282
313
  get type() {
283
314
  return this._type;
284
315
  }
316
+ set mandatory(value) {
317
+ this._mandatory = value;
318
+ }
319
+ get mandatory() {
320
+ return this._mandatory;
321
+ }
285
322
  set visible(visible) {
286
323
  this._visible = visible;
287
324
  if (visible) {
@@ -297,52 +334,97 @@ class PepTextboxComponent {
297
334
  get calculateFormattedValue() {
298
335
  return this._calculateFormattedValue;
299
336
  }
337
+ set isInFocus(isInFocus) {
338
+ this._isInFocus = isInFocus;
339
+ this.setFormattedValue(this.value);
340
+ this.changeDisplayValue();
341
+ }
342
+ get isInFocus() {
343
+ return this._isInFocus;
344
+ }
345
+ get displayValue$() {
346
+ return this._displayValueSubject.asObservable().pipe(distinctUntilChanged());
347
+ }
348
+ setInputModeAttribute() {
349
+ if (this.type === 'currency' || this.type === 'percentage' || this.type === 'real') {
350
+ this.inputMode = 'decimal';
351
+ }
352
+ else if (this.type === 'int') {
353
+ this.inputMode = 'numeric';
354
+ }
355
+ else if (this.type === 'phone') {
356
+ this.inputMode = 'tel';
357
+ }
358
+ else if (this.type === 'email') {
359
+ this.inputMode = 'email';
360
+ }
361
+ else {
362
+ this.inputMode = 'text';
363
+ }
364
+ if (this.input) {
365
+ this.renderer.setAttribute(this.input.nativeElement, 'inputmode', this.inputMode);
366
+ }
367
+ }
368
+ notifyDisplayValueChange(value) {
369
+ this._displayValueSubject.next(value);
370
+ }
300
371
  setFormattedValue(value) {
372
+ if (this.isInFocus) {
373
+ return;
374
+ }
301
375
  if (this._calculateFormattedValue) {
376
+ // console.log(`setFormattedValue before - value is ${value}`);
302
377
  if (this.type === 'currency') {
303
- this._formattedValue = this.utilitiesService.formatCurrency(value, this.accessory, this.minFractionDigits, this.maxFractionDigits);
378
+ this.formattedValue = this.utilitiesService.formatCurrency(value, this.accessory, this.minFractionDigits, this.maxFractionDigits);
304
379
  }
305
380
  else if (this.type === 'percentage') {
306
- this._formattedValue = this.utilitiesService.formatPercent(value, this.minFractionDigits, this.maxFractionDigits);
381
+ this.formattedValue = this.utilitiesService.formatPercent(value, this.minFractionDigits, this.maxFractionDigits);
307
382
  }
308
383
  else if (this.type === 'real') {
309
- this._formattedValue = this.utilitiesService.formatDecimal(value, this.minFractionDigits, this.maxFractionDigits);
384
+ this.formattedValue = this.utilitiesService.formatDecimal(value, this.minFractionDigits, this.maxFractionDigits);
310
385
  }
311
386
  else if (this.type === 'int') {
312
- this._formattedValue = this.utilitiesService.formatNumber(value);
387
+ this.formattedValue = this.utilitiesService.formatNumber(value);
313
388
  }
314
389
  else if (this.type === 'duration') {
315
- this._formattedValue = this.utilitiesService.formatDuration(value, { duration: 'seconds' });
390
+ this.formattedValue = this.utilitiesService.formatDuration(value, { duration: 'seconds' });
316
391
  }
317
392
  else {
318
- this._formattedValue = value;
393
+ this.formattedValue = value;
319
394
  }
320
395
  }
321
396
  else {
322
- this._formattedValue = value;
397
+ this.formattedValue = value;
323
398
  }
399
+ // console.log(`setFormattedValue after - value is ${this.formattedValue}`);
324
400
  this.updateFormFieldValue();
325
401
  }
326
- updateFormFieldValue() {
327
- this.customizationService.updateFormFieldValue(this.form, this.key, this.formattedValue, this.parentFieldKey);
402
+ updateFormFieldValue(firstLoad = false) {
403
+ // Set the formatted value only for the first load cause it's not formatted if we set the value (I don't know why)
404
+ // Else we set the value - this is important to set the value only cause setting the formatted value will cause bug when the number is with thousand separator
405
+ this.customizationService.updateFormFieldValue(this.form, this.key, firstLoad ? this.formattedValue : this.value, this.parentFieldKey);
328
406
  }
329
- get displayValue() {
407
+ changeDisplayValue() {
330
408
  let res = '';
331
409
  if (this.type == 'link') {
332
410
  res = this.formattedValue;
333
411
  }
412
+ else if (this.isDecimal()) {
413
+ res = this.isInFocus ? this.valueAsCurrentCulture : this.formattedValue;
414
+ }
334
415
  else if (this.isNumberType()) {
335
- res = this.isInFocus ? (this.value.length > 0 ? this.utilitiesService.formatDecimal(this.value, this.minFractionDigits, this.maxFractionDigits) : '') : this.formattedValue;
416
+ res = this.isInFocus ? this.value : this.formattedValue;
336
417
  }
337
418
  else {
338
419
  res = this.isInFocus ? this.value : this.formattedValue;
339
420
  }
340
- return res;
421
+ this.notifyDisplayValueChange(res);
422
+ // console.log('changeDisplayValue ' + res);
341
423
  }
342
424
  setDefaultForm() {
343
425
  const pepField = new PepTextboxField({
344
426
  key: this.key,
345
- value: this.value,
427
+ value: this.valueAsCurrentCulture,
346
428
  mandatory: this.mandatory,
347
429
  readonly: this.readonly,
348
430
  disabled: this.disabled,
@@ -371,14 +453,17 @@ class PepTextboxComponent {
371
453
  this.renderer.addClass(this.element.nativeElement, PepCustomizationService.STAND_ALONE_FIELD_NO_SPACING_CLASS_NAME);
372
454
  }
373
455
  }
374
- //flag to indicate whether validation on dirty is required
375
- this.form.addControl('validateOnDirty', new FormControl(this.type === 'text'));
456
+ // flag to indicate whether validation on dirty is required
457
+ // this.form.addControl('validateOnDirty', new FormControl(this.type === 'text'));
376
458
  this.readonly = this.type === 'duration' ? true : this.readonly; // Hack until we develop Timer UI for editing Duration field
377
- //load default error text
378
- if (this.type === 'text' && this.regex && !this.regexError) {
459
+ // load default error text
460
+ if (this.type === 'text' && this.regex && (!this.regexError || this.regexError.length === 0)) {
379
461
  this.translate.get('MESSAGES.ERROR_INVALID_PATTERN').subscribe(text => this.regexError = text);
380
462
  }
381
- this.updateFormFieldValue();
463
+ this.updateFormFieldValue(true);
464
+ }
465
+ ngAfterViewInit() {
466
+ this.setInputModeAttribute();
382
467
  }
383
468
  ngOnChanges(changes) {
384
469
  if (this.standAlone) {
@@ -393,9 +478,11 @@ class PepTextboxComponent {
393
478
  this.isInFocus = true;
394
479
  // select the value in focus (DI-18246 improvement)
395
480
  setTimeout(() => {
396
- const eventTarget = event.target || event.srcElement;
397
- if (eventTarget) {
398
- eventTarget.select();
481
+ if (this.isInFocus) {
482
+ const eventTarget = event.target || event.srcElement;
483
+ if (eventTarget) {
484
+ eventTarget.select();
485
+ }
399
486
  }
400
487
  }, 0);
401
488
  }
@@ -421,10 +508,20 @@ class PepTextboxComponent {
421
508
  res = this.mandatory ? false : true;
422
509
  }
423
510
  else {
424
- const numberValue = this.utilitiesService.coerceNumberProperty(value);
425
- res =
426
- numberValue >= this.minValue &&
427
- numberValue <= this.maxValue;
511
+ value = this.utilitiesService.changeDecimalSeparatorWhenItsComma(value);
512
+ const numberValue = coerceNumberProperty(value);
513
+ if (!isNaN(this.minValue) && !isNaN(this.maxValue)) {
514
+ res = numberValue >= this.minValue && numberValue <= this.maxValue;
515
+ }
516
+ else if (!isNaN(this.minValue)) {
517
+ res = numberValue >= this.minValue;
518
+ }
519
+ else if (!isNaN(this.maxValue)) {
520
+ res = numberValue <= this.maxValue;
521
+ }
522
+ else {
523
+ res = true;
524
+ }
428
525
  }
429
526
  }
430
527
  else {
@@ -436,13 +533,11 @@ class PepTextboxComponent {
436
533
  isDifferentValue(value) {
437
534
  let res = false;
438
535
  if (this.isNumberType()) {
439
- if (this.value === '' || value === '') {
536
+ if ((this.value === '' || value === '')) {
440
537
  res = true;
441
538
  }
442
539
  else {
443
- const currentValue = this.utilitiesService.coerceNumberProperty(this.value);
444
- const newValue = this.utilitiesService.coerceNumberProperty(value);
445
- res = currentValue !== newValue;
540
+ res = this.utilitiesService.isEqualNumber(this.valueAsCurrentCulture, value) === false;
446
541
  }
447
542
  }
448
543
  else {
@@ -452,28 +547,30 @@ class PepTextboxComponent {
452
547
  }
453
548
  onChange(e) {
454
549
  const value = e.target ? e.target.value : e;
550
+ // console.log(`onChange value is ${value}`);
455
551
  this.valueChange.emit(value);
456
552
  }
553
+ onKeyup(event) {
554
+ this.keyup.emit(event);
555
+ }
457
556
  onBlur(e) {
458
- this.isInFocus = false;
459
557
  const value = e.target ? e.target.value : e;
460
- if (value !== this.value && this.isDifferentValue(value)) {
461
- // If renderError is false and the new value is not valid.
462
- if (!this.renderError && !this.isValueValid(value)) {
463
- this.renderer.setProperty(this.input.nativeElement, 'value', this.value);
464
- }
465
- else {
466
- this.value = value;
467
- // // If the user is setting the formatted value then set the value till the user format it and return it back.
468
- // if (!this._calculateFormattedValue) {
469
- // this._formattedValue = value;
470
- // }
471
- this.valueChange.emit(value);
558
+ // If renderError is false and the new value is not valid.
559
+ if (!this.renderError && !this.isValueValid(value)) {
560
+ this.renderer.setProperty(this.input.nativeElement, 'value', this.valueAsCurrentCulture);
561
+ }
562
+ else {
563
+ // For decimal we need to replace the decimal separator back if it's comma (',').
564
+ const correctValue = this.isDecimal() ? this.utilitiesService.changeDecimalSeparatorWhenItsComma(value) : value;
565
+ if (correctValue !== this.valueAsCurrentCulture && this.isDifferentValue(value)) {
566
+ this.value = correctValue;
567
+ this.valueChange.emit(this.value);
472
568
  }
473
569
  }
474
570
  if (this.isInEditMode) {
475
571
  this.isInEditMode = false;
476
572
  }
573
+ this.isInFocus = false;
477
574
  }
478
575
  anchorClicked() {
479
576
  const currentValue = this.value;
@@ -501,10 +598,10 @@ class PepTextboxComponent {
501
598
  }
502
599
  }
503
600
  PepTextboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepTextboxComponent, deps: [{ token: i1.PepCustomizationService }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i2.TranslateService }, { token: i1.PepUtilitiesService }], target: i0.ɵɵFactoryTarget.Component });
504
- PepTextboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepTextboxComponent, selector: "pep-textbox", inputs: { key: "key", value: "value", formattedValue: "formattedValue", minFractionDigits: "minFractionDigits", maxFractionDigits: "maxFractionDigits", accessory: "accessory", label: "label", placeholder: "placeholder", type: "type", mandatory: "mandatory", disabled: "disabled", readonly: "readonly", maxFieldCharacters: "maxFieldCharacters", hint: "hint", textColor: "textColor", xAlignment: "xAlignment", rowSpan: "rowSpan", minValue: "minValue", maxValue: "maxValue", visible: "visible", form: "form", isActive: "isActive", showTitle: "showTitle", renderTitle: "renderTitle", renderError: "renderError", renderSymbol: "renderSymbol", layoutType: "layoutType", parentFieldKey: "parentFieldKey", regex: "regex", regexError: "regexError" }, outputs: { valueChange: "valueChange", formValidationChange: "formValidationChange" }, host: { properties: { "attr.data-qa": "this.dataQa" } }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container [formGroup]=\"form\">\n <ng-template #pepTemplate let-isFormView=\"isFormView\" let-hasParent=\"hasParent\">\n <pep-field-title *ngIf=\"renderTitle && isFormView && !hasParent\" [label]=\"label\" [mandatory]=\"mandatory\"\n [disabled]=\"disabled\" [maxFieldCharacters]=\"maxFieldCharacters\" [hint]=\"hint\" [xAlignment]=\"xAlignment\"\n [showTitle]=\"showTitle\" [inputLength]=\"input.value?.length\">\n </pep-field-title>\n <mat-form-field appearance=\"outline\">\n <input #input matInput pepTextboxValidation [formControlName]=\"key\" [errorStateMatcher]=\"matcher\" [id]=\"key\"\n [name]=\"key\" class=\" body-sm \" autocomplete=\"off\"\n maxlength=\"{{ maxFieldCharacters > 0 ? maxFieldCharacters : 99999 }}\"\n [placeholder]=\"hasParent && !disabled ? placeholder : ''\"\n [ngStyle]=\"{ color: textColor, 'text-align': xAlignment == 'center' ? 'center' : xAlignment == 'right' ? 'right' : 'left' }\"\n title=\"{{ formattedValue }}\" [type]=\"type\" [value]=\"displayValue\"\n (keyup.enter)=\"$event?.currentTarget?.blur()\" (focus)=\"onFocus($event)\" (blur)=\"onBlur($event)\"\n (change)=\"onChange($event)\"\n [ngClass]=\"{'disable-hidden': disabled && formattedValue?.length > 0 && (type === 'phone' || type === 'email' || type === 'link')}\" />\n\n <span\n *ngIf=\"disabled && formattedValue?.length > 0 && (type === 'phone' || type === 'email' || type === 'link')\"\n class=\"dis-grid\">\n <a href=\"javascript:void(0)\" (click)=\"anchorClicked()\" [id]=\"key\" [name]=\"key\"\n class=\"color-link body-sm \"> {{formattedValue}}</a>\n </span>\n <mat-error *ngIf=\"renderError\"> \n <ng-container *ngIf=\"mandatory && input.value.length == 0 then requiredError else otherErrorContainer\">\n </ng-container>\n <ng-template #requiredError>\n <span class=\"body-xs\" [title]=\"('MESSAGES.ERROR_IS_REQUIRED' | translate: { field: label })\"\n [innerText]=\"('MESSAGES.ERROR_IS_REQUIRED' | translate: { field: label })\">\n </span>\n </ng-template>\n <ng-template #otherErrorContainer>\n <ng-template *ngIf=\"form.get(key).errors?.pattern then patternError else otherError\"></ng-template>\n <ng-template #patternError>\n <span class=\"body-xs\">\n {{ regexError }}\n </span>\n </ng-template>\n <ng-template #otherError>\n <span class=\"body-xs\" [title]=\"(input.value | pepToNumber) > this.maxValue || (input.value | pepToNumber) < this.minValue ?\n ('MESSAGES.ERROR_RANGE_IS_NOT_VALID' | translate: { min: minValue, max: maxValue }) :\n ('MESSAGES.ERROR_IS_NOT_VALID' | translate: { field: label })\" [innerText]=\"(input.value | pepToNumber) > this.maxValue || (input.value | pepToNumber) < this.minValue ?\n ('MESSAGES.ERROR_RANGE_IS_NOT_VALID' | translate: { min: minValue, max: maxValue }) :\n ('MESSAGES.ERROR_IS_NOT_VALID' | translate: { field: label })\">\n </span>\n </ng-template>\n </ng-template>\n </mat-error> \n <pep-textbox-icon *ngIf=\"renderSymbol && isFormView && xAlignment == 'right'\" matPrefix [value]=\"value\"\n [label]=\"label\" [type]=\"type\" [disabled]=\"disabled\">\n </pep-textbox-icon>\n <pep-textbox-icon *ngIf=\"renderSymbol && isFormView && (xAlignment == 'left')\" matSuffix [value]=\"value\"\n [label]=\"label\" [type]=\"type\" [disabled]=\"disabled\">\n </pep-textbox-icon>\n </mat-form-field>\n </ng-template> \n <ng-container *ngIf=\"layoutType === 'form'\">\n <ng-container *ngIf=\"parentFieldKey; then groupedBlock; else regularBlock\"></ng-container>\n <ng-template #regularBlock>\n <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: true, hasParent: false }\">\n </ng-container>\n </ng-template>\n <ng-template #groupedBlock>\n <ng-container [formGroupName]=\"parentFieldKey\">\n <mat-form-field appearance=\"outline\">\n <!-- (keyup)=\"onKeyUp($event)\" -->\n <input pepTextboxValidation [id]=\"key\" [name]=\"key\" class=\" body-sm \" matInput autocomplete=\"off\"\n [placeholder]=\"!disabled ? placeholder : ''\" title=\"{{ formattedValue }}\"\n [formControlName]=\"key\" [value]=\"value\" (blur)=\"onBlur($event)\" (change)=\"onChange($event)\"\n (keyup.enter)=\"$event?.currentTarget?.blur()\" (focus)=\"onFocus($event)\" />\n </mat-form-field>\n <!-- <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: true, hasParent: true }\"></ng-container> -->\n </ng-container>\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"layoutType === 'card'\">\n <ng-container *ngIf=\"isInEditMode; then editBlock; else readOnlyBlock\"></ng-container>\n <ng-template #editBlock>\n <div [ngClass]=\"{'one-row': rowSpan === 1}\">\n <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: false, hasParent: false }\">\n </ng-container>\n </div>\n </ng-template>\n <ng-template #readOnlyBlock>\n <div class=\"pep-card-input card-flex-container\" [ngStyle]=\"{ color: textColor }\"\n [class]=\"'text-align-' + xAlignment\" [ngClass]=\"{'one-row': rowSpan === 1,\n 'multi-rows': rowSpan > 1,\n 'pep-button weak': isActive && !disabled}\"\n (click)=\"!disabled ? cardTemplateClicked($event) : ''\">\n <span *ngIf=\"showTitle && label != ''\" class=\"body-xs title\" title=\"{{ label }}\">{{ label\n }}&nbsp;</span>\n <span [id]=\"key\" title=\"{{ formattedValue }}\" class=\"body-sm value\"\n [ngClass]=\"{'multi-rows-text': rowSpan > 1}\" [ngStyle]=\"{ '-webkit-line-clamp': rowSpan }\">{{\n formattedValue }}</span>\n <button *ngIf=\"isActive && !disabled\" class=\"pep-button weak card-edit-button\" mat-button>\n <mat-icon>\n <pep-icon name=\"system_edit\">\n </pep-icon>\n </mat-icon>\n </button>\n </div>\n </ng-template>\n\n </ng-container>\n\n <ng-container *ngIf=\"layoutType === 'table'\">\n <ng-container *ngIf=\"isActive && !disabled; then selectedBlock; else notSelectedBlock\"></ng-container>\n <ng-template #selectedBlock>\n <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: false, hasParent: false }\">\n </ng-container>\n </ng-template>\n <ng-template #notSelectedBlock>\n <ng-container *ngIf=\"formattedValue?.length > 0; then notEmptyBlock; else emptyBlock\"></ng-container>\n <ng-template #notEmptyBlock>\n <ng-container [ngSwitch]=\"type\">\n <ng-container *ngSwitchCase=\"'link'\">\n <a [id]=\"key\" class=\"color-link body-sm pep-report-input\"\n [ngClass]=\"{'disable': (disabled && value === '')}\" *ngIf=\"formattedValue != null\"\n title=\"{{ formattedValue }}\" target=\"_blank\" href=\"{{ value ? value : formattedValue }}\">{{\n formattedValue }}</a>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <span [id]=\"key\" class=\"body-sm pep-report-input\" [ngClass]=\"{'readonly': disabled}\"\n title=\"{{ formattedValue }}\" [ngStyle]=\"{ color: textColor }\">{{ formattedValue }}</span>\n </ng-container>\n </ng-container>\n </ng-template>\n <ng-template #emptyBlock>\n <span [id]=\"key\">&nbsp;</span>\n </ng-template>\n </ng-template>\n </ng-container>\n\n</ng-container>", styles: [":host{height:inherit;display:grid}:host>*{align-self:center;align-items:baseline}.disable-hidden{display:none}.dis-grid{display:grid}.multi-rows-text{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal!important}\n", ""], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", 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]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i4.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "component", type: i5.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: "directive", type: i6.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i6.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i1$1.PepIconComponent, selector: "pep-icon", inputs: ["spin", "name", "fill"] }, { kind: "component", type: i10.PepFieldTitleComponent, selector: "pep-field-title", inputs: ["label", "mandatory", "disabled", "maxFieldCharacters", "hint", "xAlignment", "showTitle", "inputLength", "fontBodyType"] }, { kind: "component", type: i11.PepTextboxIconComponent, selector: "pep-textbox-icon", inputs: ["value", "label", "type", "disabled"], outputs: ["iconClick"] }, { kind: "directive", type: PepTextboxValidationDirective, selector: "[pepTextboxValidation]", inputs: ["type"] }, { kind: "pipe", type: i1.PepToNumberPipe, name: "pepToNumber" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
601
+ PepTextboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepTextboxComponent, selector: "pep-textbox", inputs: { key: "key", value: "value", minFractionDigits: "minFractionDigits", maxFractionDigits: "maxFractionDigits", accessory: "accessory", label: "label", placeholder: "placeholder", type: "type", mandatory: "mandatory", disabled: "disabled", readonly: "readonly", maxFieldCharacters: "maxFieldCharacters", hint: "hint", textColor: "textColor", xAlignment: "xAlignment", rowSpan: "rowSpan", minValue: "minValue", maxValue: "maxValue", visible: "visible", form: "form", isActive: "isActive", showTitle: "showTitle", renderTitle: "renderTitle", renderError: "renderError", renderSymbol: "renderSymbol", layoutType: "layoutType", parentFieldKey: "parentFieldKey", regex: "regex", regexError: "regexError", isInFocus: "isInFocus" }, outputs: { valueChange: "valueChange", keyup: "keyup" }, host: { properties: { "attr.data-qa": "this.dataQa" } }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container [formGroup]=\"form\">\n <ng-template #pepTemplate let-isFormView=\"isFormView\" let-hasParent=\"hasParent\">\n <pep-field-title *ngIf=\"renderTitle && isFormView && !hasParent\" [label]=\"label\" [mandatory]=\"mandatory\"\n [disabled]=\"disabled\" [maxFieldCharacters]=\"maxFieldCharacters\" [hint]=\"hint\" [xAlignment]=\"xAlignment\"\n [showTitle]=\"showTitle\" [inputLength]=\"input.value?.length\">\n </pep-field-title>\n <mat-form-field appearance=\"outline\">\n <!-- (click)=\"$event.target.select()\" -->\n <input #input matInput pepTextboxValidation [formControlName]=\"key\" [id]=\"key\"\n [name]=\"key\" class=\" body-sm \" autocomplete=\"off\"\n maxlength=\"{{ maxFieldCharacters > 0 ? maxFieldCharacters : 99999 }}\"\n [placeholder]=\"hasParent && !disabled ? placeholder : ''\"\n [ngStyle]=\"{ color: textColor, 'text-align': xAlignment == 'center' ? 'center' : xAlignment == 'right' ? 'right' : 'left' }\"\n title=\"{{ formattedValue }}\" [type]=\"type\" [value]=\"displayValue$ | async\"\n (keyup.enter)=\"$event?.currentTarget?.blur()\" (focus)=\"onFocus($event);\" (blur)=\"onBlur($event)\"\n (change)=\"onChange($event)\" (keyup)=\"onKeyup($event)\"\n [ngClass]=\"{'disable-hidden': disabled && formattedValue?.length > 0 && (type === 'phone' || type === 'email' || type === 'link')}\" />\n<!-- [attr.inputmode]=\"inputMode\" -->\n <span\n *ngIf=\"disabled && formattedValue?.length > 0 && (type === 'phone' || type === 'email' || type === 'link')\"\n class=\"dis-grid\">\n <a href=\"javascript:void(0)\" (click)=\"anchorClicked()\" [id]=\"key\" [name]=\"key\"\n class=\"color-link body-sm \"> {{formattedValue}}</a>\n </span>\n <mat-error *ngIf=\"renderError\"> \n <ng-container *ngIf=\"mandatory && input.value.length == 0 then requiredError else otherErrorContainer\">\n </ng-container>\n <ng-template #requiredError>\n <span class=\"body-xs\" [title]=\"('MESSAGES.ERROR_IS_REQUIRED' | translate: { field: label })\"\n [innerText]=\"('MESSAGES.ERROR_IS_REQUIRED' | translate: { field: label })\">\n </span>\n </ng-template>\n <ng-template #otherErrorContainer>\n <ng-template *ngIf=\"regex && form?.get(key)?.errors?.pattern then patternError else otherError\"></ng-template>\n <ng-template #patternError>\n <span class=\"body-xs\">\n {{ regexError }}\n </span>\n </ng-template>\n <ng-template #otherError>\n <span class=\"body-xs\" [title]=\"(input.value | pepToNumber) > this.maxValue || (input.value | pepToNumber) < this.minValue ?\n ('MESSAGES.ERROR_RANGE_IS_NOT_VALID' | translate: { min: minValue, max: maxValue }) :\n ('MESSAGES.ERROR_IS_NOT_VALID' | translate: { field: label })\" [innerText]=\"(input.value | pepToNumber) > this.maxValue || (input.value | pepToNumber) < this.minValue ?\n ('MESSAGES.ERROR_RANGE_IS_NOT_VALID' | translate: { min: minValue, max: maxValue }) :\n ('MESSAGES.ERROR_IS_NOT_VALID' | translate: { field: label })\">\n </span>\n </ng-template>\n </ng-template>\n </mat-error> \n <pep-textbox-icon *ngIf=\"renderSymbol && isFormView && xAlignment == 'right'\" matPrefix [value]=\"value\"\n [label]=\"label\" [type]=\"type\" [disabled]=\"disabled\">\n </pep-textbox-icon>\n <pep-textbox-icon *ngIf=\"renderSymbol && isFormView && (xAlignment == 'left')\" matSuffix [value]=\"value\"\n [label]=\"label\" [type]=\"type\" [disabled]=\"disabled\">\n </pep-textbox-icon>\n </mat-form-field>\n </ng-template> \n <ng-container *ngIf=\"layoutType === 'form'\">\n <ng-container *ngIf=\"parentFieldKey; then groupedBlock; else regularBlock\"></ng-container>\n <ng-template #regularBlock>\n <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: true, hasParent: false }\">\n </ng-container>\n </ng-template>\n <ng-template #groupedBlock>\n <ng-container [formGroupName]=\"parentFieldKey\">\n <mat-form-field appearance=\"outline\">\n <!-- (click)=\"$event.target.select()\" -->\n <input pepTextboxValidation [id]=\"key\" [name]=\"key\" class=\" body-sm \" matInput autocomplete=\"off\" \n [placeholder]=\"!disabled ? placeholder : ''\" title=\"{{ formattedValue }}\"\n [formControlName]=\"key\" [value]=\"value\" \n (blur)=\"onBlur($event)\" (change)=\"onChange($event)\" (keyup)=\"onKeyup($event)\"\n (keyup.enter)=\"$event?.currentTarget?.blur()\" (focus)=\"onFocus($event)\" />\n </mat-form-field>\n <!-- <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: true, hasParent: true }\"></ng-container> -->\n </ng-container>\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"layoutType === 'card'\">\n <ng-container *ngIf=\"isInEditMode; then editBlock; else readOnlyBlock\"></ng-container>\n <ng-template #editBlock>\n <div [ngClass]=\"{'one-row': rowSpan === 1}\">\n <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: false, hasParent: false }\">\n </ng-container>\n </div>\n </ng-template>\n <ng-template #readOnlyBlock>\n <div class=\"pep-card-input card-flex-container\" [ngStyle]=\"{ color: textColor }\"\n [class]=\"'text-align-' + xAlignment\" [ngClass]=\"{'one-row': rowSpan === 1,\n 'multi-rows': rowSpan > 1,\n 'pep-button weak': isActive && !disabled}\"\n (click)=\"!disabled ? cardTemplateClicked($event) : ''\">\n <span *ngIf=\"showTitle && label != ''\" class=\"body-xs title\" title=\"{{ label }}\">{{ label\n }}&nbsp;</span>\n <span [id]=\"key\" title=\"{{ formattedValue }}\" class=\"body-sm value\"\n [ngClass]=\"{'multi-rows-text': rowSpan > 1}\" [ngStyle]=\"{ '-webkit-line-clamp': rowSpan }\">{{\n formattedValue }}</span>\n <button *ngIf=\"isActive && !disabled\" class=\"pep-button weak card-edit-button\" mat-button>\n <mat-icon>\n <pep-icon name=\"system_edit\">\n </pep-icon>\n </mat-icon>\n </button>\n </div>\n </ng-template>\n\n </ng-container>\n\n <ng-container *ngIf=\"layoutType === 'table'\">\n <ng-container *ngIf=\"isActive && !disabled; then selectedBlock; else notSelectedBlock\"></ng-container>\n <ng-template #selectedBlock>\n <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: false, hasParent: false }\">\n </ng-container>\n </ng-template>\n <ng-template #notSelectedBlock>\n <ng-container *ngIf=\"formattedValue?.length > 0; then notEmptyBlock; else emptyBlock\"></ng-container>\n <ng-template #notEmptyBlock>\n <ng-container [ngSwitch]=\"type\">\n <ng-container *ngSwitchCase=\"'link'\">\n <a [id]=\"key\" class=\"color-link body-sm pep-report-input\"\n [ngClass]=\"{'disable': (disabled && value === '')}\" *ngIf=\"formattedValue != null\"\n title=\"{{ formattedValue }}\" target=\"_blank\" href=\"{{ value ? value : formattedValue }}\">{{\n formattedValue }}</a>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <span [id]=\"key\" class=\"body-sm pep-report-input\" [ngClass]=\"{'readonly': disabled}\"\n title=\"{{ formattedValue }}\" [ngStyle]=\"{ color: textColor }\">{{ formattedValue }}</span>\n </ng-container>\n </ng-container>\n </ng-template>\n <ng-template #emptyBlock>\n <span [id]=\"key\">&nbsp;</span>\n </ng-template>\n </ng-template>\n </ng-container>\n\n</ng-container>", styles: [":host{height:inherit;display:grid}:host>*{align-self:center;align-items:baseline}.disable-hidden{display:none}.dis-grid{display:grid}.multi-rows-text{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal!important}\n", ""], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", 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]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i4.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "component", type: i5.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: "directive", type: i6.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i6.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i1$1.PepIconComponent, selector: "pep-icon", inputs: ["spin", "name", "fill"] }, { kind: "component", type: i10.PepFieldTitleComponent, selector: "pep-field-title", inputs: ["label", "mandatory", "disabled", "maxFieldCharacters", "hint", "xAlignment", "showTitle", "inputLength", "fontBodyType"] }, { kind: "component", type: i11.PepTextboxIconComponent, selector: "pep-textbox-icon", inputs: ["value", "label", "type", "disabled"], outputs: ["iconClick"] }, { kind: "directive", type: PepTextboxValidationDirective, selector: "[pepTextboxValidation]", inputs: ["type"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.PepToNumberPipe, name: "pepToNumber" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
505
602
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepTextboxComponent, decorators: [{
506
603
  type: Component,
507
- args: [{ selector: 'pep-textbox', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [formGroup]=\"form\">\n <ng-template #pepTemplate let-isFormView=\"isFormView\" let-hasParent=\"hasParent\">\n <pep-field-title *ngIf=\"renderTitle && isFormView && !hasParent\" [label]=\"label\" [mandatory]=\"mandatory\"\n [disabled]=\"disabled\" [maxFieldCharacters]=\"maxFieldCharacters\" [hint]=\"hint\" [xAlignment]=\"xAlignment\"\n [showTitle]=\"showTitle\" [inputLength]=\"input.value?.length\">\n </pep-field-title>\n <mat-form-field appearance=\"outline\">\n <input #input matInput pepTextboxValidation [formControlName]=\"key\" [errorStateMatcher]=\"matcher\" [id]=\"key\"\n [name]=\"key\" class=\" body-sm \" autocomplete=\"off\"\n maxlength=\"{{ maxFieldCharacters > 0 ? maxFieldCharacters : 99999 }}\"\n [placeholder]=\"hasParent && !disabled ? placeholder : ''\"\n [ngStyle]=\"{ color: textColor, 'text-align': xAlignment == 'center' ? 'center' : xAlignment == 'right' ? 'right' : 'left' }\"\n title=\"{{ formattedValue }}\" [type]=\"type\" [value]=\"displayValue\"\n (keyup.enter)=\"$event?.currentTarget?.blur()\" (focus)=\"onFocus($event)\" (blur)=\"onBlur($event)\"\n (change)=\"onChange($event)\"\n [ngClass]=\"{'disable-hidden': disabled && formattedValue?.length > 0 && (type === 'phone' || type === 'email' || type === 'link')}\" />\n\n <span\n *ngIf=\"disabled && formattedValue?.length > 0 && (type === 'phone' || type === 'email' || type === 'link')\"\n class=\"dis-grid\">\n <a href=\"javascript:void(0)\" (click)=\"anchorClicked()\" [id]=\"key\" [name]=\"key\"\n class=\"color-link body-sm \"> {{formattedValue}}</a>\n </span>\n <mat-error *ngIf=\"renderError\"> \n <ng-container *ngIf=\"mandatory && input.value.length == 0 then requiredError else otherErrorContainer\">\n </ng-container>\n <ng-template #requiredError>\n <span class=\"body-xs\" [title]=\"('MESSAGES.ERROR_IS_REQUIRED' | translate: { field: label })\"\n [innerText]=\"('MESSAGES.ERROR_IS_REQUIRED' | translate: { field: label })\">\n </span>\n </ng-template>\n <ng-template #otherErrorContainer>\n <ng-template *ngIf=\"form.get(key).errors?.pattern then patternError else otherError\"></ng-template>\n <ng-template #patternError>\n <span class=\"body-xs\">\n {{ regexError }}\n </span>\n </ng-template>\n <ng-template #otherError>\n <span class=\"body-xs\" [title]=\"(input.value | pepToNumber) > this.maxValue || (input.value | pepToNumber) < this.minValue ?\n ('MESSAGES.ERROR_RANGE_IS_NOT_VALID' | translate: { min: minValue, max: maxValue }) :\n ('MESSAGES.ERROR_IS_NOT_VALID' | translate: { field: label })\" [innerText]=\"(input.value | pepToNumber) > this.maxValue || (input.value | pepToNumber) < this.minValue ?\n ('MESSAGES.ERROR_RANGE_IS_NOT_VALID' | translate: { min: minValue, max: maxValue }) :\n ('MESSAGES.ERROR_IS_NOT_VALID' | translate: { field: label })\">\n </span>\n </ng-template>\n </ng-template>\n </mat-error> \n <pep-textbox-icon *ngIf=\"renderSymbol && isFormView && xAlignment == 'right'\" matPrefix [value]=\"value\"\n [label]=\"label\" [type]=\"type\" [disabled]=\"disabled\">\n </pep-textbox-icon>\n <pep-textbox-icon *ngIf=\"renderSymbol && isFormView && (xAlignment == 'left')\" matSuffix [value]=\"value\"\n [label]=\"label\" [type]=\"type\" [disabled]=\"disabled\">\n </pep-textbox-icon>\n </mat-form-field>\n </ng-template> \n <ng-container *ngIf=\"layoutType === 'form'\">\n <ng-container *ngIf=\"parentFieldKey; then groupedBlock; else regularBlock\"></ng-container>\n <ng-template #regularBlock>\n <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: true, hasParent: false }\">\n </ng-container>\n </ng-template>\n <ng-template #groupedBlock>\n <ng-container [formGroupName]=\"parentFieldKey\">\n <mat-form-field appearance=\"outline\">\n <!-- (keyup)=\"onKeyUp($event)\" -->\n <input pepTextboxValidation [id]=\"key\" [name]=\"key\" class=\" body-sm \" matInput autocomplete=\"off\"\n [placeholder]=\"!disabled ? placeholder : ''\" title=\"{{ formattedValue }}\"\n [formControlName]=\"key\" [value]=\"value\" (blur)=\"onBlur($event)\" (change)=\"onChange($event)\"\n (keyup.enter)=\"$event?.currentTarget?.blur()\" (focus)=\"onFocus($event)\" />\n </mat-form-field>\n <!-- <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: true, hasParent: true }\"></ng-container> -->\n </ng-container>\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"layoutType === 'card'\">\n <ng-container *ngIf=\"isInEditMode; then editBlock; else readOnlyBlock\"></ng-container>\n <ng-template #editBlock>\n <div [ngClass]=\"{'one-row': rowSpan === 1}\">\n <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: false, hasParent: false }\">\n </ng-container>\n </div>\n </ng-template>\n <ng-template #readOnlyBlock>\n <div class=\"pep-card-input card-flex-container\" [ngStyle]=\"{ color: textColor }\"\n [class]=\"'text-align-' + xAlignment\" [ngClass]=\"{'one-row': rowSpan === 1,\n 'multi-rows': rowSpan > 1,\n 'pep-button weak': isActive && !disabled}\"\n (click)=\"!disabled ? cardTemplateClicked($event) : ''\">\n <span *ngIf=\"showTitle && label != ''\" class=\"body-xs title\" title=\"{{ label }}\">{{ label\n }}&nbsp;</span>\n <span [id]=\"key\" title=\"{{ formattedValue }}\" class=\"body-sm value\"\n [ngClass]=\"{'multi-rows-text': rowSpan > 1}\" [ngStyle]=\"{ '-webkit-line-clamp': rowSpan }\">{{\n formattedValue }}</span>\n <button *ngIf=\"isActive && !disabled\" class=\"pep-button weak card-edit-button\" mat-button>\n <mat-icon>\n <pep-icon name=\"system_edit\">\n </pep-icon>\n </mat-icon>\n </button>\n </div>\n </ng-template>\n\n </ng-container>\n\n <ng-container *ngIf=\"layoutType === 'table'\">\n <ng-container *ngIf=\"isActive && !disabled; then selectedBlock; else notSelectedBlock\"></ng-container>\n <ng-template #selectedBlock>\n <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: false, hasParent: false }\">\n </ng-container>\n </ng-template>\n <ng-template #notSelectedBlock>\n <ng-container *ngIf=\"formattedValue?.length > 0; then notEmptyBlock; else emptyBlock\"></ng-container>\n <ng-template #notEmptyBlock>\n <ng-container [ngSwitch]=\"type\">\n <ng-container *ngSwitchCase=\"'link'\">\n <a [id]=\"key\" class=\"color-link body-sm pep-report-input\"\n [ngClass]=\"{'disable': (disabled && value === '')}\" *ngIf=\"formattedValue != null\"\n title=\"{{ formattedValue }}\" target=\"_blank\" href=\"{{ value ? value : formattedValue }}\">{{\n formattedValue }}</a>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <span [id]=\"key\" class=\"body-sm pep-report-input\" [ngClass]=\"{'readonly': disabled}\"\n title=\"{{ formattedValue }}\" [ngStyle]=\"{ color: textColor }\">{{ formattedValue }}</span>\n </ng-container>\n </ng-container>\n </ng-template>\n <ng-template #emptyBlock>\n <span [id]=\"key\">&nbsp;</span>\n </ng-template>\n </ng-template>\n </ng-container>\n\n</ng-container>", styles: [":host{height:inherit;display:grid}:host>*{align-self:center;align-items:baseline}.disable-hidden{display:none}.dis-grid{display:grid}.multi-rows-text{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal!important}\n"] }]
604
+ args: [{ selector: 'pep-textbox', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [formGroup]=\"form\">\n <ng-template #pepTemplate let-isFormView=\"isFormView\" let-hasParent=\"hasParent\">\n <pep-field-title *ngIf=\"renderTitle && isFormView && !hasParent\" [label]=\"label\" [mandatory]=\"mandatory\"\n [disabled]=\"disabled\" [maxFieldCharacters]=\"maxFieldCharacters\" [hint]=\"hint\" [xAlignment]=\"xAlignment\"\n [showTitle]=\"showTitle\" [inputLength]=\"input.value?.length\">\n </pep-field-title>\n <mat-form-field appearance=\"outline\">\n <!-- (click)=\"$event.target.select()\" -->\n <input #input matInput pepTextboxValidation [formControlName]=\"key\" [id]=\"key\"\n [name]=\"key\" class=\" body-sm \" autocomplete=\"off\"\n maxlength=\"{{ maxFieldCharacters > 0 ? maxFieldCharacters : 99999 }}\"\n [placeholder]=\"hasParent && !disabled ? placeholder : ''\"\n [ngStyle]=\"{ color: textColor, 'text-align': xAlignment == 'center' ? 'center' : xAlignment == 'right' ? 'right' : 'left' }\"\n title=\"{{ formattedValue }}\" [type]=\"type\" [value]=\"displayValue$ | async\"\n (keyup.enter)=\"$event?.currentTarget?.blur()\" (focus)=\"onFocus($event);\" (blur)=\"onBlur($event)\"\n (change)=\"onChange($event)\" (keyup)=\"onKeyup($event)\"\n [ngClass]=\"{'disable-hidden': disabled && formattedValue?.length > 0 && (type === 'phone' || type === 'email' || type === 'link')}\" />\n<!-- [attr.inputmode]=\"inputMode\" -->\n <span\n *ngIf=\"disabled && formattedValue?.length > 0 && (type === 'phone' || type === 'email' || type === 'link')\"\n class=\"dis-grid\">\n <a href=\"javascript:void(0)\" (click)=\"anchorClicked()\" [id]=\"key\" [name]=\"key\"\n class=\"color-link body-sm \"> {{formattedValue}}</a>\n </span>\n <mat-error *ngIf=\"renderError\"> \n <ng-container *ngIf=\"mandatory && input.value.length == 0 then requiredError else otherErrorContainer\">\n </ng-container>\n <ng-template #requiredError>\n <span class=\"body-xs\" [title]=\"('MESSAGES.ERROR_IS_REQUIRED' | translate: { field: label })\"\n [innerText]=\"('MESSAGES.ERROR_IS_REQUIRED' | translate: { field: label })\">\n </span>\n </ng-template>\n <ng-template #otherErrorContainer>\n <ng-template *ngIf=\"regex && form?.get(key)?.errors?.pattern then patternError else otherError\"></ng-template>\n <ng-template #patternError>\n <span class=\"body-xs\">\n {{ regexError }}\n </span>\n </ng-template>\n <ng-template #otherError>\n <span class=\"body-xs\" [title]=\"(input.value | pepToNumber) > this.maxValue || (input.value | pepToNumber) < this.minValue ?\n ('MESSAGES.ERROR_RANGE_IS_NOT_VALID' | translate: { min: minValue, max: maxValue }) :\n ('MESSAGES.ERROR_IS_NOT_VALID' | translate: { field: label })\" [innerText]=\"(input.value | pepToNumber) > this.maxValue || (input.value | pepToNumber) < this.minValue ?\n ('MESSAGES.ERROR_RANGE_IS_NOT_VALID' | translate: { min: minValue, max: maxValue }) :\n ('MESSAGES.ERROR_IS_NOT_VALID' | translate: { field: label })\">\n </span>\n </ng-template>\n </ng-template>\n </mat-error> \n <pep-textbox-icon *ngIf=\"renderSymbol && isFormView && xAlignment == 'right'\" matPrefix [value]=\"value\"\n [label]=\"label\" [type]=\"type\" [disabled]=\"disabled\">\n </pep-textbox-icon>\n <pep-textbox-icon *ngIf=\"renderSymbol && isFormView && (xAlignment == 'left')\" matSuffix [value]=\"value\"\n [label]=\"label\" [type]=\"type\" [disabled]=\"disabled\">\n </pep-textbox-icon>\n </mat-form-field>\n </ng-template> \n <ng-container *ngIf=\"layoutType === 'form'\">\n <ng-container *ngIf=\"parentFieldKey; then groupedBlock; else regularBlock\"></ng-container>\n <ng-template #regularBlock>\n <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: true, hasParent: false }\">\n </ng-container>\n </ng-template>\n <ng-template #groupedBlock>\n <ng-container [formGroupName]=\"parentFieldKey\">\n <mat-form-field appearance=\"outline\">\n <!-- (click)=\"$event.target.select()\" -->\n <input pepTextboxValidation [id]=\"key\" [name]=\"key\" class=\" body-sm \" matInput autocomplete=\"off\" \n [placeholder]=\"!disabled ? placeholder : ''\" title=\"{{ formattedValue }}\"\n [formControlName]=\"key\" [value]=\"value\" \n (blur)=\"onBlur($event)\" (change)=\"onChange($event)\" (keyup)=\"onKeyup($event)\"\n (keyup.enter)=\"$event?.currentTarget?.blur()\" (focus)=\"onFocus($event)\" />\n </mat-form-field>\n <!-- <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: true, hasParent: true }\"></ng-container> -->\n </ng-container>\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"layoutType === 'card'\">\n <ng-container *ngIf=\"isInEditMode; then editBlock; else readOnlyBlock\"></ng-container>\n <ng-template #editBlock>\n <div [ngClass]=\"{'one-row': rowSpan === 1}\">\n <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: false, hasParent: false }\">\n </ng-container>\n </div>\n </ng-template>\n <ng-template #readOnlyBlock>\n <div class=\"pep-card-input card-flex-container\" [ngStyle]=\"{ color: textColor }\"\n [class]=\"'text-align-' + xAlignment\" [ngClass]=\"{'one-row': rowSpan === 1,\n 'multi-rows': rowSpan > 1,\n 'pep-button weak': isActive && !disabled}\"\n (click)=\"!disabled ? cardTemplateClicked($event) : ''\">\n <span *ngIf=\"showTitle && label != ''\" class=\"body-xs title\" title=\"{{ label }}\">{{ label\n }}&nbsp;</span>\n <span [id]=\"key\" title=\"{{ formattedValue }}\" class=\"body-sm value\"\n [ngClass]=\"{'multi-rows-text': rowSpan > 1}\" [ngStyle]=\"{ '-webkit-line-clamp': rowSpan }\">{{\n formattedValue }}</span>\n <button *ngIf=\"isActive && !disabled\" class=\"pep-button weak card-edit-button\" mat-button>\n <mat-icon>\n <pep-icon name=\"system_edit\">\n </pep-icon>\n </mat-icon>\n </button>\n </div>\n </ng-template>\n\n </ng-container>\n\n <ng-container *ngIf=\"layoutType === 'table'\">\n <ng-container *ngIf=\"isActive && !disabled; then selectedBlock; else notSelectedBlock\"></ng-container>\n <ng-template #selectedBlock>\n <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: false, hasParent: false }\">\n </ng-container>\n </ng-template>\n <ng-template #notSelectedBlock>\n <ng-container *ngIf=\"formattedValue?.length > 0; then notEmptyBlock; else emptyBlock\"></ng-container>\n <ng-template #notEmptyBlock>\n <ng-container [ngSwitch]=\"type\">\n <ng-container *ngSwitchCase=\"'link'\">\n <a [id]=\"key\" class=\"color-link body-sm pep-report-input\"\n [ngClass]=\"{'disable': (disabled && value === '')}\" *ngIf=\"formattedValue != null\"\n title=\"{{ formattedValue }}\" target=\"_blank\" href=\"{{ value ? value : formattedValue }}\">{{\n formattedValue }}</a>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <span [id]=\"key\" class=\"body-sm pep-report-input\" [ngClass]=\"{'readonly': disabled}\"\n title=\"{{ formattedValue }}\" [ngStyle]=\"{ color: textColor }\">{{ formattedValue }}</span>\n </ng-container>\n </ng-container>\n </ng-template>\n <ng-template #emptyBlock>\n <span [id]=\"key\">&nbsp;</span>\n </ng-template>\n </ng-template>\n </ng-container>\n\n</ng-container>", styles: [":host{height:inherit;display:grid}:host>*{align-self:center;align-items:baseline}.disable-hidden{display:none}.dis-grid{display:grid}.multi-rows-text{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal!important}\n"] }]
508
605
  }], ctorParameters: function () { return [{ type: i1.PepCustomizationService }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i2.TranslateService }, { type: i1.PepUtilitiesService }]; }, propDecorators: { dataQa: [{
509
606
  type: HostBinding,
510
607
  args: ['attr.data-qa']
@@ -512,8 +609,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImpor
512
609
  type: Input
513
610
  }], value: [{
514
611
  type: Input
515
- }], formattedValue: [{
516
- type: Input
517
612
  }], minFractionDigits: [{
518
613
  type: Input
519
614
  }], maxFractionDigits: [{
@@ -570,11 +665,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImpor
570
665
  type: Input
571
666
  }], valueChange: [{
572
667
  type: Output
573
- }], formValidationChange: [{
668
+ }], keyup: [{
574
669
  type: Output
575
670
  }], input: [{
576
671
  type: ViewChild,
577
672
  args: ['input']
673
+ }], isInFocus: [{
674
+ type: Input
578
675
  }] } });
579
676
 
580
677
  class PepTextboxModule {
@@ -641,5 +738,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImpor
641
738
  * Generated bundle index. Do not edit.
642
739
  */
643
740
 
644
- export { PepTextboxComponent, PepTextboxModule, TextErrorStateMatcher };
741
+ export { PepTextboxComponent, PepTextboxModule };
645
742
  //# sourceMappingURL=pepperi-addons-ngx-lib-textbox.mjs.map