ngx-vector-components 4.94.0 → 4.96.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 (276) hide show
  1. package/CHANGELOG.md +1227 -1226
  2. package/README.md +35 -35
  3. package/assets/icons/chevron_down_icon.svg +3 -3
  4. package/assets/icons/home_menu_icon.svg +3 -3
  5. package/assets/icons/logout_icon.svg +9 -9
  6. package/assets/icons/menu_footer_icon.svg +3 -3
  7. package/assets/icons/menu_hamburguer_icon.svg +3 -3
  8. package/assets/icons/terms_of_use_icon.svg +9 -9
  9. package/assets/icons/vector_admin_icon.svg +4 -4
  10. package/assets/icons/vector_fintech_icon.svg +3 -3
  11. package/assets/icons/vector_logtech_icon.svg +6 -6
  12. package/assets/icons/vector_marketplace_icon.svg +3 -3
  13. package/assets/images/bunge_logo.svg +23 -23
  14. package/assets/images/cofco_logo.svg +117 -117
  15. package/assets/images/emote_bad.svg +6 -6
  16. package/assets/images/emote_cool.svg +5 -5
  17. package/assets/images/emote_nice.svg +5 -5
  18. package/assets/images/success_sign.svg +4 -4
  19. package/assets/images/vector-logo-horizontal-inverse-color.svg +13 -13
  20. package/assets/images/vector_logo_horizontal.svg +13 -13
  21. package/assets/images/warn_sign.svg +4 -4
  22. package/assets/styles/_fonts.scss +114 -114
  23. package/assets/styles/_mixins.scss +7 -7
  24. package/assets/styles/_primeng-custom-theme.scss +982 -982
  25. package/assets/styles/_spinner.scss +35 -35
  26. package/assets/styles/_styles.scss +115 -115
  27. package/assets/styles/_variables.scss +27 -27
  28. package/esm2020/lib/components/badge/badge.component.mjs +39 -0
  29. package/esm2020/lib/components/badge/badge.module.mjs +19 -0
  30. package/{esm2022 → esm2020}/lib/components/badge/index.mjs +1 -1
  31. package/esm2020/lib/components/breadcrumb/breadcrumb.component.mjs +66 -0
  32. package/esm2020/lib/components/breadcrumb/breadcrumb.module.mjs +18 -0
  33. package/{esm2022 → esm2020}/lib/components/breadcrumb/index.mjs +1 -1
  34. package/esm2020/lib/components/crud-base/crud-base.component.mjs +47 -0
  35. package/{esm2022 → esm2020}/lib/components/crud-base/index.mjs +1 -1
  36. package/esm2020/lib/components/crud-footer/crud-footer.component.mjs +32 -0
  37. package/esm2020/lib/components/crud-footer/crud-footer.module.mjs +20 -0
  38. package/{esm2022 → esm2020}/lib/components/crud-footer/index.mjs +1 -1
  39. package/esm2020/lib/components/crud-header/crud-header.component.mjs +30 -0
  40. package/esm2020/lib/components/crud-header/crud-header.module.mjs +19 -0
  41. package/{esm2022 → esm2020}/lib/components/crud-header/index.mjs +1 -1
  42. package/esm2020/lib/components/crud-history/crud-history.component.mjs +82 -0
  43. package/esm2020/lib/components/crud-history/crud-history.module.mjs +20 -0
  44. package/{esm2022 → esm2020}/lib/components/crud-history/index.mjs +1 -1
  45. package/esm2020/lib/components/fields/button/button.component.mjs +41 -0
  46. package/{esm2022 → esm2020}/lib/components/fields/button/index.mjs +1 -1
  47. package/esm2020/lib/components/fields/calendar-field/calendar-field.component.mjs +74 -0
  48. package/{esm2022 → esm2020}/lib/components/fields/calendar-field/index.mjs +1 -1
  49. package/esm2020/lib/components/fields/checkbox-field/checkbox-field.component.mjs +46 -0
  50. package/{esm2022 → esm2020}/lib/components/fields/checkbox-field/index.mjs +1 -1
  51. package/esm2020/lib/components/fields/currency-field/currency-field.component.mjs +98 -0
  52. package/{esm2022 → esm2020}/lib/components/fields/currency-field/index.mjs +1 -1
  53. package/esm2020/lib/components/fields/data-table/data-table.component.mjs +386 -0
  54. package/{esm2022 → esm2020}/lib/components/fields/data-table/index.mjs +1 -1
  55. package/esm2020/lib/components/fields/dropdown-field/dropdown-field.component.mjs +204 -0
  56. package/{esm2022 → esm2020}/lib/components/fields/dropdown-field/index.mjs +1 -1
  57. package/{esm2022 → esm2020}/lib/components/fields/field-error-message/field-error-message.component.mjs +5 -5
  58. package/{esm2022 → esm2020}/lib/components/fields/field-error-message/index.mjs +1 -1
  59. package/esm2020/lib/components/fields/fields.module.mjs +213 -0
  60. package/esm2020/lib/components/fields/filters/filters.component.mjs +203 -0
  61. package/{esm2022 → esm2020}/lib/components/fields/filters/index.mjs +1 -1
  62. package/{esm2022 → esm2020}/lib/components/fields/index.mjs +1 -1
  63. package/{esm2022 → esm2020}/lib/components/fields/input-number-field/index.mjs +1 -1
  64. package/esm2020/lib/components/fields/input-number-field/input-number-field.component.mjs +85 -0
  65. package/{esm2022 → esm2020}/lib/components/fields/multiselect-field/index.mjs +1 -1
  66. package/esm2020/lib/components/fields/multiselect-field/multiselect-field.component.mjs +50 -0
  67. package/{esm2022 → esm2020}/lib/components/fields/percentage-field/index.mjs +1 -1
  68. package/esm2020/lib/components/fields/percentage-field/percentage-field.component.mjs +42 -0
  69. package/{esm2022 → esm2020}/lib/components/fields/radio-button-field/index.mjs +1 -1
  70. package/esm2020/lib/components/fields/radio-button-field/radio-button-field.component.mjs +48 -0
  71. package/{esm2022 → esm2020}/lib/components/fields/range-value/index.mjs +1 -1
  72. package/esm2020/lib/components/fields/range-value/range-value.component.mjs +72 -0
  73. package/{esm2022 → esm2020}/lib/components/fields/search-field/index.mjs +1 -1
  74. package/esm2020/lib/components/fields/search-field/search-field.component.mjs +33 -0
  75. package/{esm2022 → esm2020}/lib/components/fields/select-button-field/index.mjs +1 -1
  76. package/esm2020/lib/components/fields/select-button-field/select-button-field.component.mjs +20 -0
  77. package/{esm2022 → esm2020}/lib/components/fields/text-field/index.mjs +1 -1
  78. package/esm2020/lib/components/fields/text-field/text-field.component.mjs +232 -0
  79. package/{esm2022 → esm2020}/lib/components/fields/textarea-field/index.mjs +1 -1
  80. package/esm2020/lib/components/fields/textarea-field/textarea-field.component.mjs +81 -0
  81. package/esm2020/lib/components/generic-error-modal/generic-error-modal.component.mjs +36 -0
  82. package/esm2020/lib/components/generic-error-modal/generic-error-modal.module.mjs +20 -0
  83. package/{esm2022 → esm2020}/lib/components/generic-error-modal/index.mjs +1 -1
  84. package/esm2020/lib/components/generic-modal/generic-modal.component.mjs +66 -0
  85. package/esm2020/lib/components/generic-modal/generic-modal.module.mjs +20 -0
  86. package/{esm2022 → esm2020}/lib/components/generic-modal/index.mjs +1 -1
  87. package/{esm2022 → esm2020}/lib/components/index.mjs +1 -1
  88. package/{esm2022 → esm2020}/lib/components/menu/index.mjs +1 -1
  89. package/esm2020/lib/components/menu/menu.component.mjs +305 -0
  90. package/esm2020/lib/components/menu/menu.module.mjs +20 -0
  91. package/esm2020/lib/components/menu/sub-menus-list/sub-menus-list.component.mjs +42 -0
  92. package/{esm2022 → esm2020}/lib/components/panel/index.mjs +1 -1
  93. package/esm2020/lib/components/panel/panel.component.mjs +15 -0
  94. package/esm2020/lib/components/panel/panel.module.mjs +19 -0
  95. package/{esm2022 → esm2020}/lib/components/score/index.mjs +1 -1
  96. package/esm2020/lib/components/score/score.component.mjs +17 -0
  97. package/{esm2022 → esm2020}/lib/components/score/score.module.mjs +5 -5
  98. package/{esm2022 → esm2020}/lib/components/top-bar/index.mjs +1 -1
  99. package/esm2020/lib/components/top-bar/top-bar.component.mjs +142 -0
  100. package/esm2020/lib/components/top-bar/top-bar.module.mjs +20 -0
  101. package/{esm2022 → esm2020}/lib/guards/crud-list-has-items.guard.mjs +4 -4
  102. package/{esm2022 → esm2020}/lib/guards/get-token-by-guid.guard.mjs +4 -4
  103. package/{esm2022 → esm2020}/lib/guards/has-permission.guard.mjs +4 -4
  104. package/{esm2022 → esm2020}/lib/guards/index.mjs +1 -1
  105. package/{esm2022 → esm2020}/lib/guards/role.guard.mjs +4 -4
  106. package/{esm2022 → esm2020}/lib/guards/token-is-present.guard.mjs +4 -4
  107. package/{esm2022 → esm2020}/lib/interceptors/http-interceptor.mjs +4 -4
  108. package/{esm2022 → esm2020}/lib/interceptors/index.mjs +1 -1
  109. package/{esm2022 → esm2020}/lib/models/app-name.enum.mjs +1 -1
  110. package/{esm2022 → esm2020}/lib/models/boolean-type.enum.mjs +1 -1
  111. package/{esm2022 → esm2020}/lib/models/crud-history.model.mjs +1 -1
  112. package/{esm2022 → esm2020}/lib/models/crud-mode.enum.mjs +1 -1
  113. package/{esm2022 → esm2020}/lib/models/currency.enum.mjs +1 -1
  114. package/esm2020/lib/models/data-table.model.mjs +23 -0
  115. package/{esm2022 → esm2020}/lib/models/document-type.enum.mjs +1 -1
  116. package/{esm2022 → esm2020}/lib/models/filters.model.mjs +1 -1
  117. package/{esm2022 → esm2020}/lib/models/generic-modal.model.mjs +1 -1
  118. package/esm2020/lib/models/http-response.model.mjs +2 -0
  119. package/{esm2022 → esm2020}/lib/models/index.mjs +1 -1
  120. package/{esm2022 → esm2020}/lib/models/ip-info.enum.mjs +1 -1
  121. package/{esm2022 → esm2020}/lib/models/list-item.model.mjs +1 -1
  122. package/{esm2022 → esm2020}/lib/models/locale.enum.mjs +1 -1
  123. package/esm2020/lib/models/menu-item.model.mjs +2 -0
  124. package/{esm2022 → esm2020}/lib/models/message-status.enum.mjs +1 -1
  125. package/{esm2022 → esm2020}/lib/models/profile.model.mjs +1 -1
  126. package/{esm2022 → esm2020}/lib/models/role.enum.mjs +1 -1
  127. package/{esm2022 → esm2020}/lib/models/status.enum.mjs +1 -1
  128. package/{esm2022 → esm2020}/lib/models/topbar.model.mjs +1 -1
  129. package/esm2020/lib/models/vector-app.model.mjs +2 -0
  130. package/{esm2022 → esm2020}/lib/models/vector-notification.model.mjs +1 -1
  131. package/{esm2022 → esm2020}/lib/models/view.enum.mjs +1 -1
  132. package/{esm2022 → esm2020}/lib/pipes/currency-brl.pipe.mjs +4 -4
  133. package/{esm2022 → esm2020}/lib/pipes/format-document.pipe.mjs +4 -4
  134. package/{esm2022 → esm2020}/lib/pipes/index.mjs +1 -1
  135. package/{esm2022 → esm2020}/lib/pipes/mask.pipe.mjs +4 -4
  136. package/{esm2022 → esm2020}/lib/pipes/not-hidden.pipe.mjs +4 -4
  137. package/{esm2022 → esm2020}/lib/pipes/only-active.pipe.mjs +4 -4
  138. package/esm2020/lib/pipes/pipes.module.mjs +50 -0
  139. package/{esm2022 → esm2020}/lib/pipes/remove-last-child.pipe.mjs +4 -4
  140. package/{esm2022 → esm2020}/lib/pipes/unread-notifications.pipe.mjs +4 -4
  141. package/{esm2022 → esm2020}/lib/resolvers/get-selected-crud-item.resolver.mjs +4 -4
  142. package/{esm2022 → esm2020}/lib/resolvers/index.mjs +1 -1
  143. package/{esm2022 → esm2020}/lib/services/auth.service.mjs +4 -4
  144. package/esm2020/lib/services/base-dropdown.mjs +2 -0
  145. package/{esm2022 → esm2020}/lib/services/crud-base.service.mjs +1 -1
  146. package/{esm2022 → esm2020}/lib/services/enum.service.mjs +4 -4
  147. package/{esm2022 → esm2020}/lib/services/error-message.service.mjs +4 -4
  148. package/{esm2022 → esm2020}/lib/services/geolocation.service.mjs +4 -4
  149. package/{esm2022 → esm2020}/lib/services/index.mjs +1 -1
  150. package/{esm2022 → esm2020}/lib/services/loading.service.mjs +4 -4
  151. package/{esm2022 → esm2020}/lib/services/menu.service.mjs +4 -4
  152. package/{esm2022 → esm2020}/lib/services/modal.service.mjs +4 -4
  153. package/{esm2022 → esm2020}/lib/services/notifications.service.mjs +4 -4
  154. package/{esm2022 → esm2020}/lib/services/profile.service.mjs +4 -4
  155. package/{esm2022 → esm2020}/lib/services/storage.service.mjs +4 -4
  156. package/esm2020/lib/shared/shared.module.mjs +19 -0
  157. package/{esm2022 → esm2020}/lib/utils/cpf-cnpj-validator.util.mjs +1 -1
  158. package/{esm2022 → esm2020}/lib/utils/file.util.mjs +1 -1
  159. package/{esm2022 → esm2020}/lib/utils/index.mjs +1 -1
  160. package/esm2020/lib/utils/mask.util.mjs +76 -0
  161. package/{esm2022 → esm2020}/lib/utils/object.util.mjs +1 -1
  162. package/{esm2022 → esm2020}/lib/utils/string.util.mjs +1 -1
  163. package/{esm2022 → esm2020}/lib/utils/validation.util.mjs +1 -1
  164. package/{esm2022 → esm2020}/lib/utils/window.util.mjs +1 -1
  165. package/{esm2022 → esm2020}/public-api.mjs +1 -1
  166. package/fesm2015/ngx-vector-components.mjs +4808 -0
  167. package/fesm2015/ngx-vector-components.mjs.map +1 -0
  168. package/fesm2020/ngx-vector-components.mjs +4786 -0
  169. package/fesm2020/ngx-vector-components.mjs.map +1 -0
  170. package/lib/components/badge/badge.component.d.ts +2 -2
  171. package/lib/components/breadcrumb/breadcrumb.component.d.ts +1 -1
  172. package/lib/components/crud-base/crud-base.component.d.ts +3 -3
  173. package/lib/components/crud-footer/crud-footer.component.d.ts +1 -1
  174. package/lib/components/crud-header/crud-header.component.d.ts +1 -1
  175. package/lib/components/crud-history/crud-history.component.d.ts +1 -1
  176. package/lib/components/fields/button/button.component.d.ts +2 -2
  177. package/lib/components/fields/calendar-field/calendar-field.component.d.ts +1 -1
  178. package/lib/components/fields/checkbox-field/checkbox-field.component.d.ts +1 -1
  179. package/lib/components/fields/currency-field/currency-field.component.d.ts +1 -1
  180. package/lib/components/fields/data-table/data-table.component.d.ts +3 -3
  181. package/lib/components/fields/dropdown-field/dropdown-field.component.d.ts +2 -2
  182. package/lib/components/fields/field-error-message/field-error-message.component.d.ts +1 -1
  183. package/lib/components/fields/filters/filters.component.d.ts +4 -4
  184. package/lib/components/fields/input-number-field/input-number-field.component.d.ts +1 -1
  185. package/lib/components/fields/multiselect-field/multiselect-field.component.d.ts +1 -1
  186. package/lib/components/fields/percentage-field/percentage-field.component.d.ts +1 -1
  187. package/lib/components/fields/radio-button-field/radio-button-field.component.d.ts +2 -2
  188. package/lib/components/fields/range-value/range-value.component.d.ts +1 -1
  189. package/lib/components/fields/search-field/search-field.component.d.ts +3 -3
  190. package/lib/components/fields/select-button-field/select-button-field.component.d.ts +1 -1
  191. package/lib/components/fields/text-field/text-field.component.d.ts +1 -1
  192. package/lib/components/fields/textarea-field/textarea-field.component.d.ts +1 -1
  193. package/lib/components/generic-error-modal/generic-error-modal.component.d.ts +1 -2
  194. package/lib/components/generic-modal/generic-modal.component.d.ts +1 -1
  195. package/lib/components/menu/menu.component.d.ts +1 -1
  196. package/lib/components/menu/sub-menus-list/sub-menus-list.component.d.ts +1 -1
  197. package/lib/components/panel/panel.component.d.ts +1 -1
  198. package/lib/components/score/score.component.d.ts +1 -1
  199. package/lib/components/top-bar/top-bar.component.d.ts +1 -1
  200. package/lib/guards/crud-list-has-items.guard.d.ts +2 -2
  201. package/lib/guards/get-token-by-guid.guard.d.ts +2 -2
  202. package/lib/guards/has-permission.guard.d.ts +2 -2
  203. package/lib/guards/role.guard.d.ts +2 -2
  204. package/lib/guards/token-is-present.guard.d.ts +2 -2
  205. package/lib/models/crud-history.model.d.ts +1 -1
  206. package/lib/models/data-table.model.d.ts +3 -3
  207. package/lib/models/filters.model.d.ts +1 -1
  208. package/lib/models/generic-modal.model.d.ts +1 -1
  209. package/lib/models/http-response.model.d.ts +8 -8
  210. package/lib/models/list-item.model.d.ts +1 -1
  211. package/lib/models/menu-item.model.d.ts +1 -1
  212. package/lib/models/profile.model.d.ts +5 -5
  213. package/lib/models/topbar.model.d.ts +1 -1
  214. package/lib/models/vector-app.model.d.ts +1 -1
  215. package/lib/models/vector-notification.model.d.ts +1 -1
  216. package/lib/pipes/currency-brl.pipe.d.ts +1 -1
  217. package/lib/pipes/format-document.pipe.d.ts +1 -1
  218. package/lib/pipes/mask.pipe.d.ts +1 -1
  219. package/lib/pipes/not-hidden.pipe.d.ts +1 -1
  220. package/lib/pipes/only-active.pipe.d.ts +1 -1
  221. package/lib/pipes/remove-last-child.pipe.d.ts +1 -1
  222. package/lib/pipes/unread-notifications.pipe.d.ts +1 -1
  223. package/lib/resolvers/get-selected-crud-item.resolver.d.ts +2 -2
  224. package/package.json +24 -18
  225. package/esm2022/lib/components/badge/badge.component.mjs +0 -39
  226. package/esm2022/lib/components/badge/badge.module.mjs +0 -19
  227. package/esm2022/lib/components/breadcrumb/breadcrumb.component.mjs +0 -66
  228. package/esm2022/lib/components/breadcrumb/breadcrumb.module.mjs +0 -18
  229. package/esm2022/lib/components/crud-base/crud-base.component.mjs +0 -47
  230. package/esm2022/lib/components/crud-footer/crud-footer.component.mjs +0 -32
  231. package/esm2022/lib/components/crud-footer/crud-footer.module.mjs +0 -20
  232. package/esm2022/lib/components/crud-header/crud-header.component.mjs +0 -30
  233. package/esm2022/lib/components/crud-header/crud-header.module.mjs +0 -19
  234. package/esm2022/lib/components/crud-history/crud-history.component.mjs +0 -82
  235. package/esm2022/lib/components/crud-history/crud-history.module.mjs +0 -20
  236. package/esm2022/lib/components/fields/button/button.component.mjs +0 -41
  237. package/esm2022/lib/components/fields/calendar-field/calendar-field.component.mjs +0 -74
  238. package/esm2022/lib/components/fields/checkbox-field/checkbox-field.component.mjs +0 -46
  239. package/esm2022/lib/components/fields/currency-field/currency-field.component.mjs +0 -98
  240. package/esm2022/lib/components/fields/data-table/data-table.component.mjs +0 -386
  241. package/esm2022/lib/components/fields/dropdown-field/dropdown-field.component.mjs +0 -204
  242. package/esm2022/lib/components/fields/fields.module.mjs +0 -211
  243. package/esm2022/lib/components/fields/filters/filters.component.mjs +0 -203
  244. package/esm2022/lib/components/fields/input-number-field/input-number-field.component.mjs +0 -85
  245. package/esm2022/lib/components/fields/multiselect-field/multiselect-field.component.mjs +0 -50
  246. package/esm2022/lib/components/fields/percentage-field/percentage-field.component.mjs +0 -42
  247. package/esm2022/lib/components/fields/radio-button-field/radio-button-field.component.mjs +0 -48
  248. package/esm2022/lib/components/fields/range-value/range-value.component.mjs +0 -72
  249. package/esm2022/lib/components/fields/search-field/search-field.component.mjs +0 -33
  250. package/esm2022/lib/components/fields/select-button-field/select-button-field.component.mjs +0 -20
  251. package/esm2022/lib/components/fields/text-field/text-field.component.mjs +0 -232
  252. package/esm2022/lib/components/fields/textarea-field/textarea-field.component.mjs +0 -81
  253. package/esm2022/lib/components/generic-error-modal/generic-error-modal.component.mjs +0 -39
  254. package/esm2022/lib/components/generic-error-modal/generic-error-modal.module.mjs +0 -20
  255. package/esm2022/lib/components/generic-modal/generic-modal.component.mjs +0 -66
  256. package/esm2022/lib/components/generic-modal/generic-modal.module.mjs +0 -20
  257. package/esm2022/lib/components/menu/menu.component.mjs +0 -305
  258. package/esm2022/lib/components/menu/menu.module.mjs +0 -20
  259. package/esm2022/lib/components/menu/sub-menus-list/sub-menus-list.component.mjs +0 -42
  260. package/esm2022/lib/components/panel/panel.component.mjs +0 -15
  261. package/esm2022/lib/components/panel/panel.module.mjs +0 -19
  262. package/esm2022/lib/components/score/score.component.mjs +0 -17
  263. package/esm2022/lib/components/top-bar/top-bar.component.mjs +0 -142
  264. package/esm2022/lib/components/top-bar/top-bar.module.mjs +0 -20
  265. package/esm2022/lib/models/data-table.model.mjs +0 -23
  266. package/esm2022/lib/models/http-response.model.mjs +0 -2
  267. package/esm2022/lib/models/menu-item.model.mjs +0 -2
  268. package/esm2022/lib/models/vector-app.model.mjs +0 -2
  269. package/esm2022/lib/pipes/pipes.module.mjs +0 -50
  270. package/esm2022/lib/services/base-dropdown.mjs +0 -2
  271. package/esm2022/lib/shared/shared.module.mjs +0 -19
  272. package/esm2022/lib/utils/mask.util.mjs +0 -76
  273. package/fesm2022/ngx-vector-components.mjs +0 -4787
  274. package/fesm2022/ngx-vector-components.mjs.map +0 -1
  275. /package/{esm2022 → esm2020}/ngx-vector-components.mjs +0 -0
  276. /package/{index.d.ts → ngx-vector-components.d.ts} +0 -0
