@testgorilla/tgo-ui 8.19.1 → 9.0.0

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 (205) hide show
  1. package/components/accordion/index.d.ts +7 -7
  2. package/components/ai-audio-circle/index.d.ts +3 -3
  3. package/components/ai-caveat/index.d.ts +5 -5
  4. package/components/ai-feedback/index.d.ts +14 -14
  5. package/components/alert-banner/index.d.ts +8 -8
  6. package/components/autocomplete/index.d.ts +15 -16
  7. package/components/autocomplete-v2/index.d.ts +36 -32
  8. package/components/avatar/index.d.ts +7 -7
  9. package/components/badge/index.d.ts +6 -6
  10. package/components/breadcrumb/index.d.ts +11 -11
  11. package/components/button/index.d.ts +23 -13
  12. package/components/card/index.d.ts +4 -4
  13. package/components/checkbox/index.d.ts +24 -24
  14. package/components/core/index.d.ts +39 -31
  15. package/components/datepicker/index.d.ts +18 -18
  16. package/components/dialog/index.d.ts +29 -21
  17. package/components/divider/index.d.ts +4 -4
  18. package/components/donut-chart/index.d.ts +3 -3
  19. package/components/dropdown/index.d.ts +37 -33
  20. package/components/elevation-shadow/index.d.ts +3 -3
  21. package/components/empty-state/index.d.ts +7 -7
  22. package/components/field/index.d.ts +33 -44
  23. package/components/file-upload/index.d.ts +14 -13
  24. package/components/filter-button/index.d.ts +19 -19
  25. package/components/gaussian-chart/index.d.ts +8 -8
  26. package/components/icon/index.d.ts +20 -18
  27. package/components/icon-label/index.d.ts +5 -5
  28. package/components/inline-field/index.d.ts +20 -24
  29. package/components/logo/index.d.ts +2 -3
  30. package/components/media-dialog/index.d.ts +3 -3
  31. package/components/multi-input/index.d.ts +25 -16
  32. package/components/navbar/index.d.ts +30 -30
  33. package/components/overflow-menu/index.d.ts +20 -19
  34. package/components/page-header/index.d.ts +5 -5
  35. package/components/paginator/index.d.ts +4 -4
  36. package/components/password-criteria/index.d.ts +13 -12
  37. package/components/password-strength/index.d.ts +6 -6
  38. package/components/phone-input/index.d.ts +28 -30
  39. package/components/progress-bar/index.d.ts +5 -5
  40. package/components/prompt/index.d.ts +25 -25
  41. package/components/radial-progress/index.d.ts +5 -5
  42. package/components/radio-button/index.d.ts +28 -29
  43. package/components/rating/index.d.ts +5 -5
  44. package/components/scale/index.d.ts +4 -4
  45. package/components/segmented-bar/index.d.ts +8 -8
  46. package/components/segmented-button/index.d.ts +17 -16
  47. package/components/selectable-card/index.d.ts +6 -6
  48. package/components/side-navigation/index.d.ts +14 -14
  49. package/components/side-panel/index.d.ts +8 -8
  50. package/components/side-sheet/index.d.ts +19 -17
  51. package/components/snackbar/index.d.ts +16 -15
  52. package/components/spider-chart/index.d.ts +12 -12
  53. package/components/spinner/index.d.ts +5 -5
  54. package/components/stepper/index.d.ts +35 -35
  55. package/components/table/index.d.ts +36 -34
  56. package/components/tabs/index.d.ts +18 -17
  57. package/components/tag/index.d.ts +10 -10
  58. package/components/toggle/index.d.ts +10 -9
  59. package/components/tooltip/index.d.ts +16 -18
  60. package/components/universal-skills/index.d.ts +16 -16
  61. package/components/validation-error/index.d.ts +22 -10
  62. package/components/write-with-ai/index.d.ts +1 -1
  63. package/fesm2022/testgorilla-tgo-ui-components-accordion.mjs +36 -15
  64. package/fesm2022/testgorilla-tgo-ui-components-accordion.mjs.map +1 -1
  65. package/fesm2022/testgorilla-tgo-ui-components-ai-audio-circle.mjs +9 -12
  66. package/fesm2022/testgorilla-tgo-ui-components-ai-audio-circle.mjs.map +1 -1
  67. package/fesm2022/testgorilla-tgo-ui-components-ai-caveat.mjs +7 -10
  68. package/fesm2022/testgorilla-tgo-ui-components-ai-caveat.mjs.map +1 -1
  69. package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs +39 -27
  70. package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs.map +1 -1
  71. package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs +25 -14
  72. package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs.map +1 -1
  73. package/fesm2022/testgorilla-tgo-ui-components-audio-waveform.mjs +4 -2
  74. package/fesm2022/testgorilla-tgo-ui-components-audio-waveform.mjs.map +1 -1
  75. package/fesm2022/testgorilla-tgo-ui-components-autocomplete-v2.mjs +134 -117
  76. package/fesm2022/testgorilla-tgo-ui-components-autocomplete-v2.mjs.map +1 -1
  77. package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs +47 -48
  78. package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs.map +1 -1
  79. package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs +30 -18
  80. package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs.map +1 -1
  81. package/fesm2022/testgorilla-tgo-ui-components-badge.mjs +9 -12
  82. package/fesm2022/testgorilla-tgo-ui-components-badge.mjs.map +1 -1
  83. package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs +25 -18
  84. package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs.map +1 -1
  85. package/fesm2022/testgorilla-tgo-ui-components-button.mjs +155 -120
  86. package/fesm2022/testgorilla-tgo-ui-components-button.mjs.map +1 -1
  87. package/fesm2022/testgorilla-tgo-ui-components-card.mjs +7 -9
  88. package/fesm2022/testgorilla-tgo-ui-components-card.mjs.map +1 -1
  89. package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs +51 -47
  90. package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs.map +1 -1
  91. package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs +1 -1
  92. package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs.map +1 -1
  93. package/fesm2022/testgorilla-tgo-ui-components-core.mjs +2232 -2210
  94. package/fesm2022/testgorilla-tgo-ui-components-core.mjs.map +1 -1
  95. package/fesm2022/testgorilla-tgo-ui-components-datepicker.mjs +44 -25
  96. package/fesm2022/testgorilla-tgo-ui-components-datepicker.mjs.map +1 -1
  97. package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs +55 -31
  98. package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs.map +1 -1
  99. package/fesm2022/testgorilla-tgo-ui-components-divider.mjs +8 -11
  100. package/fesm2022/testgorilla-tgo-ui-components-divider.mjs.map +1 -1
  101. package/fesm2022/testgorilla-tgo-ui-components-donut-chart.mjs +8 -10
  102. package/fesm2022/testgorilla-tgo-ui-components-donut-chart.mjs.map +1 -1
  103. package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs +105 -90
  104. package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs.map +1 -1
  105. package/fesm2022/testgorilla-tgo-ui-components-elevation-shadow.mjs +5 -7
  106. package/fesm2022/testgorilla-tgo-ui-components-elevation-shadow.mjs.map +1 -1
  107. package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs +24 -13
  108. package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs.map +1 -1
  109. package/fesm2022/testgorilla-tgo-ui-components-field.mjs +65 -57
  110. package/fesm2022/testgorilla-tgo-ui-components-field.mjs.map +1 -1
  111. package/fesm2022/testgorilla-tgo-ui-components-file-upload.mjs +35 -23
  112. package/fesm2022/testgorilla-tgo-ui-components-file-upload.mjs.map +1 -1
  113. package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs +34 -27
  114. package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs.map +1 -1
  115. package/fesm2022/testgorilla-tgo-ui-components-gaussian-chart.mjs +26 -16
  116. package/fesm2022/testgorilla-tgo-ui-components-gaussian-chart.mjs.map +1 -1
  117. package/fesm2022/testgorilla-tgo-ui-components-icon-label.mjs +6 -7
  118. package/fesm2022/testgorilla-tgo-ui-components-icon-label.mjs.map +1 -1
  119. package/fesm2022/testgorilla-tgo-ui-components-icon.mjs +63 -57
  120. package/fesm2022/testgorilla-tgo-ui-components-icon.mjs.map +1 -1
  121. package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs +24 -24
  122. package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs.map +1 -1
  123. package/fesm2022/testgorilla-tgo-ui-components-logo.mjs +6 -6
  124. package/fesm2022/testgorilla-tgo-ui-components-logo.mjs.map +1 -1
  125. package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs +6 -6
  126. package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs.map +1 -1
  127. package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs +4 -4
  128. package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs.map +1 -1
  129. package/fesm2022/testgorilla-tgo-ui-components-multi-input.mjs +42 -21
  130. package/fesm2022/testgorilla-tgo-ui-components-multi-input.mjs.map +1 -1
  131. package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs +44 -32
  132. package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs.map +1 -1
  133. package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs +39 -21
  134. package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs.map +1 -1
  135. package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs +10 -14
  136. package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs.map +1 -1
  137. package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs +7 -9
  138. package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs.map +1 -1
  139. package/fesm2022/testgorilla-tgo-ui-components-password-criteria.mjs +33 -20
  140. package/fesm2022/testgorilla-tgo-ui-components-password-criteria.mjs.map +1 -1
  141. package/fesm2022/testgorilla-tgo-ui-components-password-strength.mjs +9 -12
  142. package/fesm2022/testgorilla-tgo-ui-components-password-strength.mjs.map +1 -1
  143. package/fesm2022/testgorilla-tgo-ui-components-phone-input.mjs +82 -73
  144. package/fesm2022/testgorilla-tgo-ui-components-phone-input.mjs.map +1 -1
  145. package/fesm2022/testgorilla-tgo-ui-components-popover.mjs.map +1 -1
  146. package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs +8 -11
  147. package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs.map +1 -1
  148. package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs +47 -40
  149. package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs.map +1 -1
  150. package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs +7 -10
  151. package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs.map +1 -1
  152. package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs +43 -48
  153. package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs.map +1 -1
  154. package/fesm2022/testgorilla-tgo-ui-components-rating.mjs +7 -12
  155. package/fesm2022/testgorilla-tgo-ui-components-rating.mjs.map +1 -1
  156. package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs +1 -1
  157. package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs.map +1 -1
  158. package/fesm2022/testgorilla-tgo-ui-components-scale.mjs +6 -10
  159. package/fesm2022/testgorilla-tgo-ui-components-scale.mjs.map +1 -1
  160. package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs +30 -16
  161. package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs.map +1 -1
  162. package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs +15 -14
  163. package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs.map +1 -1
  164. package/fesm2022/testgorilla-tgo-ui-components-segmented-toggle.mjs.map +1 -1
  165. package/fesm2022/testgorilla-tgo-ui-components-selectable-card.mjs +8 -11
  166. package/fesm2022/testgorilla-tgo-ui-components-selectable-card.mjs.map +1 -1
  167. package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs +27 -21
  168. package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs.map +1 -1
  169. package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs +5 -2
  170. package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs.map +1 -1
  171. package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs +34 -26
  172. package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs.map +1 -1
  173. package/fesm2022/testgorilla-tgo-ui-components-skeleton.mjs +5 -5
  174. package/fesm2022/testgorilla-tgo-ui-components-skeleton.mjs.map +1 -1
  175. package/fesm2022/testgorilla-tgo-ui-components-slider.mjs +10 -10
  176. package/fesm2022/testgorilla-tgo-ui-components-slider.mjs.map +1 -1
  177. package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs +31 -20
  178. package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs.map +1 -1
  179. package/fesm2022/testgorilla-tgo-ui-components-spider-chart.mjs +28 -23
  180. package/fesm2022/testgorilla-tgo-ui-components-spider-chart.mjs.map +1 -1
  181. package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs +9 -12
  182. package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs.map +1 -1
  183. package/fesm2022/testgorilla-tgo-ui-components-stepper.mjs +85 -79
  184. package/fesm2022/testgorilla-tgo-ui-components-stepper.mjs.map +1 -1
  185. package/fesm2022/testgorilla-tgo-ui-components-table.mjs +74 -51
  186. package/fesm2022/testgorilla-tgo-ui-components-table.mjs.map +1 -1
  187. package/fesm2022/testgorilla-tgo-ui-components-tabs.mjs +57 -25
  188. package/fesm2022/testgorilla-tgo-ui-components-tabs.mjs.map +1 -1
  189. package/fesm2022/testgorilla-tgo-ui-components-tag.mjs +16 -17
  190. package/fesm2022/testgorilla-tgo-ui-components-tag.mjs.map +1 -1
  191. package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs +25 -17
  192. package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs.map +1 -1
  193. package/fesm2022/testgorilla-tgo-ui-components-tooltip.mjs +44 -28
  194. package/fesm2022/testgorilla-tgo-ui-components-tooltip.mjs.map +1 -1
  195. package/fesm2022/testgorilla-tgo-ui-components-universal-skills.mjs +34 -27
  196. package/fesm2022/testgorilla-tgo-ui-components-universal-skills.mjs.map +1 -1
  197. package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs +30 -14
  198. package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs.map +1 -1
  199. package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs +13 -11
  200. package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs.map +1 -1
  201. package/fesm2022/testgorilla-tgo-ui.mjs +6 -8
  202. package/fesm2022/testgorilla-tgo-ui.mjs.map +1 -1
  203. package/index.d.ts +4 -4
  204. package/mcp/catalog.json +1 -1
  205. package/package.json +1 -2
