@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
@@ -2,6 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.migrateExpandable = void 0;
|
4
4
|
const elements_1 = require("../../../../utils/templates/elements");
|
5
|
+
const inputs_1 = require("../../../../utils/templates/inputs");
|
5
6
|
const template_resource_1 = require("../../../../utils/templates/template-resource");
|
6
7
|
function migrateExpandable({ resource, recorder, fileSystem, }) {
|
7
8
|
const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem);
|
@@ -9,7 +10,7 @@ function migrateExpandable({ resource, recorder, fileSystem, }) {
|
|
9
10
|
const elements = (0, elements_1.findElementsWithAttributeOnTag)(template, ['[expandable]'], ['tui-input-tag', 'tui-multi-select', 'tui-input-date']);
|
10
11
|
elements.forEach(({ attrs, sourceCodeLocation }) => {
|
11
12
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
12
|
-
const expandableAttr =
|
13
|
+
const expandableAttr = (0, inputs_1.findAttr)(attrs, 'expandable');
|
13
14
|
if (!expandableAttr) {
|
14
15
|
return;
|
15
16
|
}
|
@@ -17,7 +18,7 @@ function migrateExpandable({ resource, recorder, fileSystem, }) {
|
|
17
18
|
const expandableStart = (_c = (_b = (_a = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.attrs) === null || _a === void 0 ? void 0 : _a[expandableAttr.name]) === null || _b === void 0 ? void 0 : _b.startOffset) !== null && _c !== void 0 ? _c : 0;
|
18
19
|
const expandableEnd = (_f = (_e = (_d = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.attrs) === null || _d === void 0 ? void 0 : _d[expandableAttr.name]) === null || _e === void 0 ? void 0 : _e.endOffset) !== null && _f !== void 0 ? _f : 0;
|
19
20
|
if (expandableValue === 'false') {
|
20
|
-
const rowsAttr =
|
21
|
+
const rowsAttr = (0, inputs_1.findAttr)(attrs, 'rows');
|
21
22
|
const insertTo = ((_h = (_g = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.startTag) === null || _g === void 0 ? void 0 : _g.endOffset) !== null && _h !== void 0 ? _h : 0) - 1;
|
22
23
|
recorder.insertRight(templateOffset + insertTo, rowsAttr ? '' : '[rows]="1"');
|
23
24
|
}
|
@@ -2,19 +2,22 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.migrateFocusable = void 0;
|
4
4
|
const elements_1 = require("../../../../utils/templates/elements");
|
5
|
+
const inputs_1 = require("../../../../utils/templates/inputs");
|
5
6
|
const template_resource_1 = require("../../../../utils/templates/template-resource");
|
6
|
-
const LEGACY_ATTRIBUTE_NAME = '
|
7
|
+
const LEGACY_ATTRIBUTE_NAME = 'tuiFocusable';
|
7
8
|
function migrateFocusable({ resource, recorder, fileSystem, }) {
|
8
9
|
const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem);
|
9
10
|
const templateOffset = (0, template_resource_1.getTemplateOffset)(resource);
|
10
|
-
const elements = (0, elements_1.findElementsWithAttributeOnTag)(template, [
|
11
|
+
const elements = (0, elements_1.findElementsWithAttributeOnTag)(template, [
|
12
|
+
`[${LEGACY_ATTRIBUTE_NAME}]`,
|
13
|
+
]);
|
11
14
|
elements.forEach(({ attrs, sourceCodeLocation }) => {
|
12
15
|
var _a;
|
13
16
|
if (!sourceCodeLocation) {
|
14
17
|
return;
|
15
18
|
}
|
16
|
-
const focusableAttr =
|
17
|
-
const attributeLocation = (_a = sourceCodeLocation.attrs) === null || _a === void 0 ? void 0 : _a[
|
19
|
+
const focusableAttr = (0, inputs_1.findAttr)(attrs, LEGACY_ATTRIBUTE_NAME);
|
20
|
+
const attributeLocation = (_a = sourceCodeLocation.attrs) === null || _a === void 0 ? void 0 : _a[focusableAttr.name];
|
18
21
|
if (!focusableAttr || !attributeLocation) {
|
19
22
|
return;
|
20
23
|
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import type { UpdateRecorder } from '@angular-devkit/schematics';
|
2
|
+
import type { DevkitFileSystem } from 'ng-morph';
|
3
|
+
import type { TemplateResource } from '../../../interfaces';
|
4
|
+
export declare function migrateLabel({ resource, recorder, fileSystem, }: {
|
5
|
+
fileSystem: DevkitFileSystem;
|
6
|
+
recorder: UpdateRecorder;
|
7
|
+
resource: TemplateResource;
|
8
|
+
}): void;
|
@@ -0,0 +1,39 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.migrateLabel = void 0;
|
4
|
+
const elements_1 = require("../../../../utils/templates/elements");
|
5
|
+
const inputs_1 = require("../../../../utils/templates/inputs");
|
6
|
+
const template_resource_1 = require("../../../../utils/templates/template-resource");
|
7
|
+
function migrateLabel({ resource, recorder, fileSystem, }) {
|
8
|
+
const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem);
|
9
|
+
const templateOffset = (0, template_resource_1.getTemplateOffset)(resource);
|
10
|
+
const labelElements = (0, elements_1.findElementsByTagName)(template, 'label', ({ attrs }) => attrs.some(({ name }) => name === 'tuilabel' || name === '[tuilabel]'));
|
11
|
+
labelElements.forEach(({ attrs, sourceCodeLocation }) => {
|
12
|
+
const labelAttr = (0, inputs_1.findAttr)(attrs, 'tuilabel');
|
13
|
+
if (!labelAttr || !sourceCodeLocation) {
|
14
|
+
return;
|
15
|
+
}
|
16
|
+
migrateValue({
|
17
|
+
valueAttr: labelAttr,
|
18
|
+
sourceCodeLocation,
|
19
|
+
recorder,
|
20
|
+
templateOffset,
|
21
|
+
});
|
22
|
+
});
|
23
|
+
}
|
24
|
+
exports.migrateLabel = migrateLabel;
|
25
|
+
function migrateValue({ valueAttr, sourceCodeLocation, recorder, templateOffset, }) {
|
26
|
+
var _a, _b, _c;
|
27
|
+
const attrValue = valueAttr === null || valueAttr === void 0 ? void 0 : valueAttr.value;
|
28
|
+
const insertTo = (_b = (_a = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.startTag) === null || _a === void 0 ? void 0 : _a.endOffset) !== null && _b !== void 0 ? _b : 0;
|
29
|
+
if (!attrValue || !insertTo) {
|
30
|
+
return;
|
31
|
+
}
|
32
|
+
recorder.insertRight(insertTo + templateOffset, valueAttr.name === 'tuilabel' ? attrValue : `{{ ${attrValue} }}`);
|
33
|
+
const attrOffset = (_c = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.attrs) === null || _c === void 0 ? void 0 : _c[valueAttr.name];
|
34
|
+
if (attrOffset) {
|
35
|
+
const { startOffset, endOffset } = attrOffset;
|
36
|
+
recorder.remove(templateOffset + startOffset, endOffset - startOffset);
|
37
|
+
recorder.insertRight(templateOffset + startOffset, 'tuiLabel');
|
38
|
+
}
|
39
|
+
}
|
@@ -15,7 +15,7 @@ function migrateLabeled({ resource, recorder, fileSystem, }) {
|
|
15
15
|
data: [
|
16
16
|
{
|
17
17
|
attrNames: ['size'],
|
18
|
-
|
18
|
+
valueReplacer: [
|
19
19
|
{ from: 'l', to: 'm' },
|
20
20
|
{ from: 'm', to: 's' },
|
21
21
|
],
|
@@ -28,18 +28,14 @@ function migrateLabeled({ resource, recorder, fileSystem, }) {
|
|
28
28
|
'tui-radio-labeled',
|
29
29
|
]);
|
30
30
|
elements.forEach(({ sourceCodeLocation, tagName }) => {
|
31
|
-
var _a, _b, _c, _d
|
31
|
+
var _a, _b, _c, _d;
|
32
32
|
if (!sourceCodeLocation) {
|
33
33
|
return;
|
34
34
|
}
|
35
|
-
(0, add_import_to_closest_module_1.addImportToClosestModule)(resource.componentPath, tagName === 'tui-checkbox-labeled'
|
36
|
-
|
37
|
-
|
38
|
-
recorder.insertRight(templateOffset + ((
|
39
|
-
recorder.insertRight(templateOffset + ((_d = (_c = sourceCodeLocation.endTag) === null || _c === void 0 ? void 0 : _c.startOffset) !== null && _d !== void 0 ? _d : 1) - 1, '\n</label>');
|
40
|
-
recorder.remove(templateOffset + ((_f = (_e = sourceCodeLocation.endTag) === null || _e === void 0 ? void 0 : _e.startOffset) !== null && _f !== void 0 ? _f : 0), tagName === 'tui-checkbox-labeled'
|
41
|
-
? '<tui-checkbox-labeled/>'.length
|
42
|
-
: '<tui-radio-labeled/>'.length);
|
35
|
+
(0, add_import_to_closest_module_1.addImportToClosestModule)(resource.componentPath, tagName === 'tui-checkbox-labeled' ? 'TuiCheckbox' : 'TuiRadio', '@taiga-ui/kit');
|
36
|
+
recorder.insertRight(templateOffset + (((_a = sourceCodeLocation.startTag) === null || _a === void 0 ? void 0 : _a.startOffset) || 1) - 1, '<label tuiLabel>');
|
37
|
+
recorder.remove(templateOffset + ((_c = (_b = sourceCodeLocation.endTag) === null || _b === void 0 ? void 0 : _b.startOffset) !== null && _c !== void 0 ? _c : 0), `<${tagName}/>`.length);
|
38
|
+
recorder.insertRight(templateOffset + (((_d = sourceCodeLocation.endTag) === null || _d === void 0 ? void 0 : _d.startOffset) || 1), '</label>');
|
43
39
|
});
|
44
40
|
}
|
45
41
|
exports.migrateLabeled = migrateLabeled;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import type { UpdateRecorder } from '@angular-devkit/schematics';
|
2
|
+
import type { DevkitFileSystem } from 'ng-morph';
|
3
|
+
import type { TemplateResource } from '../../../interfaces';
|
4
|
+
export declare function migrateMobileTabs({ resource, recorder, fileSystem, }: {
|
5
|
+
fileSystem: DevkitFileSystem;
|
6
|
+
recorder: UpdateRecorder;
|
7
|
+
resource: TemplateResource;
|
8
|
+
}): void;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.migrateMobileTabs = void 0;
|
4
|
+
const add_import_to_closest_module_1 = require("../../../../utils/add-import-to-closest-module");
|
5
|
+
const elements_1 = require("../../../../utils/templates/elements");
|
6
|
+
const template_resource_1 = require("../../../../utils/templates/template-resource");
|
7
|
+
const templates_1 = require("../../../utils/templates");
|
8
|
+
const remove_attrs_1 = require("../utils/remove-attrs");
|
9
|
+
const TABS_TAG_NAME = 'tui-tabs';
|
10
|
+
const SEGMENTED_TAG_NAME = 'tui-segmented';
|
11
|
+
const TAB_ATTRIBUTE_NAME = 'tuiTab'.toLowerCase();
|
12
|
+
const MOBILE_TABS_ATTRIBUTE_NAME = 'tuiMobileTabs'.toLowerCase();
|
13
|
+
function migrateMobileTabs({ resource, recorder, fileSystem, }) {
|
14
|
+
const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem);
|
15
|
+
const templateOffset = (0, template_resource_1.getTemplateOffset)(resource);
|
16
|
+
const elements = (0, elements_1.findElementsWithAttributeOnTag)(template, [MOBILE_TABS_ATTRIBUTE_NAME], [TABS_TAG_NAME]);
|
17
|
+
if (elements.length > 0) {
|
18
|
+
(0, add_import_to_closest_module_1.addImportToClosestModule)(resource.componentPath, 'TuiSegmented', '@taiga-ui/kit');
|
19
|
+
}
|
20
|
+
elements.forEach((element) => {
|
21
|
+
(0, templates_1.replaceTag)(recorder, element.sourceCodeLocation, TABS_TAG_NAME, SEGMENTED_TAG_NAME, templateOffset);
|
22
|
+
removeMobileTabsAttribute(element, recorder, templateOffset);
|
23
|
+
element.childNodes
|
24
|
+
.filter(isElement)
|
25
|
+
.forEach((element) => removeTabAttribute(element, recorder, templateOffset));
|
26
|
+
});
|
27
|
+
}
|
28
|
+
exports.migrateMobileTabs = migrateMobileTabs;
|
29
|
+
function removeTabAttribute({ attrs, sourceCodeLocation }, recorder, templateOffset) {
|
30
|
+
const tabAttr = attrs.find((attr) => attr.name === TAB_ATTRIBUTE_NAME);
|
31
|
+
if (!tabAttr || !sourceCodeLocation) {
|
32
|
+
return;
|
33
|
+
}
|
34
|
+
(0, remove_attrs_1.removeAttrs)([tabAttr], sourceCodeLocation, recorder, templateOffset);
|
35
|
+
}
|
36
|
+
function removeMobileTabsAttribute({ attrs, sourceCodeLocation }, recorder, templateOffset) {
|
37
|
+
const mobileTabsAttr = attrs.find((attr) => attr.name === MOBILE_TABS_ATTRIBUTE_NAME);
|
38
|
+
if (!mobileTabsAttr || !sourceCodeLocation) {
|
39
|
+
return;
|
40
|
+
}
|
41
|
+
(0, remove_attrs_1.removeAttrs)([mobileTabsAttr], sourceCodeLocation, recorder, templateOffset);
|
42
|
+
}
|
43
|
+
function isElement(node) {
|
44
|
+
return Boolean(node.attrs);
|
45
|
+
}
|
@@ -33,7 +33,7 @@ function migrateMoney({ resource, recorder, fileSystem, }) {
|
|
33
33
|
if (decimalAttr || precisionAttr) {
|
34
34
|
(0, add_import_to_closest_module_1.addImportToClosestModule)(resource.componentPath, 'TuiNumberFormat', '@taiga-ui/core');
|
35
35
|
const format = JSON.stringify((0, clean_object_1.cleanObject)({
|
36
|
-
|
36
|
+
decimalMode: decimalAttr === null || decimalAttr === void 0 ? void 0 : decimalAttr.value,
|
37
37
|
precision: precisionAttr === null || precisionAttr === void 0 ? void 0 : precisionAttr.value,
|
38
38
|
}));
|
39
39
|
const formatPart = `[tuiNumberFormat]='${format}'`;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import type { UpdateRecorder } from '@angular-devkit/schematics';
|
2
|
+
import type { DevkitFileSystem } from 'ng-morph';
|
3
|
+
import type { TemplateResource } from '../../../interfaces';
|
4
|
+
export declare function migrateNotification({ resource, recorder, fileSystem, }: {
|
5
|
+
fileSystem: DevkitFileSystem;
|
6
|
+
recorder: UpdateRecorder;
|
7
|
+
resource: TemplateResource;
|
8
|
+
}): void;
|
@@ -0,0 +1,64 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.migrateNotification = void 0;
|
4
|
+
const ng_morph_1 = require("ng-morph");
|
5
|
+
const add_import_to_closest_module_1 = require("../../../../utils/add-import-to-closest-module");
|
6
|
+
const elements_1 = require("../../../../utils/templates/elements");
|
7
|
+
const inputs_1 = require("../../../../utils/templates/inputs");
|
8
|
+
const template_resource_1 = require("../../../../utils/templates/template-resource");
|
9
|
+
function migrateNotification({ resource, recorder, fileSystem, }) {
|
10
|
+
const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem);
|
11
|
+
const templateOffset = (0, template_resource_1.getTemplateOffset)(resource);
|
12
|
+
const elements = [
|
13
|
+
...(0, elements_1.findElementsByTagNames)(template, ['tui-notification']),
|
14
|
+
...(0, elements_1.findElementsWithAttributeOnTag)(template, ['tuiNotification'], ['button', 'a']),
|
15
|
+
];
|
16
|
+
elements.forEach(({ attrs, sourceCodeLocation, tagName, childNodes }) => {
|
17
|
+
var _a, _b, _c, _d;
|
18
|
+
const sizeAttr = (0, inputs_1.findAttr)(attrs, 'size');
|
19
|
+
const hasIconAttr = (0, inputs_1.findAttr)(attrs, 'hasIcon');
|
20
|
+
const hideCloseAttr = (0, inputs_1.findAttr)(attrs, 'hideClose');
|
21
|
+
const closeListener = (0, inputs_1.findAttr)(attrs, '(close)');
|
22
|
+
const { startTag, endTag } = sourceCodeLocation || {};
|
23
|
+
const hideCloseAttrLocation = (_a = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.attrs) === null || _a === void 0 ? void 0 : _a[(hideCloseAttr === null || hideCloseAttr === void 0 ? void 0 : hideCloseAttr.name) || ''];
|
24
|
+
const hasIconAttrLocation = (_b = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.attrs) === null || _b === void 0 ? void 0 : _b[(hasIconAttr === null || hasIconAttr === void 0 ? void 0 : hasIconAttr.name) || ''];
|
25
|
+
if (!sizeAttr) {
|
26
|
+
recorder.insertRight(templateOffset + ((_c = startTag === null || startTag === void 0 ? void 0 : startTag.startOffset) !== null && _c !== void 0 ? _c : 0) + `<${tagName}`.length, ' size="m"');
|
27
|
+
}
|
28
|
+
if (closeListener) {
|
29
|
+
const hasProprietaryPackages = !!(0, ng_morph_1.getPackageJsonDependency)(fileSystem.tree, '@taiga-ui/proprietary-core');
|
30
|
+
(0, add_import_to_closest_module_1.addImportToClosestModule)(resource.componentPath, 'NgIf', '@angular/common');
|
31
|
+
const ifCondition = hideCloseAttr ? ` *ngIf="!${hideCloseAttr.value}"` : '';
|
32
|
+
const closeIconName = hasProprietaryPackages
|
33
|
+
? '@tui.pragmatic.small.cross'
|
34
|
+
: '@tui.x';
|
35
|
+
const closeButtonTemplate = ` <button${ifCondition} tuiIconButton iconStart="${closeIconName}"></button>`;
|
36
|
+
recorder.insertRight(templateOffset + ((_d = endTag === null || endTag === void 0 ? void 0 : endTag.startOffset) !== null && _d !== void 0 ? _d : 0), closeButtonTemplate);
|
37
|
+
if (hideCloseAttrLocation) {
|
38
|
+
const { startOffset, endOffset } = hideCloseAttrLocation;
|
39
|
+
recorder.remove(templateOffset + startOffset, endOffset - startOffset);
|
40
|
+
}
|
41
|
+
}
|
42
|
+
if (hasIconAttr && hasIconAttrLocation) {
|
43
|
+
const { startOffset, endOffset } = hasIconAttrLocation;
|
44
|
+
const attrOffset = templateOffset + startOffset;
|
45
|
+
const attrLength = endOffset - startOffset;
|
46
|
+
switch (hasIconAttr.value) {
|
47
|
+
case 'false':
|
48
|
+
recorder.remove(attrOffset, attrLength);
|
49
|
+
recorder.insertRight(attrOffset, 'icon=""');
|
50
|
+
break;
|
51
|
+
case 'true':
|
52
|
+
recorder.remove(attrOffset, attrLength);
|
53
|
+
break;
|
54
|
+
default:
|
55
|
+
recorder.insertLeft(templateOffset + ((startTag === null || startTag === void 0 ? void 0 : startTag.startOffset) || 0), '<!-- TODO: (Taiga UI migration) "hasIcon" is deleted. Use icon="" to hide icon. Or pass TUI_NOTIFICATION_DEFAULT_OPTIONS["icon"] to show it again. Learn more: https://taiga-ui.dev/components/notification -->\n');
|
56
|
+
}
|
57
|
+
}
|
58
|
+
if (childNodes.length > 1 && startTag && endTag) {
|
59
|
+
recorder.insertRight(templateOffset + startTag.endOffset, '<div>');
|
60
|
+
recorder.insertLeft(templateOffset + endTag.startOffset, '</div>');
|
61
|
+
}
|
62
|
+
});
|
63
|
+
}
|
64
|
+
exports.migrateNotification = migrateNotification;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import type { UpdateRecorder } from '@angular-devkit/schematics';
|
2
|
+
import type { DevkitFileSystem } from 'ng-morph';
|
3
|
+
import type { TemplateResource } from '../../../../ng-update/interfaces';
|
4
|
+
export declare function migrateNumberPrecision({ resource, recorder, fileSystem, }: {
|
5
|
+
fileSystem: DevkitFileSystem;
|
6
|
+
recorder: UpdateRecorder;
|
7
|
+
resource: TemplateResource;
|
8
|
+
}): void;
|
@@ -0,0 +1,36 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.migrateNumberPrecision = void 0;
|
4
|
+
const remove_attrs_1 = require("../../../../ng-update/v4/steps/utils/remove-attrs");
|
5
|
+
const add_import_to_closest_module_1 = require("../../../../utils/add-import-to-closest-module");
|
6
|
+
const elements_1 = require("../../../../utils/templates/elements");
|
7
|
+
const inputs_1 = require("../../../../utils/templates/inputs");
|
8
|
+
const template_resource_1 = require("../../../../utils/templates/template-resource");
|
9
|
+
const clean_object_1 = require("../utils/clean-object");
|
10
|
+
function migrateNumberPrecision({ resource, recorder, fileSystem, }) {
|
11
|
+
const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem);
|
12
|
+
const templateOffset = (0, template_resource_1.getTemplateOffset)(resource);
|
13
|
+
const elements = (0, elements_1.findElementsByTagName)(template, 'tui-input-number');
|
14
|
+
elements.forEach(({ attrs, sourceCodeLocation }) => {
|
15
|
+
var _a;
|
16
|
+
if (!sourceCodeLocation) {
|
17
|
+
return;
|
18
|
+
}
|
19
|
+
const decimalAttr = (0, inputs_1.findAttr)(attrs, 'decimal');
|
20
|
+
const precisionAttr = (0, inputs_1.findAttr)(attrs, 'precision');
|
21
|
+
if (decimalAttr || precisionAttr) {
|
22
|
+
(0, add_import_to_closest_module_1.addImportToClosestModule)(resource.componentPath, 'TuiNumberFormat', '@taiga-ui/core');
|
23
|
+
const format = JSON.stringify((0, clean_object_1.cleanObject)({
|
24
|
+
decimalMode: decimalAttr === null || decimalAttr === void 0 ? void 0 : decimalAttr.value,
|
25
|
+
precision: precisionAttr === null || precisionAttr === void 0 ? void 0 : precisionAttr.value,
|
26
|
+
}));
|
27
|
+
const formatPart = `[tuiNumberFormat]='${format}'`;
|
28
|
+
const insertTo = (((_a = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.startTag) === null || _a === void 0 ? void 0 : _a.startOffset) || 0) +
|
29
|
+
'<tui-input-number '.length;
|
30
|
+
recorder.insertRight(templateOffset + insertTo, formatPart);
|
31
|
+
}
|
32
|
+
const attrsToRemove = [decimalAttr, precisionAttr].filter((attr) => attr !== undefined);
|
33
|
+
(0, remove_attrs_1.removeAttrs)(attrsToRemove, sourceCodeLocation, recorder, templateOffset);
|
34
|
+
});
|
35
|
+
}
|
36
|
+
exports.migrateNumberPrecision = migrateNumberPrecision;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import type { UpdateRecorder } from '@angular-devkit/schematics';
|
2
|
+
import type { DevkitFileSystem } from 'ng-morph';
|
3
|
+
import type { TemplateResource } from '../../../interfaces';
|
4
|
+
export declare function migrateOverscroll({ resource, recorder, fileSystem, }: {
|
5
|
+
fileSystem: DevkitFileSystem;
|
6
|
+
recorder: UpdateRecorder;
|
7
|
+
resource: TemplateResource;
|
8
|
+
}): void;
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.migrateOverscroll = void 0;
|
4
|
+
const elements_1 = require("../../../../utils/templates/elements");
|
5
|
+
const inputs_1 = require("../../../../utils/templates/inputs");
|
6
|
+
const template_resource_1 = require("../../../../utils/templates/template-resource");
|
7
|
+
const remove_attrs_1 = require("../utils/remove-attrs");
|
8
|
+
const overscrollAttrName = 'tuiOverscroll';
|
9
|
+
function migrateOverscroll({ resource, recorder, fileSystem, }) {
|
10
|
+
const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem);
|
11
|
+
const templateOffset = (0, template_resource_1.getTemplateOffset)(resource);
|
12
|
+
const elements = (0, elements_1.findElementsWithDirective)(template, overscrollAttrName).filter(({ sourceCodeLocation }) => !!sourceCodeLocation);
|
13
|
+
if (!elements.length) {
|
14
|
+
return;
|
15
|
+
}
|
16
|
+
elements.forEach(({ attrs, sourceCodeLocation }) => {
|
17
|
+
const attrToRemove = (0, inputs_1.findAttr)(attrs, overscrollAttrName);
|
18
|
+
attrToRemove &&
|
19
|
+
(0, remove_attrs_1.removeAttrs)([attrToRemove], sourceCodeLocation, recorder, templateOffset);
|
20
|
+
});
|
21
|
+
addTodo(recorder, elements[0].sourceCodeLocation, templateOffset);
|
22
|
+
}
|
23
|
+
exports.migrateOverscroll = migrateOverscroll;
|
24
|
+
function addTodo(recorder, sourceCodeLocation, templateOffset) {
|
25
|
+
var _a, _b;
|
26
|
+
recorder.insertRight(templateOffset + ((_b = (_a = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.startTag) === null || _a === void 0 ? void 0 : _a.startOffset) !== null && _b !== void 0 ? _b : 0), '<!-- Taiga migration TODO: use "overscroll-behavior" ccs property instead of "tuiOverscroll" directive -->\n');
|
27
|
+
}
|
@@ -2,6 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.migrateThumbnailCard = void 0;
|
4
4
|
const elements_1 = require("../../../../utils/templates/elements");
|
5
|
+
const inputs_1 = require("../../../../utils/templates/inputs");
|
5
6
|
const template_resource_1 = require("../../../../utils/templates/template-resource");
|
6
7
|
function migrateThumbnailCard({ resource, recorder, fileSystem, }) {
|
7
8
|
const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem);
|
@@ -11,7 +12,7 @@ function migrateThumbnailCard({ resource, recorder, fileSystem, }) {
|
|
11
12
|
if (!sourceCodeLocation) {
|
12
13
|
return;
|
13
14
|
}
|
14
|
-
const valueAttr =
|
15
|
+
const valueAttr = (0, inputs_1.findAttr)(attrs, 'cardNumber');
|
15
16
|
if (!valueAttr) {
|
16
17
|
return;
|
17
18
|
}
|
@@ -5,6 +5,6 @@ export declare function replaceOpenTag(sourceCodeLocation: ElementLocation, reco
|
|
5
5
|
directive: string;
|
6
6
|
type: string;
|
7
7
|
}): void;
|
8
|
-
export declare function replaceSizeAttr(attrs: Attribute[], sourceCodeLocation: ElementLocation, recorder: UpdateRecorder, templateOffset: number): void;
|
8
|
+
export declare function replaceSizeAttr(attrs: Attribute[], sourceCodeLocation: ElementLocation, recorder: UpdateRecorder, templateOffset: number, map?: Record<string, string>): void;
|
9
9
|
export declare function removeClosingTag(sourceCodeLocation: ElementLocation, recorder: UpdateRecorder, templateOffset: number): void;
|
10
10
|
export declare function closeStartTag({ startTag, endTag }: ElementLocation, recorder: UpdateRecorder, templateOffset: number): void;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.closeStartTag = exports.removeClosingTag = exports.replaceSizeAttr = exports.replaceOpenTag = void 0;
|
4
|
+
const inputs_1 = require("../../../../../utils/templates/inputs");
|
4
5
|
const sizeMap = {
|
5
6
|
l: 'm',
|
6
7
|
m: 's',
|
@@ -15,16 +16,16 @@ function replaceOpenTag(sourceCodeLocation, recorder, templateOffset, { tag, dir
|
|
15
16
|
recorder.insertRight(templateOffset + startTag.startOffset, `<input\n${spaces}${directive}\n${spaces}type="${type}"`);
|
16
17
|
}
|
17
18
|
exports.replaceOpenTag = replaceOpenTag;
|
18
|
-
function replaceSizeAttr(attrs, sourceCodeLocation, recorder, templateOffset) {
|
19
|
+
function replaceSizeAttr(attrs, sourceCodeLocation, recorder, templateOffset, map = sizeMap) {
|
19
20
|
var _a;
|
20
|
-
const sizeAttr =
|
21
|
+
const sizeAttr = (0, inputs_1.findAttr)(attrs, 'size');
|
21
22
|
if (sizeAttr) {
|
22
23
|
const { startOffset, endOffset } = ((_a = sourceCodeLocation.attrs) === null || _a === void 0 ? void 0 : _a[sizeAttr.name]) || {
|
23
24
|
startOffset: 0,
|
24
25
|
endOffset: 0,
|
25
26
|
};
|
26
27
|
recorder.remove(templateOffset + startOffset, endOffset - startOffset);
|
27
|
-
recorder.insertRight(templateOffset + startOffset,
|
28
|
+
recorder.insertRight(templateOffset + startOffset, `${sizeAttr.name}="${map[sizeAttr.value] || sizeAttr.value}"`);
|
28
29
|
}
|
29
30
|
}
|
30
31
|
exports.replaceSizeAttr = replaceSizeAttr;
|
@@ -2,6 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.migrateCheckbox = void 0;
|
4
4
|
const elements_1 = require("../../../../../utils/templates/elements");
|
5
|
+
const inputs_1 = require("../../../../../utils/templates/inputs");
|
5
6
|
const template_resource_1 = require("../../../../../utils/templates/template-resource");
|
6
7
|
const common_1 = require("./common");
|
7
8
|
function migrateCheckbox({ resource, recorder, fileSystem, }) {
|
@@ -21,5 +22,40 @@ function migrateCheckbox({ resource, recorder, fileSystem, }) {
|
|
21
22
|
(0, common_1.closeStartTag)(sourceCodeLocation, recorder, templateOffset);
|
22
23
|
(0, common_1.removeClosingTag)(sourceCodeLocation, recorder, templateOffset);
|
23
24
|
});
|
25
|
+
(0, elements_1.findElementsByTagName)(template, 'tui-primitive-checkbox').forEach(({ attrs, sourceCodeLocation }) => {
|
26
|
+
if (!sourceCodeLocation) {
|
27
|
+
return;
|
28
|
+
}
|
29
|
+
(0, common_1.replaceSizeAttr)(attrs, sourceCodeLocation, recorder, templateOffset);
|
30
|
+
replaceValueAttr(attrs, sourceCodeLocation, recorder, templateOffset);
|
31
|
+
(0, common_1.replaceOpenTag)(sourceCodeLocation, recorder, templateOffset, {
|
32
|
+
tag: 'tui-primitive-checkbox',
|
33
|
+
directive: 'tuiCheckbox',
|
34
|
+
type: 'checkbox',
|
35
|
+
});
|
36
|
+
(0, common_1.closeStartTag)(sourceCodeLocation, recorder, templateOffset);
|
37
|
+
(0, common_1.removeClosingTag)(sourceCodeLocation, recorder, templateOffset);
|
38
|
+
});
|
24
39
|
}
|
25
40
|
exports.migrateCheckbox = migrateCheckbox;
|
41
|
+
function replaceValueAttr(attrs, sourceCodeLocation, recorder, templateOffset) {
|
42
|
+
var _a;
|
43
|
+
const valueAttr = (0, inputs_1.findAttr)(attrs, 'value');
|
44
|
+
if (valueAttr) {
|
45
|
+
const { startOffset, endOffset } = ((_a = sourceCodeLocation.attrs) === null || _a === void 0 ? void 0 : _a[valueAttr.name]) || {
|
46
|
+
startOffset: 0,
|
47
|
+
endOffset: 0,
|
48
|
+
};
|
49
|
+
recorder.remove(templateOffset + startOffset, endOffset - startOffset);
|
50
|
+
switch (valueAttr.value) {
|
51
|
+
case 'false':
|
52
|
+
case 'null':
|
53
|
+
return;
|
54
|
+
case 'true':
|
55
|
+
recorder.insertRight(templateOffset + startOffset, 'checked ');
|
56
|
+
return;
|
57
|
+
default:
|
58
|
+
recorder.insertRight(templateOffset + startOffset, `[checked]="${valueAttr.value}" `);
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
package/schematics/ng-update/{v3/steps/migrate-templates.d.ts → v4/steps/update-packages.d.ts}
RENAMED
@@ -1,4 +1,4 @@
|
|
1
1
|
/// <reference lib="es2021" />
|
2
2
|
import type { DevkitFileSystem } from 'ng-morph';
|
3
3
|
import type { TuiSchema } from '../../../ng-add/schema';
|
4
|
-
export declare function
|
4
|
+
export declare function updatePackages({ tree }: DevkitFileSystem, _: TuiSchema): void;
|
@@ -0,0 +1,44 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.updatePackages = void 0;
|
4
|
+
const ng_morph_1 = require("ng-morph");
|
5
|
+
const version_1 = require("../../../../constants/version");
|
6
|
+
const constants_1 = require("../../../constants");
|
7
|
+
const steps_1 = require("../../steps");
|
8
|
+
function updatePackages({ tree }, _) {
|
9
|
+
const packagesToRemove = ['@taiga-ui/addon-tablebars', '@taiga-ui/addon-preview'];
|
10
|
+
packagesToRemove.forEach((pkg) => {
|
11
|
+
(0, ng_morph_1.removePackageJsonDependency)(tree, pkg);
|
12
|
+
});
|
13
|
+
(0, steps_1.replacePackageName)('@tinkoff/ng-polymorpheus', {
|
14
|
+
name: '@taiga-ui/polymorpheus',
|
15
|
+
version: '^4.6.4',
|
16
|
+
}, tree);
|
17
|
+
(0, steps_1.replacePackageName)('@tinkoff/ng-event-plugins', {
|
18
|
+
name: '@taiga-ui/event-plugins',
|
19
|
+
version: '^4.0.1',
|
20
|
+
}, tree);
|
21
|
+
(0, steps_1.replacePackageName)('@tinkoff/tui-editor', {
|
22
|
+
name: '@taiga-ui/editor',
|
23
|
+
version: '^2.0.0',
|
24
|
+
}, tree);
|
25
|
+
if (!(0, ng_morph_1.getPackageJsonDependency)(tree, '@taiga-ui/event-plugins')) {
|
26
|
+
(0, ng_morph_1.addPackageJsonDependency)(tree, {
|
27
|
+
name: '@taiga-ui/event-plugins',
|
28
|
+
version: '^4.0.1',
|
29
|
+
});
|
30
|
+
}
|
31
|
+
if ((0, ng_morph_1.getImports)(constants_1.ALL_TS_FILES, { moduleSpecifier: '@taiga-ui/layout' }).length) {
|
32
|
+
(0, ng_morph_1.addPackageJsonDependency)(tree, {
|
33
|
+
name: '@taiga-ui/layout',
|
34
|
+
version: version_1.TUI_VERSION,
|
35
|
+
});
|
36
|
+
}
|
37
|
+
if ((0, ng_morph_1.getImports)(constants_1.ALL_TS_FILES, { moduleSpecifier: '@taiga-ui/legacy' }).length) {
|
38
|
+
(0, ng_morph_1.addPackageJsonDependency)(tree, {
|
39
|
+
name: '@taiga-ui/legacy',
|
40
|
+
version: version_1.TUI_VERSION,
|
41
|
+
});
|
42
|
+
}
|
43
|
+
}
|
44
|
+
exports.updatePackages = updatePackages;
|
@@ -2,7 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.removeAttrs = void 0;
|
4
4
|
function removeAttrs(attrs, sourceCodeLocation, recorder, templateOffset) {
|
5
|
-
attrs.forEach(attr => {
|
5
|
+
attrs.forEach((attr) => {
|
6
6
|
var _a;
|
7
7
|
const attrOffset = (_a = sourceCodeLocation.attrs) === null || _a === void 0 ? void 0 : _a[attr.name];
|
8
8
|
if (attrOffset) {
|
@@ -0,0 +1,51 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.replaceModulesWithProviders = 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
|
+
const replaceModulesWithProviders = (options, list) => {
|
10
|
+
!options['skip-logs'] &&
|
11
|
+
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing modules with providers...`);
|
12
|
+
list.forEach(replaceModule);
|
13
|
+
!options['skip-logs'] &&
|
14
|
+
(0, colored_log_1.successLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} modules replaced \n`);
|
15
|
+
};
|
16
|
+
exports.replaceModulesWithProviders = replaceModulesWithProviders;
|
17
|
+
function replaceModule({ from, to }) {
|
18
|
+
const references = (0, get_named_import_references_1.getNamedImportReferences)(from.name, from.moduleSpecifier);
|
19
|
+
const toReplace = Array.isArray(to) ? to : [to];
|
20
|
+
references.forEach((ref) => {
|
21
|
+
if (ref.wasForgotten()) {
|
22
|
+
return;
|
23
|
+
}
|
24
|
+
const parent = ref.getParent();
|
25
|
+
if (ng_morph_1.Node.isImportSpecifier(parent)) {
|
26
|
+
(0, import_manipulations_1.removeImport)(parent);
|
27
|
+
toReplace.forEach((provider) => addImport(provider, parent.getSourceFile().getFilePath()));
|
28
|
+
}
|
29
|
+
else if (ng_morph_1.Node.isArrayLiteralExpression(parent)) {
|
30
|
+
const index = parent
|
31
|
+
.getElements()
|
32
|
+
.findIndex((el) => el.getText() === from.name);
|
33
|
+
parent.removeElement(index);
|
34
|
+
toReplace.forEach((provider) => addProvider(provider, parent.getSourceFile().getFilePath()));
|
35
|
+
}
|
36
|
+
});
|
37
|
+
}
|
38
|
+
function addImport(identifier, filePath) {
|
39
|
+
(0, add_unique_import_1.addUniqueImport)(filePath, identifier.name, identifier.providerSpecifier);
|
40
|
+
}
|
41
|
+
function addProvider(identifier, filePath) {
|
42
|
+
const provider = `${identifier.name}${identifier.isFunction ? '()' : ''}`;
|
43
|
+
const componentClass = (0, ng_morph_1.getNgComponents)(filePath)[0];
|
44
|
+
if (componentClass) {
|
45
|
+
(0, ng_morph_1.addProviderToComponent)(componentClass, provider);
|
46
|
+
}
|
47
|
+
const moduleClass = (0, ng_morph_1.getNgModules)(filePath)[0];
|
48
|
+
if (moduleClass) {
|
49
|
+
(0, ng_morph_1.addProviderToNgModule)(moduleClass, provider);
|
50
|
+
}
|
51
|
+
}
|
@@ -9,7 +9,7 @@ function replaceSubstring(text, replacement) {
|
|
9
9
|
function replaceSubstrings(text, replacements) {
|
10
10
|
let transformed = text;
|
11
11
|
let acc = 0;
|
12
|
-
replacements.forEach(replacement => {
|
12
|
+
replacements.forEach((replacement) => {
|
13
13
|
replacement.start += acc;
|
14
14
|
transformed = replaceSubstring(transformed, replacement);
|
15
15
|
acc += replacement.to.length - replacement.from.length;
|
@@ -13,6 +13,7 @@ function runMigration(before) {
|
|
13
13
|
const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
|
14
14
|
(0, ng_morph_1.setActiveProject)((0, ng_morph_1.createProject)(host));
|
15
15
|
(0, ng_morph_1.createSourceFile)('test/app/test.component.ts', before);
|
16
|
+
(0, ng_morph_1.createSourceFile)('package.json', '{}');
|
16
17
|
(0, ng_morph_1.saveActiveProject)();
|
17
18
|
const tree = yield runner.runSchematic('updateToV4', { 'skip-logs': process.env['TUI_CI'] === 'true' }, host);
|
18
19
|
return tree.readContent('test/app/test.component.ts');
|
@@ -16,7 +16,7 @@ function addUniqueImport(filePath, namedImport, moduleSpecifier) {
|
|
16
16
|
if (existingDeclaration.length) {
|
17
17
|
const modules = existingDeclaration[0]
|
18
18
|
.getNamedImports()
|
19
|
-
.map(namedImport => namedImport.getText());
|
19
|
+
.map((namedImport) => namedImport.getText());
|
20
20
|
(0, ng_morph_1.editImports)(existingDeclaration[0], () => ({
|
21
21
|
namedImports: [...modules, namedImport],
|
22
22
|
}));
|