@taiga-ui/cdk 4.0.0-rc.1 → 4.0.0-rc.10
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/classes/control.d.ts +1 -1
- package/classes/index.d.ts +0 -1
- package/constants/used-icons.d.ts +1 -1
- package/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/directives/auto-focus/autofocus.options.d.ts +1 -1
- package/directives/for/for.directive.d.ts +3 -3
- package/directives/platform/platform.directive.d.ts +1 -1
- package/directives/value-changes/value-changes.directive.d.ts +3 -3
- package/esm2022/classes/control.mjs +2 -2
- package/esm2022/classes/index.mjs +1 -2
- package/esm2022/constants/used-icons.mjs +14 -6
- package/esm2022/constants/version.mjs +2 -2
- package/esm2022/directives/active-zone/active-zone.directive.mjs +2 -2
- package/esm2022/directives/auto-focus/autofocus.options.mjs +3 -3
- package/esm2022/directives/auto-focus/handlers/ios.handler.mjs +3 -3
- package/esm2022/directives/click-outside/click-outside.directive.mjs +2 -2
- package/esm2022/directives/copy-processor/copy-processor.directive.mjs +3 -3
- package/esm2022/directives/droppable/droppable.directive.mjs +3 -3
- package/esm2022/directives/for/for.directive.mjs +6 -6
- package/esm2022/directives/high-dpi/high-dpi.directive.mjs +3 -3
- package/esm2022/directives/hovered/hovered.service.mjs +2 -2
- package/esm2022/directives/obscured/obscured.directive.mjs +2 -2
- package/esm2022/directives/obscured/obscured.service.mjs +4 -4
- package/esm2022/directives/pan/pan.service.mjs +2 -2
- package/esm2022/directives/platform/platform.directive.mjs +6 -6
- package/esm2022/directives/swipe/swipe.service.mjs +2 -2
- package/esm2022/directives/value-changes/value-changes.directive.mjs +6 -6
- package/esm2022/directives/zoom/zoom.service.mjs +4 -4
- package/esm2022/observables/control-value.mjs +2 -2
- package/esm2022/observables/drag-and-drop-from.mjs +2 -2
- package/esm2022/observables/events.mjs +3 -3
- package/esm2022/observables/if-map.mjs +2 -2
- package/esm2022/observables/must-be-present.mjs +2 -2
- package/esm2022/observables/zone.mjs +4 -4
- package/esm2022/pipes/filter/filter.pipe.mjs +2 -2
- package/esm2022/services/index.mjs +2 -2
- package/esm2022/services/popover.service.mjs +3 -3
- package/esm2022/services/scroll.service.mjs +5 -5
- package/esm2022/services/theme-color.service.mjs +30 -0
- package/esm2022/tokens/active-element.mjs +5 -5
- package/esm2022/tokens/environment.mjs +15 -7
- package/esm2022/tokens/removed-element.mjs +4 -4
- package/esm2022/tokens/window-size.mjs +3 -3
- package/esm2022/utils/color/get-gradient-data.mjs +6 -0
- package/esm2022/utils/color/hex-to-rgb.mjs +2 -2
- package/esm2022/utils/color/index.mjs +3 -1
- package/esm2022/utils/color/parse-color.mjs +3 -3
- package/esm2022/utils/color/parse-gradient.mjs +70 -0
- package/esm2022/utils/color/rgb-to-hex.mjs +2 -2
- package/esm2022/utils/dom/get-element-obscurers.mjs +2 -2
- package/esm2022/utils/dom/get-element-point.mjs +6 -0
- package/esm2022/utils/dom/index.mjs +2 -1
- package/esm2022/utils/focus/focused-in.mjs +7 -0
- package/esm2022/utils/focus/index.mjs +2 -1
- package/esm2022/utils/miscellaneous/mark-control-as-touched-and-validate.mjs +3 -3
- package/esm2022/utils/miscellaneous/with-styles.mjs +2 -2
- package/fesm2022/taiga-ui-cdk-classes.mjs +2 -16
- package/fesm2022/taiga-ui-cdk-classes.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-constants.mjs +14 -6
- package/fesm2022/taiga-ui-cdk-constants.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs +1 -1
- package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs +4 -4
- package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-click-outside.mjs +1 -1
- package/fesm2022/taiga-ui-cdk-directives-click-outside.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-copy-processor.mjs +2 -2
- package/fesm2022/taiga-ui-cdk-directives-copy-processor.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-droppable.mjs +2 -2
- package/fesm2022/taiga-ui-cdk-directives-droppable.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-for.mjs +5 -5
- package/fesm2022/taiga-ui-cdk-directives-for.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-high-dpi.mjs +2 -2
- package/fesm2022/taiga-ui-cdk-directives-high-dpi.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-hovered.mjs +1 -1
- package/fesm2022/taiga-ui-cdk-directives-hovered.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-obscured.mjs +4 -4
- package/fesm2022/taiga-ui-cdk-directives-obscured.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-pan.mjs +1 -1
- package/fesm2022/taiga-ui-cdk-directives-pan.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-platform.mjs +5 -5
- package/fesm2022/taiga-ui-cdk-directives-platform.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-swipe.mjs +1 -1
- package/fesm2022/taiga-ui-cdk-directives-swipe.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-value-changes.mjs +5 -5
- package/fesm2022/taiga-ui-cdk-directives-value-changes.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-zoom.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-directives-zoom.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-observables.mjs +9 -9
- package/fesm2022/taiga-ui-cdk-observables.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-filter.mjs +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-filter.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-services.mjs +25 -28
- package/fesm2022/taiga-ui-cdk-services.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-tokens.mjs +22 -15
- package/fesm2022/taiga-ui-cdk-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-color.mjs +80 -5
- package/fesm2022/taiga-ui-cdk-utils-color.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-dom.mjs +7 -2
- package/fesm2022/taiga-ui-cdk-utils-dom.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-focus.mjs +8 -2
- package/fesm2022/taiga-ui-cdk-utils-focus.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs +3 -3
- package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs.map +1 -1
- package/package.json +7 -8
- package/schematics/migration.json +3 -3
- package/schematics/ng-add/constants/modules.d.ts +0 -1
- package/schematics/ng-add/constants/modules.js +1 -11
- package/schematics/ng-add/constants/versions.d.ts +0 -1
- package/schematics/ng-add/constants/versions.js +1 -2
- package/schematics/ng-add/index.js +1 -7
- package/schematics/ng-add/schema.d.ts +0 -1
- package/schematics/ng-add/schema.json +0 -27
- package/schematics/ng-add/steps/add-taiga-icons.js +1 -1
- package/schematics/ng-add/steps/add-taiga-modules.js +7 -22
- package/schematics/ng-update/interfaces/html-comment.d.ts +3 -2
- package/schematics/ng-update/interfaces/replacement-attribute-value.d.ts +6 -2
- package/schematics/ng-update/interfaces/replacement-identifier.d.ts +4 -10
- package/schematics/ng-update/interfaces/replacement-type.d.ts +5 -0
- package/schematics/ng-update/steps/icons/replace-imports.js +5 -5
- package/schematics/ng-update/steps/index.d.ts +1 -0
- package/schematics/ng-update/steps/index.js +1 -0
- package/schematics/ng-update/steps/remove-module.js +2 -2
- package/schematics/ng-update/steps/rename-types.js +11 -7
- package/schematics/ng-update/steps/replace-deep-import.js +2 -2
- package/schematics/ng-update/steps/replace-enums.js +2 -2
- package/schematics/ng-update/steps/replace-identifier.js +31 -9
- package/schematics/ng-update/steps/replace-package-name.d.ts +5 -0
- package/schematics/ng-update/steps/replace-package-name.js +18 -0
- package/schematics/ng-update/steps/replace-services.js +5 -5
- package/schematics/ng-update/steps/show-warnings.js +4 -4
- package/schematics/ng-update/utils/replace-text.js +1 -1
- package/schematics/ng-update/utils/templates/replace-attr-values.js +41 -12
- package/schematics/ng-update/utils/templates/replace-attrs.js +1 -1
- package/schematics/ng-update/utils/templates/template-comments.js +11 -3
- package/schematics/ng-update/v4/index.js +20 -7
- package/schematics/ng-update/v4/migrate-css-vars/palette.d.ts +11 -2
- package/schematics/ng-update/v4/migrate-css-vars/palette.js +18 -8
- package/schematics/ng-update/v4/migrate-css-vars/rename-css-vars.js +10 -2
- package/schematics/ng-update/v4/migrate-icons/index.js +9 -7
- package/schematics/ng-update/v4/migrate-icons/rename-icons.js +15 -7
- package/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.d.ts +3 -0
- package/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.js +79 -0
- package/schematics/ng-update/v4/steps/constants/attr-to-directive-replace.js +5 -4
- package/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.js +51 -2
- package/schematics/ng-update/v4/steps/constants/attrs-to-replace.js +114 -27
- package/schematics/ng-update/v4/steps/constants/enums.js +31 -0
- package/schematics/ng-update/v4/steps/constants/html-comments.js +19 -0
- package/schematics/ng-update/v4/steps/constants/identifiers-to-replace.js +1388 -288
- package/schematics/ng-update/v4/steps/constants/index.d.ts +1 -0
- package/schematics/ng-update/v4/steps/constants/index.js +1 -0
- package/schematics/ng-update/v4/steps/constants/inputs-to-remove.js +2 -1
- package/schematics/ng-update/v4/steps/constants/migration-warnings.js +25 -0
- package/schematics/ng-update/v4/steps/constants/modules-to-remove.js +32 -0
- package/schematics/ng-update/v4/steps/constants/modules-to-replace.d.ts +13 -0
- package/schematics/ng-update/v4/steps/constants/modules-to-replace.js +16 -0
- package/schematics/ng-update/v4/steps/constants/services.d.ts +2 -0
- package/schematics/ng-update/v4/steps/constants/services.js +15 -0
- package/schematics/ng-update/v4/steps/constants/tags-to-replace.js +17 -4
- package/schematics/ng-update/v4/steps/constants/types.d.ts +2 -0
- package/schematics/ng-update/v4/steps/constants/types.js +49 -0
- package/schematics/ng-update/v4/steps/index.d.ts +7 -0
- package/schematics/ng-update/v4/steps/index.js +7 -0
- package/schematics/ng-update/v4/steps/migrate-alert-service.d.ts +2 -0
- package/schematics/ng-update/v4/steps/migrate-alert-service.js +110 -0
- package/schematics/ng-update/v4/steps/migrate-all-country-iso-codes.js +1 -1
- package/schematics/ng-update/v4/steps/migrate-destroy-service.js +7 -4
- package/schematics/ng-update/v4/steps/migrate-legacy-mask.js +2 -2
- package/schematics/ng-update/v4/steps/migrate-month-context.d.ts +2 -0
- package/schematics/ng-update/v4/steps/migrate-month-context.js +39 -0
- package/schematics/ng-update/v4/steps/migrate-number-format-settings.d.ts +2 -0
- package/schematics/ng-update/v4/steps/migrate-number-format-settings.js +64 -0
- package/schematics/ng-update/v4/steps/migrate-option-providers.js +6 -3
- package/schematics/ng-update/v4/steps/migrate-proprietary.js +3 -3
- package/schematics/ng-update/v4/steps/migrate-root.d.ts +3 -0
- package/schematics/ng-update/v4/steps/migrate-root.js +61 -0
- package/schematics/ng-update/v4/steps/migrate-templates.js +11 -1
- package/schematics/ng-update/v4/steps/styles/index.js +38 -0
- package/schematics/ng-update/v4/steps/styles/migrate-less-scss-constants.d.ts +1 -0
- package/schematics/ng-update/v4/steps/styles/migrate-less-scss-constants.js +13 -0
- package/schematics/ng-update/v4/steps/styles/migrate-scrollbar-behavior.d.ts +1 -0
- package/schematics/ng-update/v4/steps/styles/migrate-scrollbar-behavior.js +10 -0
- package/schematics/ng-update/v4/steps/styles/migrate-shadow-mixins.d.ts +1 -0
- package/schematics/ng-update/v4/steps/styles/migrate-shadow-mixins.js +23 -0
- package/schematics/ng-update/v4/steps/styles/migrate-space-mixins.d.ts +1 -0
- package/schematics/ng-update/v4/steps/styles/migrate-space-mixins.js +20 -0
- package/schematics/ng-update/v4/steps/styles/migrate-text-mixins.d.ts +1 -0
- package/schematics/ng-update/v4/steps/styles/migrate-text-mixins.js +54 -0
- package/schematics/ng-update/v4/steps/templates/index.d.ts +6 -0
- package/schematics/ng-update/v4/steps/templates/index.js +6 -0
- package/schematics/ng-update/v4/steps/templates/migrate-avatar.js +34 -11
- package/schematics/ng-update/{v3/steps/migrate-polymorpheus.d.ts → v4/steps/templates/migrate-axes.d.ts} +2 -2
- package/schematics/ng-update/v4/steps/templates/migrate-axes.js +26 -0
- package/schematics/ng-update/v4/steps/templates/migrate-badge.js +17 -8
- package/schematics/ng-update/v4/steps/templates/migrate-badged-content.js +1 -1
- package/schematics/ng-update/{v3/steps/migrate-textfield-controller.d.ts → v4/steps/templates/migrate-blocked.d.ts} +2 -2
- package/schematics/ng-update/v4/steps/templates/migrate-blocked.js +35 -0
- package/schematics/ng-update/v4/steps/templates/migrate-button-appearance.d.ts +8 -0
- package/schematics/ng-update/v4/steps/templates/migrate-button-appearance.js +41 -0
- package/schematics/ng-update/v4/steps/templates/migrate-expandable.js +3 -2
- package/schematics/ng-update/v4/steps/templates/migrate-focusable.js +7 -4
- package/schematics/ng-update/v4/steps/templates/migrate-label.d.ts +8 -0
- package/schematics/ng-update/v4/steps/templates/migrate-label.js +39 -0
- package/schematics/ng-update/v4/steps/templates/migrate-labeled.js +6 -10
- package/schematics/ng-update/v4/steps/templates/migrate-mobile-tabs.d.ts +8 -0
- package/schematics/ng-update/v4/steps/templates/migrate-mobile-tabs.js +45 -0
- package/schematics/ng-update/v4/steps/templates/migrate-money.js +1 -1
- package/schematics/ng-update/v4/steps/templates/migrate-notification.d.ts +8 -0
- package/schematics/ng-update/v4/steps/templates/migrate-notification.js +64 -0
- package/schematics/ng-update/v4/steps/templates/migrate-number-precision.d.ts +8 -0
- package/schematics/ng-update/v4/steps/templates/migrate-number-precision.js +36 -0
- package/schematics/ng-update/v4/steps/templates/migrate-overscroll.d.ts +8 -0
- package/schematics/ng-update/v4/steps/templates/migrate-overscroll.js +27 -0
- package/schematics/ng-update/v4/steps/templates/migrate-thumbnail-card.js +2 -1
- package/schematics/ng-update/v4/steps/templates/toggles/common.d.ts +1 -1
- package/schematics/ng-update/v4/steps/templates/toggles/common.js +4 -3
- package/schematics/ng-update/v4/steps/templates/toggles/migrate-checkbox.js +36 -0
- package/schematics/ng-update/{v3/steps/migrate-templates.d.ts → v4/steps/update-packages.d.ts} +1 -1
- package/schematics/ng-update/v4/steps/update-packages.js +44 -0
- package/schematics/ng-update/v4/steps/utils/remove-attrs.js +1 -1
- package/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.d.ts +3 -0
- package/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.js +51 -0
- package/schematics/ng-update/v4/steps/utils/replace-substrings.js +1 -1
- package/schematics/ng-update/v4/tests/migrate-destroy-service/utils.js +1 -0
- package/schematics/utils/add-unique-import.js +1 -1
- package/schematics/utils/angular-json-manipulations.js +4 -4
- package/schematics/utils/get-named-import-references.js +8 -6
- package/schematics/utils/get-standalone-bootstrap-function.js +2 -2
- package/schematics/utils/import-manipulations.js +1 -1
- package/schematics/utils/push-to-array-property.js +1 -1
- package/schematics/utils/templates/elements.d.ts +5 -0
- package/schematics/utils/templates/elements.js +27 -13
- package/schematics/utils/templates/get-component-templates.js +1 -1
- package/schematics/utils/templates/inputs.js +2 -1
- package/schematics/utils/templates/ng-component-input-manipulations.js +5 -5
- package/services/index.d.ts +1 -1
- package/services/theme-color.service.d.ts +16 -0
- package/tokens/environment.d.ts +1 -0
- package/utils/color/get-gradient-data.d.ts +1 -0
- package/utils/color/index.d.ts +2 -0
- package/utils/color/parse-gradient.d.ts +10 -0
- package/utils/dom/get-element-point.d.ts +2 -0
- package/utils/dom/index.d.ts +1 -0
- package/utils/focus/focused-in.d.ts +2 -0
- package/utils/focus/index.d.ts +1 -0
- package/classes/controller.d.ts +0 -9
- package/esm2022/classes/controller.mjs +0 -18
- package/esm2022/services/static-request.service.mjs +0 -33
- package/schematics/ng-update/v3/constants/breakpoints.d.ts +0 -82
- package/schematics/ng-update/v3/constants/breakpoints.js +0 -34
- package/schematics/ng-update/v3/constants/constants.d.ts +0 -2
- package/schematics/ng-update/v3/constants/constants.js +0 -466
- package/schematics/ng-update/v3/constants/deprecated-functions.d.ts +0 -2
- package/schematics/ng-update/v3/constants/deprecated-functions.js +0 -680
- package/schematics/ng-update/v3/constants/enums.d.ts +0 -2
- package/schematics/ng-update/v3/constants/enums.js +0 -284
- package/schematics/ng-update/v3/constants/modules.d.ts +0 -2
- package/schematics/ng-update/v3/constants/modules.js +0 -9
- package/schematics/ng-update/v3/constants/services.d.ts +0 -2
- package/schematics/ng-update/v3/constants/services.js +0 -53
- package/schematics/ng-update/v3/constants/templates.d.ts +0 -57
- package/schematics/ng-update/v3/constants/templates.js +0 -744
- package/schematics/ng-update/v3/constants/tui-interactive-selectors.d.ts +0 -1
- package/schematics/ng-update/v3/constants/tui-interactive-selectors.js +0 -55
- package/schematics/ng-update/v3/constants/types.d.ts +0 -2
- package/schematics/ng-update/v3/constants/types.js +0 -156
- package/schematics/ng-update/v3/constants/warnings.d.ts +0 -2
- package/schematics/ng-update/v3/constants/warnings.js +0 -111
- package/schematics/ng-update/v3/index.d.ts +0 -3
- package/schematics/ng-update/v3/index.js +0 -105
- package/schematics/ng-update/v3/schema.json +0 -13
- package/schematics/ng-update/v3/steps/migrate-date-time.d.ts +0 -2
- package/schematics/ng-update/v3/steps/migrate-date-time.js +0 -207
- package/schematics/ng-update/v3/steps/migrate-polymorpheus.js +0 -78
- package/schematics/ng-update/v3/steps/migrate-progress.d.ts +0 -8
- package/schematics/ng-update/v3/steps/migrate-progress.js +0 -49
- package/schematics/ng-update/v3/steps/migrate-sliders/index.d.ts +0 -3
- package/schematics/ng-update/v3/steps/migrate-sliders/index.js +0 -19
- package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-range.d.ts +0 -3
- package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-range.js +0 -103
- package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-slider.d.ts +0 -3
- package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-slider.js +0 -90
- package/schematics/ng-update/v3/steps/migrate-taiga-proprietary-icons.d.ts +0 -3
- package/schematics/ng-update/v3/steps/migrate-taiga-proprietary-icons.js +0 -70
- package/schematics/ng-update/v3/steps/migrate-templates.js +0 -216
- package/schematics/ng-update/v3/steps/migrate-textfield-controller.js +0 -98
- package/schematics/ng-update/v3/steps/miscellaneous.d.ts +0 -2
- package/schematics/ng-update/v3/steps/miscellaneous.js +0 -81
- package/schematics/ng-update/v3/steps/replace-functions.d.ts +0 -2
- package/schematics/ng-update/v3/steps/replace-functions.js +0 -138
- package/schematics/ng-update/v3/steps/replace-styles.d.ts +0 -3
- package/schematics/ng-update/v3/steps/replace-styles.js +0 -33
- package/schematics/ng-update/v3-30/constants/constants.d.ts +0 -2
- package/schematics/ng-update/v3-30/constants/constants.js +0 -8
- package/schematics/ng-update/v3-30/constants/icons.d.ts +0 -4
- package/schematics/ng-update/v3-30/constants/icons.js +0 -993
- package/schematics/ng-update/v3-30/index.d.ts +0 -3
- package/schematics/ng-update/v3-30/index.js +0 -33
- package/schematics/ng-update/v3-35/constants/constants.d.ts +0 -2
- package/schematics/ng-update/v3-35/constants/constants.js +0 -8
- package/schematics/ng-update/v3-35/constants/icons.d.ts +0 -4
- package/schematics/ng-update/v3-35/constants/icons.js +0 -2537
- package/schematics/ng-update/v3-35/index.d.ts +0 -3
- package/schematics/ng-update/v3-35/index.js +0 -33
- package/schematics/ng-update/v3-36/index.d.ts +0 -3
- package/schematics/ng-update/v3-36/index.js +0 -33
- package/schematics/ng-update/v3-40/index.d.ts +0 -3
- package/schematics/ng-update/v3-40/index.js +0 -62
- package/schematics/ng-update/v3-5/index.d.ts +0 -3
- package/schematics/ng-update/v3-5/index.js +0 -20
- package/schematics/ng-update/v3-5/steps/migrate-expand-templates.d.ts +0 -3
- package/schematics/ng-update/v3-5/steps/migrate-expand-templates.js +0 -44
- package/schematics/ng-update/v4/steps/migrate-styles.js +0 -20
- package/services/static-request.service.d.ts +0 -8
- /package/schematics/ng-update/v4/steps/{migrate-styles.d.ts → styles/index.d.ts} +0 -0
@@ -3,4 +3,9 @@ export interface ReplacementType {
|
|
3
3
|
readonly moduleSpecifier?: string[] | string;
|
4
4
|
readonly preserveGenerics?: boolean;
|
5
5
|
readonly to?: string;
|
6
|
+
readonly removeImport?: boolean;
|
7
|
+
readonly newImports?: Array<{
|
8
|
+
name: string;
|
9
|
+
moduleSpecifier: string;
|
10
|
+
}>;
|
6
11
|
}
|
@@ -13,15 +13,15 @@ function replaceImports(replaceable, options) {
|
|
13
13
|
total: replaceable.length,
|
14
14
|
});
|
15
15
|
replaceable.forEach(({ from, to }) => {
|
16
|
-
const importDeclarations = allImports.filter(declaration => !declaration.wasForgotten() &&
|
16
|
+
const importDeclarations = allImports.filter((declaration) => !declaration.wasForgotten() &&
|
17
17
|
declaration.getModuleSpecifierValue() === from.moduleSpecifier &&
|
18
18
|
declaration
|
19
19
|
.getNamedImports()
|
20
|
-
.some(specifier => specifier.getName() === from.name));
|
21
|
-
const namedImports = importDeclarations.map(declaration => declaration
|
20
|
+
.some((specifier) => specifier.getName() === from.name));
|
21
|
+
const namedImports = importDeclarations.map((declaration) => declaration
|
22
22
|
.getNamedImports()
|
23
|
-
.find(specifier => specifier.getName() === from.name));
|
24
|
-
namedImports.forEach(namedImport => {
|
23
|
+
.find((specifier) => specifier.getName() === from.name));
|
24
|
+
namedImports.forEach((namedImport) => {
|
25
25
|
if (ng_morph_1.Node.isImportSpecifier(namedImport) && !namedImport.wasForgotten()) {
|
26
26
|
(0, import_manipulations_1.removeImport)(namedImport);
|
27
27
|
(0, add_unique_import_1.addUniqueImport)(namedImport.getSourceFile().getFilePath(), to.namedImport || to.name, to.moduleSpecifier);
|
@@ -6,4 +6,5 @@ tslib_1.__exportStar(require("./rename-types"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./replace-deep-import"), exports);
|
7
7
|
tslib_1.__exportStar(require("./replace-enums"), exports);
|
8
8
|
tslib_1.__exportStar(require("./replace-identifier"), exports);
|
9
|
+
tslib_1.__exportStar(require("./replace-package-name"), exports);
|
9
10
|
tslib_1.__exportStar(require("./show-warnings"), exports);
|
@@ -15,7 +15,7 @@ function removeModules(options, modules) {
|
|
15
15
|
exports.removeModules = removeModules;
|
16
16
|
function removeModule(name, moduleSpecifier) {
|
17
17
|
const references = (0, get_named_import_references_1.getNamedImportReferences)(name, moduleSpecifier);
|
18
|
-
references.forEach(ref => {
|
18
|
+
references.forEach((ref) => {
|
19
19
|
if (ref.wasForgotten()) {
|
20
20
|
return;
|
21
21
|
}
|
@@ -24,7 +24,7 @@ function removeModule(name, moduleSpecifier) {
|
|
24
24
|
(0, import_manipulations_1.removeImport)(parent);
|
25
25
|
}
|
26
26
|
else if (ng_morph_1.Node.isArrayLiteralExpression(parent)) {
|
27
|
-
const index = parent.getElements().findIndex(el => el.getText() === name);
|
27
|
+
const index = parent.getElements().findIndex((el) => el.getText() === name);
|
28
28
|
parent.removeElement(index);
|
29
29
|
}
|
30
30
|
});
|
@@ -2,29 +2,33 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.renameTypes = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
|
+
const add_unique_import_1 = require("../../utils/add-unique-import");
|
5
6
|
const colored_log_1 = require("../../utils/colored-log");
|
6
7
|
const get_named_import_references_1 = require("../../utils/get-named-import-references");
|
7
8
|
const import_manipulations_1 = require("../../utils/import-manipulations");
|
8
|
-
function renameType(from, to, moduleSpecifier, preserveGenerics = false) {
|
9
|
+
function renameType({ from, to, moduleSpecifier, preserveGenerics = false, removeImport = false, newImports = [], }) {
|
9
10
|
const references = (0, get_named_import_references_1.getNamedImportReferences)(from, moduleSpecifier);
|
10
|
-
references.forEach(ref => {
|
11
|
+
references.forEach((ref) => {
|
11
12
|
if (ref.wasForgotten()) {
|
12
13
|
return;
|
13
14
|
}
|
14
15
|
const parent = ref.getParent();
|
15
16
|
if (ng_morph_1.Node.isImportSpecifier(parent)) {
|
16
|
-
processImport(parent, from, to);
|
17
|
+
processImport(parent, from, to, removeImport);
|
17
18
|
}
|
18
19
|
else if (ng_morph_1.Node.isTypeReference(parent)) {
|
19
20
|
const targetType = preserveGenerics && to ? addGeneric(to, parent.getTypeArguments()) : to;
|
20
21
|
parent.replaceWithText(targetType || 'any');
|
22
|
+
newImports.forEach(({ name, moduleSpecifier }) => {
|
23
|
+
(0, add_unique_import_1.addUniqueImport)(parent.getSourceFile().getFilePath(), name, moduleSpecifier);
|
24
|
+
});
|
21
25
|
}
|
22
26
|
});
|
23
27
|
}
|
24
|
-
function processImport(node, from, to) {
|
28
|
+
function processImport(node, from, to, remove) {
|
25
29
|
const filePath = node.getSourceFile().getFilePath();
|
26
30
|
const targetImportAlreadyExists = Boolean((0, ng_morph_1.getImports)(filePath, { namedImports: to }).length);
|
27
|
-
if (to && !targetImportAlreadyExists) {
|
31
|
+
if (to && !targetImportAlreadyExists && !remove) {
|
28
32
|
(0, import_manipulations_1.renameImport)(node, removeGeneric(to), removeGeneric(from));
|
29
33
|
}
|
30
34
|
else {
|
@@ -35,14 +39,14 @@ function removeGeneric(type) {
|
|
35
39
|
return type.replaceAll(/<.*>$/gi, '');
|
36
40
|
}
|
37
41
|
function addGeneric(typeName, generics) {
|
38
|
-
const typeArgs = generics.map(t => t.getType().getText());
|
42
|
+
const typeArgs = generics.map((t) => t.getType().getText());
|
39
43
|
const genericType = typeArgs.length ? `<${typeArgs.join(', ')}>` : '';
|
40
44
|
return typeName + genericType;
|
41
45
|
}
|
42
46
|
function renameTypes(options, types) {
|
43
47
|
!options['skip-logs'] &&
|
44
48
|
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} renaming types...`);
|
45
|
-
types.forEach(
|
49
|
+
types.forEach(renameType);
|
46
50
|
!options['skip-logs'] &&
|
47
51
|
(0, colored_log_1.successLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} types renamed \n`);
|
48
52
|
}
|
@@ -11,8 +11,8 @@ function replaceDeepImports(options) {
|
|
11
11
|
}
|
12
12
|
!options['skip-logs'] &&
|
13
13
|
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing deep imports...`);
|
14
|
-
const deepImports = (0, ng_morph_1.getImports)(constants_1.ALL_TS_FILES).filter(imp => DEEP_REGEX.test(imp.getModuleSpecifier().getLiteralValue()));
|
15
|
-
(0, ng_morph_1.editImports)(deepImports, deepImport => {
|
14
|
+
const deepImports = (0, ng_morph_1.getImports)(constants_1.ALL_TS_FILES).filter((imp) => DEEP_REGEX.test(imp.getModuleSpecifier().getLiteralValue()));
|
15
|
+
(0, ng_morph_1.editImports)(deepImports, (deepImport) => {
|
16
16
|
const specifier = deepImport.moduleSpecifier.replace(DEEP_REGEX, '$1');
|
17
17
|
return { moduleSpecifier: specifier };
|
18
18
|
});
|
@@ -25,7 +25,7 @@ function replaceEnumWithString(enumName, replaceValues, keepAsType = true) {
|
|
25
25
|
if (!ng_morph_1.Node.isPropertyAccessExpression(parent)) {
|
26
26
|
continue;
|
27
27
|
}
|
28
|
-
const key = Object.keys(replaceValues).find(key => parent.getName() === key);
|
28
|
+
const key = Object.keys(replaceValues).find((key) => parent.getName() === key);
|
29
29
|
if (key) {
|
30
30
|
parent.replaceWithText(`'${replaceValues[key]}'`);
|
31
31
|
}
|
@@ -35,7 +35,7 @@ function containTypeRef(node) {
|
|
35
35
|
return node
|
36
36
|
.getNameNode()
|
37
37
|
.findReferencesAsNodes()
|
38
|
-
.some(ref => ng_morph_1.Node.isTypeReference(ref.getParent()));
|
38
|
+
.some((ref) => ng_morph_1.Node.isTypeReference(ref.getParent()));
|
39
39
|
}
|
40
40
|
function replaceEnums(options, enums) {
|
41
41
|
!options['skip-logs'] &&
|
@@ -6,17 +6,30 @@ const add_unique_import_1 = require("../../utils/add-unique-import");
|
|
6
6
|
const colored_log_1 = require("../../utils/colored-log");
|
7
7
|
const get_named_import_references_1 = require("../../utils/get-named-import-references");
|
8
8
|
const import_manipulations_1 = require("../../utils/import-manipulations");
|
9
|
+
const progress_1 = require("../../utils/progress");
|
9
10
|
function replaceIdentifiers(options, constants) {
|
10
11
|
!options['skip-logs'] &&
|
11
12
|
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing identifiers...`);
|
12
|
-
|
13
|
+
const progressLog = (0, progress_1.setupProgressLogger)({
|
14
|
+
total: constants.length,
|
15
|
+
});
|
16
|
+
constants.forEach(({ from, to }) => {
|
17
|
+
toArray(from).forEach((x) => replaceIdentifier({ from: x, to }));
|
18
|
+
!options['skip-logs'] &&
|
19
|
+
progressLog(toArray(from)
|
20
|
+
.map((x) => x.name)
|
21
|
+
.join(', '));
|
22
|
+
});
|
13
23
|
!options['skip-logs'] &&
|
14
24
|
(0, colored_log_1.successLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} identifiers replaced \n`);
|
15
25
|
}
|
16
26
|
exports.replaceIdentifiers = replaceIdentifiers;
|
17
27
|
function replaceIdentifier({ from, to }) {
|
18
|
-
const references = (
|
19
|
-
|
28
|
+
const references = toArray(from)
|
29
|
+
.map(({ name, moduleSpecifier }) => (0, get_named_import_references_1.getNamedImportReferences)(name, moduleSpecifier))
|
30
|
+
.flat();
|
31
|
+
references.forEach((ref) => {
|
32
|
+
var _a;
|
20
33
|
if (ref.wasForgotten()) {
|
21
34
|
return;
|
22
35
|
}
|
@@ -26,15 +39,24 @@ function replaceIdentifier({ from, to }) {
|
|
26
39
|
addImports(to, parent.getSourceFile().getFilePath());
|
27
40
|
}
|
28
41
|
else {
|
29
|
-
|
42
|
+
const decorator = ref.getParentWhile((node) => node.getKindName() !== 'Decorator');
|
43
|
+
const inModule = ((_a = decorator === null || decorator === void 0 ? void 0 : decorator.getFirstChildIfKind(ng_morph_1.ts.SyntaxKind.Identifier)) === null || _a === void 0 ? void 0 : _a.getText()) ===
|
44
|
+
'NgModule';
|
45
|
+
ref.replaceWithText(getReplacementText(to, !!inModule));
|
30
46
|
}
|
31
47
|
});
|
32
48
|
}
|
33
49
|
exports.replaceIdentifier = replaceIdentifier;
|
34
50
|
function addImports(identifier, filePath) {
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
51
|
+
toArray(identifier).forEach(({ name, namedImport, moduleSpecifier }) => {
|
52
|
+
(0, add_unique_import_1.addUniqueImport)(filePath, namedImport || name, moduleSpecifier);
|
53
|
+
});
|
54
|
+
}
|
55
|
+
function getReplacementText(to, inModule) {
|
56
|
+
return toArray(to)
|
57
|
+
.map(({ name, spreadInModule }) => spreadInModule && inModule ? `...${name}` : name)
|
58
|
+
.join(', ');
|
59
|
+
}
|
60
|
+
function toArray(x) {
|
61
|
+
return Array.isArray(x) ? x : [x];
|
40
62
|
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.replacePackageName = void 0;
|
4
|
+
const ng_morph_1 = require("ng-morph");
|
5
|
+
const constants_1 = require("../../constants");
|
6
|
+
const get_file_system_1 = require("../utils/get-file-system");
|
7
|
+
const replace_text_1 = require("../utils/replace-text");
|
8
|
+
function replacePackageName(oldPackage, newPackage, tree) {
|
9
|
+
const fileSystem = (0, get_file_system_1.getFileSystem)(tree);
|
10
|
+
(0, replace_text_1.replaceText)([{ from: oldPackage, to: newPackage.name }], constants_1.ALL_TS_FILES);
|
11
|
+
if ((0, ng_morph_1.getPackageJsonDependency)(tree, oldPackage)) {
|
12
|
+
(0, ng_morph_1.removePackageJsonDependency)(tree, oldPackage);
|
13
|
+
(0, ng_morph_1.addPackageJsonDependency)(tree, newPackage);
|
14
|
+
}
|
15
|
+
fileSystem.commitEdits();
|
16
|
+
(0, ng_morph_1.saveActiveProject)();
|
17
|
+
}
|
18
|
+
exports.replacePackageName = replacePackageName;
|
@@ -10,7 +10,7 @@ function replaceService({ from, to, replaceMethods }, options) {
|
|
10
10
|
!options['skip-logs'] &&
|
11
11
|
(0, colored_log_1.processLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}replacing ${from.name}...`);
|
12
12
|
const references = (0, get_named_import_references_1.getNamedImportReferences)(from.name, from.moduleSpecifier);
|
13
|
-
references.forEach(ref => {
|
13
|
+
references.forEach((ref) => {
|
14
14
|
if (ref.wasForgotten()) {
|
15
15
|
return;
|
16
16
|
}
|
@@ -29,7 +29,7 @@ function replaceService({ from, to, replaceMethods }, options) {
|
|
29
29
|
function replaceProperties(parent, replaceProperties) {
|
30
30
|
const statement = parent.getParent();
|
31
31
|
const identifier = statement.getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier)[0];
|
32
|
-
identifier === null || identifier === void 0 ? void 0 : identifier.findReferencesAsNodes().forEach(ref => {
|
32
|
+
identifier === null || identifier === void 0 ? void 0 : identifier.findReferencesAsNodes().forEach((ref) => {
|
33
33
|
let parent = ref.getParent();
|
34
34
|
if ((ng_morph_1.Node.isPropertyAccessExpression(parent) &&
|
35
35
|
parent.getText().startsWith('this.')) ||
|
@@ -43,8 +43,8 @@ function replaceProperties(parent, replaceProperties) {
|
|
43
43
|
}
|
44
44
|
function replaceProperty(node, properties) {
|
45
45
|
const identifiers = node.getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier);
|
46
|
-
identifiers.forEach(identifier => {
|
47
|
-
const property = properties === null || properties === void 0 ? void 0 : properties.find(property => property.from === identifier.getText());
|
46
|
+
identifiers.forEach((identifier) => {
|
47
|
+
const property = properties === null || properties === void 0 ? void 0 : properties.find((property) => property.from === identifier.getText());
|
48
48
|
if (property) {
|
49
49
|
identifier.replaceWithText(property.to);
|
50
50
|
}
|
@@ -53,7 +53,7 @@ function replaceProperty(node, properties) {
|
|
53
53
|
function replaceServices(options, services) {
|
54
54
|
!options['skip-logs'] &&
|
55
55
|
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing services...`);
|
56
|
-
services.forEach(service => replaceService(service, options));
|
56
|
+
services.forEach((service) => replaceService(service, options));
|
57
57
|
!options['skip-logs'] &&
|
58
58
|
(0, colored_log_1.successLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} services replaced \n`);
|
59
59
|
}
|
@@ -8,14 +8,14 @@ function showWarning({ name, message, moduleSpecifier = '**/**' }, { logger }) {
|
|
8
8
|
moduleSpecifier,
|
9
9
|
namedImports: [name],
|
10
10
|
})
|
11
|
-
.map(i => {
|
11
|
+
.map((i) => {
|
12
12
|
var _a;
|
13
13
|
return (_a = i
|
14
14
|
.getNamedImports()
|
15
|
-
.find(namedImport => namedImport.getName() === name)) === null || _a === void 0 ? void 0 : _a.getNameNode();
|
15
|
+
.find((namedImport) => namedImport.getName() === name)) === null || _a === void 0 ? void 0 : _a.getNameNode();
|
16
16
|
})
|
17
17
|
.filter((namedImport) => Boolean(namedImport));
|
18
|
-
const referencesMeta = references.map(ref => {
|
18
|
+
const referencesMeta = references.map((ref) => {
|
19
19
|
const sourceFile = ref.getSourceFile();
|
20
20
|
return {
|
21
21
|
sourceFile,
|
@@ -34,6 +34,6 @@ function showWarning({ name, message, moduleSpecifier = '**/**' }, { logger }) {
|
|
34
34
|
});
|
35
35
|
}
|
36
36
|
function showWarnings(context, warnings) {
|
37
|
-
warnings.forEach(warning => showWarning(warning, context));
|
37
|
+
warnings.forEach((warning) => showWarning(warning, context));
|
38
38
|
}
|
39
39
|
exports.showWarnings = showWarnings;
|
@@ -5,7 +5,7 @@ const ng_morph_1 = require("ng-morph");
|
|
5
5
|
const constants_1 = require("../../constants");
|
6
6
|
function replaceText(replaceable, pattern = constants_1.ALL_FILES) {
|
7
7
|
const sourceFiles = (0, ng_morph_1.getSourceFiles)(pattern);
|
8
|
-
sourceFiles.forEach(file => {
|
8
|
+
sourceFiles.forEach((file) => {
|
9
9
|
let text = file.getFullText();
|
10
10
|
replaceable.forEach(({ from, to }) => {
|
11
11
|
const regexp = new RegExp(from, 'g');
|
@@ -1,30 +1,59 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.replaceAttrValues = void 0;
|
4
|
+
const add_import_to_closest_module_1 = require("../../../utils/add-import-to-closest-module");
|
4
5
|
const elements_1 = require("../../../utils/templates/elements");
|
5
6
|
const template_resource_1 = require("../../../utils/templates/template-resource");
|
6
7
|
function replaceAttrValues({ resource, recorder, fileSystem, data, }) {
|
7
8
|
const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem);
|
8
9
|
const templateOffset = (0, template_resource_1.getTemplateOffset)(resource);
|
9
|
-
data.forEach(({ attrNames,
|
10
|
+
data.forEach(({ attrNames, valueReplacer, withTagNames, filterFn, newAttrName, directiveModule, }) => {
|
10
11
|
const elements = [
|
11
12
|
...(0, elements_1.findElementsWithAttributeOnTag)(template, attrNames, withTagNames, filterFn),
|
12
13
|
];
|
13
|
-
elements.forEach(element => {
|
14
|
-
const { name, value } = element.attrs.find(attr => attrNames.map(name => name.toLowerCase()).includes(attr.name)) || {};
|
14
|
+
elements.forEach((element) => {
|
15
|
+
const { name, value } = element.attrs.find((attr) => attrNames.map((name) => name.toLowerCase()).includes(attr.name)) || {};
|
15
16
|
if (!name || !value) {
|
16
17
|
return;
|
17
18
|
}
|
18
|
-
const attributeName = attrNames.find(attrName => attrName.toLowerCase() === name);
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
19
|
+
const attributeName = attrNames.find((attrName) => attrName.toLowerCase() === name) || '';
|
20
|
+
if (Array.isArray(valueReplacer)) {
|
21
|
+
valueReplacer.forEach(({ from, to }) => {
|
22
|
+
if (value === from) {
|
23
|
+
replaceValue({
|
24
|
+
element,
|
25
|
+
recorder,
|
26
|
+
templateOffset,
|
27
|
+
attrName: name,
|
28
|
+
attrNewName: newAttrName || attributeName,
|
29
|
+
attrValue: to,
|
30
|
+
});
|
31
|
+
}
|
32
|
+
});
|
33
|
+
}
|
34
|
+
else {
|
35
|
+
replaceValue({
|
36
|
+
element,
|
37
|
+
recorder,
|
38
|
+
templateOffset,
|
39
|
+
attrName: name,
|
40
|
+
attrNewName: newAttrName || attributeName,
|
41
|
+
attrValue: valueReplacer(value),
|
42
|
+
});
|
43
|
+
}
|
44
|
+
if (directiveModule) {
|
45
|
+
(0, add_import_to_closest_module_1.addImportToClosestModule)(resource.componentPath, directiveModule.name, directiveModule.moduleSpecifier);
|
46
|
+
}
|
27
47
|
});
|
28
48
|
});
|
29
49
|
}
|
30
50
|
exports.replaceAttrValues = replaceAttrValues;
|
51
|
+
function replaceValue({ element, recorder, templateOffset, attrName, attrNewName, attrValue, }) {
|
52
|
+
var _a, _b;
|
53
|
+
const { startOffset, endOffset } = ((_b = (_a = element.sourceCodeLocation) === null || _a === void 0 ? void 0 : _a.attrs) === null || _b === void 0 ? void 0 : _b[attrName]) || {
|
54
|
+
startOffset: 0,
|
55
|
+
endOffset: 0,
|
56
|
+
};
|
57
|
+
recorder.remove(templateOffset + startOffset, endOffset - startOffset);
|
58
|
+
recorder.insertRight(templateOffset + startOffset, `${attrNewName}="${attrValue}"`);
|
59
|
+
}
|
@@ -11,7 +11,7 @@ function replaceAttrs({ resource, recorder, fileSystem, data, }) {
|
|
11
11
|
...(0, elements_1.findAttributeOnElementWithTag)(template, from.attrName, from.withTagNames || [], from.filterFn),
|
12
12
|
...(0, elements_1.findAttributeOnElementWithAttrs)(template, from.attrName, from.withAttrsNames || [], from.filterFn),
|
13
13
|
];
|
14
|
-
offsets.forEach(offset => {
|
14
|
+
offsets.forEach((offset) => {
|
15
15
|
recorder.remove(offset + templateOffset, from.attrName.length);
|
16
16
|
recorder.insertRight(offset + templateOffset, to.attrName);
|
17
17
|
});
|
@@ -7,12 +7,20 @@ const template_resource_1 = require("../../../utils/templates/template-resource"
|
|
7
7
|
function addHTMLCommentTags({ resource, recorder, fileSystem, data, }) {
|
8
8
|
const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem);
|
9
9
|
const templateOffset = (0, template_resource_1.getTemplateOffset)(resource);
|
10
|
-
data.forEach(({ comment, tag, withAttrs }) => {
|
10
|
+
data.forEach(({ comment, tag, withAttrs, pattern }) => {
|
11
|
+
if (pattern && template.match(pattern)) {
|
12
|
+
recorder.insertRight(templateOffset && templateOffset + 1, `<!-- ${insert_todo_1.TODO_MARK} ${comment} -->\n`);
|
13
|
+
}
|
14
|
+
if (!tag || !withAttrs) {
|
15
|
+
return;
|
16
|
+
}
|
11
17
|
const elementStartOffsets = [
|
12
18
|
...(0, elements_1.findElementsWithAttributeOnTag)(template, withAttrs, [tag]),
|
13
|
-
...(
|
19
|
+
...(withAttrs.length
|
20
|
+
? (0, elements_1.findElementsWithAttributeOnTag)(template, withAttrs.map((attr) => `[${attr}]`), [tag])
|
21
|
+
: []),
|
14
22
|
].map(({ sourceCodeLocation }) => ((sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.startOffset) || 0) + templateOffset);
|
15
|
-
elementStartOffsets.forEach(offset => {
|
23
|
+
elementStartOffsets.forEach((offset) => {
|
16
24
|
recorder.insertLeft(offset, `<!-- ${insert_todo_1.TODO_MARK} ${comment} -->\n`);
|
17
25
|
});
|
18
26
|
});
|
@@ -9,29 +9,42 @@ const versions_1 = require("../../ng-add/constants/versions");
|
|
9
9
|
const colored_log_1 = require("../../utils/colored-log");
|
10
10
|
const get_execution_time_1 = require("../../utils/get-execution-time");
|
11
11
|
const steps_1 = require("../steps");
|
12
|
+
const replace_services_1 = require("../steps/replace-services");
|
12
13
|
const get_file_system_1 = require("../utils/get-file-system");
|
13
14
|
const enums_1 = require("../v4/steps/constants/enums");
|
14
15
|
const steps_2 = require("./steps");
|
15
16
|
const constants_1 = require("./steps/constants");
|
16
|
-
const
|
17
|
-
const
|
18
|
-
const
|
17
|
+
const modules_to_replace_1 = require("./steps/constants/modules-to-replace");
|
18
|
+
const types_1 = require("./steps/constants/types");
|
19
|
+
const migrate_root_1 = require("./steps/migrate-root");
|
20
|
+
const replace_modules_with_providers_1 = require("./steps/utils/replace-modules-with-providers");
|
19
21
|
function main(options) {
|
20
22
|
return (tree, context) => {
|
21
23
|
const fileSystem = (0, get_file_system_1.getFileSystem)(tree);
|
24
|
+
(0, steps_1.replaceEnums)(options, enums_1.ENUMS_TO_REPLACE);
|
25
|
+
(0, migrate_root_1.migrateRoot)(fileSystem, options);
|
26
|
+
(0, replace_services_1.replaceServices)(options, constants_1.SERVICES_TO_REPLACE);
|
22
27
|
(0, steps_1.replaceIdentifiers)(options, constants_1.IDENTIFIERS_TO_REPLACE);
|
23
28
|
(0, steps_1.removeModules)(options, constants_1.MODULES_TO_REMOVE);
|
29
|
+
(0, replace_modules_with_providers_1.replaceModulesWithProviders)(options, modules_to_replace_1.MODULES_TO_REPLACE_WITH_PROVIDERS);
|
30
|
+
(0, steps_1.renameTypes)(options, types_1.TYPES_TO_RENAME);
|
24
31
|
(0, steps_2.restoreTuiMapper)(options);
|
25
32
|
(0, steps_2.restoreTuiMatcher)(options);
|
26
33
|
(0, steps_2.migrateLegacyMask)(options);
|
27
34
|
(0, steps_2.migrateDestroyService)(options);
|
28
|
-
(0,
|
35
|
+
(0, steps_2.migrateOptionProviders)(options);
|
29
36
|
(0, steps_2.migrateAllCountryIsoCodes)(options);
|
30
|
-
(0,
|
37
|
+
(0, steps_2.migrateAlertService)(options);
|
38
|
+
(0, steps_2.migrateNumberFormatSettings)(options);
|
39
|
+
(0, steps_2.migrateMonthContext)(options);
|
40
|
+
(0, ng_morph_1.saveActiveProject)();
|
31
41
|
(0, steps_2.migrateTemplates)(fileSystem, options);
|
32
|
-
(0, migrate_styles_1.migrateStyles)();
|
33
42
|
(0, steps_1.showWarnings)(context, constants_1.MIGRATION_WARNINGS);
|
34
|
-
|
43
|
+
fileSystem.commitEdits();
|
44
|
+
(0, ng_morph_1.saveActiveProject)();
|
45
|
+
(0, steps_2.migrateStyles)();
|
46
|
+
(0, steps_2.migrateProprietary)(fileSystem, options);
|
47
|
+
(0, steps_2.updatePackages)(fileSystem, options);
|
35
48
|
fileSystem.commitEdits();
|
36
49
|
(0, ng_morph_1.saveActiveProject)();
|
37
50
|
context.addTask(new tasks_1.NodePackageInstallTask());
|
@@ -55,8 +55,6 @@ export declare const DEPRECATED_VARS: {
|
|
55
55
|
'--tui-positive-hover': string;
|
56
56
|
'--tui-negative': string;
|
57
57
|
'--tui-negative-hover': string;
|
58
|
-
'--tui-support-': string;
|
59
|
-
'--tui-chart-': string;
|
60
58
|
'--tui-clear-inverse': string;
|
61
59
|
'--tui-clear-inverse-hover': string;
|
62
60
|
'--tui-clear-inverse-active': string;
|
@@ -84,6 +82,17 @@ export declare const DEPRECATED_VARS: {
|
|
84
82
|
'--tui-positive-night-hover': string;
|
85
83
|
'--tui-negative-night': string;
|
86
84
|
'--tui-negative-night-hover': string;
|
85
|
+
'--tui-shadow': string;
|
86
|
+
'--tui-shadow-hover': string;
|
87
|
+
'--tui-shadow-dropdown': string;
|
88
|
+
'--tui-shadow-modal': string;
|
89
|
+
'--tui-shadow-sidebar': string;
|
90
|
+
'--tui-shadow-navigation': string;
|
91
|
+
'--tui-shadow-sheet': string;
|
92
|
+
};
|
93
|
+
export declare const DEPRECATED_NUMERIC_VARS: {
|
94
|
+
'--tui-chart-': string;
|
95
|
+
'--tui-support-': string;
|
87
96
|
};
|
88
97
|
export declare const NIGHT_VAR_COMMENT = "TODO: use tuiTheme=\"dark\" on an element to switch colors to dark theme";
|
89
98
|
export declare const DEPRECATE_VARS_WITH_COMMENT: string[];
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.DEPRECATE_VARS_WITH_COMMENT = exports.NIGHT_VAR_COMMENT = exports.DEPRECATED_VARS = void 0;
|
3
|
+
exports.DEPRECATE_VARS_WITH_COMMENT = exports.NIGHT_VAR_COMMENT = exports.DEPRECATED_NUMERIC_VARS = exports.DEPRECATED_VARS = void 0;
|
4
4
|
exports.DEPRECATED_VARS = {
|
5
5
|
'--tui-font-text-l-2': '--tui-font-text-ui-l',
|
6
6
|
'--tui-font-text-m-2': '--tui-font-text-ui-m',
|
@@ -26,7 +26,7 @@ exports.DEPRECATED_VARS = {
|
|
26
26
|
'--tui-accent-hover': '--tui-background-accent-2-hover',
|
27
27
|
'--tui-accent-active': '--tui-background-accent-2-pressed',
|
28
28
|
'--tui-accent-text': '--tui-text-primary-on-accent-2',
|
29
|
-
'--tui-selection': '--tui-service-
|
29
|
+
'--tui-selection': '--tui-service-selection-background',
|
30
30
|
'--tui-focus': '--tui-border-focus',
|
31
31
|
'--tui-clear': '--tui-background-neutral-1',
|
32
32
|
'--tui-clear-disabled': '--tui-background-neutral-1',
|
@@ -54,12 +54,10 @@ exports.DEPRECATED_VARS = {
|
|
54
54
|
'--tui-text-03': '--tui-text-tertiary',
|
55
55
|
'--tui-link': '--tui-text-action',
|
56
56
|
'--tui-link-hover': '--tui-text-action-hover',
|
57
|
-
'--tui-positive': '--tui-
|
58
|
-
'--tui-positive-hover': '--tui-
|
59
|
-
'--tui-negative': '--tui-
|
60
|
-
'--tui-negative-hover': '--tui-
|
61
|
-
'--tui-support-': '--tui-chart-categorical-',
|
62
|
-
'--tui-chart-': '--tui-chart-categorical-0',
|
57
|
+
'--tui-positive': '--tui-text-positive',
|
58
|
+
'--tui-positive-hover': '--tui-text-positive-hover',
|
59
|
+
'--tui-negative': '--tui-text-negative',
|
60
|
+
'--tui-negative-hover': '--tui-text-negative-hover',
|
63
61
|
'--tui-clear-inverse': '--tui-background-neutral-1',
|
64
62
|
'--tui-clear-inverse-hover': '--tui-background-neutral-1-hover',
|
65
63
|
'--tui-clear-inverse-active': '--tui-background-neutral-1-pressed',
|
@@ -87,6 +85,18 @@ exports.DEPRECATED_VARS = {
|
|
87
85
|
'--tui-positive-night-hover': '--tui-status-positive',
|
88
86
|
'--tui-negative-night': '--tui-status-negative',
|
89
87
|
'--tui-negative-night-hover': '--tui-status-negative',
|
88
|
+
'--tui-shadow': 'var(--tui-shadow-small)',
|
89
|
+
'--tui-shadow-hover': 'var(--tui-shadow-small-hover)',
|
90
|
+
'--tui-shadow-dropdown': 'var(--tui-shadow-medium)',
|
91
|
+
'--tui-shadow-modal': 'var(--tui-shadow-popup)',
|
92
|
+
'--tui-shadow-sidebar': 'var(--tui-shadow-medium)',
|
93
|
+
'--tui-shadow-navigation': 'var(--tui-shadow-small)',
|
94
|
+
'--tui-shadow-sheet': 'var(--tui-shadow-popup)',
|
95
|
+
};
|
96
|
+
// warning: order is important
|
97
|
+
exports.DEPRECATED_NUMERIC_VARS = {
|
98
|
+
'--tui-chart-': '--tui-chart-categorical-0',
|
99
|
+
'--tui-support-': '--tui-chart-categorical-',
|
90
100
|
};
|
91
101
|
exports.NIGHT_VAR_COMMENT = 'TODO: use tuiTheme="dark" on an element to switch colors to dark theme';
|
92
102
|
exports.DEPRECATE_VARS_WITH_COMMENT = [
|
@@ -7,11 +7,11 @@ const constants_1 = require("../../../constants");
|
|
7
7
|
const palette_1 = require("./palette");
|
8
8
|
function renameCssVars(pattern = constants_1.ALL_FILES) {
|
9
9
|
const sourceFiles = (0, ng_morph_1.getSourceFiles)(pattern);
|
10
|
-
sourceFiles.forEach(file => {
|
10
|
+
sourceFiles.forEach((file) => {
|
11
11
|
let text = file.getFullText();
|
12
12
|
// leave comments
|
13
13
|
if (!file.getFilePath().endsWith('html')) {
|
14
|
-
palette_1.DEPRECATE_VARS_WITH_COMMENT.forEach(variable => {
|
14
|
+
palette_1.DEPRECATE_VARS_WITH_COMMENT.forEach((variable) => {
|
15
15
|
const wordRegex = new RegExp(`(^|\\n)(?=[^\\n]*\\b${variable}\\b)`, 'g');
|
16
16
|
text = text.replaceAll(wordRegex, `$1// ${palette_1.NIGHT_VAR_COMMENT}\n`);
|
17
17
|
});
|
@@ -25,6 +25,14 @@ function renameCssVars(pattern = constants_1.ALL_FILES) {
|
|
25
25
|
.forEach(({ from, to }) => {
|
26
26
|
text = text.replaceAll(from, to);
|
27
27
|
});
|
28
|
+
Object.entries(palette_1.DEPRECATED_NUMERIC_VARS)
|
29
|
+
.map(([from, to]) => ({
|
30
|
+
from: new RegExp(`${from}`, 'g'),
|
31
|
+
to,
|
32
|
+
}))
|
33
|
+
.forEach(({ from, to }) => {
|
34
|
+
text = text.replaceAll(from, to);
|
35
|
+
});
|
28
36
|
file.replaceWithText(text);
|
29
37
|
});
|
30
38
|
}
|
@@ -6,17 +6,19 @@ const ng_morph_1 = require("ng-morph");
|
|
6
6
|
const colored_log_1 = require("../../../utils/colored-log");
|
7
7
|
const get_file_system_1 = require("../../utils/get-file-system");
|
8
8
|
const rename_icons_1 = require("./rename-icons");
|
9
|
+
const rename_proprietary_icons_1 = require("./rename-proprietary-icons");
|
9
10
|
function migrateIcons(options) {
|
10
11
|
return (0, schematics_1.chain)([
|
11
|
-
(tree,
|
12
|
-
if (hasProprietaryIcons(tree)) {
|
13
|
-
// TODO: add proprietary-icons migration
|
14
|
-
return;
|
15
|
-
}
|
12
|
+
(tree, context) => {
|
16
13
|
const fileSystem = (0, get_file_system_1.getFileSystem)(tree);
|
17
14
|
!options['skip-logs'] &&
|
18
|
-
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing
|
19
|
-
|
15
|
+
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing icons...`);
|
16
|
+
if (hasProprietaryIcons(tree)) {
|
17
|
+
(0, rename_proprietary_icons_1.renameProprietaryIcons)(context);
|
18
|
+
}
|
19
|
+
else {
|
20
|
+
(0, rename_icons_1.renameIcons)();
|
21
|
+
}
|
20
22
|
fileSystem.commitEdits();
|
21
23
|
(0, ng_morph_1.saveActiveProject)();
|
22
24
|
!options['skip-logs'] &&
|