@testgorilla/tgo-ui 11.22.3 → 12.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/fesm2022/testgorilla-tgo-ui-components-accordion.mjs +335 -229
  2. package/fesm2022/testgorilla-tgo-ui-components-accordion.mjs.map +1 -1
  3. package/fesm2022/testgorilla-tgo-ui-components-ai-audio-circle.mjs +547 -465
  4. package/fesm2022/testgorilla-tgo-ui-components-ai-audio-circle.mjs.map +1 -1
  5. package/fesm2022/testgorilla-tgo-ui-components-ai-caveat.mjs +160 -75
  6. package/fesm2022/testgorilla-tgo-ui-components-ai-caveat.mjs.map +1 -1
  7. package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs +678 -278
  8. package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs.map +1 -1
  9. package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs +337 -274
  10. package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs.map +1 -1
  11. package/fesm2022/testgorilla-tgo-ui-components-audio-waveform.mjs +351 -192
  12. package/fesm2022/testgorilla-tgo-ui-components-audio-waveform.mjs.map +1 -1
  13. package/fesm2022/testgorilla-tgo-ui-components-autocomplete-v2.mjs +1950 -960
  14. package/fesm2022/testgorilla-tgo-ui-components-autocomplete-v2.mjs.map +1 -1
  15. package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs +1206 -1044
  16. package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs.map +1 -1
  17. package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs +328 -182
  18. package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs.map +1 -1
  19. package/fesm2022/testgorilla-tgo-ui-components-badge.mjs +383 -203
  20. package/fesm2022/testgorilla-tgo-ui-components-badge.mjs.map +1 -1
  21. package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs +553 -261
  22. package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs.map +1 -1
  23. package/fesm2022/testgorilla-tgo-ui-components-button.mjs +709 -739
  24. package/fesm2022/testgorilla-tgo-ui-components-button.mjs.map +1 -1
  25. package/fesm2022/testgorilla-tgo-ui-components-card.mjs +219 -184
  26. package/fesm2022/testgorilla-tgo-ui-components-card.mjs.map +1 -1
  27. package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs +515 -458
  28. package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs.map +1 -1
  29. package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs +423 -162
  30. package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs.map +1 -1
  31. package/fesm2022/testgorilla-tgo-ui-components-core.mjs +10784 -10996
  32. package/fesm2022/testgorilla-tgo-ui-components-core.mjs.map +1 -1
  33. package/fesm2022/testgorilla-tgo-ui-components-datepicker.mjs +810 -533
  34. package/fesm2022/testgorilla-tgo-ui-components-datepicker.mjs.map +1 -1
  35. package/fesm2022/testgorilla-tgo-ui-components-device-control.mjs +473 -116
  36. package/fesm2022/testgorilla-tgo-ui-components-device-control.mjs.map +1 -1
  37. package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs +1149 -540
  38. package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs.map +1 -1
  39. package/fesm2022/testgorilla-tgo-ui-components-divider.mjs +148 -84
  40. package/fesm2022/testgorilla-tgo-ui-components-divider.mjs.map +1 -1
  41. package/fesm2022/testgorilla-tgo-ui-components-donut-chart.mjs +239 -142
  42. package/fesm2022/testgorilla-tgo-ui-components-donut-chart.mjs.map +1 -1
  43. package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs +599 -467
  44. package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs.map +1 -1
  45. package/fesm2022/testgorilla-tgo-ui-components-elevation-shadow.mjs +126 -70
  46. package/fesm2022/testgorilla-tgo-ui-components-elevation-shadow.mjs.map +1 -1
  47. package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs +324 -329
  48. package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs.map +1 -1
  49. package/fesm2022/testgorilla-tgo-ui-components-field.mjs +969 -648
  50. package/fesm2022/testgorilla-tgo-ui-components-field.mjs.map +1 -1
  51. package/fesm2022/testgorilla-tgo-ui-components-file-upload.mjs +553 -419
  52. package/fesm2022/testgorilla-tgo-ui-components-file-upload.mjs.map +1 -1
  53. package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs +847 -452
  54. package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs.map +1 -1
  55. package/fesm2022/testgorilla-tgo-ui-components-gaussian-chart.mjs +398 -302
  56. package/fesm2022/testgorilla-tgo-ui-components-gaussian-chart.mjs.map +1 -1
  57. package/fesm2022/testgorilla-tgo-ui-components-icon-label.mjs +162 -95
  58. package/fesm2022/testgorilla-tgo-ui-components-icon-label.mjs.map +1 -1
  59. package/fesm2022/testgorilla-tgo-ui-components-icon.mjs +1825 -1795
  60. package/fesm2022/testgorilla-tgo-ui-components-icon.mjs.map +1 -1
  61. package/fesm2022/testgorilla-tgo-ui-components-infinite-scroll-table.mjs +1018 -672
  62. package/fesm2022/testgorilla-tgo-ui-components-infinite-scroll-table.mjs.map +1 -1
  63. package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs +758 -368
  64. package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs.map +1 -1
  65. package/fesm2022/testgorilla-tgo-ui-components-logo.mjs +204 -212
  66. package/fesm2022/testgorilla-tgo-ui-components-logo.mjs.map +1 -1
  67. package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs +183 -48
  68. package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs.map +1 -1
  69. package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs +243 -79
  70. package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs.map +1 -1
  71. package/fesm2022/testgorilla-tgo-ui-components-multi-input.mjs +751 -361
  72. package/fesm2022/testgorilla-tgo-ui-components-multi-input.mjs.map +1 -1
  73. package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs +1122 -385
  74. package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs.map +1 -1
  75. package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs +689 -413
  76. package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs.map +1 -1
  77. package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs +227 -92
  78. package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs.map +1 -1
  79. package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs +174 -113
  80. package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs.map +1 -1
  81. package/fesm2022/testgorilla-tgo-ui-components-password-criteria.mjs +367 -165
  82. package/fesm2022/testgorilla-tgo-ui-components-password-criteria.mjs.map +1 -1
  83. package/fesm2022/testgorilla-tgo-ui-components-password-strength.mjs +253 -118
  84. package/fesm2022/testgorilla-tgo-ui-components-password-strength.mjs.map +1 -1
  85. package/fesm2022/testgorilla-tgo-ui-components-phone-input.mjs +730 -444
  86. package/fesm2022/testgorilla-tgo-ui-components-phone-input.mjs.map +1 -1
  87. package/fesm2022/testgorilla-tgo-ui-components-popover.mjs +533 -221
  88. package/fesm2022/testgorilla-tgo-ui-components-popover.mjs.map +1 -1
  89. package/fesm2022/testgorilla-tgo-ui-components-popup-tip.mjs +274 -76
  90. package/fesm2022/testgorilla-tgo-ui-components-popup-tip.mjs.map +1 -1
  91. package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs +184 -124
  92. package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs.map +1 -1
  93. package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs +1223 -574
  94. package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs.map +1 -1
  95. package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs +249 -160
  96. package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs.map +1 -1
  97. package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs +447 -439
  98. package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs.map +1 -1
  99. package/fesm2022/testgorilla-tgo-ui-components-rating.mjs +226 -150
  100. package/fesm2022/testgorilla-tgo-ui-components-rating.mjs.map +1 -1
  101. package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs +255 -67
  102. package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs.map +1 -1
  103. package/fesm2022/testgorilla-tgo-ui-components-scale.mjs +205 -162
  104. package/fesm2022/testgorilla-tgo-ui-components-scale.mjs.map +1 -1
  105. package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs +245 -153
  106. package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs.map +1 -1
  107. package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs +274 -140
  108. package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs.map +1 -1
  109. package/fesm2022/testgorilla-tgo-ui-components-segmented-toggle.mjs +319 -147
  110. package/fesm2022/testgorilla-tgo-ui-components-segmented-toggle.mjs.map +1 -1
  111. package/fesm2022/testgorilla-tgo-ui-components-selectable-card.mjs +286 -84
  112. package/fesm2022/testgorilla-tgo-ui-components-selectable-card.mjs.map +1 -1
  113. package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs +660 -208
  114. package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs.map +1 -1
  115. package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs +579 -320
  116. package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs.map +1 -1
  117. package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs +419 -200
  118. package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs.map +1 -1
  119. package/fesm2022/testgorilla-tgo-ui-components-skeleton.mjs +132 -80
  120. package/fesm2022/testgorilla-tgo-ui-components-skeleton.mjs.map +1 -1
  121. package/fesm2022/testgorilla-tgo-ui-components-slider.mjs +741 -390
  122. package/fesm2022/testgorilla-tgo-ui-components-slider.mjs.map +1 -1
  123. package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs +455 -329
  124. package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs.map +1 -1
  125. package/fesm2022/testgorilla-tgo-ui-components-spider-chart.mjs +543 -514
  126. package/fesm2022/testgorilla-tgo-ui-components-spider-chart.mjs.map +1 -1
  127. package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs +193 -104
  128. package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs.map +1 -1
  129. package/fesm2022/testgorilla-tgo-ui-components-stepper.mjs +760 -524
  130. package/fesm2022/testgorilla-tgo-ui-components-stepper.mjs.map +1 -1
  131. package/fesm2022/testgorilla-tgo-ui-components-table.mjs +714 -415
  132. package/fesm2022/testgorilla-tgo-ui-components-table.mjs.map +1 -1
  133. package/fesm2022/testgorilla-tgo-ui-components-tabs.mjs +847 -438
  134. package/fesm2022/testgorilla-tgo-ui-components-tabs.mjs.map +1 -1
  135. package/fesm2022/testgorilla-tgo-ui-components-tag.mjs +535 -275
  136. package/fesm2022/testgorilla-tgo-ui-components-tag.mjs.map +1 -1
  137. package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs +316 -246
  138. package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs.map +1 -1
  139. package/fesm2022/testgorilla-tgo-ui-components-tooltip.mjs +404 -284
  140. package/fesm2022/testgorilla-tgo-ui-components-tooltip.mjs.map +1 -1
  141. package/fesm2022/testgorilla-tgo-ui-components-universal-skills.mjs +664 -383
  142. package/fesm2022/testgorilla-tgo-ui-components-universal-skills.mjs.map +1 -1
  143. package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs +201 -112
  144. package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs.map +1 -1
  145. package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs +1014 -458
  146. package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs.map +1 -1
  147. package/fesm2022/testgorilla-tgo-ui.mjs +147 -155
  148. package/fesm2022/testgorilla-tgo-ui.mjs.map +1 -1
  149. package/mcp/catalog.json +1 -1
  150. package/package.json +16 -17
  151. package/projects/tgo-canopy-ui/theme/_palette.scss +23 -18
  152. package/types/testgorilla-tgo-ui-components-accordion.d.ts +214 -158
  153. package/types/testgorilla-tgo-ui-components-ai-audio-circle.d.ts +93 -69
  154. package/types/testgorilla-tgo-ui-components-ai-caveat.d.ts +37 -34
  155. package/types/testgorilla-tgo-ui-components-ai-feedback.d.ts +126 -86
  156. package/types/testgorilla-tgo-ui-components-alert-banner.d.ts +260 -185
  157. package/types/testgorilla-tgo-ui-components-audio-waveform.d.ts +96 -67
  158. package/types/testgorilla-tgo-ui-components-autocomplete-v2.d.ts +455 -256
  159. package/types/testgorilla-tgo-ui-components-autocomplete.d.ts +545 -390
  160. package/types/testgorilla-tgo-ui-components-avatar.d.ts +128 -102
  161. package/types/testgorilla-tgo-ui-components-badge.d.ts +191 -139
  162. package/types/testgorilla-tgo-ui-components-breadcrumb.d.ts +100 -62
  163. package/types/testgorilla-tgo-ui-components-button.d.ts +479 -340
  164. package/types/testgorilla-tgo-ui-components-card.d.ts +153 -114
  165. package/types/testgorilla-tgo-ui-components-checkbox.d.ts +299 -223
  166. package/types/testgorilla-tgo-ui-components-checklist.d.ts +149 -97
  167. package/types/testgorilla-tgo-ui-components-core.d.ts +307 -295
  168. package/types/testgorilla-tgo-ui-components-datepicker.d.ts +404 -299
  169. package/types/testgorilla-tgo-ui-components-device-control.d.ts +151 -81
  170. package/types/testgorilla-tgo-ui-components-dialog.d.ts +442 -329
  171. package/types/testgorilla-tgo-ui-components-divider.d.ts +64 -51
  172. package/types/testgorilla-tgo-ui-components-donut-chart.d.ts +41 -37
  173. package/types/testgorilla-tgo-ui-components-dropdown.d.ts +335 -241
  174. package/types/testgorilla-tgo-ui-components-elevation-shadow.d.ts +48 -43
  175. package/types/testgorilla-tgo-ui-components-empty-state.d.ts +317 -215
  176. package/types/testgorilla-tgo-ui-components-field.d.ts +559 -388
  177. package/types/testgorilla-tgo-ui-components-file-upload.d.ts +230 -168
  178. package/types/testgorilla-tgo-ui-components-filter-button.d.ts +263 -206
  179. package/types/testgorilla-tgo-ui-components-gaussian-chart.d.ts +107 -94
  180. package/types/testgorilla-tgo-ui-components-icon-label.d.ts +84 -61
  181. package/types/testgorilla-tgo-ui-components-icon.d.ts +137 -110
  182. package/types/testgorilla-tgo-ui-components-infinite-scroll-table.d.ts +429 -303
  183. package/types/testgorilla-tgo-ui-components-inline-field.d.ts +338 -254
  184. package/types/testgorilla-tgo-ui-components-logo.d.ts +119 -101
  185. package/types/testgorilla-tgo-ui-components-media-card.d.ts +51 -35
  186. package/types/testgorilla-tgo-ui-components-media-dialog.d.ts +40 -45
  187. package/types/testgorilla-tgo-ui-components-multi-input.d.ts +283 -194
  188. package/types/testgorilla-tgo-ui-components-navbar.d.ts +326 -208
  189. package/types/testgorilla-tgo-ui-components-overflow-menu.d.ts +276 -204
  190. package/types/testgorilla-tgo-ui-components-page-header.d.ts +67 -50
  191. package/types/testgorilla-tgo-ui-components-paginator.d.ts +103 -70
  192. package/types/testgorilla-tgo-ui-components-password-criteria.d.ts +67 -58
  193. package/types/testgorilla-tgo-ui-components-password-strength.d.ts +66 -57
  194. package/types/testgorilla-tgo-ui-components-phone-input.d.ts +217 -175
  195. package/types/testgorilla-tgo-ui-components-popover.d.ts +94 -53
  196. package/types/testgorilla-tgo-ui-components-popup-tip.d.ts +81 -44
  197. package/types/testgorilla-tgo-ui-components-progress-bar.d.ts +115 -84
  198. package/types/testgorilla-tgo-ui-components-prompt.d.ts +315 -219
  199. package/types/testgorilla-tgo-ui-components-radial-progress.d.ts +146 -107
  200. package/types/testgorilla-tgo-ui-components-radio-button.d.ts +296 -219
  201. package/types/testgorilla-tgo-ui-components-rating.d.ts +134 -95
  202. package/types/testgorilla-tgo-ui-components-scale-table.d.ts +67 -47
  203. package/types/testgorilla-tgo-ui-components-scale.d.ts +91 -66
  204. package/types/testgorilla-tgo-ui-components-segmented-bar.d.ts +118 -89
  205. package/types/testgorilla-tgo-ui-components-segmented-button.d.ts +107 -80
  206. package/types/testgorilla-tgo-ui-components-segmented-toggle.d.ts +138 -105
  207. package/types/testgorilla-tgo-ui-components-selectable-card.d.ts +90 -56
  208. package/types/testgorilla-tgo-ui-components-side-navigation.d.ts +183 -107
  209. package/types/testgorilla-tgo-ui-components-side-panel.d.ts +156 -145
  210. package/types/testgorilla-tgo-ui-components-side-sheet.d.ts +98 -89
  211. package/types/testgorilla-tgo-ui-components-skeleton.d.ts +50 -33
  212. package/types/testgorilla-tgo-ui-components-slider.d.ts +278 -198
  213. package/types/testgorilla-tgo-ui-components-snackbar.d.ts +211 -159
  214. package/types/testgorilla-tgo-ui-components-spider-chart.d.ts +140 -121
  215. package/types/testgorilla-tgo-ui-components-spinner.d.ts +93 -72
  216. package/types/testgorilla-tgo-ui-components-stepper.d.ts +480 -338
  217. package/types/testgorilla-tgo-ui-components-table.d.ts +280 -233
  218. package/types/testgorilla-tgo-ui-components-tabs.d.ts +282 -183
  219. package/types/testgorilla-tgo-ui-components-tag.d.ts +266 -193
  220. package/types/testgorilla-tgo-ui-components-toggle.d.ts +180 -132
  221. package/types/testgorilla-tgo-ui-components-tooltip.d.ts +142 -105
  222. package/types/testgorilla-tgo-ui-components-universal-skills.d.ts +165 -144
  223. package/types/testgorilla-tgo-ui-components-validation-error.d.ts +70 -51
  224. package/types/testgorilla-tgo-ui-components-write-with-ai.d.ts +210 -133
  225. package/types/testgorilla-tgo-ui.d.ts +52 -45
