@caribeng/ui 22.2.0 → 22.5.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 (285) hide show
  1. package/README.md +311 -231
  2. package/fesm2022/caribeng-ui-accordion.mjs +2 -2
  3. package/fesm2022/caribeng-ui-account-picker.mjs +533 -0
  4. package/fesm2022/caribeng-ui-aging.mjs +488 -0
  5. package/fesm2022/{caribeng-ui-caribe-alert.mjs → caribeng-ui-alert.mjs} +45 -45
  6. package/fesm2022/caribeng-ui-amount.mjs +249 -0
  7. package/fesm2022/caribeng-ui-anchor.mjs +2 -2
  8. package/fesm2022/{caribeng-ui-caribe-animation-lottie.mjs → caribeng-ui-animation-lottie.mjs} +41 -41
  9. package/fesm2022/caribeng-ui-audit-log.mjs +323 -0
  10. package/fesm2022/caribeng-ui-avatar.mjs +4 -4
  11. package/fesm2022/caribeng-ui-badge.mjs +8 -2
  12. package/fesm2022/caribeng-ui-breadcrumb.mjs +26 -9
  13. package/fesm2022/{caribeng-ui-caribe-button-group.mjs → caribeng-ui-button-group.mjs} +15 -15
  14. package/fesm2022/caribeng-ui-button.mjs +2 -2
  15. package/fesm2022/{caribeng-ui-caribe-card-content.mjs → caribeng-ui-card-content.mjs} +39 -39
  16. package/fesm2022/{caribeng-ui-caribe-card-move.mjs → caribeng-ui-card-move.mjs} +65 -65
  17. package/fesm2022/{caribeng-ui-caribe-card-primary.mjs → caribeng-ui-card-primary.mjs} +31 -31
  18. package/fesm2022/{caribeng-ui-caribe-card-select.mjs → caribeng-ui-card-select.mjs} +67 -67
  19. package/fesm2022/caribeng-ui-carousel.mjs +2 -2
  20. package/fesm2022/caribeng-ui-cascadeselect.mjs +45 -9
  21. package/fesm2022/caribeng-ui-chart.mjs +8 -5
  22. package/fesm2022/caribeng-ui-chat.mjs +1303 -0
  23. package/fesm2022/{caribeng-ui-caribe-coachmark.mjs → caribeng-ui-coachmark.mjs} +85 -85
  24. package/fesm2022/caribeng-ui-code-block.mjs +332 -0
  25. package/fesm2022/caribeng-ui-colorpicker.mjs +99 -5
  26. package/fesm2022/caribeng-ui-command-palette.mjs +476 -0
  27. package/fesm2022/caribeng-ui-comments.mjs +864 -0
  28. package/fesm2022/caribeng-ui-confirmdialog.mjs +78 -13
  29. package/fesm2022/caribeng-ui-confirmpopup.mjs +91 -16
  30. package/fesm2022/caribeng-ui-contextmenu.mjs +8 -4
  31. package/fesm2022/caribeng-ui-copy-button.mjs +230 -0
  32. package/fesm2022/caribeng-ui-datagrid.mjs +1635 -0
  33. package/fesm2022/caribeng-ui-dataview.mjs +6 -3
  34. package/fesm2022/caribeng-ui-datepicker.mjs +2 -2
  35. package/fesm2022/caribeng-ui-dock.mjs +52 -12
  36. package/fesm2022/caribeng-ui-document.mjs +495 -0
  37. package/fesm2022/{caribeng-ui-caribe-dots-indicator.mjs → caribeng-ui-dots-indicator.mjs} +41 -41
  38. package/fesm2022/caribeng-ui-drawer.mjs +9 -4
  39. package/fesm2022/caribeng-ui-dynamic-form.mjs +1581 -0
  40. package/fesm2022/caribeng-ui-editor.mjs +2324 -1311
  41. package/fesm2022/{caribeng-ui-caribe-expansion-panel.mjs → caribeng-ui-expansion-panel.mjs} +39 -39
  42. package/fesm2022/{caribeng-ui-caribe-fab-menu.mjs → caribeng-ui-fab-menu.mjs} +75 -75
  43. package/fesm2022/caribeng-ui-fieldset.mjs +2 -2
  44. package/fesm2022/caribeng-ui-file-card.mjs +134 -17
  45. package/fesm2022/{caribeng-ui-caribe-file-download.mjs → caribeng-ui-file-download.mjs} +63 -63
  46. package/fesm2022/caribeng-ui-financial-report.mjs +380 -0
  47. package/fesm2022/{caribeng-ui-caribe-float-menu.mjs → caribeng-ui-float-menu.mjs} +31 -31
  48. package/fesm2022/caribeng-ui-floatlabel.mjs +2 -2
  49. package/fesm2022/caribeng-ui-flow.mjs +1508 -0
  50. package/fesm2022/caribeng-ui-folder-card.mjs +122 -12
  51. package/fesm2022/{caribeng-ui-caribe-footer.mjs → caribeng-ui-footer.mjs} +19 -19
  52. package/fesm2022/caribeng-ui-gantt.mjs +1094 -0
  53. package/fesm2022/{caribeng-ui-caribe-header.mjs → caribeng-ui-header.mjs} +49 -49
  54. package/fesm2022/{caribeng-ui-caribe-icon-button.mjs → caribeng-ui-icon-button.mjs} +23 -23
  55. package/fesm2022/caribeng-ui-image-cropper.mjs +671 -0
  56. package/fesm2022/caribeng-ui-import-wizard.mjs +746 -0
  57. package/fesm2022/caribeng-ui-infinite-scroll.mjs +226 -0
  58. package/fesm2022/caribeng-ui-inlinemessage.mjs +2 -2
  59. package/fesm2022/caribeng-ui-input-number.mjs +22 -6
  60. package/fesm2022/{caribeng-ui-caribe-input-search.mjs → caribeng-ui-input-search.mjs} +65 -65
  61. package/fesm2022/{caribeng-ui-caribe-input-token.mjs → caribeng-ui-input-token.mjs} +59 -59
  62. package/fesm2022/caribeng-ui-inputmask.mjs +8 -2
  63. package/fesm2022/caribeng-ui-inputotp.mjs +2 -2
  64. package/fesm2022/caribeng-ui-journal-entry.mjs +340 -0
  65. package/fesm2022/caribeng-ui-kanban.mjs +4612 -0
  66. package/fesm2022/caribeng-ui-kbd.mjs +122 -0
  67. package/fesm2022/caribeng-ui-kpi.mjs +189 -0
  68. package/fesm2022/{caribeng-ui-caribe-link.mjs → caribeng-ui-link.mjs} +37 -37
  69. package/fesm2022/caribeng-ui-masonry.mjs +93 -0
  70. package/fesm2022/caribeng-ui-media-player.mjs +821 -0
  71. package/fesm2022/caribeng-ui-megamenu.mjs +13 -9
  72. package/fesm2022/caribeng-ui-mentions.mjs +495 -0
  73. package/fesm2022/caribeng-ui-menu.mjs +8 -4
  74. package/fesm2022/caribeng-ui-menubar.mjs +9 -5
  75. package/fesm2022/caribeng-ui-message.mjs +6 -3
  76. package/fesm2022/caribeng-ui-notification-center.mjs +636 -0
  77. package/fesm2022/{caribeng-ui-caribe-off-canvas.mjs → caribeng-ui-off-canvas.mjs} +55 -55
  78. package/fesm2022/{caribeng-ui-caribe-onboarding.mjs → caribeng-ui-onboarding.mjs} +105 -105
  79. package/fesm2022/caribeng-ui-orderlist.mjs +2 -2
  80. package/fesm2022/caribeng-ui-organizationchart.mjs +6 -10
  81. package/fesm2022/caribeng-ui-panel.mjs +6 -6
  82. package/fesm2022/caribeng-ui-panelmenu.mjs +9 -6
  83. package/fesm2022/caribeng-ui-pdfviewer.mjs +1755 -25
  84. package/fesm2022/caribeng-ui-period-picker.mjs +637 -0
  85. package/fesm2022/caribeng-ui-phone-input.mjs +688 -0
  86. package/fesm2022/caribeng-ui-picklist.mjs +2 -2
  87. package/fesm2022/caribeng-ui-pivot.mjs +419 -0
  88. package/fesm2022/caribeng-ui-pricing.mjs +263 -69
  89. package/fesm2022/caribeng-ui-qrcode.mjs +564 -0
  90. package/fesm2022/caribeng-ui-rating.mjs +14 -17
  91. package/fesm2022/caribeng-ui-reconciliation.mjs +386 -0
  92. package/fesm2022/caribeng-ui-ripple.mjs +2 -0
  93. package/fesm2022/caribeng-ui-scheduler.mjs +1027 -0
  94. package/fesm2022/caribeng-ui-scrolltop.mjs +3 -1
  95. package/fesm2022/caribeng-ui-select.mjs +2 -2
  96. package/fesm2022/{caribeng-ui-caribe-shortcut.mjs → caribeng-ui-shortcut.mjs} +29 -29
  97. package/fesm2022/caribeng-ui-sidebar.mjs +573 -0
  98. package/fesm2022/caribeng-ui-signature-pad.mjs +654 -0
  99. package/fesm2022/{caribeng-ui-caribe-status.mjs → caribeng-ui-status.mjs} +11 -11
  100. package/fesm2022/{caribeng-ui-caribe-step-indicator.mjs → caribeng-ui-step-indicator.mjs} +53 -53
  101. package/fesm2022/caribeng-ui-stepper.mjs +12 -5
  102. package/fesm2022/caribeng-ui-steps.mjs +2 -2
  103. package/fesm2022/caribeng-ui-table.mjs +333 -19
  104. package/fesm2022/caribeng-ui-tabmenu.mjs +10 -6
  105. package/fesm2022/caribeng-ui-tabs.mjs +2 -2
  106. package/fesm2022/{caribeng-ui-caribe-tag-button.mjs → caribeng-ui-tag-button.mjs} +25 -25
  107. package/fesm2022/caribeng-ui-tag.mjs +2 -2
  108. package/fesm2022/caribeng-ui-tieredmenu.mjs +111 -21
  109. package/fesm2022/{caribeng-ui-caribe-tracker.mjs → caribeng-ui-tracker.mjs} +29 -29
  110. package/fesm2022/{caribeng-ui-caribe-transaction-status.mjs → caribeng-ui-transaction-status.mjs} +11 -11
  111. package/fesm2022/caribeng-ui-treeselect.mjs +44 -9
  112. package/fesm2022/caribeng-ui-treetable.mjs +236 -17
  113. package/fesm2022/{caribeng-ui-caribe-voucher.mjs → caribeng-ui-voucher.mjs} +45 -45
  114. package/fesm2022/caribeng-ui-xlsx.mjs +486 -0
  115. package/fesm2022/caribeng-ui.mjs +1568 -1
  116. package/package.json +258 -178
  117. package/schematics/collection.json +5 -0
  118. package/schematics/migrate-from-primeng/core-icons.json +1 -0
  119. package/schematics/migrate-from-primeng/icons.js +269 -0
  120. package/schematics/migrate-from-primeng/index.js +290 -0
  121. package/schematics/migrate-from-primeng/mappings/button.js +93 -0
  122. package/schematics/migrate-from-primeng/mappings/card.js +33 -0
  123. package/schematics/migrate-from-primeng/mappings/checkbox.js +44 -0
  124. package/schematics/migrate-from-primeng/mappings/confirm.js +221 -0
  125. package/schematics/migrate-from-primeng/mappings/datepicker.js +121 -0
  126. package/schematics/migrate-from-primeng/mappings/dialog.js +84 -0
  127. package/schematics/migrate-from-primeng/mappings/index.js +88 -0
  128. package/schematics/migrate-from-primeng/mappings/inputnumber.js +62 -0
  129. package/schematics/migrate-from-primeng/mappings/inputtext.js +60 -0
  130. package/schematics/migrate-from-primeng/mappings/menu.js +468 -0
  131. package/schematics/migrate-from-primeng/mappings/multiselect.js +49 -0
  132. package/schematics/migrate-from-primeng/mappings/radiobutton.js +22 -0
  133. package/schematics/migrate-from-primeng/mappings/rules.js +206 -0
  134. package/schematics/migrate-from-primeng/mappings/select.js +97 -0
  135. package/schematics/migrate-from-primeng/mappings/service-calls.js +100 -0
  136. package/schematics/migrate-from-primeng/mappings/table.js +613 -0
  137. package/schematics/migrate-from-primeng/mappings/tabs.js +225 -0
  138. package/schematics/migrate-from-primeng/mappings/tag.js +29 -0
  139. package/schematics/migrate-from-primeng/mappings/textarea.js +44 -0
  140. package/schematics/migrate-from-primeng/mappings/toast.js +173 -0
  141. package/schematics/migrate-from-primeng/mappings/toggleswitch.js +37 -0
  142. package/schematics/migrate-from-primeng/mappings/tooltip.js +44 -0
  143. package/schematics/migrate-from-primeng/mappings/types.js +10 -0
  144. package/schematics/migrate-from-primeng/report.js +79 -0
  145. package/schematics/migrate-from-primeng/schema.js +2 -0
  146. package/schematics/migrate-from-primeng/schema.json +34 -0
  147. package/schematics/migrate-from-primeng/template.js +387 -0
  148. package/schematics/migrate-from-primeng/todo.js +5 -0
  149. package/schematics/migrate-from-primeng/typescript.js +442 -0
  150. package/schematics/migrate-from-primeng/workspace.js +117 -0
  151. package/schematics/ng-add/index.js +16 -1
  152. package/types/caribeng-ui-account-picker.d.ts +142 -0
  153. package/types/caribeng-ui-aging.d.ts +123 -0
  154. package/types/{caribeng-ui-caribe-alert.d.ts → caribeng-ui-alert.d.ts} +2 -2
  155. package/types/caribeng-ui-amount.d.ts +82 -0
  156. package/types/{caribeng-ui-caribe-animation-lottie.d.ts → caribeng-ui-animation-lottie.d.ts} +2 -2
  157. package/types/caribeng-ui-audit-log.d.ts +86 -0
  158. package/types/caribeng-ui-badge.d.ts +3 -1
  159. package/types/caribeng-ui-breadcrumb.d.ts +9 -1
  160. package/types/{caribeng-ui-caribe-button-group.d.ts → caribeng-ui-button-group.d.ts} +2 -2
  161. package/types/{caribeng-ui-caribe-card-content.d.ts → caribeng-ui-card-content.d.ts} +2 -2
  162. package/types/{caribeng-ui-caribe-card-move.d.ts → caribeng-ui-card-move.d.ts} +1 -1
  163. package/types/{caribeng-ui-caribe-card-primary.d.ts → caribeng-ui-card-primary.d.ts} +2 -2
  164. package/types/{caribeng-ui-caribe-card-select.d.ts → caribeng-ui-card-select.d.ts} +2 -2
  165. package/types/caribeng-ui-cascadeselect.d.ts +6 -0
  166. package/types/caribeng-ui-chart.d.ts +3 -1
  167. package/types/caribeng-ui-chat.d.ts +299 -0
  168. package/types/{caribeng-ui-caribe-coachmark.d.ts → caribeng-ui-coachmark.d.ts} +2 -2
  169. package/types/caribeng-ui-code-block.d.ts +65 -0
  170. package/types/caribeng-ui-colorpicker.d.ts +5 -1
  171. package/types/caribeng-ui-command-palette.d.ts +133 -0
  172. package/types/caribeng-ui-comments.d.ts +214 -0
  173. package/types/caribeng-ui-confirmdialog.d.ts +34 -2
  174. package/types/caribeng-ui-confirmpopup.d.ts +39 -2
  175. package/types/caribeng-ui-contextmenu.d.ts +7 -0
  176. package/types/caribeng-ui-copy-button.d.ts +90 -0
  177. package/types/caribeng-ui-datagrid.d.ts +269 -0
  178. package/types/caribeng-ui-dataview.d.ts +2 -0
  179. package/types/caribeng-ui-dock.d.ts +13 -1
  180. package/types/caribeng-ui-document.d.ts +138 -0
  181. package/types/{caribeng-ui-caribe-dots-indicator.d.ts → caribeng-ui-dots-indicator.d.ts} +2 -2
  182. package/types/caribeng-ui-drawer.d.ts +3 -1
  183. package/types/caribeng-ui-dynamic-form.d.ts +409 -0
  184. package/types/caribeng-ui-editor.d.ts +110 -12
  185. package/types/{caribeng-ui-caribe-expansion-panel.d.ts → caribeng-ui-expansion-panel.d.ts} +1 -1
  186. package/types/{caribeng-ui-caribe-fab-menu.d.ts → caribeng-ui-fab-menu.d.ts} +2 -2
  187. package/types/caribeng-ui-file-card.d.ts +27 -2
  188. package/types/{caribeng-ui-caribe-file-download.d.ts → caribeng-ui-file-download.d.ts} +1 -1
  189. package/types/caribeng-ui-financial-report.d.ts +102 -0
  190. package/types/{caribeng-ui-caribe-float-menu.d.ts → caribeng-ui-float-menu.d.ts} +2 -2
  191. package/types/caribeng-ui-flow.d.ts +228 -0
  192. package/types/caribeng-ui-folder-card.d.ts +27 -5
  193. package/types/{caribeng-ui-caribe-footer.d.ts → caribeng-ui-footer.d.ts} +2 -2
  194. package/types/caribeng-ui-gantt.d.ts +244 -0
  195. package/types/{caribeng-ui-caribe-header.d.ts → caribeng-ui-header.d.ts} +2 -2
  196. package/types/{caribeng-ui-caribe-icon-button.d.ts → caribeng-ui-icon-button.d.ts} +2 -2
  197. package/types/{caribeng-ui-caribe-illustration.d.ts → caribeng-ui-illustration.d.ts} +1 -1
  198. package/types/caribeng-ui-image-cropper.d.ts +169 -0
  199. package/types/caribeng-ui-import-wizard.d.ts +149 -0
  200. package/types/caribeng-ui-infinite-scroll.d.ts +75 -0
  201. package/types/caribeng-ui-input-number.d.ts +1 -1
  202. package/types/{caribeng-ui-caribe-input-search.d.ts → caribeng-ui-input-search.d.ts} +2 -2
  203. package/types/{caribeng-ui-caribe-input-token.d.ts → caribeng-ui-input-token.d.ts} +2 -2
  204. package/types/caribeng-ui-inputmask.d.ts +3 -1
  205. package/types/caribeng-ui-journal-entry.d.ts +110 -0
  206. package/types/caribeng-ui-kanban.d.ts +783 -0
  207. package/types/caribeng-ui-kbd.d.ts +36 -0
  208. package/types/caribeng-ui-kpi.d.ts +64 -0
  209. package/types/{caribeng-ui-caribe-link.d.ts → caribeng-ui-link.d.ts} +2 -2
  210. package/types/{caribeng-ui-caribe-logo.d.ts → caribeng-ui-logo.d.ts} +1 -1
  211. package/types/caribeng-ui-masonry.d.ts +32 -0
  212. package/types/caribeng-ui-media-player.d.ts +140 -0
  213. package/types/caribeng-ui-megamenu.d.ts +11 -0
  214. package/types/caribeng-ui-mentions.d.ts +127 -0
  215. package/types/caribeng-ui-menu.d.ts +7 -0
  216. package/types/caribeng-ui-menubar.d.ts +7 -0
  217. package/types/caribeng-ui-message.d.ts +2 -0
  218. package/types/caribeng-ui-notification-center.d.ts +153 -0
  219. package/types/{caribeng-ui-caribe-off-canvas.d.ts → caribeng-ui-off-canvas.d.ts} +2 -2
  220. package/types/{caribeng-ui-caribe-onboarding.d.ts → caribeng-ui-onboarding.d.ts} +2 -2
  221. package/types/caribeng-ui-panelmenu.d.ts +7 -0
  222. package/types/caribeng-ui-pdfviewer.d.ts +245 -5
  223. package/types/caribeng-ui-period-picker.d.ts +148 -0
  224. package/types/caribeng-ui-phone-input.d.ts +168 -0
  225. package/types/caribeng-ui-pivot.d.ts +116 -0
  226. package/types/caribeng-ui-pricing.d.ts +41 -4
  227. package/types/caribeng-ui-qrcode.d.ts +88 -0
  228. package/types/caribeng-ui-reconciliation.d.ts +109 -0
  229. package/types/caribeng-ui-scheduler.d.ts +188 -0
  230. package/types/{caribeng-ui-caribe-shortcut.d.ts → caribeng-ui-shortcut.d.ts} +2 -2
  231. package/types/caribeng-ui-sidebar.d.ts +167 -0
  232. package/types/caribeng-ui-signature-pad.d.ts +151 -0
  233. package/types/{caribeng-ui-caribe-status.d.ts → caribeng-ui-status.d.ts} +2 -2
  234. package/types/{caribeng-ui-caribe-step-indicator.d.ts → caribeng-ui-step-indicator.d.ts} +2 -2
  235. package/types/caribeng-ui-stepper.d.ts +2 -0
  236. package/types/caribeng-ui-table.d.ts +67 -3
  237. package/types/caribeng-ui-tabmenu.d.ts +7 -0
  238. package/types/{caribeng-ui-caribe-tag-button.d.ts → caribeng-ui-tag-button.d.ts} +2 -2
  239. package/types/caribeng-ui-tieredmenu.d.ts +17 -1
  240. package/types/{caribeng-ui-caribe-tracker.d.ts → caribeng-ui-tracker.d.ts} +2 -2
  241. package/types/{caribeng-ui-caribe-transaction-status.d.ts → caribeng-ui-transaction-status.d.ts} +2 -2
  242. package/types/caribeng-ui-treeselect.d.ts +6 -0
  243. package/types/caribeng-ui-treetable.d.ts +67 -2
  244. package/types/{caribeng-ui-caribe-voucher.d.ts → caribeng-ui-voucher.d.ts} +2 -2
  245. package/types/caribeng-ui-xlsx.d.ts +79 -0
  246. package/types/caribeng-ui.d.ts +985 -2
  247. package/fesm2022/caribeng-ui-caribe-calendar.mjs +0 -92
  248. package/fesm2022/caribeng-ui-caribe-circle-loading.mjs +0 -130
  249. package/fesm2022/caribeng-ui-caribe-data-table.mjs +0 -94
  250. package/fesm2022/caribeng-ui-caribe-file-select.mjs +0 -88
  251. package/fesm2022/caribeng-ui-caribe-inline-alert.mjs +0 -100
  252. package/fesm2022/caribeng-ui-caribe-input-date.mjs +0 -138
  253. package/fesm2022/caribeng-ui-caribe-input-select.mjs +0 -154
  254. package/fesm2022/caribeng-ui-caribe-loader.mjs +0 -48
  255. package/fesm2022/caribeng-ui-caribe-modal.mjs +0 -119
  256. package/fesm2022/caribeng-ui-caribe-pictogram.mjs +0 -52
  257. package/fesm2022/caribeng-ui-caribe-pop-over.mjs +0 -104
  258. package/fesm2022/caribeng-ui-caribe-preloader.mjs +0 -57
  259. package/fesm2022/caribeng-ui-caribe-progress-bar.mjs +0 -84
  260. package/fesm2022/caribeng-ui-caribe-stroke.mjs +0 -69
  261. package/fesm2022/caribeng-ui-caribe-switch.mjs +0 -182
  262. package/styles/caribeng.css +0 -380
  263. package/styles/scss/_mixins.scss +0 -46
  264. package/styles/scss/_overlay.scss +0 -15
  265. package/styles/scss/_tokens.scss +0 -267
  266. package/styles/scss/_utilities.scss +0 -73
  267. package/styles/scss/_variables.scss +0 -33
  268. package/styles/scss/index.scss +0 -16
  269. package/types/caribeng-ui-caribe-calendar.d.ts +0 -27
  270. package/types/caribeng-ui-caribe-circle-loading.d.ts +0 -28
  271. package/types/caribeng-ui-caribe-data-table.d.ts +0 -26
  272. package/types/caribeng-ui-caribe-file-select.d.ts +0 -31
  273. package/types/caribeng-ui-caribe-inline-alert.d.ts +0 -28
  274. package/types/caribeng-ui-caribe-input-date.d.ts +0 -40
  275. package/types/caribeng-ui-caribe-input-select.d.ts +0 -47
  276. package/types/caribeng-ui-caribe-loader.d.ts +0 -22
  277. package/types/caribeng-ui-caribe-modal.d.ts +0 -21
  278. package/types/caribeng-ui-caribe-pictogram.d.ts +0 -15
  279. package/types/caribeng-ui-caribe-pop-over.d.ts +0 -17
  280. package/types/caribeng-ui-caribe-preloader.d.ts +0 -24
  281. package/types/caribeng-ui-caribe-progress-bar.d.ts +0 -28
  282. package/types/caribeng-ui-caribe-stroke.d.ts +0 -17
  283. package/types/caribeng-ui-caribe-switch.d.ts +0 -55
  284. /package/fesm2022/{caribeng-ui-caribe-illustration.mjs → caribeng-ui-illustration.mjs} +0 -0
  285. /package/fesm2022/{caribeng-ui-caribe-logo.mjs → caribeng-ui-logo.mjs} +0 -0
