@bravura/ui 1.21.10 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/CHANGELOG.md +25 -5
  2. package/README.md +1 -2
  3. package/alert/alert-container.component.d.ts +1 -1
  4. package/alert/alert-message.component.d.ts +1 -1
  5. package/alert/{bravura-ui-alert.d.ts → index.d.ts} +0 -0
  6. package/behavior/await.directive.d.ts +1 -1
  7. package/behavior/{bravura-ui-behavior.d.ts → index.d.ts} +0 -0
  8. package/behavior/sizing-monitor.directive.d.ts +1 -1
  9. package/behavior/sizing.directive.d.ts +1 -1
  10. package/common/{bravura-ui-common.d.ts → index.d.ts} +0 -0
  11. package/currency-input/currency-input.directive.d.ts +1 -1
  12. package/currency-input/{bravura-ui-currency-input.d.ts → index.d.ts} +0 -0
  13. package/decimal-input/decimal-input.directive.d.ts +1 -1
  14. package/decimal-input/{bravura-ui-decimal-input.d.ts → index.d.ts} +0 -0
  15. package/discrete-input/discrete-input.component.d.ts +6 -5
  16. package/discrete-input/{bravura-ui-discrete-input.d.ts → index.d.ts} +0 -0
  17. package/esm2020/alert/alert-container.component.mjs +201 -0
  18. package/esm2020/alert/alert-message.component.mjs +92 -0
  19. package/esm2020/alert/alert.module.mjs +22 -0
  20. package/{esm2015/alert/bravura-ui-alert.js → esm2020/alert/bravura-ui-alert.mjs} +0 -0
  21. package/{esm2015/alert/public-api.js → esm2020/alert/public-api.mjs} +0 -0
  22. package/{esm2015/behavior/await.directive.js → esm2020/behavior/await.directive.mjs} +4 -4
  23. package/esm2020/behavior/behavior.module.mjs +25 -0
  24. package/{esm2015/behavior/bravura-ui-behavior.js → esm2020/behavior/bravura-ui-behavior.mjs} +0 -0
  25. package/{esm2015/behavior/public-api.js → esm2020/behavior/public-api.mjs} +0 -0
  26. package/{esm2015/behavior/sizing-monitor.directive.js → esm2020/behavior/sizing-monitor.directive.mjs} +4 -4
  27. package/{esm2015/behavior/sizing.directive.js → esm2020/behavior/sizing.directive.mjs} +4 -4
  28. package/{esm2015/bravura-ui.js → esm2020/bravura-ui.mjs} +0 -0
  29. package/{esm2015/common/bravura-ui-common.js → esm2020/common/bravura-ui-common.mjs} +0 -0
  30. package/{esm2015/common/common-utils.js → esm2020/common/common-utils.mjs} +0 -0
  31. package/esm2020/common/common.module.mjs +52 -0
  32. package/{esm2015/common/public-api.js → esm2020/common/public-api.mjs} +0 -0
  33. package/{esm2015/currency-input/bravura-ui-currency-input.js → esm2020/currency-input/bravura-ui-currency-input.mjs} +0 -0
  34. package/esm2020/currency-input/currency-input.directive.mjs +279 -0
  35. package/esm2020/currency-input/currency-input.module.mjs +19 -0
  36. package/{esm2015/currency-input/public-api.js → esm2020/currency-input/public-api.mjs} +0 -0
  37. package/{esm2015/decimal-input/bravura-ui-decimal-input.js → esm2020/decimal-input/bravura-ui-decimal-input.mjs} +0 -0
  38. package/{esm2015/decimal-input/decimal-input.directive.js → esm2020/decimal-input/decimal-input.directive.mjs} +4 -4
  39. package/esm2020/decimal-input/decimal-input.module.mjs +19 -0
  40. package/{esm2015/decimal-input/public-api.js → esm2020/decimal-input/public-api.mjs} +0 -0
  41. package/{esm2015/discrete-input/bravura-ui-discrete-input.js → esm2020/discrete-input/bravura-ui-discrete-input.mjs} +0 -0
  42. package/esm2020/discrete-input/discrete-input.component.mjs +326 -0
  43. package/esm2020/discrete-input/discrete-input.module.mjs +21 -0
  44. package/{esm2015/discrete-input/public-api.js → esm2020/discrete-input/public-api.mjs} +0 -0
  45. package/{esm2015/file-upload/bravura-ui-file-upload.js → esm2020/file-upload/bravura-ui-file-upload.mjs} +0 -0
  46. package/esm2020/file-upload/file-upload.component.mjs +356 -0
  47. package/{esm2015/file-upload/file-upload.module.js → esm2020/file-upload/file-upload.module.mjs} +11 -13
  48. package/{esm2015/file-upload/file-upload.service.js → esm2020/file-upload/file-upload.service.mjs} +4 -4
  49. package/{esm2015/file-upload/public-api.js → esm2020/file-upload/public-api.mjs} +0 -0
  50. package/{esm2015/form-field/bravura-ui-form-field.js → esm2020/form-field/bravura-ui-form-field.mjs} +0 -0
  51. package/esm2020/form-field/form-field.component.mjs +96 -0
  52. package/esm2020/form-field/form-field.module.mjs +20 -0
  53. package/{esm2015/form-field/public-api.js → esm2020/form-field/public-api.mjs} +0 -0
  54. package/{esm2015/icon-font/bravura-ui-icon-font.js → esm2020/icon-font/bravura-ui-icon-font.mjs} +0 -0
  55. package/esm2020/icon-font/icon-font.module.mjs +22 -0
  56. package/{esm2015/icon-font/icon.directive.js → esm2020/icon-font/icon.directive.mjs} +4 -4
  57. package/{esm2015/icon-font/public-api.js → esm2020/icon-font/public-api.mjs} +0 -0
  58. package/{esm2015/icon-font/utilities.js → esm2020/icon-font/utilities.mjs} +0 -0
  59. package/esm2020/panel/bravura-ui-panel.mjs +5 -0
  60. package/esm2020/panel/panel.component.mjs +64 -0
  61. package/esm2020/panel/panel.module.mjs +20 -0
  62. package/esm2020/panel/public-api.mjs +2 -0
  63. package/{esm2015/phone-number/bravura-ui-phone-number.js → esm2020/phone-number/bravura-ui-phone-number.mjs} +0 -0
  64. package/esm2020/phone-number/phone-number.directive.mjs +187 -0
  65. package/esm2020/phone-number/phone-number.module.mjs +24 -0
  66. package/{esm2015/phone-number/phone-number.pipe.js → esm2020/phone-number/phone-number.pipe.mjs} +4 -4
  67. package/{esm2015/phone-number/phone-number.validator.js → esm2020/phone-number/phone-number.validator.mjs} +4 -4
  68. package/{esm2015/phone-number/public-api.js → esm2020/phone-number/public-api.mjs} +0 -0
  69. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  70. package/{esm2015/radio-panel/bravura-ui-radio-panel.js → esm2020/radio-panel/bravura-ui-radio-panel.mjs} +0 -0
  71. package/{esm2015/radio-panel/public-api.js → esm2020/radio-panel/public-api.mjs} +0 -0
  72. package/esm2020/radio-panel/radio-panel-item.component.mjs +97 -0
  73. package/esm2020/radio-panel/radio-panel.component.mjs +89 -0
  74. package/esm2020/radio-panel/radio-panel.module.mjs +25 -0
  75. package/{esm2015/selection-panel/bravura-ui-selection-panel.js → esm2020/selection-panel/bravura-ui-selection-panel.mjs} +0 -0
  76. package/{esm2015/selection-panel/public-api.js → esm2020/selection-panel/public-api.mjs} +0 -0
  77. package/esm2020/selection-panel/selection-panel-item.component.mjs +166 -0
  78. package/esm2020/selection-panel/selection-panel.directive.mjs +119 -0
  79. package/esm2020/selection-panel/selection-panel.module.mjs +23 -0
  80. package/{esm2015/skeletons/bravura-ui-skeletons.js → esm2020/skeletons/bravura-ui-skeletons.mjs} +0 -0
  81. package/{esm2015/skeletons/public-api.js → esm2020/skeletons/public-api.mjs} +0 -0
  82. package/esm2020/skeletons/skeleton-loader-presets.directive.mjs +83 -0
  83. package/{esm2015/skeletons/skeleton-loader.component.js → esm2020/skeletons/skeleton-loader.component.mjs} +4 -4
  84. package/esm2020/skeletons/skeletons.module.mjs +35 -0
  85. package/{esm2015/stepper/bravura-ui-stepper.js → esm2020/stepper/bravura-ui-stepper.mjs} +0 -0
  86. package/{esm2015/stepper/public-api.js → esm2020/stepper/public-api.mjs} +0 -0
  87. package/esm2020/stepper/stepper-animation.mjs +23 -0
  88. package/esm2020/stepper/stepper.component.mjs +166 -0
  89. package/{esm2015/stepper/stepper.module.js → esm2020/stepper/stepper.module.mjs} +13 -15
  90. package/{esm2015/tooltip/bravura-ui-tooltip.js → esm2020/tooltip/bravura-ui-tooltip.mjs} +0 -0
  91. package/{esm2015/tooltip/public-api.js → esm2020/tooltip/public-api.mjs} +0 -0
  92. package/esm2020/tooltip/tooltip.component.mjs +51 -0
  93. package/{esm2015/tooltip/tooltip.directive.js → esm2020/tooltip/tooltip.directive.mjs} +4 -4
  94. package/esm2020/tooltip/tooltip.module.mjs +25 -0
  95. package/fesm2015/bravura-ui-alert.mjs +324 -0
  96. package/fesm2015/bravura-ui-alert.mjs.map +1 -0
  97. package/fesm2015/bravura-ui-behavior.mjs +407 -0
  98. package/fesm2015/bravura-ui-behavior.mjs.map +1 -0
  99. package/fesm2015/bravura-ui-common.mjs +74 -0
  100. package/fesm2015/bravura-ui-common.mjs.map +1 -0
  101. package/fesm2015/bravura-ui-currency-input.mjs +303 -0
  102. package/fesm2015/bravura-ui-currency-input.mjs.map +1 -0
  103. package/fesm2015/bravura-ui-decimal-input.mjs +149 -0
  104. package/fesm2015/bravura-ui-decimal-input.mjs.map +1 -0
  105. package/fesm2015/bravura-ui-discrete-input.mjs +354 -0
  106. package/fesm2015/bravura-ui-discrete-input.mjs.map +1 -0
  107. package/fesm2015/bravura-ui-file-upload.mjs +434 -0
  108. package/fesm2015/bravura-ui-file-upload.mjs.map +1 -0
  109. package/fesm2015/{bravura-ui-form-field.js → bravura-ui-form-field.mjs} +12 -23
  110. package/fesm2015/bravura-ui-form-field.mjs.map +1 -0
  111. package/fesm2015/{bravura-ui-icon-font.js → bravura-ui-icon-font.mjs} +8 -8
  112. package/fesm2015/bravura-ui-icon-font.mjs.map +1 -0
  113. package/fesm2015/bravura-ui-panel.mjs +87 -0
  114. package/fesm2015/bravura-ui-panel.mjs.map +1 -0
  115. package/fesm2015/{bravura-ui-phone-number.js → bravura-ui-phone-number.mjs} +34 -30
  116. package/fesm2015/bravura-ui-phone-number.mjs.map +1 -0
  117. package/fesm2015/bravura-ui-radio-panel.mjs +212 -0
  118. package/fesm2015/bravura-ui-radio-panel.mjs.map +1 -0
  119. package/fesm2015/{bravura-ui-selection-panel.js → bravura-ui-selection-panel.mjs} +24 -28
  120. package/fesm2015/bravura-ui-selection-panel.mjs.map +1 -0
  121. package/fesm2015/bravura-ui-skeletons.mjs +195 -0
  122. package/fesm2015/bravura-ui-skeletons.mjs.map +1 -0
  123. package/fesm2015/bravura-ui-stepper.mjs +243 -0
  124. package/fesm2015/bravura-ui-stepper.mjs.map +1 -0
  125. package/fesm2015/bravura-ui-tooltip.mjs +195 -0
  126. package/fesm2015/bravura-ui-tooltip.mjs.map +1 -0
  127. package/fesm2015/{bravura-ui.js → bravura-ui.mjs} +1 -1
  128. package/fesm2015/bravura-ui.mjs.map +1 -0
  129. package/fesm2020/bravura-ui-alert.mjs +312 -0
  130. package/fesm2020/bravura-ui-alert.mjs.map +1 -0
  131. package/{fesm2015/bravura-ui-behavior.js → fesm2020/bravura-ui-behavior.mjs} +14 -14
  132. package/fesm2020/bravura-ui-behavior.mjs.map +1 -0
  133. package/{fesm2015/bravura-ui-common.js → fesm2020/bravura-ui-common.mjs} +7 -7
  134. package/fesm2020/bravura-ui-common.mjs.map +1 -0
  135. package/{fesm2015/bravura-ui-currency-input.js → fesm2020/bravura-ui-currency-input.mjs} +9 -10
  136. package/fesm2020/bravura-ui-currency-input.mjs.map +1 -0
  137. package/{fesm2015/bravura-ui-decimal-input.js → fesm2020/bravura-ui-decimal-input.mjs} +8 -8
  138. package/fesm2020/bravura-ui-decimal-input.mjs.map +1 -0
  139. package/{fesm2015/bravura-ui-discrete-input.js → fesm2020/bravura-ui-discrete-input.mjs} +18 -26
  140. package/fesm2020/bravura-ui-discrete-input.mjs.map +1 -0
  141. package/fesm2020/bravura-ui-file-upload.mjs +430 -0
  142. package/fesm2020/bravura-ui-file-upload.mjs.map +1 -0
  143. package/fesm2020/bravura-ui-form-field.mjs +119 -0
  144. package/fesm2020/bravura-ui-form-field.mjs.map +1 -0
  145. package/fesm2020/bravura-ui-icon-font.mjs +178 -0
  146. package/fesm2020/bravura-ui-icon-font.mjs.map +1 -0
  147. package/fesm2020/bravura-ui-panel.mjs +87 -0
  148. package/fesm2020/bravura-ui-panel.mjs.map +1 -0
  149. package/fesm2020/bravura-ui-phone-number.mjs +317 -0
  150. package/fesm2020/bravura-ui-phone-number.mjs.map +1 -0
  151. package/fesm2020/bravura-ui-radio-panel.mjs +209 -0
  152. package/fesm2020/bravura-ui-radio-panel.mjs.map +1 -0
  153. package/fesm2020/bravura-ui-selection-panel.mjs +306 -0
  154. package/fesm2020/bravura-ui-selection-panel.mjs.map +1 -0
  155. package/{fesm2015/bravura-ui-skeletons.js → fesm2020/bravura-ui-skeletons.mjs} +13 -13
  156. package/fesm2020/bravura-ui-skeletons.mjs.map +1 -0
  157. package/{fesm2015/bravura-ui-stepper.js → fesm2020/bravura-ui-stepper.mjs} +27 -44
  158. package/fesm2020/bravura-ui-stepper.mjs.map +1 -0
  159. package/{fesm2015/bravura-ui-tooltip.js → fesm2020/bravura-ui-tooltip.mjs} +13 -22
  160. package/fesm2020/bravura-ui-tooltip.mjs.map +1 -0
  161. package/fesm2020/bravura-ui.mjs +8 -0
  162. package/fesm2020/bravura-ui.mjs.map +1 -0
  163. package/file-upload/file-upload.component.d.ts +1 -1
  164. package/file-upload/{bravura-ui-file-upload.d.ts → index.d.ts} +0 -0
  165. package/form-field/form-field.component.d.ts +1 -1
  166. package/form-field/{bravura-ui-form-field.d.ts → index.d.ts} +0 -0
  167. package/icon-font/icon.directive.d.ts +1 -1
  168. package/icon-font/{bravura-ui-icon-font.d.ts → index.d.ts} +0 -0
  169. package/{bravura-ui.d.ts → index.d.ts} +0 -0
  170. package/package.json +157 -14
  171. package/panel/index.d.ts +5 -0
  172. package/panel/panel.component.d.ts +46 -0
  173. package/panel/panel.module.d.ts +11 -0
  174. package/panel/public-api.d.ts +1 -0
  175. package/phone-number/{bravura-ui-phone-number.d.ts → index.d.ts} +0 -0
  176. package/phone-number/phone-number.directive.d.ts +1 -1
  177. package/phone-number/phone-number.pipe.d.ts +1 -1
  178. package/phone-number/phone-number.validator.d.ts +1 -1
  179. package/radio-panel/{bravura-ui-radio-panel.d.ts → index.d.ts} +0 -0
  180. package/radio-panel/radio-panel-item.component.d.ts +1 -1
  181. package/radio-panel/radio-panel.component.d.ts +1 -1
  182. package/selection-panel/{bravura-ui-selection-panel.d.ts → index.d.ts} +0 -0
  183. package/selection-panel/selection-panel-item.component.d.ts +1 -1
  184. package/selection-panel/selection-panel.directive.d.ts +1 -1
  185. package/skeletons/{bravura-ui-skeletons.d.ts → index.d.ts} +0 -0
  186. package/skeletons/skeleton-loader-presets.directive.d.ts +1 -1
  187. package/skeletons/skeleton-loader.component.d.ts +1 -1
  188. package/stepper/{bravura-ui-stepper.d.ts → index.d.ts} +0 -0
  189. package/stepper/stepper.component.d.ts +1 -1
  190. package/theme/_ui-theme.scss +1 -1
  191. package/tooltip/{bravura-ui-tooltip.d.ts → index.d.ts} +0 -0
  192. package/tooltip/tooltip.component.d.ts +1 -1
  193. package/tooltip/tooltip.directive.d.ts +1 -1
  194. package/alert/package.json +0 -10
  195. package/behavior/package.json +0 -10
  196. package/bundles/bravura-ui-alert.umd.js +0 -745
  197. package/bundles/bravura-ui-alert.umd.js.map +0 -1
  198. package/bundles/bravura-ui-behavior.umd.js +0 -788
  199. package/bundles/bravura-ui-behavior.umd.js.map +0 -1
  200. package/bundles/bravura-ui-common.umd.js +0 -103
  201. package/bundles/bravura-ui-common.umd.js.map +0 -1
  202. package/bundles/bravura-ui-currency-input.umd.js +0 -335
  203. package/bundles/bravura-ui-currency-input.umd.js.map +0 -1
  204. package/bundles/bravura-ui-decimal-input.umd.js +0 -178
  205. package/bundles/bravura-ui-decimal-input.umd.js.map +0 -1
  206. package/bundles/bravura-ui-discrete-input.umd.js +0 -747
  207. package/bundles/bravura-ui-discrete-input.umd.js.map +0 -1
  208. package/bundles/bravura-ui-file-upload.umd.js +0 -845
  209. package/bundles/bravura-ui-file-upload.umd.js.map +0 -1
  210. package/bundles/bravura-ui-form-field.umd.js +0 -494
  211. package/bundles/bravura-ui-form-field.umd.js.map +0 -1
  212. package/bundles/bravura-ui-icon-font.umd.js +0 -539
  213. package/bundles/bravura-ui-icon-font.umd.js.map +0 -1
  214. package/bundles/bravura-ui-phone-number.umd.js +0 -690
  215. package/bundles/bravura-ui-phone-number.umd.js.map +0 -1
  216. package/bundles/bravura-ui-radio-panel.umd.js +0 -595
  217. package/bundles/bravura-ui-radio-panel.umd.js.map +0 -1
  218. package/bundles/bravura-ui-selection-panel.umd.js +0 -699
  219. package/bundles/bravura-ui-selection-panel.umd.js.map +0 -1
  220. package/bundles/bravura-ui-skeletons.umd.js +0 -525
  221. package/bundles/bravura-ui-skeletons.umd.js.map +0 -1
  222. package/bundles/bravura-ui-stepper.umd.js +0 -613
  223. package/bundles/bravura-ui-stepper.umd.js.map +0 -1
  224. package/bundles/bravura-ui-tooltip.umd.js +0 -586
  225. package/bundles/bravura-ui-tooltip.umd.js.map +0 -1
  226. package/bundles/bravura-ui.umd.js +0 -18
  227. package/bundles/bravura-ui.umd.js.map +0 -1
  228. package/common/package.json +0 -10
  229. package/currency-input/package.json +0 -10
  230. package/decimal-input/package.json +0 -10
  231. package/discrete-input/package.json +0 -10
  232. package/esm2015/alert/alert-container.component.js +0 -220
  233. package/esm2015/alert/alert-message.component.js +0 -98
  234. package/esm2015/alert/alert.module.js +0 -22
  235. package/esm2015/behavior/behavior.module.js +0 -25
  236. package/esm2015/common/common.module.js +0 -52
  237. package/esm2015/currency-input/currency-input.directive.js +0 -280
  238. package/esm2015/currency-input/currency-input.module.js +0 -19
  239. package/esm2015/decimal-input/decimal-input.module.js +0 -19
  240. package/esm2015/discrete-input/discrete-input.component.js +0 -334
  241. package/esm2015/discrete-input/discrete-input.module.js +0 -21
  242. package/esm2015/file-upload/file-upload.component.js +0 -367
  243. package/esm2015/form-field/form-field.component.js +0 -107
  244. package/esm2015/form-field/form-field.module.js +0 -20
  245. package/esm2015/icon-font/icon-font.module.js +0 -22
  246. package/esm2015/phone-number/phone-number.directive.js +0 -192
  247. package/esm2015/phone-number/phone-number.module.js +0 -24
  248. package/esm2015/radio-panel/radio-panel-item.component.js +0 -109
  249. package/esm2015/radio-panel/radio-panel.component.js +0 -98
  250. package/esm2015/radio-panel/radio-panel.module.js +0 -25
  251. package/esm2015/selection-panel/selection-panel-item.component.js +0 -174
  252. package/esm2015/selection-panel/selection-panel.directive.js +0 -120
  253. package/esm2015/selection-panel/selection-panel.module.js +0 -23
  254. package/esm2015/skeletons/skeleton-loader-presets.directive.js +0 -83
  255. package/esm2015/skeletons/skeletons.module.js +0 -35
  256. package/esm2015/stepper/stepper-animation.js +0 -23
  257. package/esm2015/stepper/stepper.component.js +0 -181
  258. package/esm2015/tooltip/tooltip.component.js +0 -59
  259. package/esm2015/tooltip/tooltip.module.js +0 -26
  260. package/fesm2015/bravura-ui-alert.js +0 -337
  261. package/fesm2015/bravura-ui-alert.js.map +0 -1
  262. package/fesm2015/bravura-ui-behavior.js.map +0 -1
  263. package/fesm2015/bravura-ui-common.js.map +0 -1
  264. package/fesm2015/bravura-ui-currency-input.js.map +0 -1
  265. package/fesm2015/bravura-ui-decimal-input.js.map +0 -1
  266. package/fesm2015/bravura-ui-discrete-input.js.map +0 -1
  267. package/fesm2015/bravura-ui-file-upload.js +0 -443
  268. package/fesm2015/bravura-ui-file-upload.js.map +0 -1
  269. package/fesm2015/bravura-ui-form-field.js.map +0 -1
  270. package/fesm2015/bravura-ui-icon-font.js.map +0 -1
  271. package/fesm2015/bravura-ui-phone-number.js.map +0 -1
  272. package/fesm2015/bravura-ui-radio-panel.js +0 -230
  273. package/fesm2015/bravura-ui-radio-panel.js.map +0 -1
  274. package/fesm2015/bravura-ui-selection-panel.js.map +0 -1
  275. package/fesm2015/bravura-ui-skeletons.js.map +0 -1
  276. package/fesm2015/bravura-ui-stepper.js.map +0 -1
  277. package/fesm2015/bravura-ui-tooltip.js.map +0 -1
  278. package/fesm2015/bravura-ui.js.map +0 -1
  279. package/file-upload/package.json +0 -10
  280. package/form-field/package.json +0 -10
  281. package/icon-font/package.json +0 -10
  282. package/phone-number/package.json +0 -10
  283. package/radio-panel/package.json +0 -10
  284. package/selection-panel/package.json +0 -10
  285. package/skeletons/package.json +0 -10
  286. package/stepper/package.json +0 -10
  287. package/tooltip/package.json +0 -10
