@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
@@ -9,4 +9,5 @@ tslib_1.__exportStar(require("./identifiers-to-replace"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./inputs-to-remove"), exports);
|
10
10
|
tslib_1.__exportStar(require("./migration-warnings"), exports);
|
11
11
|
tslib_1.__exportStar(require("./modules-to-remove"), exports);
|
12
|
+
tslib_1.__exportStar(require("./services"), exports);
|
12
13
|
tslib_1.__exportStar(require("./tags-to-replace"), exports);
|
@@ -7,9 +7,10 @@ exports.INPUTS_TO_REMOVE = [
|
|
7
7
|
{ inputName: 'showLoader', tags: ['tui-toggle'] },
|
8
8
|
{ inputName: 'singleColor', tags: ['tui-toggle'] },
|
9
9
|
{ inputName: 'hoverable', tags: ['tui-badge'] },
|
10
|
+
{ inputName: 'singleColor', tags: ['tui-money'] },
|
10
11
|
{
|
11
12
|
inputName: 'iconAlign',
|
12
13
|
tags: ['button', 'a'],
|
13
|
-
filterFn: el => (0, elements_1.hasElementAttribute)(el, 'tuiLink'),
|
14
|
+
filterFn: (el) => (0, elements_1.hasElementAttribute)(el, 'tuiLink'),
|
14
15
|
},
|
15
16
|
];
|
@@ -142,4 +142,29 @@ exports.MIGRATION_WARNINGS = [
|
|
142
142
|
moduleSpecifier: '@taiga-ui/kit',
|
143
143
|
message: 'TUI_INPUT_NUMBER_OPTIONS "precision" and "decimal" have been moved to TUI_FORMAT_NUMBER_OPTIONS. See https://taiga-ui.dev/components/input-number#options ',
|
144
144
|
},
|
145
|
+
{
|
146
|
+
name: 'TUI_ARROW',
|
147
|
+
moduleSpecifier: '@taiga-ui/kit',
|
148
|
+
message: 'TUI_ARROW is deprecated, Use tuiChevron directive instead. See example https://taiga-ui.dev/components/data-list#links',
|
149
|
+
},
|
150
|
+
{
|
151
|
+
name: 'TuiMoneyComponent',
|
152
|
+
moduleSpecifier: '@taiga-ui/addon-commerce',
|
153
|
+
message: 'TuiMoneyComponent is deprecated, Use tuiAmount pipe instead. See example https://taiga-ui.dev/pipes/amount',
|
154
|
+
},
|
155
|
+
{
|
156
|
+
name: 'TuiIllustrationsModule',
|
157
|
+
moduleSpecifier: '@taiga-ui/proprietary-icons',
|
158
|
+
message: 'TuiIllustrationsModule was deleted. Import TuiIconPipe and use <img [src]="icon | tuiIcon" /> instead. See https://taiga-ui.tcsbank.ru/icons',
|
159
|
+
},
|
160
|
+
{
|
161
|
+
name: 'TuiIllustrationsPipe',
|
162
|
+
moduleSpecifier: '@taiga-ui/proprietary-icons',
|
163
|
+
message: 'TuiIllustrationsPipe was deleted. Import TuiIconPipe and use <img [src]="icon | tuiIcon" /> instead. See https://taiga-ui.tcsbank.ru/icons',
|
164
|
+
},
|
165
|
+
{
|
166
|
+
name: 'TuiIllustrationModePipe',
|
167
|
+
moduleSpecifier: '@taiga-ui/proprietary-icons',
|
168
|
+
message: 'TuiIllustrationModePipe was deleted. Import TuiIconPipe and use <img [src]="icon | tuiIcon" /> instead. See https://taiga-ui.tcsbank.ru/icons',
|
169
|
+
},
|
145
170
|
];
|
@@ -14,4 +14,36 @@ exports.MODULES_TO_REMOVE = [
|
|
14
14
|
name: 'TuiFocusableModule',
|
15
15
|
moduleSpecifier: '@taiga-ui/cdk',
|
16
16
|
},
|
17
|
+
{
|
18
|
+
name: 'TuiPromptDialogModule',
|
19
|
+
moduleSpecifier: '@taiga-ui/proprietary-core',
|
20
|
+
},
|
21
|
+
{
|
22
|
+
name: 'TuiPromptModule',
|
23
|
+
moduleSpecifier: '@taiga-ui/kit',
|
24
|
+
},
|
25
|
+
{
|
26
|
+
name: 'TuiThemeTinkoff2023NightModule',
|
27
|
+
moduleSpecifier: '@taiga-ui/proprietary-core',
|
28
|
+
},
|
29
|
+
{
|
30
|
+
name: 'TuiOverscrollModule',
|
31
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
32
|
+
},
|
33
|
+
{
|
34
|
+
name: 'TuiThemeNightModule',
|
35
|
+
moduleSpecifier: '@taiga-ui/core',
|
36
|
+
},
|
37
|
+
{
|
38
|
+
name: 'TuiModeModule',
|
39
|
+
moduleSpecifier: '@taiga-ui/core',
|
40
|
+
},
|
41
|
+
{
|
42
|
+
name: 'TuiIconsModule',
|
43
|
+
moduleSpecifier: '@taiga-ui/experimental',
|
44
|
+
},
|
45
|
+
{
|
46
|
+
name: 'TuiMobileTabsModule',
|
47
|
+
moduleSpecifier: '@taiga-ui/addon-mobile',
|
48
|
+
},
|
17
49
|
];
|
@@ -0,0 +1,13 @@
|
|
1
|
+
export interface ProviderToReplace {
|
2
|
+
name: string;
|
3
|
+
providerSpecifier: string;
|
4
|
+
isFunction?: boolean;
|
5
|
+
}
|
6
|
+
export interface ModuleToReplace {
|
7
|
+
from: {
|
8
|
+
name: string;
|
9
|
+
moduleSpecifier: string;
|
10
|
+
};
|
11
|
+
to: ProviderToReplace | ProviderToReplace[];
|
12
|
+
}
|
13
|
+
export declare const MODULES_TO_REPLACE_WITH_PROVIDERS: ModuleToReplace[];
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.MODULES_TO_REPLACE_WITH_PROVIDERS = void 0;
|
4
|
+
exports.MODULES_TO_REPLACE_WITH_PROVIDERS = [
|
5
|
+
{
|
6
|
+
from: {
|
7
|
+
name: 'TuiMobileCalendarDialogModule',
|
8
|
+
moduleSpecifier: '@taiga-ui/addon-mobile',
|
9
|
+
},
|
10
|
+
to: {
|
11
|
+
name: 'tuiProvideMobileCalendar',
|
12
|
+
providerSpecifier: '@taiga-ui/addon-mobile',
|
13
|
+
isFunction: true,
|
14
|
+
},
|
15
|
+
},
|
16
|
+
];
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.SERVICES_TO_REPLACE = void 0;
|
4
|
+
exports.SERVICES_TO_REPLACE = [
|
5
|
+
{
|
6
|
+
from: { name: 'TuiDialogFormService', moduleSpecifier: '@taiga-ui/kit' },
|
7
|
+
to: { name: 'TuiConfirmService', moduleSpecifier: '@taiga-ui/kit' },
|
8
|
+
replaceMethods: [
|
9
|
+
{
|
10
|
+
from: 'withPrompt',
|
11
|
+
to: 'withConfirm',
|
12
|
+
},
|
13
|
+
],
|
14
|
+
},
|
15
|
+
];
|
@@ -1,20 +1,22 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.TAGS_TO_REPLACE = void 0;
|
4
|
+
const elements_1 = require("../../../../utils/templates/elements");
|
4
5
|
exports.TAGS_TO_REPLACE = [
|
5
6
|
{ from: 'tui-card', to: 'tui-thumbnail-card' },
|
6
7
|
{ from: 'tui-text-area', to: 'tui-textarea' },
|
8
|
+
{ from: 'tui-svg', to: 'tui-icon' },
|
7
9
|
{
|
8
10
|
from: 'tui-input-count',
|
9
11
|
to: 'tui-input-number',
|
10
12
|
addAttributes: ['decimal="never"'],
|
11
|
-
filterFn: element =>
|
13
|
+
filterFn: (element) => (0, elements_1.hasElementAttribute)(element, 'step'),
|
12
14
|
},
|
13
15
|
{
|
14
16
|
from: 'tui-input-count',
|
15
17
|
to: 'tui-input-number',
|
16
18
|
addAttributes: ['decimal="never"', '[step]="1"'],
|
17
|
-
filterFn: element =>
|
19
|
+
filterFn: (element) => !(0, elements_1.hasElementAttribute)(element, 'step'),
|
18
20
|
},
|
19
21
|
{
|
20
22
|
from: 'tui-money',
|
@@ -30,15 +32,25 @@ exports.TAGS_TO_REPLACE = [
|
|
30
32
|
to: 'input',
|
31
33
|
addAttributes: ['tuiRadio', 'type="radio"'],
|
32
34
|
},
|
35
|
+
{
|
36
|
+
from: 'tui-checkbox-block',
|
37
|
+
to: 'input',
|
38
|
+
addAttributes: ['tuiCheckbox', 'type="checkbox"'],
|
39
|
+
},
|
40
|
+
{
|
41
|
+
from: 'tui-radio-block',
|
42
|
+
to: 'input',
|
43
|
+
addAttributes: ['tuiRadio', 'type="radio"'],
|
44
|
+
},
|
33
45
|
{
|
34
46
|
from: 'tui-hosted-dropdown',
|
35
47
|
to: 'div',
|
36
|
-
filterFn: el => el.attrs.some(attr => attr.name === '[open]' || attr.name === '[(open)]'),
|
48
|
+
filterFn: (el) => el.attrs.some((attr) => attr.name === '[open]' || attr.name === '[(open)]'),
|
37
49
|
},
|
38
50
|
{
|
39
51
|
from: 'tui-hosted-dropdown',
|
40
52
|
to: 'div',
|
41
|
-
filterFn: el => el.attrs.every(attr => attr.name !== '[open]' && attr.name !== '[(open)]'),
|
53
|
+
filterFn: (el) => el.attrs.every((attr) => attr.name !== '[open]' && attr.name !== '[(open)]'),
|
42
54
|
addAttributes: ['tuiDropdownOpen'],
|
43
55
|
},
|
44
56
|
{
|
@@ -50,4 +62,5 @@ exports.TAGS_TO_REPLACE = [
|
|
50
62
|
from: 'tui-marker-icon',
|
51
63
|
to: 'tui-avatar',
|
52
64
|
},
|
65
|
+
{ from: 'tui-input-card-grouped', to: 'tui-input-card-group' },
|
53
66
|
];
|
@@ -0,0 +1,49 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.TYPES_TO_RENAME = void 0;
|
4
|
+
exports.TYPES_TO_RENAME = [
|
5
|
+
{
|
6
|
+
from: 'TuiDocExample',
|
7
|
+
to: 'Record<string, TuiRawLoaderContent>',
|
8
|
+
moduleSpecifier: ['@taiga-ui/addon-doc'],
|
9
|
+
removeImport: true,
|
10
|
+
newImports: [
|
11
|
+
{ name: 'TuiRawLoaderContent', moduleSpecifier: '@taiga-ui/addon-doc' },
|
12
|
+
],
|
13
|
+
},
|
14
|
+
{
|
15
|
+
from: 'TuiBrightness',
|
16
|
+
to: "'onDark' | 'onLight'",
|
17
|
+
moduleSpecifier: ['@taiga-ui/core'],
|
18
|
+
removeImport: true,
|
19
|
+
},
|
20
|
+
{
|
21
|
+
from: 'TuiIllustrationName',
|
22
|
+
moduleSpecifier: ['@taiga-ui/proprietary-icons'],
|
23
|
+
to: 'string',
|
24
|
+
removeImport: true,
|
25
|
+
},
|
26
|
+
{
|
27
|
+
from: 'TuiIllustrationCategory',
|
28
|
+
moduleSpecifier: ['@taiga-ui/proprietary-icons'],
|
29
|
+
to: 'string',
|
30
|
+
removeImport: true,
|
31
|
+
},
|
32
|
+
{
|
33
|
+
from: 'TuiNotificationT',
|
34
|
+
moduleSpecifier: ['@taiga-ui/core'],
|
35
|
+
to: 'string',
|
36
|
+
removeImport: true,
|
37
|
+
},
|
38
|
+
{
|
39
|
+
from: 'TuiMarkerIconMode',
|
40
|
+
moduleSpecifier: ['@taiga-ui/kit'],
|
41
|
+
to: 'string',
|
42
|
+
removeImport: true,
|
43
|
+
},
|
44
|
+
{
|
45
|
+
from: 'TuiOperationIcon',
|
46
|
+
moduleSpecifier: ['@taiga-ui/proprietary-banking'],
|
47
|
+
to: 'TuiFeedItemIcon',
|
48
|
+
},
|
49
|
+
];
|
@@ -1,6 +1,13 @@
|
|
1
|
+
export * from './migrate-alert-service';
|
1
2
|
export * from './migrate-all-country-iso-codes';
|
2
3
|
export * from './migrate-destroy-service';
|
3
4
|
export * from './migrate-legacy-mask';
|
5
|
+
export * from './migrate-month-context';
|
6
|
+
export * from './migrate-number-format-settings';
|
7
|
+
export * from './migrate-option-providers';
|
8
|
+
export * from './migrate-proprietary';
|
4
9
|
export * from './migrate-templates';
|
5
10
|
export * from './restore-tui-mapper';
|
6
11
|
export * from './restore-tui-matcher';
|
12
|
+
export * from './styles';
|
13
|
+
export * from './update-packages';
|
@@ -1,9 +1,16 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const tslib_1 = require("tslib");
|
4
|
+
tslib_1.__exportStar(require("./migrate-alert-service"), exports);
|
4
5
|
tslib_1.__exportStar(require("./migrate-all-country-iso-codes"), exports);
|
5
6
|
tslib_1.__exportStar(require("./migrate-destroy-service"), exports);
|
6
7
|
tslib_1.__exportStar(require("./migrate-legacy-mask"), exports);
|
8
|
+
tslib_1.__exportStar(require("./migrate-month-context"), exports);
|
9
|
+
tslib_1.__exportStar(require("./migrate-number-format-settings"), exports);
|
10
|
+
tslib_1.__exportStar(require("./migrate-option-providers"), exports);
|
11
|
+
tslib_1.__exportStar(require("./migrate-proprietary"), exports);
|
7
12
|
tslib_1.__exportStar(require("./migrate-templates"), exports);
|
8
13
|
tslib_1.__exportStar(require("./restore-tui-mapper"), exports);
|
9
14
|
tslib_1.__exportStar(require("./restore-tui-matcher"), exports);
|
15
|
+
tslib_1.__exportStar(require("./styles"), exports);
|
16
|
+
tslib_1.__exportStar(require("./update-packages"), exports);
|
@@ -0,0 +1,110 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.migrateAlertService = void 0;
|
4
|
+
const ng_morph_1 = require("ng-morph");
|
5
|
+
const colored_log_1 = require("../../../utils/colored-log");
|
6
|
+
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
7
|
+
const OPTIONS_MIGRATIONS = {
|
8
|
+
autoClose: (property) => {
|
9
|
+
const [propertyKey, propertyValue] = property.getText().split(/\s?:\s?/);
|
10
|
+
switch (propertyValue) {
|
11
|
+
case 'true':
|
12
|
+
return property.replaceWithText(`${propertyKey}: 3_000`);
|
13
|
+
case 'false':
|
14
|
+
return property.replaceWithText(`${propertyKey}: 0`);
|
15
|
+
default:
|
16
|
+
return null;
|
17
|
+
}
|
18
|
+
},
|
19
|
+
defaultAutoCloseTime: (property) => property.replaceWithText(property.getText().replace('defaultAutoCloseTime', 'autoClose')),
|
20
|
+
status: (property) => property.replaceWithText(property.getText().replace('status', 'appearance')),
|
21
|
+
hasCloseButton: (property) => property.replaceWithText(property.getText().replace('hasCloseButton', 'closeable')),
|
22
|
+
hasIcon: (property) => {
|
23
|
+
const [, propertyValue] = property.getText().split(/\s?:\s?/);
|
24
|
+
switch (propertyValue) {
|
25
|
+
case 'false':
|
26
|
+
return property.replaceWithText("icon: ''");
|
27
|
+
case 'true':
|
28
|
+
return property.remove();
|
29
|
+
default:
|
30
|
+
return property.replaceWithText(`// TODO: (Taiga UI migration) "hasIcon" is deleted. Use "icon: ''" to hide icon. Use "icon: TUI_NOTIFICATION_DEFAULT_OPTIONS['icon']" to show it.\n${property.getText()}`);
|
31
|
+
}
|
32
|
+
},
|
33
|
+
};
|
34
|
+
function migrateAlertService(options) {
|
35
|
+
!options['skip-logs'] &&
|
36
|
+
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing inject(TuiAlertService).open({autoClose: boolean})...`);
|
37
|
+
const alertServiceRefs = (0, get_named_import_references_1.getNamedImportReferences)('TuiAlertService', '@taiga-ui/core');
|
38
|
+
// inject(TuiAlertService).open(...)
|
39
|
+
const viaDirectInjects = alertServiceRefs.map((x) => x.getFirstAncestor((node) => node.isKind(ng_morph_1.SyntaxKind.CallExpression) &&
|
40
|
+
node.getFullText().includes('inject(TuiAlertService') &&
|
41
|
+
node.getFullText().includes('.open')));
|
42
|
+
// readonly alertService = inject(TuiAlertService);
|
43
|
+
const viaClassProperty = alertServiceRefs
|
44
|
+
.map((x) => {
|
45
|
+
var _a;
|
46
|
+
return (_a = x
|
47
|
+
.getFirstAncestorByKind(ng_morph_1.SyntaxKind.PropertyDeclaration)) === null || _a === void 0 ? void 0 : _a.findReferencesAsNodes();
|
48
|
+
})
|
49
|
+
.flat()
|
50
|
+
.map(toAlertServiceOpenCallExpression);
|
51
|
+
// constructor(private readonly legacyWayService: TuiAlertService) {}
|
52
|
+
const viaConstructorParam = alertServiceRefs
|
53
|
+
.map((x) => { var _a; return (_a = x.getFirstAncestorByKind(ng_morph_1.SyntaxKind.Parameter)) === null || _a === void 0 ? void 0 : _a.findReferencesAsNodes(); })
|
54
|
+
.flat()
|
55
|
+
.map(toAlertServiceOpenCallExpression);
|
56
|
+
const inlineAlertOptions = [
|
57
|
+
...viaDirectInjects,
|
58
|
+
...viaClassProperty,
|
59
|
+
...viaConstructorParam,
|
60
|
+
]
|
61
|
+
.map((callExpression) => {
|
62
|
+
if (!callExpression || callExpression.wasForgotten()) {
|
63
|
+
return;
|
64
|
+
}
|
65
|
+
const [, arg] = callExpression.getArguments();
|
66
|
+
return (arg === null || arg === void 0 ? void 0 : arg.isKind(ng_morph_1.SyntaxKind.PropertyAccessExpression))
|
67
|
+
? findOptionsInitializer(arg)
|
68
|
+
: arg;
|
69
|
+
})
|
70
|
+
.filter(ng_morph_1.Node.isObjectLiteralExpression);
|
71
|
+
const standaloneAlertOptions = (0, get_named_import_references_1.getNamedImportReferences)('TuiAlertOptions', '@taiga-ui/core')
|
72
|
+
.map((n) => {
|
73
|
+
const type = n.getFirstAncestorByKind(ng_morph_1.SyntaxKind.TypeReference);
|
74
|
+
const siblings = [
|
75
|
+
...((type === null || type === void 0 ? void 0 : type.getPreviousSiblings()) || []),
|
76
|
+
...((type === null || type === void 0 ? void 0 : type.getNextSiblings()) || []),
|
77
|
+
];
|
78
|
+
return siblings.find(ng_morph_1.Node.isObjectLiteralExpression);
|
79
|
+
})
|
80
|
+
.filter((x) => !!x);
|
81
|
+
[...inlineAlertOptions, ...standaloneAlertOptions].forEach((options) => {
|
82
|
+
Object.entries(OPTIONS_MIGRATIONS).forEach(([propertyName, migration]) => {
|
83
|
+
const property = options.getProperty(propertyName);
|
84
|
+
if (!property) {
|
85
|
+
return;
|
86
|
+
}
|
87
|
+
const isShorthandPropertyAssignment = ng_morph_1.Node.isShorthandPropertyAssignment(property) &&
|
88
|
+
!property.hasObjectAssignmentInitializer();
|
89
|
+
const previousPropertyText = property.getText();
|
90
|
+
migration(property);
|
91
|
+
if (isShorthandPropertyAssignment && !property.wasForgotten()) {
|
92
|
+
property.replaceWithText(`${property.getText()}: ${previousPropertyText}`);
|
93
|
+
}
|
94
|
+
});
|
95
|
+
});
|
96
|
+
!options['skip-logs'] &&
|
97
|
+
(0, colored_log_1.successLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} "true => 3_000" & "false => 0" were replaced \n`);
|
98
|
+
}
|
99
|
+
exports.migrateAlertService = migrateAlertService;
|
100
|
+
function toAlertServiceOpenCallExpression(node) {
|
101
|
+
return node === null || node === void 0 ? void 0 : node.getFirstAncestor((x) => x.isKind(ng_morph_1.SyntaxKind.CallExpression) && x.getFullText().includes('.open'));
|
102
|
+
}
|
103
|
+
function findOptionsInitializer(ref) {
|
104
|
+
var _a;
|
105
|
+
return (_a = ref === null || ref === void 0 ? void 0 : ref.getFirstChildByKind(ng_morph_1.SyntaxKind.Identifier)) === null || _a === void 0 ? void 0 : _a.findReferencesAsNodes().map((n) => {
|
106
|
+
var _a;
|
107
|
+
return (_a = n
|
108
|
+
.getFirstAncestorByKind(ng_morph_1.SyntaxKind.PropertyDeclaration)) === null || _a === void 0 ? void 0 : _a.getFirstChildByKind(ng_morph_1.SyntaxKind.ObjectLiteralExpression);
|
109
|
+
}).find(Boolean);
|
110
|
+
}
|
@@ -9,7 +9,7 @@ function migrateAllCountryIsoCodes(options) {
|
|
9
9
|
!options['skip-logs'] &&
|
10
10
|
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating Object.values(TuiCountryIsoCode)...`);
|
11
11
|
const references = (0, get_named_import_references_1.getNamedImportReferences)('TuiCountryIsoCode', '@taiga-ui/i18n');
|
12
|
-
references.forEach(ref => {
|
12
|
+
references.forEach((ref) => {
|
13
13
|
if (ref.wasForgotten()) {
|
14
14
|
return;
|
15
15
|
}
|
@@ -12,7 +12,7 @@ function migrateDestroyService(options) {
|
|
12
12
|
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating TuiDestroyService => takeUntilDestroyed ...`);
|
13
13
|
const references = (0, get_named_import_references_1.getNamedImportReferences)('TuiDestroyService', '@taiga-ui/cdk');
|
14
14
|
const nodesForComments = [];
|
15
|
-
references.forEach(ref => {
|
15
|
+
references.forEach((ref) => {
|
16
16
|
var _a;
|
17
17
|
if (ref.wasForgotten()) {
|
18
18
|
return;
|
@@ -30,7 +30,7 @@ function migrateDestroyService(options) {
|
|
30
30
|
// providers: [TuiDestroyService]
|
31
31
|
const index = parent
|
32
32
|
.getElements()
|
33
|
-
.findIndex(el => el.getText() === 'TuiDestroyService');
|
33
|
+
.findIndex((el) => el.getText() === 'TuiDestroyService');
|
34
34
|
parent.removeElement(index);
|
35
35
|
}
|
36
36
|
else if (ng_morph_1.Node.isTypeReference(parent)) {
|
@@ -67,7 +67,7 @@ function migrateDestroyService(options) {
|
|
67
67
|
else {
|
68
68
|
nodesForComments.push(ref);
|
69
69
|
}
|
70
|
-
destroyObservableUsages.forEach(node => {
|
70
|
+
destroyObservableUsages.forEach((node) => {
|
71
71
|
const possibleTakeUntil = findTakeUntil(node);
|
72
72
|
if (!possibleTakeUntil) {
|
73
73
|
return;
|
@@ -103,7 +103,7 @@ function migrateDestroyService(options) {
|
|
103
103
|
* ---
|
104
104
|
* @see https://ts-morph.com/manipulation/#strongwarningstrong
|
105
105
|
*/
|
106
|
-
nodesForComments.forEach(ref => {
|
106
|
+
nodesForComments.forEach((ref) => {
|
107
107
|
if (ref.wasForgotten()) {
|
108
108
|
return;
|
109
109
|
}
|
@@ -117,6 +117,9 @@ function migrateDestroyService(options) {
|
|
117
117
|
}
|
118
118
|
exports.migrateDestroyService = migrateDestroyService;
|
119
119
|
function findTakeUntil(node, maxDepth = 10) {
|
120
|
+
if (node.wasForgotten()) {
|
121
|
+
return null;
|
122
|
+
}
|
120
123
|
if (ng_morph_1.Node.isCallExpression(node) && node.getText().includes('takeUntil(')) {
|
121
124
|
return node;
|
122
125
|
}
|
@@ -18,7 +18,7 @@ function migrateTuiMaskedMoneyValueIsEmpty(options) {
|
|
18
18
|
!options['skip-logs'] &&
|
19
19
|
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} tuiMaskedMoneyValueIsEmpty`);
|
20
20
|
const references = (0, get_named_import_references_1.getNamedImportReferences)('tuiMaskedMoneyValueIsEmpty', '@taiga-ui/core');
|
21
|
-
references.forEach(ref => {
|
21
|
+
references.forEach((ref) => {
|
22
22
|
if (ref.wasForgotten()) {
|
23
23
|
return;
|
24
24
|
}
|
@@ -37,7 +37,7 @@ function migrateTuiMaskedNumberStringToNumber(options) {
|
|
37
37
|
!options['skip-logs'] &&
|
38
38
|
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} tuiMaskedNumberStringToNumber`);
|
39
39
|
const references = (0, get_named_import_references_1.getNamedImportReferences)('tuiMaskedNumberStringToNumber', '@taiga-ui/core');
|
40
|
-
references.forEach(ref => {
|
40
|
+
references.forEach((ref) => {
|
41
41
|
if (ref.wasForgotten()) {
|
42
42
|
return;
|
43
43
|
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.migrateMonthContext = void 0;
|
4
|
+
const ng_morph_1 = require("ng-morph");
|
5
|
+
const add_unique_import_1 = require("../../../utils/add-unique-import");
|
6
|
+
const colored_log_1 = require("../../../utils/colored-log");
|
7
|
+
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
8
|
+
const import_manipulations_1 = require("../../../utils/import-manipulations");
|
9
|
+
function migrateMonthContext(options) {
|
10
|
+
!options['skip-logs'] &&
|
11
|
+
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating TuiBooleanHandlerWithContext<TuiMonth, TuiMonthContext> ...`);
|
12
|
+
const monthContextRefs = (0, get_named_import_references_1.getNamedImportReferences)('TuiMonthContext', '@taiga-ui/kit');
|
13
|
+
monthContextRefs
|
14
|
+
.map((n) => n.getFirstAncestorByKind(ng_morph_1.SyntaxKind.TypeReference))
|
15
|
+
.forEach((ref) => {
|
16
|
+
if (!ref || ref.wasForgotten()) {
|
17
|
+
return;
|
18
|
+
}
|
19
|
+
const booleanHandlerWithContext = ref.getFirstAncestor((node) => node.isKind(ng_morph_1.SyntaxKind.TypeReference) &&
|
20
|
+
!!node
|
21
|
+
.getText()
|
22
|
+
.match(/TuiBooleanHandlerWithContext<\s*TuiMonth\s*,\s*TuiMonthContext\s*>/));
|
23
|
+
if (!booleanHandlerWithContext) {
|
24
|
+
return;
|
25
|
+
}
|
26
|
+
booleanHandlerWithContext.replaceWithText('TuiBooleanHandler<TuiMonth>');
|
27
|
+
(0, add_unique_import_1.addUniqueImport)(booleanHandlerWithContext.getSourceFile().getFilePath(), 'TuiBooleanHandler', '@taiga-ui/cdk');
|
28
|
+
});
|
29
|
+
[
|
30
|
+
...monthContextRefs,
|
31
|
+
...(0, get_named_import_references_1.getNamedImportReferences)('TuiBooleanHandlerWithContext', '@taiga-ui/kit'),
|
32
|
+
]
|
33
|
+
.map((node) => !node.wasForgotten() &&
|
34
|
+
node.getFirstAncestorByKind(ng_morph_1.SyntaxKind.ImportSpecifier))
|
35
|
+
.filter((x) => !!x)
|
36
|
+
.forEach(import_manipulations_1.removeImport);
|
37
|
+
!options['skip-logs'] && (0, colored_log_1.titleLog)(`${colored_log_1.FINISH_SYMBOL} successfully migrated \n`);
|
38
|
+
}
|
39
|
+
exports.migrateMonthContext = migrateMonthContext;
|
@@ -0,0 +1,64 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.migrateNumberFormatSettings = void 0;
|
4
|
+
const ng_morph_1 = require("ng-morph");
|
5
|
+
const colored_log_1 = require("../../../utils/colored-log");
|
6
|
+
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
7
|
+
const OPTIONS_MIGRATIONS = {
|
8
|
+
decimalLimit: (property) => property.replaceWithText(property.getText().replace('decimalLimit', 'precision')),
|
9
|
+
decimal: (property) => {
|
10
|
+
const [, propertyValue] = property.getText().split(/\s?:\s?/);
|
11
|
+
property.replaceWithText(propertyValue.match(/^['"`]never['"`]$/)
|
12
|
+
? 'precision: 0'
|
13
|
+
: property.getText().replace('decimal', 'decimalMode'));
|
14
|
+
},
|
15
|
+
zeroPadding: (property) => {
|
16
|
+
const [, propertyValue] = property.getText().split(/\s?:\s?/);
|
17
|
+
if (propertyValue === 'true') {
|
18
|
+
property.replaceWithText('decimalMode: "always"');
|
19
|
+
}
|
20
|
+
else {
|
21
|
+
property.replaceWithText(`// TODO: (Taiga UI migration) "zeroPadding" is deleted. Use "decimalMode" instead https://taiga-ui.dev/pipes/format-number/API \n${property.getText()}`);
|
22
|
+
}
|
23
|
+
},
|
24
|
+
};
|
25
|
+
function migrateNumberFormatSettings(options) {
|
26
|
+
!options['skip-logs'] &&
|
27
|
+
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating TuiNumberFormatSettings...`);
|
28
|
+
const asFunctionArgument = [
|
29
|
+
...(0, get_named_import_references_1.getNamedImportReferences)('tuiFormatNumber', '@taiga-ui/core'),
|
30
|
+
...(0, get_named_import_references_1.getNamedImportReferences)('tuiNumberFormatProvider', '@taiga-ui/core'),
|
31
|
+
].map((n) => {
|
32
|
+
var _a;
|
33
|
+
return (_a = n
|
34
|
+
.getFirstAncestorByKind(ng_morph_1.SyntaxKind.CallExpression)) === null || _a === void 0 ? void 0 : _a.getFirstDescendantByKind(ng_morph_1.SyntaxKind.ObjectLiteralExpression);
|
35
|
+
});
|
36
|
+
const asStandaloneSettingsObject = (0, get_named_import_references_1.getNamedImportReferences)('TuiNumberFormatSettings', '@taiga-ui/core').map((n) => {
|
37
|
+
const type = n.getFirstAncestorByKind(ng_morph_1.SyntaxKind.TypeReference);
|
38
|
+
const siblings = [
|
39
|
+
...((type === null || type === void 0 ? void 0 : type.getPreviousSiblings()) || []),
|
40
|
+
...((type === null || type === void 0 ? void 0 : type.getNextSiblings()) || []),
|
41
|
+
];
|
42
|
+
return siblings.find(ng_morph_1.Node.isObjectLiteralExpression);
|
43
|
+
});
|
44
|
+
[...asFunctionArgument, ...asStandaloneSettingsObject]
|
45
|
+
.filter(ng_morph_1.Node.isObjectLiteralExpression)
|
46
|
+
.forEach((options) => {
|
47
|
+
Object.entries(OPTIONS_MIGRATIONS).forEach(([propertyName, migration]) => {
|
48
|
+
const property = options.getProperty(propertyName);
|
49
|
+
if (!property) {
|
50
|
+
return;
|
51
|
+
}
|
52
|
+
const isShorthandPropertyAssignment = ng_morph_1.Node.isShorthandPropertyAssignment(property) &&
|
53
|
+
!property.hasObjectAssignmentInitializer();
|
54
|
+
const previousPropertyText = property.getText();
|
55
|
+
migration(property);
|
56
|
+
if (isShorthandPropertyAssignment && !property.wasForgotten()) {
|
57
|
+
property.replaceWithText(`${property.getText()}: ${previousPropertyText}`);
|
58
|
+
}
|
59
|
+
});
|
60
|
+
});
|
61
|
+
!options['skip-logs'] &&
|
62
|
+
(0, colored_log_1.successLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} migration of TuiNumberFormatSettings completes \n`);
|
63
|
+
}
|
64
|
+
exports.migrateNumberFormatSettings = migrateNumberFormatSettings;
|
@@ -15,8 +15,11 @@ exports.migrateOptionProviders = migrateOptionProviders;
|
|
15
15
|
function migrateInputNumberOptions(options) {
|
16
16
|
!options['skip-logs'] &&
|
17
17
|
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} tuiInputNumberOptionsProvider`);
|
18
|
-
const references =
|
19
|
-
|
18
|
+
const references = [
|
19
|
+
...(0, get_named_import_references_1.getNamedImportReferences)('tuiInputNumberOptionsProvider', '@taiga-ui/kit'),
|
20
|
+
...(0, get_named_import_references_1.getNamedImportReferences)('tuiInputNumberOptionsProvider', '@taiga-ui/legacy'),
|
21
|
+
];
|
22
|
+
references.forEach((ref) => {
|
20
23
|
if (ref.wasForgotten()) {
|
21
24
|
return;
|
22
25
|
}
|
@@ -30,7 +33,7 @@ function migrateInputNumberOptions(options) {
|
|
30
33
|
const decimal = value.getProperty('decimal');
|
31
34
|
[precision, decimal]
|
32
35
|
.filter((property) => !!property)
|
33
|
-
.forEach(property => property.remove());
|
36
|
+
.forEach((property) => property.remove());
|
34
37
|
if (precision || decimal) {
|
35
38
|
(0, insert_todo_1.insertTodo)(parent, '"precision" and "decimal" options have been moved to FormatNumberOptions. See https://taiga-ui.dev/components/input-number#options');
|
36
39
|
}
|
@@ -24,7 +24,7 @@ function migrateProprietary(fileSystem, options) {
|
|
24
24
|
exports.migrateProprietary = migrateProprietary;
|
25
25
|
function replaceScopePackages() {
|
26
26
|
var _a;
|
27
|
-
(_a = (0, ng_morph_1.getActiveProject)()) === null || _a === void 0 ? void 0 : _a.getSourceFiles('**/**.{ts,less,scss}').forEach(sourceFile => {
|
27
|
+
(_a = (0, ng_morph_1.getActiveProject)()) === null || _a === void 0 ? void 0 : _a.getSourceFiles('**/**.{ts,less,scss}').forEach((sourceFile) => {
|
28
28
|
let fullText = sourceFile.getFullText();
|
29
29
|
fullText = fullText
|
30
30
|
.replaceAll('@taiga-ui/proprietary-core', '@taiga-ui/proprietary')
|
@@ -38,7 +38,7 @@ function replaceScopePackages() {
|
|
38
38
|
}
|
39
39
|
function replaceProprietaryIconPath() {
|
40
40
|
var _a;
|
41
|
-
(_a = (0, ng_morph_1.getActiveProject)()) === null || _a === void 0 ? void 0 : _a.getSourceFiles('**/{angular,project}.json').forEach(sourceFile => {
|
41
|
+
(_a = (0, ng_morph_1.getActiveProject)()) === null || _a === void 0 ? void 0 : _a.getSourceFiles('**/{angular,project}.json').forEach((sourceFile) => {
|
42
42
|
let fullText = sourceFile.getFullText();
|
43
43
|
fullText = fullText
|
44
44
|
.replaceAll('node_modules/@taiga-ui/proprietary-icons/src', '@taiga-ui/proprietary/design-tokens/icons/src')
|
@@ -56,7 +56,7 @@ function removeProprietaryPackages(fileSystem) {
|
|
56
56
|
'@taiga-ui/proprietary-icons',
|
57
57
|
'@taiga-ui/proprietary-tds-icons',
|
58
58
|
'@taiga-ui/proprietary-tds-palette',
|
59
|
-
].forEach(name => (0, ng_morph_1.removePackageJsonDependency)(fileSystem.tree, name));
|
59
|
+
].forEach((name) => (0, ng_morph_1.removePackageJsonDependency)(fileSystem.tree, name));
|
60
60
|
(0, ng_morph_1.addPackageJsonDependency)(fileSystem.tree, {
|
61
61
|
name: '@taiga-ui/proprietary',
|
62
62
|
version: version_1.TUI_VERSION,
|