@@ -1,445 +1,731 @@
1
- import { FocusMonitor } from '@angular/cdk/a11y';
2
- import { NgClass, NgStyle, AsyncPipe, CommonModule } from '@angular/common';
3
- import * as i0 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';
6
- import * as i1 from '@angular/forms';
7
- import { NgControl, UntypedFormBuilder, UntypedFormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
8
- import { MAT_AUTOCOMPLETE_DEFAULT_OPTIONS } from '@angular/material/autocomplete';
9
- import { ErrorStateMatcher } from '@angular/material/core';
10
- import { MatFormField, MatLabel, MatPrefix, MatHint } from '@angular/material/form-field';
11
- import { MatInput, MatInputModule } from '@angular/material/input';
12
- import { MatSelect, MatSelectTrigger, MatOption, MatSelectModule } from '@angular/material/select';
13
- import { parsePhoneNumber } from 'libphonenumber-js';
14
- import { MatSelectSearchComponent, MatSelectSearchClearDirective, NgxMatSelectSearchModule } from 'ngx-mat-select-search';
15
- import { BehaviorSubject, Subject, combineLatest, debounceTime, take, filter, first, map, startWith, tap, delay } from 'rxjs';
16
- import { UiTranslatePipe, HasValidationErrorPipe } from '@testgorilla/tgo-ui/components/core';
17
- import { IconComponent, IconComponentModule } from '@testgorilla/tgo-ui/components/icon';
18
- import { ValidationErrorComponent, ValidationErrorModule } from '@testgorilla/tgo-ui/components/validation-error';
19
- import { MatIconModule } from '@angular/material/icon';
20
- import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
21
- import { SpinnerComponentModule } from '@testgorilla/tgo-ui/components/spinner';
22
-
23
- class JoinStringsPipe {
24
- transform(value, separator) {
25
- // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- an empty separator falls back to the default separator
26
- return value.filter(Boolean).join(separator ? separator : ' - ');
27
- }
28
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: JoinStringsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
29
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: JoinStringsPipe, isStandalone: true, name: "joinStrings" }); }
30
- }
31
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: JoinStringsPipe, decorators: [{
32
- type: Pipe,
33
- args: [{ name: 'joinStrings' }]
34
- }] });
35
-
36
- class PhoneInputComponent {
37
- /**
38
- * Phone number
39
- *
40
- * @type {string}
41
- * @memberof PhoneInputComponent
42
- */
43
- set value(value) {
44
- this.initialValue = this.initialValue || value;
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
47
- const parsed = parsePhoneNumber(value);
48
- const formatted = parsed.formatInternational();
49
- this.selectedCountry = this.getCountryByAlpha2Code(parsed.country) ?? this.selectedCountry;
50
- this.form.patchValue({ phone_number: formatted.replace(this.selectedCountry.callingCode, '') });
51
- }
52
- catch {
53
- if (value?.length <= 4) {
54
- this.selectedCountry = this.getCountryByCallingCode(value) ?? this.selectedCountry;
55
- }
56
- this.form.patchValue({ phone_number: value?.replace(this.selectedCountry?.callingCode, '') });
57
- }
58
- this.stateChanges.next();
59
- }
60
- get value() {
61
- return this.getNumberWithCountryCode();
62
- }
63
- /**
64
- * Country list for select
65
- *
66
- * @type {UICountry[]}
67
- * @memberof PhoneInputComponent
68
- */
69
- set countryList(countryList) {
70
- this.loadCountries$.next(countryList);
71
- this.selectedCountry = this.selectedCountry ?? countryList[0];
72
- }
73
- /**
74
- * Placeholder input
75
- *
76
- * @type {text}
77
- * @memberof PhoneInputComponent
78
- */
79
- set placeholder(value) {
80
- this.internalPlaceholder = value;
81
- this.stateChanges.next();
82
- }
83
- get placeholder() {
84
- return this.internalPlaceholder;
85
- }
86
- get countrySelectTestId() {
87
- return this.testId ? `${this.testId}-country` : null;
88
- }
89
- /**
90
- * Input field errors
91
- *
92
- * @type {string}
93
- * @memberof PhoneInputComponent
94
- */
95
- set errors(errors) {
96
- if (errors) {
97
- this._errors = errors?.filter(Boolean) ?? [];
98
- this.errorsLength = this.setErrorsLength();
99
- }
100
- }
101
- static { this.nextId = 0; }
102
- get shouldLabelFloat() {
103
- return true;
104
- }
105
- get empty() {
106
- return Boolean(this.form.value);
107
- }
108
- get errorState() {
109
- return this.errorMatcher.isErrorState(this.ngControl?.control, null);
110
- }
111
- constructor() {
112
- this.testId = null;
113
- // Empty by default: the library ships no copy for it, so apps pass an already-translated string.
114
- this.countryAriaLabel = '';
115
- /**
116
- *
117
- * Defines the application theme
118
- *
119
- * @type {ApplicationTheme}
120
- * @memberof PhoneInputComponent
121
- */
122
- this.applicationTheme = 'light';
123
- /**
124
- * Indicator of the phone input width
125
- * @property fullWidth
126
- * @type {boolean}
127
- * @memberof PhoneInputComponent
128
- */
129
- this.fullWidth = false;
130
- /**
131
- * Hide in build errors for Reactive Forms
132
- *
133
- * @type {number}
134
- * @memberof PhoneInputComponent
135
- */
136
- this.hideBuiltInErrors = false;
137
- /**
138
- * Hide label in errors
139
- *
140
- * @type {number}
141
- * @memberof PhoneInputComponent
142
- */
143
- this.hideLabelInErrors = false;
144
- this.countries = new BehaviorSubject([]);
145
- this.countries$ = this.countries.asObservable();
146
- this.ngControl = inject(NgControl, { optional: true, self: true });
147
- this.errorMatcher = inject(ErrorStateMatcher);
148
- this.fb = inject(UntypedFormBuilder);
149
- this.focusMonitor = inject(FocusMonitor);
150
- this.ref = inject(ChangeDetectorRef);
151
- this.defaultAppTheme = inject('CANOPYUI_DEFAULT_APPLICATION_THEME', {
152
- optional: true,
153
- });
154
- this.form = this.fb.group({
155
- phone_number: new UntypedFormControl(),
156
- });
157
- this.controlType = 'phone-number';
158
- this.loadCountries$ = new BehaviorSubject([]);
159
- this.countryCode = new BehaviorSubject('US');
160
- this.stateChanges = new Subject();
161
- this.selectFilterCtrl = new UntypedFormControl('');
162
- this.countryFlagSrc = 'assets/svg-country-flags/';
163
- this.id = `phone-number${PhoneInputComponent.nextId++}`;
164
- this.describedBy = '';
165
- this.DEFAULT_COUNTRY_CODE = 'US';
166
- this.destroyRef = inject(DestroyRef);
167
- this.trackByFn = (index, value) => value;
168
- if (this.ngControl !== null) {
169
- this.ngControl.valueAccessor = this;
170
- }
171
- if (this.defaultAppTheme) {
172
- this.applicationTheme = this.defaultAppTheme;
173
- }
174
- }
175
- /**
176
- * Used to mark component view as dirty when touched programmatically with markAsTouched/markAllAsTouched or errors
177
- * to display validation errors that might happen (e.g. required)
178
- */
179
- ngDoCheck() {
180
- if (this.ngControl?.touched || this.ngControl?.errors) {
181
- this.ref.markForCheck();
182
- }
183
- }
184
- ngOnInit() {
185
- this.loadCountries();
186
- this.preSelectCountry();
187
- this.subscribeToFocusEvents();
188
- }
189
- setErrorsLength() {
190
- if (this._errors) {
191
- return this._errors.filter(err => Boolean(err)).length > 0;
192
- }
193
- return false;
194
- }
195
- setDescribedByIds(ids) {
196
- this.userAriaDescribedBy = ids.join(' ');
197
- }
198
- writeValue(phoneNumber) {
199
- if (phoneNumber) {
200
- this.value = phoneNumber;
201
- }
202
- }
203
- registerOnChange(fn) {
204
- this.onChange = fn;
205
- }
206
- registerOnTouched(fn) {
207
- this.onTouch = fn;
208
- }
209
- setDisabledState(isDisabled) {
210
- if (isDisabled) {
211
- this.form.disable();
212
- }
213
- else {
214
- this.form.enable();
215
- }
216
- this.disabled = isDisabled;
217
- this.stateChanges.next();
218
- this.ref.markForCheck();
219
- }
220
- ngOnDestroy() {
221
- this.focusMonitor.stopMonitoring(this.input);
222
- this.focusMonitor.stopMonitoring(this.select);
223
- this.stateChanges.complete();
224
- }
225
- onOptionsSelected(value) {
226
- this.setCountry(value);
227
- }
228
- onInput(value) {
229
- this.value = (this.selectedCountry?.callingCode ?? '') + value;
230
- this.onChange(this.value);
231
- }
232
- filteredCountryTrackByMethod(index, el) {
233
- return el.alpha2Code;
234
- }
235
- setCountry(country) {
236
- if (country) {
237
- this.selectedCountry = country;
238
- }
239
- this.value = this.getNumberWithCountryCode();
240
- this.onChange(this.value);
241
- }
242
- getNumberWithCountryCode() {
243
- const nationalNumber = this.form.value?.phone_number;
244
- return nationalNumber ? (this.selectedCountry?.callingCode ?? '') + nationalNumber : '';
245
- }
246
- subscribeToFocusEvents() {
247
- const selectAndInputFocus$ = combineLatest([
248
- this.focusMonitor.monitor(this.select),
249
- this.focusMonitor.monitor(this.input),
250
- ]).pipe(debounceTime(10));
251
- selectAndInputFocus$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(([selectFocus, inputFocus]) => {
252
- this.focused = Boolean(selectFocus) || Boolean(inputFocus);
253
- this.stateChanges.next();
254
- });
255
- selectAndInputFocus$.pipe(take(1)).subscribe(() => {
256
- this.onTouch();
257
- });
258
- }
259
- preSelectCountry() {
260
- this.setDisabledState(true);
261
- combineLatest([
262
- this.countries$.pipe(filter(countries => countries.length > 0), first()),
263
- this.countryCode,
264
- ])
265
- .pipe(map(([_countries, selectedCountry]) => {
266
- if (!this.initialValue) {
267
- const country = this.getCountryByAlpha2Code(selectedCountry) ?? this.getCountryByAlpha2Code(this.DEFAULT_COUNTRY_CODE);
268
- this.setCountry(country);
269
- }
270
- else {
271
- this.value = this.initialValue;
272
- }
273
- this.setDisabledState(false);
274
- this.ref.markForCheck();
275
- }), takeUntilDestroyed(this.destroyRef))
276
- .subscribe();
277
- }
278
- getCountryByAlpha2Code(alpha2Code) {
279
- return this.countries.value.find(country => country.alpha2Code === alpha2Code);
280
- }
281
- getCountryByCallingCode(callingCode) {
282
- return this.countries.value.find(country => country.callingCode === callingCode);
283
- }
284
- loadCountries() {
285
- const searchText$ = this.selectFilterCtrl.valueChanges.pipe(debounceTime(100), startWith(''));
286
- combineLatest([this.loadCountries$, searchText$])
287
- .pipe(tap(([countries, searchText]) => {
288
- const searchTextLowerCase = searchText.toLowerCase();
289
- const filteredCountries = countries
290
- .filter(option => option.name.toLowerCase().includes(searchTextLowerCase) ||
291
- option.alpha2Code.toLowerCase().includes(searchTextLowerCase) ||
292
- option.callingCode.toLowerCase().includes(searchTextLowerCase))
293
- .sort((optionA, optionB) => (optionB.name.startsWith(searchText) ? 1 : -1));
294
- this.countries.next(filteredCountries);
295
- }), delay(1), tap(() => {
296
- const countryFound = this.getCountryByAlpha2Code(this.selectedCountry?.alpha2Code);
297
- this.selectedCountry = countryFound ?? this.selectedCountry;
298
- this.ref.markForCheck();
299
- }), takeUntilDestroyed(this.destroyRef))
300
- .subscribe();
301
- }
302
- disableClick(ev) {
303
- ev.preventDefault();
304
- ev.stopPropagation();
305
- }
306
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: PhoneInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
307
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: PhoneInputComponent, isStandalone: true, selector: "ui-phone-input", inputs: { value: "value", countryList: "countryList", placeholder: "placeholder", disabled: "disabled", required: "required", testId: "testId", countryAriaLabel: "countryAriaLabel", 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: [
308
- {
309
- provide: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS,
310
- useValue: { overlayPanelClass: 'phone-number-autocomplete' },
311
- },
312
- ], 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 type=\"button\" tabindex=\"-1\" aria-hidden=\"true\">\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 [aria-label]=\"countryAriaLabel\"\n [attr.data-testid]=\"countrySelectTestId\"\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 [attr.data-testid]=\"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.full-width{width:100%}:host .mat-mdc-form-field{min-width:320px}: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],[formArray],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 }); }
313
- }
314
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: PhoneInputComponent, decorators: [{
315
- type: Component,
316
- args: [{ selector: 'ui-phone-input', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
317
- {
318
- provide: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS,
319
- useValue: { overlayPanelClass: 'phone-number-autocomplete' },
320
- },
321
- ], imports: [
322
- MatFormField,
323
- FormsModule,
324
- ReactiveFormsModule,
325
- NgClass,
326
- MatLabel,
327
- MatPrefix,
328
- MatSelect,
329
- MatSelectTrigger,
330
- MatOption,
331
- MatSelectSearchComponent,
332
- IconComponent,
333
- MatSelectSearchClearDirective,
334
- MatInput,
335
- NgStyle,
336
- MatHint,
337
- ValidationErrorComponent,
338
- AsyncPipe,
339
- UiTranslatePipe,
340
- HasValidationErrorPipe,
341
- JoinStringsPipe,
342
- ], 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 type=\"button\" tabindex=\"-1\" aria-hidden=\"true\">\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 [aria-label]=\"countryAriaLabel\"\n [attr.data-testid]=\"countrySelectTestId\"\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 [attr.data-testid]=\"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.full-width{width:100%}:host .mat-mdc-form-field{min-width:320px}: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"] }]
343
- }], ctorParameters: () => [], propDecorators: { value: [{
344
- type: Input
345
- }], countryList: [{
346
- type: Input
347
- }], placeholder: [{
348
- type: Input
349
- }], disabled: [{
350
- type: HostBinding,
351
- args: ['attr.disabled']
352
- }, {
353
- type: Input
354
- }], required: [{
355
- type: Input
356
- }], testId: [{
357
- type: Input
358
- }], countryAriaLabel: [{
359
- type: Input
360
- }], applicationTheme: [{
361
- type: HostBinding,
362
- args: ['attr.theme']
363
- }, {
364
- type: Input
365
- }], fullWidth: [{
366
- type: Input
367
- }], errors: [{
368
- type: Input
369
- }], hideBuiltInErrors: [{
370
- type: Input
371
- }], hideLabelInErrors: [{
372
- type: Input
373
- }], input: [{
374
- type: ViewChild,
375
- args: [MatInput, { read: ElementRef, static: true }]
376
- }], select: [{
377
- type: ViewChild,
378
- args: [MatSelect, { read: ElementRef, static: true }]
379
- }], id: [{
380
- type: HostBinding
381
- }], shouldLabelFloat: [{
382
- type: HostBinding,
383
- args: ['class.floated']
384
- }], describedBy: [{
385
- type: HostBinding,
386
- args: ['attr.aria-describedby']
387
- }] } });
388
-
389
- class PhoneInputComponentModule {
390
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: PhoneInputComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
391
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: PhoneInputComponentModule, imports: [CommonModule,
392
- MatProgressSpinnerModule,
393
- ReactiveFormsModule,
394
- MatSelectModule,
395
- MatIconModule,
396
- MatInputModule,
397
- NgxMatSelectSearchModule,
398
- IconComponentModule,
399
- SpinnerComponentModule,
400
- UiTranslatePipe,
401
- ValidationErrorModule,
402
- HasValidationErrorPipe,
403
- PhoneInputComponent,
404
- JoinStringsPipe], exports: [PhoneInputComponent] }); }
405
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: PhoneInputComponentModule, imports: [CommonModule,
406
- MatProgressSpinnerModule,
407
- ReactiveFormsModule,
408
- MatSelectModule,
409
- MatIconModule,
410
- MatInputModule,
411
- NgxMatSelectSearchModule,
412
- IconComponentModule,
413
- SpinnerComponentModule,
414
- ValidationErrorModule,
415
- PhoneInputComponent] }); }
416
- }
417
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: PhoneInputComponentModule, decorators: [{
418
- type: NgModule,
419
- args: [{
420
- exports: [PhoneInputComponent],
421
- imports: [
422
- CommonModule,
423
- MatProgressSpinnerModule,
424
- ReactiveFormsModule,
425
- MatSelectModule,
426
- MatIconModule,
427
- MatInputModule,
428
- NgxMatSelectSearchModule,
429
- IconComponentModule,
430
- SpinnerComponentModule,
431
- UiTranslatePipe,
432
- ValidationErrorModule,
433
- HasValidationErrorPipe,
434
- PhoneInputComponent,
435
- JoinStringsPipe,
436
- ],
437
- }]
438
- }] });
439
-
440
- /**
441
- * Generated bundle index. Do not edit.
442
- */
443
-
1
+ import { FocusMonitor } from "@angular/cdk/a11y";
2
+ import { AsyncPipe, CommonModule, NgClass, NgStyle } from "@angular/common";
3
+ import * as i0 from "@angular/core";
4
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, DestroyRef, ElementRef, HostBinding, Input, NgModule, Pipe, ViewChild, inject } from "@angular/core";
5
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
6
+ import * as i1 from "@angular/forms";
7
+ import { FormsModule, NgControl, ReactiveFormsModule, UntypedFormBuilder, UntypedFormControl } from "@angular/forms";
8
+ import { MAT_AUTOCOMPLETE_DEFAULT_OPTIONS } from "@angular/material/autocomplete";
9
+ import { ErrorStateMatcher } from "@angular/material/core";
10
+ import { MatFormField, MatHint, MatLabel, MatPrefix } from "@angular/material/form-field";
11
+ import { MatInput, MatInputModule } from "@angular/material/input";
12
+ import { MatOption, MatSelect, MatSelectModule, MatSelectTrigger } from "@angular/material/select";
13
+ import { parsePhoneNumber } from "libphonenumber-js";
14
+ import { MatSelectSearchClearDirective, MatSelectSearchComponent, NgxMatSelectSearchModule } from "ngx-mat-select-search";
15
+ import { BehaviorSubject, Subject, combineLatest, debounceTime, delay, filter, first, map, startWith, take, tap } from "rxjs";
16
+ import { HasValidationErrorPipe, UiTranslatePipe } from "@testgorilla/tgo-ui/components/core";
17
+ import { IconComponent, IconComponentModule } from "@testgorilla/tgo-ui/components/icon";
18
+ import { ValidationErrorComponent, ValidationErrorModule } from "@testgorilla/tgo-ui/components/validation-error";
19
+ import { MatIconModule } from "@angular/material/icon";
20
+ import { MatProgressSpinnerModule } from "@angular/material/progress-spinner";
21
+ import { SpinnerComponentModule } from "@testgorilla/tgo-ui/components/spinner";
22
+ var JoinStringsPipe = class JoinStringsPipe {
23
+ transform(value, separator) {
24
+ return value.filter(Boolean).join(separator ? separator : " - ");
25
+ }
26
+ static {
27
+ this.ɵfac = i0.ɵɵngDeclareFactory({
28
+ minVersion: "12.0.0",
29
+ version: "22.2.4",
30
+ ngImport: i0,
31
+ type: JoinStringsPipe,
32
+ deps: [],
33
+ target: i0.ɵɵFactoryTarget.Pipe
34
+ });
35
+ }
36
+ static {
37
+ this.ɵpipe = i0.ɵɵngDeclarePipe({
38
+ minVersion: "14.0.0",
39
+ version: "22.2.4",
40
+ ngImport: i0,
41
+ type: JoinStringsPipe,
42
+ isStandalone: true,
43
+ name: "joinStrings"
44
+ });
45
+ }
46
+ };
47
+ i0.ɵɵngDeclareClassMetadata({
48
+ minVersion: "12.0.0",
49
+ version: "22.2.4",
50
+ ngImport: i0,
51
+ type: JoinStringsPipe,
52
+ decorators: [{
53
+ type: Pipe,
54
+ args: [{ name: "joinStrings" }]
55
+ }]
56
+ });
57
+ var PhoneInputComponent = class PhoneInputComponent {
58
+ set value(value) {
59
+ this.initialValue = this.initialValue || value;
60
+ try {
61
+ const parsed = parsePhoneNumber(value);
62
+ const formatted = parsed.formatInternational();
63
+ this.selectedCountry = this.getCountryByAlpha2Code(parsed.country) ?? this.selectedCountry;
64
+ this.form.patchValue({ phone_number: formatted.replace(this.selectedCountry.callingCode, "") });
65
+ } catch {
66
+ if (value?.length <= 4) this.selectedCountry = this.getCountryByCallingCode(value) ?? this.selectedCountry;
67
+ this.form.patchValue({ phone_number: value?.replace(this.selectedCountry?.callingCode, "") });
68
+ }
69
+ this.stateChanges.next();
70
+ }
71
+ get value() {
72
+ return this.getNumberWithCountryCode();
73
+ }
74
+ set countryList(countryList) {
75
+ this.loadCountries$.next(countryList);
76
+ this.selectedCountry = this.selectedCountry ?? countryList[0];
77
+ }
78
+ set placeholder(value) {
79
+ this.internalPlaceholder = value;
80
+ this.stateChanges.next();
81
+ }
82
+ get placeholder() {
83
+ return this.internalPlaceholder;
84
+ }
85
+ get countrySelectTestId() {
86
+ return this.testId ? `${this.testId}-country` : null;
87
+ }
88
+ set errors(errors) {
89
+ if (errors) {
90
+ this._errors = errors?.filter(Boolean) ?? [];
91
+ this.errorsLength = this.setErrorsLength();
92
+ }
93
+ }
94
+ static {
95
+ this.nextId = 0;
96
+ }
97
+ get shouldLabelFloat() {
98
+ return true;
99
+ }
100
+ get empty() {
101
+ return Boolean(this.form.value);
102
+ }
103
+ get errorState() {
104
+ return this.errorMatcher.isErrorState(this.ngControl?.control, null);
105
+ }
106
+ constructor() {
107
+ this.testId = null;
108
+ this.countryAriaLabel = "";
109
+ this.applicationTheme = "light";
110
+ this.fullWidth = false;
111
+ this.hideBuiltInErrors = false;
112
+ this.hideLabelInErrors = false;
113
+ this.countries = new BehaviorSubject([]);
114
+ this.countries$ = this.countries.asObservable();
115
+ this.ngControl = inject(NgControl, {
116
+ optional: true,
117
+ self: true
118
+ });
119
+ this.errorMatcher = inject(ErrorStateMatcher);
120
+ this.fb = inject(UntypedFormBuilder);
121
+ this.focusMonitor = inject(FocusMonitor);
122
+ this.ref = inject(ChangeDetectorRef);
123
+ this.defaultAppTheme = inject("CANOPYUI_DEFAULT_APPLICATION_THEME", { optional: true });
124
+ this.form = this.fb.group({ phone_number: new UntypedFormControl() });
125
+ this.controlType = "phone-number";
126
+ this.loadCountries$ = new BehaviorSubject([]);
127
+ this.countryCode = new BehaviorSubject("US");
128
+ this.stateChanges = new Subject();
129
+ this.selectFilterCtrl = new UntypedFormControl("");
130
+ this.countryFlagSrc = "assets/svg-country-flags/";
131
+ this.id = `phone-number${PhoneInputComponent.nextId++}`;
132
+ this.describedBy = "";
133
+ this.DEFAULT_COUNTRY_CODE = "US";
134
+ this.destroyRef = inject(DestroyRef);
135
+ this.trackByFn = (index, value) => value;
136
+ if (this.ngControl !== null) this.ngControl.valueAccessor = this;
137
+ if (this.defaultAppTheme) this.applicationTheme = this.defaultAppTheme;
138
+ }
139
+ ngDoCheck() {
140
+ if (this.ngControl?.touched || this.ngControl?.errors) this.ref.markForCheck();
141
+ }
142
+ ngOnInit() {
143
+ this.loadCountries();
144
+ this.preSelectCountry();
145
+ this.subscribeToFocusEvents();
146
+ }
147
+ setErrorsLength() {
148
+ if (this._errors) return this._errors.filter((err) => Boolean(err)).length > 0;
149
+ return false;
150
+ }
151
+ setDescribedByIds(ids) {
152
+ this.userAriaDescribedBy = ids.join(" ");
153
+ }
154
+ writeValue(phoneNumber) {
155
+ if (phoneNumber) this.value = phoneNumber;
156
+ }
157
+ registerOnChange(fn) {
158
+ this.onChange = fn;
159
+ }
160
+ registerOnTouched(fn) {
161
+ this.onTouch = fn;
162
+ }
163
+ setDisabledState(isDisabled) {
164
+ if (isDisabled) this.form.disable();
165
+ else this.form.enable();
166
+ this.disabled = isDisabled;
167
+ this.stateChanges.next();
168
+ this.ref.markForCheck();
169
+ }
170
+ ngOnDestroy() {
171
+ this.focusMonitor.stopMonitoring(this.input);
172
+ this.focusMonitor.stopMonitoring(this.select);
173
+ this.stateChanges.complete();
174
+ }
175
+ onOptionsSelected(value) {
176
+ this.setCountry(value);
177
+ }
178
+ onInput(value) {
179
+ this.value = (this.selectedCountry?.callingCode ?? "") + value;
180
+ this.onChange(this.value);
181
+ }
182
+ filteredCountryTrackByMethod(index, el) {
183
+ return el.alpha2Code;
184
+ }
185
+ setCountry(country) {
186
+ if (country) this.selectedCountry = country;
187
+ this.value = this.getNumberWithCountryCode();
188
+ this.onChange(this.value);
189
+ }
190
+ getNumberWithCountryCode() {
191
+ const nationalNumber = this.form.value?.phone_number;
192
+ return nationalNumber ? (this.selectedCountry?.callingCode ?? "") + nationalNumber : "";
193
+ }
194
+ subscribeToFocusEvents() {
195
+ const selectAndInputFocus$ = combineLatest([this.focusMonitor.monitor(this.select), this.focusMonitor.monitor(this.input)]).pipe(debounceTime(10));
196
+ selectAndInputFocus$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(([selectFocus, inputFocus]) => {
197
+ this.focused = Boolean(selectFocus) || Boolean(inputFocus);
198
+ this.stateChanges.next();
199
+ });
200
+ selectAndInputFocus$.pipe(take(1)).subscribe(() => {
201
+ this.onTouch();
202
+ });
203
+ }
204
+ preSelectCountry() {
205
+ this.setDisabledState(true);
206
+ combineLatest([this.countries$.pipe(filter((countries) => countries.length > 0), first()), this.countryCode]).pipe(map(([_countries, selectedCountry]) => {
207
+ if (!this.initialValue) {
208
+ const country = this.getCountryByAlpha2Code(selectedCountry) ?? this.getCountryByAlpha2Code(this.DEFAULT_COUNTRY_CODE);
209
+ this.setCountry(country);
210
+ } else this.value = this.initialValue;
211
+ this.setDisabledState(false);
212
+ this.ref.markForCheck();
213
+ }), takeUntilDestroyed(this.destroyRef)).subscribe();
214
+ }
215
+ getCountryByAlpha2Code(alpha2Code) {
216
+ return this.countries.value.find((country) => country.alpha2Code === alpha2Code);
217
+ }
218
+ getCountryByCallingCode(callingCode) {
219
+ return this.countries.value.find((country) => country.callingCode === callingCode);
220
+ }
221
+ loadCountries() {
222
+ const searchText$ = this.selectFilterCtrl.valueChanges.pipe(debounceTime(100), startWith(""));
223
+ combineLatest([this.loadCountries$, searchText$]).pipe(tap(([countries, searchText]) => {
224
+ const searchTextLowerCase = searchText.toLowerCase();
225
+ const filteredCountries = countries.filter((option) => option.name.toLowerCase().includes(searchTextLowerCase) || option.alpha2Code.toLowerCase().includes(searchTextLowerCase) || option.callingCode.toLowerCase().includes(searchTextLowerCase)).sort((optionA, optionB) => optionB.name.startsWith(searchText) ? 1 : -1);
226
+ this.countries.next(filteredCountries);
227
+ }), delay(1), tap(() => {
228
+ const countryFound = this.getCountryByAlpha2Code(this.selectedCountry?.alpha2Code);
229
+ this.selectedCountry = countryFound ?? this.selectedCountry;
230
+ this.ref.markForCheck();
231
+ }), takeUntilDestroyed(this.destroyRef)).subscribe();
232
+ }
233
+ disableClick(ev) {
234
+ ev.preventDefault();
235
+ ev.stopPropagation();
236
+ }
237
+ static {
238
+ this.ɵfac = i0.ɵɵngDeclareFactory({
239
+ minVersion: "12.0.0",
240
+ version: "22.2.4",
241
+ ngImport: i0,
242
+ type: PhoneInputComponent,
243
+ deps: [],
244
+ target: i0.ɵɵFactoryTarget.Component
245
+ });
246
+ }
247
+ static {
248
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
249
+ minVersion: "17.0.0",
250
+ version: "22.2.4",
251
+ type: PhoneInputComponent,
252
+ isStandalone: true,
253
+ selector: "ui-phone-input",
254
+ inputs: {
255
+ value: "value",
256
+ countryList: "countryList",
257
+ placeholder: "placeholder",
258
+ disabled: "disabled",
259
+ required: "required",
260
+ testId: "testId",
261
+ countryAriaLabel: "countryAriaLabel",
262
+ applicationTheme: "applicationTheme",
263
+ fullWidth: "fullWidth",
264
+ errors: "errors",
265
+ hideBuiltInErrors: "hideBuiltInErrors",
266
+ hideLabelInErrors: "hideLabelInErrors"
267
+ },
268
+ host: { properties: {
269
+ "attr.disabled": "this.disabled",
270
+ "attr.theme": "this.applicationTheme",
271
+ "id": "this.id",
272
+ "class.floated": "this.shouldLabelFloat",
273
+ "attr.aria-describedby": "this.describedBy"
274
+ } },
275
+ providers: [{
276
+ provide: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS,
277
+ useValue: { overlayPanelClass: "phone-number-autocomplete" }
278
+ }],
279
+ viewQueries: [{
280
+ propertyName: "input",
281
+ first: true,
282
+ predicate: MatInput,
283
+ descendants: true,
284
+ read: ElementRef,
285
+ static: true
286
+ }, {
287
+ propertyName: "select",
288
+ first: true,
289
+ predicate: MatSelect,
290
+ descendants: true,
291
+ read: ElementRef,
292
+ static: true
293
+ }],
294
+ ngImport: i0,
295
+ 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 type=\"button\" tabindex=\"-1\" aria-hidden=\"true\">\n <img\n [height]=\"20\"\n [width]=\"24\"\n [attr.src]=\"countryFlagSrc + selectedCountry?.alpha2Code?.toLowerCase() + '.svg'\"\n [alt]=\"'Country flag ' + $safeNavigationMigration(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 [aria-label]=\"countryAriaLabel\"\n [attr.data-testid]=\"countrySelectTestId\"\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 ' + $safeNavigationMigration(country?.alpha2Code?.toLowerCase())!\"\n />\n <small>{{\n $any([\n $safeNavigationMigration(country?.name),\n '(' + $safeNavigationMigration(country?.callingCode) + ')',\n ]) | joinStrings: ' '\n }}</small>\n </div>\n </mat-option>\n }\n </mat-select>\n </div>\n\n <input\n [attr.data-testid]=\"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 || ($safeNavigationMigration(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",
296
+ 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.full-width{width:100%}:host .mat-mdc-form-field{min-width:320px}: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"],
297
+ dependencies: [
298
+ {
299
+ kind: "component",
300
+ type: MatFormField,
301
+ selector: "mat-form-field",
302
+ inputs: [
303
+ "hideRequiredMarker",
304
+ "color",
305
+ "floatLabel",
306
+ "appearance",
307
+ "subscriptSizing",
308
+ "hintLabel"
309
+ ],
310
+ exportAs: ["matFormField"]
311
+ },
312
+ {
313
+ kind: "ngmodule",
314
+ type: FormsModule
315
+ },
316
+ {
317
+ kind: "directive",
318
+ type: i1.DefaultValueAccessor,
319
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
320
+ },
321
+ {
322
+ kind: "directive",
323
+ type: i1.NgControlStatus,
324
+ selector: "[formControlName],[ngModel],[formControl]"
325
+ },
326
+ {
327
+ kind: "directive",
328
+ type: i1.NgControlStatusGroup,
329
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
330
+ },
331
+ {
332
+ kind: "directive",
333
+ type: i1.RequiredValidator,
334
+ selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",
335
+ inputs: ["required"]
336
+ },
337
+ {
338
+ kind: "ngmodule",
339
+ type: ReactiveFormsModule
340
+ },
341
+ {
342
+ kind: "directive",
343
+ type: i1.FormControlDirective,
344
+ selector: "[formControl]",
345
+ inputs: [
346
+ "formControl",
347
+ "disabled",
348
+ "ngModel"
349
+ ],
350
+ outputs: ["ngModelChange"],
351
+ exportAs: ["ngForm"]
352
+ },
353
+ {
354
+ kind: "directive",
355
+ type: i1.FormGroupDirective,
356
+ selector: "[formGroup]",
357
+ inputs: ["formGroup"],
358
+ outputs: ["ngSubmit"],
359
+ exportAs: ["ngForm"]
360
+ },
361
+ {
362
+ kind: "directive",
363
+ type: i1.FormControlName,
364
+ selector: "[formControlName]",
365
+ inputs: [
366
+ "formControlName",
367
+ "disabled",
368
+ "ngModel"
369
+ ],
370
+ outputs: ["ngModelChange"]
371
+ },
372
+ {
373
+ kind: "directive",
374
+ type: NgClass,
375
+ selector: "[ngClass]",
376
+ inputs: ["class", "ngClass"]
377
+ },
378
+ {
379
+ kind: "directive",
380
+ type: MatLabel,
381
+ selector: "mat-label"
382
+ },
383
+ {
384
+ kind: "directive",
385
+ type: MatPrefix,
386
+ selector: "[matPrefix], [matIconPrefix], [matTextPrefix]",
387
+ inputs: ["matTextPrefix"]
388
+ },
389
+ {
390
+ kind: "component",
391
+ type: MatSelect,
392
+ selector: "mat-select",
393
+ inputs: [
394
+ "aria-describedby",
395
+ "panelClass",
396
+ "disabled",
397
+ "disableRipple",
398
+ "tabIndex",
399
+ "hideSingleSelectionIndicator",
400
+ "placeholder",
401
+ "required",
402
+ "multiple",
403
+ "disableOptionCentering",
404
+ "compareWith",
405
+ "value",
406
+ "aria-label",
407
+ "aria-labelledby",
408
+ "errorStateMatcher",
409
+ "typeaheadDebounceInterval",
410
+ "sortComparator",
411
+ "id",
412
+ "panelWidth",
413
+ "canSelectNullableOptions"
414
+ ],
415
+ outputs: [
416
+ "openedChange",
417
+ "opened",
418
+ "closed",
419
+ "selectionChange",
420
+ "valueChange"
421
+ ],
422
+ exportAs: ["matSelect"]
423
+ },
424
+ {
425
+ kind: "directive",
426
+ type: MatSelectTrigger,
427
+ selector: "mat-select-trigger"
428
+ },
429
+ {
430
+ kind: "component",
431
+ type: MatOption,
432
+ selector: "mat-option",
433
+ inputs: [
434
+ "value",
435
+ "id",
436
+ "disabled"
437
+ ],
438
+ outputs: ["onSelectionChange"],
439
+ exportAs: ["matOption"]
440
+ },
441
+ {
442
+ kind: "component",
443
+ type: MatSelectSearchComponent,
444
+ selector: "ngx-mat-select-search",
445
+ inputs: [
446
+ "placeholderLabel",
447
+ "type",
448
+ "closeIcon",
449
+ "closeSvgIcon",
450
+ "noEntriesFoundLabel",
451
+ "clearSearchInput",
452
+ "searching",
453
+ "disableInitialFocus",
454
+ "enableClearOnEscapePressed",
455
+ "preventHomeEndKeyPropagation",
456
+ "disableScrollToActiveOnOptionsChanged",
457
+ "ariaLabel",
458
+ "showToggleAllCheckbox",
459
+ "toggleAllCheckboxChecked",
460
+ "toggleAllCheckboxIndeterminate",
461
+ "toggleAllCheckboxTooltipMessage",
462
+ "toggleAllCheckboxTooltipPosition",
463
+ "hideClearSearchButton",
464
+ "alwaysRestoreSelectedOptionsMulti",
465
+ "recreateValuesArray"
466
+ ],
467
+ outputs: ["toggleAll"]
468
+ },
469
+ {
470
+ kind: "component",
471
+ type: IconComponent,
472
+ selector: "ui-icon",
473
+ inputs: [
474
+ "size",
475
+ "cssClass",
476
+ "name",
477
+ "color",
478
+ "filled",
479
+ "toggleIconStyle",
480
+ "applicationTheme",
481
+ "useFullIconName"
482
+ ]
483
+ },
484
+ {
485
+ kind: "directive",
486
+ type: MatSelectSearchClearDirective,
487
+ selector: "[ngxMatSelectSearchClear]"
488
+ },
489
+ {
490
+ kind: "directive",
491
+ type: MatInput,
492
+ selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
493
+ inputs: [
494
+ "disabled",
495
+ "id",
496
+ "placeholder",
497
+ "name",
498
+ "required",
499
+ "type",
500
+ "errorStateMatcher",
501
+ "aria-describedby",
502
+ "value",
503
+ "readonly",
504
+ "disabledInteractive"
505
+ ],
506
+ exportAs: ["matInput"]
507
+ },
508
+ {
509
+ kind: "directive",
510
+ type: NgStyle,
511
+ selector: "[ngStyle]",
512
+ inputs: ["ngStyle"]
513
+ },
514
+ {
515
+ kind: "directive",
516
+ type: MatHint,
517
+ selector: "mat-hint",
518
+ inputs: ["align", "id"]
519
+ },
520
+ {
521
+ kind: "component",
522
+ type: ValidationErrorComponent,
523
+ selector: "ui-validation-error",
524
+ inputs: [
525
+ "ngControl",
526
+ "touchedOn",
527
+ "errorMessage",
528
+ "label",
529
+ "applicationTheme",
530
+ "customErrors"
531
+ ]
532
+ },
533
+ {
534
+ kind: "pipe",
535
+ type: AsyncPipe,
536
+ name: "async"
537
+ },
538
+ {
539
+ kind: "pipe",
540
+ type: UiTranslatePipe,
541
+ name: "uiTranslate"
542
+ },
543
+ {
544
+ kind: "pipe",
545
+ type: HasValidationErrorPipe,
546
+ name: "hasValidationError"
547
+ },
548
+ {
549
+ kind: "pipe",
550
+ type: JoinStringsPipe,
551
+ name: "joinStrings"
552
+ }
553
+ ],
554
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
555
+ });
556
+ }
557
+ };
558
+ i0.ɵɵngDeclareClassMetadata({
559
+ minVersion: "12.0.0",
560
+ version: "22.2.4",
561
+ ngImport: i0,
562
+ type: PhoneInputComponent,
563
+ decorators: [{
564
+ type: Component,
565
+ args: [{
566
+ selector: "ui-phone-input",
567
+ changeDetection: ChangeDetectionStrategy.OnPush,
568
+ providers: [{
569
+ provide: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS,
570
+ useValue: { overlayPanelClass: "phone-number-autocomplete" }
571
+ }],
572
+ imports: [
573
+ MatFormField,
574
+ FormsModule,
575
+ ReactiveFormsModule,
576
+ NgClass,
577
+ MatLabel,
578
+ MatPrefix,
579
+ MatSelect,
580
+ MatSelectTrigger,
581
+ MatOption,
582
+ MatSelectSearchComponent,
583
+ IconComponent,
584
+ MatSelectSearchClearDirective,
585
+ MatInput,
586
+ NgStyle,
587
+ MatHint,
588
+ ValidationErrorComponent,
589
+ AsyncPipe,
590
+ UiTranslatePipe,
591
+ HasValidationErrorPipe,
592
+ JoinStringsPipe
593
+ ],
594
+ 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 type=\"button\" tabindex=\"-1\" aria-hidden=\"true\">\n <img\n [height]=\"20\"\n [width]=\"24\"\n [attr.src]=\"countryFlagSrc + selectedCountry?.alpha2Code?.toLowerCase() + '.svg'\"\n [alt]=\"'Country flag ' + $safeNavigationMigration(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 [aria-label]=\"countryAriaLabel\"\n [attr.data-testid]=\"countrySelectTestId\"\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 ' + $safeNavigationMigration(country?.alpha2Code?.toLowerCase())!\"\n />\n <small>{{\n $any([\n $safeNavigationMigration(country?.name),\n '(' + $safeNavigationMigration(country?.callingCode) + ')',\n ]) | joinStrings: ' '\n }}</small>\n </div>\n </mat-option>\n }\n </mat-select>\n </div>\n\n <input\n [attr.data-testid]=\"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 || ($safeNavigationMigration(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",
595
+ 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.full-width{width:100%}:host .mat-mdc-form-field{min-width:320px}: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"]
596
+ }]
597
+ }],
598
+ ctorParameters: () => [],
599
+ propDecorators: {
600
+ value: [{ type: Input }],
601
+ countryList: [{ type: Input }],
602
+ placeholder: [{ type: Input }],
603
+ disabled: [{
604
+ type: HostBinding,
605
+ args: ["attr.disabled"]
606
+ }, { type: Input }],
607
+ required: [{ type: Input }],
608
+ testId: [{ type: Input }],
609
+ countryAriaLabel: [{ type: Input }],
610
+ applicationTheme: [{
611
+ type: HostBinding,
612
+ args: ["attr.theme"]
613
+ }, { type: Input }],
614
+ fullWidth: [{ type: Input }],
615
+ errors: [{ type: Input }],
616
+ hideBuiltInErrors: [{ type: Input }],
617
+ hideLabelInErrors: [{ type: Input }],
618
+ input: [{
619
+ type: ViewChild,
620
+ args: [MatInput, {
621
+ read: ElementRef,
622
+ static: true
623
+ }]
624
+ }],
625
+ select: [{
626
+ type: ViewChild,
627
+ args: [MatSelect, {
628
+ read: ElementRef,
629
+ static: true
630
+ }]
631
+ }],
632
+ id: [{ type: HostBinding }],
633
+ shouldLabelFloat: [{
634
+ type: HostBinding,
635
+ args: ["class.floated"]
636
+ }],
637
+ describedBy: [{
638
+ type: HostBinding,
639
+ args: ["attr.aria-describedby"]
640
+ }]
641
+ }
642
+ });
643
+ var PhoneInputComponentModule = class PhoneInputComponentModule {
644
+ static {
645
+ this.ɵfac = i0.ɵɵngDeclareFactory({
646
+ minVersion: "12.0.0",
647
+ version: "22.2.4",
648
+ ngImport: i0,
649
+ type: PhoneInputComponentModule,
650
+ deps: [],
651
+ target: i0.ɵɵFactoryTarget.NgModule
652
+ });
653
+ }
654
+ static {
655
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
656
+ minVersion: "14.0.0",
657
+ version: "22.2.4",
658
+ ngImport: i0,
659
+ type: PhoneInputComponentModule,
660
+ imports: [
661
+ CommonModule,
662
+ MatProgressSpinnerModule,
663
+ ReactiveFormsModule,
664
+ MatSelectModule,
665
+ MatIconModule,
666
+ MatInputModule,
667
+ NgxMatSelectSearchModule,
668
+ IconComponentModule,
669
+ SpinnerComponentModule,
670
+ UiTranslatePipe,
671
+ ValidationErrorModule,
672
+ HasValidationErrorPipe,
673
+ PhoneInputComponent,
674
+ JoinStringsPipe
675
+ ],
676
+ exports: [PhoneInputComponent]
677
+ });
678
+ }
679
+ static {
680
+ this.ɵinj = i0.ɵɵngDeclareInjector({
681
+ minVersion: "12.0.0",
682
+ version: "22.2.4",
683
+ ngImport: i0,
684
+ type: PhoneInputComponentModule,
685
+ imports: [
686
+ CommonModule,
687
+ MatProgressSpinnerModule,
688
+ ReactiveFormsModule,
689
+ MatSelectModule,
690
+ MatIconModule,
691
+ MatInputModule,
692
+ NgxMatSelectSearchModule,
693
+ IconComponentModule,
694
+ SpinnerComponentModule,
695
+ ValidationErrorModule,
696
+ PhoneInputComponent
697
+ ]
698
+ });
699
+ }
700
+ };
701
+ i0.ɵɵngDeclareClassMetadata({
702
+ minVersion: "12.0.0",
703
+ version: "22.2.4",
704
+ ngImport: i0,
705
+ type: PhoneInputComponentModule,
706
+ decorators: [{
707
+ type: NgModule,
708
+ args: [{
709
+ exports: [PhoneInputComponent],
710
+ imports: [
711
+ CommonModule,
712
+ MatProgressSpinnerModule,
713
+ ReactiveFormsModule,
714
+ MatSelectModule,
715
+ MatIconModule,
716
+ MatInputModule,
717
+ NgxMatSelectSearchModule,
718
+ IconComponentModule,
719
+ SpinnerComponentModule,
720
+ UiTranslatePipe,
721
+ ValidationErrorModule,
722
+ HasValidationErrorPipe,
723
+ PhoneInputComponent,
724
+ JoinStringsPipe
725
+ ]
726
+ }]
727
+ }]
728
+ });
444
729
  export { JoinStringsPipe, PhoneInputComponent, PhoneInputComponentModule };
445
- //# sourceMappingURL=testgorilla-tgo-ui-components-phone-input.mjs.map
730
+
731
+ //# sourceMappingURL=testgorilla-tgo-ui-components-phone-input.mjs.map