@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
@@ -1,78 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.migratePolymorpheus = void 0;
|
4
|
-
const elements_1 = require("../../../utils/templates/elements");
|
5
|
-
const ng_component_input_manipulations_1 = require("../../../utils/templates/ng-component-input-manipulations");
|
6
|
-
const template_resource_1 = require("../../../utils/templates/template-resource");
|
7
|
-
const replace_tag_1 = require("../../utils/templates/replace-tag");
|
8
|
-
function insertPolymorpheus({ element, contentVal, contextVal, recorder, templateOffset, }) {
|
9
|
-
var _a, _b;
|
10
|
-
const content = `
|
11
|
-
<ng-container *polymorpheusOutlet="${contentVal} as text${contextVal ? `; context: ${contextVal}` : ''}">
|
12
|
-
{{ text }}
|
13
|
-
</ng-container>`;
|
14
|
-
const insertTo = (_b = (_a = element.sourceCodeLocation) === null || _a === void 0 ? void 0 : _a.startTag) === null || _b === void 0 ? void 0 : _b.endOffset;
|
15
|
-
if (insertTo) {
|
16
|
-
recorder.insertRight(insertTo + templateOffset, content);
|
17
|
-
}
|
18
|
-
}
|
19
|
-
function removeOldInputs(recorder, template, templateOffset) {
|
20
|
-
const offsets = [
|
21
|
-
...(0, ng_component_input_manipulations_1.getInputPropertyOffsets)(template, '[content]', ['*'], el => (0, elements_1.hasElementAttribute)(el, 'polymorpheus-outlet')),
|
22
|
-
...(0, ng_component_input_manipulations_1.getInputPropertyOffsets)(template, '[context]', ['*'], el => (0, elements_1.hasElementAttribute)(el, 'polymorpheus-outlet')),
|
23
|
-
...(0, ng_component_input_manipulations_1.getInputPropertyOffsets)(template, 'polymorpheus-outlet', ['*'], el => (0, elements_1.hasElementAttribute)(el, 'polymorpheus-outlet')),
|
24
|
-
];
|
25
|
-
offsets.forEach(([start, end]) => {
|
26
|
-
recorder.remove(start + templateOffset, end - start);
|
27
|
-
});
|
28
|
-
}
|
29
|
-
function insertPolymorpheusWithDefault({ template, defaultTemplateEl, recorder, templateOffset, contentVal, contextVal, }) {
|
30
|
-
var _a, _b;
|
31
|
-
const templateVar = defaultTemplateEl.attrs.find(attr => attr.name.startsWith('let-'));
|
32
|
-
let templateVarName = templateVar === null || templateVar === void 0 ? void 0 : templateVar.name;
|
33
|
-
if (templateVarName === null || templateVarName === void 0 ? void 0 : templateVarName.startsWith('let-')) {
|
34
|
-
templateVarName = (_a = template.match(new RegExp(templateVarName, 'i'))) === null || _a === void 0 ? void 0 : _a[0];
|
35
|
-
}
|
36
|
-
const varName = templateVarName === null || templateVarName === void 0 ? void 0 : templateVarName.replace('let-', '');
|
37
|
-
const attr = `*polymorpheusOutlet="${contentVal} as ${varName}${contextVal ? `; context: ${contextVal}` : ''}"`;
|
38
|
-
(0, replace_tag_1.replaceTag)(recorder, defaultTemplateEl.sourceCodeLocation, 'ng-template', 'ng-container', templateOffset, [attr]);
|
39
|
-
if (((_b = defaultTemplateEl.sourceCodeLocation) === null || _b === void 0 ? void 0 : _b.attrs) && (templateVar === null || templateVar === void 0 ? void 0 : templateVar.name)) {
|
40
|
-
recorder.remove(defaultTemplateEl.sourceCodeLocation.attrs[templateVar.name].startOffset +
|
41
|
-
templateOffset, templateVar.name.length);
|
42
|
-
}
|
43
|
-
}
|
44
|
-
function migratePolymorpheus({ resource, fileSystem, recorder, }) {
|
45
|
-
const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem);
|
46
|
-
const templateOffset = (0, template_resource_1.getTemplateOffset)(resource);
|
47
|
-
const elements = (0, elements_1.findElementsWithAttribute)(template, 'polymorpheus-outlet');
|
48
|
-
elements.forEach(element => {
|
49
|
-
var _a, _b;
|
50
|
-
const contentVal = (_a = element.attrs.find(attr => attr.name === '[content]')) === null || _a === void 0 ? void 0 : _a.value;
|
51
|
-
const contextVal = (_b = element.attrs.find(attr => attr.name === '[context]')) === null || _b === void 0 ? void 0 : _b.value;
|
52
|
-
const defaultTemplateEl = (0, elements_1.findElementsByFn)(element.childNodes, el => el.tagName === 'ng-template')[0];
|
53
|
-
if (!contentVal) {
|
54
|
-
return;
|
55
|
-
}
|
56
|
-
if (defaultTemplateEl) {
|
57
|
-
insertPolymorpheusWithDefault({
|
58
|
-
template,
|
59
|
-
defaultTemplateEl,
|
60
|
-
recorder,
|
61
|
-
templateOffset,
|
62
|
-
contentVal,
|
63
|
-
contextVal,
|
64
|
-
});
|
65
|
-
}
|
66
|
-
else {
|
67
|
-
insertPolymorpheus({
|
68
|
-
element,
|
69
|
-
contentVal,
|
70
|
-
contextVal,
|
71
|
-
recorder,
|
72
|
-
templateOffset,
|
73
|
-
});
|
74
|
-
}
|
75
|
-
});
|
76
|
-
removeOldInputs(recorder, template, templateOffset);
|
77
|
-
}
|
78
|
-
exports.migratePolymorpheus = migratePolymorpheus;
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import type { DevkitFileSystem } from 'ng-morph';
|
2
|
-
import type { Element } from 'parse5/dist/tree-adapters/default';
|
3
|
-
import type { TuiSchema } from '../../../ng-add/schema';
|
4
|
-
import type { TemplateResource } from '../../interfaces/template-resource';
|
5
|
-
export declare const DEPRECATED_PROGRESS_PIPES_REG: RegExp;
|
6
|
-
export declare function replaceProgressColorSegmentsPipe(templateResource: TemplateResource, fileSystem: DevkitFileSystem): void;
|
7
|
-
export declare function isProgressWithDeprecatedPipe(element: Element): boolean;
|
8
|
-
export declare function migrateProgress(fileSystem: DevkitFileSystem, options: TuiSchema): void;
|
@@ -1,49 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.migrateProgress = exports.isProgressWithDeprecatedPipe = exports.replaceProgressColorSegmentsPipe = exports.DEPRECATED_PROGRESS_PIPES_REG = void 0;
|
4
|
-
const ng_morph_1 = require("ng-morph");
|
5
|
-
const constants_1 = require("../../../constants");
|
6
|
-
const colored_log_1 = require("../../../utils/colored-log");
|
7
|
-
const project_root_1 = require("../../../utils/project-root");
|
8
|
-
const elements_1 = require("../../../utils/templates/elements");
|
9
|
-
const get_component_templates_1 = require("../../../utils/templates/get-component-templates");
|
10
|
-
const template_resource_1 = require("../../../utils/templates/template-resource");
|
11
|
-
const PROPERTY_FOR_DEPRECATED_PIPES = '[color]';
|
12
|
-
exports.DEPRECATED_PROGRESS_PIPES_REG = /\s*\|\s*tuiProgressColorSegments(Async\s*\|\s*async)?/gi;
|
13
|
-
function replaceProgressColorSegmentsPipe(templateResource, fileSystem) {
|
14
|
-
const template = (0, template_resource_1.getTemplateFromTemplateResource)(templateResource, fileSystem);
|
15
|
-
const templateOffset = (0, template_resource_1.getTemplateOffset)(templateResource);
|
16
|
-
const path = fileSystem.resolve((0, template_resource_1.getPathFromTemplateResource)(templateResource));
|
17
|
-
const recorder = fileSystem.edit(path);
|
18
|
-
(0, elements_1.findElementsWithAttribute)(template, PROPERTY_FOR_DEPRECATED_PIPES)
|
19
|
-
.filter(isProgressWithDeprecatedPipe)
|
20
|
-
.forEach(progressEl => {
|
21
|
-
var _a, _b;
|
22
|
-
const oldValue = ((_a = progressEl.attrs.find(attr => attr.name === PROPERTY_FOR_DEPRECATED_PIPES)) === null || _a === void 0 ? void 0 : _a.value) || '';
|
23
|
-
const newValue = oldValue.replaceAll(exports.DEPRECATED_PROGRESS_PIPES_REG, '');
|
24
|
-
const attrLocations = (_b = progressEl.sourceCodeLocation) === null || _b === void 0 ? void 0 : _b.attrs;
|
25
|
-
if (attrLocations) {
|
26
|
-
const { startOffset, endOffset } = attrLocations[PROPERTY_FOR_DEPRECATED_PIPES];
|
27
|
-
recorder.remove(templateOffset + startOffset, endOffset - startOffset);
|
28
|
-
recorder.insertRight(templateOffset + startOffset, `[tuiProgressColorSegments]="${newValue}"`);
|
29
|
-
}
|
30
|
-
});
|
31
|
-
}
|
32
|
-
exports.replaceProgressColorSegmentsPipe = replaceProgressColorSegmentsPipe;
|
33
|
-
function isProgressWithDeprecatedPipe(element) {
|
34
|
-
return (element.tagName === 'progress' &&
|
35
|
-
element.attrs.some(attr => attr.name === PROPERTY_FOR_DEPRECATED_PIPES &&
|
36
|
-
attr.value.match(exports.DEPRECATED_PROGRESS_PIPES_REG)));
|
37
|
-
}
|
38
|
-
exports.isProgressWithDeprecatedPipe = isProgressWithDeprecatedPipe;
|
39
|
-
function migrateProgress(fileSystem, options) {
|
40
|
-
!options['skip-logs'] &&
|
41
|
-
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating progress bars...`);
|
42
|
-
(0, get_component_templates_1.getComponentTemplates)(constants_1.ALL_TS_FILES).forEach(templateResource => replaceProgressColorSegmentsPipe(templateResource, fileSystem));
|
43
|
-
fileSystem.commitEdits();
|
44
|
-
(0, ng_morph_1.saveActiveProject)();
|
45
|
-
(0, ng_morph_1.setActiveProject)((0, ng_morph_1.createProject)(fileSystem.tree, (0, project_root_1.projectRoot)(), constants_1.ALL_FILES));
|
46
|
-
!options['skip-logs'] &&
|
47
|
-
(0, colored_log_1.successLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} progress bars migrated \n`);
|
48
|
-
}
|
49
|
-
exports.migrateProgress = migrateProgress;
|
@@ -1,19 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.migrateSliders = void 0;
|
4
|
-
const colored_log_1 = require("../../../../utils/colored-log");
|
5
|
-
const migrate_input_range_1 = require("./migrate-input-range");
|
6
|
-
const migrate_input_slider_1 = require("./migrate-input-slider");
|
7
|
-
function migrateSliders(fileSystem, options) {
|
8
|
-
!options['skip-logs'] &&
|
9
|
-
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating sliders...`);
|
10
|
-
!options['skip-logs'] &&
|
11
|
-
(0, colored_log_1.processLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}InputSlider...`);
|
12
|
-
(0, migrate_input_slider_1.migrateInputSlider)(fileSystem, options);
|
13
|
-
!options['skip-logs'] &&
|
14
|
-
(0, colored_log_1.processLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}InputRange...`);
|
15
|
-
(0, migrate_input_range_1.migrateInputRange)(fileSystem, options);
|
16
|
-
!options['skip-logs'] &&
|
17
|
-
(0, colored_log_1.successLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} sliders migrated \n`);
|
18
|
-
}
|
19
|
-
exports.migrateSliders = migrateSliders;
|
@@ -1,103 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.migrateInputRange = void 0;
|
4
|
-
const ng_morph_1 = require("ng-morph");
|
5
|
-
const constants_1 = require("../../../../constants");
|
6
|
-
const add_unique_import_1 = require("../../../../utils/add-unique-import");
|
7
|
-
const progress_1 = require("../../../../utils/progress");
|
8
|
-
const project_root_1 = require("../../../../utils/project-root");
|
9
|
-
const get_component_templates_1 = require("../../../../utils/templates/get-component-templates");
|
10
|
-
const ng_component_input_manipulations_1 = require("../../../../utils/templates/ng-component-input-manipulations");
|
11
|
-
const MIN_LABELS_MIGRATION_METHOD_NAME = 'tuiMigrationInputRangeMinLabel';
|
12
|
-
const MAX_LABELS_MIGRATION_METHOD_NAME = 'tuiMigrationInputRangeMaxLabel';
|
13
|
-
function replaceMinLabel(templateResource, fileSystem, modifiedComponentStorage) {
|
14
|
-
const wasModified = (0, ng_component_input_manipulations_1.replaceInputProperty)({
|
15
|
-
templateResource,
|
16
|
-
fileSystem,
|
17
|
-
componentSelector: 'tui-input-range',
|
18
|
-
from: 'minLabel',
|
19
|
-
to: '[leftValueContent]',
|
20
|
-
newValue: MIN_LABELS_MIGRATION_METHOD_NAME,
|
21
|
-
});
|
22
|
-
if (wasModified) {
|
23
|
-
modifiedComponentStorage.add(templateResource.componentPath);
|
24
|
-
}
|
25
|
-
}
|
26
|
-
function replaceMaxLabel(templateResource, fileSystem, modifiedComponentStorage) {
|
27
|
-
const wasModified = (0, ng_component_input_manipulations_1.replaceInputProperty)({
|
28
|
-
templateResource,
|
29
|
-
fileSystem,
|
30
|
-
componentSelector: 'tui-input-range',
|
31
|
-
from: 'maxLabel',
|
32
|
-
to: '[rightValueContent]',
|
33
|
-
newValue: MAX_LABELS_MIGRATION_METHOD_NAME,
|
34
|
-
});
|
35
|
-
if (wasModified) {
|
36
|
-
modifiedComponentStorage.add(templateResource.componentPath);
|
37
|
-
}
|
38
|
-
}
|
39
|
-
function addMinMaxLabelMethod(componentPath, methodName, methodCode) {
|
40
|
-
const [ngComponent] = (0, ng_morph_1.getNgComponents)(componentPath);
|
41
|
-
if (ngComponent) {
|
42
|
-
(0, add_unique_import_1.addUniqueImport)(ngComponent.getSourceFile().getFilePath(), 'TuiContextWithImplicit', '@taiga-ui/cdk');
|
43
|
-
(0, ng_morph_1.addMethods)(ngComponent, {
|
44
|
-
name: methodName,
|
45
|
-
returnType: 'string',
|
46
|
-
parameters: [{ name: 'context', type: 'TuiContextWithImplicit<number>' }],
|
47
|
-
statements: methodCode,
|
48
|
-
});
|
49
|
-
}
|
50
|
-
}
|
51
|
-
/**
|
52
|
-
* We should update virtual file tree after template manipulations
|
53
|
-
* otherwise all following ng-morph commands will overwrite all previous template manipulations
|
54
|
-
* */
|
55
|
-
function save(fileSystem) {
|
56
|
-
fileSystem.commitEdits();
|
57
|
-
(0, ng_morph_1.saveActiveProject)();
|
58
|
-
(0, ng_morph_1.setActiveProject)((0, ng_morph_1.createProject)(fileSystem.tree, (0, project_root_1.projectRoot)(), constants_1.ALL_FILES));
|
59
|
-
}
|
60
|
-
function migrateInputRange(fileSystem, options) {
|
61
|
-
const templateResources = (0, get_component_templates_1.getComponentTemplates)(constants_1.ALL_TS_FILES);
|
62
|
-
const COMPONENTS_WITH_MIN_LABELS = new Set();
|
63
|
-
const COMPONENTS_WITH_MAX_LABELS = new Set();
|
64
|
-
let progressLog = (0, progress_1.setupProgressLogger)({
|
65
|
-
total: templateResources.length,
|
66
|
-
prefix: '[replaceMinMaxLabel]',
|
67
|
-
});
|
68
|
-
templateResources.forEach(templateResource => {
|
69
|
-
!options['skip-logs'] && progressLog(templateResource.componentPath);
|
70
|
-
replaceMinLabel(templateResource, fileSystem, COMPONENTS_WITH_MIN_LABELS);
|
71
|
-
replaceMaxLabel(templateResource, fileSystem, COMPONENTS_WITH_MAX_LABELS);
|
72
|
-
});
|
73
|
-
save(fileSystem);
|
74
|
-
progressLog = (0, progress_1.setupProgressLogger)({
|
75
|
-
total: COMPONENTS_WITH_MIN_LABELS.size,
|
76
|
-
prefix: '[COMPONENTS_WITH_MIN_LABELS]',
|
77
|
-
});
|
78
|
-
Array.from(COMPONENTS_WITH_MIN_LABELS).forEach(componentPath => {
|
79
|
-
!options['skip-logs'] && progressLog(componentPath);
|
80
|
-
addMinMaxLabelMethod(componentPath, MIN_LABELS_MIGRATION_METHOD_NAME, [
|
81
|
-
'const currentValue = context.$implicit;',
|
82
|
-
'const minValue = 0; // TODO: (Taiga UI migration) replace with the MIN value of the input-range',
|
83
|
-
'const minLabelText = "Min"; // TODO: (Taiga UI migration) replace with the required label',
|
84
|
-
'if (currentValue === minValue) return minLabelText;',
|
85
|
-
'return String(currentValue);',
|
86
|
-
]);
|
87
|
-
});
|
88
|
-
progressLog = (0, progress_1.setupProgressLogger)({
|
89
|
-
total: COMPONENTS_WITH_MAX_LABELS.size,
|
90
|
-
prefix: '[COMPONENTS_WITH_MAX_LABELS]',
|
91
|
-
});
|
92
|
-
Array.from(COMPONENTS_WITH_MAX_LABELS).forEach(componentPath => {
|
93
|
-
!options['skip-logs'] && progressLog(componentPath);
|
94
|
-
addMinMaxLabelMethod(componentPath, MAX_LABELS_MIGRATION_METHOD_NAME, [
|
95
|
-
'const currentValue = context.$implicit;',
|
96
|
-
'const maxValue = 100; // TODO: (Taiga UI migration) replace with the MAX value of the input',
|
97
|
-
'const maxLabelText = "Max"; // TODO: (Taiga UI migration) replace with the required label',
|
98
|
-
'if (currentValue === maxValue) return maxLabelText;',
|
99
|
-
'return String(currentValue);',
|
100
|
-
]);
|
101
|
-
});
|
102
|
-
}
|
103
|
-
exports.migrateInputRange = migrateInputRange;
|
@@ -1,90 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.migrateInputSlider = void 0;
|
4
|
-
const ng_morph_1 = require("ng-morph");
|
5
|
-
const constants_1 = require("../../../../constants");
|
6
|
-
const add_unique_import_1 = require("../../../../utils/add-unique-import");
|
7
|
-
const progress_1 = require("../../../../utils/progress");
|
8
|
-
const project_root_1 = require("../../../../utils/project-root");
|
9
|
-
const elements_1 = require("../../../../utils/templates/elements");
|
10
|
-
const get_component_templates_1 = require("../../../../utils/templates/get-component-templates");
|
11
|
-
const ng_component_input_manipulations_1 = require("../../../../utils/templates/ng-component-input-manipulations");
|
12
|
-
const MIN_MAX_LABELS_MIGRATION_METHOD_NAME = 'tuiMigrationMinMaxLabel';
|
13
|
-
function replaceMinMaxLabels(templateResource, fileSystem, modifiedComponentStorage) {
|
14
|
-
const wasMaxLabelModified = (0, ng_component_input_manipulations_1.replaceInputProperty)({
|
15
|
-
templateResource,
|
16
|
-
fileSystem,
|
17
|
-
componentSelector: 'tui-input-slider',
|
18
|
-
from: 'maxLabel',
|
19
|
-
to: '[valueContent]',
|
20
|
-
newValue: MIN_MAX_LABELS_MIGRATION_METHOD_NAME,
|
21
|
-
});
|
22
|
-
const wasMinLabelModified = (0, ng_component_input_manipulations_1.replaceInputProperty)({
|
23
|
-
templateResource,
|
24
|
-
fileSystem,
|
25
|
-
componentSelector: 'tui-input-slider',
|
26
|
-
from: 'minLabel',
|
27
|
-
to: '[valueContent]',
|
28
|
-
newValue: MIN_MAX_LABELS_MIGRATION_METHOD_NAME,
|
29
|
-
filterFn: element => !(0, elements_1.hasElementAttribute)(element, 'maxLabel'),
|
30
|
-
});
|
31
|
-
(0, ng_component_input_manipulations_1.removeInputProperty)({
|
32
|
-
templateResource,
|
33
|
-
fileSystem,
|
34
|
-
componentSelector: 'tui-input-slider',
|
35
|
-
inputProperty: 'minLabel',
|
36
|
-
filterFn: element => (0, elements_1.hasElementAttribute)(element, 'maxLabel'),
|
37
|
-
});
|
38
|
-
if (wasMaxLabelModified || wasMinLabelModified) {
|
39
|
-
modifiedComponentStorage.add(templateResource.componentPath);
|
40
|
-
}
|
41
|
-
}
|
42
|
-
function addMinMaxLabelMethod(componentPath) {
|
43
|
-
const [ngComponent] = (0, ng_morph_1.getNgComponents)(componentPath);
|
44
|
-
if (ngComponent) {
|
45
|
-
(0, add_unique_import_1.addUniqueImport)(componentPath, 'TuiContextWithImplicit', '@taiga-ui/cdk');
|
46
|
-
(0, ng_morph_1.addMethods)(ngComponent, {
|
47
|
-
name: MIN_MAX_LABELS_MIGRATION_METHOD_NAME,
|
48
|
-
returnType: 'string',
|
49
|
-
parameters: [{ name: 'context', type: 'TuiContextWithImplicit<number>' }],
|
50
|
-
statements: [
|
51
|
-
'const currentValue = context.$implicit;',
|
52
|
-
'const maxValue = 100; // TODO: (Taiga UI migration) replace with the MAX value of the input',
|
53
|
-
'const maxLabelText = "Max"; // TODO: (Taiga UI migration) replace with the required label',
|
54
|
-
'const minValue = 0; // TODO: (Taiga UI migration) replace with the MIN value of the input',
|
55
|
-
'const minLabelText = "Min"; // TODO: (Taiga UI migration) replace with the required label',
|
56
|
-
'if (currentValue === maxValue) return maxLabelText;',
|
57
|
-
'if (currentValue === minValue) return minLabelText;',
|
58
|
-
'return String(currentValue);',
|
59
|
-
],
|
60
|
-
});
|
61
|
-
}
|
62
|
-
}
|
63
|
-
function migrateInputSlider(fileSystem, options) {
|
64
|
-
const templateResources = (0, get_component_templates_1.getComponentTemplates)(constants_1.ALL_TS_FILES);
|
65
|
-
const COMPONENTS_WITH_MIN_MAX_LABELS = new Set();
|
66
|
-
let progressLog = (0, progress_1.setupProgressLogger)({
|
67
|
-
total: templateResources.length,
|
68
|
-
prefix: '[replaceMinMaxLabels]',
|
69
|
-
});
|
70
|
-
templateResources.forEach(templateResource => {
|
71
|
-
!options['skip-logs'] && progressLog(templateResource.componentPath);
|
72
|
-
replaceMinMaxLabels(templateResource, fileSystem, COMPONENTS_WITH_MIN_MAX_LABELS);
|
73
|
-
});
|
74
|
-
/**
|
75
|
-
* We should update virtual file tree
|
76
|
-
* otherwise all following ng-morph commands will overwrite all previous template manipulations
|
77
|
-
* */
|
78
|
-
fileSystem.commitEdits();
|
79
|
-
(0, ng_morph_1.saveActiveProject)();
|
80
|
-
(0, ng_morph_1.setActiveProject)((0, ng_morph_1.createProject)(fileSystem.tree, (0, project_root_1.projectRoot)(), constants_1.ALL_FILES));
|
81
|
-
progressLog = (0, progress_1.setupProgressLogger)({
|
82
|
-
total: COMPONENTS_WITH_MIN_MAX_LABELS.size,
|
83
|
-
prefix: '[addMinMaxLabelMethod]',
|
84
|
-
});
|
85
|
-
Array.from(COMPONENTS_WITH_MIN_MAX_LABELS).forEach(componentPath => {
|
86
|
-
!options['skip-logs'] && progressLog(componentPath);
|
87
|
-
addMinMaxLabelMethod(componentPath);
|
88
|
-
});
|
89
|
-
}
|
90
|
-
exports.migrateInputSlider = migrateInputSlider;
|
@@ -1,70 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.migrateTaigaProprietaryIcons = void 0;
|
4
|
-
const tslib_1 = require("tslib");
|
5
|
-
const workspace_1 = require("@schematics/angular/utility/workspace");
|
6
|
-
const ng_morph_1 = require("ng-morph");
|
7
|
-
const is_string_1 = require("../../../../utils/miscellaneous/is-string");
|
8
|
-
const angular_json_manipulations_1 = require("../../../utils/angular-json-manipulations");
|
9
|
-
const get_project_target_options_1 = require("../../../utils/get-project-target-options");
|
10
|
-
const get_projects_1 = require("../../../utils/get-projects");
|
11
|
-
const PROPRIETARY_TDS_ICON_ASSETS = {
|
12
|
-
glob: '**/*',
|
13
|
-
input: 'node_modules/@taiga-ui/proprietary-tds-icons/src',
|
14
|
-
output: 'assets/taiga-ui/icons',
|
15
|
-
};
|
16
|
-
const MANUAL_MIGRATION_TIPS = `Add ${JSON.stringify(PROPRIETARY_TDS_ICON_ASSETS, null, 4)} to angular.json manually`;
|
17
|
-
function migrateTaigaProprietaryIcons(options) {
|
18
|
-
return (tree, context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
19
|
-
var _a;
|
20
|
-
let proprietaryIcons = null;
|
21
|
-
try {
|
22
|
-
proprietaryIcons =
|
23
|
-
((_a = (0, ng_morph_1.getPackageJsonDependency)(tree, '@taiga-ui/proprietary-icons')) === null || _a === void 0 ? void 0 : _a.version) ||
|
24
|
-
null;
|
25
|
-
}
|
26
|
-
catch (_b) {
|
27
|
-
// noop
|
28
|
-
}
|
29
|
-
if (yield (0, angular_json_manipulations_1.isInvalidAngularJson)(tree)) {
|
30
|
-
context.logger.warn(`[WARNING]: Schematics don't support this version of angular.json. ${MANUAL_MIGRATION_TIPS}`);
|
31
|
-
return;
|
32
|
-
}
|
33
|
-
return (0, ng_morph_1.getSourceFiles)('**/angular.json').length > 0
|
34
|
-
? (0, workspace_1.updateWorkspace)(workspace => {
|
35
|
-
if (proprietaryIcons === null) {
|
36
|
-
return;
|
37
|
-
}
|
38
|
-
const projects = (0, get_projects_1.getProjects)(options, workspace);
|
39
|
-
if (!projects.length) {
|
40
|
-
context.logger.warn(`[WARNING]: Target project not found. ${MANUAL_MIGRATION_TIPS}`);
|
41
|
-
return;
|
42
|
-
}
|
43
|
-
for (const project of projects) {
|
44
|
-
let targetOptions;
|
45
|
-
try {
|
46
|
-
targetOptions = (0, get_project_target_options_1.getProjectTargetOptions)(project, 'build');
|
47
|
-
}
|
48
|
-
catch (_a) {
|
49
|
-
context.logger.warn(`[WARNING]: No buildable project was found. ${MANUAL_MIGRATION_TIPS}`);
|
50
|
-
return;
|
51
|
-
}
|
52
|
-
if (Array.isArray(targetOptions === null || targetOptions === void 0 ? void 0 : targetOptions.assets)) {
|
53
|
-
const tdsSrc = '@taiga-ui/proprietary-tds-icons/src';
|
54
|
-
const hasIcons = targetOptions.assets.find(asset => {
|
55
|
-
var _a;
|
56
|
-
return (0, is_string_1.tuiIsString)(asset)
|
57
|
-
? asset.includes(tdsSrc)
|
58
|
-
: (_a = asset === null || asset === void 0 ? void 0 : asset.input) === null || _a === void 0 ? void 0 : _a.includes(tdsSrc);
|
59
|
-
});
|
60
|
-
if (hasIcons) {
|
61
|
-
return;
|
62
|
-
}
|
63
|
-
targetOptions.assets.push(PROPRIETARY_TDS_ICON_ASSETS);
|
64
|
-
}
|
65
|
-
}
|
66
|
-
})
|
67
|
-
: () => { };
|
68
|
-
});
|
69
|
-
}
|
70
|
-
exports.migrateTaigaProprietaryIcons = migrateTaigaProprietaryIcons;
|