@@ -1,76 +0,0 @@
1
- const CPF_PATTERN = '###.###.###-##';
2
- const CNPJ_PATTERN = '##.###.###/####-##';
3
- const BOLETO_PATTERN = '#####.##### #####.###### #####.###### # ############## #';
4
- const POSTALCODE_PATTERN = '#####-###';
5
- const CELLPHONE_PATTERN = '(##) #####-####';
6
- const PHONE_PATTERN = '(##) ####-####';
7
- const PLATE_PATTERN = '###-####';
8
- const HOURS_MINUTES_PATTERN = '##:##';
9
- const DNI_PATTERN = '##.###.###';
10
- const CUIT_PATTERN = '##-########-#';
11
- export class MaskUtil {
12
- static { this.CPF_TEXT_FIELD_PATTERN = '999.999.999-99'; }
13
- static { this.CNPJ_TEXT_FIELD_PATTERN = '99.999.999/9999-99'; }
14
- static { this.BOLETO_TEXT_FIELD_PATTERN = '99999.99999 99999.999999 99999.999999 9 99999999999999 9'; }
15
- static { this.CELLPHONE_TEXT_FIELD_PATTERN = '(99) 99999-9999'; }
16
- static { this.PHONE_TEXT_FIELD_PATTERN = '(99) 9999-9999'; }
17
- static { this.POSTALCODE_TEXT_FIELD_PATTERN = '99999-999'; }
18
- static { this.PLATE_FIELD_PATTERN = 'aaa-9*99'; }
19
- static { this.HOURS_MINUTES_FIELD_PATTERN = '99:99'; }
20
- static { this.DNI_FIELD_PATTERN = '99.999.999'; }
21
- static { this.CUIT_FIELD_PATTERN = '99.99999999.9'; }
22
- static formatDocument(stringValue) {
23
- if (!stringValue) {
24
- return '';
25
- }
26
- if (stringValue.length === 11) {
27
- return this.doMaskString(stringValue, CPF_PATTERN);
28
- }
29
- if (stringValue.length === 14) {
30
- return this.doMaskString(stringValue, CNPJ_PATTERN);
31
- }
32
- return stringValue;
33
- }
34
- static formatPostalCode(stringValue) {
35
- return this.doMaskString(stringValue, POSTALCODE_PATTERN);
36
- }
37
- static formatBoleto(stringValue) {
38
- return this.doMaskString(stringValue, BOLETO_PATTERN);
39
- }
40
- static formatPhone(stringValue) {
41
- if (!stringValue) {
42
- return '';
43
- }
44
- if (stringValue.length === 11) {
45
- return this.doMaskString(stringValue, CELLPHONE_PATTERN);
46
- }
47
- else if (stringValue.length === 10) {
48
- return this.doMaskString(stringValue, PHONE_PATTERN);
49
- }
50
- return stringValue;
51
- }
52
- static formatHoursMinutes(stringValue) {
53
- return this.doMaskString(stringValue, HOURS_MINUTES_PATTERN);
54
- }
55
- static formatPlate(stringValue) {
56
- return this.doMaskString(stringValue, PLATE_PATTERN);
57
- }
58
- static formatDni(stringValue) {
59
- return this.doMaskString(stringValue, DNI_PATTERN);
60
- }
61
- static formatCuit(stringValue) {
62
- return this.doMaskString(stringValue, CUIT_PATTERN);
63
- }
64
- static doMaskString(str, pattern) {
65
- if (!str?.trim()) {
66
- return '';
67
- }
68
- if (!pattern || !pattern.includes('#')) {
69
- console.warn('Utilize uma máscara válida. Ex.: (##) #####-####');
70
- return str;
71
- }
72
- let i = 0;
73
- return pattern.replace(/#/g, () => str[i++]);
74
- }
75
- }
76
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFzay51dGlsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXZlY3Rvci1jb21wb25lbnRzL3NyYy9saWIvdXRpbHMvbWFzay51dGlsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sV0FBVyxHQUFHLGdCQUFnQixDQUFDO0FBQ3JDLE1BQU0sWUFBWSxHQUFHLG9CQUFvQixDQUFDO0FBQzFDLE1BQU0sY0FBYyxHQUFHLDBEQUEwRCxDQUFDO0FBQ2xGLE1BQU0sa0JBQWtCLEdBQUcsV0FBVyxDQUFDO0FBQ3ZDLE1BQU0saUJBQWlCLEdBQUcsaUJBQWlCLENBQUM7QUFDNUMsTUFBTSxhQUFhLEdBQUcsZ0JBQWdCLENBQUM7QUFDdkMsTUFBTSxhQUFhLEdBQUcsVUFBVSxDQUFDO0FBQ2pDLE1BQU0scUJBQXFCLEdBQUcsT0FBTyxDQUFDO0FBQ3RDLE1BQU0sV0FBVyxHQUFHLFlBQVksQ0FBQztBQUNqQyxNQUFNLFlBQVksR0FBRyxlQUFlLENBQUM7QUFFckMsTUFBTSxPQUFPLFFBQVE7YUFDTCwyQkFBc0IsR0FBRyxnQkFBZ0IsQ0FBQzthQUMxQyw0QkFBdUIsR0FBRyxvQkFBb0IsQ0FBQzthQUMvQyw4QkFBeUIsR0FBRywwREFBMEQsQ0FBQzthQUN2RixpQ0FBNEIsR0FBRyxpQkFBaUIsQ0FBQzthQUNqRCw2QkFBd0IsR0FBRyxnQkFBZ0IsQ0FBQzthQUM1QyxrQ0FBNkIsR0FBRyxXQUFXLENBQUM7YUFDNUMsd0JBQ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