@@ -1,690 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('intl-tel-input'), require('rxjs'), require('rxjs/operators'), require('@angular/forms'), require('@angular/material/form-field')) :
3
- typeof define === 'function' && define.amd ? define('@bravura/ui/phone-number', ['exports', '@angular/common', '@angular/core', 'intl-tel-input', 'rxjs', 'rxjs/operators', '@angular/forms', '@angular/material/form-field'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.bravura = global.bravura || {}, global.bravura.ui = global.bravura.ui || {}, global.bravura.ui["phone-number"] = {}), global.ng.common, global.ng.core, global.intlTelInput, global.rxjs, global.rxjs.operators, global.ng.forms, global.ng.material.formField));
5
- })(this, (function (exports, common, i0, intlTelInput, rxjs, operators, i1, i2) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- function _interopNamespace(e) {
10
- if (e && e.__esModule) return e;
11
- var n = Object.create(null);
12
- if (e) {
13
- Object.keys(e).forEach(function (k) {
14
- if (k !== 'default') {
15
- var d = Object.getOwnPropertyDescriptor(e, k);
16
- Object.defineProperty(n, k, d.get ? d : {
17
- enumerable: true,
18
- get: function () { return e[k]; }
19
- });
20
- }
21
- });
22
- }
23
- n["default"] = e;
24
- return Object.freeze(n);
25
- }
26
-
27
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
- var intlTelInput__default = /*#__PURE__*/_interopDefaultLegacy(intlTelInput);
29
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
30
- var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
31
-
32
- /******************************************************************************
33
- Copyright (c) Microsoft Corporation.
34
-
35
- Permission to use, copy, modify, and/or distribute this software for any
36
- purpose with or without fee is hereby granted.
37
-
38
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
39
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
40
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
41
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
42
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
43
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
44
- PERFORMANCE OF THIS SOFTWARE.
45
- ***************************************************************************** */
46
- /* global Reflect, Promise */
47
- var extendStatics = function (d, b) {
48
- extendStatics = Object.setPrototypeOf ||
49
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
50
- function (d, b) { for (var p in b)
51
- if (Object.prototype.hasOwnProperty.call(b, p))
52
- d[p] = b[p]; };
53
- return extendStatics(d, b);
54
- };
55
- function __extends(d, b) {
56
- if (typeof b !== "function" && b !== null)
57
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
58
- extendStatics(d, b);
59
- function __() { this.constructor = d; }
60
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
61
- }
62
- var __assign = function () {
63
- __assign = Object.assign || function __assign(t) {
64
- for (var s, i = 1, n = arguments.length; i < n; i++) {
65
- s = arguments[i];
66
- for (var p in s)
67
- if (Object.prototype.hasOwnProperty.call(s, p))
68
- t[p] = s[p];
69
- }
70
- return t;
71
- };
72
- return __assign.apply(this, arguments);
73
- };
74
- function __rest(s, e) {
75
- var t = {};
76
- for (var p in s)
77
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
78
- t[p] = s[p];
79
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
80
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
81
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
82
- t[p[i]] = s[p[i]];
83
- }
84
- return t;
85
- }
86
- function __decorate(decorators, target, key, desc) {
87
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
88
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
89
- r = Reflect.decorate(decorators, target, key, desc);
90
- else
91
- for (var i = decorators.length - 1; i >= 0; i--)
92
- if (d = decorators[i])
93
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
94
- return c > 3 && r && Object.defineProperty(target, key, r), r;
95
- }
96
- function __param(paramIndex, decorator) {
97
- return function (target, key) { decorator(target, key, paramIndex); };
98
- }
99
- function __metadata(metadataKey, metadataValue) {
100
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
101
- return Reflect.metadata(metadataKey, metadataValue);
102
- }
103
- function __awaiter(thisArg, _arguments, P, generator) {
104
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
105
- return new (P || (P = Promise))(function (resolve, reject) {
106
- function fulfilled(value) { try {
107
- step(generator.next(value));
108
- }
109
- catch (e) {
110
- reject(e);
111
- } }
112
- function rejected(value) { try {
113
- step(generator["throw"](value));
114
- }
115
- catch (e) {
116
- reject(e);
117
- } }
118
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
119
- step((generator = generator.apply(thisArg, _arguments || [])).next());
120
- });
121
- }
122
- function __generator(thisArg, body) {
123
- var _ = { label: 0, sent: function () { if (t[0] & 1)
124
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
125
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
126
- function verb(n) { return function (v) { return step([n, v]); }; }
127
- function step(op) {
128
- if (f)
129
- throw new TypeError("Generator is already executing.");
130
- while (_)
131
- try {
132
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
133
- return t;
134
- if (y = 0, t)
135
- op = [op[0] & 2, t.value];
136
- switch (op[0]) {
137
- case 0:
138
- case 1:
139
- t = op;
140
- break;
141
- case 4:
142
- _.label++;
143
- return { value: op[1], done: false };
144
- case 5:
145
- _.label++;
146
- y = op[1];
147
- op = [0];
148
- continue;
149
- case 7:
150
- op = _.ops.pop();
151
- _.trys.pop();
152
- continue;
153
- default:
154
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
155
- _ = 0;
156
- continue;
157
- }
158
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
159
- _.label = op[1];
160
- break;
161
- }
162
- if (op[0] === 6 && _.label < t[1]) {
163
- _.label = t[1];
164
- t = op;
165
- break;
166
- }
167
- if (t && _.label < t[2]) {
168
- _.label = t[2];
169
- _.ops.push(op);
170
- break;
171
- }
172
- if (t[2])
173
- _.ops.pop();
174
- _.trys.pop();
175
- continue;
176
- }
177
- op = body.call(thisArg, _);
178
- }
179
- catch (e) {
180
- op = [6, e];
181
- y = 0;
182
- }
183
- finally {
184
- f = t = 0;
185
- }
186
- if (op[0] & 5)
187
- throw op[1];
188
- return { value: op[0] ? op[1] : void 0, done: true };
189
- }
190
- }
191
- var __createBinding = Object.create ? (function (o, m, k, k2) {
192
- if (k2 === undefined)
193
- k2 = k;
194
- var desc = Object.getOwnPropertyDescriptor(m, k);
195
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
196
- desc = { enumerable: true, get: function () { return m[k]; } };
197
- }
198
- Object.defineProperty(o, k2, desc);
199
- }) : (function (o, m, k, k2) {
200
- if (k2 === undefined)
201
- k2 = k;
202
- o[k2] = m[k];
203
- });
204
- function __exportStar(m, o) {
205
- for (var p in m)
206
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
207
- __createBinding(o, m, p);
208
- }
209
- function __values(o) {
210
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
211
- if (m)
212
- return m.call(o);
213
- if (o && typeof o.length === "number")
214
- return {
215
- next: function () {
216
- if (o && i >= o.length)
217
- o = void 0;
218
- return { value: o && o[i++], done: !o };
219
- }
220
- };
221
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
222
- }
223
- function __read(o, n) {
224
- var m = typeof Symbol === "function" && o[Symbol.iterator];
225
- if (!m)
226
- return o;
227
- var i = m.call(o), r, ar = [], e;
228
- try {
229
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
230
- ar.push(r.value);
231
- }
232
- catch (error) {
233
- e = { error: error };
234
- }
235
- finally {
236
- try {
237
- if (r && !r.done && (m = i["return"]))
238
- m.call(i);
239
- }
240
- finally {
241
- if (e)
242
- throw e.error;
243
- }
244
- }
245
- return ar;
246
- }
247
- /** @deprecated */
248
- function __spread() {
249
- for (var ar = [], i = 0; i < arguments.length; i++)
250
- ar = ar.concat(__read(arguments[i]));
251
- return ar;
252
- }
253
- /** @deprecated */
254
- function __spreadArrays() {
255
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
256
- s += arguments[i].length;
257
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
258
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
259
- r[k] = a[j];
260
- return r;
261
- }
262
- function __spreadArray(to, from, pack) {
263
- if (pack || arguments.length === 2)
264
- for (var i = 0, l = from.length, ar; i < l; i++) {
265
- if (ar || !(i in from)) {
266
- if (!ar)
267
- ar = Array.prototype.slice.call(from, 0, i);
268
- ar[i] = from[i];
269
- }
270
- }
271
- return to.concat(ar || Array.prototype.slice.call(from));
272
- }
273
- function __await(v) {
274
- return this instanceof __await ? (this.v = v, this) : new __await(v);
275
- }
276
- function __asyncGenerator(thisArg, _arguments, generator) {
277
- if (!Symbol.asyncIterator)
278
- throw new TypeError("Symbol.asyncIterator is not defined.");
279
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
280
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
281
- function verb(n) { if (g[n])
282
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
283
- function resume(n, v) { try {
284
- step(g[n](v));
285
- }
286
- catch (e) {
287
- settle(q[0][3], e);
288
- } }
289
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
290
- function fulfill(value) { resume("next", value); }
291
- function reject(value) { resume("throw", value); }
292
- function settle(f, v) { if (f(v), q.shift(), q.length)
293
- resume(q[0][0], q[0][1]); }
294
- }
295
- function __asyncDelegator(o) {
296
- var i, p;
297
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
298
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
299
- }
300
- function __asyncValues(o) {
301
- if (!Symbol.asyncIterator)
302
- throw new TypeError("Symbol.asyncIterator is not defined.");
303
- var m = o[Symbol.asyncIterator], i;
304
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
305
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
306
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
307
- }
308
- function __makeTemplateObject(cooked, raw) {
309
- if (Object.defineProperty) {
310
- Object.defineProperty(cooked, "raw", { value: raw });
311
- }
312
- else {
313
- cooked.raw = raw;
314
- }
315
- return cooked;
316
- }
317
- ;
318
- var __setModuleDefault = Object.create ? (function (o, v) {
319
- Object.defineProperty(o, "default", { enumerable: true, value: v });
320
- }) : function (o, v) {
321
- o["default"] = v;
322
- };
323
- function __importStar(mod) {
324
- if (mod && mod.__esModule)
325
- return mod;
326
- var result = {};
327
- if (mod != null)
328
- for (var k in mod)
329
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
330
- __createBinding(result, mod, k);
331
- __setModuleDefault(result, mod);
332
- return result;
333
- }
334
- function __importDefault(mod) {
335
- return (mod && mod.__esModule) ? mod : { default: mod };
336
- }
337
- function __classPrivateFieldGet(receiver, state, kind, f) {
338
- if (kind === "a" && !f)
339
- throw new TypeError("Private accessor was defined without a getter");
340
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
341
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
342
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
343
- }
344
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
345
- if (kind === "m")
346
- throw new TypeError("Private method is not writable");
347
- if (kind === "a" && !f)
348
- throw new TypeError("Private accessor was defined without a setter");
349
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
350
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
351
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
352
- }
353
- function __classPrivateFieldIn(state, receiver) {
354
- if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
355
- throw new TypeError("Cannot use 'in' operator on non-object");
356
- return typeof state === "function" ? receiver === state : state.has(receiver);
357
- }
358
-
359
- /**
360
- * @internal
361
- */
362
- var PhoneNumberPipe = /** @class */ (function () {
363
- function PhoneNumberPipe(_locale) {
364
- this._locale = _locale;
365
- }
366
- PhoneNumberPipe.prototype.transform = function (value, mode, renderLink) {
367
- if (!value) {
368
- return value;
369
- }
370
- var countryCode = getCountryCodeFromLocale(this._locale);
371
- var format;
372
- switch (mode) {
373
- case 'NATIONAL':
374
- format = intlTelInputUtils.numberFormat.NATIONAL;
375
- break;
376
- default:
377
- format = intlTelInputUtils.numberFormat.INTERNATIONAL;
378
- }
379
- var result = intlTelInputUtils.formatNumber(value, countryCode, format);
380
- if (renderLink) {
381
- return "<a href=\"tel:" + result + "\">" + result + "</a>";
382
- }
383
- else {
384
- return result;
385
- }
386
- };
387
- return PhoneNumberPipe;
388
- }());
389
- PhoneNumberPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PhoneNumberPipe, deps: [{ token: i0.LOCALE_ID }], target: i0__namespace.ɵɵFactoryTarget.Pipe });
390
- PhoneNumberPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PhoneNumberPipe, name: "buiPhone" });
391
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PhoneNumberPipe, decorators: [{
392
- type: i0.Pipe,
393
- args: [{
394
- name: 'buiPhone',
395
- pure: true
396
- }]
397
- }], ctorParameters: function () {
398
- return [{ type: undefined, decorators: [{
399
- type: i0.Inject,
400
- args: [i0.LOCALE_ID]
401
- }] }];
402
- } });
403
- function getCountryCodeFromLocale(locale) {
404
- return locale.replace(/.+[-_]([a-z][a-z])$/i, '$1');
405
- }
406
-
407
- /**
408
- * @internal
409
- */
410
- var SELECTOR = '[buiTelInput], input([type=tel])[ngModel], input([type=tel])[formControlName], input([type=tel])[formControl]';
411
- /**
412
- * @internal
413
- */
414
- var PHONE_VALIDATOR = {
415
- provide: i1.NG_VALIDATORS,
416
- useExisting: i0.forwardRef(function () { return PhoneNumberValidator; }),
417
- multi: true
418
- };
419
- /**
420
- * @internal
421
- */
422
- var PhoneNumberValidator = /** @class */ (function () {
423
- function PhoneNumberValidator(_el) {
424
- this._el = _el;
425
- this.telType = 'FIXED_LINE';
426
- }
427
- PhoneNumberValidator.validateControl = function (inp, type, update) {
428
- var err = { tel: true };
429
- if (!inp.value) {
430
- return null;
431
- }
432
- var iti = inp.$$iti;
433
- if (!iti) {
434
- return null;
435
- }
436
- if (iti.isValidNumber()) {
437
- var n = iti.getNumber(intlTelInputUtils.numberFormat.INTERNATIONAL);
438
- if (update) {
439
- inp.value = n;
440
- }
441
- var t = iti.getNumberType();
442
- if (t !== intlTelInputUtils.numberType.FIXED_LINE_OR_MOBILE) {
443
- if ((type === 'MOBILE' && t !== intlTelInputUtils.numberType.MOBILE) ||
444
- (type === 'FIXED_LINE' && t !== intlTelInputUtils.numberType.FIXED_LINE)) {
445
- return err;
446
- }
447
- }
448
- return null;
449
- }
450
- return err;
451
- };
452
- PhoneNumberValidator.prototype.validate = function (_) {
453
- return PhoneNumberValidator.validateControl(this._el.nativeElement, this.telType, false);
454
- };
455
- return PhoneNumberValidator;
456
- }());
457
- PhoneNumberValidator.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PhoneNumberValidator, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
458
- PhoneNumberValidator.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: PhoneNumberValidator, selector: "[buiTelInput], input([type=tel])[ngModel], input([type=tel])[formControlName], input([type=tel])[formControl]", inputs: { telType: "telType" }, providers: [PHONE_VALIDATOR], ngImport: i0__namespace });
459
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PhoneNumberValidator, decorators: [{
460
- type: i0.Directive,
461
- args: [{
462
- selector: SELECTOR,
463
- providers: [PHONE_VALIDATOR]
464
- }]
465
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; }, propDecorators: { telType: [{
466
- type: i0.Input
467
- }] } });
468
-
469
- /**
470
- * Add phone number validation support by specifying the `type` attribute as `tel` in an `<input>` element.
471
- *
472
- * To use this feature, please install a peer dependency `intl-tel-input` in your project and add the following
473
- * to your application polyfills:
474
- *
475
- * ```javascript
476
- * import 'intl-tel-input/build/js/utils.js';
477
- * ```
478
- *
479
- * You will also need to add the following statements to one of your global SCSS files:
480
- *
481
- * ```scss
482
- * $flagsImagePath: '~intl-tel-input/build/img/' !default;
483
- * @import '~intl-tel-input/src/css/intlTelInput';
484
- * ```
485
- */
486
- var PhoneNumberDirective = /** @class */ (function () {
487
- function PhoneNumberDirective(_el, _ngModel, _formControlName, _formControlDirective, _locale, _zone, _matField) {
488
- this._el = _el;
489
- this._ngModel = _ngModel;
490
- this._formControlName = _formControlName;
491
- this._formControlDirective = _formControlDirective;
492
- this._locale = _locale;
493
- this._zone = _zone;
494
- this._matField = _matField;
495
- /**
496
- * The type of phone number to validate for
497
- */
498
- this.telType = 'FIXED_LINE';
499
- /**
500
- * Disable country dropdown by setting this property to `false`.
501
- */
502
- this.telDropdown = true;
503
- /**
504
- * This event is triggered when a new country is selected from the dropdown. The event detail is the ISO country code.
505
- */
506
- this.telCountryChange = new i0.EventEmitter();
507
- this._reactive = false;
508
- this._countryChangeListener = function () { return null; };
509
- }
510
- /** @internal */
511
- PhoneNumberDirective.prototype.onInput = function () {
512
- var err = PhoneNumberValidator.validateControl(this._input, this.telType, true);
513
- this._control.patchValue(this._input.value, { emitEvent: false });
514
- if (this._reactive && err) {
515
- this._control.setErrors(Object.assign(Object.assign({}, this._control.errors), err));
516
- }
517
- };
518
- PhoneNumberDirective.prototype.ngOnInit = function () {
519
- var _this = this;
520
- var ctrDirective = this._ngModel || this._formControlName || this._formControlDirective;
521
- this._control = ctrDirective.control;
522
- this._reactive = this._ngModel ? false : true;
523
- this._input = this._el.nativeElement;
524
- this._countryChangeListener = (function () {
525
- _this._zone.run(function () {
526
- _this._control.markAsDirty();
527
- _this._control.updateValueAndValidity({ emitEvent: true });
528
- _this.telCountryChange.emit(_this._iti.getSelectedCountryData().iso2);
529
- });
530
- }).bind(this);
531
- (PhoneNumberDirective.BYPASS_SHADOW_DETECTION ? rxjs.of(0) : this._zone.onStable)
532
- .pipe(operators.debounceTime(10), operators.take(1))
533
- .subscribe(function () { return _this.initElement(); });
534
- };
535
- PhoneNumberDirective.prototype.ngOnDestroy = function () {
536
- var _a;
537
- this._input.removeEventListener('countrychange', this._countryChangeListener);
538
- (_a = this._iti) === null || _a === void 0 ? void 0 : _a.destroy();
539
- };
540
- PhoneNumberDirective.prototype.ngOnChanges = function (changes) {
541
- var td = changes.telDropdown;
542
- if (td && !td.firstChange) {
543
- this.ngOnDestroy();
544
- this.ngOnInit();
545
- }
546
- var type = changes.telType;
547
- if (type && !type.firstChange) {
548
- this.onInput();
549
- }
550
- };
551
- PhoneNumberDirective.prototype.initElement = function () {
552
- var _this = this;
553
- var _a;
554
- var countryCode = getCountryCodeFromLocale(this._locale).toLowerCase();
555
- var root = this._input.getRootNode();
556
- if (!root.querySelector('#bui-tel-input-style')) {
557
- var styleTag = document.createElement('style');
558
- styleTag.id = 'bui-tel-input-style';
559
- styleTag.innerText =
560
- '.mat-form-field:not(.mat-focused) .bui-tel-input-placeholder.mat-empty { margin-left: 52px }' +
561
- '.bui-tel-input-with-value:disabled { cursor: pointer;}';
562
- (root instanceof Document ? root.querySelector('head') : root).appendChild(styleTag);
563
- }
564
- this._iti = intlTelInput__default["default"](this._input, {
565
- initialCountry: countryCode,
566
- placeholderNumberType: this.telType,
567
- preferredCountries: __spreadArray([countryCode], __read(['au', 'ca', 'nz', 'us', 'gb'].filter(function (c) { return c !== countryCode; }))),
568
- dropdownContainer: root instanceof ShadowRoot ? root.querySelector('overlay-root') : root.body,
569
- autoPlaceholder: 'off',
570
- allowDropdown: this.telDropdown
571
- });
572
- this._input.$$iti = this._iti;
573
- this._input.addEventListener('countrychange', this._countryChangeListener);
574
- var frameTime = Date.now();
575
- var postRenderWork = function () {
576
- var _a, _b;
577
- if (frameTime + PhoneNumberDirective.POST_RENDER_INIT_DELAY > Date.now()) {
578
- window.requestAnimationFrame(postRenderWork);
579
- return;
580
- }
581
- var label;
582
- if (((_a = _this._matField) === null || _a === void 0 ? void 0 : _a.getLabelId()) && typeof root.getElementById === 'function') {
583
- label = root.getElementById(_this._matField.getLabelId());
584
- label === null || label === void 0 ? void 0 : label.classList.remove('bui-tel-input-placeholder');
585
- }
586
- if (label && _this.telDropdown) {
587
- label.classList.add('bui-tel-input-placeholder');
588
- }
589
- if ((_b = _this._input) === null || _b === void 0 ? void 0 : _b.value) {
590
- _this._input.classList.add('bui-tel-input-with-value');
591
- }
592
- };
593
- window.requestAnimationFrame(postRenderWork);
594
- this._input.addEventListener('click', function () {
595
- var _a;
596
- if (((_a = _this._control) === null || _a === void 0 ? void 0 : _a.disabled) && _this._control.value) {
597
- window.location.href = 'tel://' + _this._control.value;
598
- }
599
- });
600
- (_a = this._control) === null || _a === void 0 ? void 0 : _a.registerOnDisabledChange(function (isDisabled) { return _this._patchValueByState(isDisabled); });
601
- this._patchValueByState(this._control.disabled);
602
- };
603
- PhoneNumberDirective.prototype._patchValueByState = function (isDisabled) {
604
- var _this = this;
605
- setTimeout(function () {
606
- var _a, _b;
607
- if (!isDisabled) {
608
- _this.onInput();
609
- }
610
- else {
611
- var v = _this._iti.getNumber(intlTelInputUtils.numberFormat.NATIONAL);
612
- _this._input.value = v;
613
- (_a = _this._control) === null || _a === void 0 ? void 0 : _a.patchValue((_b = _this._input) === null || _b === void 0 ? void 0 : _b.value, { emitEvent: false });
614
- }
615
- }, 20);
616
- };
617
- return PhoneNumberDirective;
618
- }());
619
- /**
620
- * @ignore
621
- */
622
- PhoneNumberDirective.POST_RENDER_INIT_DELAY = 20;
623
- /**
624
- * @ignore
625
- */
626
- PhoneNumberDirective.BYPASS_SHADOW_DETECTION = false;
627
- PhoneNumberDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PhoneNumberDirective, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace.NgModel, optional: true }, { token: i1__namespace.FormControlName, optional: true }, { token: i1__namespace.FormControlDirective, optional: true }, { token: i0.LOCALE_ID }, { token: i0__namespace.NgZone }, { token: i2__namespace.MatFormField, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Directive });
628
- PhoneNumberDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: PhoneNumberDirective, selector: "[buiTelInput], input([type=tel])[ngModel], input([type=tel])[formControlName], input([type=tel])[formControl]", inputs: { telType: "telType", telDropdown: "telDropdown" }, outputs: { telCountryChange: "telCountryChange" }, host: { listeners: { "input": "onInput()" } }, usesOnChanges: true, ngImport: i0__namespace });
629
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PhoneNumberDirective, decorators: [{
630
- type: i0.Directive,
631
- args: [{
632
- selector: SELECTOR
633
- }]
634
- }], ctorParameters: function () {
635
- return [{ type: i0__namespace.ElementRef }, { type: i1__namespace.NgModel, decorators: [{
636
- type: i0.Optional
637
- }] }, { type: i1__namespace.FormControlName, decorators: [{
638
- type: i0.Optional
639
- }] }, { type: i1__namespace.FormControlDirective, decorators: [{
640
- type: i0.Optional
641
- }] }, { type: undefined, decorators: [{
642
- type: i0.Inject,
643
- args: [i0.LOCALE_ID]
644
- }] }, { type: i0__namespace.NgZone }, { type: i2__namespace.MatFormField, decorators: [{
645
- type: i0.Optional
646
- }] }];
647
- }, propDecorators: { telType: [{
648
- type: i0.Input
649
- }], telDropdown: [{
650
- type: i0.Input
651
- }], telCountryChange: [{
652
- type: i0.Output
653
- }], onInput: [{
654
- type: i0.HostListener,
655
- args: ['input']
656
- }] } });
657
-
658
- /**
659
- * @internal
660
- */
661
- var PhoneModule = /** @class */ (function () {
662
- function PhoneModule() {
663
- }
664
- return PhoneModule;
665
- }());
666
- PhoneModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PhoneModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
667
- PhoneModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PhoneModule, declarations: [PhoneNumberPipe, PhoneNumberDirective, PhoneNumberValidator], imports: [common.CommonModule], exports: [PhoneNumberDirective, PhoneNumberPipe, PhoneNumberValidator] });
668
- PhoneModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PhoneModule, imports: [[common.CommonModule]] });
669
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: PhoneModule, decorators: [{
670
- type: i0.NgModule,
671
- args: [{
672
- declarations: [PhoneNumberPipe, PhoneNumberDirective, PhoneNumberValidator],
673
- imports: [common.CommonModule],
674
- exports: [PhoneNumberDirective, PhoneNumberPipe, PhoneNumberValidator]
675
- }]
676
- }] });
677
-
678
- /**
679
- * Generated bundle index. Do not edit.
680
- */
681
-
682
- exports.PhoneModule = PhoneModule;
683
- exports.PhoneNumberDirective = PhoneNumberDirective;
684
- exports.PhoneNumberPipe = PhoneNumberPipe;
685
- exports.PhoneNumberValidator = PhoneNumberValidator;
686
-
687
- Object.defineProperty(exports, '__esModule', { value: true });
688
-
689
- }));
690
- //# sourceMappingURL=bravura-ui-phone-number.umd.js.map