@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,13 +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
- const validateOnDirty = form?.form?.controls?.['validateOnDirty']?.value;
116
- return !!(validateOnDirty && control && control.invalid && (control.dirty || control.touched));
117
- }
118
- }
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
+ // }
119
126
  /**
120
127
  * This is a text box input component that can be use to
121
128
  *
@@ -135,7 +142,27 @@ class PepTextboxComponent {
135
142
  this.dataQa = '';
136
143
  this._key = '';
137
144
  this._value = '';
138
- 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
+ // }
139
166
  this._minFractionDigits = NaN;
140
167
  this._maxFractionDigits = NaN;
141
168
  /**
@@ -163,12 +190,13 @@ class PepTextboxComponent {
163
190
  * @memberof PepTextboxComponent
164
191
  */
165
192
  this._type = 'text';
193
+ this.inputMode = 'text';
166
194
  /**
167
195
  * If the textbox is mandatory
168
196
  *
169
197
  * @memberof PepTextboxComponent
170
198
  */
171
- this.mandatory = false;
199
+ this._mandatory = false;
172
200
  // TODO: Check if should remove disabled and keep only readonly.
173
201
  /**
174
202
  * If the textbox is disabled.
@@ -197,6 +225,7 @@ class PepTextboxComponent {
197
225
  this.renderSymbol = true;
198
226
  this.layoutType = 'form';
199
227
  this.parentFieldKey = null;
228
+ this.regex = null;
200
229
  this.regexError = '';
201
230
  /**
202
231
  * The value change event.
@@ -205,12 +234,17 @@ class PepTextboxComponent {
205
234
  * @memberof PepTextboxComponent
206
235
  */
207
236
  this.valueChange = new EventEmitter();
208
- this.formValidationChange = new EventEmitter();
237
+ // @Output()
238
+ // formValidationChange: EventEmitter<boolean> = new EventEmitter<boolean>();
239
+ this.keyup = new EventEmitter();
209
240
  this._calculateFormattedValue = true;
210
241
  this.controlType = 'textbox';
211
242
  this.standAlone = false;
212
243
  this.isInEditMode = false;
213
- this.matcher = new TextErrorStateMatcher();
244
+ this._isInFocus = false;
245
+ // matcher = new TextErrorStateMatcher();
246
+ // protected displayValue$:
247
+ this._displayValueSubject = new BehaviorSubject('');
214
248
  this.isInFocus = false;
215
249
  }
216
250
  /**
@@ -234,33 +268,28 @@ class PepTextboxComponent {
234
268
  if (!value) {
235
269
  value = '';
236
270
  }
237
- this._value = value;
238
- 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();
239
277
  }
240
278
  get value() {
241
279
  return this._value;
242
280
  }
243
- /**
244
- * The formatted value.
245
- *
246
- * @memberof PepTextboxComponent
247
- */
248
- set formattedValue(value) {
249
- // Do nothing.
250
- // if (!value) {
251
- // 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);
252
286
  // }
253
- // if (this._calculateFormattedValue) {
254
- // this._calculateFormattedValue = false;
255
- // }
256
- // this.setFormattedValue(value);
257
- }
258
- get formattedValue() {
259
- return this._formattedValue;
287
+ // return res;
260
288
  }
261
289
  set minFractionDigits(value) {
262
290
  this._minFractionDigits = value;
263
291
  this.setFormattedValue(this.value);
292
+ this.changeDisplayValue();
264
293
  }