@@ -1,44 +1,36 @@
1
+ import { FocusMonitor } from '@angular/cdk/a11y';
2
+ import { NgClass, NgStyle, AsyncPipe, CommonModule } from '@angular/common';
1
3
  import * as i0 from '@angular/core';
2
- import { Pipe, ElementRef, HostBinding, ViewChild, Input, Optional, Self, Inject, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
4
+ import { Pipe, inject, ChangeDetectorRef, DestroyRef, ElementRef, HostBinding, ViewChild, Input, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
5
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
3
6
  import * as i1 from '@angular/forms';
4
- import { UntypedFormControl, ReactiveFormsModule } from '@angular/forms';
7
+ import { NgControl, UntypedFormBuilder, UntypedFormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
8
  import { MAT_AUTOCOMPLETE_DEFAULT_OPTIONS } from '@angular/material/autocomplete';
6
- import * as i6 from '@angular/material/input';
9
+ import { ErrorStateMatcher } from '@angular/material/core';
10
+ import { MatFormField, MatLabel, MatPrefix, MatHint } from '@angular/material/form-field';
7
11
  import { MatInput, MatInputModule } from '@angular/material/input';
8
- import * as i5 from '@angular/material/select';
9
- import { MatSelect, MatSelectModule } from '@angular/material/select';
12
+ import { MatSelect, MatSelectTrigger, MatOption, MatSelectModule } from '@angular/material/select';
10
13
  import { parsePhoneNumber } from 'libphonenumber-js';
14
+ import { MatSelectSearchComponent, MatSelectSearchClearDirective, NgxMatSelectSearchModule } from 'ngx-mat-select-search';
11
15
  import { BehaviorSubject, Subject, combineLatest, debounceTime, take, filter, first, map, startWith, tap, delay } from 'rxjs';
12
- import { takeUntil } from 'rxjs/operators';
13
- import * as i2 from '@angular/material/core';
14
- import * as i3 from '@angular/cdk/a11y';
15
- import * as i4 from '@angular/common';
16
- import { CommonModule } from '@angular/common';
17
- import * as i7 from 'ngx-mat-select-search';
18
- import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
19
- import * as i8 from '@testgorilla/tgo-ui/components/icon';
20
- import { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';
21
- import * as i9 from '@testgorilla/tgo-ui/components/validation-error';
22
- import { ValidationErrorModule } from '@testgorilla/tgo-ui/components/validation-error';
23
- import * as i10 from '@testgorilla/tgo-ui/components/core';
24
16
  import { UiTranslatePipe, HasValidationErrorPipe } from '@testgorilla/tgo-ui/components/core';
25
- import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
17
+ import { IconComponent, IconComponentModule } from '@testgorilla/tgo-ui/components/icon';
18
+ import { ValidationErrorComponent, ValidationErrorModule } from '@testgorilla/tgo-ui/components/validation-error';
26
19
  import { MatIconModule } from '@angular/material/icon';
20
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
27
21
  import { SpinnerComponentModule } from '@testgorilla/tgo-ui/components/spinner';
28
22
 
29
23
  class JoinStringsPipe {
30
24
  transform(value, separator) {
25
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- an empty separator falls back to the default separator
31
26
  return value.filter(Boolean).join(separator ? separator : ' - ');
32
27
  }
33
28
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: JoinStringsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
34
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.25", ngImport: i0, type: JoinStringsPipe, isStandalone: false, name: "joinStrings" }); }
29
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.25", ngImport: i0, type: JoinStringsPipe, isStandalone: true, name: "joinStrings" }); }
35
30
  }
36
31
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: JoinStringsPipe, decorators: [{
37
32
  type: Pipe,
38
- args: [{
39
- name: 'joinStrings',
40
- standalone: false,
41
- }]
33
+ args: [{ name: 'joinStrings' }]
42
34
  }] });
43
35
 
44
36
  class PhoneInputComponent {
@@ -51,19 +43,23 @@ class PhoneInputComponent {
51
43
  set value(value) {
52
44
  this.initialValue = this.initialValue || value;
53
45
  try {
46
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- parsePhoneNumber is deprecated by libphonenumber-js (renamed export); swapping the API is behaviour-sensitive and out of scope for this lint pass
54
47
  const parsed = parsePhoneNumber(value);
55
48
  const formatted = parsed.formatInternational();
56
- this.selectedCountry = this.getCountryByAlpha2Code(parsed.country) || this.selectedCountry;
49
+ this.selectedCountry = this.getCountryByAlpha2Code(parsed.country) ?? this.selectedCountry;
57
50
  this.form.patchValue({ phone_number: formatted.replace(this.selectedCountry.callingCode, '') });
58
51
  }
59
52
  catch {
60
53
  if (value?.length <= 4) {
61
- this.selectedCountry = this.getCountryByCallingCode(value) || this.selectedCountry;
54
+ this.selectedCountry = this.getCountryByCallingCode(value) ?? this.selectedCountry;
62
55
  }
63
56
  this.form.patchValue({ phone_number: value?.replace(this.selectedCountry?.callingCode, '') });
64
57
  }
65
58
  this.stateChanges.next();
66
59
  }
60
+ get value() {
61
+ return this.getNumberWithCountryCode();
62
+ }
67
63
  /**
68
64
  * Country list for select
69
65
  *
@@ -84,6 +80,9 @@ class PhoneInputComponent {
84
80
  this.internalPlaceholder = value;
85
81
  this.stateChanges.next();
86
82
  }
83
+ get placeholder() {
84
+ return this.internalPlaceholder;
85
+ }
87
86
  /**
88
87
  * Input field errors
89
88
  *
@@ -101,24 +100,12 @@ class PhoneInputComponent {
101
100
  return true;
102
101
  }
103
102
  get empty() {
104
- return !!this.form.value;
103
+ return Boolean(this.form.value);
105
104
  }
106
105
  get errorState() {
107
- return this.errorMatcher.isErrorState(this.ngControl.control, null);
106
+ return this.errorMatcher.isErrorState(this.ngControl?.control, null);
108
107
  }
109
- get value() {
110
- return this.getNumberWithCountryCode();
111
- }
112
- get placeholder() {
113
- return this.internalPlaceholder;
114
- }
115
- constructor(ngControl, errorMatcher, fb, focusMonitor, ref, defaultAppTheme) {
116
- this.ngControl = ngControl;
117
- this.errorMatcher = errorMatcher;
118
- this.fb = fb;
119
- this.focusMonitor = focusMonitor;
120
- this.ref = ref;
121
- this.defaultAppTheme = defaultAppTheme;
108
+ constructor() {
122
109
  /**
123
110
  *
124
111
  * Defines the application theme
@@ -150,6 +137,14 @@ class PhoneInputComponent {
150
137
  this.hideLabelInErrors = false;
151
138
  this.countries = new BehaviorSubject([]);
152
139
  this.countries$ = this.countries.asObservable();
140
+ this.ngControl = inject(NgControl, { optional: true, self: true });
141
+ this.errorMatcher = inject(ErrorStateMatcher);
142
+ this.fb = inject(UntypedFormBuilder);
143
+ this.focusMonitor = inject(FocusMonitor);
144
+ this.ref = inject(ChangeDetectorRef);
145
+ this.defaultAppTheme = inject('CANOPYUI_DEFAULT_APPLICATION_THEME', {
146
+ optional: true,
147
+ });
153
148
  this.form = this.fb.group({
154
149
  phone_number: new UntypedFormControl(),
155
150
  });
@@ -162,13 +157,13 @@ class PhoneInputComponent {
162
157
  this.id = `phone-number${PhoneInputComponent.nextId++}`;
163
158
  this.describedBy = '';
164
159
  this.DEFAULT_COUNTRY_CODE = 'US';
165
- this.unsubscribeAll$ = new Subject();
160
+ this.destroyRef = inject(DestroyRef);
166
161
  this.trackByFn = (index, value) => value;
167
- if (this.ngControl != null) {
162
+ if (this.ngControl !== null) {
168
163
  this.ngControl.valueAccessor = this;
169
164
  }
170
- if (defaultAppTheme) {
171
- this.applicationTheme = defaultAppTheme;
165
+ if (this.defaultAppTheme) {
166
+ this.applicationTheme = this.defaultAppTheme;
172
167
  }
173
168
  }
174
169
  /**
@@ -187,7 +182,7 @@ class PhoneInputComponent {
187
182
  }
188
183
  setErrorsLength() {
189
184
  if (this._errors) {
190
- return this._errors.filter(err => !!err).length > 0;
185
+ return this._errors.filter(err => Boolean(err)).length > 0;
191
186
  }
192
187
  return false;
193
188
  }
@@ -220,8 +215,6 @@ class PhoneInputComponent {
220
215
  this.focusMonitor.stopMonitoring(this.input);
221
216
  this.focusMonitor.stopMonitoring(this.select);
222
217
  this.stateChanges.complete();
223
- this.unsubscribeAll$.next();
224
- this.unsubscribeAll$.complete();
225
218
  }
226
219
  onOptionsSelected(value) {
227
220
  this.setCountry(value);
@@ -248,9 +241,9 @@ class PhoneInputComponent {
248
241
  const selectAndInputFocus$ = combineLatest([
249
242
  this.focusMonitor.monitor(this.select),
250
243
  this.focusMonitor.monitor(this.input),
251
- ]).pipe(takeUntil(this.unsubscribeAll$), debounceTime(10));
252
- selectAndInputFocus$.subscribe(([selectFocus, inputFocus]) => {
253
- this.focused = !!(selectFocus || inputFocus);
244
+ ]).pipe(debounceTime(10));
245
+ selectAndInputFocus$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(([selectFocus, inputFocus]) => {
246
+ this.focused = Boolean(selectFocus) || Boolean(inputFocus);
254
247
  this.stateChanges.next();
255
248
  });
256
249
  selectAndInputFocus$.pipe(take(1)).subscribe(() => {
@@ -265,7 +258,7 @@ class PhoneInputComponent {
265
258
  ])
266
259
  .pipe(map(([_countries, selectedCountry]) => {
267
260
  if (!this.initialValue) {
268
- const country = this.getCountryByAlpha2Code(selectedCountry) || this.getCountryByAlpha2Code(this.DEFAULT_COUNTRY_CODE);
261
+ const country = this.getCountryByAlpha2Code(selectedCountry) ?? this.getCountryByAlpha2Code(this.DEFAULT_COUNTRY_CODE);
269
262
  this.setCountry(country);
270
263
  }
271
264
  else {
@@ -273,7 +266,7 @@ class PhoneInputComponent {
273
266
  }
274
267
  this.setDisabledState(false);
275
268
  this.ref.markForCheck();
276
- }))
269
+ }), takeUntilDestroyed(this.destroyRef))
277
270
  .subscribe();
278
271
  }
279
272
  getCountryByAlpha2Code(alpha2Code) {
@@ -285,7 +278,7 @@ class PhoneInputComponent {
285
278
  loadCountries() {
286
279
  const searchText$ = this.selectFilterCtrl.valueChanges.pipe(debounceTime(100), startWith(''));
287
280
  combineLatest([this.loadCountries$, searchText$])
288
- .pipe(takeUntil(this.unsubscribeAll$), tap(([countries, searchText]) => {
281
+ .pipe(tap(([countries, searchText]) => {
289
282
  const searchTextLowerCase = searchText.toLowerCase();
290
283
  const filteredCountries = countries
291
284
  .filter(option => option.name.toLowerCase().includes(searchTextLowerCase) ||
@@ -295,22 +288,22 @@ class PhoneInputComponent {
295
288
  this.countries.next(filteredCountries);
296
289
  }), delay(1), tap(() => {
297
290
  const countryFound = this.getCountryByAlpha2Code(this.selectedCountry?.alpha2Code);
298
- this.selectedCountry = countryFound || this.selectedCountry;
291
+ this.selectedCountry = countryFound ?? this.selectedCountry;
299
292
  this.ref.markForCheck();
300
- }))
293
+ }), takeUntilDestroyed(this.destroyRef))
301
294
  .subscribe();
302
295
  }
303
296
  disableClick(ev) {
304
297
  ev.preventDefault();
305
298
  ev.stopPropagation();
306
299
  }
307
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: PhoneInputComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i2.ErrorStateMatcher }, { token: i1.UntypedFormBuilder }, { token: i3.FocusMonitor }, { token: i0.ChangeDetectorRef }, { token: 'CANOPYUI_DEFAULT_APPLICATION_THEME', optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
308
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: PhoneInputComponent, isStandalone: false, selector: "ui-phone-input", inputs: { value: "value", countryList: "countryList", placeholder: "placeholder", disabled: "disabled", required: "required", applicationTheme: "applicationTheme", fullWidth: "fullWidth", errors: "errors", hideBuiltInErrors: "hideBuiltInErrors", hideLabelInErrors: "hideLabelInErrors" }, host: { properties: { "attr.disabled": "this.disabled", "attr.theme": "this.applicationTheme", "id": "this.id", "class.floated": "this.shouldLabelFloat", "attr.aria-describedby": "this.describedBy" } }, providers: [
300
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: PhoneInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
301
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: PhoneInputComponent, isStandalone: true, selector: "ui-phone-input", inputs: { value: "value", countryList: "countryList", placeholder: "placeholder", disabled: "disabled", required: "required", applicationTheme: "applicationTheme", fullWidth: "fullWidth", errors: "errors", hideBuiltInErrors: "hideBuiltInErrors", hideLabelInErrors: "hideLabelInErrors" }, host: { properties: { "attr.disabled": "this.disabled", "attr.theme": "this.applicationTheme", "id": "this.id", "class.floated": "this.shouldLabelFloat", "attr.aria-describedby": "this.describedBy" } }, providers: [
309
302
  {
310
303
  provide: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS,
311
304
  useValue: { overlayPanelClass: 'phone-number-autocomplete' },
312
305
  },
313
- ], viewQueries: [{ propertyName: "input", first: true, predicate: MatInput, descendants: true, read: ElementRef, static: true }, { propertyName: "select", first: true, predicate: MatSelect, descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<mat-form-field\n [formGroup]=\"form\"\n appearance=\"outline\"\n [color]=\"errorsLength || (ngControl?.errors && ngControl?.touched) ? 'warn' : 'accent'\"\n [ngClass]=\"{ disabled: form.disabled || disabled, 'full-width': fullWidth }\"\n>\n <mat-label\n >{{ 'COMMON.PHONE_NUMBER' | uiTranslate | async }}\n @if (required) {\n <span>*</span>\n }\n </mat-label>\n\n <div matPrefix class=\"country\">\n @if (selectedCountry) {\n <button class=\"selected-flag\" matPrefix>\n <img\n [height]=\"20\"\n [width]=\"24\"\n [attr.src]=\"countryFlagSrc + selectedCountry?.alpha2Code?.toLowerCase() + '.svg'\"\n [alt]=\"'Country flag ' + selectedCountry?.alpha2Code?.toLowerCase()\"\n />\n </button>\n }\n <mat-select\n #select\n (selectionChange)=\"onOptionsSelected($event.value)\"\n [value]=\"selectedCountry\"\n [disableOptionCentering]=\"true\"\n [panelClass]=\"'phone-number-select' + ' ' + applicationTheme\"\n [ngClass]=\"{ opened: select.panelOpen }\"\n >\n <mat-select-trigger>{{ selectedCountry?.callingCode }}</mat-select-trigger>\n <mat-option>\n <ngx-mat-select-search\n [formControl]=\"selectFilterCtrl\"\n ngDefaultControl\n placeholderLabel=\"\"\n noEntriesFoundLabel=\"\"\n >\n <ui-icon ngxMatSelectSearchClear size=\"24\" [name]=\"'Close-in-line'\"></ui-icon>\n </ngx-mat-select-search>\n </mat-option>\n @for (country of countries$ | async; track filteredCountryTrackByMethod($index, country)) {\n <mat-option [value]=\"country\">\n <div class=\"country-option\">\n <img\n [height]=\"20\"\n [width]=\"24\"\n [attr.src]=\"countryFlagSrc + country?.alpha2Code?.toLowerCase()! + '.svg'\"\n [alt]=\"'Country flag ' + country?.alpha2Code?.toLowerCase()!\"\n />\n <small>{{ $any([country?.name, '(' + country?.callingCode + ')']) | joinStrings: ' ' }}</small>\n </div>\n </mat-option>\n }\n </mat-select>\n </div>\n\n <input\n (input)=\"onInput(form.get('phone_number')!.value)\"\n formControlName=\"phone_number\"\n (click)=\"disableClick($event)\"\n [ngStyle]=\"{ opacity: disabled ? 0.5 : 1 }\"\n [required]=\"required\"\n matInput\n type=\"text\"\n />\n\n @if (errorsLength || (ngControl?.errors | hasValidationError)) {\n <mat-hint class=\"error\">\n @if (errorsLength) {\n @for (error of _errors; track trackByFn($index, error)) {\n <div class=\"errors\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span [innerHTML]=\"error\"></span>\n </div>\n }\n }\n @if (ngControl && !hideBuiltInErrors) {\n <ui-validation-error\n [ngControl]=\"ngControl\"\n [label]=\"hideLabelInErrors ? null : ('COMMON.PHONE_NUMBER' | uiTranslate | async)\"\n ></ui-validation-error>\n }\n </mat-hint>\n }\n</mat-form-field>\n", styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}:host{display:flex;align-items:center}:host .selected-flag{display:flex;position:relative;margin-right:1rem;align-items:center}:host mat-spinner{padding:0 20px}:host .country{cursor:pointer!important;display:flex;align-items:center;margin:-8px 12px 0 16px}:host .country button{margin:0 8px 0 0;background:transparent;border:unset;padding:0}:host ::ng-deep .mat-mdc-select-trigger{display:flex;gap:8px}:host mat-select{flex:0}:host .mat-mdc-form-field{min-width:320px}:host .mat-mdc-form-field.full-width{width:100%}:host .mat-mdc-form-field.disabled ::ng-deep *{border-color:#d3d3d3;color:#d3d3d3;pointer-events:none}:host .mat-mdc-form-field.disabled ::ng-deep * .mat-mdc-select-arrow{opacity:.1}:host[theme=dark] mat-select ::ng-deep .mat-mdc-select-arrow,:host[theme=light] mat-select ::ng-deep .mat-mdc-select-arrow{background:url(\"data:image/svg+xml,%3Csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 17.025L6 11.025L7.4 9.625L12 14.225L16.6 9.625L18 11.025L12 17.025Z' fill='%23333333'/%3E%3C/svg%3E\");background-size:cover;width:16px;height:16px}:host[theme=dark] mat-select ::ng-deep .mat-mdc-select-arrow svg,:host[theme=light] mat-select ::ng-deep .mat-mdc-select-arrow svg{display:none}:host[theme=dark] mat-select.opened ::ng-deep .mat-mdc-select-arrow,:host[theme=light] mat-select.opened ::ng-deep .mat-mdc-select-arrow{background:url(\"data:image/svg+xml,%3Csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 9.6249L18 15.6249L16.6 17.0249L12 12.4249L7.4 17.0249L6 15.6249L12 9.6249Z' fill='%23333333'/%3E%3C/svg%3E\");background-size:cover;width:16px;height:16px}::ng-deep .mat-form-field-appearance-outline mat-select .mat-select-arrow-wrapper{transform:none}::ng-deep .mat-select-panel.phone-number-select{margin-top:36px;margin-left:45px}::ng-deep .mat-select-search-inner{box-shadow:none!important;height:48px;background-color:#fff!important;border-bottom:none!important}::ng-deep .mat-select-search-inner .mat-select-search-inner-row{width:100%}::ng-deep .mat-select-search-inner button.mat-select-search-clear{right:35px}::ng-deep .mat-select-search-inner button.mat-select-search-clear mat-icon{font-size:20px}@media screen and (min-width:599px){::ng-deep .mat-select-panel.phone-number-select{margin-left:-33px;min-width:510px}::ng-deep .mat-select-search-inner{min-width:calc(100% + 33px)!important}}ngx-mat-select-search ::ng-deep button .mat-mdc-button-persistent-ripple,ngx-mat-select-search ::ng-deep button .mat-ripple,ngx-mat-select-search ::ng-deep button .mat-mdc-button-ripple{display:none}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i5.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i5.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i7.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "closeIcon", "closeSvgIcon", "noEntriesFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti", "recreateValuesArray"], outputs: ["toggleAll"] }, { kind: "directive", type: i7.MatSelectSearchClearDirective, selector: "[ngxMatSelectSearchClear]" }, { kind: "component", type: i8.IconComponent, selector: "ui-icon", inputs: ["size", "cssClass", "name", "color", "filled", "toggleIconStyle", "applicationTheme", "useFullIconName"] }, { kind: "component", type: i9.ValidationErrorComponent, selector: "ui-validation-error", inputs: ["ngControl", "touchedOn", "errorMessage", "label", "applicationTheme", "customErrors"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i10.UiTranslatePipe, name: "uiTranslate" }, { kind: "pipe", type: i10.HasValidationErrorPipe, name: "hasValidationError" }, { kind: "pipe", type: JoinStringsPipe, name: "joinStrings" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
306
+ ], viewQueries: [{ propertyName: "input", first: true, predicate: MatInput, descendants: true, read: ElementRef, static: true }, { propertyName: "select", first: true, predicate: MatSelect, descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<mat-form-field\n [formGroup]=\"form\"\n appearance=\"outline\"\n [color]=\"errorsLength || (ngControl?.errors && ngControl?.touched) ? 'warn' : 'accent'\"\n [ngClass]=\"{ disabled: form.disabled || disabled, 'full-width': fullWidth }\"\n>\n <mat-label\n >{{ 'COMMON.PHONE_NUMBER' | uiTranslate | async }}\n @if (required) {\n <span>*</span>\n }\n </mat-label>\n\n <div matPrefix class=\"country\">\n @if (selectedCountry) {\n <button class=\"selected-flag\" matPrefix>\n <img\n [height]=\"20\"\n [width]=\"24\"\n [attr.src]=\"countryFlagSrc + selectedCountry?.alpha2Code?.toLowerCase() + '.svg'\"\n [alt]=\"'Country flag ' + selectedCountry?.alpha2Code?.toLowerCase()\"\n />\n </button>\n }\n <mat-select\n #select\n (selectionChange)=\"onOptionsSelected($event.value)\"\n [value]=\"selectedCountry\"\n [disableOptionCentering]=\"true\"\n [panelClass]=\"'phone-number-select' + ' ' + applicationTheme\"\n [ngClass]=\"{ opened: select.panelOpen }\"\n >\n <mat-select-trigger>{{ selectedCountry?.callingCode }}</mat-select-trigger>\n <mat-option>\n <ngx-mat-select-search\n [formControl]=\"selectFilterCtrl\"\n ngDefaultControl\n placeholderLabel=\"\"\n noEntriesFoundLabel=\"\"\n >\n <ui-icon ngxMatSelectSearchClear size=\"24\" [name]=\"'Close-in-line'\"></ui-icon>\n </ngx-mat-select-search>\n </mat-option>\n @for (country of countries$ | async; track filteredCountryTrackByMethod($index, country)) {\n <mat-option [value]=\"country\">\n <div class=\"country-option\">\n <img\n [height]=\"20\"\n [width]=\"24\"\n [attr.src]=\"countryFlagSrc + country?.alpha2Code?.toLowerCase()! + '.svg'\"\n [alt]=\"'Country flag ' + country?.alpha2Code?.toLowerCase()!\"\n />\n <small>{{ $any([country?.name, '(' + country?.callingCode + ')']) | joinStrings: ' ' }}</small>\n </div>\n </mat-option>\n }\n </mat-select>\n </div>\n\n <input\n data-testid=\"phone-input-number\"\n (input)=\"onInput(form.get('phone_number')!.value)\"\n formControlName=\"phone_number\"\n (click)=\"disableClick($event)\"\n [ngStyle]=\"{ opacity: disabled ? 0.5 : 1 }\"\n [required]=\"required\"\n matInput\n type=\"text\"\n />\n\n @if (errorsLength || (ngControl?.errors | hasValidationError)) {\n <mat-hint class=\"error\">\n @if (errorsLength) {\n @for (error of _errors; track trackByFn($index, error)) {\n <div class=\"errors\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span [innerHTML]=\"error\"></span>\n </div>\n }\n }\n @if (ngControl && !hideBuiltInErrors) {\n <ui-validation-error\n [ngControl]=\"ngControl\"\n [label]=\"hideLabelInErrors ? null : ('COMMON.PHONE_NUMBER' | uiTranslate | async)\"\n ></ui-validation-error>\n }\n </mat-hint>\n }\n</mat-form-field>\n", styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}:host{display:flex;align-items:center}:host .selected-flag{display:flex;position:relative;margin-right:1rem;align-items:center}:host mat-spinner{padding:0 20px}:host .country{cursor:pointer!important;display:flex;align-items:center;margin:-8px 12px 0 16px}:host .country button{margin:0 8px 0 0;background:transparent;border:unset;padding:0}:host ::ng-deep .mat-mdc-select-trigger{display:flex;gap:8px}:host mat-select{flex:0}:host .mat-mdc-form-field{min-width:320px}:host .mat-mdc-form-field.full-width{width:100%}:host .mat-mdc-form-field.disabled ::ng-deep *{border-color:#d3d3d3;color:#d3d3d3;pointer-events:none}:host .mat-mdc-form-field.disabled ::ng-deep * .mat-mdc-select-arrow{opacity:.1}:host[theme=dark] mat-select ::ng-deep .mat-mdc-select-arrow,:host[theme=light] mat-select ::ng-deep .mat-mdc-select-arrow{background:url(\"data:image/svg+xml,%3Csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 17.025L6 11.025L7.4 9.625L12 14.225L16.6 9.625L18 11.025L12 17.025Z' fill='%23333333'/%3E%3C/svg%3E\");background-size:cover;width:16px;height:16px}:host[theme=dark] mat-select ::ng-deep .mat-mdc-select-arrow svg,:host[theme=light] mat-select ::ng-deep .mat-mdc-select-arrow svg{display:none}:host[theme=dark] mat-select.opened ::ng-deep .mat-mdc-select-arrow,:host[theme=light] mat-select.opened ::ng-deep .mat-mdc-select-arrow{background:url(\"data:image/svg+xml,%3Csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 9.6249L18 15.6249L16.6 17.0249L12 12.4249L7.4 17.0249L6 15.6249L12 9.6249Z' fill='%23333333'/%3E%3C/svg%3E\");background-size:cover;width:16px;height:16px}::ng-deep .mat-form-field-appearance-outline mat-select .mat-select-arrow-wrapper{transform:none}::ng-deep .mat-select-panel.phone-number-select{margin-top:36px;margin-left:45px}::ng-deep .mat-select-search-inner{box-shadow:none!important;height:48px;background-color:#fff!important;border-bottom:none!important}::ng-deep .mat-select-search-inner .mat-select-search-inner-row{width:100%}::ng-deep .mat-select-search-inner button.mat-select-search-clear{right:35px}::ng-deep .mat-select-search-inner button.mat-select-search-clear mat-icon{font-size:20px}@media screen and (min-width:599px){::ng-deep .mat-select-panel.phone-number-select{margin-left:-33px;min-width:510px}::ng-deep .mat-select-search-inner{min-width:calc(100% + 33px)!important}}ngx-mat-select-search ::ng-deep button .mat-mdc-button-persistent-ripple,ngx-mat-select-search ::ng-deep button .mat-ripple,ngx-mat-select-search ::ng-deep button .mat-mdc-button-ripple{display:none}\n"], dependencies: [{ kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "directive", type: MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "component", type: MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "closeIcon", "closeSvgIcon", "noEntriesFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti", "recreateValuesArray"], outputs: ["toggleAll"] }, { kind: "component", type: IconComponent, selector: "ui-icon", inputs: ["size", "cssClass", "name", "color", "filled", "toggleIconStyle", "applicationTheme", "useFullIconName"] }, { kind: "directive", type: MatSelectSearchClearDirective, selector: "[ngxMatSelectSearchClear]" }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: ValidationErrorComponent, selector: "ui-validation-error", inputs: ["ngControl", "touchedOn", "errorMessage", "label", "applicationTheme", "customErrors"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: UiTranslatePipe, name: "uiTranslate" }, { kind: "pipe", type: HasValidationErrorPipe, name: "hasValidationError" }, { kind: "pipe", type: JoinStringsPipe, name: "joinStrings" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
314
307
  }
315
308
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: PhoneInputComponent, decorators: [{
316
309
  type: Component,
@@ -319,17 +312,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
319
312
  provide: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS,
320
313
  useValue: { overlayPanelClass: 'phone-number-autocomplete' },
321
314
  },
322
- ], standalone: false, template: "<mat-form-field\n [formGroup]=\"form\"\n appearance=\"outline\"\n [color]=\"errorsLength || (ngControl?.errors && ngControl?.touched) ? 'warn' : 'accent'\"\n [ngClass]=\"{ disabled: form.disabled || disabled, 'full-width': fullWidth }\"\n>\n <mat-label\n >{{ 'COMMON.PHONE_NUMBER' | uiTranslate | async }}\n @if (required) {\n <span>*</span>\n }\n </mat-label>\n\n <div matPrefix class=\"country\">\n @if (selectedCountry) {\n <button class=\"selected-flag\" matPrefix>\n <img\n [height]=\"20\"\n [width]=\"24\"\n [attr.src]=\"countryFlagSrc + selectedCountry?.alpha2Code?.toLowerCase() + '.svg'\"\n [alt]=\"'Country flag ' + selectedCountry?.alpha2Code?.toLowerCase()\"\n />\n </button>\n }\n <mat-select\n #select\n (selectionChange)=\"onOptionsSelected($event.value)\"\n [value]=\"selectedCountry\"\n [disableOptionCentering]=\"true\"\n [panelClass]=\"'phone-number-select' + ' ' + applicationTheme\"\n [ngClass]=\"{ opened: select.panelOpen }\"\n >\n <mat-select-trigger>{{ selectedCountry?.callingCode }}</mat-select-trigger>\n <mat-option>\n <ngx-mat-select-search\n [formControl]=\"selectFilterCtrl\"\n ngDefaultControl\n placeholderLabel=\"\"\n noEntriesFoundLabel=\"\"\n >\n <ui-icon ngxMatSelectSearchClear size=\"24\" [name]=\"'Close-in-line'\"></ui-icon>\n </ngx-mat-select-search>\n </mat-option>\n @for (country of countries$ | async; track filteredCountryTrackByMethod($index, country)) {\n <mat-option [value]=\"country\">\n <div class=\"country-option\">\n <img\n [height]=\"20\"\n [width]=\"24\"\n [attr.src]=\"countryFlagSrc + country?.alpha2Code?.toLowerCase()! + '.svg'\"\n [alt]=\"'Country flag ' + country?.alpha2Code?.toLowerCase()!\"\n />\n <small>{{ $any([country?.name, '(' + country?.callingCode + ')']) | joinStrings: ' ' }}</small>\n </div>\n </mat-option>\n }\n </mat-select>\n </div>\n\n <input\n (input)=\"onInput(form.get('phone_number')!.value)\"\n formControlName=\"phone_number\"\n (click)=\"disableClick($event)\"\n [ngStyle]=\"{ opacity: disabled ? 0.5 : 1 }\"\n [required]=\"required\"\n matInput\n type=\"text\"\n />\n\n @if (errorsLength || (ngControl?.errors | hasValidationError)) {\n <mat-hint class=\"error\">\n @if (errorsLength) {\n @for (error of _errors; track trackByFn($index, error)) {\n <div class=\"errors\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span [innerHTML]=\"error\"></span>\n </div>\n }\n }\n @if (ngControl && !hideBuiltInErrors) {\n <ui-validation-error\n [ngControl]=\"ngControl\"\n [label]=\"hideLabelInErrors ? null : ('COMMON.PHONE_NUMBER' | uiTranslate | async)\"\n ></ui-validation-error>\n }\n </mat-hint>\n }\n</mat-form-field>\n", styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}:host{display:flex;align-items:center}:host .selected-flag{display:flex;position:relative;margin-right:1rem;align-items:center}:host mat-spinner{padding:0 20px}:host .country{cursor:pointer!important;display:flex;align-items:center;margin:-8px 12px 0 16px}:host .country button{margin:0 8px 0 0;background:transparent;border:unset;padding:0}:host ::ng-deep .mat-mdc-select-trigger{display:flex;gap:8px}:host mat-select{flex:0}:host .mat-mdc-form-field{min-width:320px}:host .mat-mdc-form-field.full-width{width:100%}:host .mat-mdc-form-field.disabled ::ng-deep *{border-color:#d3d3d3;color:#d3d3d3;pointer-events:none}:host .mat-mdc-form-field.disabled ::ng-deep * .mat-mdc-select-arrow{opacity:.1}:host[theme=dark] mat-select ::ng-deep .mat-mdc-select-arrow,:host[theme=light] mat-select ::ng-deep .mat-mdc-select-arrow{background:url(\"data:image/svg+xml,%3Csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 17.025L6 11.025L7.4 9.625L12 14.225L16.6 9.625L18 11.025L12 17.025Z' fill='%23333333'/%3E%3C/svg%3E\");background-size:cover;width:16px;height:16px}:host[theme=dark] mat-select ::ng-deep .mat-mdc-select-arrow svg,:host[theme=light] mat-select ::ng-deep .mat-mdc-select-arrow svg{display:none}:host[theme=dark] mat-select.opened ::ng-deep .mat-mdc-select-arrow,:host[theme=light] mat-select.opened ::ng-deep .mat-mdc-select-arrow{background:url(\"data:image/svg+xml,%3Csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 9.6249L18 15.6249L16.6 17.0249L12 12.4249L7.4 17.0249L6 15.6249L12 9.6249Z' fill='%23333333'/%3E%3C/svg%3E\");background-size:cover;width:16px;height:16px}::ng-deep .mat-form-field-appearance-outline mat-select .mat-select-arrow-wrapper{transform:none}::ng-deep .mat-select-panel.phone-number-select{margin-top:36px;margin-left:45px}::ng-deep .mat-select-search-inner{box-shadow:none!important;height:48px;background-color:#fff!important;border-bottom:none!important}::ng-deep .mat-select-search-inner .mat-select-search-inner-row{width:100%}::ng-deep .mat-select-search-inner button.mat-select-search-clear{right:35px}::ng-deep .mat-select-search-inner button.mat-select-search-clear mat-icon{font-size:20px}@media screen and (min-width:599px){::ng-deep .mat-select-panel.phone-number-select{margin-left:-33px;min-width:510px}::ng-deep .mat-select-search-inner{min-width:calc(100% + 33px)!important}}ngx-mat-select-search ::ng-deep button .mat-mdc-button-persistent-ripple,ngx-mat-select-search ::ng-deep button .mat-ripple,ngx-mat-select-search ::ng-deep button .mat-mdc-button-ripple{display:none}\n"] }]
323
- }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
324
- type: Optional
325
- }, {
326
- type: Self
327
- }] }, { type: i2.ErrorStateMatcher }, { type: i1.UntypedFormBuilder }, { type: i3.FocusMonitor }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
328
- type: Optional
329
- }, {
330
- type: Inject,
331
- args: ['CANOPYUI_DEFAULT_APPLICATION_THEME']
332
- }] }], propDecorators: { value: [{
315
+ ], imports: [
316
+ MatFormField,
317
+ FormsModule,
318
+ ReactiveFormsModule,
319
+ NgClass,
320
+ MatLabel,
321
+ MatPrefix,
322
+ MatSelect,
323
+ MatSelectTrigger,
324
+ MatOption,
325
+ MatSelectSearchComponent,
326
+ IconComponent,
327
+ MatSelectSearchClearDirective,
328
+ MatInput,
329
+ NgStyle,
330
+ MatHint,
331
+ ValidationErrorComponent,
332
+ AsyncPipe,
333
+ UiTranslatePipe,
334
+ HasValidationErrorPipe,
335
+ JoinStringsPipe,
336
+ ], template: "<mat-form-field\n [formGroup]=\"form\"\n appearance=\"outline\"\n [color]=\"errorsLength || (ngControl?.errors && ngControl?.touched) ? 'warn' : 'accent'\"\n [ngClass]=\"{ disabled: form.disabled || disabled, 'full-width': fullWidth }\"\n>\n <mat-label\n >{{ 'COMMON.PHONE_NUMBER' | uiTranslate | async }}\n @if (required) {\n <span>*</span>\n }\n </mat-label>\n\n <div matPrefix class=\"country\">\n @if (selectedCountry) {\n <button class=\"selected-flag\" matPrefix>\n <img\n [height]=\"20\"\n [width]=\"24\"\n [attr.src]=\"countryFlagSrc + selectedCountry?.alpha2Code?.toLowerCase() + '.svg'\"\n [alt]=\"'Country flag ' + selectedCountry?.alpha2Code?.toLowerCase()\"\n />\n </button>\n }\n <mat-select\n #select\n (selectionChange)=\"onOptionsSelected($event.value)\"\n [value]=\"selectedCountry\"\n [disableOptionCentering]=\"true\"\n [panelClass]=\"'phone-number-select' + ' ' + applicationTheme\"\n [ngClass]=\"{ opened: select.panelOpen }\"\n >\n <mat-select-trigger>{{ selectedCountry?.callingCode }}</mat-select-trigger>\n <mat-option>\n <ngx-mat-select-search\n [formControl]=\"selectFilterCtrl\"\n ngDefaultControl\n placeholderLabel=\"\"\n noEntriesFoundLabel=\"\"\n >\n <ui-icon ngxMatSelectSearchClear size=\"24\" [name]=\"'Close-in-line'\"></ui-icon>\n </ngx-mat-select-search>\n </mat-option>\n @for (country of countries$ | async; track filteredCountryTrackByMethod($index, country)) {\n <mat-option [value]=\"country\">\n <div class=\"country-option\">\n <img\n [height]=\"20\"\n [width]=\"24\"\n [attr.src]=\"countryFlagSrc + country?.alpha2Code?.toLowerCase()! + '.svg'\"\n [alt]=\"'Country flag ' + country?.alpha2Code?.toLowerCase()!\"\n />\n <small>{{ $any([country?.name, '(' + country?.callingCode + ')']) | joinStrings: ' ' }}</small>\n </div>\n </mat-option>\n }\n </mat-select>\n </div>\n\n <input\n data-testid=\"phone-input-number\"\n (input)=\"onInput(form.get('phone_number')!.value)\"\n formControlName=\"phone_number\"\n (click)=\"disableClick($event)\"\n [ngStyle]=\"{ opacity: disabled ? 0.5 : 1 }\"\n [required]=\"required\"\n matInput\n type=\"text\"\n />\n\n @if (errorsLength || (ngControl?.errors | hasValidationError)) {\n <mat-hint class=\"error\">\n @if (errorsLength) {\n @for (error of _errors; track trackByFn($index, error)) {\n <div class=\"errors\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span [innerHTML]=\"error\"></span>\n </div>\n }\n }\n @if (ngControl && !hideBuiltInErrors) {\n <ui-validation-error\n [ngControl]=\"ngControl\"\n [label]=\"hideLabelInErrors ? null : ('COMMON.PHONE_NUMBER' | uiTranslate | async)\"\n ></ui-validation-error>\n }\n </mat-hint>\n }\n</mat-form-field>\n", styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}:host{display:flex;align-items:center}:host .selected-flag{display:flex;position:relative;margin-right:1rem;align-items:center}:host mat-spinner{padding:0 20px}:host .country{cursor:pointer!important;display:flex;align-items:center;margin:-8px 12px 0 16px}:host .country button{margin:0 8px 0 0;background:transparent;border:unset;padding:0}:host ::ng-deep .mat-mdc-select-trigger{display:flex;gap:8px}:host mat-select{flex:0}:host .mat-mdc-form-field{min-width:320px}:host .mat-mdc-form-field.full-width{width:100%}:host .mat-mdc-form-field.disabled ::ng-deep *{border-color:#d3d3d3;color:#d3d3d3;pointer-events:none}:host .mat-mdc-form-field.disabled ::ng-deep * .mat-mdc-select-arrow{opacity:.1}:host[theme=dark] mat-select ::ng-deep .mat-mdc-select-arrow,:host[theme=light] mat-select ::ng-deep .mat-mdc-select-arrow{background:url(\"data:image/svg+xml,%3Csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 17.025L6 11.025L7.4 9.625L12 14.225L16.6 9.625L18 11.025L12 17.025Z' fill='%23333333'/%3E%3C/svg%3E\");background-size:cover;width:16px;height:16px}:host[theme=dark] mat-select ::ng-deep .mat-mdc-select-arrow svg,:host[theme=light] mat-select ::ng-deep .mat-mdc-select-arrow svg{display:none}:host[theme=dark] mat-select.opened ::ng-deep .mat-mdc-select-arrow,:host[theme=light] mat-select.opened ::ng-deep .mat-mdc-select-arrow{background:url(\"data:image/svg+xml,%3Csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 9.6249L18 15.6249L16.6 17.0249L12 12.4249L7.4 17.0249L6 15.6249L12 9.6249Z' fill='%23333333'/%3E%3C/svg%3E\");background-size:cover;width:16px;height:16px}::ng-deep .mat-form-field-appearance-outline mat-select .mat-select-arrow-wrapper{transform:none}::ng-deep .mat-select-panel.phone-number-select{margin-top:36px;margin-left:45px}::ng-deep .mat-select-search-inner{box-shadow:none!important;height:48px;background-color:#fff!important;border-bottom:none!important}::ng-deep .mat-select-search-inner .mat-select-search-inner-row{width:100%}::ng-deep .mat-select-search-inner button.mat-select-search-clear{right:35px}::ng-deep .mat-select-search-inner button.mat-select-search-clear mat-icon{font-size:20px}@media screen and (min-width:599px){::ng-deep .mat-select-panel.phone-number-select{margin-left:-33px;min-width:510px}::ng-deep .mat-select-search-inner{min-width:calc(100% + 33px)!important}}ngx-mat-select-search ::ng-deep button .mat-mdc-button-persistent-ripple,ngx-mat-select-search ::ng-deep button .mat-ripple,ngx-mat-select-search ::ng-deep button .mat-mdc-button-ripple{display:none}\n"] }]
337
+ }], ctorParameters: () => [], propDecorators: { value: [{
333
338
  type: Input
334
339
  }], countryList: [{
335
340
  type: Input
@@ -373,7 +378,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
373
378
 
374
379
  class PhoneInputComponentModule {
375
380
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: PhoneInputComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
376
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.25", ngImport: i0, type: PhoneInputComponentModule, declarations: [PhoneInputComponent, JoinStringsPipe], imports: [CommonModule,
381
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.25", ngImport: i0, type: PhoneInputComponentModule, imports: [CommonModule,
377
382
  MatProgressSpinnerModule,
378
383
  ReactiveFormsModule,
379
384
  MatSelectModule,
@@ -384,7 +389,9 @@ class PhoneInputComponentModule {
384
389
  SpinnerComponentModule,
385
390
  UiTranslatePipe,
386
391
  ValidationErrorModule,
387
- HasValidationErrorPipe], exports: [PhoneInputComponent] }); }
392
+ HasValidationErrorPipe,
393
+ PhoneInputComponent,
394
+ JoinStringsPipe], exports: [PhoneInputComponent] }); }
388
395
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: PhoneInputComponentModule, imports: [CommonModule,
389
396
  MatProgressSpinnerModule,
390
397
  ReactiveFormsModule,
@@ -394,12 +401,12 @@ class PhoneInputComponentModule {
394
401
  NgxMatSelectSearchModule,
395
402
  IconComponentModule,
396
403
  SpinnerComponentModule,
397
- ValidationErrorModule] }); }
404
+ ValidationErrorModule,
405
+ PhoneInputComponent] }); }
398
406
  }
399
407
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: PhoneInputComponentModule, decorators: [{
400
408
  type: NgModule,
401
409
  args: [{
402
- declarations: [PhoneInputComponent, JoinStringsPipe],
403
410
  exports: [PhoneInputComponent],
404
411
  imports: [
405
412
  CommonModule,
@@ -414,6 +421,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
414
421
  UiTranslatePipe,
415
422
  ValidationErrorModule,
416
423
  HasValidationErrorPipe,
424
+ PhoneInputComponent,
425
+ JoinStringsPipe,
417
426
  ],
418
427
  }]
419
428
  }] });
@@ -1 +1 @@
1
- {"version":3,"file":"testgorilla-tgo-ui-components-phone-input.mjs","sources":["../../../components/phone-input/join-strings.pipe.ts","../../../components/phone-input/phone-input.component.ts","../../../components/phone-input/phone-input.component.html","../../../components/phone-input/phone-input.component.module.ts","../../../components/phone-input/testgorilla-tgo-ui-components-phone-input.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'joinStrings',\n standalone: false,\n})\nexport class JoinStringsPipe implements PipeTransform {\n transform(value: string[], separator?: string): string {\n return value.filter(Boolean).join(separator ? separator : ' - ');\n }\n}\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DoCheck,\n ElementRef,\n HostBinding,\n Inject,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NgControl,\n UntypedFormBuilder,\n UntypedFormControl,\n UntypedFormGroup,\n} from '@angular/forms';\nimport { MAT_AUTOCOMPLETE_DEFAULT_OPTIONS } from '@angular/material/autocomplete';\nimport { ErrorStateMatcher } from '@angular/material/core';\nimport { MatInput } from '@angular/material/input';\nimport { MatSelect } from '@angular/material/select';\nimport { parsePhoneNumber } from 'libphonenumber-js';\nimport {\n BehaviorSubject,\n combineLatest,\n debounceTime,\n delay,\n filter,\n first,\n map,\n Observable,\n startWith,\n Subject,\n take,\n tap,\n} from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\nimport { ApplicationTheme } from '@testgorilla/tgo-ui/components/core';\nimport { UICountry } from './phone-input.model';\n\n@Component({\n selector: 'ui-phone-input',\n templateUrl: './phone-input.component.html',\n styleUrls: ['./phone-input.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS,\n useValue: { overlayPanelClass: 'phone-number-autocomplete' },\n },\n ],\n standalone: false,\n})\nexport class PhoneInputComponent implements OnInit, OnDestroy, ControlValueAccessor, DoCheck {\n /**\n * Phone number\n *\n * @type {string}\n * @memberof PhoneInputComponent\n */\n @Input()\n set value(value: string) {\n this.initialValue = this.initialValue || value;\n try {\n const parsed = parsePhoneNumber(value);\n const formatted = parsed.formatInternational();\n this.selectedCountry = this.getCountryByAlpha2Code(parsed.country as string) || this.selectedCountry;\n this.form.patchValue({ phone_number: formatted.replace(this.selectedCountry.callingCode, '') });\n } catch {\n if (value?.length <= 4) {\n this.selectedCountry = this.getCountryByCallingCode(value) || this.selectedCountry;\n }\n this.form.patchValue({ phone_number: value?.replace(this.selectedCountry?.callingCode, '') });\n }\n this.stateChanges.next();\n }\n\n /**\n * Country list for select\n *\n * @type {UICountry[]}\n * @memberof PhoneInputComponent\n */\n @Input() set countryList(countryList: UICountry[]) {\n this.loadCountries$.next(countryList);\n this.selectedCountry = this.selectedCountry ?? countryList[0];\n }\n\n /**\n * Placeholder input\n *\n * @type {text}\n * @memberof PhoneInputComponent\n */\n @Input()\n set placeholder(value: string) {\n this.internalPlaceholder = value;\n this.stateChanges.next();\n }\n\n /**\n * Determines if input is disabled\n *\n * @type {boolean}\n * @memberof PhoneInputComponent\n */\n @HostBinding('attr.disabled')\n @Input()\n disabled: boolean;\n\n /**\n * Input is required or not\n *\n * @type {boolean}\n * @memberof PhoneInputComponent\n */\n @Input() required: boolean;\n\n /**\n *\n * Defines the application theme\n *\n * @type {ApplicationTheme}\n * @memberof PhoneInputComponent\n */\n @HostBinding('attr.theme')\n @Input()\n applicationTheme: ApplicationTheme = 'light';\n\n /**\n * Indicator of the phone input width\n * @property fullWidth\n * @type {boolean}\n * @memberof PhoneInputComponent\n */\n @Input() fullWidth = false;\n\n _errors: string[];\n /**\n * Input field errors\n *\n * @type {string}\n * @memberof PhoneInputComponent\n */\n @Input() set errors(errors: string[]) {\n if (errors) {\n this._errors = errors?.filter(Boolean) ?? [];\n this.errorsLength = this.setErrorsLength();\n }\n }\n\n /**\n * Hide in build errors for Reactive Forms\n *\n * @type {number}\n * @memberof PhoneInputComponent\n */\n @Input() hideBuiltInErrors = false;\n\n /**\n * Hide label in errors\n *\n * @type {number}\n * @memberof PhoneInputComponent\n */\n @Input() hideLabelInErrors = false;\n\n static nextId = 0;\n\n private countries = new BehaviorSubject<UICountry[]>([]);\n protected countries$ = this.countries.asObservable();\n form: UntypedFormGroup = this.fb.group({\n phone_number: new UntypedFormControl(),\n });\n protected controlType = 'phone-number';\n protected userAriaDescribedBy?: string;\n protected loadCountries$ = new BehaviorSubject<UICountry[]>([]);\n protected countryCode = new BehaviorSubject<string>('US');\n protected stateChanges = new Subject<void>();\n protected focused: boolean;\n protected selectFilterCtrl = new UntypedFormControl('');\n protected errorsLength: boolean;\n protected readonly countryFlagSrc = 'assets/svg-country-flags/';\n\n @ViewChild(MatInput, { read: ElementRef, static: true })\n public input: ElementRef<HTMLElement>;\n @ViewChild(MatSelect, { read: ElementRef, static: true })\n public select: ElementRef<HTMLElement>;\n\n @HostBinding()\n id = `phone-number${PhoneInputComponent.nextId++}`;\n\n @HostBinding('class.floated')\n get shouldLabelFloat(): boolean {\n return true;\n }\n\n @HostBinding('attr.aria-describedby') describedBy = '';\n\n get empty(): boolean {\n return !!this.form.value;\n }\n\n get errorState(): boolean {\n return this.errorMatcher.isErrorState(this.ngControl.control as UntypedFormControl, null);\n }\n\n get value(): string {\n return this.getNumberWithCountryCode();\n }\n\n get placeholder() {\n return this.internalPlaceholder;\n }\n\n private initialValue: string;\n private readonly DEFAULT_COUNTRY_CODE = 'US';\n private internalPlaceholder: string;\n protected selectedCountry: UICountry;\n private unsubscribeAll$ = new Subject<void>();\n\n constructor(\n @Optional() @Self() public ngControl: NgControl,\n private errorMatcher: ErrorStateMatcher,\n private fb: UntypedFormBuilder,\n private focusMonitor: FocusMonitor,\n private ref: ChangeDetectorRef,\n @Optional() @Inject('CANOPYUI_DEFAULT_APPLICATION_THEME') private readonly defaultAppTheme: ApplicationTheme\n ) {\n if (this.ngControl != null) {\n this.ngControl.valueAccessor = this;\n }\n\n if (defaultAppTheme) {\n this.applicationTheme = defaultAppTheme;\n }\n }\n\n /**\n * Used to mark component view as dirty when touched programmatically with markAsTouched/markAllAsTouched or errors\n * to display validation errors that might happen (e.g. required)\n */\n ngDoCheck(): void {\n if (this.ngControl?.touched || this.ngControl?.errors) {\n this.ref.markForCheck();\n }\n }\n\n ngOnInit(): void {\n this.loadCountries();\n this.preSelectCountry();\n this.subscribeToFocusEvents();\n }\n\n setErrorsLength(): boolean {\n if (this._errors) {\n return this._errors.filter(err => !!err).length > 0;\n }\n return false;\n }\n\n setDescribedByIds(ids: string[]): void {\n this.userAriaDescribedBy = ids.join(' ');\n }\n\n onChange: (value: string) => void;\n onTouch: () => void;\n\n writeValue(phoneNumber: string): void {\n if (phoneNumber) {\n this.value = phoneNumber;\n }\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouch = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n if (isDisabled) {\n this.form.disable();\n } else {\n this.form.enable();\n }\n this.disabled = isDisabled;\n this.stateChanges.next();\n this.ref.markForCheck();\n }\n\n ngOnDestroy(): void {\n this.focusMonitor.stopMonitoring(this.input);\n this.focusMonitor.stopMonitoring(this.select);\n this.stateChanges.complete();\n this.unsubscribeAll$.next();\n this.unsubscribeAll$.complete();\n }\n\n onOptionsSelected(value: UICountry) {\n this.setCountry(value);\n }\n\n onInput(value: string) {\n this.value = (this.selectedCountry?.callingCode ?? '') + value;\n this.onChange(this.value);\n }\n\n filteredCountryTrackByMethod(index: number, el: UICountry): string {\n return el.alpha2Code;\n }\n\n private setCountry(country: UICountry | null): void {\n if (country) {\n this.selectedCountry = country;\n }\n this.value = this.getNumberWithCountryCode();\n this.onChange(this.value);\n }\n\n private getNumberWithCountryCode() {\n const nationalNumber = this.form.value?.phone_number as string;\n return nationalNumber ? (this.selectedCountry?.callingCode ?? '') + nationalNumber : '';\n }\n\n private subscribeToFocusEvents() {\n const selectAndInputFocus$ = combineLatest([\n this.focusMonitor.monitor(this.select),\n this.focusMonitor.monitor(this.input),\n ]).pipe(takeUntil(this.unsubscribeAll$), debounceTime(10));\n\n selectAndInputFocus$.subscribe(([selectFocus, inputFocus]) => {\n this.focused = !!(selectFocus || inputFocus);\n this.stateChanges.next();\n });\n\n selectAndInputFocus$.pipe(take(1)).subscribe(() => {\n this.onTouch();\n });\n }\n\n private preSelectCountry() {\n this.setDisabledState(true);\n combineLatest([\n this.countries$.pipe(\n filter(countries => countries.length > 0),\n first()\n ),\n this.countryCode,\n ])\n .pipe(\n map(([_countries, selectedCountry]) => {\n if (!this.initialValue) {\n const country =\n this.getCountryByAlpha2Code(selectedCountry) || this.getCountryByAlpha2Code(this.DEFAULT_COUNTRY_CODE);\n this.setCountry(country as UICountry);\n } else {\n this.value = this.initialValue;\n }\n\n this.setDisabledState(false);\n this.ref.markForCheck();\n })\n )\n .subscribe();\n }\n\n private getCountryByAlpha2Code(alpha2Code: string) {\n return this.countries.value.find(country => country.alpha2Code === alpha2Code);\n }\n\n private getCountryByCallingCode(callingCode: string) {\n return this.countries.value.find(country => country.callingCode === callingCode);\n }\n\n private loadCountries(): void {\n const searchText$: Observable<string> = this.selectFilterCtrl.valueChanges.pipe(debounceTime(100), startWith(''));\n\n combineLatest([this.loadCountries$, searchText$])\n .pipe(\n takeUntil(this.unsubscribeAll$),\n tap(([countries, searchText]) => {\n const searchTextLowerCase = searchText.toLowerCase();\n const filteredCountries = countries\n .filter(\n option =>\n option.name.toLowerCase().includes(searchTextLowerCase) ||\n option.alpha2Code.toLowerCase().includes(searchTextLowerCase) ||\n option.callingCode.toLowerCase().includes(searchTextLowerCase)\n )\n .sort((optionA, optionB) => (optionB.name.startsWith(searchText) ? 1 : -1));\n this.countries.next(filteredCountries);\n }),\n delay(1),\n tap(() => {\n const countryFound = this.getCountryByAlpha2Code(this.selectedCountry?.alpha2Code);\n this.selectedCountry = countryFound || this.selectedCountry;\n this.ref.markForCheck();\n })\n )\n .subscribe();\n }\n\n disableClick(ev: Event) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n\n trackByFn = (index: number, value: string) => value;\n}\n","<mat-form-field\n [formGroup]=\"form\"\n appearance=\"outline\"\n [color]=\"errorsLength || (ngControl?.errors && ngControl?.touched) ? 'warn' : 'accent'\"\n [ngClass]=\"{ disabled: form.disabled || disabled, 'full-width': fullWidth }\"\n>\n <mat-label\n >{{ 'COMMON.PHONE_NUMBER' | uiTranslate | async }}\n @if (required) {\n <span>*</span>\n }\n </mat-label>\n\n <div matPrefix class=\"country\">\n @if (selectedCountry) {\n <button class=\"selected-flag\" matPrefix>\n <img\n [height]=\"20\"\n [width]=\"24\"\n [attr.src]=\"countryFlagSrc + selectedCountry?.alpha2Code?.toLowerCase() + '.svg'\"\n [alt]=\"'Country flag ' + selectedCountry?.alpha2Code?.toLowerCase()\"\n />\n </button>\n }\n <mat-select\n #select\n (selectionChange)=\"onOptionsSelected($event.value)\"\n [value]=\"selectedCountry\"\n [disableOptionCentering]=\"true\"\n [panelClass]=\"'phone-number-select' + ' ' + applicationTheme\"\n [ngClass]=\"{ opened: select.panelOpen }\"\n >\n <mat-select-trigger>{{ selectedCountry?.callingCode }}</mat-select-trigger>\n <mat-option>\n <ngx-mat-select-search\n [formControl]=\"selectFilterCtrl\"\n ngDefaultControl\n placeholderLabel=\"\"\n noEntriesFoundLabel=\"\"\n >\n <ui-icon ngxMatSelectSearchClear size=\"24\" [name]=\"'Close-in-line'\"></ui-icon>\n </ngx-mat-select-search>\n </mat-option>\n @for (country of countries$ | async; track filteredCountryTrackByMethod($index, country)) {\n <mat-option [value]=\"country\">\n <div class=\"country-option\">\n <img\n [height]=\"20\"\n [width]=\"24\"\n [attr.src]=\"countryFlagSrc + country?.alpha2Code?.toLowerCase()! + '.svg'\"\n [alt]=\"'Country flag ' + country?.alpha2Code?.toLowerCase()!\"\n />\n <small>{{ $any([country?.name, '(' + country?.callingCode + ')']) | joinStrings: ' ' }}</small>\n </div>\n </mat-option>\n }\n </mat-select>\n </div>\n\n <input\n (input)=\"onInput(form.get('phone_number')!.value)\"\n formControlName=\"phone_number\"\n (click)=\"disableClick($event)\"\n [ngStyle]=\"{ opacity: disabled ? 0.5 : 1 }\"\n [required]=\"required\"\n matInput\n type=\"text\"\n />\n\n @if (errorsLength || (ngControl?.errors | hasValidationError)) {\n <mat-hint class=\"error\">\n @if (errorsLength) {\n @for (error of _errors; track trackByFn($index, error)) {\n <div class=\"errors\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span [innerHTML]=\"error\"></span>\n </div>\n }\n }\n @if (ngControl && !hideBuiltInErrors) {\n <ui-validation-error\n [ngControl]=\"ngControl\"\n [label]=\"hideLabelInErrors ? null : ('COMMON.PHONE_NUMBER' | uiTranslate | async)\"\n ></ui-validation-error>\n }\n </mat-hint>\n }\n</mat-form-field>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { PhoneInputComponent } from './phone-input.component';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatSelectModule } from '@angular/material/select';\nimport { MatIconModule } from '@angular/material/icon';\nimport { JoinStringsPipe } from './join-strings.pipe';\nimport { MatInputModule } from '@angular/material/input';\nimport { NgxMatSelectSearchModule } from 'ngx-mat-select-search';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { SpinnerComponentModule } from '@testgorilla/tgo-ui/components/spinner';\nimport { UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\nimport { ValidationErrorModule } from '@testgorilla/tgo-ui/components/validation-error';\nimport { HasValidationErrorPipe } from '@testgorilla/tgo-ui/components/core';\n\n@NgModule({\n declarations: [PhoneInputComponent, JoinStringsPipe],\n exports: [PhoneInputComponent],\n imports: [\n CommonModule,\n MatProgressSpinnerModule,\n ReactiveFormsModule,\n MatSelectModule,\n MatIconModule,\n MatInputModule,\n NgxMatSelectSearchModule,\n IconComponentModule,\n SpinnerComponentModule,\n UiTranslatePipe,\n ValidationErrorModule,\n HasValidationErrorPipe,\n ],\n})\nexport class PhoneInputComponentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i11.JoinStringsPipe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;MAMa,e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;AACR,oBAAA,YAAY,EAAE,CAAC,mBAAmB,EAAE,eAAe,CAAC;oBACpD,OAAO,EAAE,CAAC,mBAAmB,CAAC;AAC9B,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,wBAAwB;wBACxB,mBAAmB;wBACnB,eAAe;wBACf,aAAa;wBACb,cAAc;wBACd,wBAAwB;wBACxB,mBAAmB;wBACnB,sBAAsB;wBACtB,eAAe;wBACf,qBAAqB;wBACrB,sBAAsB;AACvB,qBAAA;AACF,iBAAA;;;ACjCD;;AAEG;;;;"}
1
+ {"version":3,"file":"testgorilla-tgo-ui-components-phone-input.mjs","sources":["../../../components/phone-input/join-strings.pipe.ts","../../../components/phone-input/phone-input.component.ts","../../../components/phone-input/phone-input.component.html","../../../components/phone-input/phone-input.component.module.ts","../../../components/phone-input/testgorilla-tgo-ui-components-phone-input.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({ name: 'joinStrings' })\nexport class JoinStringsPipe implements PipeTransform {\n transform(value: string[], separator?: string): string {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- an empty separator falls back to the default separator\n return value.filter(Boolean).join(separator ? separator : ' - ');\n }\n}\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport { NgClass, NgStyle, AsyncPipe } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n DoCheck,\n ElementRef,\n HostBinding,\n inject,\n Input,\n OnDestroy,\n OnInit,\n ProviderToken,\n ViewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n ControlValueAccessor,\n NgControl,\n UntypedFormBuilder,\n UntypedFormControl,\n UntypedFormGroup,\n FormsModule,\n ReactiveFormsModule,\n} from '@angular/forms';\nimport { MAT_AUTOCOMPLETE_DEFAULT_OPTIONS } from '@angular/material/autocomplete';\nimport { ErrorStateMatcher } from '@angular/material/core';\nimport { MatFormField, MatLabel, MatPrefix, MatHint } from '@angular/material/form-field';\nimport { MatInput } from '@angular/material/input';\nimport { MatSelect, MatSelectTrigger, MatOption } from '@angular/material/select';\nimport { parsePhoneNumber } from 'libphonenumber-js';\nimport { MatSelectSearchComponent, MatSelectSearchClearDirective } from 'ngx-mat-select-search';\nimport {\n BehaviorSubject,\n combineLatest,\n debounceTime,\n delay,\n filter,\n first,\n map,\n Observable,\n startWith,\n Subject,\n take,\n tap,\n} from 'rxjs';\n\nimport { ApplicationTheme, UiTranslatePipe, HasValidationErrorPipe } from '@testgorilla/tgo-ui/components/core';\nimport { IconComponent } from '@testgorilla/tgo-ui/components/icon';\nimport { ValidationErrorComponent } from '@testgorilla/tgo-ui/components/validation-error';\n\nimport { JoinStringsPipe } from './join-strings.pipe';\nimport { UICountry } from './phone-input.model';\n\n@Component({\n selector: 'ui-phone-input',\n templateUrl: './phone-input.component.html',\n styleUrls: ['./phone-input.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS,\n useValue: { overlayPanelClass: 'phone-number-autocomplete' },\n },\n ],\n imports: [\n MatFormField,\n FormsModule,\n ReactiveFormsModule,\n NgClass,\n MatLabel,\n MatPrefix,\n MatSelect,\n MatSelectTrigger,\n MatOption,\n MatSelectSearchComponent,\n IconComponent,\n MatSelectSearchClearDirective,\n MatInput,\n NgStyle,\n MatHint,\n ValidationErrorComponent,\n AsyncPipe,\n UiTranslatePipe,\n HasValidationErrorPipe,\n JoinStringsPipe,\n ],\n})\nexport class PhoneInputComponent implements OnInit, OnDestroy, ControlValueAccessor, DoCheck {\n /**\n * Phone number\n *\n * @type {string}\n * @memberof PhoneInputComponent\n */\n @Input()\n set value(value: string) {\n this.initialValue = this.initialValue || value;\n try {\n // eslint-disable-next-line @typescript-eslint/no-deprecated -- parsePhoneNumber is deprecated by libphonenumber-js (renamed export); swapping the API is behaviour-sensitive and out of scope for this lint pass\n const parsed = parsePhoneNumber(value);\n const formatted = parsed.formatInternational();\n this.selectedCountry = this.getCountryByAlpha2Code(parsed.country as string) ?? this.selectedCountry;\n this.form.patchValue({ phone_number: formatted.replace(this.selectedCountry.callingCode, '') });\n } catch {\n if (value?.length <= 4) {\n this.selectedCountry = this.getCountryByCallingCode(value) ?? this.selectedCountry;\n }\n this.form.patchValue({ phone_number: value?.replace(this.selectedCountry?.callingCode, '') });\n }\n this.stateChanges.next();\n }\n\n get value(): string {\n return this.getNumberWithCountryCode();\n }\n\n /**\n * Country list for select\n *\n * @type {UICountry[]}\n * @memberof PhoneInputComponent\n */\n @Input() set countryList(countryList: UICountry[]) {\n this.loadCountries$.next(countryList);\n this.selectedCountry = this.selectedCountry ?? countryList[0];\n }\n\n /**\n * Placeholder input\n *\n * @type {text}\n * @memberof PhoneInputComponent\n */\n @Input()\n set placeholder(value: string) {\n this.internalPlaceholder = value;\n this.stateChanges.next();\n }\n\n get placeholder() {\n return this.internalPlaceholder;\n }\n\n /**\n * Determines if input is disabled\n *\n * @type {boolean}\n * @memberof PhoneInputComponent\n */\n @HostBinding('attr.disabled')\n @Input()\n disabled: boolean;\n\n /**\n * Input is required or not\n *\n * @type {boolean}\n * @memberof PhoneInputComponent\n */\n @Input() required: boolean;\n\n /**\n *\n * Defines the application theme\n *\n * @type {ApplicationTheme}\n * @memberof PhoneInputComponent\n */\n @HostBinding('attr.theme')\n @Input()\n applicationTheme: ApplicationTheme = 'light';\n\n /**\n * Indicator of the phone input width\n * @property fullWidth\n * @type {boolean}\n * @memberof PhoneInputComponent\n */\n @Input() fullWidth = false;\n\n _errors: string[];\n /**\n * Input field errors\n *\n * @type {string}\n * @memberof PhoneInputComponent\n */\n @Input() set errors(errors: string[]) {\n if (errors) {\n this._errors = errors?.filter(Boolean) ?? [];\n this.errorsLength = this.setErrorsLength();\n }\n }\n\n /**\n * Hide in build errors for Reactive Forms\n *\n * @type {number}\n * @memberof PhoneInputComponent\n */\n @Input() hideBuiltInErrors = false;\n\n /**\n * Hide label in errors\n *\n * @type {number}\n * @memberof PhoneInputComponent\n */\n @Input() hideLabelInErrors = false;\n\n static nextId = 0;\n\n private readonly countries = new BehaviorSubject<UICountry[]>([]);\n protected countries$ = this.countries.asObservable();\n public ngControl = inject(NgControl, { optional: true, self: true });\n private readonly errorMatcher = inject(ErrorStateMatcher);\n private readonly fb = inject(UntypedFormBuilder);\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly ref = inject(ChangeDetectorRef);\n private readonly defaultAppTheme = inject(\n 'CANOPYUI_DEFAULT_APPLICATION_THEME' as unknown as ProviderToken<ApplicationTheme>,\n {\n optional: true,\n }\n );\n form: UntypedFormGroup = this.fb.group({\n phone_number: new UntypedFormControl(),\n });\n protected controlType = 'phone-number';\n protected userAriaDescribedBy?: string;\n protected loadCountries$ = new BehaviorSubject<UICountry[]>([]);\n protected countryCode = new BehaviorSubject<string>('US');\n protected stateChanges = new Subject<void>();\n protected focused: boolean;\n protected selectFilterCtrl = new UntypedFormControl('');\n protected errorsLength: boolean;\n protected readonly countryFlagSrc = 'assets/svg-country-flags/';\n\n @ViewChild(MatInput, { read: ElementRef, static: true })\n public input: ElementRef<HTMLElement>;\n @ViewChild(MatSelect, { read: ElementRef, static: true })\n public select: ElementRef<HTMLElement>;\n\n @HostBinding()\n id = `phone-number${PhoneInputComponent.nextId++}`;\n\n @HostBinding('class.floated')\n get shouldLabelFloat(): boolean {\n return true;\n }\n\n @HostBinding('attr.aria-describedby') describedBy = '';\n\n get empty(): boolean {\n return Boolean(this.form.value);\n }\n\n get errorState(): boolean {\n return this.errorMatcher.isErrorState(this.ngControl?.control as UntypedFormControl, null);\n }\n\n private initialValue: string;\n private readonly DEFAULT_COUNTRY_CODE = 'US';\n private internalPlaceholder: string;\n protected selectedCountry: UICountry;\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n if (this.ngControl !== null) {\n this.ngControl.valueAccessor = this;\n }\n\n if (this.defaultAppTheme) {\n this.applicationTheme = this.defaultAppTheme;\n }\n }\n\n /**\n * Used to mark component view as dirty when touched programmatically with markAsTouched/markAllAsTouched or errors\n * to display validation errors that might happen (e.g. required)\n */\n ngDoCheck(): void {\n if (this.ngControl?.touched || this.ngControl?.errors) {\n this.ref.markForCheck();\n }\n }\n\n ngOnInit(): void {\n this.loadCountries();\n this.preSelectCountry();\n this.subscribeToFocusEvents();\n }\n\n setErrorsLength(): boolean {\n if (this._errors) {\n return this._errors.filter(err => Boolean(err)).length > 0;\n }\n return false;\n }\n\n setDescribedByIds(ids: string[]): void {\n this.userAriaDescribedBy = ids.join(' ');\n }\n\n onChange: (value: string) => void;\n onTouch: () => void;\n\n writeValue(phoneNumber: string): void {\n if (phoneNumber) {\n this.value = phoneNumber;\n }\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouch = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n if (isDisabled) {\n this.form.disable();\n } else {\n this.form.enable();\n }\n this.disabled = isDisabled;\n this.stateChanges.next();\n this.ref.markForCheck();\n }\n\n ngOnDestroy(): void {\n this.focusMonitor.stopMonitoring(this.input);\n this.focusMonitor.stopMonitoring(this.select);\n this.stateChanges.complete();\n }\n\n onOptionsSelected(value: UICountry) {\n this.setCountry(value);\n }\n\n onInput(value: string) {\n this.value = (this.selectedCountry?.callingCode ?? '') + value;\n this.onChange(this.value);\n }\n\n filteredCountryTrackByMethod(index: number, el: UICountry): string {\n return el.alpha2Code;\n }\n\n private setCountry(country: UICountry | null): void {\n if (country) {\n this.selectedCountry = country;\n }\n this.value = this.getNumberWithCountryCode();\n this.onChange(this.value);\n }\n\n private getNumberWithCountryCode() {\n const nationalNumber = (this.form.value as { phone_number?: string } | null)?.phone_number;\n return nationalNumber ? (this.selectedCountry?.callingCode ?? '') + nationalNumber : '';\n }\n\n private subscribeToFocusEvents() {\n const selectAndInputFocus$ = combineLatest([\n this.focusMonitor.monitor(this.select),\n this.focusMonitor.monitor(this.input),\n ]).pipe(debounceTime(10));\n\n selectAndInputFocus$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(([selectFocus, inputFocus]) => {\n this.focused = Boolean(selectFocus) || Boolean(inputFocus);\n this.stateChanges.next();\n });\n\n selectAndInputFocus$.pipe(take(1)).subscribe(() => {\n this.onTouch();\n });\n }\n\n private preSelectCountry() {\n this.setDisabledState(true);\n combineLatest([\n this.countries$.pipe(\n filter(countries => countries.length > 0),\n first()\n ),\n this.countryCode,\n ])\n .pipe(\n map(([_countries, selectedCountry]) => {\n if (!this.initialValue) {\n const country =\n this.getCountryByAlpha2Code(selectedCountry) ?? this.getCountryByAlpha2Code(this.DEFAULT_COUNTRY_CODE);\n this.setCountry(country as UICountry);\n } else {\n this.value = this.initialValue;\n }\n\n this.setDisabledState(false);\n this.ref.markForCheck();\n }),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe();\n }\n\n private getCountryByAlpha2Code(alpha2Code: string) {\n return this.countries.value.find(country => country.alpha2Code === alpha2Code);\n }\n\n private getCountryByCallingCode(callingCode: string) {\n return this.countries.value.find(country => country.callingCode === callingCode);\n }\n\n private loadCountries(): void {\n const searchText$: Observable<string> = this.selectFilterCtrl.valueChanges.pipe(debounceTime(100), startWith(''));\n\n combineLatest([this.loadCountries$, searchText$])\n .pipe(\n tap(([countries, searchText]) => {\n const searchTextLowerCase = searchText.toLowerCase();\n const filteredCountries = countries\n .filter(\n option =>\n option.name.toLowerCase().includes(searchTextLowerCase) ||\n option.alpha2Code.toLowerCase().includes(searchTextLowerCase) ||\n option.callingCode.toLowerCase().includes(searchTextLowerCase)\n )\n .sort((optionA, optionB) => (optionB.name.startsWith(searchText) ? 1 : -1));\n this.countries.next(filteredCountries);\n }),\n delay(1),\n tap(() => {\n const countryFound = this.getCountryByAlpha2Code(this.selectedCountry?.alpha2Code);\n this.selectedCountry = countryFound ?? this.selectedCountry;\n this.ref.markForCheck();\n }),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe();\n }\n\n disableClick(ev: Event) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n\n trackByFn = (index: number, value: string) => value;\n}\n","<mat-form-field\n [formGroup]=\"form\"\n appearance=\"outline\"\n [color]=\"errorsLength || (ngControl?.errors && ngControl?.touched) ? 'warn' : 'accent'\"\n [ngClass]=\"{ disabled: form.disabled || disabled, 'full-width': fullWidth }\"\n>\n <mat-label\n >{{ 'COMMON.PHONE_NUMBER' | uiTranslate | async }}\n @if (required) {\n <span>*</span>\n }\n </mat-label>\n\n <div matPrefix class=\"country\">\n @if (selectedCountry) {\n <button class=\"selected-flag\" matPrefix>\n <img\n [height]=\"20\"\n [width]=\"24\"\n [attr.src]=\"countryFlagSrc + selectedCountry?.alpha2Code?.toLowerCase() + '.svg'\"\n [alt]=\"'Country flag ' + selectedCountry?.alpha2Code?.toLowerCase()\"\n />\n </button>\n }\n <mat-select\n #select\n (selectionChange)=\"onOptionsSelected($event.value)\"\n [value]=\"selectedCountry\"\n [disableOptionCentering]=\"true\"\n [panelClass]=\"'phone-number-select' + ' ' + applicationTheme\"\n [ngClass]=\"{ opened: select.panelOpen }\"\n >\n <mat-select-trigger>{{ selectedCountry?.callingCode }}</mat-select-trigger>\n <mat-option>\n <ngx-mat-select-search\n [formControl]=\"selectFilterCtrl\"\n ngDefaultControl\n placeholderLabel=\"\"\n noEntriesFoundLabel=\"\"\n >\n <ui-icon ngxMatSelectSearchClear size=\"24\" [name]=\"'Close-in-line'\"></ui-icon>\n </ngx-mat-select-search>\n </mat-option>\n @for (country of countries$ | async; track filteredCountryTrackByMethod($index, country)) {\n <mat-option [value]=\"country\">\n <div class=\"country-option\">\n <img\n [height]=\"20\"\n [width]=\"24\"\n [attr.src]=\"countryFlagSrc + country?.alpha2Code?.toLowerCase()! + '.svg'\"\n [alt]=\"'Country flag ' + country?.alpha2Code?.toLowerCase()!\"\n />\n <small>{{ $any([country?.name, '(' + country?.callingCode + ')']) | joinStrings: ' ' }}</small>\n </div>\n </mat-option>\n }\n </mat-select>\n </div>\n\n <input\n data-testid=\"phone-input-number\"\n (input)=\"onInput(form.get('phone_number')!.value)\"\n formControlName=\"phone_number\"\n (click)=\"disableClick($event)\"\n [ngStyle]=\"{ opacity: disabled ? 0.5 : 1 }\"\n [required]=\"required\"\n matInput\n type=\"text\"\n />\n\n @if (errorsLength || (ngControl?.errors | hasValidationError)) {\n <mat-hint class=\"error\">\n @if (errorsLength) {\n @for (error of _errors; track trackByFn($index, error)) {\n <div class=\"errors\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span [innerHTML]=\"error\"></span>\n </div>\n }\n }\n @if (ngControl && !hideBuiltInErrors) {\n <ui-validation-error\n [ngControl]=\"ngControl\"\n [label]=\"hideLabelInErrors ? null : ('COMMON.PHONE_NUMBER' | uiTranslate | async)\"\n ></ui-validation-error>\n }\n </mat-hint>\n }\n</mat-form-field>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatSelectModule } from '@angular/material/select';\nimport { NgxMatSelectSearchModule } from 'ngx-mat-select-search';\n\nimport { UiTranslatePipe, HasValidationErrorPipe } from '@testgorilla/tgo-ui/components/core';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { SpinnerComponentModule } from '@testgorilla/tgo-ui/components/spinner';\nimport { ValidationErrorModule } from '@testgorilla/tgo-ui/components/validation-error';\n\nimport { JoinStringsPipe } from './join-strings.pipe';\nimport { PhoneInputComponent } from './phone-input.component';\n\n@NgModule({\n exports: [PhoneInputComponent],\n imports: [\n CommonModule,\n MatProgressSpinnerModule,\n ReactiveFormsModule,\n MatSelectModule,\n MatIconModule,\n MatInputModule,\n NgxMatSelectSearchModule,\n IconComponentModule,\n SpinnerComponentModule,\n UiTranslatePipe,\n ValidationErrorModule,\n HasValidationErrorPipe,\n PhoneInputComponent,\n JoinStringsPipe,\n ],\n})\nexport class PhoneInputComponentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;MAGa,eAAe,CAAA;IAC1B,SAAS,CAAC,KAAe,EAAE,SAAkB,EAAA;;AAE3C,QAAA,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,SAAS,GAAG,KAAK,CAAC;IAClE;+GAJW,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;6GAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,aAAA,EAAA,CAAA,CAAA;;4FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAD3B,IAAI;mBAAC,EAAE,IAAI,EAAE,aAAa,EAAE;;;MCwFhB,mBAAmB,CAAA;AAC9B;;;;;AAKG;IACH,IACI,KAAK,CAAC,KAAa,EAAA;QACrB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,KAAK;AAC9C,QAAA,IAAI;;AAEF,YAAA,MAAM,MAAM,GAAG,gBAAgB,CAAC,KAAK,CAAC;AACtC,YAAA,MAAM,SAAS,GAAG,MAAM,CAAC,mBAAmB,EAAE;AAC9C,YAAA,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,OAAiB,CAAC,IAAI,IAAI,CAAC,eAAe;YACpG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,YAAY,EAAE,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,EAAE,CAAC,EAAE,CAAC;QACjG;AAAE,QAAA,MAAM;AACN,YAAA,IAAI,KAAK,EAAE,MAAM,IAAI,CAAC,EAAE;AACtB,gBA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