@@ -0,0 +1,688 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, ViewContainerRef, Injector, viewChild, model, input, output, signal, computed, effect, untracked, afterNextRender, forwardRef, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
4
+ import { Overlay } from '@angular/cdk/overlay';
5
+ import { TemplatePortal } from '@angular/cdk/portal';
6
+ import { injectCbTranslation, cbFieldState } from '@caribeng/ui';
7
+ import { CbIcon } from '@caribeng/ui/icon';
8
+
9
+ const NANP = { dial: '1', lengths: [10], formats: { 10: '(###) ###-####' } };
10
+ /**
11
+ * Países incluidos: América Latina y el Caribe, Norteamérica, la Europa más
12
+ * habitual y los mayores de Asia y Oceanía. Amplíalos con `[countries]`.
13
+ */
14
+ const CB_PHONE_COUNTRIES = [
15
+ // --- América Latina y el Caribe ---
16
+ { iso: 'AR', dial: '54', lengths: [10, 11], formats: { 10: '## ####-####', 11: '# ## ####-####' }, trunk: '0', example: '1123456789' },
17
+ { iso: 'BO', dial: '591', lengths: [8], formats: { 8: '# ### ####' }, trunk: '0', example: '71234567' },
18
+ { iso: 'BR', dial: '55', lengths: [10, 11], formats: { 10: '(##) ####-####', 11: '(##) #####-####' }, trunk: '0', example: '11912345678' },
19
+ { iso: 'CL', dial: '56', lengths: [9], formats: { 9: '# #### ####' }, example: '912345678' },
20
+ { iso: 'CO', dial: '57', lengths: [10], formats: { 10: '### ### ####' }, example: '3001234567' },
21
+ { iso: 'CR', dial: '506', lengths: [8], formats: { 8: '#### ####' }, example: '83123456' },
22
+ { iso: 'CU', dial: '53', lengths: [8], formats: { 8: '# ### ####' }, trunk: '0', example: '51234567' },
23
+ { iso: 'DO', ...NANP, leading: ['809', '829', '849'], example: '8092345678' },
24
+ { iso: 'EC', dial: '593', lengths: [8, 9], formats: { 8: '# ### ####', 9: '## ### ####' }, trunk: '0', example: '991234567' },
25
+ { iso: 'SV', dial: '503', lengths: [8], formats: { 8: '#### ####' }, example: '70123456' },
26
+ { iso: 'GT', dial: '502', lengths: [8], formats: { 8: '#### ####' }, example: '51234567' },
27
+ { iso: 'HN', dial: '504', lengths: [8], formats: { 8: '####-####' }, example: '91234567' },
28
+ { iso: 'MX', dial: '52', lengths: [10], formats: { 10: '## #### ####' }, example: '5512345678' },
29
+ { iso: 'NI', dial: '505', lengths: [8], formats: { 8: '#### ####' }, example: '81234567' },
30
+ { iso: 'PA', dial: '507', lengths: [7, 8], formats: { 7: '###-####', 8: '####-####' }, example: '61234567' },
31
+ { iso: 'PY', dial: '595', lengths: [9], formats: { 9: '### ######' }, trunk: '0', example: '961456789' },
32
+ { iso: 'PE', dial: '51', lengths: [8, 9], formats: { 8: '# ### ####', 9: '### ### ###' }, trunk: '0', example: '912345678' },
33
+ { iso: 'PR', ...NANP, leading: ['787', '939'], example: '7872345678' },
34
+ { iso: 'UY', dial: '598', lengths: [8], formats: { 8: '#### ####' }, trunk: '0', example: '94231234' },
35
+ { iso: 'VE', dial: '58', lengths: [10], formats: { 10: '###-#######' }, trunk: '0', example: '4121234567' },
36
+ { iso: 'JM', ...NANP, leading: ['876', '658'], example: '8762101234' },
37
+ { iso: 'TT', ...NANP, leading: ['868'], example: '8682911234' },
38
+ // --- Norteamérica ---
39
+ { iso: 'US', ...NANP, example: '2015550123' },
40
+ { iso: 'CA', ...NANP, leading: ['204', '226', '236', '249', '250', '263', '289', '306', '343', '354', '365', '367', '368', '382', '403', '416', '418', '428', '431', '437', '438', '450', '468', '474', '506', '514', '519', '548', '579', '581', '584', '587', '604', '613', '639', '647', '672', '683', '705', '709', '742', '753', '778', '780', '782', '807', '819', '825', '867', '873', '879', '902', '905'], example: '5062345678' },
41
+ // --- Europa ---
42
+ { iso: 'DE', dial: '49', lengths: [7, 8, 9, 10, 11], formats: { 10: '### #######', 11: '#### #######' }, trunk: '0', example: '15123456789' },
43
+ { iso: 'AT', dial: '43', lengths: [8, 9, 10, 11, 12], formats: { 10: '### #######', 11: '### ########' }, trunk: '0', example: '6641234567' },
44
+ { iso: 'BE', dial: '32', lengths: [8, 9], formats: { 8: '# ### ## ##', 9: '### ## ## ##' }, trunk: '0', example: '470123456' },
45
+ { iso: 'DK', dial: '45', lengths: [8], formats: { 8: '## ## ## ##' }, example: '32123456' },
46
+ { iso: 'ES', dial: '34', lengths: [9], formats: { 9: '### ## ## ##' }, example: '612345678' },
47
+ { iso: 'FI', dial: '358', lengths: [9, 10], formats: { 9: '## ### ####', 10: '## #### ####' }, trunk: '0', example: '412345678' },
48
+ { iso: 'FR', dial: '33', lengths: [9], formats: { 9: '# ## ## ## ##' }, trunk: '0', example: '612345678' },
49
+ { iso: 'GR', dial: '30', lengths: [10], formats: { 10: '### ### ####' }, example: '6912345678' },
50
+ { iso: 'IE', dial: '353', lengths: [9], formats: { 9: '## ### ####' }, trunk: '0', example: '850123456' },
51
+ { iso: 'IT', dial: '39', lengths: [6, 7, 8, 9, 10, 11], formats: { 9: '### ### ###', 10: '### ### ####' }, example: '3123456789' },
52
+ { iso: 'NL', dial: '31', lengths: [9], formats: { 9: '# ########' }, trunk: '0', example: '612345678' },
53
+ { iso: 'NO', dial: '47', lengths: [8], formats: { 8: '### ## ###' }, example: '40612345' },
54
+ { iso: 'PL', dial: '48', lengths: [9], formats: { 9: '### ### ###' }, example: '512345678' },
55
+ { iso: 'PT', dial: '351', lengths: [9], formats: { 9: '### ### ###' }, example: '912345678' },
56
+ { iso: 'GB', dial: '44', lengths: [10], formats: { 10: '#### ######' }, trunk: '0', example: '7400123456' },
57
+ { iso: 'CH', dial: '41', lengths: [9], formats: { 9: '## ### ## ##' }, trunk: '0', example: '781234567' },
58
+ { iso: 'SE', dial: '46', lengths: [9], formats: { 9: '##-### ## ##' }, trunk: '0', example: '701234567' },
59
+ // --- Asia, Oceanía, África y Oriente Medio ---
60
+ { iso: 'AU', dial: '61', lengths: [9], formats: { 9: '### ### ###' }, trunk: '0', example: '412345678' },
61
+ { iso: 'CN', dial: '86', lengths: [11], formats: { 11: '### #### ####' }, trunk: '0', example: '13123456789' },
62
+ { iso: 'IN', dial: '91', lengths: [10], formats: { 10: '##### #####' }, trunk: '0', example: '8123456789' },
63
+ { iso: 'IL', dial: '972', lengths: [9], formats: { 9: '##-###-####' }, trunk: '0', example: '502345678' },
64
+ { iso: 'JP', dial: '81', lengths: [10], formats: { 10: '##-####-####' }, trunk: '0', example: '9012345678' },
65
+ { iso: 'KR', dial: '82', lengths: [9, 10], formats: { 9: '##-###-####', 10: '##-####-####' }, trunk: '0', example: '1020000000' },
66
+ { iso: 'NZ', dial: '64', lengths: [8, 9, 10], formats: { 8: '## ### ###', 9: '## ### ####', 10: '## #### ####' }, trunk: '0', example: '211234567' },
67
+ { iso: 'AE', dial: '971', lengths: [9], formats: { 9: '## ### ####' }, trunk: '0', example: '501234567' },
68
+ { iso: 'ZA', dial: '27', lengths: [9], formats: { 9: '## ### ####' }, trunk: '0', example: '711234567' },
69
+ ];
70
+ /** Emoji de bandera a partir del código ISO (indicadores regionales). */
71
+ function cbFlagEmoji(iso) {
72
+ return iso.toUpperCase().replace(/[A-Z]/g, (c) => String.fromCodePoint(0x1f1e6 + c.charCodeAt(0) - 65));
73
+ }
74
+ /** Aplica el formato del país al número nacional (solo dígitos), también a medio escribir. */
75
+ function cbFormatNational(country, digits) {
76
+ if (!digits)
77
+ return '';
78
+ const lengths = [...country.lengths].sort((a, b) => a - b);
79
+ // El formato de la longitud más cercana por arriba; si se pasa, el de la mayor.
80
+ const target = lengths.find((l) => digits.length <= l) ?? lengths[lengths.length - 1];
81
+ const pattern = country.formats?.[target] ?? '### ### ### ### ###';
82
+ let out = '';
83
+ let d = 0;
84
+ for (const ch of pattern) {
85
+ if (d >= digits.length)
86
+ break;
87
+ if (ch === '#')
88
+ out += digits[d++];
89
+ else
90
+ out += ch;
91
+ }
92
+ // Dígitos que sobran del patrón (número demasiado largo): se añaden tal cual.
93
+ if (d < digits.length)
94
+ out += (out ? ' ' : '') + digits.slice(d);
95
+ return out.replace(/[\s()-]+$/, '');
96
+ }
97
+ /**
98
+ * Interpreta lo escrito o pegado. Con `+` o `00` detecta el país por el prefijo
99
+ * (el más largo que coincide; entre los que comparten prefijo, por el comienzo
100
+ * del número o, si no, el país actual). Sin prefijo, usa `current` y quita su 0 nacional.
101
+ */
102
+ function cbParsePhone(text, current, countries) {
103
+ const raw = (text ?? '').trim();
104
+ const international = /^(\+|00)/.test(raw);
105
+ let digits = raw.replace(/\D/g, '');
106
+ if (international) {
107
+ if (raw.startsWith('00'))
108
+ digits = digits.slice(2);
109
+ const candidates = countries
110
+ .filter((c) => digits.startsWith(c.dial))
111
+ .sort((a, b) => b.dial.length - a.dial.length);
112
+ if (!candidates.length)
113
+ return { country: current, national: digits };
114
+ const dial = candidates[0].dial;
115
+ const national = digits.slice(dial.length);
116
+ const sameDial = candidates.filter((c) => c.dial === dial);
117
+ const byLeading = sameDial.find((c) => c.leading?.some((p) => national.startsWith(p)));
118
+ const country = byLeading ??
119
+ (current && current.dial === dial ? current : null) ??
120
+ sameDial.find((c) => !c.leading) ??
121
+ sameDial[0];
122
+ return { country, national: stripTrunk(country, national) };
123
+ }
124
+ return { country: current, national: current ? stripTrunk(current, digits) : digits };
125
+ }
126
+ function stripTrunk(country, digits) {
127
+ return country.trunk && digits.startsWith(country.trunk) ? digits.slice(country.trunk.length) : digits;
128
+ }
129
+ /** Número completo en formato E.164 (`+573001234567`), o `''` sin dígitos. */
130
+ function cbToE164(country, national) {
131
+ if (!national)
132
+ return '';
133
+ return country ? `+${country.dial}${national}` : `+${national}`;
134
+ }
135
+ /** Si la longitud del número nacional es válida para el país. */
136
+ function cbIsValidPhone(country, national) {
137
+ return !!country && country.lengths.includes(national.length) && /^\d+$/.test(national);
138
+ }
139
+
140
+ let nextUid = 0;
141
+ const toBoolean = (value) => value !== false && value !== 'false' && value != null;
142
+ /**
143
+ * Teléfono internacional de CaribeNG: selector de país (bandera, nombre y
144
+ * prefijo, con buscador) y número que se formatea mientras se escribe. El
145
+ * valor es E.164 (`+573001234567`), listo para guardar o enviar. Al pegar un
146
+ * número con `+` o `00` detecta el país.
147
+ *
148
+ * Funciona con Angular Forms (`formControlName`, `ngModel`) y añade el error
149
+ * `{ phone: true }` si el número está incompleto o no es válido para el país.
150
+ *
151
+ * @example
152
+ * ```html
153
+ * <cb-phone-input label="Celular" formControlName="celular" country="CO" [preferredCountries]="['CO', 'MX', 'US']" />
154
+ * ```
155
+ */
156
+ class CbPhoneInput {
157
+ constructor() {
158
+ /** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
159
+ this.t = injectCbTranslation();
160
+ this.overlay = inject(Overlay);
161
+ this.vcr = inject(ViewContainerRef);
162
+ this.injector = inject(Injector);
163
+ this.triggerEl = viewChild.required('trigger');
164
+ this.fieldEl = viewChild.required('field');
165
+ this.searchEl = viewChild('search', /* @ts-ignore */
166
+ ...(ngDevMode ? [{ debugName: "searchEl" }] : /* istanbul ignore next */ []));
167
+ this.panelTpl = viewChild.required('panel');
168
+ this.overlayRef = null;
169
+ this.inputId = `cb-phone-input-${++nextUid}`;
170
+ this.listId = `${this.inputId}-countries`;
171
+ /** Número en formato E.164 (`+573001234567`); `''` si está vacío. */
172
+ this.value = model('', /* @ts-ignore */
173
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
174
+ /** País seleccionado (código ISO). */
175
+ this.country = model('CO', /* @ts-ignore */
176
+ ...(ngDevMode ? [{ debugName: "country" }] : /* istanbul ignore next */ []));
177
+ /** Países disponibles. Por defecto, `CB_PHONE_COUNTRIES`; puedes pasar otros o filtrar por código ISO. */
178
+ this.countries = input(CB_PHONE_COUNTRIES, /* @ts-ignore */
179
+ ...(ngDevMode ? [{ debugName: "countries" }] : /* istanbul ignore next */ []));
180
+ /** Países que aparecen primero en la lista (código ISO). */
181
+ this.preferredCountries = input([], /* @ts-ignore */
182
+ ...(ngDevMode ? [{ debugName: "preferredCountries" }] : /* istanbul ignore next */ []));
183
+ /** Bloquea el país (solo se escribe el número). */
184
+ this.countryLocked = input(false, { ...(ngDevMode ? { debugName: "countryLocked" } : /* istanbul ignore next */ {}), transform: toBoolean });
185
+ /** Muestra la bandera (emoji). En Windows algunos navegadores la muestran como letras. */
186
+ this.showFlag = input(true, { ...(ngDevMode ? { debugName: "showFlag" } : /* istanbul ignore next */ {}), transform: toBoolean });
187
+ this.label = input('', /* @ts-ignore */
188
+ ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
189
+ this.hint = input('', /* @ts-ignore */
190
+ ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
191
+ /** Error a mostrar. Por defecto, "Número de teléfono incompleto o no válido" cuando lo es. */
192
+ this.error = input(undefined, /* @ts-ignore */
193
+ ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
194
+ this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: toBoolean });
195
+ this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: toBoolean });
196
+ this.requiredIndicator = input(undefined, /* @ts-ignore */
197
+ ...(ngDevMode ? [{ debugName: "requiredIndicator" }] : /* istanbul ignore next */ []));
198
+ /** Placeholder. Por defecto, un número de ejemplo del país. */
199
+ this.placeholder = input(undefined, /* @ts-ignore */
200
+ ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
201
+ this.size = input('md', /* @ts-ignore */
202
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
203
+ this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: toBoolean });
204
+ /** Cada cambio con el número E.164, el nacional, el país y si es válido. */
205
+ this.phoneChange = output();
206
+ this.fieldState = cbFieldState({
207
+ invalid: () => this.invalid(),
208
+ required: () => this.required(),
209
+ requiredIndicator: () => this.requiredIndicator(),
210
+ });
211
+ /** Número nacional (solo dígitos). */
212
+ this.national = signal('', /* @ts-ignore */
213
+ ...(ngDevMode ? [{ debugName: "national" }] : /* istanbul ignore next */ []));
214
+ this.touched = signal(false, /* @ts-ignore */
215
+ ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
216
+ this.cvaDisabled = signal(false, /* @ts-ignore */
217
+ ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : /* istanbul ignore next */ []));
218
+ this.isDisabled = computed(() => this.disabled() || this.cvaDisabled(), /* @ts-ignore */
219
+ ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
220
+ this.open = signal(false, /* @ts-ignore */
221
+ ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
222
+ this.query = signal('', /* @ts-ignore */
223
+ ...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
224
+ this.active = signal(0, /* @ts-ignore */
225
+ ...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
226
+ this.displayNames = computed(() => {
227
+ try {
228
+ return new Intl.DisplayNames([this.t().intlLocale], { type: 'region' });
229
+ }
230
+ catch {
231
+ return null;
232
+ }
233
+ }, /* @ts-ignore */
234
+ ...(ngDevMode ? [{ debugName: "displayNames" }] : /* istanbul ignore next */ []));
235
+ this.list = computed(() => {
236
+ const byIso = new Map(CB_PHONE_COUNTRIES.map((c) => [c.iso, c]));
237
+ const items = this.countries()
238
+ .map((c) => (typeof c === 'string' ? byIso.get(c.toUpperCase()) : c))
239
+ .filter((c) => !!c);
240
+ const preferred = this.preferredCountries().map((iso) => iso.toUpperCase());
241
+ const rank = (c) => {
242
+ const i = preferred.indexOf(c.iso);
243
+ return i < 0 ? preferred.length : i;
244
+ };
245
+ return [...items].sort((a, b) => rank(a) - rank(b) || this.name(a).localeCompare(this.name(b), this.t().intlLocale));
246
+ }, /* @ts-ignore */
247
+ ...(ngDevMode ? [{ debugName: "list" }] : /* istanbul ignore next */ []));
248
+ this.selected = computed(() => {
249
+ const iso = this.country().toUpperCase();
250
+ return this.list().find((c) => c.iso === iso) ?? this.list()[0] ?? null;
251
+ }, /* @ts-ignore */
252
+ ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
253
+ this.filtered = computed(() => {
254
+ const q = this.normalize(this.query().trim().replace(/^\+/, ''));
255
+ if (!q)
256
+ return this.list();
257
+ return this.list().filter((c) => this.normalize(this.name(c)).includes(q) || c.dial.startsWith(q) || c.iso.toLowerCase() === q);
258
+ }, /* @ts-ignore */
259
+ ...(ngDevMode ? [{ debugName: "filtered" }] : /* istanbul ignore next */ []));
260
+ this.activeId = computed(() => {
261
+ const c = this.filtered()[this.active()];
262
+ return c ? `${this.listId}-${c.iso}` : null;
263
+ }, /* @ts-ignore */
264
+ ...(ngDevMode ? [{ debugName: "activeId" }] : /* istanbul ignore next */ []));
265
+ this.display = computed(() => {
266
+ const c = this.selected();
267
+ return c ? cbFormatNational(c, this.national()) : this.national();
268
+ }, /* @ts-ignore */
269
+ ...(ngDevMode ? [{ debugName: "display" }] : /* istanbul ignore next */ []));
270
+ this.examplePlaceholder = computed(() => {
271
+ const c = this.selected();
272
+ return c?.example ? cbFormatNational(c, c.example) : '';
273
+ }, /* @ts-ignore */
274
+ ...(ngDevMode ? [{ debugName: "examplePlaceholder" }] : /* istanbul ignore next */ []));
275
+ this.isValid = computed(() => !this.national() || cbIsValidPhone(this.selected(), this.national()), /* @ts-ignore */
276
+ ...(ngDevMode ? [{ debugName: "isValid" }] : /* istanbul ignore next */ []));
277
+ this.showInvalid = computed(() => this.fieldState.invalid() || (this.touched() && !this.isValid()), /* @ts-ignore */
278
+ ...(ngDevMode ? [{ debugName: "showInvalid" }] : /* istanbul ignore next */ []));
279
+ this.errorText = computed(() => this.error() ?? (!this.isValid() ? this.t().phoneInvalid : ''), /* @ts-ignore */
280
+ ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
281
+ this.countryLabel = computed(() => {
282
+ const c = this.selected();
283
+ return c ? `${this.t().phoneCountry}: ${this.name(c)} (+${c.dial})` : this.t().phoneCountry;
284
+ }, /* @ts-ignore */
285
+ ...(ngDevMode ? [{ debugName: "countryLabel" }] : /* istanbul ignore next */ []));
286
+ this.describedBy = computed(() => {
287
+ if (this.showInvalid() && this.errorText())
288
+ return `${this.inputId}-error`;
289
+ if (this.hint())
290
+ return `${this.inputId}-hint`;
291
+ return null;
292
+ }, /* @ts-ignore */
293
+ ...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
294
+ this.onChange = () => { };
295
+ this.onTouched = () => { };
296
+ this.onValidatorChange = () => { };
297
+ // `[(value)]` fuera de Angular Forms: un valor nuevo desde fuera se interpreta.
298
+ effect(() => {
299
+ const value = this.value();
300
+ untracked(() => {
301
+ if (value !== cbToE164(this.selected(), this.national()))
302
+ this.applyText(value, false);
303
+ });
304
+ });
305
+ }
306
+ flag(c) {
307
+ return cbFlagEmoji(c.iso);
308
+ }
309
+ name(c) {
310
+ return this.displayNames()?.of(c.iso) ?? c.iso;
311
+ }
312
+ normalize(text) {
313
+ return text.normalize('NFD').replace(/[̀-ͯ]/g, '').toLowerCase();
314
+ }
315
+ // --- ControlValueAccessor / Validator --------------------------------------
316
+ writeValue(value) {
317
+ this.applyText(value ?? '', false);
318
+ }
319
+ registerOnChange(fn) {
320
+ this.onChange = fn;
321
+ }
322
+ registerOnTouched(fn) {
323
+ this.onTouched = fn;
324
+ }
325
+ setDisabledState(isDisabled) {
326
+ this.cvaDisabled.set(isDisabled);
327
+ }
328
+ validate(_control) {
329
+ return this.isValid() ? null : { phone: true };
330
+ }
331
+ registerOnValidatorChange(fn) {
332
+ this.onValidatorChange = fn;
333
+ }
334
+ // --- Número ------------------------------------------------------------------
335
+ onInput(event) {
336
+ const el = event.target;
337
+ // Posición del cursor contada en dígitos, para restaurarla tras reformatear.
338
+ const caretDigits = el.value.slice(0, el.selectionStart ?? el.value.length).replace(/\D/g, '').length;
339
+ this.applyText(el.value, true);
340
+ const formatted = this.display();
341
+ el.value = formatted;
342
+ let pos = 0;
343
+ for (let seen = 0; pos < formatted.length && seen < caretDigits; pos++)
344
+ if (/\d/.test(formatted[pos]))
345
+ seen++;
346
+ el.setSelectionRange?.(pos, pos);
347
+ }
348
+ onBlur() {
349
+ this.touched.set(true);
350
+ this.onTouched();
351
+ }
352
+ /** Interpreta texto escrito, pegado o recibido (E.164 o nacional). */
353
+ applyText(text, emit) {
354
+ const parsed = cbParsePhone(text, this.selected(), this.list());
355
+ if (parsed.country && parsed.country.iso !== this.selected()?.iso)
356
+ this.country.set(parsed.country.iso);
357
+ const country = parsed.country ?? this.selected();
358
+ const max = country ? Math.max(...country.lengths) : 15;
359
+ this.national.set(parsed.national.slice(0, max));
360
+ this.publish(emit);
361
+ }
362
+ publish(emit) {
363
+ const country = this.selected();
364
+ const national = this.national();
365
+ const e164 = cbToE164(country, national);
366
+ this.value.set(e164);
367
+ this.onValidatorChange();
368
+ if (!emit)
369
+ return;
370
+ this.onChange(e164);
371
+ this.phoneChange.emit({ e164, national, country: country?.iso ?? '', valid: !!national && cbIsValidPhone(country, national) });
372
+ }
373
+ // --- Selector de país ------------------------------------------------------------
374
+ toggle() {
375
+ if (this.open())
376
+ this.close();
377
+ else
378
+ this.openPanel();
379
+ }
380
+ openFromKeyboard(event) {
381
+ event.preventDefault();
382
+ if (!this.open())
383
+ this.openPanel();
384
+ }
385
+ openPanel() {
386
+ if (this.overlayRef || this.isDisabled() || this.countryLocked())
387
+ return;
388
+ this.query.set('');
389
+ const index = this.list().findIndex((c) => c.iso === this.selected()?.iso);
390
+ this.active.set(Math.max(0, index));
391
+ this.overlayRef = this.overlay.create({
392
+ hasBackdrop: true,
393
+ backdropClass: 'cdk-overlay-transparent-backdrop',
394
+ scrollStrategy: this.overlay.scrollStrategies.reposition(),
395
+ positionStrategy: this.overlay
396
+ .position()
397
+ .flexibleConnectedTo(this.triggerEl().nativeElement)
398
+ .withPositions([
399
+ { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },
400
+ { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },
401
+ ])
402
+ .withPush(true),
403
+ });
404
+ this.overlayRef.attach(new TemplatePortal(this.panelTpl(), this.vcr));
405
+ this.overlayRef.backdropClick().subscribe(() => this.close());
406
+ this.open.set(true);
407
+ afterNextRender(() => {
408
+ this.searchEl()?.nativeElement.focus();
409
+ this.scrollActiveIntoView();
410
+ }, { injector: this.injector });
411
+ }
412
+ /** Cierra la lista de países. */
413
+ close(focusTrigger = true) {
414
+ if (!this.overlayRef)
415
+ return;
416
+ this.overlayRef.dispose();
417
+ this.overlayRef = null;
418
+ this.open.set(false);
419
+ if (focusTrigger)
420
+ this.triggerEl().nativeElement.focus();
421
+ }
422
+ choose(c) {
423
+ this.country.set(c.iso);
424
+ this.national.set(this.national().slice(0, Math.max(...c.lengths)));
425
+ this.close(false);
426
+ this.publish(true);
427
+ this.fieldEl().nativeElement.focus();
428
+ }
429
+ onSearchKeydown(event) {
430
+ const count = this.filtered().length;
431
+ switch (event.key) {
432
+ case 'ArrowDown':
433
+ case 'ArrowUp':
434
+ event.preventDefault();
435
+ if (!count)
436
+ return;
437
+ this.active.set((this.active() + (event.key === 'ArrowDown' ? 1 : -1) + count) % count);
438
+ this.scrollActiveIntoView();
439
+ break;
440
+ case 'Enter': {
441
+ event.preventDefault();
442
+ const c = this.filtered()[this.active()];
443
+ if (c)
444
+ this.choose(c);
445
+ break;
446
+ }
447
+ case 'Escape':
448
+ event.preventDefault();
449
+ this.close();
450
+ break;
451
+ case 'Tab':
452
+ this.close(false);
453
+ break;
454
+ }
455
+ }
456
+ scrollActiveIntoView() {
457
+ const id = this.activeId();
458
+ afterNextRender(() => (id ? this.overlayRef?.overlayElement.querySelector(`#${id}`)?.scrollIntoView?.({ block: 'nearest' }) : null), {
459
+ injector: this.injector,
460
+ });
461
+ }
462
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbPhoneInput, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
463
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbPhoneInput, isStandalone: true, selector: "cb-phone-input", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, country: { classPropertyName: "country", publicName: "country", isSignal: true, isRequired: false, transformFunction: null }, countries: { classPropertyName: "countries", publicName: "countries", isSignal: true, isRequired: false, transformFunction: null }, preferredCountries: { classPropertyName: "preferredCountries", publicName: "preferredCountries", isSignal: true, isRequired: false, transformFunction: null }, countryLocked: { classPropertyName: "countryLocked", publicName: "countryLocked", isSignal: true, isRequired: false, transformFunction: null }, showFlag: { classPropertyName: "showFlag", publicName: "showFlag", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, requiredIndicator: { classPropertyName: "requiredIndicator", publicName: "requiredIndicator", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", country: "countryChange", phoneChange: "phoneChange" }, host: { classAttribute: "cb-phone-input" }, providers: [
464
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => CbPhoneInput), multi: true },
465
+ { provide: NG_VALIDATORS, useExisting: forwardRef(() => CbPhoneInput), multi: true },
466
+ ], viewQueries: [{ propertyName: "triggerEl", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "fieldEl", first: true, predicate: ["field"], descendants: true, isSignal: true }, { propertyName: "searchEl", first: true, predicate: ["search"], descendants: true, isSignal: true }, { propertyName: "panelTpl", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: `
467
+ @if (label()) {
468
+ <label class="cb-phone-input__label" [attr.for]="inputId">
469
+ {{ label() }}
470
+ @if (fieldState.indicator(); as mark) {
471
+ <span [class]="'cb-phone-input__required cb-phone-input__required--' + mark.kind" [attr.aria-hidden]="mark.kind === 'optional' ? null : 'true'">{{ mark.text }}</span>
472
+ }
473
+ </label>
474
+ }
475
+ <div
476
+ class="cb-phone-input__control"
477
+ [class]="'cb-phone-input__control--' + size()"
478
+ [class.cb-is-invalid]="showInvalid()"
479
+ [class.cb-is-disabled]="isDisabled()"
480
+ >
481
+ <button
482
+ #trigger
483
+ type="button"
484
+ class="cb-phone-input__country"
485
+ aria-haspopup="listbox"
486
+ [attr.aria-expanded]="open()"
487
+ [attr.aria-controls]="open() ? listId : null"
488
+ [attr.aria-label]="countryLabel()"
489
+ [disabled]="isDisabled() || countryLocked()"
490
+ (click)="toggle()"
491
+ (keydown.arrowdown)="openFromKeyboard($event)"
492
+ >
493
+ @if (selected(); as c) {
494
+ @if (showFlag()) {
495
+ <span class="cb-phone-input__flag" aria-hidden="true">{{ flag(c) }}</span>
496
+ }
497
+ <span class="cb-phone-input__dial" aria-hidden="true">+{{ c.dial }}</span>
498
+ }
499
+ @if (!countryLocked()) {
500
+ <cb-icon name="chevron-down" [size]="14" aria-hidden="true" />
501
+ }
502
+ </button>
503
+ <input
504
+ #field
505
+ class="cb-phone-input__field"
506
+ type="tel"
507
+ inputmode="tel"
508
+ autocomplete="tel-national"
509
+ [id]="inputId"
510
+ [value]="display()"
511
+ [placeholder]="placeholder() ?? examplePlaceholder()"
512
+ [disabled]="isDisabled()"
513
+ [required]="fieldState.required()"
514
+ [attr.aria-invalid]="showInvalid() ? 'true' : null"
515
+ [attr.aria-describedby]="describedBy()"
516
+ (input)="onInput($event)"
517
+ (blur)="onBlur()"
518
+ />
519
+ </div>
520
+ @if (showInvalid() && errorText()) {
521
+ <p class="cb-phone-input__message cb-phone-input__message--error" [id]="inputId + '-error'" role="alert">{{ errorText() }}</p>
522
+ } @else if (hint()) {
523
+ <p class="cb-phone-input__message" [id]="inputId + '-hint'">{{ hint() }}</p>
524
+ }
525
+
526
+ <ng-template #panel>
527
+ <div class="cb-phone-input__panel">
528
+ <input
529
+ #search
530
+ class="cb-phone-input__search"
531
+ type="text"
532
+ role="combobox"
533
+ aria-autocomplete="list"
534
+ aria-expanded="true"
535
+ autocomplete="off"
536
+ [attr.aria-controls]="listId"
537
+ [attr.aria-activedescendant]="activeId()"
538
+ [attr.aria-label]="t().searchCountry"
539
+ [placeholder]="t().searchCountry"
540
+ [value]="query()"
541
+ (input)="query.set($any($event.target).value); active.set(0)"
542
+ (keydown)="onSearchKeydown($event)"
543
+ />
544
+ <ul class="cb-phone-input__list" role="listbox" [id]="listId" [attr.aria-label]="t().phoneCountry">
545
+ @for (c of filtered(); track c.iso; let i = $index) {
546
+ <li
547
+ role="option"
548
+ class="cb-phone-input__option"
549
+ [id]="listId + '-' + c.iso"
550
+ [class.cb-phone-input__option--active]="i === active()"
551
+ [attr.aria-selected]="c.iso === selected()?.iso"
552
+ (mousemove)="active.set(i)"
553
+ (mousedown)="$event.preventDefault()"
554
+ (click)="choose(c)"
555
+ >
556
+ @if (showFlag()) {
557
+ <span class="cb-phone-input__flag" aria-hidden="true">{{ flag(c) }}</span>
558
+ }
559
+ <span class="cb-phone-input__name">{{ name(c) }}</span>
560
+ <span class="cb-phone-input__option-dial">+{{ c.dial }}</span>
561
+ </li>
562
+ } @empty {
563
+ <li class="cb-phone-input__empty" role="presentation">{{ t().noResults }}</li>
564
+ }
565
+ </ul>
566
+ </div>
567
+ </ng-template>
568
+ `, isInline: true, styles: [":host{display:block;min-width:0;font-family:var(--cb-font-sans)}.cb-phone-input__label{display:block;margin-bottom:var(--cb-space-1);font-size:var(--cb-text-sm);font-weight:var(--cb-font-weight-medium);color:var(--cb-color-text)}.cb-phone-input__required{margin-left:2px;color:var(--cb-color-danger)}.cb-phone-input__required--required,.cb-phone-input__required--optional{margin-left:.25rem;color:var(--cb-color-text-muted);font-size:.85em;font-weight:var(--cb-font-weight-normal, 400)}.cb-phone-input__control{display:flex;align-items:stretch;box-sizing:border-box;width:100%;overflow:hidden;border:var(--cb-border-width, 1px) solid var(--cb-color-border-strong);border-radius:var(--cb-radius-md);background-color:var(--cb-color-bg);transition:border-color var(--cb-duration-fast) var(--cb-ease),box-shadow var(--cb-duration-fast) var(--cb-ease)}.cb-phone-input__control:hover:not(.cb-is-disabled):not(:focus-within){border-color:var(--cb-color-text-muted)}.cb-phone-input__control:focus-within{border-color:var(--cb-color-primary-500);box-shadow:0 0 0 3px color-mix(in srgb,var(--cb-color-primary-500) 25%,transparent)}.cb-phone-input__control.cb-is-invalid{border-color:var(--cb-color-danger)}.cb-phone-input__control.cb-is-invalid:focus-within{box-shadow:0 0 0 3px color-mix(in srgb,var(--cb-color-danger) 25%,transparent)}.cb-phone-input__control.cb-is-disabled{background-color:var(--cb-color-surface);opacity:.8}.cb-phone-input__country{display:inline-flex;flex:none;align-items:center;gap:.375rem;padding:0 .625rem 0 .75rem;border:0;border-right:1px solid var(--cb-color-border);background:var(--cb-color-surface);color:var(--cb-color-text);font:inherit;cursor:pointer}.cb-phone-input__country:disabled{cursor:default}.cb-phone-input__country:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:-2px}.cb-phone-input__flag{font-size:1.15em;line-height:1}.cb-phone-input__dial{font-variant-numeric:tabular-nums}.cb-phone-input__field{flex:1;min-width:0;border:0;outline:none;background:transparent;color:var(--cb-color-text);font:inherit;font-variant-numeric:tabular-nums}.cb-phone-input__field::placeholder{color:var(--cb-color-text-muted)}.cb-phone-input__field:disabled{cursor:not-allowed;color:var(--cb-color-text-muted)}.cb-phone-input__control--sm{min-height:2rem;font-size:var(--cb-text-sm)}.cb-phone-input__control--sm .cb-phone-input__field{padding:var(--cb-space-1) var(--cb-space-2)}.cb-phone-input__control--md{min-height:2.5rem;font-size:var(--cb-text-base)}.cb-phone-input__control--md .cb-phone-input__field{padding:var(--cb-space-2) var(--cb-space-3)}.cb-phone-input__control--lg{min-height:3rem;font-size:var(--cb-text-lg)}.cb-phone-input__control--lg .cb-phone-input__field{padding:var(--cb-space-3) var(--cb-space-4)}.cb-phone-input__message{margin:var(--cb-space-1) 0 0;color:var(--cb-color-text-muted);font-size:var(--cb-text-sm)}.cb-phone-input__message--error{color:var(--cb-color-danger)}.cb-phone-input__panel{display:flex;flex-direction:column;width:20rem;max-width:calc(100vw - 2rem);max-height:20rem;overflow:hidden;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-md);background:var(--cb-color-surface-raised);box-shadow:var(--cb-shadow-lg);color:var(--cb-color-text);font-family:var(--cb-font-sans)}.cb-phone-input__search{margin:.5rem;padding:.5rem .625rem;border:1px solid var(--cb-color-border-strong);border-radius:var(--cb-radius-sm);background:var(--cb-color-bg);color:inherit;font:inherit;font-size:var(--cb-text-sm)}.cb-phone-input__search:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:0}.cb-phone-input__list{flex:1;margin:0;padding:0 .375rem .375rem;overflow-y:auto;list-style:none}.cb-phone-input__option{display:flex;align-items:center;gap:.625rem;padding:.5rem;border-radius:var(--cb-radius-sm);font-size:var(--cb-text-sm);cursor:pointer}.cb-phone-input__option--active{background:var(--cb-color-surface-hover)}.cb-phone-input__option[aria-selected=true]{font-weight:var(--cb-font-weight-semibold, 600)}.cb-phone-input__name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cb-phone-input__option-dial{color:var(--cb-color-text-muted);font-variant-numeric:tabular-nums}.cb-phone-input__empty{padding:1rem;color:var(--cb-color-text-muted);font-size:var(--cb-text-sm);text-align:center}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
569
+ }
570
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbPhoneInput, decorators: [{
571
+ type: Component,
572
+ args: [{ selector: 'cb-phone-input', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon], host: { class: 'cb-phone-input' }, providers: [
573
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => CbPhoneInput), multi: true },
574
+ { provide: NG_VALIDATORS, useExisting: forwardRef(() => CbPhoneInput), multi: true },
575
+ ], template: `
576
+ @if (label()) {
577
+ <label class="cb-phone-input__label" [attr.for]="inputId">
578
+ {{ label() }}
579
+ @if (fieldState.indicator(); as mark) {
580
+ <span [class]="'cb-phone-input__required cb-phone-input__required--' + mark.kind" [attr.aria-hidden]="mark.kind === 'optional' ? null : 'true'">{{ mark.text }}</span>
581
+ }
582
+ </label>
583
+ }
584
+ <div
585
+ class="cb-phone-input__control"
586
+ [class]="'cb-phone-input__control--' + size()"
587
+ [class.cb-is-invalid]="showInvalid()"
588
+ [class.cb-is-disabled]="isDisabled()"
589
+ >
590
+ <button
591
+ #trigger
592
+ type="button"
593
+ class="cb-phone-input__country"
594
+ aria-haspopup="listbox"
595
+ [attr.aria-expanded]="open()"
596
+ [attr.aria-controls]="open() ? listId : null"
597
+ [attr.aria-label]="countryLabel()"
598
+ [disabled]="isDisabled() || countryLocked()"
599
+ (click)="toggle()"
600
+ (keydown.arrowdown)="openFromKeyboard($event)"
601
+ >
602
+ @if (selected(); as c) {
603
+ @if (showFlag()) {
604
+ <span class="cb-phone-input__flag" aria-hidden="true">{{ flag(c) }}</span>
605
+ }
606
+ <span class="cb-phone-input__dial" aria-hidden="true">+{{ c.dial }}</span>
607
+ }
608
+ @if (!countryLocked()) {
609
+ <cb-icon name="chevron-down" [size]="14" aria-hidden="true" />
610
+ }
611
+ </button>
612
+ <input
613
+ #field
614
+ class="cb-phone-input__field"
615
+ type="tel"
616
+ inputmode="tel"
617
+ autocomplete="tel-national"
618
+ [id]="inputId"
619
+ [value]="display()"
620
+ [placeholder]="placeholder() ?? examplePlaceholder()"
621
+ [disabled]="isDisabled()"
622
+ [required]="fieldState.required()"
623
+ [attr.aria-invalid]="showInvalid() ? 'true' : null"
624
+ [attr.aria-describedby]="describedBy()"
625
+ (input)="onInput($event)"
626
+ (blur)="onBlur()"
627
+ />
628
+ </div>
629
+ @if (showInvalid() && errorText()) {
630
+ <p class="cb-phone-input__message cb-phone-input__message--error" [id]="inputId + '-error'" role="alert">{{ errorText() }}</p>
631
+ } @else if (hint()) {
632
+ <p class="cb-phone-input__message" [id]="inputId + '-hint'">{{ hint() }}</p>
633
+ }
634
+
635
+ <ng-template #panel>
636
+ <div class="cb-phone-input__panel">
637
+ <input
638
+ #search
639
+ class="cb-phone-input__search"
640
+ type="text"
641
+ role="combobox"
642
+ aria-autocomplete="list"
643
+ aria-expanded="true"
644
+ autocomplete="off"
645
+ [attr.aria-controls]="listId"
646
+ [attr.aria-activedescendant]="activeId()"
647
+ [attr.aria-label]="t().searchCountry"
648
+ [placeholder]="t().searchCountry"
649
+ [value]="query()"
650
+ (input)="query.set($any($event.target).value); active.set(0)"
651
+ (keydown)="onSearchKeydown($event)"
652
+ />
653
+ <ul class="cb-phone-input__list" role="listbox" [id]="listId" [attr.aria-label]="t().phoneCountry">
654
+ @for (c of filtered(); track c.iso; let i = $index) {
655
+ <li
656
+ role="option"
657
+ class="cb-phone-input__option"
658
+ [id]="listId + '-' + c.iso"
659
+ [class.cb-phone-input__option--active]="i === active()"
660
+ [attr.aria-selected]="c.iso === selected()?.iso"
661
+ (mousemove)="active.set(i)"
662
+ (mousedown)="$event.preventDefault()"
663
+ (click)="choose(c)"
664
+ >
665
+ @if (showFlag()) {
666
+ <span class="cb-phone-input__flag" aria-hidden="true">{{ flag(c) }}</span>
667
+ }
668
+ <span class="cb-phone-input__name">{{ name(c) }}</span>
669
+ <span class="cb-phone-input__option-dial">+{{ c.dial }}</span>
670
+ </li>
671
+ } @empty {
672
+ <li class="cb-phone-input__empty" role="presentation">{{ t().noResults }}</li>
673
+ }
674
+ </ul>
675
+ </div>
676
+ </ng-template>
677
+ `, styles: [":host{display:block;min-width:0;font-family:var(--cb-font-sans)}.cb-phone-input__label{display:block;margin-bottom:var(--cb-space-1);font-size:var(--cb-text-sm);font-weight:var(--cb-font-weight-medium);color:var(--cb-color-text)}.cb-phone-input__required{margin-left:2px;color:var(--cb-color-danger)}.cb-phone-input__required--required,.cb-phone-input__required--optional{margin-left:.25rem;color:var(--cb-color-text-muted);font-size:.85em;font-weight:var(--cb-font-weight-normal, 400)}.cb-phone-input__control{display:flex;align-items:stretch;box-sizing:border-box;width:100%;overflow:hidden;border:var(--cb-border-width, 1px) solid var(--cb-color-border-strong);border-radius:var(--cb-radius-md);background-color:var(--cb-color-bg);transition:border-color var(--cb-duration-fast) var(--cb-ease),box-shadow var(--cb-duration-fast) var(--cb-ease)}.cb-phone-input__control:hover:not(.cb-is-disabled):not(:focus-within){border-color:var(--cb-color-text-muted)}.cb-phone-input__control:focus-within{border-color:var(--cb-color-primary-500);box-shadow:0 0 0 3px color-mix(in srgb,var(--cb-color-primary-500) 25%,transparent)}.cb-phone-input__control.cb-is-invalid{border-color:var(--cb-color-danger)}.cb-phone-input__control.cb-is-invalid:focus-within{box-shadow:0 0 0 3px color-mix(in srgb,var(--cb-color-danger) 25%,transparent)}.cb-phone-input__control.cb-is-disabled{background-color:var(--cb-color-surface);opacity:.8}.cb-phone-input__country{display:inline-flex;flex:none;align-items:center;gap:.375rem;padding:0 .625rem 0 .75rem;border:0;border-right:1px solid var(--cb-color-border);background:var(--cb-color-surface);color:var(--cb-color-text);font:inherit;cursor:pointer}.cb-phone-input__country:disabled{cursor:default}.cb-phone-input__country:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:-2px}.cb-phone-input__flag{font-size:1.15em;line-height:1}.cb-phone-input__dial{font-variant-numeric:tabular-nums}.cb-phone-input__field{flex:1;min-width:0;border:0;outline:none;background:transparent;color:var(--cb-color-text);font:inherit;font-variant-numeric:tabular-nums}.cb-phone-input__field::placeholder{color:var(--cb-color-text-muted)}.cb-phone-input__field:disabled{cursor:not-allowed;color:var(--cb-color-text-muted)}.cb-phone-input__control--sm{min-height:2rem;font-size:var(--cb-text-sm)}.cb-phone-input__control--sm .cb-phone-input__field{padding:var(--cb-space-1) var(--cb-space-2)}.cb-phone-input__control--md{min-height:2.5rem;font-size:var(--cb-text-base)}.cb-phone-input__control--md .cb-phone-input__field{padding:var(--cb-space-2) var(--cb-space-3)}.cb-phone-input__control--lg{min-height:3rem;font-size:var(--cb-text-lg)}.cb-phone-input__control--lg .cb-phone-input__field{padding:var(--cb-space-3) var(--cb-space-4)}.cb-phone-input__message{margin:var(--cb-space-1) 0 0;color:var(--cb-color-text-muted);font-size:var(--cb-text-sm)}.cb-phone-input__message--error{color:var(--cb-color-danger)}.cb-phone-input__panel{display:flex;flex-direction:column;width:20rem;max-width:calc(100vw - 2rem);max-height:20rem;overflow:hidden;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-md);background:var(--cb-color-surface-raised);box-shadow:var(--cb-shadow-lg);color:var(--cb-color-text);font-family:var(--cb-font-sans)}.cb-phone-input__search{margin:.5rem;padding:.5rem .625rem;border:1px solid var(--cb-color-border-strong);border-radius:var(--cb-radius-sm);background:var(--cb-color-bg);color:inherit;font:inherit;font-size:var(--cb-text-sm)}.cb-phone-input__search:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:0}.cb-phone-input__list{flex:1;margin:0;padding:0 .375rem .375rem;overflow-y:auto;list-style:none}.cb-phone-input__option{display:flex;align-items:center;gap:.625rem;padding:.5rem;border-radius:var(--cb-radius-sm);font-size:var(--cb-text-sm);cursor:pointer}.cb-phone-input__option--active{background:var(--cb-color-surface-hover)}.cb-phone-input__option[aria-selected=true]{font-weight:var(--cb-font-weight-semibold, 600)}.cb-phone-input__name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cb-phone-input__option-dial{color:var(--cb-color-text-muted);font-variant-numeric:tabular-nums}.cb-phone-input__empty{padding:1rem;color:var(--cb-color-text-muted);font-size:var(--cb-text-sm);text-align:center}\n"] }]
678
+ }], ctorParameters: () => [], propDecorators: { triggerEl: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], fieldEl: [{ type: i0.ViewChild, args: ['field', { isSignal: true }] }], searchEl: [{ type: i0.ViewChild, args: ['search', { isSignal: true }] }], panelTpl: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], country: [{ type: i0.Input, args: [{ isSignal: true, alias: "country", required: false }] }, { type: i0.Output, args: ["countryChange"] }], countries: [{ type: i0.Input, args: [{ isSignal: true, alias: "countries", required: false }] }], preferredCountries: [{ type: i0.Input, args: [{ isSignal: true, alias: "preferredCountries", required: false }] }], countryLocked: [{ type: i0.Input, args: [{ isSignal: true, alias: "countryLocked", required: false }] }], showFlag: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFlag", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], requiredIndicator: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredIndicator", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], phoneChange: [{ type: i0.Output, args: ["phoneChange"] }] } });
679
+
680
+ /*
681
+ * Public API Surface de @caribeng/ui/phone-input
682
+ */
683
+
684
+ /**
685
+ * Generated bundle index. Do not edit.
686
+ */
687
+
688
+ export { CB_PHONE_COUNTRIES, CbPhoneInput, cbFlagEmoji, cbFormatNational, cbIsValidPhone, cbParsePhone, cbToE164 };