265
294
  get minFractionDigits() {
266
295
  return this._minFractionDigits;
@@ -268,6 +297,7 @@ class PepTextboxComponent {
268
297
  set maxFractionDigits(value) {
269
298
  this._maxFractionDigits = value;
270
299
  this.setFormattedValue(this.value);
300
+ this.changeDisplayValue();
271
301
  }
272
302
  get maxFractionDigits() {
273
303
  return this._maxFractionDigits;
@@ -276,11 +306,19 @@ class PepTextboxComponent {
276
306
  this._type = value;
277
307
  if (this.value) {
278
308
  this.setFormattedValue(this.value);
309
+ this.changeDisplayValue();
310
+ this.setInputModeAttribute();
279
311
  }
280
312
  }
281
313
  get type() {
282
314
  return this._type;
283
315
  }
316
+ set mandatory(value) {
317
+ this._mandatory = value;
318
+ }
319
+ get mandatory() {
320
+ return this._mandatory;
321
+ }
284
322
  set visible(visible) {
285
323
  this._visible = visible;
286
324
  if (visible) {
@@ -296,52 +334,97 @@ class PepTextboxComponent {
296
334
  get calculateFormattedValue() {
297
335
  return this._calculateFormattedValue;
298
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
+ }
299
371
  setFormattedValue(value) {
372
+ if (this.isInFocus) {
373
+ return;
374
+ }
300
375
  if (this._calculateFormattedValue) {
376
+ // console.log(`setFormattedValue before - value is ${value}`);
301
377
  if (this.type === 'currency') {
302
- 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);
303
379
  }
304
380
  else if (this.type === 'percentage') {
305
- this._formattedValue = this.utilitiesService.formatPercent(value, this.minFractionDigits, this.maxFractionDigits);
381
+ this.formattedValue = this.utilitiesService.formatPercent(value, this.minFractionDigits, this.maxFractionDigits);
306
382
  }
307
383
  else if (this.type === 'real') {
308
- this._formattedValue = this.utilitiesService.formatDecimal(value, this.minFractionDigits, this.maxFractionDigits);
384
+ this.formattedValue = this.utilitiesService.formatDecimal(value, this.minFractionDigits, this.maxFractionDigits);
309
385
  }
310
386
  else if (this.type === 'int') {
311
- this._formattedValue = this.utilitiesService.formatNumber(value);
387
+ this.formattedValue = this.utilitiesService.formatNumber(value);
312
388
  }
313
389
  else if (this.type === 'duration') {
314
- this._formattedValue = this.utilitiesService.formatDuration(value, { duration: 'seconds' });
390
+ this.formattedValue = this.utilitiesService.formatDuration(value, { duration: 'seconds' });
315
391
  }
316
392
  else {
317
- this._formattedValue = value;
393
+ this.formattedValue = value;
318
394
  }
319
395
  }
320
396
  else {
321
- this._formattedValue = value;
397
+ this.formattedValue = value;
322
398
  }
399
+ // console.log(`setFormattedValue after - value is ${this.formattedValue}`);
323
400
  this.updateFormFieldValue();
324
401
  }
325
- updateFormFieldValue() {
326
- 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);
327
406
  }
328
- get displayValue() {
407
+ changeDisplayValue() {
329
408
  let res = '';
330
409
  if (this.type == 'link') {
331
410
  res = this.formattedValue;
332
411
  }
412
+ else if (this.isDecimal()) {
413
+ res = this.isInFocus ? this.valueAsCurrentCulture : this.formattedValue;
414
+ }
333
415
  else if (this.isNumberType()) {
334
- 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;
335
417
  }
336
418
  else {
337
419
  res = this.isInFocus ? this.value : this.formattedValue;
338
420
  }
339
- return res;
421
+ this.notifyDisplayValueChange(res);
422
+ // console.log('changeDisplayValue ' + res);
340
423
  }
341
424
  setDefaultForm() {
342
425
  const pepField = new PepTextboxField({
343
426
  key: this.key,
344
- value: this.value,
427
+ value: this.valueAsCurrentCulture,
345
428
  mandatory: this.mandatory,
346
429
  readonly: this.readonly,
347
430
  disabled: this.disabled,
@@ -370,14 +453,17 @@ class PepTextboxComponent {
370
453
  this.renderer.addClass(this.element.nativeElement, PepCustomizationService.STAND_ALONE_FIELD_NO_SPACING_CLASS_NAME);
371
454
  }
372
455
  }
373
- //flag to indicate whether validation on dirty is required
374
- 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'));
375
458
  this.readonly = this.type === 'duration' ? true : this.readonly; // Hack until we develop Timer UI for editing Duration field
376
- //load default error text
377
- 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)) {
378
461
  this.translate.get('MESSAGES.ERROR_INVALID_PATTERN').subscribe(text => this.regexError = text);
379
462
  }
380
- this.updateFormFieldValue();
463
+ this.updateFormFieldValue(true);
464
+ }
465
+ ngAfterViewInit() {
466
+ this.setInputModeAttribute();
381
467
  }
382
468
  ngOnChanges(changes) {
383
469
  if (this.standAlone) {
@@ -392,9 +478,11 @@ class PepTextboxComponent {
392
478
  this.isInFocus = true;
393
479
  // select the value in focus (DI-18246 improvement)
394
480
  setTimeout(() => {
395
- const eventTarget = event.target || event.srcElement;
396
- if (eventTarget) {
397
- eventTarget.select();
481
+ if (this.isInFocus) {
482
+ const eventTarget = event.target || event.srcElement;
483
+ if (eventTarget) {
484
+ eventTarget.select();
485
+ }
398
486
  }
399
487
  }, 0);
400
488
  }
@@ -420,10 +508,20 @@ class PepTextboxComponent {
420
508
  res = this.mandatory ? false : true;
421
509
  }
422
510
  else {
423
- const numberValue = this.utilitiesService.coerceNumberProperty(value);
424
- res =
425
- numberValue >= this.minValue &&
426
- 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
+ }
427
525
  }
428
526
  }
429
527
  else {
@@ -435,13 +533,11 @@ class PepTextboxComponent {
435
533
  isDifferentValue(value) {
436
534
  let res = false;
437
535
  if (this.isNumberType()) {
438
- if (this.value === '' || value === '') {
536
+ if ((this.value === '' || value === '')) {
439
537
  res = true;
440
538
  }
441
539
  else {
442
- const currentValue = this.utilitiesService.coerceNumberProperty(this.value);
443
- const newValue = this.utilitiesService.coerceNumberProperty(value);
444
- res = currentValue !== newValue;
540
+ res = this.utilitiesService.isEqualNumber(this.valueAsCurrentCulture, value) === false;
445
541
  }
446
542
  }
447
543
  else {
@@ -451,28 +547,30 @@ class PepTextboxComponent {
451
547
  }
452
548
  onChange(e) {
453
549
  const value = e.target ? e.target.value : e;
550
+ // console.log(`onChange value is ${value}`);
454
551
  this.valueChange.emit(value);
455
552
  }
553
+ onKeyup(event) {
554
+ this.keyup.emit(event);
555
+ }
456
556
  onBlur(e) {
457
- this.isInFocus = false;
458
557
  const value = e.target ? e.target.value : e;
459
- if (value !== this.value && this.isDifferentValue(value)) {
460
- // If renderError is false and the new value is not valid.
461
- if (!this.renderError && !this.isValueValid(value)) {
462
- this.renderer.setProperty(this.input.nativeElement, 'value', this.value);
463
- }
464
- else {
465
- this.value = value;
466
- // // If the user is setting the formatted value then set the value till the user format it and return it back.
467
- // if (!this._calculateFormattedValue) {
468
- // this._formattedValue = value;
469
- // }
470
- 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);
471
568
  }
472
569
  }
473
570
  if (this.isInEditMode) {
474
571
  this.isInEditMode = false;
475
572
  }
573
+ this.isInFocus = false;
476
574
  }
477
575
  anchorClicked() {
478
576
  const currentValue = this.value;
@@ -500,10 +598,10 @@ class PepTextboxComponent {
500
598
  }
501
599
  }
502
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 });
503
- 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 });
504
602
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepTextboxComponent, decorators: [{
505
603
  type: Component,
506
- 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"] }]
507
605
  }], ctorParameters: function () { return [{ type: i1.PepCustomizationService }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i2.TranslateService }, { type: i1.PepUtilitiesService }]; }, propDecorators: { dataQa: [{
508
606
  type: HostBinding,
509
607
  args: ['attr.data-qa']
@@ -511,8 +609,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImpor
511
609
  type: Input
512
610
  }], value: [{
513
611
  type: Input
514
- }], formattedValue: [{
515
- type: Input
516
612
  }], minFractionDigits: [{
517
613
  type: Input
518
614
  }], maxFractionDigits: [{
@@ -569,11 +665,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImpor
569
665
  type: Input
570
666
  }], valueChange: [{
571
667
  type: Output
572
- }], formValidationChange: [{
668
+ }], keyup: [{
573
669
  type: Output
574
670
  }], input: [{
575
671
  type: ViewChild,
576
672
  args: ['input']
673
+ }], isInFocus: [{
674
+ type: Input
577
675
  }] } });
578
676
 
579
677
  class PepTextboxModule {
@@ -640,5 +738,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImpor
640
738
  * Generated bundle index. Do not edit.
641
739
  */
642
740
 
643
- export { PepTextboxComponent, PepTextboxModule, TextErrorStateMatcher };
741
+ export { PepTextboxComponent, PepTextboxModule };
644
742
  //# sourceMappingURL=pepperi-addons-ngx-lib-textbox.mjs.map