@taiga-ui/cdk 2.46.0 → 2.49.0
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/abstract/controller.d.ts +6 -0
- package/abstract/taiga-ui-cdk-abstract.metadata.json +1 -1
- package/bundles/taiga-ui-cdk-abstract.umd.js +62 -20
- package/bundles/taiga-ui-cdk-abstract.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-abstract.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-abstract.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-alert-host.umd.js +50 -20
- package/bundles/taiga-ui-cdk-components-alert-host.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-alert-host.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-components-alert-host.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-dialog-host.umd.js +50 -20
- package/bundles/taiga-ui-cdk-components-dialog-host.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-dialog-host.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-components-dialog-host.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js +50 -20
- package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-dropdown-host.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-components-dropdown-host.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-portal-host.umd.js +50 -20
- package/bundles/taiga-ui-cdk-components-portal-host.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-portal-host.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-components-portal-host.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.js +28 -1
- package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-date-time.umd.js +50 -20
- package/bundles/taiga-ui-cdk-date-time.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-date-time.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-date-time.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-decorators.umd.js +50 -20
- package/bundles/taiga-ui-cdk-decorators.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-decorators.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-decorators.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-active-zone.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-active-zone.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-active-zone.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-active-zone.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js +146 -55
- package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-auto-focus.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-auto-focus.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-autofilled.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-autofilled.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-autofilled.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-autofilled.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-checked.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-checked.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-checked.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-checked.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-copy-processor.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-copy-processor.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-copy-processor.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-copy-processor.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-drag.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-drag.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-drag.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-drag.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-droppable.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-droppable.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-droppable.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-droppable.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-element.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-element.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-element.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-element.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-focus-trap.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-focus-trap.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-focus-trap.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-focus-trap.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-focus-visible.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-focus-visible.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-focus-visible.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-focus-visible.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-focusable.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-focusable.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-focusable.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-focusable.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-focused.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-focused.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-focused.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-focused.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-for-async.umd.js +325 -0
- package/bundles/taiga-ui-cdk-directives-for-async.umd.js.map +1 -0
- package/bundles/taiga-ui-cdk-directives-for-async.umd.min.js +2 -0
- package/bundles/taiga-ui-cdk-directives-for-async.umd.min.js.map +1 -0
- package/bundles/taiga-ui-cdk-directives-for.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-for.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-for.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-for.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-high-dpi.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-high-dpi.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-high-dpi.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-high-dpi.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-hovered.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-hovered.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-hovered.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-hovered.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-input-mode.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-input-mode.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-input-mode.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-input-mode.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-item.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-item.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-item.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-item.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-let.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-let.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-let.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-let.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-media.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-media.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-media.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-media.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-obscured.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-obscured.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-obscured.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-obscured.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-overscroll.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-overscroll.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-overscroll.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-overscroll.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-pan.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-pan.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-pan.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-pan.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-portal.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-portal.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-portal.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-portal.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-pressed.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-pressed.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-pressed.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-pressed.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-prevent-default.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-prevent-default.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-prevent-default.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-prevent-default.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-repeat-times.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-repeat-times.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-repeat-times.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-repeat-times.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-resize.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-resize.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-resize.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-resize.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-swipe.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-swipe.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-swipe.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-swipe.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-validator.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-validator.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-validator.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-validator.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-zoom.umd.js +50 -20
- package/bundles/taiga-ui-cdk-directives-zoom.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-zoom.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-directives-zoom.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives.umd.js +12 -4
- package/bundles/taiga-ui-cdk-directives.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-enums.umd.js +12 -0
- package/bundles/taiga-ui-cdk-enums.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-enums.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-enums.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-exceptions.umd.js +50 -20
- package/bundles/taiga-ui-cdk-exceptions.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-exceptions.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-exceptions.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-pipes-filter.umd.js +50 -20
- package/bundles/taiga-ui-cdk-pipes-filter.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-pipes-filter.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-pipes-filter.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-pipes-mapper.umd.js +50 -20
- package/bundles/taiga-ui-cdk-pipes-mapper.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-pipes-mapper.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-pipes-mapper.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-services.umd.js +50 -20
- package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-services.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-services.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.js +68 -20
- package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-tokens.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-browser.umd.js +2 -2
- package/bundles/taiga-ui-cdk-utils-browser.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-browser.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-utils-browser.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-focus.umd.js +1 -1
- package/bundles/taiga-ui-cdk-utils-focus.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-focus.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-utils-focus.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-os.umd.js +17 -3
- package/bundles/taiga-ui-cdk-utils-os.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-os.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-utils-os.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-svg.umd.js +50 -20
- package/bundles/taiga-ui-cdk-utils-svg.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-svg.umd.min.js +1 -15
- package/bundles/taiga-ui-cdk-utils-svg.umd.min.js.map +1 -1
- package/constants/taiga-ui-cdk-constants.metadata.json +1 -1
- package/constants/unicode-chars.d.ts +25 -1
- package/directives/auto-focus/autofocus.options.d.ts +1 -1
- package/directives/auto-focus/handlers/ios.handler.d.ts +26 -1
- package/directives/auto-focus/taiga-ui-cdk-directives-auto-focus.metadata.json +1 -1
- package/directives/for-async/for-async.directive.d.ts +13 -0
- package/directives/for-async/for-async.module.d.ts +5 -0
- package/directives/for-async/index.d.ts +2 -0
- package/directives/for-async/package.json +13 -0
- package/directives/for-async/taiga-ui-cdk-directives-for-async.d.ts +4 -0
- package/directives/for-async/taiga-ui-cdk-directives-for-async.metadata.json +1 -0
- package/directives/index.d.ts +1 -0
- package/directives/taiga-ui-cdk-directives.metadata.json +1 -1
- package/enums/autocomplete.d.ts +10 -0
- package/enums/taiga-ui-cdk-enums.metadata.json +1 -1
- package/esm2015/abstract/controller.js +7 -1
- package/esm2015/constants/unicode-chars.js +26 -2
- package/esm2015/directives/auto-focus/autofocus.options.js +7 -6
- package/esm2015/directives/auto-focus/handlers/ios.handler.js +80 -29
- package/esm2015/directives/for-async/for-async.directive.js +48 -0
- package/esm2015/directives/for-async/for-async.module.js +16 -0
- package/esm2015/directives/for-async/index.js +3 -0
- package/esm2015/directives/for-async/taiga-ui-cdk-directives-for-async.js +5 -0
- package/esm2015/directives/index.js +2 -1
- package/esm2015/enums/autocomplete.js +12 -1
- package/esm2015/tokens/index.js +4 -1
- package/esm2015/tokens/is-chromium.js +6 -0
- package/esm2015/tokens/is-firefox.js +9 -0
- package/esm2015/tokens/is-webkit.js +6 -0
- package/esm2015/utils/browser/is-edge-older-than.js +2 -2
- package/esm2015/utils/browser/is-safari.js +2 -2
- package/esm2015/utils/focus/get-native-focused.js +2 -2
- package/esm2015/utils/os/index.js +2 -1
- package/esm2015/utils/os/is-apple-platform.js +14 -0
- package/esm2015/utils/os/is-ios.js +4 -4
- package/esm5/abstract/controller.js +14 -1
- package/esm5/constants/unicode-chars.js +26 -2
- package/esm5/directives/auto-focus/autofocus.options.js +7 -6
- package/esm5/directives/auto-focus/handlers/ios.handler.js +92 -30
- package/esm5/directives/for-async/for-async.directive.js +53 -0
- package/esm5/directives/for-async/for-async.module.js +19 -0
- package/esm5/directives/for-async/index.js +3 -0
- package/esm5/directives/for-async/taiga-ui-cdk-directives-for-async.js +5 -0
- package/esm5/directives/index.js +2 -1
- package/esm5/enums/autocomplete.js +12 -1
- package/esm5/tokens/index.js +4 -1
- package/esm5/tokens/is-chromium.js +6 -0
- package/esm5/tokens/is-firefox.js +9 -0
- package/esm5/tokens/is-webkit.js +6 -0
- package/esm5/utils/browser/is-edge-older-than.js +2 -2
- package/esm5/utils/browser/is-safari.js +2 -2
- package/esm5/utils/focus/get-native-focused.js +2 -2
- package/esm5/utils/os/index.js +2 -1
- package/esm5/utils/os/is-apple-platform.js +14 -0
- package/esm5/utils/os/is-ios.js +4 -4
- package/fesm2015/taiga-ui-cdk-abstract.js +7 -1
- package/fesm2015/taiga-ui-cdk-abstract.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-constants.js +26 -2
- package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-auto-focus.js +84 -33
- package/fesm2015/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-for-async.js +66 -0
- package/fesm2015/taiga-ui-cdk-directives-for-async.js.map +1 -0
- package/fesm2015/taiga-ui-cdk-directives.js +1 -0
- package/fesm2015/taiga-ui-cdk-directives.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-enums.js +11 -0
- package/fesm2015/taiga-ui-cdk-enums.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-tokens.js +16 -1
- package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-browser.js +2 -2
- package/fesm2015/taiga-ui-cdk-utils-browser.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-focus.js +1 -1
- package/fesm2015/taiga-ui-cdk-utils-focus.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-os.js +17 -4
- package/fesm2015/taiga-ui-cdk-utils-os.js.map +1 -1
- package/fesm5/taiga-ui-cdk-abstract.js +12 -1
- package/fesm5/taiga-ui-cdk-abstract.js.map +1 -1
- package/fesm5/taiga-ui-cdk-constants.js +26 -2
- package/fesm5/taiga-ui-cdk-constants.js.map +1 -1
- package/fesm5/taiga-ui-cdk-directives-auto-focus.js +96 -34
- package/fesm5/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
- package/fesm5/taiga-ui-cdk-directives-for-async.js +74 -0
- package/fesm5/taiga-ui-cdk-directives-for-async.js.map +1 -0
- package/fesm5/taiga-ui-cdk-directives.js +1 -0
- package/fesm5/taiga-ui-cdk-directives.js.map +1 -1
- package/fesm5/taiga-ui-cdk-enums.js +11 -0
- package/fesm5/taiga-ui-cdk-enums.js.map +1 -1
- package/fesm5/taiga-ui-cdk-tokens.js +16 -1
- package/fesm5/taiga-ui-cdk-tokens.js.map +1 -1
- package/fesm5/taiga-ui-cdk-utils-browser.js +2 -2
- package/fesm5/taiga-ui-cdk-utils-browser.js.map +1 -1
- package/fesm5/taiga-ui-cdk-utils-focus.js +1 -1
- package/fesm5/taiga-ui-cdk-utils-focus.js.map +1 -1
- package/fesm5/taiga-ui-cdk-utils-os.js +17 -4
- package/fesm5/taiga-ui-cdk-utils-os.js.map +1 -1
- package/package.json +4 -1
- package/schematics/ng-update/constants/consts.d.ts +7 -7
- package/schematics/ng-update/constants/consts.js +38 -0
- package/schematics/ng-update/constants/enums.d.ts +3 -3
- package/schematics/ng-update/constants/enums.js +22 -0
- package/schematics/ng-update/constants/services.d.ts +8 -0
- package/schematics/ng-update/constants/services.js +43 -0
- package/schematics/ng-update/constants/templates.d.ts +17 -0
- package/schematics/ng-update/constants/templates.js +44 -0
- package/schematics/ng-update/constants/types.d.ts +4 -3
- package/schematics/ng-update/constants/types.js +60 -0
- package/schematics/ng-update/constants/warnings.d.ts +6 -0
- package/schematics/ng-update/constants/warnings.js +45 -0
- package/schematics/ng-update/index.js +8 -0
- package/schematics/ng-update/interfaces/template-resourse.d.ts +8 -0
- package/schematics/ng-update/interfaces/template-resourse.js +2 -0
- package/schematics/ng-update/steps/migrate-sliders/index.d.ts +2 -0
- package/schematics/ng-update/steps/migrate-sliders/index.js +7 -0
- package/schematics/ng-update/steps/migrate-sliders/migrate-input-slider.d.ts +2 -0
- package/schematics/ng-update/steps/migrate-sliders/migrate-input-slider.js +24 -0
- package/schematics/ng-update/steps/migrate-templates.d.ts +2 -0
- package/schematics/ng-update/steps/migrate-templates.js +57 -0
- package/schematics/ng-update/steps/rename-types.js +27 -11
- package/schematics/ng-update/steps/replace-const.js +2 -2
- package/schematics/ng-update/steps/replace-enums.js +2 -2
- package/schematics/ng-update/steps/replace-services.d.ts +1 -0
- package/schematics/ng-update/steps/replace-services.js +51 -0
- package/schematics/ng-update/steps/show-warnings.d.ts +2 -0
- package/schematics/ng-update/steps/show-warnings.js +35 -0
- package/schematics/utils/angular/ng-component.d.ts +3 -0
- package/schematics/utils/angular/ng-component.js +7 -0
- package/schematics/utils/angular/ng-module.d.ts +7 -0
- package/schematics/utils/angular/ng-module.js +21 -0
- package/schematics/utils/{remove-import.d.ts → import-manipulations.d.ts} +1 -0
- package/schematics/utils/import-manipulations.js +19 -0
- package/schematics/utils/templates/elements.d.ts +2 -0
- package/schematics/utils/templates/elements.js +21 -0
- package/schematics/utils/templates/get-component-templates.d.ts +4 -0
- package/schematics/utils/templates/get-component-templates.js +36 -0
- package/schematics/utils/templates/ng-component-input-manipulations.d.ts +45 -0
- package/schematics/utils/templates/ng-component-input-manipulations.js +78 -0
- package/schematics/utils/templates/template-resource.d.ts +5 -0
- package/schematics/utils/templates/template-resource.js +21 -0
- package/tokens/index.d.ts +3 -0
- package/tokens/is-chromium.d.ts +2 -0
- package/tokens/is-firefox.d.ts +2 -0
- package/tokens/is-webkit.d.ts +2 -0
- package/tokens/taiga-ui-cdk-tokens.metadata.json +1 -1
- package/utils/os/index.d.ts +1 -0
- package/utils/os/is-apple-platform.d.ts +11 -0
- package/utils/os/taiga-ui-cdk-utils-os.metadata.json +1 -1
- package/schematics/utils/remove-import.js +0 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
interface ReplacementEnum {
|
|
2
|
-
name: string;
|
|
3
|
-
replaceValues: Record<string, string>;
|
|
4
|
-
keepAsType?: boolean;
|
|
2
|
+
readonly name: string;
|
|
3
|
+
readonly replaceValues: Record<string, string>;
|
|
4
|
+
readonly keepAsType?: boolean;
|
|
5
5
|
}
|
|
6
6
|
export declare const ENUMS_TO_REPLACE: ReplacementEnum[];
|
|
7
7
|
export {};
|
|
@@ -56,6 +56,19 @@ exports.ENUMS_TO_REPLACE = [
|
|
|
56
56
|
None: 'none',
|
|
57
57
|
},
|
|
58
58
|
},
|
|
59
|
+
{
|
|
60
|
+
name: 'TuiInputMode',
|
|
61
|
+
replaceValues: {
|
|
62
|
+
None: 'none',
|
|
63
|
+
Text: 'text',
|
|
64
|
+
Decimal: 'decimal',
|
|
65
|
+
Numeric: 'numeric',
|
|
66
|
+
Tel: 'tel',
|
|
67
|
+
Email: 'email',
|
|
68
|
+
Url: 'url',
|
|
69
|
+
Search: 'search',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
59
72
|
{
|
|
60
73
|
name: 'TuiStepState',
|
|
61
74
|
replaceValues: {
|
|
@@ -171,4 +184,13 @@ exports.ENUMS_TO_REPLACE = [
|
|
|
171
184
|
},
|
|
172
185
|
keepAsType: false,
|
|
173
186
|
},
|
|
187
|
+
{
|
|
188
|
+
name: 'TuiTouchMode',
|
|
189
|
+
replaceValues: {
|
|
190
|
+
Transform: 'transform',
|
|
191
|
+
Opacity: 'opacity',
|
|
192
|
+
Background: 'background',
|
|
193
|
+
},
|
|
194
|
+
keepAsType: true,
|
|
195
|
+
},
|
|
174
196
|
];
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SERVICES_TO_REPLACE = [
|
|
4
|
+
{
|
|
5
|
+
from: {
|
|
6
|
+
name: 'TuiPortalService',
|
|
7
|
+
},
|
|
8
|
+
to: {
|
|
9
|
+
name: 'TuiDropdownPortalService',
|
|
10
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
from: {
|
|
15
|
+
name: 'TuiNotificationsService',
|
|
16
|
+
},
|
|
17
|
+
to: {
|
|
18
|
+
name: 'TuiAlertService',
|
|
19
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
|
20
|
+
},
|
|
21
|
+
replaceMethods: [
|
|
22
|
+
{
|
|
23
|
+
from: 'show',
|
|
24
|
+
to: 'open',
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
from: {
|
|
30
|
+
name: 'TuiCodeEditor',
|
|
31
|
+
},
|
|
32
|
+
to: {
|
|
33
|
+
name: 'TuiCodeEditor',
|
|
34
|
+
moduleSpecifier: '@taiga-ui/addon-doc',
|
|
35
|
+
},
|
|
36
|
+
replaceMethods: [
|
|
37
|
+
{
|
|
38
|
+
from: 'open',
|
|
39
|
+
to: 'edit',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ReplacementAttributes {
|
|
2
|
+
readonly from: {
|
|
3
|
+
readonly attrName: string;
|
|
4
|
+
readonly withTagNames?: string[];
|
|
5
|
+
readonly withAttrsNames?: string[];
|
|
6
|
+
};
|
|
7
|
+
readonly to: {
|
|
8
|
+
readonly attrName: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface ReplacementTags {
|
|
12
|
+
readonly from: string;
|
|
13
|
+
readonly to: string;
|
|
14
|
+
readonly addAttributes: string[];
|
|
15
|
+
}
|
|
16
|
+
export declare const ATTRS_TO_REPLACE: ReplacementAttributes[];
|
|
17
|
+
export declare const TAGS_TO_REPLACE: ReplacementTags[];
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ATTRS_TO_REPLACE = [
|
|
4
|
+
{
|
|
5
|
+
from: { attrName: 'tuiResizableColumn', withAttrsNames: ['tuiResizableColumn'] },
|
|
6
|
+
to: { attrName: 'tuiTh [resizable]="true"' },
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
from: { attrName: 'new', withTagNames: ['tui-editor'] },
|
|
10
|
+
to: { attrName: '' },
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
from: {
|
|
14
|
+
attrName: '[hovered]',
|
|
15
|
+
withTagNames: ['tui-wrapper'],
|
|
16
|
+
withAttrsNames: ['tuiWrapper'],
|
|
17
|
+
},
|
|
18
|
+
to: {
|
|
19
|
+
attrName: '[hover]',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
from: {
|
|
24
|
+
attrName: '[pressed]',
|
|
25
|
+
withTagNames: ['tui-wrapper'],
|
|
26
|
+
withAttrsNames: ['tuiWrapper'],
|
|
27
|
+
},
|
|
28
|
+
to: {
|
|
29
|
+
attrName: '[active]',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
exports.TAGS_TO_REPLACE = [
|
|
34
|
+
{
|
|
35
|
+
from: 'tui-group',
|
|
36
|
+
to: 'div',
|
|
37
|
+
addAttributes: ['tuiGroup'],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
from: 'tui-wrapper',
|
|
41
|
+
to: 'div',
|
|
42
|
+
addAttributes: ['tuiWrapper'],
|
|
43
|
+
},
|
|
44
|
+
];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
interface TypeToRename {
|
|
2
|
-
from: string;
|
|
3
|
-
to
|
|
4
|
-
moduleSpecifier?: string | string[];
|
|
2
|
+
readonly from: string;
|
|
3
|
+
readonly to?: string;
|
|
4
|
+
readonly moduleSpecifier?: string | string[];
|
|
5
|
+
readonly preserveGenerics?: boolean;
|
|
5
6
|
}
|
|
6
7
|
export declare const TYPES_TO_RENAME: readonly TypeToRename[];
|
|
7
8
|
export {};
|
|
@@ -6,6 +6,26 @@ exports.TYPES_TO_RENAME = [
|
|
|
6
6
|
to: 'TuiButtonOptions',
|
|
7
7
|
moduleSpecifier: ['@taiga-ui/core'],
|
|
8
8
|
},
|
|
9
|
+
{
|
|
10
|
+
from: 'InputCountOptions',
|
|
11
|
+
to: 'TuiInputCountOptions',
|
|
12
|
+
moduleSpecifier: ['@taiga-ui/kit'],
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
from: 'InputPasswordOptions',
|
|
16
|
+
to: 'TuiInputPasswordOptions',
|
|
17
|
+
moduleSpecifier: ['@taiga-ui/kit'],
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
from: 'InputTimeOptions',
|
|
21
|
+
to: 'TuiInputTimeOptions',
|
|
22
|
+
moduleSpecifier: ['@taiga-ui/kit'],
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
from: 'ToggleOptions',
|
|
26
|
+
to: 'TuiToggleOptions',
|
|
27
|
+
moduleSpecifier: ['@taiga-ui/cdk'],
|
|
28
|
+
},
|
|
9
29
|
{
|
|
10
30
|
from: 'RadioOptions',
|
|
11
31
|
to: 'TuiRadioOptions',
|
|
@@ -16,4 +36,44 @@ exports.TYPES_TO_RENAME = [
|
|
|
16
36
|
to: 'TuiCodeEditor',
|
|
17
37
|
moduleSpecifier: ['@taiga-ui/addon-doc'],
|
|
18
38
|
},
|
|
39
|
+
{
|
|
40
|
+
from: 'WithDateMaskPipeConfig',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
from: 'TuiBreadCrumbsItem',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
from: 'CheckboxOptions',
|
|
47
|
+
to: 'TuiCheckboxOptions',
|
|
48
|
+
moduleSpecifier: ['@taiga-ui/core'],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
from: 'NotificationTokenOptions',
|
|
52
|
+
to: 'TuiNotificationDefaultOptions',
|
|
53
|
+
moduleSpecifier: ['@taiga-ui/core'],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
from: 'TuiNotificationAutoClose',
|
|
57
|
+
to: 'TuiAlertAutoClose',
|
|
58
|
+
moduleSpecifier: ['@taiga-ui/core'],
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
from: 'TuiNotificationOptions',
|
|
62
|
+
to: 'TuiAlertOptions<any>',
|
|
63
|
+
moduleSpecifier: ['@taiga-ui/core'],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
from: 'TuiNotificationOptionsWithData',
|
|
67
|
+
to: 'TuiAlertOptions',
|
|
68
|
+
moduleSpecifier: ['@taiga-ui/core'],
|
|
69
|
+
preserveGenerics: true,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
from: 'Country',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
from: 'NumberFormatSettings',
|
|
76
|
+
to: 'TuiNumberFormatSettings',
|
|
77
|
+
moduleSpecifier: ['@taiga-ui/core'],
|
|
78
|
+
},
|
|
19
79
|
];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MIGRATION_WARNINGS = [
|
|
4
|
+
{
|
|
5
|
+
name: 'TUI_MOBILE_AWARE',
|
|
6
|
+
message: 'TUI_MOBILE_AWARE has been deleted in 3.0, please use TuiMobileTabsDirective from @taiga-ui/addon-mobile',
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
name: 'TUI_DATE_FILLER',
|
|
10
|
+
message: 'TUI_DATE_FILLER has been deleted in 3.0, please use TUI_DATE_FORMAT + TUI_DATE_SEPARATOR from @taiga-ui/cdk. Read more: https://taiga-ui.dev/components/input-date',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: 'TUI_DATE_RANGE_FILLER',
|
|
14
|
+
message: 'TUI_DATE_RANGE_FILLER has been deleted in 3.0, please use TUI_DATE_FORMAT + TUI_DATE_SEPARATOR from @taiga-ui/cdk. Read more: https://taiga-ui.dev/components/input-date-range',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'TUI_SHEET_OFFSET',
|
|
18
|
+
message: 'TUI_SHEET_OFFSET has been deleted in 3.0, please use option argument for each Sheet. Read more: https://taiga-ui.dev/components/sheet',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'COUNTRIES',
|
|
22
|
+
moduleSpecifier: '@taiga-ui/kit',
|
|
23
|
+
message: 'Use DI-token TUI_COUNTRIES_MASKS to get phone mask by country iso code. Use DI-token TUI_COUNTRIES to get localized country name by its iso code',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'COUNTRIES_MASKS',
|
|
27
|
+
moduleSpecifier: '@taiga-ui/kit',
|
|
28
|
+
message: 'Use DI-token TUI_COUNTRIES_MASKS to get phone mask by country iso code',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'TuiTableModeModule',
|
|
32
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
33
|
+
message: 'TuiTableModeModule has been deleted in 3.0, please use @taiga-ui/addon-table',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'TuiColorModule',
|
|
37
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
38
|
+
message: 'TuiColorModule has been deleted in 3.0, please use CSS custom properties',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'TuiPluralizePipeModule',
|
|
42
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
43
|
+
message: 'TuiPluralizePipeModule has been deleted in 3.0, please use use Angular built-in pipe https://angular.io/api/common/I18nPluralPipe ',
|
|
44
|
+
},
|
|
45
|
+
];
|
|
@@ -7,6 +7,10 @@ const replace_enums_1 = require("./steps/replace-enums");
|
|
|
7
7
|
const rename_types_1 = require("./steps/rename-types");
|
|
8
8
|
const replace_const_1 = require("./steps/replace-const");
|
|
9
9
|
const replace_deep_import_1 = require("./steps/replace-deep-import");
|
|
10
|
+
const show_warnings_1 = require("./steps/show-warnings");
|
|
11
|
+
const replace_services_1 = require("./steps/replace-services");
|
|
12
|
+
const migrate_templates_1 = require("./steps/migrate-templates");
|
|
13
|
+
const migrate_sliders_1 = require("./steps/migrate-sliders");
|
|
10
14
|
function updateToV3(_) {
|
|
11
15
|
return (tree, context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
16
|
context.logger.info(`taiga packages will be updated to ${versions_1.TAIGA_VERSION}`);
|
|
@@ -15,6 +19,10 @@ function updateToV3(_) {
|
|
|
15
19
|
replace_enums_1.replaceEnums();
|
|
16
20
|
rename_types_1.renameTypes();
|
|
17
21
|
replace_const_1.replaceConsts();
|
|
22
|
+
replace_services_1.replaceServices();
|
|
23
|
+
show_warnings_1.showWarnings(context);
|
|
24
|
+
migrate_templates_1.migrateTemplates(tree);
|
|
25
|
+
migrate_sliders_1.migrateSliders(tree);
|
|
18
26
|
ng_morph_1.saveActiveProject();
|
|
19
27
|
});
|
|
20
28
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const migrate_input_slider_1 = require("./migrate-input-slider");
|
|
4
|
+
function migrateSliders(tree) {
|
|
5
|
+
migrate_input_slider_1.migrateInputSlider(tree);
|
|
6
|
+
}
|
|
7
|
+
exports.migrateSliders = migrateSliders;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const get_component_templates_1 = require("../../../utils/templates/get-component-templates");
|
|
4
|
+
const devkit_file_system_1 = require("ng-morph/project/classes/devkit-file-system");
|
|
5
|
+
const ng_component_input_manipulations_1 = require("../../../utils/templates/ng-component-input-manipulations");
|
|
6
|
+
function migrateInputSlider(tree) {
|
|
7
|
+
const fileSystem = new devkit_file_system_1.DevkitFileSystem(tree);
|
|
8
|
+
const templateResources = get_component_templates_1.getComponentTemplates('**/**');
|
|
9
|
+
for (const templateResource of templateResources) {
|
|
10
|
+
ng_component_input_manipulations_1.replaceInputPropertyByDirective({
|
|
11
|
+
templateResource,
|
|
12
|
+
fileSystem,
|
|
13
|
+
componentSelector: 'tui-input-slider',
|
|
14
|
+
inputProperty: 'secondary',
|
|
15
|
+
directive: 'tuiTextfieldCustomContent',
|
|
16
|
+
directiveModule: {
|
|
17
|
+
name: 'TuiTextfieldControllerModule',
|
|
18
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
fileSystem.commitEdits();
|
|
23
|
+
}
|
|
24
|
+
exports.migrateInputSlider = migrateInputSlider;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const get_component_templates_1 = require("../../utils/templates/get-component-templates");
|
|
4
|
+
const templates_1 = require("../constants/templates");
|
|
5
|
+
const schematics_1 = require("@angular/cdk/schematics");
|
|
6
|
+
const elements_1 = require("../../utils/templates/elements");
|
|
7
|
+
const devkit_file_system_1 = require("ng-morph/project/classes/devkit-file-system");
|
|
8
|
+
const START_TAG_OFFSET = 1;
|
|
9
|
+
const END_TAG_OFFSET = 2;
|
|
10
|
+
function migrateTemplates(tree) {
|
|
11
|
+
const templateResources = get_component_templates_1.getComponentTemplates('**/**');
|
|
12
|
+
const fileSystem = new devkit_file_system_1.DevkitFileSystem(tree);
|
|
13
|
+
templateResources.forEach((resource) => {
|
|
14
|
+
if ('template' in resource) {
|
|
15
|
+
const template = resource.template;
|
|
16
|
+
const path = fileSystem.resolve(resource.componentPath);
|
|
17
|
+
const recorder = fileSystem.edit(path);
|
|
18
|
+
processTemplateUrl(template, recorder, resource.offset);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
const path = fileSystem.resolve(resource.templatePath);
|
|
22
|
+
const template = fileSystem.read(path);
|
|
23
|
+
const recorder = fileSystem.edit(path);
|
|
24
|
+
processTemplateUrl(template, recorder);
|
|
25
|
+
}
|
|
26
|
+
fileSystem.commitEdits();
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
exports.migrateTemplates = migrateTemplates;
|
|
30
|
+
function processTemplateUrl(template, recorder, templateOffset = 0) {
|
|
31
|
+
templates_1.ATTRS_TO_REPLACE.forEach(({ from, to }) => {
|
|
32
|
+
const offsets = [
|
|
33
|
+
...schematics_1.findAttributeOnElementWithTag(template, from.attrName, from.withTagNames || []),
|
|
34
|
+
...schematics_1.findAttributeOnElementWithAttrs(template, from.attrName, from.withAttrsNames || []),
|
|
35
|
+
];
|
|
36
|
+
offsets.forEach(offset => {
|
|
37
|
+
recorder.remove(offset + templateOffset, from.attrName.length + (to.attrName.length ? 0 : 1));
|
|
38
|
+
recorder.insertRight(offset + templateOffset, to.attrName);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
templates_1.TAGS_TO_REPLACE.forEach(({ from, to, addAttributes }) => {
|
|
42
|
+
const elements = elements_1.findElementsByTagName(template, from);
|
|
43
|
+
elements.forEach(({ sourceCodeLocation }) => {
|
|
44
|
+
var _a;
|
|
45
|
+
if (sourceCodeLocation) {
|
|
46
|
+
const startTagOffset = sourceCodeLocation.startTag.startOffset;
|
|
47
|
+
const endTagOffset = (_a = sourceCodeLocation.endTag) === null || _a === void 0 ? void 0 : _a.startOffset;
|
|
48
|
+
if (endTagOffset) {
|
|
49
|
+
recorder.remove(endTagOffset + templateOffset + END_TAG_OFFSET, from.length);
|
|
50
|
+
recorder.insertRight(endTagOffset + templateOffset + END_TAG_OFFSET, to);
|
|
51
|
+
}
|
|
52
|
+
recorder.remove(startTagOffset + templateOffset + START_TAG_OFFSET, from.length);
|
|
53
|
+
recorder.insertRight(startTagOffset + templateOffset + START_TAG_OFFSET, `${to} ${addAttributes.join(' ')}`);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
}
|
|
@@ -1,27 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const get_named_import_references_1 = require("../../utils/get-named-import-references");
|
|
4
3
|
const ng_morph_1 = require("ng-morph");
|
|
4
|
+
const get_named_import_references_1 = require("../../utils/get-named-import-references");
|
|
5
5
|
const types_1 = require("../constants/types");
|
|
6
|
+
const import_manipulations_1 = require("../../utils/import-manipulations");
|
|
6
7
|
function renameTypes() {
|
|
7
|
-
types_1.TYPES_TO_RENAME.forEach(({ from, to, moduleSpecifier }) => {
|
|
8
|
-
renameType(from, to, moduleSpecifier);
|
|
8
|
+
types_1.TYPES_TO_RENAME.forEach(({ from, to, moduleSpecifier, preserveGenerics }) => {
|
|
9
|
+
renameType(from, to, moduleSpecifier, preserveGenerics);
|
|
9
10
|
});
|
|
10
11
|
}
|
|
11
12
|
exports.renameTypes = renameTypes;
|
|
12
|
-
function renameType(from, to, moduleSpecifier) {
|
|
13
|
+
function renameType(from, to, moduleSpecifier, preserveGenerics = false) {
|
|
13
14
|
const references = get_named_import_references_1.getNamedImportReferences(from, moduleSpecifier);
|
|
14
|
-
|
|
15
|
+
references.forEach(ref => {
|
|
15
16
|
const parent = ref.getParent();
|
|
16
17
|
if (ng_morph_1.Node.isImportSpecifier(parent)) {
|
|
17
|
-
|
|
18
|
-
.getImportDeclaration()
|
|
19
|
-
.getNamedImports()
|
|
20
|
-
.find(specifier => specifier.getName() === from);
|
|
21
|
-
namedImport === null || namedImport === void 0 ? void 0 : namedImport.replaceWithText(to);
|
|
18
|
+
processImport(parent, from, to);
|
|
22
19
|
}
|
|
23
20
|
else if (ng_morph_1.Node.isTypeReferenceNode(parent)) {
|
|
24
|
-
parent.
|
|
21
|
+
const targetType = preserveGenerics && to ? addGeneric(to, parent.getTypeArguments()) : to;
|
|
22
|
+
parent.replaceWithText(targetType || 'any');
|
|
25
23
|
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function processImport(node, from, to) {
|
|
27
|
+
const filePath = node.getSourceFile().getFilePath();
|
|
28
|
+
const targetImportAlreadyExists = Boolean(ng_morph_1.getImports(filePath, { namedImports: to }).length);
|
|
29
|
+
if (to && !targetImportAlreadyExists) {
|
|
30
|
+
import_manipulations_1.renameImport(node, removeGeneric(to), removeGeneric(from));
|
|
26
31
|
}
|
|
32
|
+
else {
|
|
33
|
+
import_manipulations_1.removeImport(node);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function removeGeneric(type) {
|
|
37
|
+
return type.replace(/<.*>$/gi, '');
|
|
38
|
+
}
|
|
39
|
+
function addGeneric(typeName, generics) {
|
|
40
|
+
const typeArgs = generics.map(t => t.getType().getText());
|
|
41
|
+
const genericType = typeArgs.length ? `<${typeArgs.join(', ')}>` : '';
|
|
42
|
+
return typeName + genericType;
|
|
27
43
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const get_named_import_references_1 = require("../../utils/get-named-import-references");
|
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
|
5
|
-
const
|
|
5
|
+
const import_manipulations_1 = require("../../utils/import-manipulations");
|
|
6
6
|
const add_unique_import_1 = require("../../utils/add-unique-import");
|
|
7
7
|
const consts_1 = require("../constants/consts");
|
|
8
8
|
function replaceConsts() {
|
|
@@ -14,7 +14,7 @@ function replaceConst({ from, to }) {
|
|
|
14
14
|
for (let ref of references) {
|
|
15
15
|
const parent = ref.getParent();
|
|
16
16
|
if (ng_morph_1.Node.isImportSpecifier(parent)) {
|
|
17
|
-
|
|
17
|
+
import_manipulations_1.removeImport(parent);
|
|
18
18
|
add_unique_import_1.addUniqueImport(parent.getSourceFile().getFilePath(), to.namedImport || to.name, to.moduleSpecifier);
|
|
19
19
|
}
|
|
20
20
|
else {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const ng_morph_1 = require("ng-morph");
|
|
4
4
|
const get_named_import_references_1 = require("../../utils/get-named-import-references");
|
|
5
5
|
const enums_1 = require("../constants/enums");
|
|
6
|
-
const
|
|
6
|
+
const import_manipulations_1 = require("../../utils/import-manipulations");
|
|
7
7
|
function replaceEnums() {
|
|
8
8
|
enums_1.ENUMS_TO_REPLACE.forEach(({ name, replaceValues, keepAsType }) => {
|
|
9
9
|
replaceEnumWithString(name, replaceValues, keepAsType);
|
|
@@ -15,7 +15,7 @@ function replaceEnumWithString(enumName, replaceValues, keepAsType = true) {
|
|
|
15
15
|
for (let ref of references) {
|
|
16
16
|
const parent = ref.getParent();
|
|
17
17
|
if (ng_morph_1.Node.isImportSpecifier(parent) && !(keepAsType && containTypeRef(parent))) {
|
|
18
|
-
|
|
18
|
+
import_manipulations_1.removeImport(parent);
|
|
19
19
|
continue;
|
|
20
20
|
}
|
|
21
21
|
if (ng_morph_1.Node.isTypeReferenceNode(parent) && !keepAsType) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function replaceServices(): void;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const services_1 = require("../constants/services");
|
|
4
|
+
const get_named_import_references_1 = require("../../utils/get-named-import-references");
|
|
5
|
+
const ng_morph_1 = require("ng-morph");
|
|
6
|
+
const import_manipulations_1 = require("../../utils/import-manipulations");
|
|
7
|
+
const add_unique_import_1 = require("../../utils/add-unique-import");
|
|
8
|
+
function replaceServices() {
|
|
9
|
+
services_1.SERVICES_TO_REPLACE.forEach(service => replaceService(service));
|
|
10
|
+
}
|
|
11
|
+
exports.replaceServices = replaceServices;
|
|
12
|
+
function replaceService({ from, to, replaceMethods }) {
|
|
13
|
+
const references = get_named_import_references_1.getNamedImportReferences(from.name, from.moduleSpecifier);
|
|
14
|
+
references.forEach(ref => {
|
|
15
|
+
const parent = ref.getParent();
|
|
16
|
+
if (ng_morph_1.Node.isImportSpecifier(parent)) {
|
|
17
|
+
import_manipulations_1.removeImport(parent);
|
|
18
|
+
add_unique_import_1.addUniqueImport(parent.getSourceFile().getFilePath(), to.namedImport || to.name, to.moduleSpecifier);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (ng_morph_1.Node.isTypeReferenceNode(parent) && (replaceMethods === null || replaceMethods === void 0 ? void 0 : replaceMethods.length)) {
|
|
22
|
+
replaceProperties(parent, replaceMethods);
|
|
23
|
+
}
|
|
24
|
+
ref.replaceWithText(to.name);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function replaceProperties(parent, replaceProperties) {
|
|
28
|
+
const statement = parent.getParent();
|
|
29
|
+
const identifier = statement.getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier)[0];
|
|
30
|
+
identifier.findReferencesAsNodes().forEach(ref => {
|
|
31
|
+
let parent = ref.getParent();
|
|
32
|
+
if ((ng_morph_1.Node.isPropertyAccessExpression(parent) &&
|
|
33
|
+
parent.getText().startsWith('this.')) ||
|
|
34
|
+
ng_morph_1.Node.isCallExpression(parent)) {
|
|
35
|
+
parent = parent.getParentIfKind(ng_morph_1.SyntaxKind.PropertyAccessExpression);
|
|
36
|
+
}
|
|
37
|
+
if (ng_morph_1.Node.isPropertyAccessExpression(parent)) {
|
|
38
|
+
replaceProperty(parent, replaceProperties);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function replaceProperty(node, properties) {
|
|
44
|
+
const identifiers = node.getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier);
|
|
45
|
+
identifiers.forEach(identifier => {
|
|
46
|
+
const property = properties === null || properties === void 0 ? void 0 : properties.find(property => property.from === identifier.getText());
|
|
47
|
+
if (property) {
|
|
48
|
+
identifier.replaceWithText(property.to);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ng_morph_1 = require("ng-morph");
|
|
4
|
+
const warnings_1 = require("../constants/warnings");
|
|
5
|
+
function showWarnings(context) {
|
|
6
|
+
warnings_1.MIGRATION_WARNINGS.forEach(warning => showWarning(warning, context));
|
|
7
|
+
}
|
|
8
|
+
exports.showWarnings = showWarnings;
|
|
9
|
+
function showWarning({ name, message, moduleSpecifier = '**/**' }, { logger }) {
|
|
10
|
+
const references = ng_morph_1.getImports('**/**', {
|
|
11
|
+
moduleSpecifier,
|
|
12
|
+
namedImports: [name],
|
|
13
|
+
})
|
|
14
|
+
.map(i => { var _a; return (_a = i
|
|
15
|
+
.getNamedImports()
|
|
16
|
+
.find(namedImport => namedImport.getName() === name)) === null || _a === void 0 ? void 0 : _a.getNameNode(); })
|
|
17
|
+
.filter((namedImport) => Boolean(namedImport));
|
|
18
|
+
const referencesMeta = references.map(ref => {
|
|
19
|
+
const sourceFile = ref.getSourceFile();
|
|
20
|
+
return {
|
|
21
|
+
sourceFile,
|
|
22
|
+
filePath: sourceFile.getFilePath().toString(),
|
|
23
|
+
startLinePos: ref.getStartLinePos(),
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* We have to twice iterate array with refs because otherwise we get error:
|
|
28
|
+
* > Attempted to get information from a node that was removed or forgotten.
|
|
29
|
+
* See this {@link https://ts-morph.com/manipulation/#strongwarningstrong warning}
|
|
30
|
+
*/
|
|
31
|
+
referencesMeta.forEach(({ sourceFile, filePath, startLinePos }) => {
|
|
32
|
+
logger.warn(`[WARNING] in ${filePath}: ${message}`);
|
|
33
|
+
sourceFile.insertText(startLinePos, `// TODO: ${message}\n`);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ng_morph_1 = require("ng-morph");
|
|
4
|
+
function getNgComponents(pattern, query) {
|
|
5
|
+
return ng_morph_1.getClasses(pattern, query).filter(declaration => !!declaration.getDecorator('Component'));
|
|
6
|
+
}
|
|
7
|
+
exports.getNgComponents = getNgComponents;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ClassDeclaration, Pattern, Query } from 'ng-morph';
|
|
2
|
+
import { StructureType } from 'ng-morph/utils/types/structure-type';
|
|
3
|
+
export declare function getNgModules(pattern: Pattern, query?: Query<Omit<StructureType<ClassDeclaration>, 'kind'>>): ClassDeclaration[];
|
|
4
|
+
/**
|
|
5
|
+
* Find NgModule where the component was declared.
|
|
6
|
+
*/
|
|
7
|
+
export declare function findNgModule(ngComponent: ClassDeclaration): ClassDeclaration | null;
|