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.
- package/CHANGELOG.md +1227 -1226
- package/README.md +35 -35
- package/assets/icons/chevron_down_icon.svg +3 -3
- package/assets/icons/home_menu_icon.svg +3 -3
- package/assets/icons/logout_icon.svg +9 -9
- package/assets/icons/menu_footer_icon.svg +3 -3
- package/assets/icons/menu_hamburguer_icon.svg +3 -3
- package/assets/icons/terms_of_use_icon.svg +9 -9
- package/assets/icons/vector_admin_icon.svg +4 -4
- package/assets/icons/vector_fintech_icon.svg +3 -3
- package/assets/icons/vector_logtech_icon.svg +6 -6
- package/assets/icons/vector_marketplace_icon.svg +3 -3
- package/assets/images/bunge_logo.svg +23 -23
- package/assets/images/cofco_logo.svg +117 -117
- package/assets/images/emote_bad.svg +6 -6
- package/assets/images/emote_cool.svg +5 -5
- package/assets/images/emote_nice.svg +5 -5
- package/assets/images/success_sign.svg +4 -4
- package/assets/images/vector-logo-horizontal-inverse-color.svg +13 -13
- package/assets/images/vector_logo_horizontal.svg +13 -13
- package/assets/images/warn_sign.svg +4 -4
- package/assets/styles/_fonts.scss +114 -114
- package/assets/styles/_mixins.scss +7 -7
- package/assets/styles/_primeng-custom-theme.scss +982 -982
- package/assets/styles/_spinner.scss +35 -35
- package/assets/styles/_styles.scss +115 -115
- package/assets/styles/_variables.scss +27 -27
- package/esm2020/lib/components/badge/badge.component.mjs +39 -0
- package/esm2020/lib/components/badge/badge.module.mjs +19 -0
- package/{esm2022 → esm2020}/lib/components/badge/index.mjs +1 -1
- package/esm2020/lib/components/breadcrumb/breadcrumb.component.mjs +66 -0
- package/esm2020/lib/components/breadcrumb/breadcrumb.module.mjs +18 -0
- package/{esm2022 → esm2020}/lib/components/breadcrumb/index.mjs +1 -1
- package/esm2020/lib/components/crud-base/crud-base.component.mjs +47 -0
- package/{esm2022 → esm2020}/lib/components/crud-base/index.mjs +1 -1
- package/esm2020/lib/components/crud-footer/crud-footer.component.mjs +32 -0
- package/esm2020/lib/components/crud-footer/crud-footer.module.mjs +20 -0
- package/{esm2022 → esm2020}/lib/components/crud-footer/index.mjs +1 -1
- package/esm2020/lib/components/crud-header/crud-header.component.mjs +30 -0
- package/esm2020/lib/components/crud-header/crud-header.module.mjs +19 -0
- package/{esm2022 → esm2020}/lib/components/crud-header/index.mjs +1 -1
- package/esm2020/lib/components/crud-history/crud-history.component.mjs +82 -0
- package/esm2020/lib/components/crud-history/crud-history.module.mjs +20 -0
- package/{esm2022 → esm2020}/lib/components/crud-history/index.mjs +1 -1
- package/esm2020/lib/components/fields/button/button.component.mjs +41 -0
- package/{esm2022 → esm2020}/lib/components/fields/button/index.mjs +1 -1
- package/esm2020/lib/components/fields/calendar-field/calendar-field.component.mjs +74 -0
- package/{esm2022 → esm2020}/lib/components/fields/calendar-field/index.mjs +1 -1
- package/esm2020/lib/components/fields/checkbox-field/checkbox-field.component.mjs +46 -0
- package/{esm2022 → esm2020}/lib/components/fields/checkbox-field/index.mjs +1 -1
- package/esm2020/lib/components/fields/currency-field/currency-field.component.mjs +98 -0
- package/{esm2022 → esm2020}/lib/components/fields/currency-field/index.mjs +1 -1
- package/esm2020/lib/components/fields/data-table/data-table.component.mjs +386 -0
- package/{esm2022 → esm2020}/lib/components/fields/data-table/index.mjs +1 -1
- package/esm2020/lib/components/fields/dropdown-field/dropdown-field.component.mjs +204 -0
- package/{esm2022 → esm2020}/lib/components/fields/dropdown-field/index.mjs +1 -1
- package/{esm2022 → esm2020}/lib/components/fields/field-error-message/field-error-message.component.mjs +5 -5
- package/{esm2022 → esm2020}/lib/components/fields/field-error-message/index.mjs +1 -1
- package/esm2020/lib/components/fields/fields.module.mjs +213 -0
- package/esm2020/lib/components/fields/filters/filters.component.mjs +203 -0
- package/{esm2022 → esm2020}/lib/components/fields/filters/index.mjs +1 -1
- package/{esm2022 → esm2020}/lib/components/fields/index.mjs +1 -1
- package/{esm2022 → esm2020}/lib/components/fields/input-number-field/index.mjs +1 -1
- package/esm2020/lib/components/fields/input-number-field/input-number-field.component.mjs +85 -0
- package/{esm2022 → esm2020}/lib/components/fields/multiselect-field/index.mjs +1 -1
- package/esm2020/lib/components/fields/multiselect-field/multiselect-field.component.mjs +50 -0
- package/{esm2022 → esm2020}/lib/components/fields/percentage-field/index.mjs +1 -1
- package/esm2020/lib/components/fields/percentage-field/percentage-field.component.mjs +42 -0
- package/{esm2022 → esm2020}/lib/components/fields/radio-button-field/index.mjs +1 -1
- package/esm2020/lib/components/fields/radio-button-field/radio-button-field.component.mjs +48 -0
- package/{esm2022 → esm2020}/lib/components/fields/range-value/index.mjs +1 -1
- package/esm2020/lib/components/fields/range-value/range-value.component.mjs +72 -0
- package/{esm2022 → esm2020}/lib/components/fields/search-field/index.mjs +1 -1
- package/esm2020/lib/components/fields/search-field/search-field.component.mjs +33 -0
- package/{esm2022 → esm2020}/lib/components/fields/select-button-field/index.mjs +1 -1
- package/esm2020/lib/components/fields/select-button-field/select-button-field.component.mjs +20 -0
- package/{esm2022 → esm2020}/lib/components/fields/text-field/index.mjs +1 -1
- package/esm2020/lib/components/fields/text-field/text-field.component.mjs +232 -0
- package/{esm2022 → esm2020}/lib/components/fields/textarea-field/index.mjs +1 -1
- package/esm2020/lib/components/fields/textarea-field/textarea-field.component.mjs +81 -0
- package/esm2020/lib/components/generic-error-modal/generic-error-modal.component.mjs +36 -0
- package/esm2020/lib/components/generic-error-modal/generic-error-modal.module.mjs +20 -0
- package/{esm2022 → esm2020}/lib/components/generic-error-modal/index.mjs +1 -1
- package/esm2020/lib/components/generic-modal/generic-modal.component.mjs +66 -0
- package/esm2020/lib/components/generic-modal/generic-modal.module.mjs +20 -0
- package/{esm2022 → esm2020}/lib/components/generic-modal/index.mjs +1 -1
- package/{esm2022 → esm2020}/lib/components/index.mjs +1 -1
- package/{esm2022 → esm2020}/lib/components/menu/index.mjs +1 -1
- package/esm2020/lib/components/menu/menu.component.mjs +305 -0
- package/esm2020/lib/components/menu/menu.module.mjs +20 -0
- package/esm2020/lib/components/menu/sub-menus-list/sub-menus-list.component.mjs +42 -0
- package/{esm2022 → esm2020}/lib/components/panel/index.mjs +1 -1
- package/esm2020/lib/components/panel/panel.component.mjs +15 -0
- package/esm2020/lib/components/panel/panel.module.mjs +19 -0
- package/{esm2022 → esm2020}/lib/components/score/index.mjs +1 -1
- package/esm2020/lib/components/score/score.component.mjs +17 -0
- package/{esm2022 → esm2020}/lib/components/score/score.module.mjs +5 -5
- package/{esm2022 → esm2020}/lib/components/top-bar/index.mjs +1 -1
- package/esm2020/lib/components/top-bar/top-bar.component.mjs +142 -0
- package/esm2020/lib/components/top-bar/top-bar.module.mjs +20 -0
- package/{esm2022 → esm2020}/lib/guards/crud-list-has-items.guard.mjs +4 -4
- package/{esm2022 → esm2020}/lib/guards/get-token-by-guid.guard.mjs +4 -4
- package/{esm2022 → esm2020}/lib/guards/has-permission.guard.mjs +4 -4
- package/{esm2022 → esm2020}/lib/guards/index.mjs +1 -1
- package/{esm2022 → esm2020}/lib/guards/role.guard.mjs +4 -4
- package/{esm2022 → esm2020}/lib/guards/token-is-present.guard.mjs +4 -4
- package/{esm2022 → esm2020}/lib/interceptors/http-interceptor.mjs +4 -4
- package/{esm2022 → esm2020}/lib/interceptors/index.mjs +1 -1
- package/{esm2022 → esm2020}/lib/models/app-name.enum.mjs +1 -1
- package/{esm2022 → esm2020}/lib/models/boolean-type.enum.mjs +1 -1
- package/{esm2022 → esm2020}/lib/models/crud-history.model.mjs +1 -1
- package/{esm2022 → esm2020}/lib/models/crud-mode.enum.mjs +1 -1
- package/{esm2022 → esm2020}/lib/models/currency.enum.mjs +1 -1
- package/esm2020/lib/models/data-table.model.mjs +23 -0
- package/{esm2022 → esm2020}/lib/models/document-type.enum.mjs +1 -1
- package/{esm2022 → esm2020}/lib/models/filters.model.mjs +1 -1
- package/{esm2022 → esm2020}/lib/models/generic-modal.model.mjs +1 -1
- package/esm2020/lib/models/http-response.model.mjs +2 -0
- package/{esm2022 → esm2020}/lib/models/index.mjs +1 -1
- package/{esm2022 → esm2020}/lib/models/ip-info.enum.mjs +1 -1
- package/{esm2022 → esm2020}/lib/models/list-item.model.mjs +1 -1
- package/{esm2022 → esm2020}/lib/models/locale.enum.mjs +1 -1
- package/esm2020/lib/models/menu-item.model.mjs +2 -0
- package/{esm2022 → esm2020}/lib/models/message-status.enum.mjs +1 -1
- package/{esm2022 → esm2020}/lib/models/profile.model.mjs +1 -1
- package/{esm2022 → esm2020}/lib/models/role.enum.mjs +1 -1
- package/{esm2022 → esm2020}/lib/models/status.enum.mjs +1 -1
- package/{esm2022 → esm2020}/lib/models/topbar.model.mjs +1 -1
- package/esm2020/lib/models/vector-app.model.mjs +2 -0
- package/{esm2022 → esm2020}/lib/models/vector-notification.model.mjs +1 -1
- package/{esm2022 → esm2020}/lib/models/view.enum.mjs +1 -1
- package/{esm2022 → esm2020}/lib/pipes/currency-brl.pipe.mjs +4 -4
- package/{esm2022 → esm2020}/lib/pipes/format-document.pipe.mjs +4 -4
- package/{esm2022 → esm2020}/lib/pipes/index.mjs +1 -1
- package/{esm2022 → esm2020}/lib/pipes/mask.pipe.mjs +4 -4
- package/{esm2022 → esm2020}/lib/pipes/not-hidden.pipe.mjs +4 -4
- package/{esm2022 → esm2020}/lib/pipes/only-active.pipe.mjs +4 -4
- package/esm2020/lib/pipes/pipes.module.mjs +50 -0
- package/{esm2022 → esm2020}/lib/pipes/remove-last-child.pipe.mjs +4 -4
- package/{esm2022 → esm2020}/lib/pipes/unread-notifications.pipe.mjs +4 -4
- package/{esm2022 → esm2020}/lib/resolvers/get-selected-crud-item.resolver.mjs +4 -4
- package/{esm2022 → esm2020}/lib/resolvers/index.mjs +1 -1
- package/{esm2022 → esm2020}/lib/services/auth.service.mjs +4 -4
- package/esm2020/lib/services/base-dropdown.mjs +2 -0
- package/{esm2022 → esm2020}/lib/services/crud-base.service.mjs +1 -1
- package/{esm2022 → esm2020}/lib/services/enum.service.mjs +4 -4
- package/{esm2022 → esm2020}/lib/services/error-message.service.mjs +4 -4
- package/{esm2022 → esm2020}/lib/services/geolocation.service.mjs +4 -4
- package/{esm2022 → esm2020}/lib/services/index.mjs +1 -1
- package/{esm2022 → esm2020}/lib/services/loading.service.mjs +4 -4
- package/{esm2022 → esm2020}/lib/services/menu.service.mjs +4 -4
- package/{esm2022 → esm2020}/lib/services/modal.service.mjs +4 -4
- package/{esm2022 → esm2020}/lib/services/notifications.service.mjs +4 -4
- package/{esm2022 → esm2020}/lib/services/profile.service.mjs +4 -4
- package/{esm2022 → esm2020}/lib/services/storage.service.mjs +4 -4
- package/esm2020/lib/shared/shared.module.mjs +19 -0
- package/{esm2022 → esm2020}/lib/utils/cpf-cnpj-validator.util.mjs +1 -1
- package/{esm2022 → esm2020}/lib/utils/file.util.mjs +1 -1
- package/{esm2022 → esm2020}/lib/utils/index.mjs +1 -1
- package/esm2020/lib/utils/mask.util.mjs +76 -0
- package/{esm2022 → esm2020}/lib/utils/object.util.mjs +1 -1
- package/{esm2022 → esm2020}/lib/utils/string.util.mjs +1 -1
- package/{esm2022 → esm2020}/lib/utils/validation.util.mjs +1 -1
- package/{esm2022 → esm2020}/lib/utils/window.util.mjs +1 -1
- package/{esm2022 → esm2020}/public-api.mjs +1 -1
- package/fesm2015/ngx-vector-components.mjs +4808 -0
- package/fesm2015/ngx-vector-components.mjs.map +1 -0
- package/fesm2020/ngx-vector-components.mjs +4786 -0
- package/fesm2020/ngx-vector-components.mjs.map +1 -0
- package/lib/components/badge/badge.component.d.ts +2 -2
- package/lib/components/breadcrumb/breadcrumb.component.d.ts +1 -1
- package/lib/components/crud-base/crud-base.component.d.ts +3 -3
- package/lib/components/crud-footer/crud-footer.component.d.ts +1 -1
- package/lib/components/crud-header/crud-header.component.d.ts +1 -1
- package/lib/components/crud-history/crud-history.component.d.ts +1 -1
- package/lib/components/fields/button/button.component.d.ts +2 -2
- package/lib/components/fields/calendar-field/calendar-field.component.d.ts +1 -1
- package/lib/components/fields/checkbox-field/checkbox-field.component.d.ts +1 -1
- package/lib/components/fields/currency-field/currency-field.component.d.ts +1 -1
- package/lib/components/fields/data-table/data-table.component.d.ts +3 -3
- package/lib/components/fields/dropdown-field/dropdown-field.component.d.ts +2 -2
- package/lib/components/fields/field-error-message/field-error-message.component.d.ts +1 -1
- package/lib/components/fields/filters/filters.component.d.ts +4 -4
- package/lib/components/fields/input-number-field/input-number-field.component.d.ts +1 -1
- package/lib/components/fields/multiselect-field/multiselect-field.component.d.ts +1 -1
- package/lib/components/fields/percentage-field/percentage-field.component.d.ts +1 -1
- package/lib/components/fields/radio-button-field/radio-button-field.component.d.ts +2 -2
- package/lib/components/fields/range-value/range-value.component.d.ts +1 -1
- package/lib/components/fields/search-field/search-field.component.d.ts +3 -3
- package/lib/components/fields/select-button-field/select-button-field.component.d.ts +1 -1
- package/lib/components/fields/text-field/text-field.component.d.ts +1 -1
- package/lib/components/fields/textarea-field/textarea-field.component.d.ts +1 -1
- package/lib/components/generic-error-modal/generic-error-modal.component.d.ts +1 -2
- package/lib/components/generic-modal/generic-modal.component.d.ts +1 -1
- package/lib/components/menu/menu.component.d.ts +1 -1
- package/lib/components/menu/sub-menus-list/sub-menus-list.component.d.ts +1 -1
- package/lib/components/panel/panel.component.d.ts +1 -1
- package/lib/components/score/score.component.d.ts +1 -1
- package/lib/components/top-bar/top-bar.component.d.ts +1 -1
- package/lib/guards/crud-list-has-items.guard.d.ts +2 -2
- package/lib/guards/get-token-by-guid.guard.d.ts +2 -2
- package/lib/guards/has-permission.guard.d.ts +2 -2
- package/lib/guards/role.guard.d.ts +2 -2
- package/lib/guards/token-is-present.guard.d.ts +2 -2
- package/lib/models/crud-history.model.d.ts +1 -1
- package/lib/models/data-table.model.d.ts +3 -3
- package/lib/models/filters.model.d.ts +1 -1
- package/lib/models/generic-modal.model.d.ts +1 -1
- package/lib/models/http-response.model.d.ts +8 -8
- package/lib/models/list-item.model.d.ts +1 -1
- package/lib/models/menu-item.model.d.ts +1 -1
- package/lib/models/profile.model.d.ts +5 -5
- package/lib/models/topbar.model.d.ts +1 -1
- package/lib/models/vector-app.model.d.ts +1 -1
- package/lib/models/vector-notification.model.d.ts +1 -1
- package/lib/pipes/currency-brl.pipe.d.ts +1 -1
- package/lib/pipes/format-document.pipe.d.ts +1 -1
- package/lib/pipes/mask.pipe.d.ts +1 -1
- package/lib/pipes/not-hidden.pipe.d.ts +1 -1
- package/lib/pipes/only-active.pipe.d.ts +1 -1
- package/lib/pipes/remove-last-child.pipe.d.ts +1 -1
- package/lib/pipes/unread-notifications.pipe.d.ts +1 -1
- package/lib/resolvers/get-selected-crud-item.resolver.d.ts +2 -2
- package/package.json +24 -18
- package/esm2022/lib/components/badge/badge.component.mjs +0 -39
- package/esm2022/lib/components/badge/badge.module.mjs +0 -19
- package/esm2022/lib/components/breadcrumb/breadcrumb.component.mjs +0 -66
- package/esm2022/lib/components/breadcrumb/breadcrumb.module.mjs +0 -18
- package/esm2022/lib/components/crud-base/crud-base.component.mjs +0 -47
- package/esm2022/lib/components/crud-footer/crud-footer.component.mjs +0 -32
- package/esm2022/lib/components/crud-footer/crud-footer.module.mjs +0 -20
- package/esm2022/lib/components/crud-header/crud-header.component.mjs +0 -30
- package/esm2022/lib/components/crud-header/crud-header.module.mjs +0 -19
- package/esm2022/lib/components/crud-history/crud-history.component.mjs +0 -82
- package/esm2022/lib/components/crud-history/crud-history.module.mjs +0 -20
- package/esm2022/lib/components/fields/button/button.component.mjs +0 -41
- package/esm2022/lib/components/fields/calendar-field/calendar-field.component.mjs +0 -74
- package/esm2022/lib/components/fields/checkbox-field/checkbox-field.component.mjs +0 -46
- package/esm2022/lib/components/fields/currency-field/currency-field.component.mjs +0 -98
- package/esm2022/lib/components/fields/data-table/data-table.component.mjs +0 -386
- package/esm2022/lib/components/fields/dropdown-field/dropdown-field.component.mjs +0 -204
- package/esm2022/lib/components/fields/fields.module.mjs +0 -211
- package/esm2022/lib/components/fields/filters/filters.component.mjs +0 -203
- package/esm2022/lib/components/fields/input-number-field/input-number-field.component.mjs +0 -85
- package/esm2022/lib/components/fields/multiselect-field/multiselect-field.component.mjs +0 -50
- package/esm2022/lib/components/fields/percentage-field/percentage-field.component.mjs +0 -42
- package/esm2022/lib/components/fields/radio-button-field/radio-button-field.component.mjs +0 -48
- package/esm2022/lib/components/fields/range-value/range-value.component.mjs +0 -72
- package/esm2022/lib/components/fields/search-field/search-field.component.mjs +0 -33
- package/esm2022/lib/components/fields/select-button-field/select-button-field.component.mjs +0 -20
- package/esm2022/lib/components/fields/text-field/text-field.component.mjs +0 -232
- package/esm2022/lib/components/fields/textarea-field/textarea-field.component.mjs +0 -81
- package/esm2022/lib/components/generic-error-modal/generic-error-modal.component.mjs +0 -39
- package/esm2022/lib/components/generic-error-modal/generic-error-modal.module.mjs +0 -20
- package/esm2022/lib/components/generic-modal/generic-modal.component.mjs +0 -66
- package/esm2022/lib/components/generic-modal/generic-modal.module.mjs +0 -20
- package/esm2022/lib/components/menu/menu.component.mjs +0 -305
- package/esm2022/lib/components/menu/menu.module.mjs +0 -20
- package/esm2022/lib/components/menu/sub-menus-list/sub-menus-list.component.mjs +0 -42
- package/esm2022/lib/components/panel/panel.component.mjs +0 -15
- package/esm2022/lib/components/panel/panel.module.mjs +0 -19
- package/esm2022/lib/components/score/score.component.mjs +0 -17
- package/esm2022/lib/components/top-bar/top-bar.component.mjs +0 -142
- package/esm2022/lib/components/top-bar/top-bar.module.mjs +0 -20
- package/esm2022/lib/models/data-table.model.mjs +0 -23
- package/esm2022/lib/models/http-response.model.mjs +0 -2
- package/esm2022/lib/models/menu-item.model.mjs +0 -2
- package/esm2022/lib/models/vector-app.model.mjs +0 -2
- package/esm2022/lib/pipes/pipes.module.mjs +0 -50
- package/esm2022/lib/services/base-dropdown.mjs +0 -2
- package/esm2022/lib/shared/shared.module.mjs +0 -19
- package/esm2022/lib/utils/mask.util.mjs +0 -76
- package/fesm2022/ngx-vector-components.mjs +0 -4787
- package/fesm2022/ngx-vector-components.mjs.map +0 -1
- /package/{esm2022 → esm2020}/ngx-vector-components.mjs +0 -0
- /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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