@seniorsistemas/angular-components 19.9.14-develop-23365630 → 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.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.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/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.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.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.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/drawer/lib/drawer/drawer.module.mjs +11 -1
- 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.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 +7 -0
- 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 +7 -0
- 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 +10 -2
- 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-drawer.mjs +10 -0
- package/fesm2022/seniorsistemas-angular-components-drawer.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs +52 -208
- 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 +7 -0
- 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
|
@@ -0,0 +1,660 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ITEM_ID = void 0;
|
|
4
|
+
exports.migrateTemplateText = migrateTemplateText;
|
|
5
|
+
exports.migrateApisInContent = migrateApisInContent;
|
|
6
|
+
exports.migrateDeprecatedApis = migrateDeprecatedApis;
|
|
7
|
+
exports.migrate = migrate;
|
|
8
|
+
const path = require("path");
|
|
9
|
+
const ts = require("typescript");
|
|
10
|
+
const ast_utils_1 = require("../../utils/ast-utils");
|
|
11
|
+
const report_1 = require("../../utils/report");
|
|
12
|
+
const scope_1 = require("../../utils/scope");
|
|
13
|
+
const symbol_utils_1 = require("../../utils/symbol-utils");
|
|
14
|
+
const template_utils_1 = require("../../utils/template-utils");
|
|
15
|
+
const eol_1 = require("../../utils/eol");
|
|
16
|
+
/**
|
|
17
|
+
* Migra APIs depreciadas que têm substituto direto (renomeios mecânicos), sempre restritas ao elemento
|
|
18
|
+
* ou símbolo correto, e avisa (`addManual`) onde a conversão é ambígua.
|
|
19
|
+
*
|
|
20
|
+
* Templates (HTML e `template:` inline): usa o scanner de tags de `template-utils` (nunca uma regex solta sobre o arquivo),
|
|
21
|
+
* então `(onCodeChange)` só muda em `<s-code-editor>`, `[scale]` só em `<input sBignumberInput|sNumberInput>`, etc.
|
|
22
|
+
*
|
|
23
|
+
* Decisões:
|
|
24
|
+
* - `sNumberInput`/`sBignumberInput`/`sLocalizedNumberInput` (e as respectivas `*Directive`/`*Module`) -> `sNumericMask`/
|
|
25
|
+
* `NumericMaskDirective`. Os defaults das diretivas antigas diferem da `sNumericMask`, então são gravados de forma
|
|
26
|
+
* explícita no template para preservar o comportamento: `[precision]="15"`, `[allowNegative]="true"`,
|
|
27
|
+
* `[blockDecimalOverflow]="false"` e `[minDecimalPlaces]`/`[maxDecimalPlaces]` (a partir de `[scale]`, ou `0`).
|
|
28
|
+
* Na `sLocalizedNumberInput`, `precision` (casas decimais) vira `maxDecimalPlaces` e sempre há aviso de revisão,
|
|
29
|
+
* porque o valor do `FormControl` passa a ser `string` e o erro `invalidNumber` deixa de existir.
|
|
30
|
+
* - `NumberAlignmentOption.X`/`BignumberAlignmentOption.X` -> `'left'`/`'right'` (o enum não tem mais efeito).
|
|
31
|
+
* - `localizedCurrency` -> `localizedBignumber` (mesmos defaults: scale 2 e símbolo do locale; só a chave `currencySymbol`
|
|
32
|
+
* vira `prefix`; `emptyAsZero: true` preserva a exibição de string vazia como 0); `localizedCurrencyImpure` ->
|
|
33
|
+
* `localizedBignumberImpure` (preserva a detecção de mudança impura).
|
|
34
|
+
* Argumento que não seja um objeto literal com chaves conhecidas -> aviso, sem reescrever.
|
|
35
|
+
* - `localizedNumber` usava `Intl.NumberFormat` (sem prefixo, até 3 casas); vira `localizedBignumber: { prefix: '', scale: N, emptyAsZero: true, nullAsZero: true }`
|
|
36
|
+
* (N = literal ou 0; as duas opções preservam a exibição de vazio e null como 0) e SEMPRE gera um aviso de revisão, porque o arredondamento/separadores podem divergir.
|
|
37
|
+
* - Símbolos TS (pipes e `BreadcrumbModule`) só são trocados se todos os usos forem elementos de array (`imports`, etc.).
|
|
38
|
+
* Se algum template ainda usa o pipe antigo (não migrável), o símbolo antigo é mantido ao lado do novo.
|
|
39
|
+
*/
|
|
40
|
+
exports.ITEM_ID = 'apis';
|
|
41
|
+
const PREFIX = '@seniorsistemas/angular-components/';
|
|
42
|
+
const LOCALE = `${PREFIX}locale`;
|
|
43
|
+
const NUMBER_INPUT = `${PREFIX}number-input`;
|
|
44
|
+
const BIGNUMBER_INPUT = `${PREFIX}bignumber-input`;
|
|
45
|
+
const BREADCRUMB = `${PREFIX}breadcrumb`;
|
|
46
|
+
const NUMERIC_MASK = `${PREFIX}numeric-mask`;
|
|
47
|
+
const LOCALIZED_NUMBER_INPUT = `${PREFIX}localized-number-input`;
|
|
48
|
+
const NUMERIC_INPUT_ATTRS = ['sBignumberInput', 'sNumberInput', 'sLocalizedNumberInput'];
|
|
49
|
+
const CURRENCY_ALLOWED_KEYS = ['scale', 'currencySymbol', 'thousandsSeparator', 'decimalSeparator'];
|
|
50
|
+
const SAFE_SCALE_EXPRESSION = /^\s*(?:\d+|[A-Za-z_$][\w$]*(?:\??\.[A-Za-z_$][\w$]*)*!?|'[^'"\\]*')\s*$/;
|
|
51
|
+
// ---------------------------------------------------------------------------------------------------------------------
|
|
52
|
+
// Templates
|
|
53
|
+
// ---------------------------------------------------------------------------------------------------------------------
|
|
54
|
+
function findAttr(tag, ...names) {
|
|
55
|
+
return tag.attrs.find((attr) => names.includes(attr.name));
|
|
56
|
+
}
|
|
57
|
+
function renameAttr(tag, from, to, edits, manual) {
|
|
58
|
+
const attr = findAttr(tag, from);
|
|
59
|
+
if (!attr)
|
|
60
|
+
return;
|
|
61
|
+
if (findAttr(tag, to)) {
|
|
62
|
+
manual.push({
|
|
63
|
+
index: attr.start,
|
|
64
|
+
message: `<${tag.name}> tem "${from}" e "${to}" ao mesmo tempo: remova "${from}" manualmente.`,
|
|
65
|
+
});
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
edits.push({ start: attr.nameStart, end: attr.nameEnd, replacement: to });
|
|
69
|
+
}
|
|
70
|
+
function collectTagEdits(text, edits, manual) {
|
|
71
|
+
for (const tag of (0, template_utils_1.scanOpenTags)(text)) {
|
|
72
|
+
if (tag.name === 's-code-editor') {
|
|
73
|
+
renameAttr(tag, '(onCodeChange)', '(codeChange)', edits, manual);
|
|
74
|
+
}
|
|
75
|
+
else if (tag.name === 's-profile-picture-picker') {
|
|
76
|
+
// Não é um rename: `changedImage` sempre emite `string`, enquanto `imageChange` emite
|
|
77
|
+
// `string | ProfilePicturePickerData` conforme o tipo de `[image]`. O handler precisa ser revisto.
|
|
78
|
+
const changed = findAttr(tag, '(changedImage)');
|
|
79
|
+
if (changed) {
|
|
80
|
+
manual.push({
|
|
81
|
+
index: changed.start,
|
|
82
|
+
message: '"(changedImage)" está depreciado, mas "(imageChange)" não é equivalente: emite string | ProfilePicturePickerData (conforme [image]). Troque o output e ajuste o tipo do handler manualmente.',
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else if (tag.name === 'input' && findAttr(tag, ...NUMERIC_INPUT_ATTRS)) {
|
|
87
|
+
collectNumericInputEdits(text, tag, edits, manual);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function collectNumericInputEdits(text, tag, edits, manual) {
|
|
92
|
+
const directives = NUMERIC_INPUT_ATTRS.map((name) => findAttr(tag, name)).filter((attr) => !!attr);
|
|
93
|
+
if (directives.length > 1 || findAttr(tag, 'sNumericMask')) {
|
|
94
|
+
manual.push({
|
|
95
|
+
index: directives[0].start,
|
|
96
|
+
message: 'O <input> tem mais de uma diretiva numérica (sNumericMask, sBignumberInput, sNumberInput, sLocalizedNumberInput): mantenha apenas "sNumericMask" e revise os inputs manualmente.',
|
|
97
|
+
});
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const directive = directives[0];
|
|
101
|
+
const localized = directive.name === 'sLocalizedNumberInput';
|
|
102
|
+
const has = (...names) => !!findAttr(tag, ...names);
|
|
103
|
+
// Inputs com os defaults da diretiva antiga, para que o comportamento não mude silenciosamente.
|
|
104
|
+
const explicit = [];
|
|
105
|
+
// Todas as variações (`[thousandsSeparator]` e `thousandsSeparator`): a segunda passada não vê mais a tag, pois
|
|
106
|
+
// ela já deixou de ter a diretiva antiga.
|
|
107
|
+
for (const thousands of tag.attrs.filter((attr) => ['[thousandsSeparator]', 'thousandsSeparator'].includes(attr.name))) {
|
|
108
|
+
const target = thousands.name.startsWith('[') ? '[thousandSeparator]' : 'thousandSeparator';
|
|
109
|
+
renameAttr(tag, thousands.name, target, edits, manual);
|
|
110
|
+
}
|
|
111
|
+
if (localized) {
|
|
112
|
+
// `precision` da sLocalizedNumberInput é o nº máximo de casas decimais (padrão 2).
|
|
113
|
+
const precision = findAttr(tag, '[precision]', 'precision');
|
|
114
|
+
if (precision) {
|
|
115
|
+
renameAttr(tag, precision.name, precision.name.startsWith('[') ? '[maxDecimalPlaces]' : 'maxDecimalPlaces', edits, manual);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
explicit.push('[maxDecimalPlaces]="2"');
|
|
119
|
+
}
|
|
120
|
+
if (!has('[allowNegative]', 'allowNegative'))
|
|
121
|
+
explicit.push('[allowNegative]="true"');
|
|
122
|
+
manual.push({
|
|
123
|
+
index: directive.start,
|
|
124
|
+
message: 'sLocalizedNumberInput foi trocada por sNumericMask: o valor do FormControl agora é uma string em formato internacional (ex.: "1234.56") e o erro "invalidNumber" deixou de existir. Revise validações e mensagens.',
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
const alignTo = findAttr(tag, '[alignTo]', 'alignTo');
|
|
129
|
+
if (alignTo) {
|
|
130
|
+
edits.push((0, template_utils_1.buildRemoveAttrEdit)(text, alignTo));
|
|
131
|
+
manual.push({
|
|
132
|
+
index: alignTo.start,
|
|
133
|
+
message: `"${alignTo.name}" foi removido: não tem mais efeito (o alinhamento é sempre à direita).`,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
const scale = findAttr(tag, '[scale]', 'scale');
|
|
137
|
+
if (scale) {
|
|
138
|
+
collectScaleEdit(tag, scale, edits, manual);
|
|
139
|
+
}
|
|
140
|
+
else if (!has('[minDecimalPlaces]', 'minDecimalPlaces', '[maxDecimalPlaces]', 'maxDecimalPlaces')) {
|
|
141
|
+
explicit.push('[minDecimalPlaces]="0"', '[maxDecimalPlaces]="0"');
|
|
142
|
+
}
|
|
143
|
+
if (!has('[precision]', 'precision'))
|
|
144
|
+
explicit.push('[precision]="15"');
|
|
145
|
+
if (!has('[allowNegative]', 'allowNegative'))
|
|
146
|
+
explicit.push('[allowNegative]="true"');
|
|
147
|
+
if (!has('[blockDecimalOverflow]', 'blockDecimalOverflow'))
|
|
148
|
+
explicit.push('[blockDecimalOverflow]="false"');
|
|
149
|
+
}
|
|
150
|
+
edits.push({
|
|
151
|
+
start: directive.nameStart,
|
|
152
|
+
end: directive.nameEnd,
|
|
153
|
+
replacement: ['sNumericMask', ...explicit].join(' '),
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
function collectScaleEdit(tag, scale, edits, manual) {
|
|
157
|
+
if (findAttr(tag, '[minDecimalPlaces]', 'minDecimalPlaces', '[maxDecimalPlaces]', 'maxDecimalPlaces')) {
|
|
158
|
+
manual.push({
|
|
159
|
+
index: scale.start,
|
|
160
|
+
message: `"${scale.name}" convive com minDecimalPlaces/maxDecimalPlaces: remova "${scale.name}" manualmente.`,
|
|
161
|
+
});
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
const value = scale.value?.trim();
|
|
165
|
+
const bound = scale.name.startsWith('[');
|
|
166
|
+
const safe = value !== undefined && (bound ? SAFE_SCALE_EXPRESSION.test(value) : /^\d+$/.test(value));
|
|
167
|
+
if (!safe) {
|
|
168
|
+
manual.push({
|
|
169
|
+
index: scale.start,
|
|
170
|
+
message: `"${scale.name}" com expressão que não dá para duplicar com segurança: troque por [minDecimalPlaces] e [maxDecimalPlaces].`,
|
|
171
|
+
});
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
const quote = bound ? (scale.quote ?? '"') : '"';
|
|
175
|
+
edits.push({
|
|
176
|
+
start: scale.start,
|
|
177
|
+
end: scale.end,
|
|
178
|
+
replacement: `[minDecimalPlaces]=${quote}${value}${quote} [maxDecimalPlaces]=${quote}${value}${quote}`,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
// ---- pipes ----
|
|
182
|
+
const PIPE_REGEX = /(?<!\|)\|(?!\|)\s*(localizedCurrencyImpure|localizedCurrency|localizedNumber)(?![\w$])/g;
|
|
183
|
+
/** Fim (exclusivo) da expressão do argumento de um pipe que começa em `from`. */
|
|
184
|
+
function findPipeArgEnd(text, from, inInterpolation) {
|
|
185
|
+
let depth = 0;
|
|
186
|
+
let str = null;
|
|
187
|
+
for (let i = from; i < text.length; i++) {
|
|
188
|
+
const c = text[i];
|
|
189
|
+
if (str) {
|
|
190
|
+
if (c === '\\')
|
|
191
|
+
i++;
|
|
192
|
+
else if (c === str)
|
|
193
|
+
str = null;
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
if (c === "'" || c === '`') {
|
|
197
|
+
str = c;
|
|
198
|
+
}
|
|
199
|
+
else if (c === '"') {
|
|
200
|
+
if (!inInterpolation)
|
|
201
|
+
return i;
|
|
202
|
+
str = c;
|
|
203
|
+
}
|
|
204
|
+
else if (c === '(' || c === '[' || c === '{') {
|
|
205
|
+
depth++;
|
|
206
|
+
}
|
|
207
|
+
else if (c === ')' || c === ']' || c === '}') {
|
|
208
|
+
if (depth === 0)
|
|
209
|
+
return i;
|
|
210
|
+
depth--;
|
|
211
|
+
}
|
|
212
|
+
else if (depth === 0 && (c === ',' || c === ';' || c === ':')) {
|
|
213
|
+
return i;
|
|
214
|
+
}
|
|
215
|
+
else if (depth === 0 && c === '|' && text[i + 1] !== '|' && text[i - 1] !== '|') {
|
|
216
|
+
return i;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
return text.length;
|
|
220
|
+
}
|
|
221
|
+
function buildCurrencyOptionsEdits(arg) {
|
|
222
|
+
const source = ts.createSourceFile('_arg.ts', `(${arg})`, ts.ScriptTarget.Latest, true);
|
|
223
|
+
if (source.parseDiagnostics.length > 0)
|
|
224
|
+
return undefined;
|
|
225
|
+
const statement = source.statements[0];
|
|
226
|
+
if (source.statements.length !== 1 || !ts.isExpressionStatement(statement))
|
|
227
|
+
return undefined;
|
|
228
|
+
const expression = statement.expression;
|
|
229
|
+
if (!ts.isParenthesizedExpression(expression) || !ts.isObjectLiteralExpression(expression.expression)) {
|
|
230
|
+
return undefined;
|
|
231
|
+
}
|
|
232
|
+
const edits = [];
|
|
233
|
+
for (const prop of expression.expression.properties) {
|
|
234
|
+
if (ts.isShorthandPropertyAssignment(prop)) {
|
|
235
|
+
if (!CURRENCY_ALLOWED_KEYS.includes(prop.name.text))
|
|
236
|
+
return undefined;
|
|
237
|
+
if (prop.name.text === 'currencySymbol') {
|
|
238
|
+
edits.push({
|
|
239
|
+
start: prop.getStart(source) - 1,
|
|
240
|
+
end: prop.getEnd() - 1,
|
|
241
|
+
replacement: 'prefix: currencySymbol',
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
else if (ts.isPropertyAssignment(prop) && (ts.isIdentifier(prop.name) || ts.isStringLiteral(prop.name))) {
|
|
246
|
+
if (!CURRENCY_ALLOWED_KEYS.includes(prop.name.text))
|
|
247
|
+
return undefined;
|
|
248
|
+
if (prop.name.text === 'currencySymbol') {
|
|
249
|
+
edits.push({
|
|
250
|
+
start: prop.name.getStart(source) - 1,
|
|
251
|
+
end: prop.name.getEnd() - 1,
|
|
252
|
+
replacement: 'prefix',
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
return undefined;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return edits;
|
|
261
|
+
}
|
|
262
|
+
function collectPipeEdits(text, edits, manual, quotesSafe) {
|
|
263
|
+
PIPE_REGEX.lastIndex = 0;
|
|
264
|
+
let match;
|
|
265
|
+
while ((match = PIPE_REGEX.exec(text)) !== null) {
|
|
266
|
+
const pipe = match[1];
|
|
267
|
+
const nameEnd = match.index + match[0].length;
|
|
268
|
+
const nameStart = nameEnd - pipe.length;
|
|
269
|
+
const interpolationOpen = text.lastIndexOf('{{', match.index);
|
|
270
|
+
const inInterpolation = interpolationOpen > text.lastIndexOf('}}', match.index);
|
|
271
|
+
let cursor = nameEnd;
|
|
272
|
+
while (/\s/.test(text[cursor] ?? ''))
|
|
273
|
+
cursor++;
|
|
274
|
+
const hasArg = text[cursor] === ':';
|
|
275
|
+
let argStart = -1;
|
|
276
|
+
let argEnd = -1;
|
|
277
|
+
let arg = '';
|
|
278
|
+
if (hasArg) {
|
|
279
|
+
argStart = cursor + 1;
|
|
280
|
+
while (/\s/.test(text[argStart] ?? ''))
|
|
281
|
+
argStart++;
|
|
282
|
+
argEnd = findPipeArgEnd(text, argStart, inInterpolation);
|
|
283
|
+
while (argEnd > argStart && /\s/.test(text[argEnd - 1]))
|
|
284
|
+
argEnd--;
|
|
285
|
+
arg = text.slice(argStart, argEnd);
|
|
286
|
+
let after = argEnd;
|
|
287
|
+
while (/\s/.test(text[after] ?? ''))
|
|
288
|
+
after++;
|
|
289
|
+
if (text[after] === ':') {
|
|
290
|
+
manual.push({
|
|
291
|
+
index: match.index,
|
|
292
|
+
message: `Pipe "${pipe}" com mais de um argumento: migre manualmente para localizedBignumber.`,
|
|
293
|
+
});
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
if (pipe === 'localizedNumber') {
|
|
298
|
+
if (!quotesSafe) {
|
|
299
|
+
manual.push({
|
|
300
|
+
index: match.index,
|
|
301
|
+
message: 'Pipe "localizedNumber": migre manualmente para localizedBignumber: { prefix: \'\', scale: N }.',
|
|
302
|
+
});
|
|
303
|
+
continue;
|
|
304
|
+
}
|
|
305
|
+
let scale;
|
|
306
|
+
if (!hasArg)
|
|
307
|
+
scale = '0';
|
|
308
|
+
else if (/^\d+$/.test(arg))
|
|
309
|
+
scale = arg;
|
|
310
|
+
else {
|
|
311
|
+
manual.push({
|
|
312
|
+
index: match.index,
|
|
313
|
+
message: `Pipe "localizedNumber" com argumento "${arg}" não literal: use localizedBignumber: { prefix: '', scale: <casas> }.`,
|
|
314
|
+
});
|
|
315
|
+
continue;
|
|
316
|
+
}
|
|
317
|
+
edits.push({ start: nameStart, end: nameEnd, replacement: 'localizedBignumber' });
|
|
318
|
+
const options = `{ prefix: '', scale: ${scale}, emptyAsZero: true, nullAsZero: true }`;
|
|
319
|
+
if (hasArg)
|
|
320
|
+
edits.push({ start: argStart, end: argEnd, replacement: options });
|
|
321
|
+
else
|
|
322
|
+
edits.push({ start: nameEnd, end: nameEnd, replacement: `: ${options}` });
|
|
323
|
+
manual.push({
|
|
324
|
+
index: match.index,
|
|
325
|
+
message: 'Pipe "localizedNumber" trocado por "localizedBignumber" com scale fixo, emptyAsZero e nullAsZero (valores vazios e null continuam sendo exibidos como 0): revise, pois o antigo usava Intl.NumberFormat (até 3 casas decimais) e o novo usa os separadores do LocaleService.',
|
|
326
|
+
});
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
const target = pipe === 'localizedCurrencyImpure' ? 'localizedBignumberImpure' : 'localizedBignumber';
|
|
330
|
+
// `Number('')` é 0: o pipe antigo formatava string vazia como 0 (ex.: 0,00), e o novo devolve vazio.
|
|
331
|
+
const keepEmptyAsZero = 'emptyAsZero: true';
|
|
332
|
+
if (!hasArg) {
|
|
333
|
+
edits.push({ start: nameEnd, end: nameEnd, replacement: `: { ${keepEmptyAsZero} }` });
|
|
334
|
+
}
|
|
335
|
+
if (hasArg) {
|
|
336
|
+
const argEdits = buildCurrencyOptionsEdits(arg);
|
|
337
|
+
if (!argEdits) {
|
|
338
|
+
manual.push({
|
|
339
|
+
index: match.index,
|
|
340
|
+
message: `Pipe "${pipe}" com argumento "${arg}" que não é um objeto literal conhecido: migre manualmente para ${target} (a chave currencySymbol vira prefix).`,
|
|
341
|
+
});
|
|
342
|
+
continue;
|
|
343
|
+
}
|
|
344
|
+
for (const e of argEdits) {
|
|
345
|
+
edits.push({ start: argStart + e.start, end: argStart + e.end, replacement: e.replacement });
|
|
346
|
+
}
|
|
347
|
+
if (arg.startsWith('{')) {
|
|
348
|
+
const isEmptyObject = arg.slice(1, -1).trim() === '';
|
|
349
|
+
edits.push({
|
|
350
|
+
start: argStart + 1,
|
|
351
|
+
end: argStart + 1,
|
|
352
|
+
replacement: isEmptyObject ? ` ${keepEmptyAsZero} ` : ` ${keepEmptyAsZero},`,
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
edits.push({ start: nameStart, end: nameEnd, replacement: target });
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
function dropOverlaps(edits) {
|
|
360
|
+
const sorted = [...edits].sort((a, b) => a.start - b.start || a.end - b.end);
|
|
361
|
+
const result = [];
|
|
362
|
+
let lastEnd = -1;
|
|
363
|
+
for (const edit of sorted) {
|
|
364
|
+
if (edit.start < lastEnd)
|
|
365
|
+
continue;
|
|
366
|
+
result.push(edit);
|
|
367
|
+
lastEnd = Math.max(lastEnd, edit.end);
|
|
368
|
+
}
|
|
369
|
+
return result;
|
|
370
|
+
}
|
|
371
|
+
/** Migra um texto de template (HTML inteiro ou conteúdo de `template:` inline). */
|
|
372
|
+
function migrateTemplateText(text, options = { quotesSafe: true }) {
|
|
373
|
+
let current = text;
|
|
374
|
+
const manual = [];
|
|
375
|
+
// Vários passes: um pipe dentro do argumento de outro só fica livre de sobreposição na rodada seguinte.
|
|
376
|
+
for (let pass = 0; pass < 5; pass++) {
|
|
377
|
+
const edits = [];
|
|
378
|
+
const passManual = [];
|
|
379
|
+
collectTagEdits(current, edits, passManual);
|
|
380
|
+
collectPipeEdits(current, edits, passManual, options.quotesSafe);
|
|
381
|
+
if (pass === 0)
|
|
382
|
+
manual.push(...passManual);
|
|
383
|
+
const safe = dropOverlaps(edits);
|
|
384
|
+
if (safe.length === 0)
|
|
385
|
+
break;
|
|
386
|
+
const next = (0, ast_utils_1.applyChanges)(current, safe);
|
|
387
|
+
if (next === current)
|
|
388
|
+
break;
|
|
389
|
+
current = next;
|
|
390
|
+
}
|
|
391
|
+
return { updated: current, manual };
|
|
392
|
+
}
|
|
393
|
+
const SYMBOL_SPECS = [
|
|
394
|
+
{
|
|
395
|
+
from: LOCALE,
|
|
396
|
+
old: 'LocalizedNumberPipe',
|
|
397
|
+
new: 'LocalizedBignumberPipe',
|
|
398
|
+
newFrom: LOCALE,
|
|
399
|
+
mode: 'array',
|
|
400
|
+
pipe: 'localizedNumber',
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
from: LOCALE,
|
|
404
|
+
old: 'LocalizedCurrencyPipe',
|
|
405
|
+
new: 'LocalizedBignumberPipe',
|
|
406
|
+
newFrom: LOCALE,
|
|
407
|
+
mode: 'array',
|
|
408
|
+
pipe: 'localizedCurrency',
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
from: LOCALE,
|
|
412
|
+
old: 'LocalizedCurrencyImpurePipe',
|
|
413
|
+
new: 'LocalizedBignumberImpurePipe',
|
|
414
|
+
newFrom: LOCALE,
|
|
415
|
+
mode: 'array',
|
|
416
|
+
pipe: 'localizedCurrencyImpure',
|
|
417
|
+
},
|
|
418
|
+
...[
|
|
419
|
+
{ from: NUMBER_INPUT, old: 'NumberInputDirective' },
|
|
420
|
+
{ from: NUMBER_INPUT, old: 'NumberInputModule' },
|
|
421
|
+
{ from: BIGNUMBER_INPUT, old: 'BignumberInputDirective' },
|
|
422
|
+
{ from: BIGNUMBER_INPUT, old: 'BignumberInputModule' },
|
|
423
|
+
{ from: LOCALIZED_NUMBER_INPUT, old: 'LocalizedNumberInputDirective' },
|
|
424
|
+
{ from: LOCALIZED_NUMBER_INPUT, old: 'LocalizedNumberInputModule' },
|
|
425
|
+
].map(({ from, old }) => ({
|
|
426
|
+
from,
|
|
427
|
+
old,
|
|
428
|
+
new: 'NumericMaskDirective',
|
|
429
|
+
newFrom: NUMERIC_MASK,
|
|
430
|
+
mode: 'rename',
|
|
431
|
+
})),
|
|
432
|
+
{
|
|
433
|
+
from: BREADCRUMB,
|
|
434
|
+
old: 'BreadcrumbModule',
|
|
435
|
+
new: 'DynamicBreadcrumbComponent',
|
|
436
|
+
newFrom: BREADCRUMB,
|
|
437
|
+
mode: 'array',
|
|
438
|
+
},
|
|
439
|
+
];
|
|
440
|
+
const ENUM_SPECS = [
|
|
441
|
+
{ from: NUMBER_INPUT, name: 'NumberAlignmentOption' },
|
|
442
|
+
{ from: BIGNUMBER_INPUT, name: 'BignumberAlignmentOption' },
|
|
443
|
+
];
|
|
444
|
+
function parse(file, content) {
|
|
445
|
+
return ts.createSourceFile(file, content, ts.ScriptTarget.Latest, true);
|
|
446
|
+
}
|
|
447
|
+
function pipeStillUsed(file, content, pipe, readTemplate) {
|
|
448
|
+
const regex = new RegExp(`\\|\\s*${pipe}(?![\\w$])`);
|
|
449
|
+
const sourceFile = parse(file, content);
|
|
450
|
+
for (const seg of (0, template_utils_1.findInlineTemplateSegments)(sourceFile)) {
|
|
451
|
+
if (regex.test(content.slice(seg.start, seg.end)))
|
|
452
|
+
return true;
|
|
453
|
+
}
|
|
454
|
+
if (!readTemplate)
|
|
455
|
+
return false;
|
|
456
|
+
for (const match of content.matchAll(/templateUrl\s*:\s*['"`]([^'"`]+)['"`]/g)) {
|
|
457
|
+
const html = readTemplate(file, match[1]);
|
|
458
|
+
if (html === undefined)
|
|
459
|
+
continue;
|
|
460
|
+
if (regex.test(migrateTemplateText(html).updated))
|
|
461
|
+
return true;
|
|
462
|
+
}
|
|
463
|
+
return false;
|
|
464
|
+
}
|
|
465
|
+
function migrateSymbols(file, content, readTemplate, manual) {
|
|
466
|
+
let current = content;
|
|
467
|
+
for (const spec of SYMBOL_SPECS) {
|
|
468
|
+
if (!current.includes(spec.old))
|
|
469
|
+
continue;
|
|
470
|
+
const sourceFile = parse(file, current);
|
|
471
|
+
const imported = (0, symbol_utils_1.findNamedImport)(sourceFile, spec.old, spec.from);
|
|
472
|
+
if (!imported)
|
|
473
|
+
continue;
|
|
474
|
+
const line = (0, report_1.lineOf)(current, imported.element.getStart(sourceFile));
|
|
475
|
+
if (imported.element.propertyName) {
|
|
476
|
+
manual.push({ line, message: `"${spec.old}" importado com alias: troque manualmente por "${spec.new}".` });
|
|
477
|
+
continue;
|
|
478
|
+
}
|
|
479
|
+
const references = (0, symbol_utils_1.findReferences)(sourceFile, spec.old);
|
|
480
|
+
if (spec.mode === 'array') {
|
|
481
|
+
const outside = references.find((ref) => !(0, symbol_utils_1.isArrayElement)(ref));
|
|
482
|
+
if (outside) {
|
|
483
|
+
manual.push({
|
|
484
|
+
line: (0, report_1.lineOf)(current, outside.getStart(sourceFile)),
|
|
485
|
+
message: `"${spec.old}" é usado fora de um array de imports/providers: troque manualmente por "${spec.new}" e revise os argumentos.`,
|
|
486
|
+
});
|
|
487
|
+
continue;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
const keepOld = !!spec.pipe && pipeStillUsed(file, current, spec.pipe, readTemplate);
|
|
491
|
+
const changes = [];
|
|
492
|
+
changes.push(...(0, symbol_utils_1.buildReplaceInArraysChanges)(sourceFile, spec.old, spec.new, keepOld));
|
|
493
|
+
changes.push(...(0, symbol_utils_1.buildEnsureInModuleImportsChanges)(sourceFile, spec.old, spec.new));
|
|
494
|
+
if (spec.mode === 'rename') {
|
|
495
|
+
for (const ref of references.filter((r) => !(0, symbol_utils_1.isArrayElement)(r))) {
|
|
496
|
+
const replacement = ts.isShorthandPropertyAssignment(ref.parent)
|
|
497
|
+
? `${spec.old}: ${spec.new}`
|
|
498
|
+
: spec.new;
|
|
499
|
+
changes.push({ start: ref.getStart(sourceFile), end: ref.getEnd(), replacement });
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
if (!keepOld)
|
|
503
|
+
changes.push(...(0, ast_utils_1.buildRemoveNamedImportsChanges)(sourceFile, [spec.old], spec.from).changes);
|
|
504
|
+
current = (0, ast_utils_1.applyChanges)(current, (0, symbol_utils_1.consumeRemovedLineBreaks)(current, changes));
|
|
505
|
+
if (references.length > 0)
|
|
506
|
+
current = (0, ast_utils_1.ensureNamedImport)(current, spec.new, spec.newFrom);
|
|
507
|
+
}
|
|
508
|
+
return current;
|
|
509
|
+
}
|
|
510
|
+
function migrateAlignmentEnums(file, content, manual) {
|
|
511
|
+
let current = content;
|
|
512
|
+
for (const spec of ENUM_SPECS) {
|
|
513
|
+
if (!current.includes(spec.name))
|
|
514
|
+
continue;
|
|
515
|
+
const sourceFile = parse(file, current);
|
|
516
|
+
const imported = (0, symbol_utils_1.findNamedImport)(sourceFile, spec.name, spec.from);
|
|
517
|
+
if (!imported || imported.element.propertyName)
|
|
518
|
+
continue;
|
|
519
|
+
const changes = [];
|
|
520
|
+
let unresolved = false;
|
|
521
|
+
for (const ref of (0, symbol_utils_1.findReferences)(sourceFile, spec.name)) {
|
|
522
|
+
const parent = ref.parent;
|
|
523
|
+
const member = ts.isPropertyAccessExpression(parent) && parent.expression === ref ? parent.name.text : undefined;
|
|
524
|
+
if (member === 'RIGHT' || member === 'LEFT') {
|
|
525
|
+
changes.push({
|
|
526
|
+
start: parent.getStart(sourceFile),
|
|
527
|
+
end: parent.getEnd(),
|
|
528
|
+
replacement: member === 'RIGHT' ? "'right'" : "'left'",
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
else {
|
|
532
|
+
unresolved = true;
|
|
533
|
+
manual.push({
|
|
534
|
+
line: (0, report_1.lineOf)(current, ref.getStart(sourceFile)),
|
|
535
|
+
message: `"${spec.name}" usado fora de ${spec.name}.RIGHT/LEFT: troque por 'left' | 'right'.`,
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
if (!unresolved)
|
|
540
|
+
changes.push(...(0, ast_utils_1.buildRemoveNamedImportsChanges)(sourceFile, [spec.name], spec.from).changes);
|
|
541
|
+
current = (0, ast_utils_1.applyChanges)(current, (0, symbol_utils_1.consumeRemovedLineBreaks)(current, changes));
|
|
542
|
+
}
|
|
543
|
+
return current;
|
|
544
|
+
}
|
|
545
|
+
const RATING_NODE_KEYS = ['id', 'title', 'icon'];
|
|
546
|
+
/** O arquivo importa algo do entrypoint do rating-scale ou usa `<s-rating-scale>` no template inline. */
|
|
547
|
+
function usesRatingScale(sourceFile, content) {
|
|
548
|
+
if (content.includes('<s-rating-scale'))
|
|
549
|
+
return true;
|
|
550
|
+
return sourceFile.statements.some((statement) => ts.isImportDeclaration(statement) &&
|
|
551
|
+
ts.isStringLiteral(statement.moduleSpecifier) &&
|
|
552
|
+
statement.moduleSpecifier.text === `${PREFIX}rating-scale`);
|
|
553
|
+
}
|
|
554
|
+
function migrateRatingScaleNodes(file, content, manual) {
|
|
555
|
+
if (!content.includes('icon'))
|
|
556
|
+
return content;
|
|
557
|
+
const sourceFile = parse(file, content);
|
|
558
|
+
if (!usesRatingScale(sourceFile, content))
|
|
559
|
+
return content;
|
|
560
|
+
const changes = [];
|
|
561
|
+
const visit = (node) => {
|
|
562
|
+
if (ts.isObjectLiteralExpression(node)) {
|
|
563
|
+
const named = (name) => node.properties.find((p) => ts.isPropertyAssignment(p) &&
|
|
564
|
+
(ts.isIdentifier(p.name) || ts.isStringLiteral(p.name)) &&
|
|
565
|
+
p.name.text === name);
|
|
566
|
+
const icon = named('icon');
|
|
567
|
+
// Só objetos no formato de nó (id/title/icon): objetos com outras chaves (ex.: itens de menu) não são nós.
|
|
568
|
+
const isNodeShape = node.properties.every((p) => ts.isPropertyAssignment(p) &&
|
|
569
|
+
(ts.isIdentifier(p.name) || ts.isStringLiteral(p.name)) &&
|
|
570
|
+
RATING_NODE_KEYS.includes(p.name.text));
|
|
571
|
+
if (icon && isNodeShape && named('id') && !named('selectedIcon') && !named('unselectedIcon')) {
|
|
572
|
+
const init = icon.initializer;
|
|
573
|
+
const line = (0, report_1.lineOf)(content, icon.getStart(sourceFile));
|
|
574
|
+
if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {
|
|
575
|
+
const quote = init.getText(sourceFile)[0];
|
|
576
|
+
if (/\s/.test(init.text)) {
|
|
577
|
+
manual.push({
|
|
578
|
+
line,
|
|
579
|
+
message: `rating-scale: "icon" com glifo já informado ("${init.text}"): defina selectedIcon e unselectedIcon manualmente.`,
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
else {
|
|
583
|
+
changes.push({
|
|
584
|
+
start: icon.getStart(sourceFile),
|
|
585
|
+
end: icon.getEnd(),
|
|
586
|
+
replacement: `selectedIcon: ${quote}fas ${init.text}${quote}, unselectedIcon: ${quote}far ${init.text}${quote}`,
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
else {
|
|
591
|
+
manual.push({
|
|
592
|
+
line,
|
|
593
|
+
message: 'rating-scale: "icon" dinâmico: defina selectedIcon (fas ...) e unselectedIcon (far ...) manualmente.',
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
ts.forEachChild(node, visit);
|
|
599
|
+
};
|
|
600
|
+
visit(sourceFile);
|
|
601
|
+
return changes.length > 0 ? (0, ast_utils_1.applyChanges)(content, changes) : content;
|
|
602
|
+
}
|
|
603
|
+
function warnBignumberDirective(file, content, manual) {
|
|
604
|
+
if (!content.includes('BignumberInputDirective'))
|
|
605
|
+
return;
|
|
606
|
+
const sourceFile = parse(file, content);
|
|
607
|
+
const imported = (0, symbol_utils_1.findNamedImport)(sourceFile, 'BignumberInputDirective', BIGNUMBER_INPUT);
|
|
608
|
+
if (!imported)
|
|
609
|
+
return;
|
|
610
|
+
manual.push({
|
|
611
|
+
line: (0, report_1.lineOf)(content, imported.element.getStart(sourceFile)),
|
|
612
|
+
message: 'BignumberInputDirective (importada com alias) está depreciada em favor de sNumericMask (NumericMaskDirective): troque manualmente.',
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Migra um arquivo. `.html` (template), `.ts` (template inline, símbolos, enums e nós do rating-scale).
|
|
617
|
+
* `readTemplate` resolve `templateUrl` para decidir se um pipe antigo ainda é usado.
|
|
618
|
+
*/
|
|
619
|
+
function migrateApisInContent(file, content, readTemplate) {
|
|
620
|
+
const manual = [];
|
|
621
|
+
if (file.endsWith('.html')) {
|
|
622
|
+
const result = (0, template_utils_1.transformTemplates)(file, content, migrateTemplateText);
|
|
623
|
+
return result;
|
|
624
|
+
}
|
|
625
|
+
if (!file.endsWith('.ts') || file.endsWith('.d.ts'))
|
|
626
|
+
return { updated: content, manual };
|
|
627
|
+
const templated = (0, template_utils_1.transformTemplates)(file, content, migrateTemplateText);
|
|
628
|
+
manual.push(...templated.manual);
|
|
629
|
+
let current = templated.updated;
|
|
630
|
+
current = migrateSymbols(file, current, readTemplate, manual);
|
|
631
|
+
current = migrateAlignmentEnums(file, current, manual);
|
|
632
|
+
current = migrateRatingScaleNodes(file, current, manual);
|
|
633
|
+
warnBignumberDirective(file, current, manual);
|
|
634
|
+
return { updated: current, manual };
|
|
635
|
+
}
|
|
636
|
+
function migrateDeprecatedApis(options, report) {
|
|
637
|
+
return (tree, context) => {
|
|
638
|
+
const readTemplate = (relativeTo, templateUrl) => {
|
|
639
|
+
const resolved = path.posix.join(path.posix.dirname(relativeTo), templateUrl);
|
|
640
|
+
return tree.exists(resolved) ? tree.readText(resolved) : undefined;
|
|
641
|
+
};
|
|
642
|
+
(0, scope_1.visitScopedFiles)(tree, options, context, (file) => {
|
|
643
|
+
if (!(file.endsWith('.html') || file.endsWith('.ts')) || file.endsWith('.d.ts'))
|
|
644
|
+
return;
|
|
645
|
+
const content = tree.readText(file);
|
|
646
|
+
const { updated, manual } = migrateApisInContent(file, content, readTemplate);
|
|
647
|
+
if (updated !== content) {
|
|
648
|
+
tree.overwrite(file, (0, eol_1.preserveLineEndings)(content, updated));
|
|
649
|
+
report.markChanged(exports.ITEM_ID, file);
|
|
650
|
+
}
|
|
651
|
+
for (const entry of manual) {
|
|
652
|
+
report.addManual(exports.ITEM_ID, { file, line: entry.line, message: entry.message }, context);
|
|
653
|
+
}
|
|
654
|
+
});
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
function migrate(options = {}) {
|
|
658
|
+
return migrateDeprecatedApis(options, new report_1.MigrationReport());
|
|
659
|
+
}
|
|
660
|
+
//# sourceMappingURL=index.js.map
|