@seniorsistemas/angular-components 19.9.14 → 19.9.15-develop-11ab86f5
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/README.md +84 -2
- package/accordion/README.md +5 -4
- package/accordion/lib/accordion/accordion.module.d.ts +7 -0
- package/alert/lib/alert/alert.module.d.ts +7 -0
- package/badge/README.md +5 -4
- package/badge/lib/badge/badge.module.d.ts +10 -0
- package/bignumber-input/README.md +5 -4
- package/bignumber-input/lib/bignumber-input/bignumber-input.directive.d.ts +16 -39
- package/bignumber-input/lib/bignumber-input/bignumber-input.module.d.ts +7 -0
- package/breadcrumb/README.md +5 -4
- package/breadcrumb/lib/dynamic-breadcrumb/dynamic-breadcrumb.module.d.ts +5 -1
- package/button/lib/button/button.module.d.ts +7 -0
- package/calendar-mask/README.md +5 -4
- package/calendar-mask/lib/calendar-mask/calendar-mask.module.d.ts +7 -0
- package/card/README.md +6 -5
- package/card/lib/card/card.component.d.ts +2 -0
- package/card/lib/card/card.module.d.ts +7 -0
- package/chat/README.md +11 -8
- package/chat/lib/chat/chat.module.d.ts +7 -0
- package/checkbox-list/README.md +5 -4
- package/checkbox-list/lib/checkbox-list/checkbox-list.module.d.ts +7 -0
- package/chips/README.md +5 -4
- package/chips/lib/chips/chips.module.d.ts +7 -0
- package/code-editor/README.md +5 -4
- package/code-editor/lib/code-editor/code-editor.module.d.ts +7 -0
- package/collapse-link/README.md +5 -4
- package/collapse-link/lib/collapse-link/collapse-link.module.d.ts +7 -0
- package/common/lib/angular-components.module.d.ts +9 -0
- package/common/lib/provide-angular-components.d.ts +19 -0
- package/common/lib/svg-factory/svg-factory.module.d.ts +7 -0
- package/common/public-api.d.ts +1 -0
- package/content-generator/README.md +2 -2
- package/content-generator/lib/content-generator/content-generator.module.d.ts +7 -0
- package/control-errors/README.md +2 -2
- package/control-errors/lib/control-errors/control-errors.module.d.ts +7 -0
- package/country-phone-picker/README.md +2 -2
- package/country-phone-picker/lib/country-phone-picker/country-phone-picker.component.d.ts +1 -0
- package/country-phone-picker/lib/country-phone-picker/country-phone-picker.module.d.ts +7 -0
- package/currency/README.md +1 -1
- package/custom-fields/README.md +14 -3
- package/custom-fields/lib/custom-fields/custom-fields.module.d.ts +7 -0
- package/custom-fields/lib/custom-fields/models/custom-field-value-parser.d.ts +21 -0
- package/custom-fields/lib/custom-fields/models/index.d.ts +1 -0
- package/dialog/README.md +1 -1
- package/drawer/README.md +8 -4
- package/drawer/lib/drawer/drawer.module.d.ts +10 -0
- package/dynamic-form/README.md +18 -2
- package/dynamic-form/dynamic-form/components/lookup/lookup.component.d.ts +0 -1
- package/dynamic-form/dynamic-form/dynamic-form.module.d.ts +7 -0
- package/dynamic-form/dynamic-form/form-field/addon-config.d.ts +10 -1
- package/dynamic-form/dynamic-form/form-field/configurations/fields/currency-field.d.ts +15 -15
- package/dynamic-form/dynamic-form/form-field/configurations/fields/number-field.d.ts +8 -6
- package/dynamic-form/dynamic-form/form-field/fields/bignumber/bignumber-field.component.d.ts +5 -2
- package/dynamic-form/public-api.d.ts +0 -1
- package/editable-overlay/README.md +2 -2
- package/editable-overlay/lib/editable-overlay/editable-overlay.module.d.ts +7 -0
- package/empty-state/README.md +5 -2
- package/empty-state/lib/empty-state/empty-state.module.d.ts +7 -0
- package/esm2022/accordion/lib/accordion/accordion.module.mjs +8 -1
- package/esm2022/alert/lib/alert/alert.module.mjs +8 -1
- package/esm2022/badge/lib/badge/badge.module.mjs +11 -1
- package/esm2022/bignumber-input/lib/bignumber-input/bignumber-input.directive.mjs +19 -127
- package/esm2022/bignumber-input/lib/bignumber-input/bignumber-input.module.mjs +8 -1
- package/esm2022/breadcrumb/lib/dynamic-breadcrumb/dynamic-breadcrumb.module.mjs +6 -2
- package/esm2022/button/lib/button/button.module.mjs +8 -1
- package/esm2022/calendar-mask/lib/calendar-mask/calendar-mask.module.mjs +8 -1
- package/esm2022/card/lib/card/card.component.mjs +17 -3
- package/esm2022/card/lib/card/card.module.mjs +8 -1
- package/esm2022/chat/lib/chat/chat.module.mjs +8 -1
- package/esm2022/checkbox-list/lib/checkbox-list/checkbox-list.module.mjs +8 -1
- package/esm2022/chips/lib/chips/chips/chips.component.mjs +3 -3
- package/esm2022/chips/lib/chips/chips.module.mjs +8 -1
- package/esm2022/code-editor/lib/code-editor/code-editor.component.mjs +10 -1
- package/esm2022/code-editor/lib/code-editor/code-editor.module.mjs +9 -15
- package/esm2022/collapse-link/lib/collapse-link/collapse-link.module.mjs +8 -1
- package/esm2022/common/lib/angular-components.module.mjs +10 -1
- package/esm2022/common/lib/provide-angular-components.mjs +22 -0
- package/esm2022/common/lib/svg-factory/svg-factory.module.mjs +8 -1
- package/esm2022/common/public-api.mjs +2 -1
- package/esm2022/content-generator/lib/content-generator/content-generator.module.mjs +8 -1
- package/esm2022/control-errors/lib/control-errors/control-errors.module.mjs +8 -1
- package/esm2022/country-phone-picker/lib/country-phone-picker/country-phone-picker.component.mjs +12 -7
- package/esm2022/country-phone-picker/lib/country-phone-picker/country-phone-picker.module.mjs +8 -1
- package/esm2022/country-phone-picker/lib/country-phone-picker/country-phone-picker.service.mjs +4 -3
- package/esm2022/custom-fields/lib/custom-fields/custom-fields.component.mjs +17 -13
- package/esm2022/custom-fields/lib/custom-fields/custom-fields.module.mjs +8 -1
- package/esm2022/custom-fields/lib/custom-fields/custom-fields.service.mjs +4 -3
- package/esm2022/custom-fields/lib/custom-fields/models/custom-field-type.mjs +4 -2
- package/esm2022/custom-fields/lib/custom-fields/models/custom-field-value-parser.mjs +46 -0
- package/esm2022/custom-fields/lib/custom-fields/models/index.mjs +2 -1
- package/esm2022/datepicker/lib/datepicker/datepicker.component.mjs +3 -3
- package/esm2022/drawer/lib/drawer/drawer.module.mjs +11 -1
- package/esm2022/dynamic-form/dynamic-form/components/lookup/lookup.component.mjs +3 -5
- package/esm2022/dynamic-form/dynamic-form/dynamic-form.module.mjs +8 -1
- package/esm2022/dynamic-form/dynamic-form/form-field/addon-config.mjs +6 -2
- package/esm2022/dynamic-form/dynamic-form/form-field/configurations/fields/currency-field.mjs +1 -1
- package/esm2022/dynamic-form/dynamic-form/form-field/configurations/fields/number-field.mjs +1 -1
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/bignumber/bignumber-field.component.mjs +33 -10
- package/esm2022/dynamic-form/public-api.mjs +2 -7
- package/esm2022/editable-overlay/lib/editable-overlay/editable-overlay.module.mjs +8 -1
- package/esm2022/empty-state/lib/empty-state/empty-state.module.mjs +8 -1
- package/esm2022/fieldset/lib/fieldset/fieldset.module.mjs +8 -1
- package/esm2022/file-picker/lib/file-picker/file-picker.module.mjs +8 -1
- package/esm2022/file-picker/lib/file-picker/file-picker.service.mjs +4 -3
- package/esm2022/gantt/lib/gantt/gantt.module.mjs +8 -1
- package/esm2022/global-search/lib/global-search/global-search.module.mjs +19 -1
- package/esm2022/grid-menu/lib/grid-menu/grid-menu.module.mjs +8 -1
- package/esm2022/help-popover/lib/help-popover/help-popover.module.mjs +8 -1
- package/esm2022/image-cropper/lib/image-cropper/image-cropper.module.mjs +12 -1
- package/esm2022/image-cropper/lib/image-cropper/image-cropper.service.mjs +4 -3
- package/esm2022/infinite-scroll/lib/infinite-scroll/infinite-scroll.module.mjs +8 -1
- package/esm2022/info-sign/lib/info-sign/info-sign.module.mjs +8 -1
- package/esm2022/inline-edit/lib/inline-edit/components/fields/inline-edit-number/inline-edit-number.component.mjs +5 -5
- package/esm2022/inline-edit/lib/inline-edit/inline-edit.module.mjs +8 -1
- package/esm2022/input-group/lib/input-group/input-group.module.mjs +8 -1
- package/esm2022/input-mask/lib/input-mask/input-mask.module.mjs +8 -1
- package/esm2022/input-text/lib/input-text/input-text.module.mjs +8 -1
- package/esm2022/insights/lib/insights/insights.module.mjs +11 -1
- package/esm2022/kanban/lib/kanban/kanban-event.service.mjs +4 -3
- package/esm2022/kanban/lib/kanban/kanban.module.mjs +11 -1
- package/esm2022/label-value/lib/label-value/label-value.module.mjs +8 -1
- package/esm2022/loading-state/lib/loading-state/loading-state.module.mjs +8 -1
- package/esm2022/locale/lib/locale/locale.module.mjs +14 -1
- package/esm2022/locale/lib/locale/locale.service.mjs +4 -3
- package/esm2022/locale/lib/locale/options/index.mjs +1 -13
- package/esm2022/locale/lib/locale/pipes/localized-bignumber-impure.pipe.mjs +1 -1
- package/esm2022/locale/lib/locale/pipes/localized-bignumber.pipe.mjs +10 -2
- package/esm2022/locale/lib/locale/provide-locale.mjs +42 -0
- package/esm2022/locale/public-api.mjs +2 -1
- package/esm2022/localized-number-input/lib/localized-number-input/localized-number-input.directive.mjs +5 -1
- package/esm2022/localized-number-input/lib/localized-number-input/localized-number-input.module.mjs +8 -1
- package/esm2022/mask/lib/mask/mask-formatter.module.mjs +8 -1
- package/esm2022/mouse-events/lib/mouse-events/mouse-events.module.mjs +8 -1
- package/esm2022/navigation-button/lib/navigation-button/navigation-button.module.mjs +8 -1
- package/esm2022/number-input/lib/number-input/number-input.directive.mjs +2 -2
- package/esm2022/number-input/lib/number-input/number-input.module.mjs +9 -2
- package/esm2022/numeric/lib/numeric.module.mjs +8 -1
- package/esm2022/numeric-mask/lib/numeric-mask/numeric-mask.directive.mjs +178 -15
- package/esm2022/numeric-mask/lib/numeric-mask/numeric-mask.module.mjs +8 -1
- package/esm2022/object-card/lib/object-card/object-card.module.mjs +12 -1
- package/esm2022/panel/lib/panel/panel.module.mjs +11 -1
- package/esm2022/password-strength/lib/password-strength/password-strength.module.mjs +8 -1
- package/esm2022/picklist/lib/picklist/picklist.module.mjs +8 -1
- package/esm2022/pin-code-field/lib/pin-code-field.module.mjs +8 -1
- package/esm2022/profile-picture-picker/lib/profile-picture-picker/profile-picture-picker.module.mjs +8 -1
- package/esm2022/progressbar/lib/progressbar/progressbar.module.mjs +8 -1
- package/esm2022/rating-scale/lib/rating-scale/rating-scale.module.mjs +8 -1
- package/esm2022/select/lib/select/select.component.mjs +16 -3
- package/esm2022/select-button/lib/select-button/select-button.module.mjs +8 -1
- package/esm2022/shared/lib/shared/border-button/border-button.module.mjs +8 -1
- package/esm2022/slide-in-bar/lib/slide-in-bar/slide-in-bar.module.mjs +8 -1
- package/esm2022/slide-in-bar/lib/slide-in-bar/slide-in-bar.service.mjs +4 -3
- package/esm2022/slider/lib/slider/slider.module.mjs +8 -1
- package/esm2022/speech-recognition/lib/speech-recognition/speech-recognition.module.mjs +8 -1
- package/esm2022/split-button/lib/split-button/split-button.module.mjs +8 -1
- package/esm2022/stats-card/lib/stats-card/stats-card.module.mjs +8 -1
- package/esm2022/stepper/lib/stepper/stepper.module.mjs +8 -1
- package/esm2022/structure/lib/structure/structure.module.mjs +8 -1
- package/esm2022/switch/lib/switch/switch.module.mjs +8 -1
- package/esm2022/table/lib/table/table.module.mjs +9 -1
- package/esm2022/table-header/lib/table-header/table-header-checkox.module.mjs +8 -1
- package/esm2022/template/lib/template/template.module.mjs +8 -1
- package/esm2022/text-area/lib/text-area/text-area.component.mjs +3 -3
- package/esm2022/text-area/lib/text-area.module.mjs +8 -1
- package/esm2022/thumbnail/lib/thumbnail/thumbnail.module.mjs +8 -1
- package/esm2022/thumbnails/lib/thumbnails/thumbnails.module.mjs +8 -1
- package/esm2022/tiered-menu/lib/tiered-menu/tiered-menu.module.mjs +8 -1
- package/esm2022/tile/lib/tile/tile.module.mjs +11 -1
- package/esm2022/timeline/lib/timeline/timeline.module.mjs +8 -1
- package/esm2022/toast/lib/toast/toast.module.mjs +8 -1
- package/esm2022/token-list/lib/token-list/token-list.module.mjs +8 -1
- package/esm2022/tooltip/lib/tooltip/tooltip.module.mjs +8 -1
- package/esm2022/topbar/lib/topbar/topbar.module.mjs +11 -1
- package/esm2022/tree/lib/tree/tree.module.mjs +8 -1
- package/esm2022/workspace-switch/lib/workspace-switch/workspace-switch.module.mjs +8 -1
- package/fesm2022/seniorsistemas-angular-components-accordion.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-accordion.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-alert.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-alert.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-badge.mjs +10 -0
- package/fesm2022/seniorsistemas-angular-components-badge.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-bignumber-input.mjs +25 -126
- package/fesm2022/seniorsistemas-angular-components-bignumber-input.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-breadcrumb.mjs +5 -1
- package/fesm2022/seniorsistemas-angular-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-button.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-calendar-mask.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-calendar-mask.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-card.mjs +23 -2
- package/fesm2022/seniorsistemas-angular-components-card.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-chat.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-chat.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-checkbox-list.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-checkbox-list.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-chips.mjs +9 -2
- package/fesm2022/seniorsistemas-angular-components-chips.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-code-editor.mjs +164 -160
- package/fesm2022/seniorsistemas-angular-components-code-editor.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-collapse-link.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-collapse-link.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-common.mjs +38 -2
- package/fesm2022/seniorsistemas-angular-components-common.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-content-generator.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-content-generator.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-control-errors.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-control-errors.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-country-phone-picker.mjs +21 -8
- package/fesm2022/seniorsistemas-angular-components-country-phone-picker.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-custom-fields.mjs +75 -15
- package/fesm2022/seniorsistemas-angular-components-custom-fields.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-datepicker.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-datepicker.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-drawer.mjs +10 -0
- package/fesm2022/seniorsistemas-angular-components-drawer.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs +54 -212
- package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-editable-overlay.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-editable-overlay.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-empty-state.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-empty-state.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-fieldset.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-fieldset.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-file-picker.mjs +10 -2
- package/fesm2022/seniorsistemas-angular-components-file-picker.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-gantt.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-gantt.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-global-search.mjs +18 -0
- package/fesm2022/seniorsistemas-angular-components-global-search.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-grid-menu.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-grid-menu.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-help-popover.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-help-popover.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-image-cropper.mjs +14 -2
- package/fesm2022/seniorsistemas-angular-components-image-cropper.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-infinite-scroll.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-infinite-scroll.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-info-sign.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-info-sign.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-inline-edit.mjs +11 -4
- package/fesm2022/seniorsistemas-angular-components-inline-edit.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-input-group.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-input-group.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-input-mask.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-input-mask.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-input-text.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-input-text.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-insights.mjs +10 -0
- package/fesm2022/seniorsistemas-angular-components-insights.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-kanban.mjs +13 -2
- package/fesm2022/seniorsistemas-angular-components-kanban.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-label-value.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-label-value.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-loading-state.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-loading-state.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-locale.mjs +58 -5
- package/fesm2022/seniorsistemas-angular-components-locale.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-localized-number-input.mjs +11 -0
- package/fesm2022/seniorsistemas-angular-components-localized-number-input.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-mask.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-mask.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-mouse-events.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-mouse-events.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-navigation-button.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-navigation-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-number-input.mjs +9 -2
- package/fesm2022/seniorsistemas-angular-components-number-input.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-numeric-mask.mjs +184 -14
- package/fesm2022/seniorsistemas-angular-components-numeric-mask.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-numeric.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-numeric.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-object-card.mjs +11 -0
- package/fesm2022/seniorsistemas-angular-components-object-card.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-panel.mjs +10 -0
- package/fesm2022/seniorsistemas-angular-components-panel.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-password-strength.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-password-strength.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-picklist.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-picklist.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-pin-code-field.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-pin-code-field.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-profile-picture-picker.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-profile-picture-picker.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-progressbar.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-progressbar.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-rating-scale.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-rating-scale.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-select-button.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-select-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-select.mjs +15 -2
- package/fesm2022/seniorsistemas-angular-components-select.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-shared.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-shared.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-slide-in-bar.mjs +10 -2
- package/fesm2022/seniorsistemas-angular-components-slide-in-bar.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-slider.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-slider.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-speech-recognition.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-speech-recognition.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-split-button.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-split-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-stats-card.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-stats-card.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-stepper.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-stepper.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-structure.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-structure.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-switch.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-switch.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-table-header.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-table-header.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-table.mjs +8 -0
- package/fesm2022/seniorsistemas-angular-components-table.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-template.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-template.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-text-area.mjs +9 -2
- package/fesm2022/seniorsistemas-angular-components-text-area.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-thumbnail.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-thumbnail.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-thumbnails.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-thumbnails.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-tiered-menu.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-tiered-menu.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-tile.mjs +10 -0
- package/fesm2022/seniorsistemas-angular-components-tile.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-timeline.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-timeline.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-toast.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-toast.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-token-list.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-token-list.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-tooltip.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-tooltip.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-topbar.mjs +10 -0
- package/fesm2022/seniorsistemas-angular-components-topbar.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-tree.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-tree.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-workspace-switch.mjs +7 -0
- package/fesm2022/seniorsistemas-angular-components-workspace-switch.mjs.map +1 -1
- package/fieldset/README.md +2 -2
- package/fieldset/lib/fieldset/fieldset.module.d.ts +7 -0
- package/file-picker/README.md +2 -2
- package/file-picker/lib/file-picker/file-picker.module.d.ts +7 -0
- package/file-upload/README.md +1 -1
- package/gantt/README.md +2 -2
- package/gantt/lib/gantt/gantt.module.d.ts +7 -0
- package/global-search/README.md +5 -2
- package/global-search/lib/global-search/global-search.module.d.ts +18 -0
- package/grid-menu/README.md +5 -4
- package/grid-menu/lib/grid-menu/grid-menu.module.d.ts +7 -0
- package/help-popover/README.md +5 -4
- package/help-popover/lib/help-popover/help-popover.module.d.ts +7 -0
- package/ia-insight/README.md +1 -1
- package/image-cropper/README.md +6 -5
- package/image-cropper/lib/image-cropper/image-cropper.module.d.ts +11 -0
- package/infinite-scroll/README.md +5 -4
- package/infinite-scroll/lib/infinite-scroll/infinite-scroll.module.d.ts +7 -0
- package/info-sign/README.md +5 -4
- package/info-sign/lib/info-sign/info-sign.module.d.ts +7 -0
- package/inline-edit/README.md +5 -4
- package/inline-edit/lib/inline-edit/inline-edit.module.d.ts +7 -0
- package/input-group/lib/input-group/input-group.module.d.ts +7 -0
- package/input-mask/lib/input-mask/input-mask.module.d.ts +7 -0
- package/input-text/lib/input-text/input-text.module.d.ts +7 -0
- package/insights/README.md +6 -4
- package/insights/lib/insights/insights.module.d.ts +10 -0
- package/kanban/README.md +6 -4
- package/kanban/lib/kanban/kanban.module.d.ts +10 -0
- package/label-value/README.md +5 -4
- package/label-value/lib/label-value/label-value.module.d.ts +7 -0
- package/loading-state/README.md +9 -5
- package/loading-state/lib/loading-state/loading-state.module.d.ts +7 -0
- package/locale/lib/locale/locale.module.d.ts +13 -0
- package/locale/lib/locale/pipes/localized-bignumber-impure.pipe.d.ts +2 -2
- package/locale/lib/locale/pipes/localized-bignumber.pipe.d.ts +20 -1
- package/locale/lib/locale/provide-locale.d.ts +18 -0
- package/locale/public-api.d.ts +1 -0
- package/localized-number-input/README.md +32 -8
- package/localized-number-input/lib/localized-number-input/localized-number-input.directive.d.ts +4 -0
- package/localized-number-input/lib/localized-number-input/localized-number-input.module.d.ts +7 -0
- package/mask/lib/mask/mask-formatter.module.d.ts +7 -0
- package/mouse-events/README.md +5 -4
- package/mouse-events/lib/mouse-events/mouse-events.module.d.ts +7 -0
- package/navigation-button/README.md +5 -4
- package/navigation-button/lib/navigation-button/navigation-button.module.d.ts +7 -0
- package/number-input/lib/number-input/number-input.directive.d.ts +1 -1
- package/number-input/lib/number-input/number-input.module.d.ts +8 -1
- package/numeric/README.md +6 -5
- package/numeric/lib/numeric.module.d.ts +7 -0
- package/numeric-mask/README.md +44 -1
- package/numeric-mask/lib/numeric-mask/numeric-mask.directive.d.ts +65 -4
- package/numeric-mask/lib/numeric-mask/numeric-mask.module.d.ts +7 -0
- package/object-card/README.md +11 -4
- package/object-card/lib/object-card/object-card.module.d.ts +11 -0
- package/package.json +1 -1
- package/panel/README.md +8 -4
- package/panel/lib/panel/panel.module.d.ts +10 -0
- package/password-strength/README.md +6 -3
- package/password-strength/lib/password-strength/password-strength.module.d.ts +7 -0
- package/picklist/README.md +8 -5
- package/picklist/lib/picklist/picklist.module.d.ts +7 -0
- package/pin-code-field/lib/pin-code-field.module.d.ts +7 -0
- package/product-header/README.md +2 -2
- package/profile-picture-picker/README.md +6 -3
- package/profile-picture-picker/lib/profile-picture-picker/profile-picture-picker.module.d.ts +7 -0
- package/progressbar/README.md +6 -3
- package/progressbar/lib/progressbar/progressbar.module.d.ts +7 -0
- package/rating-scale/README.md +6 -3
- package/rating-scale/lib/rating-scale/rating-scale.module.d.ts +7 -0
- package/schematics/collection.json +40 -0
- package/schematics/migrations/migrate-app-to-standalone/index.d.ts +32 -0
- package/schematics/migrations/migrate-app-to-standalone/index.js +98 -0
- package/schematics/migrations/migrate-app-to-standalone/index.js.map +1 -0
- package/schematics/migrations/migrate-deprecated-apis/index.d.ts +49 -0
- package/schematics/migrations/migrate-deprecated-apis/index.js +660 -0
- package/schematics/migrations/migrate-deprecated-apis/index.js.map +1 -0
- package/schematics/migrations/migrate-deprecated-datepicker/index.d.ts +31 -0
- package/schematics/migrations/migrate-deprecated-datepicker/index.js +115 -0
- package/schematics/migrations/migrate-deprecated-datepicker/index.js.map +1 -0
- package/schematics/migrations/migrate-deprecated-dynamic-form/index.d.ts +52 -0
- package/schematics/migrations/migrate-deprecated-dynamic-form/index.js +661 -0
- package/schematics/migrations/migrate-deprecated-dynamic-form/index.js.map +1 -0
- package/schematics/migrations/migrate-deprecated-imports/index.d.ts +23 -0
- package/schematics/migrations/migrate-deprecated-imports/index.js +335 -0
- package/schematics/migrations/migrate-deprecated-imports/index.js.map +1 -0
- package/schematics/migrations/migrate-deprecated-selectors/index.d.ts +15 -0
- package/schematics/migrations/migrate-deprecated-selectors/index.js +76 -0
- package/schematics/migrations/migrate-deprecated-selectors/index.js.map +1 -0
- package/schematics/migrations/migrate-modules-to-standalone/index.d.ts +51 -0
- package/schematics/migrations/migrate-modules-to-standalone/index.js +632 -0
- package/schematics/migrations/migrate-modules-to-standalone/index.js.map +1 -0
- package/schematics/migrations/migrate-modules-to-standalone/modules-map.json +1656 -0
- package/schematics/migrations/migrate-v20/index.d.ts +9 -0
- package/schematics/migrations/migrate-v20/index.js +90 -0
- package/schematics/migrations/migrate-v20/index.js.map +1 -0
- package/schematics/migrations/migrate-v20/items.d.ts +7 -0
- package/schematics/migrations/migrate-v20/items.js +54 -0
- package/schematics/migrations/migrate-v20/items.js.map +1 -0
- package/schematics/migrations/migrate-v20/plan.d.ts +32 -0
- package/schematics/migrations/migrate-v20/plan.js +29 -0
- package/schematics/migrations/migrate-v20/plan.js.map +1 -0
- package/schematics/migrations.json +5 -1
- package/schematics/schema/app-standalone.schema.json +21 -0
- package/schematics/schema/migrate-v20.schema.json +33 -0
- package/schematics/schema/scope.schema.json +17 -0
- package/schematics/utils/ast-utils.js +16 -0
- package/schematics/utils/ast-utils.js.map +1 -1
- package/schematics/utils/eol.d.ts +5 -0
- package/schematics/utils/eol.js +17 -0
- package/schematics/utils/eol.js.map +1 -0
- package/schematics/utils/prompt-utils.d.ts +62 -0
- package/schematics/utils/prompt-utils.js +166 -0
- package/schematics/utils/prompt-utils.js.map +1 -0
- package/schematics/utils/report.d.ts +27 -0
- package/schematics/utils/report.js +70 -0
- package/schematics/utils/report.js.map +1 -0
- package/schematics/utils/scope.d.ts +17 -0
- package/schematics/utils/scope.js +55 -0
- package/schematics/utils/scope.js.map +1 -0
- package/schematics/utils/selection.d.ts +21 -0
- package/schematics/utils/selection.js +60 -0
- package/schematics/utils/selection.js.map +1 -0
- package/schematics/utils/symbol-utils.d.ts +31 -0
- package/schematics/utils/symbol-utils.js +202 -0
- package/schematics/utils/symbol-utils.js.map +1 -0
- package/schematics/utils/template-utils.d.ts +62 -0
- package/schematics/utils/template-utils.js +165 -0
- package/schematics/utils/template-utils.js.map +1 -0
- package/schematics/utils/tsconfig-paths.d.ts +5 -0
- package/schematics/utils/tsconfig-paths.js +73 -0
- package/schematics/utils/tsconfig-paths.js.map +1 -0
- package/select/lib/select/select.component.d.ts +8 -0
- package/select-button/README.md +6 -3
- package/select-button/lib/select-button/select-button.module.d.ts +7 -0
- package/shared/lib/shared/border-button/border-button.module.d.ts +7 -0
- package/sidebar/README.md +2 -2
- package/slide-in-bar/README.md +5 -5
- package/slide-in-bar/lib/slide-in-bar/slide-in-bar.module.d.ts +7 -0
- package/slider/README.md +6 -3
- package/slider/lib/slider/slider.module.d.ts +7 -0
- package/speech-recognition/README.md +6 -3
- package/speech-recognition/lib/speech-recognition/speech-recognition.module.d.ts +7 -0
- package/split-button/README.md +6 -3
- package/split-button/lib/split-button/split-button.module.d.ts +7 -0
- package/stats-card/README.md +6 -3
- package/stats-card/lib/stats-card/stats-card.module.d.ts +7 -0
- package/stepper/README.md +6 -3
- package/stepper/lib/stepper/stepper.module.d.ts +7 -0
- package/structure/lib/structure/structure.module.d.ts +7 -0
- package/switch/README.md +6 -3
- package/switch/lib/switch/switch.module.d.ts +7 -0
- package/table/README.md +12 -4
- package/table/lib/table/table.module.d.ts +8 -0
- package/table-header/lib/table-header/table-header-checkox.module.d.ts +7 -0
- package/template/README.md +0 -11
- package/template/lib/template/template.module.d.ts +7 -0
- package/text-area/lib/text-area.module.d.ts +7 -0
- package/text-area-ia/README.md +1 -1
- package/thumbnail/lib/thumbnail/thumbnail.module.d.ts +7 -0
- package/thumbnails/lib/thumbnails/thumbnails.module.d.ts +7 -0
- package/tiered-menu/lib/tiered-menu/tiered-menu.module.d.ts +7 -0
- package/tile/lib/tile/tile.module.d.ts +10 -0
- package/timeline/lib/timeline/timeline.module.d.ts +7 -0
- package/toast/lib/toast/toast.module.d.ts +7 -0
- package/token-list/lib/token-list/token-list.module.d.ts +7 -0
- package/tooltip/lib/tooltip/tooltip.module.d.ts +7 -0
- package/topbar/lib/topbar/topbar.module.d.ts +10 -0
- package/tree/lib/tree/tree.module.d.ts +7 -0
- package/workspace-switch/lib/workspace-switch/workspace-switch.module.d.ts +7 -0
- package/dynamic-form/dynamic-form/form-field/fields/currency/currency-field.component.d.ts +0 -664
- package/dynamic-form/dynamic-form/form-field/fields/number/number-field.component.d.ts +0 -29
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/currency/currency-field.component.mjs +0 -96
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/number/number-field.component.mjs +0 -124
|
@@ -149,6 +149,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
149
149
|
type: Output
|
|
150
150
|
}] } });
|
|
151
151
|
|
|
152
|
+
/**
|
|
153
|
+
* @deprecated Será removido na v20. Importe diretamente o standalone `NavigationButtonComponent` (de
|
|
154
|
+
* `@seniorsistemas/angular-components/navigation-button`) no lugar deste módulo.
|
|
155
|
+
*
|
|
156
|
+
* Migração automática (também executada pelo `ng update` na v20):
|
|
157
|
+
* `ng generate @seniorsistemas/angular-components:migrate-modules-to-standalone`
|
|
158
|
+
*/
|
|
152
159
|
class NavigationButtonModule {
|
|
153
160
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NavigationButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
154
161
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: NavigationButtonModule, imports: [NavigationButtonComponent], exports: [NavigationButtonComponent] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seniorsistemas-angular-components-navigation-button.mjs","sources":["../../projects/angular-components/navigation-button/src/lib/navigation-button/navigation-button.component.ts","../../projects/angular-components/navigation-button/src/lib/navigation-button/navigation-button.component.html","../../projects/angular-components/navigation-button/src/lib/navigation-button/navigation-button.module.ts","../../projects/angular-components/navigation-button/src/seniorsistemas-angular-components-navigation-button.ts"],"sourcesContent":["import {\r\n Component,\r\n Input,\r\n Output,\r\n EventEmitter,\r\n forwardRef,\r\n OnInit,\r\n AfterViewInit,\r\n ChangeDetectorRef,\r\n inject,\r\n} from '@angular/core';\r\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\r\n\r\nimport { NavigationButtonItem } from './models/navigation-button-item';\r\nimport { NavigationButtonStepChangedInfo } from './models';\r\nimport { TieredMenuItemData, TieredMenuDirective } from '@seniorsistemas/angular-components/tiered-menu';\r\nimport { NgClass } from '@angular/common';\r\nimport { TooltipDirective } from '@seniorsistemas/angular-components/tooltip';\r\n\r\n/**\r\n * @description Componente de navegação por etapas que exibe o estado atual (step)\r\n * com suporte a avanço, retrocesso e seleção direta via dropdown (`TieredMenu`).\r\n * Implementa `ControlValueAccessor` para integração com formulários Angular.\r\n *\r\n * @example\r\n * ```html\r\n * <s-navigation-button\r\n * [steps]=\"etapas\"\r\n * (stepChanged)=\"onEtapaMudou($event)\" />\r\n * ```\r\n *\r\n * @category Inputs\r\n */\r\n@Component({\r\n selector: 's-navigation-button',\r\n templateUrl: './navigation-button.component.html',\r\n styleUrls: ['./navigation-button.component.scss'],\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => NavigationButtonComponent),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n imports: [NgClass, TieredMenuDirective, TooltipDirective],\r\n})\r\nexport class NavigationButtonComponent implements ControlValueAccessor, OnInit, AfterViewInit {\r\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\r\n\r\n /** @description Lista de etapas de navegação. Campo obrigatório. */\r\n @Input({ required: true })\r\n public steps!: NavigationButtonItem[];\r\n\r\n /** @description Valor padrão a ser selecionado ao inicializar o componente. */\r\n @Input()\r\n public defaultValue: unknown;\r\n\r\n /** @description Texto exibido no tooltip do botão principal. */\r\n @Input()\r\n public tooltip?: string;\r\n\r\n /** @description Quando `true`, emite `stepChanged` durante a inicialização com a etapa atual. @default false */\r\n @Input()\r\n public changeOnInit = false;\r\n\r\n /** @description Emitido quando o usuário navega para uma nova etapa, com informações da etapa anterior e atual. */\r\n @Output()\r\n public stepChanged: EventEmitter<NavigationButtonStepChangedInfo> = new EventEmitter();\r\n\r\n public currentIndex = 0;\r\n public isDisabled = false;\r\n public tieredMenuItems: TieredMenuItemData[] = [];\r\n\r\n private _onChange?: (value: unknown) => void;\r\n private _onTouched?: () => void;\r\n private _value: unknown;\r\n\r\n public ngOnInit(): void {\r\n this._createTieredMenuItems();\r\n\r\n if (this.changeOnInit) {\r\n this.stepChanged.emit({\r\n previous: null,\r\n current: this.steps[this.currentIndex],\r\n });\r\n }\r\n }\r\n\r\n public ngAfterViewInit(): void {\r\n this._setDefaultValue();\r\n }\r\n\r\n private _setDefaultValue(): void {\r\n if (this.defaultValue) {\r\n this._value = this.defaultValue;\r\n\r\n const index = this.steps.findIndex((step) => step.value === this._value);\r\n this.currentIndex = index !== -1 ? index : 0;\r\n this.stepChanged.emit({\r\n previous: null,\r\n current: this.steps[this.currentIndex],\r\n });\r\n\r\n this.changeDetectorRef.detectChanges();\r\n }\r\n }\r\n\r\n public writeValue(value: unknown): void {\r\n this._value = value;\r\n\r\n const index = this.steps.findIndex((step) => step.value === this._value);\r\n this.currentIndex = index !== -1 ? index : 0;\r\n }\r\n\r\n public registerOnChange(onChange: (value: unknown) => void): void {\r\n this._onChange = onChange;\r\n }\r\n\r\n public registerOnTouched(onTouched: () => void): void {\r\n this._onTouched = onTouched;\r\n }\r\n\r\n public setDisabledState?(isDisabled: boolean): void {\r\n this.isDisabled = isDisabled;\r\n }\r\n\r\n public onNext(): void {\r\n if (this.isDisabled) return;\r\n\r\n const previous = this.steps[this.currentIndex];\r\n\r\n if (this.currentIndex < this.steps.length - 1) {\r\n this.currentIndex++;\r\n\r\n const current = this.steps[this.currentIndex];\r\n\r\n this._onChange && this._onChange(current.value);\r\n this.stepChanged.emit({ previous, current });\r\n }\r\n\r\n this._onTouched && this._onTouched();\r\n }\r\n\r\n public onPrevious(): void {\r\n if (this.isDisabled) return;\r\n\r\n const previous = this.steps[this.currentIndex];\r\n\r\n if (this.currentIndex > 0) {\r\n this.currentIndex--;\r\n\r\n const current = this.steps[this.currentIndex];\r\n\r\n this._onChange && this._onChange(current.value);\r\n this.stepChanged.emit({ previous, current });\r\n }\r\n\r\n this._onTouched && this._onTouched();\r\n }\r\n\r\n private _createTieredMenuItems() {\r\n this.steps.forEach((step: NavigationButtonItem) => {\r\n this.tieredMenuItems.push({\r\n label: step.label,\r\n command: () => {\r\n const index = this.steps.findIndex((s) => s === step);\r\n if (this.currentIndex !== index) {\r\n this._onChange && this._onChange(step.value);\r\n this.stepChanged.emit({\r\n previous: this.steps[this.currentIndex],\r\n current: step,\r\n });\r\n this.currentIndex = index;\r\n }\r\n\r\n this._onTouched && this._onTouched();\r\n },\r\n });\r\n });\r\n }\r\n}\r\n","<div\n class=\"navigation-button\"\n [ngClass]=\"{ 'navigation-button--disabled': isDisabled }\"\n>\n <button\n class=\"option option--previous\"\n [ngClass]=\"{ 'option--disabled': currentIndex === 0 }\"\n (click)=\"onPrevious()\"\n >\n <i class=\"fas fa-chevron-left\"></i>\n </button>\n\n @if (steps[currentIndex].tooltip || tooltip) {\n <button\n [sTooltip]=\"steps[currentIndex].tooltip || tooltip\"\n class=\"step\"\n sTieredMenu\n [items]=\"tieredMenuItems\"\n [focusedItem]=\"tieredMenuItems[currentIndex]\"\n >\n {{ steps[currentIndex].label }}\n </button>\n } @else {\n <button class=\"step\">\n {{ steps[currentIndex].label }}\n </button>\n }\n <button\n class=\"option option--next\"\n [ngClass]=\"{ 'option--disabled': currentIndex === steps.length - 1 }\"\n (click)=\"onNext()\"\n >\n <i class=\"fas fa-chevron-right\"></i>\n </button>\n</div>\n","import { NgModule } from '@angular/core';\r\nimport { NavigationButtonComponent } from './navigation-button.component';\r\n\r\n@NgModule({\r\n imports: [NavigationButtonComponent],\r\n exports: [NavigationButtonComponent],\r\n})\r\nexport class NavigationButtonModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAmBA;;;;;;;;;;;;;AAaG;MAeU,yBAAyB,CAAA;AACjB,IAAA,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;;AAIxD,IAAA,KAAK,CAA0B;;AAI/B,IAAA,YAAY,CAAU;;AAItB,IAAA,OAAO,CAAU;;IAIjB,YAAY,GAAG,KAAK,CAAC;;AAIrB,IAAA,WAAW,GAAkD,IAAI,YAAY,EAAE,CAAC;IAEhF,YAAY,GAAG,CAAC,CAAC;IACjB,UAAU,GAAG,KAAK,CAAC;IACnB,eAAe,GAAyB,EAAE,CAAC;AAE1C,IAAA,SAAS,CAA4B;AACrC,IAAA,UAAU,CAAc;AACxB,IAAA,MAAM,CAAU;IAEjB,QAAQ,GAAA;QACX,IAAI,CAAC,sBAAsB,EAAE,CAAC;AAE9B,QAAA,IAAI,IAAI,CAAC,YAAY,EAAE;AACnB,YAAA,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;AAClB,gBAAA,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC;AACzC,aAAA,CAAC,CAAC;SACN;KACJ;IAEM,eAAe,GAAA;QAClB,IAAI,CAAC,gBAAgB,EAAE,CAAC;KAC3B;IAEO,gBAAgB,GAAA;AACpB,QAAA,IAAI,IAAI,CAAC,YAAY,EAAE;AACnB,YAAA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC;YAEhC,MAAM,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AA,CAAA,QAAA,EAAA,CAAA,CAAA;yGAAtB,sBAAsB,EAAA,OAAA,EAAA,CAHrB,yBAAyB,CAAA,EAAA,OAAA,EAAA,CACzB,yBAAyB,CAAA,EAAA,CAAA,CAAA;yGAE1B,sBAAsB,EAAA,CAAA,CAAA;;4FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAJlC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,yBAAyB,CAAC;oBACpC,OAAO,EAAE,CAAC,yBAAyB,CAAC;AACvC,iBAAA,CAAA;;;ACND;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"seniorsistemas-angular-components-navigation-button.mjs","sources":["../../projects/angular-components/navigation-button/src/lib/navigation-button/navigation-button.component.ts","../../projects/angular-components/navigation-button/src/lib/navigation-button/navigation-button.component.html","../../projects/angular-components/navigation-button/src/lib/navigation-button/navigation-button.module.ts","../../projects/angular-components/navigation-button/src/seniorsistemas-angular-components-navigation-button.ts"],"sourcesContent":["import {\r\n Component,\r\n Input,\r\n Output,\r\n EventEmitter,\r\n forwardRef,\r\n OnInit,\r\n AfterViewInit,\r\n ChangeDetectorRef,\r\n inject,\r\n} from '@angular/core';\r\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\r\n\r\nimport { NavigationButtonItem } from './models/navigation-button-item';\r\nimport { NavigationButtonStepChangedInfo } from './models';\r\nimport { TieredMenuItemData, TieredMenuDirective } from '@seniorsistemas/angular-components/tiered-menu';\r\nimport { NgClass } from '@angular/common';\r\nimport { TooltipDirective } from '@seniorsistemas/angular-components/tooltip';\r\n\r\n/**\r\n * @description Componente de navegação por etapas que exibe o estado atual (step)\r\n * com suporte a avanço, retrocesso e seleção direta via dropdown (`TieredMenu`).\r\n * Implementa `ControlValueAccessor` para integração com formulários Angular.\r\n *\r\n * @example\r\n * ```html\r\n * <s-navigation-button\r\n * [steps]=\"etapas\"\r\n * (stepChanged)=\"onEtapaMudou($event)\" />\r\n * ```\r\n *\r\n * @category Inputs\r\n */\r\n@Component({\r\n selector: 's-navigation-button',\r\n templateUrl: './navigation-button.component.html',\r\n styleUrls: ['./navigation-button.component.scss'],\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => NavigationButtonComponent),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n imports: [NgClass, TieredMenuDirective, TooltipDirective],\r\n})\r\nexport class NavigationButtonComponent implements ControlValueAccessor, OnInit, AfterViewInit {\r\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\r\n\r\n /** @description Lista de etapas de navegação. Campo obrigatório. */\r\n @Input({ required: true })\r\n public steps!: NavigationButtonItem[];\r\n\r\n /** @description Valor padrão a ser selecionado ao inicializar o componente. */\r\n @Input()\r\n public defaultValue: unknown;\r\n\r\n /** @description Texto exibido no tooltip do botão principal. */\r\n @Input()\r\n public tooltip?: string;\r\n\r\n /** @description Quando `true`, emite `stepChanged` durante a inicialização com a etapa atual. @default false */\r\n @Input()\r\n public changeOnInit = false;\r\n\r\n /** @description Emitido quando o usuário navega para uma nova etapa, com informações da etapa anterior e atual. */\r\n @Output()\r\n public stepChanged: EventEmitter<NavigationButtonStepChangedInfo> = new EventEmitter();\r\n\r\n public currentIndex = 0;\r\n public isDisabled = false;\r\n public tieredMenuItems: TieredMenuItemData[] = [];\r\n\r\n private _onChange?: (value: unknown) => void;\r\n private _onTouched?: () => void;\r\n private _value: unknown;\r\n\r\n public ngOnInit(): void {\r\n this._createTieredMenuItems();\r\n\r\n if (this.changeOnInit) {\r\n this.stepChanged.emit({\r\n previous: null,\r\n current: this.steps[this.currentIndex],\r\n });\r\n }\r\n }\r\n\r\n public ngAfterViewInit(): void {\r\n this._setDefaultValue();\r\n }\r\n\r\n private _setDefaultValue(): void {\r\n if (this.defaultValue) {\r\n this._value = this.defaultValue;\r\n\r\n const index = this.steps.findIndex((step) => step.value === this._value);\r\n this.currentIndex = index !== -1 ? index : 0;\r\n this.stepChanged.emit({\r\n previous: null,\r\n current: this.steps[this.currentIndex],\r\n });\r\n\r\n this.changeDetectorRef.detectChanges();\r\n }\r\n }\r\n\r\n public writeValue(value: unknown): void {\r\n this._value = value;\r\n\r\n const index = this.steps.findIndex((step) => step.value === this._value);\r\n this.currentIndex = index !== -1 ? index : 0;\r\n }\r\n\r\n public registerOnChange(onChange: (value: unknown) => void): void {\r\n this._onChange = onChange;\r\n }\r\n\r\n public registerOnTouched(onTouched: () => void): void {\r\n this._onTouched = onTouched;\r\n }\r\n\r\n public setDisabledState?(isDisabled: boolean): void {\r\n this.isDisabled = isDisabled;\r\n }\r\n\r\n public onNext(): void {\r\n if (this.isDisabled) return;\r\n\r\n const previous = this.steps[this.currentIndex];\r\n\r\n if (this.currentIndex < this.steps.length - 1) {\r\n this.currentIndex++;\r\n\r\n const current = this.steps[this.currentIndex];\r\n\r\n this._onChange && this._onChange(current.value);\r\n this.stepChanged.emit({ previous, current });\r\n }\r\n\r\n this._onTouched && this._onTouched();\r\n }\r\n\r\n public onPrevious(): void {\r\n if (this.isDisabled) return;\r\n\r\n const previous = this.steps[this.currentIndex];\r\n\r\n if (this.currentIndex > 0) {\r\n this.currentIndex--;\r\n\r\n const current = this.steps[this.currentIndex];\r\n\r\n this._onChange && this._onChange(current.value);\r\n this.stepChanged.emit({ previous, current });\r\n }\r\n\r\n this._onTouched && this._onTouched();\r\n }\r\n\r\n private _createTieredMenuItems() {\r\n this.steps.forEach((step: NavigationButtonItem) => {\r\n this.tieredMenuItems.push({\r\n label: step.label,\r\n command: () => {\r\n const index = this.steps.findIndex((s) => s === step);\r\n if (this.currentIndex !== index) {\r\n this._onChange && this._onChange(step.value);\r\n this.stepChanged.emit({\r\n previous: this.steps[this.currentIndex],\r\n current: step,\r\n });\r\n this.currentIndex = index;\r\n }\r\n\r\n this._onTouched && this._onTouched();\r\n },\r\n });\r\n });\r\n }\r\n}\r\n","<div\n class=\"navigation-button\"\n [ngClass]=\"{ 'navigation-button--disabled': isDisabled }\"\n>\n <button\n class=\"option option--previous\"\n [ngClass]=\"{ 'option--disabled': currentIndex === 0 }\"\n (click)=\"onPrevious()\"\n >\n <i class=\"fas fa-chevron-left\"></i>\n </button>\n\n @if (steps[currentIndex].tooltip || tooltip) {\n <button\n [sTooltip]=\"steps[currentIndex].tooltip || tooltip\"\n class=\"step\"\n sTieredMenu\n [items]=\"tieredMenuItems\"\n [focusedItem]=\"tieredMenuItems[currentIndex]\"\n >\n {{ steps[currentIndex].label }}\n </button>\n } @else {\n <button class=\"step\">\n {{ steps[currentIndex].label }}\n </button>\n }\n <button\n class=\"option option--next\"\n [ngClass]=\"{ 'option--disabled': currentIndex === steps.length - 1 }\"\n (click)=\"onNext()\"\n >\n <i class=\"fas fa-chevron-right\"></i>\n </button>\n</div>\n","import { NgModule } from '@angular/core';\r\nimport { NavigationButtonComponent } from './navigation-button.component';\r\n\r\n/**\r\n * @deprecated Será removido na v20. Importe diretamente o standalone `NavigationButtonComponent` (de\r\n * `@seniorsistemas/angular-components/navigation-button`) no lugar deste módulo.\r\n *\r\n * Migração automática (também executada pelo `ng update` na v20):\r\n * `ng generate @seniorsistemas/angular-components:migrate-modules-to-standalone`\r\n */\r\n@NgModule({\r\n imports: [NavigationButtonComponent],\r\n exports: [NavigationButtonComponent],\r\n})\r\nexport class NavigationButtonModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAmBA;;;;;;;;;;;;;AAaG;MAeU,yBAAyB,CAAA;AACjB,IAAA,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;;AAIxD,IAAA,KAAK,CAA0B;;AAI/B,IAAA,YAAY,CAAU;;AAItB,IAAA,OAAO,CAAU;;IAIjB,YAAY,GAAG,KAAK,CAAC;;AAIrB,IAAA,WAAW,GAAkD,IAAI,YAAY,EAAE,CAAC;IAEhF,YAAY,GAAG,CAAC,CAAC;IACjB,UAAU,GAAG,K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E,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,+BAA+B,CAAC;AACxD,4BAAA,KAAK,EAAE,IAAI;AACd,yBAAA;qBACJ,EACW,UAAA,EAAA,IAAI,WACP,CAAC,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,CAAC,EAAA,QAAA,EAAA,siCAAA,EAAA,MAAA,EAAA,CAAA,g5BAAA,CAAA,EAAA,CAAA;8BAOlD,KAAK,EAAA,CAAA;sBADX,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;gBAKlB,YAAY,EAAA,CAAA;sBADlB,KAAK;gBAKC,OAAO,EAAA,CAAA;sBADb,KAAK;gBAKC,YAAY,EAAA,CAAA;sBADlB,KAAK;gBAKC,WAAW,EAAA,CAAA;sBADjB,MAAM;;;AEhEX;;;;;;AAMG;MAKU,sBAAsB,CAAA;wGAAtB,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;yGAAtB,sBAAsB,EAAA,OAAA,EAAA,CAHrB,yBAAyB,CAAA,EAAA,OAAA,EAAA,CACzB,yBAAyB,CAAA,EAAA,CAAA,CAAA;yGAE1B,sBAAsB,EAAA,CAAA,CAAA;;4FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAJlC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,yBAAyB,CAAC;oBACpC,OAAO,EAAE,CAAC,yBAAyB,CAAC;AACvC,iBAAA,CAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -12,7 +12,7 @@ var NumberAlignmentOption;
|
|
|
12
12
|
NumberAlignmentOption["LEFT"] = "left";
|
|
13
13
|
})(NumberAlignmentOption || (NumberAlignmentOption = {}));
|
|
14
14
|
/**
|
|
15
|
-
* @deprecated Use a diretiva `
|
|
15
|
+
* @deprecated Use a diretiva `sBignumberInput` em vez desta.
|
|
16
16
|
* @description Alias de `BignumberInputDirective` mantido por compatibilidade.
|
|
17
17
|
* Todos os inputs e outputs são idênticos ao `sBignumberInput`.
|
|
18
18
|
*
|
|
@@ -49,7 +49,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
49
49
|
}] });
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
|
-
* @deprecated
|
|
52
|
+
* @deprecated Será removido na v20. Importe diretamente o standalone `BignumberInputDirective` (de
|
|
53
|
+
* `@seniorsistemas/angular-components/bignumber-input`) no lugar deste módulo.
|
|
54
|
+
*
|
|
55
|
+
* Atenção: o `sNumberInput` está depreciado em favor do `sNumericMask`; revise os templates (o schematic
|
|
56
|
+
* `migrate-deprecated-apis` faz essa troca e grava os defaults antigos de forma explícita).
|
|
57
|
+
*
|
|
58
|
+
* Migração automática (também executada pelo `ng update` na v20):
|
|
59
|
+
* `ng generate @seniorsistemas/angular-components:migrate-modules-to-standalone`
|
|
53
60
|
*/
|
|
54
61
|
class NumberInputModule {
|
|
55
62
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NumberInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seniorsistemas-angular-components-number-input.mjs","sources":["../../projects/angular-components/number-input/src/lib/number-input/number-input.directive.ts","../../projects/angular-components/number-input/src/lib/number-input/number-input.module.ts","../../projects/angular-components/number-input/src/seniorsistemas-angular-components-number-input.ts"],"sourcesContent":["import { Directive, forwardRef } from '@angular/core';\r\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\r\n\r\nimport { BignumberInputDirective } from '@seniorsistemas/angular-components/bignumber-input';\r\n\r\n/**\r\n * @deprecated Este enum é mantido apenas por compatibilidade. Utilize as strings `'left'` ou `'right'` diretamente.\r\n */\r\nexport enum NumberAlignmentOption {\r\n RIGHT = 'right',\r\n LEFT = 'left',\r\n}\r\n\r\n/**\r\n * @deprecated Use a diretiva `
|
|
1
|
+
{"version":3,"file":"seniorsistemas-angular-components-number-input.mjs","sources":["../../projects/angular-components/number-input/src/lib/number-input/number-input.directive.ts","../../projects/angular-components/number-input/src/lib/number-input/number-input.module.ts","../../projects/angular-components/number-input/src/seniorsistemas-angular-components-number-input.ts"],"sourcesContent":["import { Directive, forwardRef } from '@angular/core';\r\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\r\n\r\nimport { BignumberInputDirective } from '@seniorsistemas/angular-components/bignumber-input';\r\n\r\n/**\r\n * @deprecated Este enum é mantido apenas por compatibilidade. Utilize as strings `'left'` ou `'right'` diretamente.\r\n */\r\nexport enum NumberAlignmentOption {\r\n RIGHT = 'right',\r\n LEFT = 'left',\r\n}\r\n\r\n/**\r\n * @deprecated Use a diretiva `sBignumberInput` em vez desta.\r\n * @description Alias de `BignumberInputDirective` mantido por compatibilidade.\r\n * Todos os inputs e outputs são idênticos ao `sBignumberInput`.\r\n *\r\n * @example\r\n * ```html\r\n * <input sNumberInput [precision]=\"10\" [scale]=\"2\" />\r\n * ```\r\n *\r\n * @category Inputs\r\n */\r\n@Directive({\r\n selector: 'input[sNumberInput]',\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => NumberInputDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class NumberInputDirective extends BignumberInputDirective {}\r\n","import { NgModule } from '@angular/core';\r\n\r\nimport { BignumberInputModule } from '@seniorsistemas/angular-components/bignumber-input';\r\n\r\nimport { NumberInputDirective } from './number-input.directive';\r\n\r\n/**\r\n * @deprecated Será removido na v20. Importe diretamente o standalone `BignumberInputDirective` (de\r\n * `@seniorsistemas/angular-components/bignumber-input`) no lugar deste módulo.\r\n *\r\n * Atenção: o `sNumberInput` está depreciado em favor do `sNumericMask`; revise os templates (o schematic\r\n * `migrate-deprecated-apis` faz essa troca e grava os defaults antigos de forma explícita).\r\n *\r\n * Migração automática (também executada pelo `ng update` na v20):\r\n * `ng generate @seniorsistemas/angular-components:migrate-modules-to-standalone`\r\n */\r\n@NgModule({\r\n imports: [NumberInputDirective],\r\n exports: [NumberInputDirective],\r\n})\r\nexport class NumberInputModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAKA;;AAEG;IACS,sBAGX;AAHD,CAAA,UAAY,qBAAqB,EAAA;AAC7B,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,qBAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACjB,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,GAGhC,EAAA,CAAA,CAAA,CAAA;AAED;;;;;;;;;;;AAWG;AAYG,MAAO,oBAAqB,SAAQ,uBAAuB,CAAA;wGAApD,oBAAoB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAApB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,oBAAoB,EATlB,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,SAAA,EAAA;AACP,YAAA;AACI,gBAAA,OAAO,EAAE,iBAAiB;AAC1B,gBAAA,WAAW,EAAE,UAAU,CAAC,MAAM,oBAAoB,CAAC;AACnD,gBAAA,KAAK,EAAE,IAAI;AACd,aAAA;AACJ,SAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAGQ,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAXhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,SAAS,EAAE;AACP,wBAAA;AACI,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,0BAA0B,CAAC;AACnD,4BAAA,KAAK,EAAE,IAAI;AACd,yBAAA;AACJ,qBAAA;AACD,oBAAA,UAAU,EAAE,IAAI;AACnB,iBAAA,CAAA;;;AC7BD;;;;;;;;;AASG;MAKU,iBAAiB,CAAA;wGAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;yGAAjB,iBAAiB,EAAA,OAAA,EAAA,CAHhB,oBAAoB,CAAA,EAAA,OAAA,EAAA,CACpB,oBAAoB,CAAA,EAAA,CAAA,CAAA;yGAErB,iBAAiB,EAAA,CAAA,CAAA;;4FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,oBAAoB,CAAC;oBAC/B,OAAO,EAAE,CAAC,oBAAoB,CAAC;AAClC,iBAAA,CAAA;;;ACnBD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, inject, ElementRef, Renderer2, DestroyRef,
|
|
2
|
+
import { input, model, output, inject, ElementRef, Renderer2, DestroyRef, forwardRef, Directive, NgModule } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
|
5
5
|
import { LocaleService } from '@seniorsistemas/angular-components/locale';
|
|
@@ -76,6 +76,25 @@ class NumericMaskDirective {
|
|
|
76
76
|
* @default 'preserve'
|
|
77
77
|
*/
|
|
78
78
|
decimalRoundingMode = input('preserve');
|
|
79
|
+
/**
|
|
80
|
+
* Maximum number of significant digits accepted by the field (integer + decimal part).
|
|
81
|
+
* Opt-in: when left `undefined` (default), there is no total-digit limit, no native `maxLength`
|
|
82
|
+
* is applied, pasted values are never rejected, and `placeholder` is never auto-calculated —
|
|
83
|
+
* i.e. the directive behaves exactly as before this input existed.
|
|
84
|
+
*/
|
|
85
|
+
precision = input(undefined);
|
|
86
|
+
/**
|
|
87
|
+
* Placeholder text shown when the field is empty. When `precision` is set and this is left
|
|
88
|
+
* unset, it is auto-calculated from `minDecimalPlaces` (e.g. `0,00`); has no effect otherwise.
|
|
89
|
+
*/
|
|
90
|
+
placeholder = model(undefined);
|
|
91
|
+
/**
|
|
92
|
+
* Emitted when a pasted value is rejected for exceeding `precision`. Only fires when
|
|
93
|
+
* `precision` is set; emits the rejected pasted text.
|
|
94
|
+
*/
|
|
95
|
+
pasteRejected = output();
|
|
96
|
+
/** Native `maxLength` attribute, auto-calculated from `precision` when it is set. */
|
|
97
|
+
maxLength;
|
|
79
98
|
elementRef = inject((ElementRef));
|
|
80
99
|
renderer = inject(Renderer2);
|
|
81
100
|
localeService = inject(LocaleService, { optional: true });
|
|
@@ -86,17 +105,46 @@ class NumericMaskDirective {
|
|
|
86
105
|
thousandSeparator = model('.');
|
|
87
106
|
currentLocale = 'pt-BR';
|
|
88
107
|
lastModelValue = null;
|
|
108
|
+
/** `protected`: subclasses with their own deprecated separator aliases (e.g. `BignumberInputDirective`) set this directly. */
|
|
109
|
+
_decimalSeparatorExplicit = false;
|
|
110
|
+
/** `protected`: see `_decimalSeparatorExplicit`. */
|
|
111
|
+
_thousandSeparatorExplicit = false;
|
|
112
|
+
_lastAutoPlaceholder;
|
|
89
113
|
ngOnChanges(changes) {
|
|
90
114
|
if (changes['locale'] && !changes['locale'].firstChange && this.locale()) {
|
|
91
115
|
this.currentLocale = this.locale();
|
|
92
116
|
this.updateSeparators();
|
|
93
117
|
this.setInputMode();
|
|
94
118
|
}
|
|
119
|
+
// Preserves an explicitly bound separator across later locale-driven recalculations
|
|
120
|
+
// (see `updateSeparators`): `changes['X']` is only present when the parent template
|
|
121
|
+
// actually binds that input (Angular never reports unbound inputs here, not even on
|
|
122
|
+
// the first change), so consumers who never touch these two keep today's locale-derived
|
|
123
|
+
// behavior. Checked by key presence alone — NOT the current value's truthiness, which
|
|
124
|
+
// would wrongly treat an intentional `[thousandSeparator]="''"` (no grouping) as "not
|
|
125
|
+
// explicit" and let a later locale change silently restore grouping.
|
|
126
|
+
if (changes['decimalSeparator']) {
|
|
127
|
+
this._decimalSeparatorExplicit = true;
|
|
128
|
+
}
|
|
129
|
+
if (changes['thousandSeparator']) {
|
|
130
|
+
this._thousandSeparatorExplicit = true;
|
|
131
|
+
}
|
|
132
|
+
if (changes['precision'] ||
|
|
133
|
+
changes['minDecimalPlaces'] ||
|
|
134
|
+
changes['maxDecimalPlaces'] ||
|
|
135
|
+
changes['decimalSeparator'] ||
|
|
136
|
+
changes['thousandSeparator']) {
|
|
137
|
+
this.calculateMaxLength();
|
|
138
|
+
}
|
|
139
|
+
if (changes['precision'] || changes['minDecimalPlaces'] || changes['decimalSeparator']) {
|
|
140
|
+
this.updatePlaceholder();
|
|
141
|
+
}
|
|
95
142
|
}
|
|
96
143
|
ngOnInit() {
|
|
97
144
|
if (this.minDecimalPlaces() > this.maxDecimalPlaces()) {
|
|
98
145
|
throw new Error(`NumericMaskDirective: minDecimalPlaces (${this.minDecimalPlaces()}) cannot be greater than maxDecimalPlaces (${this.maxDecimalPlaces()})`);
|
|
99
146
|
}
|
|
147
|
+
this.updatePlaceholder();
|
|
100
148
|
if (this.locale()) {
|
|
101
149
|
this.currentLocale = this.locale();
|
|
102
150
|
this.updateSeparators();
|
|
@@ -177,14 +225,35 @@ class NumericMaskDirective {
|
|
|
177
225
|
this.onChange(modelValue);
|
|
178
226
|
}
|
|
179
227
|
/**
|
|
180
|
-
* Listener for paste events (clipboard)
|
|
228
|
+
* Listener for paste events (clipboard). When `precision` is set and the pasted value would
|
|
229
|
+
* exceed it, the paste is rejected outright (nothing is written) and `pasteRejected` fires.
|
|
181
230
|
*/
|
|
182
231
|
onPaste(event) {
|
|
183
|
-
event.preventDefault();
|
|
184
232
|
const pastedText = event.clipboardData?.getData('text') || '';
|
|
233
|
+
const precision = this.precision();
|
|
234
|
+
if (precision !== undefined && this.exceedsPrecision(pastedText, precision)) {
|
|
235
|
+
event.preventDefault();
|
|
236
|
+
this.pasteRejected.emit(pastedText);
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
event.preventDefault();
|
|
185
240
|
let value = this.parseClipboardValue(pastedText);
|
|
186
241
|
this.processInputValue(value);
|
|
187
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* Whether a raw pasted string, once stripped of separators, has more significant digits
|
|
245
|
+
* than `precision` allows.
|
|
246
|
+
* @private
|
|
247
|
+
*/
|
|
248
|
+
exceedsPrecision(text, precision) {
|
|
249
|
+
const thousandSep = this.thousandSeparator();
|
|
250
|
+
const numericText = text
|
|
251
|
+
.replace(new RegExp(this.escapeRegex(thousandSep), 'g'), '')
|
|
252
|
+
.replace(this.decimalSeparator(), '.');
|
|
253
|
+
const [intPart, decimalPart = ''] = numericText.split('.');
|
|
254
|
+
const totalDigits = intPart.replace(/\D/g, '').length + decimalPart.slice(0, this.maxDecimalPlaces()).length;
|
|
255
|
+
return totalDigits > precision;
|
|
256
|
+
}
|
|
188
257
|
/**
|
|
189
258
|
* Listener for special keys (+ and -)
|
|
190
259
|
*/
|
|
@@ -256,12 +325,59 @@ class NumericMaskDirective {
|
|
|
256
325
|
}
|
|
257
326
|
}
|
|
258
327
|
/**
|
|
259
|
-
* Updates separators according to the locale
|
|
328
|
+
* Updates separators according to the locale. An explicitly bound `decimalSeparator`/
|
|
329
|
+
* `thousandSeparator` (tracked in `ngOnChanges`) is restored afterwards, so a locale
|
|
330
|
+
* change never silently overrides a value the consumer set on purpose.
|
|
260
331
|
*/
|
|
261
332
|
updateSeparators() {
|
|
333
|
+
const explicitDecimal = this._decimalSeparatorExplicit ? this.decimalSeparator() : undefined;
|
|
334
|
+
const explicitThousand = this._thousandSeparatorExplicit ? this.thousandSeparator() : undefined;
|
|
262
335
|
const formatted = new Intl.NumberFormat(this.currentLocale).format(1234.5);
|
|
263
336
|
this.thousandSeparator.set(formatted[1]);
|
|
264
337
|
this.decimalSeparator.set(formatted[5]);
|
|
338
|
+
if (explicitDecimal !== undefined) {
|
|
339
|
+
this.decimalSeparator.set(explicitDecimal);
|
|
340
|
+
}
|
|
341
|
+
if (explicitThousand !== undefined) {
|
|
342
|
+
this.thousandSeparator.set(explicitThousand);
|
|
343
|
+
}
|
|
344
|
+
this.calculateMaxLength();
|
|
345
|
+
this.updatePlaceholder();
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Auto-calculates the native `maxLength` from `precision`, sized for the current separators
|
|
349
|
+
* and `maxDecimalPlaces`. No-op (leaves `maxLength` unset) while `precision` is `undefined`.
|
|
350
|
+
* `protected`: subclasses that map their own deprecated inputs into `minDecimalPlaces`/
|
|
351
|
+
* `maxDecimalPlaces`/`thousandSeparator` outside of a tracked `changes` key call this directly.
|
|
352
|
+
*/
|
|
353
|
+
calculateMaxLength() {
|
|
354
|
+
const precision = this.precision();
|
|
355
|
+
if (precision === undefined) {
|
|
356
|
+
this.maxLength = undefined;
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
const scale = this.maxDecimalPlaces();
|
|
360
|
+
const decSepLength = this.decimalSeparator()?.length ?? 0;
|
|
361
|
+
const thoSepLength = this.thousandSeparator()?.length ?? 0;
|
|
362
|
+
const DIGITS_GROUP_SIZE = 3;
|
|
363
|
+
let maxLength = precision + (scale ? decSepLength : 0);
|
|
364
|
+
maxLength += Math.ceil((precision - scale) / DIGITS_GROUP_SIZE - 1) * thoSepLength;
|
|
365
|
+
this.maxLength = maxLength;
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Auto-calculates `placeholder` (e.g. `0,00`) from `minDecimalPlaces`, without overwriting
|
|
369
|
+
* a value the consumer set explicitly. No-op while `precision` is `undefined`.
|
|
370
|
+
* `protected`: see `calculateMaxLength`.
|
|
371
|
+
*/
|
|
372
|
+
updatePlaceholder() {
|
|
373
|
+
if (this.precision() === undefined)
|
|
374
|
+
return;
|
|
375
|
+
const scale = this.minDecimalPlaces();
|
|
376
|
+
const autoPlaceholder = scale ? `0${this.decimalSeparator()}${''.padEnd(scale, '0')}` : '0';
|
|
377
|
+
if (this.placeholder() === undefined || this.placeholder() === this._lastAutoPlaceholder) {
|
|
378
|
+
this.placeholder.set(autoPlaceholder);
|
|
379
|
+
}
|
|
380
|
+
this._lastAutoPlaceholder = autoPlaceholder;
|
|
265
381
|
}
|
|
266
382
|
/**
|
|
267
383
|
* Processes input value and updates the input and model
|
|
@@ -386,10 +502,18 @@ class NumericMaskDirective {
|
|
|
386
502
|
*/
|
|
387
503
|
parseStringToValue(value) {
|
|
388
504
|
const isNegative = value.startsWith('-');
|
|
389
|
-
let numericStr = value
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
505
|
+
let numericStr = value.replace(/^-/, '');
|
|
506
|
+
// Guarded: an empty thousandSeparator (e.g. "no grouping") must not reach `new RegExp`,
|
|
507
|
+
// since a bare escaped-empty pattern (`new RegExp('\\' + '')`) throws
|
|
508
|
+
// "Invalid regular expression: \ at end of pattern".
|
|
509
|
+
const thousandSep = this.thousandSeparator();
|
|
510
|
+
if (thousandSep) {
|
|
511
|
+
numericStr = numericStr.replace(new RegExp(this.escapeRegex(thousandSep), 'g'), '');
|
|
512
|
+
}
|
|
513
|
+
const decimalSep = this.decimalSeparator();
|
|
514
|
+
if (decimalSep) {
|
|
515
|
+
numericStr = numericStr.replace(new RegExp(this.escapeRegex(decimalSep), 'g'), '.');
|
|
516
|
+
}
|
|
393
517
|
if (numericStr === '.' || numericStr === '') {
|
|
394
518
|
numericStr = '0';
|
|
395
519
|
}
|
|
@@ -405,6 +529,28 @@ class NumericMaskDirective {
|
|
|
405
529
|
}
|
|
406
530
|
return { bigNumber, numeric: bigNumber.toNumber(), isNegative };
|
|
407
531
|
}
|
|
532
|
+
/**
|
|
533
|
+
* Groups an integer digit string (optionally signed) using `thousandSeparator`.
|
|
534
|
+
*
|
|
535
|
+
* Previously this used `Intl.NumberFormat(currentLocale)` and then tried to strip the
|
|
536
|
+
* locale's own grouping via `.split(decimalSeparator())`, which (a) ignored a custom
|
|
537
|
+
* `thousandSeparator` entirely — always falling back to the locale's own grouping
|
|
538
|
+
* character instead, e.g. `thousandSeparator=""` had no effect — and (b) corrupted the
|
|
539
|
+
* result whenever the locale's grouping character happened to equal `decimalSeparator`
|
|
540
|
+
* (e.g. a custom `decimalSeparator="."` under `pt-BR`, which groups thousands with `.`
|
|
541
|
+
* too): `"1.234".split('.')[0]` returned `"1"` instead of `"1234"`. Grouping the digits
|
|
542
|
+
* directly with the directive's own (already locale/explicit-resolved) `thousandSeparator`
|
|
543
|
+
* avoids the detour through `Intl.NumberFormat` and both bugs.
|
|
544
|
+
* @private
|
|
545
|
+
*/
|
|
546
|
+
groupIntegerDigits(integerPart) {
|
|
547
|
+
const numericValue = parseInt(integerPart, 10) || 0;
|
|
548
|
+
const isNegative = numericValue < 0;
|
|
549
|
+
const digits = Math.abs(numericValue).toString();
|
|
550
|
+
const sep = this.thousandSeparator();
|
|
551
|
+
const grouped = sep ? digits.replace(/\B(?=(\d{3})+(?!\d))/g, sep) : digits;
|
|
552
|
+
return isNegative ? `-${grouped}` : grouped;
|
|
553
|
+
}
|
|
408
554
|
/**
|
|
409
555
|
* Formats a numeric value according to the locale
|
|
410
556
|
* Truncates (never rounds) to maxDecimalPlaces and pads with zeros to minDecimalPlaces
|
|
@@ -418,9 +564,7 @@ class NumericMaskDirective {
|
|
|
418
564
|
const parts = formattedValue.split(this.decimalSeparator());
|
|
419
565
|
const integerPart = parts[0];
|
|
420
566
|
let decimalPart = parts[1] || '';
|
|
421
|
-
const formattedInteger =
|
|
422
|
-
.format(parseInt(integerPart, 10) || 0)
|
|
423
|
-
.split(this.decimalSeparator())[0];
|
|
567
|
+
const formattedInteger = this.groupIntegerDigits(integerPart);
|
|
424
568
|
const effectiveDecimalPlaces = decimalPart.replace(/0+$/, '').length;
|
|
425
569
|
const decimalPlacesToShow = Math.max(this.minDecimalPlaces(), Math.min(effectiveDecimalPlaces, this.maxDecimalPlaces()));
|
|
426
570
|
decimalPart = decimalPart.substring(0, decimalPlacesToShow).padEnd(decimalPlacesToShow, '0');
|
|
@@ -518,10 +662,13 @@ class NumericMaskDirective {
|
|
|
518
662
|
this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', isDisabled);
|
|
519
663
|
}
|
|
520
664
|
validate(control) {
|
|
521
|
-
const
|
|
522
|
-
if (!
|
|
665
|
+
const controlValue = control.value;
|
|
666
|
+
if (!controlValue) {
|
|
523
667
|
return null;
|
|
524
668
|
}
|
|
669
|
+
// The model may be set programmatically as a `number` (e.g. `patchValue` with a backend DTO),
|
|
670
|
+
// even though the value this directive emits is always a decimal `string`.
|
|
671
|
+
const value = String(controlValue);
|
|
525
672
|
const numericValue = parseFloat(value);
|
|
526
673
|
if (isNaN(numericValue)) {
|
|
527
674
|
return null;
|
|
@@ -556,10 +703,24 @@ class NumericMaskDirective {
|
|
|
556
703
|
},
|
|
557
704
|
};
|
|
558
705
|
}
|
|
706
|
+
const precision = this.precision();
|
|
707
|
+
if (precision !== undefined) {
|
|
708
|
+
const numericStr = String(value).replace('-', '');
|
|
709
|
+
const [intPart, decPart = ''] = numericStr.split('.');
|
|
710
|
+
const totalDigits = intPart.length + decPart.length;
|
|
711
|
+
if (totalDigits > precision) {
|
|
712
|
+
return {
|
|
713
|
+
exceedsPrecision: {
|
|
714
|
+
precision,
|
|
715
|
+
actual: totalDigits,
|
|
716
|
+
},
|
|
717
|
+
};
|
|
718
|
+
}
|
|
719
|
+
}
|
|
559
720
|
return null;
|
|
560
721
|
}
|
|
561
722
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NumericMaskDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
562
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.14", type: NumericMaskDirective, isStandalone: true, selector: "[sNumericMask]", inputs: { locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, minDecimalPlaces: { classPropertyName: "minDecimalPlaces", publicName: "minDecimalPlaces", isSignal: true, isRequired: false, transformFunction: null }, maxDecimalPlaces: { classPropertyName: "maxDecimalPlaces", publicName: "maxDecimalPlaces", isSignal: true, isRequired: false, transformFunction: null }, allowNegative: { classPropertyName: "allowNegative", publicName: "allowNegative", isSignal: true, isRequired: false, transformFunction: null }, allowScientificNotation: { classPropertyName: "allowScientificNotation", publicName: "allowScientificNotation", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, blockDecimalOverflow: { classPropertyName: "blockDecimalOverflow", publicName: "blockDecimalOverflow", isSignal: true, isRequired: false, transformFunction: null }, decimalRoundingMode: { classPropertyName: "decimalRoundingMode", publicName: "decimalRoundingMode", isSignal: true, isRequired: false, transformFunction: null }, decimalSeparator: { classPropertyName: "decimalSeparator", publicName: "decimalSeparator", isSignal: true, isRequired: false, transformFunction: null }, thousandSeparator: { classPropertyName: "thousandSeparator", publicName: "thousandSeparator", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { decimalSeparator: "decimalSeparatorChange", thousandSeparator: "thousandSeparatorChange" }, host: { listeners: { "input": "onInput($event)", "focus": "onFocus()", "blur": "onBlur()", "paste": "onPaste($event)", "keydown": "onKeyDown($event)", "keypress": "onKeyPress($event)" }, properties: { "style.text-align": "\"right\"" } }, providers: [
|
|
723
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.14", type: NumericMaskDirective, isStandalone: true, selector: "[sNumericMask]", inputs: { locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, minDecimalPlaces: { classPropertyName: "minDecimalPlaces", publicName: "minDecimalPlaces", isSignal: true, isRequired: false, transformFunction: null }, maxDecimalPlaces: { classPropertyName: "maxDecimalPlaces", publicName: "maxDecimalPlaces", isSignal: true, isRequired: false, transformFunction: null }, allowNegative: { classPropertyName: "allowNegative", publicName: "allowNegative", isSignal: true, isRequired: false, transformFunction: null }, allowScientificNotation: { classPropertyName: "allowScientificNotation", publicName: "allowScientificNotation", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, blockDecimalOverflow: { classPropertyName: "blockDecimalOverflow", publicName: "blockDecimalOverflow", isSignal: true, isRequired: false, transformFunction: null }, decimalRoundingMode: { classPropertyName: "decimalRoundingMode", publicName: "decimalRoundingMode", isSignal: true, isRequired: false, transformFunction: null }, precision: { classPropertyName: "precision", publicName: "precision", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, decimalSeparator: { classPropertyName: "decimalSeparator", publicName: "decimalSeparator", isSignal: true, isRequired: false, transformFunction: null }, thousandSeparator: { classPropertyName: "thousandSeparator", publicName: "thousandSeparator", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { placeholder: "placeholderChange", pasteRejected: "pasteRejected", decimalSeparator: "decimalSeparatorChange", thousandSeparator: "thousandSeparatorChange" }, host: { listeners: { "input": "onInput($event)", "focus": "onFocus()", "blur": "onBlur()", "paste": "onPaste($event)", "keydown": "onKeyDown($event)", "keypress": "onKeyPress($event)" }, properties: { "style.text-align": "\"right\"", "attr.maxLength": "maxLength", "attr.placeholder": "placeholder()" } }, providers: [
|
|
563
724
|
{
|
|
564
725
|
provide: NG_VALUE_ACCESSOR,
|
|
565
726
|
useExisting: forwardRef(() => NumericMaskDirective),
|
|
@@ -585,6 +746,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
585
746
|
'(keydown)': 'onKeyDown($event)',
|
|
586
747
|
'(keypress)': 'onKeyPress($event)',
|
|
587
748
|
'[style.text-align]': '"right"',
|
|
749
|
+
'[attr.maxLength]': 'maxLength',
|
|
750
|
+
'[attr.placeholder]': 'placeholder()',
|
|
588
751
|
},
|
|
589
752
|
providers: [
|
|
590
753
|
{
|
|
@@ -601,6 +764,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
601
764
|
}]
|
|
602
765
|
}] });
|
|
603
766
|
|
|
767
|
+
/**
|
|
768
|
+
* @deprecated Será removido na v20. Importe diretamente o standalone `NumericMaskDirective` (de
|
|
769
|
+
* `@seniorsistemas/angular-components/numeric-mask`) no lugar deste módulo.
|
|
770
|
+
*
|
|
771
|
+
* Migração automática (também executada pelo `ng update` na v20):
|
|
772
|
+
* `ng generate @seniorsistemas/angular-components:migrate-modules-to-standalone`
|
|
773
|
+
*/
|
|
604
774
|
class CurrencyMaskModule {
|
|
605
775
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CurrencyMaskModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
606
776
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: CurrencyMaskModule, imports: [NumericMaskDirective], exports: [NumericMaskDirective] });
|