@taiga-ui/cdk 2.51.0 → 2.53.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/bundles/taiga-ui-cdk-components-alert-host.umd.js +1 -1
- 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 -1
- package/bundles/taiga-ui-cdk-components-alert-host.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js +5 -13
- 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 -1
- package/bundles/taiga-ui-cdk-components-dropdown-host.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.js +9 -0
- 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-directives-hovered.umd.js +29 -14
- package/bundles/taiga-ui-cdk-directives-hovered.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-hovered.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-directives-hovered.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-media.umd.js +2 -0
- package/bundles/taiga-ui-cdk-directives-media.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-media.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-observables.umd.js +56 -0
- package/bundles/taiga-ui-cdk-observables.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-observables.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-observables.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-services.umd.js +1 -0
- package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-services.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.js +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-browser.umd.js +30 -0
- 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-dom.umd.js +69 -2
- package/bundles/taiga-ui-cdk-utils-dom.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-dom.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-utils-dom.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-focus.umd.js +42 -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-format.umd.js +6 -2
- package/bundles/taiga-ui-cdk-utils-format.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-format.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-utils-format.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-math.umd.js +48 -0
- package/bundles/taiga-ui-cdk-utils-math.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-math.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-utils-math.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js +64 -2
- package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-os.umd.js +17 -1
- 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 +5 -1
- package/bundles/taiga-ui-cdk-utils-svg.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-svg.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-utils-svg.umd.min.js.map +1 -1
- package/components/alert-host/taiga-ui-cdk-components-alert-host.metadata.json +1 -1
- package/components/dropdown-host/taiga-ui-cdk-components-dropdown-host.metadata.json +1 -1
- package/constants/empty.d.ts +1 -0
- package/constants/taiga-ui-cdk-constants.metadata.json +1 -1
- package/directives/hovered/hovered.directive.d.ts +5 -5
- package/directives/hovered/taiga-ui-cdk-directives-hovered.metadata.json +1 -1
- package/directives/media/taiga-ui-cdk-directives-media.metadata.json +1 -1
- package/esm2015/components/alert-host/alert-host.component.js +2 -2
- package/esm2015/components/dropdown-host/dropdown-host.component.js +3 -10
- package/esm2015/constants/empty.js +9 -1
- package/esm2015/directives/hovered/hovered.directive.js +28 -13
- package/esm2015/directives/media/media.directive.js +3 -1
- package/esm2015/observables/drag-and-drop-from.js +6 -1
- package/esm2015/observables/focus-visible-observable.js +6 -1
- package/esm2015/observables/items-query-list-observable.js +4 -1
- package/esm2015/observables/mouse-drag-finish-from.js +4 -1
- package/esm2015/observables/must-be-present.js +6 -1
- package/esm2015/observables/pressed-observable.js +6 -1
- package/esm2015/observables/prevent-default.js +6 -1
- package/esm2015/observables/stop-propagation.js +6 -1
- package/esm2015/observables/typed-from-event.js +6 -1
- package/esm2015/observables/watch.js +6 -1
- package/esm2015/services/hovered.service.js +2 -1
- package/esm2015/tokens/is-firefox.js +2 -2
- package/esm2015/utils/browser/is-edge-older-than.js +6 -1
- package/esm2015/utils/browser/is-edge.js +6 -1
- package/esm2015/utils/browser/is-firefox.js +6 -1
- package/esm2015/utils/browser/is-ie.js +6 -1
- package/esm2015/utils/browser/is-safari.js +6 -1
- package/esm2015/utils/dom/can-scroll.js +6 -1
- package/esm2015/utils/dom/contains-or-after.js +6 -1
- package/esm2015/utils/dom/get-actual-target.js +4 -1
- package/esm2015/utils/dom/get-clipboard-data-text.js +4 -1
- package/esm2015/utils/dom/get-closest-element.js +3 -2
- package/esm2015/utils/dom/get-document-or-shadow-root.js +6 -1
- package/esm2015/utils/dom/get-element-obscurers.js +4 -1
- package/esm2015/utils/dom/get-element-offset.js +4 -1
- package/esm2015/utils/dom/get-scroll-parent.js +5 -2
- package/esm2015/utils/dom/index.js +2 -1
- package/esm2015/utils/dom/is-current-target.js +6 -1
- package/esm2015/utils/dom/is-inside-iframe.js +4 -1
- package/esm2015/utils/dom/is-node-in.js +4 -1
- package/esm2015/utils/dom/point-to-client-rect.js +11 -0
- package/esm2015/utils/focus/blur-native-focused.js +4 -1
- package/esm2015/utils/focus/get-closest-keyboard-focusable.js +7 -2
- package/esm2015/utils/focus/get-native-focused.js +4 -1
- package/esm2015/utils/focus/is-native-focused-in.js +4 -1
- package/esm2015/utils/focus/is-native-focused.js +4 -1
- package/esm2015/utils/focus/is-native-keyboard-focusable.js +4 -1
- package/esm2015/utils/focus/is-native-mouse-focusable.js +6 -1
- package/esm2015/utils/focus/move-focus.js +4 -1
- package/esm2015/utils/focus/set-native-focused.js +2 -1
- package/esm2015/utils/focus/set-native-mouse-focused.js +4 -1
- package/esm2015/utils/format/pad-start.js +3 -3
- package/esm2015/utils/format/px.js +4 -1
- package/esm2015/utils/math/clamp.js +4 -1
- package/esm2015/utils/math/in-range.js +4 -1
- package/esm2015/utils/math/normalize-to-int-number.js +4 -1
- package/esm2015/utils/math/quantize.js +4 -1
- package/esm2015/utils/math/round.js +16 -1
- package/esm2015/utils/math/sum.js +4 -1
- package/esm2015/utils/math/to-int.js +6 -1
- package/esm2015/utils/math/to-radians.js +4 -1
- package/esm2015/utils/miscellaneous/distance-between-touches.js +6 -1
- package/esm2015/utils/miscellaneous/ease-in-out-quad.js +6 -1
- package/esm2015/utils/miscellaneous/fallback-value.js +3 -2
- package/esm2015/utils/miscellaneous/flat-length.js +5 -2
- package/esm2015/utils/miscellaneous/get-original-array-from-query-list.js +4 -1
- package/esm2015/utils/miscellaneous/get-swipe-direction.js +6 -1
- package/esm2015/utils/miscellaneous/identity.js +2 -1
- package/esm2015/utils/miscellaneous/is-element-editable.js +6 -1
- package/esm2015/utils/miscellaneous/is-number.js +6 -1
- package/esm2015/utils/miscellaneous/is-present.js +6 -1
- package/esm2015/utils/miscellaneous/mark-control-as-touched-and-validate.js +6 -1
- package/esm2015/utils/miscellaneous/nullable-same.js +4 -1
- package/esm2015/utils/miscellaneous/uniq-by.js +6 -1
- package/esm2015/utils/os/is-apple-platform.js +5 -2
- package/esm2015/utils/os/is-apple.js +6 -1
- package/esm2015/utils/os/is-ios.js +6 -1
- package/esm2015/utils/svg/svg-linear-gradient-processor.js +5 -2
- package/esm5/components/alert-host/alert-host.component.js +2 -2
- package/esm5/components/dropdown-host/dropdown-host.component.js +3 -10
- package/esm5/constants/empty.js +9 -1
- package/esm5/directives/hovered/hovered.directive.js +29 -14
- package/esm5/directives/media/media.directive.js +3 -1
- package/esm5/observables/drag-and-drop-from.js +6 -1
- package/esm5/observables/focus-visible-observable.js +6 -1
- package/esm5/observables/items-query-list-observable.js +4 -1
- package/esm5/observables/mouse-drag-finish-from.js +4 -1
- package/esm5/observables/must-be-present.js +6 -1
- package/esm5/observables/pressed-observable.js +6 -1
- package/esm5/observables/prevent-default.js +6 -1
- package/esm5/observables/stop-propagation.js +6 -1
- package/esm5/observables/typed-from-event.js +6 -1
- package/esm5/observables/watch.js +6 -1
- package/esm5/services/hovered.service.js +2 -1
- package/esm5/tokens/is-firefox.js +2 -2
- package/esm5/utils/browser/is-edge-older-than.js +6 -1
- package/esm5/utils/browser/is-edge.js +6 -1
- package/esm5/utils/browser/is-firefox.js +6 -1
- package/esm5/utils/browser/is-ie.js +6 -1
- package/esm5/utils/browser/is-safari.js +6 -1
- package/esm5/utils/dom/can-scroll.js +6 -1
- package/esm5/utils/dom/contains-or-after.js +6 -1
- package/esm5/utils/dom/get-actual-target.js +4 -1
- package/esm5/utils/dom/get-clipboard-data-text.js +4 -1
- package/esm5/utils/dom/get-closest-element.js +3 -2
- package/esm5/utils/dom/get-document-or-shadow-root.js +6 -1
- package/esm5/utils/dom/get-element-obscurers.js +4 -1
- package/esm5/utils/dom/get-element-offset.js +4 -1
- package/esm5/utils/dom/get-scroll-parent.js +5 -2
- package/esm5/utils/dom/index.js +2 -1
- package/esm5/utils/dom/is-current-target.js +6 -1
- package/esm5/utils/dom/is-inside-iframe.js +4 -1
- package/esm5/utils/dom/is-node-in.js +4 -1
- package/esm5/utils/dom/point-to-client-rect.js +13 -0
- package/esm5/utils/focus/blur-native-focused.js +4 -1
- package/esm5/utils/focus/get-closest-keyboard-focusable.js +7 -2
- package/esm5/utils/focus/get-native-focused.js +4 -1
- package/esm5/utils/focus/is-native-focused-in.js +4 -1
- package/esm5/utils/focus/is-native-focused.js +4 -1
- package/esm5/utils/focus/is-native-keyboard-focusable.js +4 -1
- package/esm5/utils/focus/is-native-mouse-focusable.js +6 -1
- package/esm5/utils/focus/move-focus.js +4 -1
- package/esm5/utils/focus/set-native-focused.js +2 -1
- package/esm5/utils/focus/set-native-mouse-focused.js +4 -1
- package/esm5/utils/format/pad-start.js +3 -3
- package/esm5/utils/format/px.js +4 -1
- package/esm5/utils/math/clamp.js +4 -1
- package/esm5/utils/math/in-range.js +4 -1
- package/esm5/utils/math/normalize-to-int-number.js +4 -1
- package/esm5/utils/math/quantize.js +4 -1
- package/esm5/utils/math/round.js +16 -1
- package/esm5/utils/math/sum.js +4 -1
- package/esm5/utils/math/to-int.js +6 -1
- package/esm5/utils/math/to-radians.js +4 -1
- package/esm5/utils/miscellaneous/distance-between-touches.js +6 -1
- package/esm5/utils/miscellaneous/ease-in-out-quad.js +6 -1
- package/esm5/utils/miscellaneous/fallback-value.js +3 -2
- package/esm5/utils/miscellaneous/flat-length.js +5 -2
- package/esm5/utils/miscellaneous/get-original-array-from-query-list.js +4 -1
- package/esm5/utils/miscellaneous/get-swipe-direction.js +6 -1
- package/esm5/utils/miscellaneous/identity.js +2 -1
- package/esm5/utils/miscellaneous/is-element-editable.js +6 -1
- package/esm5/utils/miscellaneous/is-number.js +6 -1
- package/esm5/utils/miscellaneous/is-present.js +6 -1
- package/esm5/utils/miscellaneous/mark-control-as-touched-and-validate.js +6 -1
- package/esm5/utils/miscellaneous/nullable-same.js +4 -1
- package/esm5/utils/miscellaneous/uniq-by.js +6 -1
- package/esm5/utils/os/is-apple-platform.js +5 -2
- package/esm5/utils/os/is-apple.js +6 -1
- package/esm5/utils/os/is-ios.js +6 -1
- package/esm5/utils/svg/svg-linear-gradient-processor.js +5 -2
- package/fesm2015/taiga-ui-cdk-components-alert-host.js +1 -1
- package/fesm2015/taiga-ui-cdk-components-alert-host.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-components-dropdown-host.js +2 -9
- package/fesm2015/taiga-ui-cdk-components-dropdown-host.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-constants.js +9 -1
- package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-hovered.js +28 -13
- package/fesm2015/taiga-ui-cdk-directives-hovered.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-media.js +2 -0
- package/fesm2015/taiga-ui-cdk-directives-media.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-observables.js +47 -1
- package/fesm2015/taiga-ui-cdk-observables.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-services.js +1 -0
- package/fesm2015/taiga-ui-cdk-services.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-tokens.js +1 -1
- package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-browser.js +26 -1
- package/fesm2015/taiga-ui-cdk-utils-browser.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-dom.js +56 -3
- package/fesm2015/taiga-ui-cdk-utils-dom.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-focus.js +34 -2
- package/fesm2015/taiga-ui-cdk-utils-focus.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-format.js +6 -3
- package/fesm2015/taiga-ui-cdk-utils-format.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-math.js +39 -1
- package/fesm2015/taiga-ui-cdk-utils-math.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js +54 -3
- package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-os.js +15 -2
- package/fesm2015/taiga-ui-cdk-utils-os.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-svg.js +5 -2
- package/fesm2015/taiga-ui-cdk-utils-svg.js.map +1 -1
- package/fesm5/taiga-ui-cdk-components-alert-host.js +1 -1
- package/fesm5/taiga-ui-cdk-components-alert-host.js.map +1 -1
- package/fesm5/taiga-ui-cdk-components-dropdown-host.js +2 -9
- package/fesm5/taiga-ui-cdk-components-dropdown-host.js.map +1 -1
- package/fesm5/taiga-ui-cdk-constants.js +9 -1
- package/fesm5/taiga-ui-cdk-constants.js.map +1 -1
- package/fesm5/taiga-ui-cdk-directives-hovered.js +29 -14
- package/fesm5/taiga-ui-cdk-directives-hovered.js.map +1 -1
- package/fesm5/taiga-ui-cdk-directives-media.js +2 -0
- package/fesm5/taiga-ui-cdk-directives-media.js.map +1 -1
- package/fesm5/taiga-ui-cdk-observables.js +47 -1
- package/fesm5/taiga-ui-cdk-observables.js.map +1 -1
- package/fesm5/taiga-ui-cdk-services.js +1 -0
- package/fesm5/taiga-ui-cdk-services.js.map +1 -1
- package/fesm5/taiga-ui-cdk-tokens.js +1 -1
- package/fesm5/taiga-ui-cdk-tokens.js.map +1 -1
- package/fesm5/taiga-ui-cdk-utils-browser.js +26 -1
- package/fesm5/taiga-ui-cdk-utils-browser.js.map +1 -1
- package/fesm5/taiga-ui-cdk-utils-dom.js +58 -3
- package/fesm5/taiga-ui-cdk-utils-dom.js.map +1 -1
- package/fesm5/taiga-ui-cdk-utils-focus.js +34 -2
- package/fesm5/taiga-ui-cdk-utils-focus.js.map +1 -1
- package/fesm5/taiga-ui-cdk-utils-format.js +6 -3
- package/fesm5/taiga-ui-cdk-utils-format.js.map +1 -1
- package/fesm5/taiga-ui-cdk-utils-math.js +39 -1
- package/fesm5/taiga-ui-cdk-utils-math.js.map +1 -1
- package/fesm5/taiga-ui-cdk-utils-miscellaneous.js +54 -3
- package/fesm5/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
- package/fesm5/taiga-ui-cdk-utils-os.js +15 -2
- package/fesm5/taiga-ui-cdk-utils-os.js.map +1 -1
- package/fesm5/taiga-ui-cdk-utils-svg.js +5 -2
- package/fesm5/taiga-ui-cdk-utils-svg.js.map +1 -1
- package/observables/drag-and-drop-from.d.ts +4 -0
- package/observables/focus-visible-observable.d.ts +4 -0
- package/observables/items-query-list-observable.d.ts +2 -0
- package/observables/mouse-drag-finish-from.d.ts +2 -0
- package/observables/must-be-present.d.ts +4 -0
- package/observables/pressed-observable.d.ts +4 -0
- package/observables/prevent-default.d.ts +4 -0
- package/observables/stop-propagation.d.ts +4 -0
- package/observables/taiga-ui-cdk-observables.metadata.json +1 -1
- package/observables/typed-from-event.d.ts +16 -0
- package/observables/watch.d.ts +4 -0
- package/package.json +1 -1
- package/schematics/ng-update/constants/deprecated-functions.d.ts +2 -0
- package/schematics/ng-update/constants/deprecated-functions.js +714 -0
- package/schematics/ng-update/constants/templates.d.ts +8 -0
- package/schematics/ng-update/constants/templates.js +76 -0
- package/schematics/ng-update/constants/types.d.ts +1 -2
- package/schematics/ng-update/index.js +38 -5
- package/schematics/ng-update/steps/migrate-date-time.d.ts +1 -0
- package/schematics/ng-update/steps/migrate-date-time.js +152 -0
- package/schematics/ng-update/steps/migrate-progress.d.ts +2 -2
- package/schematics/ng-update/steps/migrate-progress.js +1 -3
- package/schematics/ng-update/steps/migrate-sliders/index.d.ts +2 -2
- package/schematics/ng-update/steps/migrate-sliders/index.js +3 -3
- package/schematics/ng-update/steps/migrate-sliders/migrate-input-range.d.ts +2 -2
- package/schematics/ng-update/steps/migrate-sliders/migrate-input-range.js +1 -3
- package/schematics/ng-update/steps/migrate-sliders/migrate-input-slider.d.ts +2 -2
- package/schematics/ng-update/steps/migrate-sliders/migrate-input-slider.js +1 -3
- package/schematics/ng-update/steps/migrate-templates.d.ts +2 -2
- package/schematics/ng-update/steps/migrate-templates.js +63 -24
- package/schematics/ng-update/steps/miscellaneous.js +2 -6
- package/schematics/ng-update/steps/replace-functions.js +12 -0
- package/schematics/ng-update/steps/replace-services.js +5 -1
- package/schematics/utils/colored-log.d.ts +2 -0
- package/schematics/utils/colored-log.js +10 -0
- package/schematics/utils/insert-todo.d.ts +2 -0
- package/schematics/utils/insert-todo.js +8 -0
- package/schematics/utils/templates/elements.d.ts +1 -0
- package/schematics/utils/templates/elements.js +7 -18
- package/schematics/utils/templates/ng-component-input-manipulations.d.ts +2 -1
- package/schematics/utils/templates/ng-component-input-manipulations.js +2 -1
- package/services/hovered.service.d.ts +1 -0
- package/services/taiga-ui-cdk-services.metadata.json +1 -1
- package/utils/browser/is-edge-older-than.d.ts +4 -0
- package/utils/browser/is-edge.d.ts +4 -0
- package/utils/browser/is-firefox.d.ts +4 -0
- package/utils/browser/is-ie.d.ts +4 -0
- package/utils/browser/is-safari.d.ts +4 -0
- package/utils/browser/taiga-ui-cdk-utils-browser.metadata.json +1 -1
- package/utils/dom/can-scroll.d.ts +4 -0
- package/utils/dom/contains-or-after.d.ts +4 -0
- package/utils/dom/get-actual-target.d.ts +2 -0
- package/utils/dom/get-clipboard-data-text.d.ts +2 -0
- package/utils/dom/get-closest-element.d.ts +1 -1
- package/utils/dom/get-document-or-shadow-root.d.ts +4 -0
- package/utils/dom/get-element-obscurers.d.ts +2 -0
- package/utils/dom/get-element-offset.d.ts +2 -0
- package/utils/dom/get-scroll-parent.d.ts +3 -1
- package/utils/dom/index.d.ts +1 -0
- package/utils/dom/is-current-target.d.ts +4 -0
- package/utils/dom/is-inside-iframe.d.ts +2 -0
- package/utils/dom/is-node-in.d.ts +2 -0
- package/utils/dom/point-to-client-rect.d.ts +1 -0
- package/utils/dom/taiga-ui-cdk-utils-dom.metadata.json +1 -1
- package/utils/focus/blur-native-focused.d.ts +2 -0
- package/utils/focus/get-closest-keyboard-focusable.d.ts +5 -1
- package/utils/focus/get-native-focused.d.ts +2 -0
- package/utils/focus/is-native-focused-in.d.ts +2 -0
- package/utils/focus/is-native-focused.d.ts +2 -0
- package/utils/focus/is-native-keyboard-focusable.d.ts +2 -0
- package/utils/focus/is-native-mouse-focusable.d.ts +4 -0
- package/utils/focus/move-focus.d.ts +2 -0
- package/utils/focus/set-native-mouse-focused.d.ts +2 -0
- package/utils/focus/taiga-ui-cdk-utils-focus.metadata.json +1 -1
- package/utils/format/pad-start.d.ts +1 -2
- package/utils/format/px.d.ts +2 -0
- package/utils/format/taiga-ui-cdk-utils-format.metadata.json +1 -1
- package/utils/math/clamp.d.ts +2 -0
- package/utils/math/in-range.d.ts +2 -0
- package/utils/math/normalize-to-int-number.d.ts +2 -0
- package/utils/math/quantize.d.ts +2 -0
- package/utils/math/round.d.ts +12 -0
- package/utils/math/sum.d.ts +2 -0
- package/utils/math/taiga-ui-cdk-utils-math.metadata.json +1 -1
- package/utils/math/to-int.d.ts +4 -0
- package/utils/math/to-radians.d.ts +2 -0
- package/utils/miscellaneous/distance-between-touches.d.ts +4 -0
- package/utils/miscellaneous/ease-in-out-quad.d.ts +4 -0
- package/utils/miscellaneous/fallback-value.d.ts +1 -1
- package/utils/miscellaneous/flat-length.d.ts +3 -1
- package/utils/miscellaneous/get-original-array-from-query-list.d.ts +2 -0
- package/utils/miscellaneous/get-swipe-direction.d.ts +4 -0
- package/utils/miscellaneous/is-element-editable.d.ts +4 -0
- package/utils/miscellaneous/is-number.d.ts +4 -0
- package/utils/miscellaneous/is-present.d.ts +4 -0
- package/utils/miscellaneous/mark-control-as-touched-and-validate.d.ts +4 -0
- package/utils/miscellaneous/nullable-same.d.ts +2 -0
- package/utils/miscellaneous/taiga-ui-cdk-utils-miscellaneous.metadata.json +1 -1
- package/utils/miscellaneous/uniq-by.d.ts +4 -0
- package/utils/os/is-apple-platform.d.ts +3 -1
- package/utils/os/is-apple.d.ts +4 -0
- package/utils/os/is-ios.d.ts +4 -0
- package/utils/os/taiga-ui-cdk-utils-os.metadata.json +1 -1
- package/utils/svg/svg-linear-gradient-processor.d.ts +3 -1
- package/utils/svg/taiga-ui-cdk-utils-svg.metadata.json +1 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { Element } from 'parse5';
|
|
1
2
|
export interface ReplacementAttributes {
|
|
2
3
|
readonly from: {
|
|
3
4
|
readonly attrName: string;
|
|
4
5
|
readonly withTagNames?: string[];
|
|
5
6
|
readonly withAttrsNames?: string[];
|
|
7
|
+
readonly filterFn?: (element: Element) => boolean;
|
|
6
8
|
};
|
|
7
9
|
readonly to: {
|
|
8
10
|
readonly attrName: string;
|
|
@@ -15,6 +17,7 @@ export interface ReplacementTags {
|
|
|
15
17
|
}
|
|
16
18
|
export interface AttributeToDirective {
|
|
17
19
|
readonly componentSelector: string | string[];
|
|
20
|
+
readonly filterFn?: (element: Element) => boolean;
|
|
18
21
|
readonly inputProperty: string;
|
|
19
22
|
readonly directive: string;
|
|
20
23
|
readonly directiveModule: {
|
|
@@ -22,7 +25,12 @@ export interface AttributeToDirective {
|
|
|
22
25
|
readonly moduleSpecifier: string;
|
|
23
26
|
};
|
|
24
27
|
}
|
|
28
|
+
export interface InputToRemove {
|
|
29
|
+
readonly inputName: string;
|
|
30
|
+
readonly tags: string[];
|
|
31
|
+
}
|
|
25
32
|
export declare const ATTRS_TO_REPLACE: ReplacementAttributes[];
|
|
33
|
+
export declare const INPUTS_TO_REMOVE: InputToRemove[];
|
|
26
34
|
export declare const TAGS_TO_REPLACE: ReplacementTags[];
|
|
27
35
|
export declare const ATTR_TO_DIRECTIVE: AttributeToDirective[];
|
|
28
36
|
export declare const TEMPLATE_COMMENTS: readonly [{
|
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tui_interactive_selectors_1 = require("./tui-interactive-selectors");
|
|
4
|
+
const elements_1 = require("../../utils/templates/elements");
|
|
4
5
|
exports.ATTRS_TO_REPLACE = [
|
|
6
|
+
{
|
|
7
|
+
from: {
|
|
8
|
+
attrName: 'icon',
|
|
9
|
+
withTagNames: ['tui-input-tag'],
|
|
10
|
+
filterFn: element => { var _a; return ((_a = element.attrs.find(attr => attr.name === 'iconalign')) === null || _a === void 0 ? void 0 : _a.value) === 'left'; },
|
|
11
|
+
},
|
|
12
|
+
to: {
|
|
13
|
+
attrName: 'iconLeft',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
from: {
|
|
18
|
+
attrName: '[icon]',
|
|
19
|
+
withTagNames: ['tui-input-tag'],
|
|
20
|
+
filterFn: element => { var _a; return ((_a = element.attrs.find(attr => attr.name === 'iconalign')) === null || _a === void 0 ? void 0 : _a.value) === 'left'; },
|
|
21
|
+
},
|
|
22
|
+
to: {
|
|
23
|
+
attrName: '[iconLeft]',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
5
26
|
{
|
|
6
27
|
from: { attrName: 'tuiResizableColumn', withAttrsNames: ['tuiResizableColumn'] },
|
|
7
28
|
to: { attrName: 'tuiTh [resizable]="true"' },
|
|
@@ -51,12 +72,19 @@ exports.ATTRS_TO_REPLACE = [
|
|
|
51
72
|
from: {
|
|
52
73
|
attrName: '[quantum]',
|
|
53
74
|
withAttrsNames: ['tuiSlider'],
|
|
75
|
+
withTagNames: ['tui-slider'],
|
|
54
76
|
},
|
|
55
77
|
to: {
|
|
56
78
|
attrName: '[step]',
|
|
57
79
|
},
|
|
58
80
|
},
|
|
59
81
|
];
|
|
82
|
+
exports.INPUTS_TO_REMOVE = [
|
|
83
|
+
{
|
|
84
|
+
inputName: 'iconAlign',
|
|
85
|
+
tags: ['tui-input', 'tui-primitive-textfield', 'tui-input-tag'],
|
|
86
|
+
},
|
|
87
|
+
];
|
|
60
88
|
exports.TAGS_TO_REPLACE = [
|
|
61
89
|
{
|
|
62
90
|
from: 'tui-group',
|
|
@@ -129,6 +157,54 @@ exports.ATTR_TO_DIRECTIVE = [
|
|
|
129
157
|
moduleSpecifier: '@taiga-ui/core',
|
|
130
158
|
},
|
|
131
159
|
},
|
|
160
|
+
{
|
|
161
|
+
componentSelector: 'tui-input',
|
|
162
|
+
inputProperty: 'icon',
|
|
163
|
+
directive: 'tuiTextfieldIcon',
|
|
164
|
+
directiveModule: {
|
|
165
|
+
name: 'TuiTextfieldControllerModule',
|
|
166
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
167
|
+
},
|
|
168
|
+
filterFn: element => { var _a; return ((_a = element.attrs.find(attr => attr.name === 'iconalign')) === null || _a === void 0 ? void 0 : _a.value) === 'right'; },
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
componentSelector: 'tui-input',
|
|
172
|
+
inputProperty: 'icon',
|
|
173
|
+
directive: 'tuiTextfieldIconLeft',
|
|
174
|
+
directiveModule: {
|
|
175
|
+
name: 'TuiTextfieldControllerModule',
|
|
176
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
177
|
+
},
|
|
178
|
+
filterFn: element => {
|
|
179
|
+
var _a;
|
|
180
|
+
return !elements_1.hasElementAttribute(element, 'iconAlign') ||
|
|
181
|
+
((_a = element.attrs.find(attr => attr.name === 'iconalign')) === null || _a === void 0 ? void 0 : _a.value) === 'left';
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
componentSelector: 'tui-primitive-textfield',
|
|
186
|
+
inputProperty: 'iconContent',
|
|
187
|
+
directive: 'tuiTextfieldIcon',
|
|
188
|
+
directiveModule: {
|
|
189
|
+
name: 'TuiTextfieldControllerModule',
|
|
190
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
191
|
+
},
|
|
192
|
+
filterFn: element => {
|
|
193
|
+
var _a;
|
|
194
|
+
return !elements_1.hasElementAttribute(element, 'iconAlign') ||
|
|
195
|
+
((_a = element.attrs.find(attr => attr.name === 'iconalign')) === null || _a === void 0 ? void 0 : _a.value) === 'right';
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
componentSelector: 'tui-primitive-textfield',
|
|
200
|
+
inputProperty: 'iconContent',
|
|
201
|
+
directive: 'tuiTextfieldIconLeft',
|
|
202
|
+
directiveModule: {
|
|
203
|
+
name: 'TuiTextfieldControllerModule',
|
|
204
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
205
|
+
},
|
|
206
|
+
filterFn: element => { var _a; return ((_a = element.attrs.find(attr => attr.name === 'iconalign')) === null || _a === void 0 ? void 0 : _a.value) === 'left'; },
|
|
207
|
+
},
|
|
132
208
|
{
|
|
133
209
|
componentSelector: '*',
|
|
134
210
|
inputProperty: 'scrollIntoView',
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
interface TypeToRename {
|
|
1
|
+
export interface TypeToRename {
|
|
2
2
|
readonly from: string;
|
|
3
3
|
readonly to?: string;
|
|
4
4
|
readonly moduleSpecifier?: string | string[];
|
|
5
5
|
readonly preserveGenerics?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare const TYPES_TO_RENAME: readonly TypeToRename[];
|
|
8
|
-
export {};
|
|
@@ -15,23 +15,56 @@ const remove_module_1 = require("./steps/remove-module");
|
|
|
15
15
|
const miscellaneous_1 = require("./steps/miscellaneous");
|
|
16
16
|
const replace_functions_1 = require("./steps/replace-functions");
|
|
17
17
|
const migrate_progress_1 = require("./steps/migrate-progress");
|
|
18
|
+
const colored_log_1 = require("../utils/colored-log");
|
|
19
|
+
const migrate_date_time_1 = require("./steps/migrate-date-time");
|
|
18
20
|
function updateToV3(_) {
|
|
19
21
|
return (tree, context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
console.info('\x1b[35m', `taiga packages will be updated to ${versions_1.TAIGA_VERSION}`);
|
|
23
|
+
const fileSystem = getFileSystem(tree);
|
|
24
|
+
colored_log_1.infoLog('replacing deep imports...');
|
|
22
25
|
replace_deep_import_1.replaceDeepImports();
|
|
26
|
+
colored_log_1.successLog('deep imports replaced');
|
|
27
|
+
colored_log_1.infoLog('replacing enums imports...');
|
|
23
28
|
replace_enums_1.replaceEnums();
|
|
29
|
+
colored_log_1.successLog('enums replaced');
|
|
30
|
+
colored_log_1.infoLog('renaming types...');
|
|
24
31
|
rename_types_1.renameTypes();
|
|
32
|
+
colored_log_1.successLog('types renamed');
|
|
33
|
+
colored_log_1.infoLog('replacing consts...');
|
|
25
34
|
replace_const_1.replaceConsts();
|
|
35
|
+
colored_log_1.successLog('constants replaced');
|
|
36
|
+
colored_log_1.infoLog('replacing services...');
|
|
26
37
|
replace_services_1.replaceServices();
|
|
38
|
+
colored_log_1.successLog('services replaced');
|
|
27
39
|
show_warnings_1.showWarnings(context);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
40
|
+
colored_log_1.infoLog('migrating templates...');
|
|
41
|
+
migrate_templates_1.migrateTemplates(fileSystem);
|
|
42
|
+
colored_log_1.successLog('templates migrated');
|
|
43
|
+
fileSystem.commitEdits();
|
|
44
|
+
ng_morph_1.saveActiveProject();
|
|
45
|
+
const updatedFileSystem = getFileSystem(tree);
|
|
46
|
+
colored_log_1.infoLog('migrating sliders...');
|
|
47
|
+
migrate_sliders_1.migrateSliders(updatedFileSystem);
|
|
48
|
+
colored_log_1.successLog('sliders migrated');
|
|
49
|
+
colored_log_1.infoLog('migrating progress bars');
|
|
50
|
+
migrate_progress_1.migrateProgress(updatedFileSystem);
|
|
51
|
+
colored_log_1.successLog('progress bars migrated');
|
|
52
|
+
colored_log_1.infoLog('removing modules...');
|
|
31
53
|
remove_module_1.removeModules();
|
|
54
|
+
colored_log_1.successLog('modules removed');
|
|
55
|
+
colored_log_1.infoLog('migrating taiga date/time ...');
|
|
56
|
+
migrate_date_time_1.dateTimeMigrations();
|
|
57
|
+
colored_log_1.successLog('date/time migrated');
|
|
58
|
+
colored_log_1.infoLog('miscellaneous migrating...');
|
|
32
59
|
replace_functions_1.replaceFunctions();
|
|
33
60
|
miscellaneous_1.miscellaneousMigrations();
|
|
61
|
+
colored_log_1.successLog('miscellaneous migrated');
|
|
34
62
|
ng_morph_1.saveActiveProject();
|
|
35
63
|
});
|
|
36
64
|
}
|
|
37
65
|
exports.updateToV3 = updateToV3;
|
|
66
|
+
function getFileSystem(tree) {
|
|
67
|
+
const project = ng_morph_1.createProject(tree, '/', '**/**.{html,ts}');
|
|
68
|
+
ng_morph_1.setActiveProject(project);
|
|
69
|
+
return project.getFileSystem().fs;
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dateTimeMigrations(): void;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ng_morph_1 = require("ng-morph");
|
|
4
|
+
const get_named_import_references_1 = require("../../utils/get-named-import-references");
|
|
5
|
+
const insert_todo_1 = require("../../utils/insert-todo");
|
|
6
|
+
function dateTimeMigrations() {
|
|
7
|
+
migrateProperty({
|
|
8
|
+
namedImport: 'TuiDay',
|
|
9
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
|
10
|
+
from: 'formattedDay',
|
|
11
|
+
callback: node => node.replaceWithText(node.getText().replace('formattedDay', 'getFormattedDay("DMY", ".")')),
|
|
12
|
+
});
|
|
13
|
+
migrateProperty({
|
|
14
|
+
namedImport: 'TuiDayRange',
|
|
15
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
|
16
|
+
from: 'formattedDayRange',
|
|
17
|
+
callback: node => node.replaceWithText(node
|
|
18
|
+
.getText()
|
|
19
|
+
.replace('formattedDayRange', 'getFormattedDayRange("DMY", ".")')),
|
|
20
|
+
});
|
|
21
|
+
migrateProperty({
|
|
22
|
+
namedImport: 'TuiDayRange',
|
|
23
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
|
24
|
+
from: 'normalizeParse',
|
|
25
|
+
callback: node => {
|
|
26
|
+
const parent = node.getParent();
|
|
27
|
+
if (ng_morph_1.Node.isCallExpression(parent)) {
|
|
28
|
+
changeNormalizeArgs(parent);
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
[
|
|
33
|
+
{
|
|
34
|
+
namedImport: 'TuiMonthRange',
|
|
35
|
+
field: 'formattedMonthRange',
|
|
36
|
+
message: 'formattedMonthRange has been removed in 3.0. Please use TUI_MONTH_FORMATTER from @taiga-ui/kit',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
namedImport: 'TuiMonth',
|
|
40
|
+
field: 'formattedMonth',
|
|
41
|
+
message: 'formattedMonth has been removed in 3.0. Please use TUI_MONTH_FORMATTER from @taiga-ui/kit',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
namedImport: 'TuiDay',
|
|
45
|
+
field: 'getDayFromMonthRowCol',
|
|
46
|
+
message: 'getDayFromMonthRowCol has been removed in 3.0. If you need this utils check out this pipe https://github.com/Tinkoff/taiga-ui/tree/main/projects/core/pipes/calendar-sheet',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
namedImport: 'TuiMonth',
|
|
50
|
+
field: 'monthStartDaysOffset',
|
|
51
|
+
message: 'monthStartDaysOffset has been removed in 3.0. If you need this utils check out this pipe https://github.com/Tinkoff/taiga-ui/tree/main/projects/core/pipes/calendar-sheet',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
namedImport: 'TuiMonth',
|
|
55
|
+
field: 'weeksRowsCount',
|
|
56
|
+
message: 'weeksRowsCount has been removed in 3.0. If you need this utils check out this pipe https://github.com/Tinkoff/taiga-ui/tree/main/projects/core/pipes/calendar-sheet',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
namedImport: 'TuiYear',
|
|
60
|
+
field: 'getYearStartDaysOffset',
|
|
61
|
+
message: 'getYearStartDaysOffset has been removed in 3.0. If you need this utils check out this pipe https://github.com/Tinkoff/taiga-ui/tree/main/projects/core/pipes/calendar-sheet',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
namedImport: 'TuiYear',
|
|
65
|
+
field: 'weeksRowsCount',
|
|
66
|
+
message: 'weeksRowsCount has been removed in 3.0. If you need this utils check out this pipe https://github.com/Tinkoff/taiga-ui/tree/main/projects/core/pipes/calendar-sheet',
|
|
67
|
+
},
|
|
68
|
+
].forEach(({ namedImport, field, message }) => {
|
|
69
|
+
migrateProperty({
|
|
70
|
+
namedImport,
|
|
71
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
|
72
|
+
from: field,
|
|
73
|
+
callback: node => insertTodoBeforeNode(node, message),
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
exports.dateTimeMigrations = dateTimeMigrations;
|
|
78
|
+
function migrateProperty({ namedImport, moduleSpecifier, from, callback, }) {
|
|
79
|
+
const references = get_named_import_references_1.getNamedImportReferences(namedImport, moduleSpecifier);
|
|
80
|
+
references.forEach(ref => {
|
|
81
|
+
if (ref.wasForgotten()) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const parent = ref.getParent();
|
|
85
|
+
if (!parent) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (ng_morph_1.Node.isNewExpression(parent)) {
|
|
89
|
+
const accessExpression = parent.getFirstAncestorByKind(ng_morph_1.SyntaxKind.PropertyAccessExpression);
|
|
90
|
+
const searched = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier).find(identifier => identifier.getText() === from);
|
|
91
|
+
if (searched && accessExpression) {
|
|
92
|
+
callback(accessExpression);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (ng_morph_1.Node.isPropertyAccessExpression(parent)) {
|
|
97
|
+
const searched = parent
|
|
98
|
+
.getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier)
|
|
99
|
+
.find(identifier => identifier.getText() === from);
|
|
100
|
+
if (searched && !parent.wasForgotten()) {
|
|
101
|
+
callback(parent);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
replaceIdentifier(parent, from, callback);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function replaceIdentifier(node, from, callback) {
|
|
109
|
+
const declaration = node.getFirstAncestorByKind(ng_morph_1.SyntaxKind.VariableDeclaration) ||
|
|
110
|
+
node.getFirstAncestorByKind(ng_morph_1.SyntaxKind.PropertyDeclaration);
|
|
111
|
+
const identifier = declaration === null || declaration === void 0 ? void 0 : declaration.getFirstDescendantByKind(ng_morph_1.SyntaxKind.Identifier);
|
|
112
|
+
if (identifier) {
|
|
113
|
+
replaceIdentifierReferences(identifier, from, callback);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function replaceIdentifierReferences(identifier, from, callback) {
|
|
117
|
+
identifier.findReferencesAsNodes().forEach(ref => {
|
|
118
|
+
let parent = ref.getParent();
|
|
119
|
+
if ((parent === null || parent === void 0 ? void 0 : parent.getText()) === `this.${identifier.getText()}` ||
|
|
120
|
+
(parent === null || parent === void 0 ? void 0 : parent.getText()) === identifier.getText()) {
|
|
121
|
+
replaceIdentifier(parent, from, callback);
|
|
122
|
+
}
|
|
123
|
+
if (parent === null || parent === void 0 ? void 0 : parent.getText().startsWith('this')) {
|
|
124
|
+
parent = parent === null || parent === void 0 ? void 0 : parent.getParent();
|
|
125
|
+
}
|
|
126
|
+
if (ng_morph_1.Node.isPropertyAccessExpression(parent)) {
|
|
127
|
+
const searched = parent
|
|
128
|
+
.getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier)
|
|
129
|
+
.find(identifier => identifier.getText() === from);
|
|
130
|
+
if (searched) {
|
|
131
|
+
callback(parent);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
function changeNormalizeArgs(node) {
|
|
137
|
+
const args = node.getArguments();
|
|
138
|
+
if (args.length > 2) {
|
|
139
|
+
node.removeArgument(2);
|
|
140
|
+
node.removeArgument(1);
|
|
141
|
+
node.addArgument('"DMY"');
|
|
142
|
+
}
|
|
143
|
+
else if (args.length === 1) {
|
|
144
|
+
node.addArgument('"DMY"');
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function insertTodoBeforeNode(node, message) {
|
|
148
|
+
const identifier = node.getFirstDescendantByKind(ng_morph_1.SyntaxKind.Identifier);
|
|
149
|
+
if (identifier) {
|
|
150
|
+
insert_todo_1.insertTodo(identifier, message);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DevkitFileSystem } from 'ng-morph/project/classes/devkit-file-system';
|
|
2
2
|
export declare const DEPRECATED_PROGRESS_PIPES_REG: RegExp;
|
|
3
|
-
export declare function migrateProgress(
|
|
3
|
+
export declare function migrateProgress(fileSystem: DevkitFileSystem): void;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const ng_morph_1 = require("ng-morph");
|
|
4
|
-
const devkit_file_system_1 = require("ng-morph/project/classes/devkit-file-system");
|
|
5
4
|
const get_component_templates_1 = require("../../utils/templates/get-component-templates");
|
|
6
5
|
const elements_1 = require("../../utils/templates/elements");
|
|
7
6
|
const template_resource_1 = require("../../utils/templates/template-resource");
|
|
8
7
|
exports.DEPRECATED_PROGRESS_PIPES_REG = /\s*\|\s*tuiProgressColorSegments(Async\s*\|\s*async)?/gi;
|
|
9
8
|
const PROPERTY_FOR_DEPRECATED_PIPES = '[color]';
|
|
10
|
-
function migrateProgress(
|
|
11
|
-
const fileSystem = new devkit_file_system_1.DevkitFileSystem(tree);
|
|
9
|
+
function migrateProgress(fileSystem) {
|
|
12
10
|
const templateResources = get_component_templates_1.getComponentTemplates('**/**');
|
|
13
11
|
for (const templateResource of templateResources) {
|
|
14
12
|
replaceProgressColorSegmentsPipe(templateResource, fileSystem);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function migrateSliders(
|
|
1
|
+
import { DevkitFileSystem } from 'ng-morph/project/classes/devkit-file-system';
|
|
2
|
+
export declare function migrateSliders(fileSystem: DevkitFileSystem): void;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const migrate_input_slider_1 = require("./migrate-input-slider");
|
|
4
4
|
const migrate_input_range_1 = require("./migrate-input-range");
|
|
5
|
-
function migrateSliders(
|
|
6
|
-
migrate_input_slider_1.migrateInputSlider(
|
|
7
|
-
migrate_input_range_1.migrateInputRange(
|
|
5
|
+
function migrateSliders(fileSystem) {
|
|
6
|
+
migrate_input_slider_1.migrateInputSlider(fileSystem);
|
|
7
|
+
migrate_input_range_1.migrateInputRange(fileSystem);
|
|
8
8
|
}
|
|
9
9
|
exports.migrateSliders = migrateSliders;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function migrateInputRange(
|
|
1
|
+
import { DevkitFileSystem } from 'ng-morph/project/classes/devkit-file-system';
|
|
2
|
+
export declare function migrateInputRange(fileSystem: DevkitFileSystem): void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const devkit_file_system_1 = require("ng-morph/project/classes/devkit-file-system");
|
|
4
3
|
const get_component_templates_1 = require("../../../utils/templates/get-component-templates");
|
|
5
4
|
const ng_component_input_manipulations_1 = require("../../../utils/templates/ng-component-input-manipulations");
|
|
6
5
|
const ng_morph_1 = require("ng-morph");
|
|
@@ -8,8 +7,7 @@ const ng_component_1 = require("../../../utils/angular/ng-component");
|
|
|
8
7
|
const add_unique_import_1 = require("../../../utils/add-unique-import");
|
|
9
8
|
const MIN_LABELS_MIGRATION_METHOD_NAME = 'tuiMigrationInputRangeMinLabel';
|
|
10
9
|
const MAX_LABELS_MIGRATION_METHOD_NAME = 'tuiMigrationInputRangeMaxLabel';
|
|
11
|
-
function migrateInputRange(
|
|
12
|
-
const fileSystem = new devkit_file_system_1.DevkitFileSystem(tree);
|
|
10
|
+
function migrateInputRange(fileSystem) {
|
|
13
11
|
const templateResources = get_component_templates_1.getComponentTemplates('**/**');
|
|
14
12
|
const COMPONENTS_WITH_MIN_LABELS = new Set();
|
|
15
13
|
const COMPONENTS_WITH_MAX_LABELS = new Set();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function migrateInputSlider(
|
|
1
|
+
import { DevkitFileSystem } from 'ng-morph/project/classes/devkit-file-system';
|
|
2
|
+
export declare function migrateInputSlider(fileSystem: DevkitFileSystem): void;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const ng_morph_1 = require("ng-morph");
|
|
4
|
-
const devkit_file_system_1 = require("ng-morph/project/classes/devkit-file-system");
|
|
5
4
|
const ng_component_input_manipulations_1 = require("../../../utils/templates/ng-component-input-manipulations");
|
|
6
5
|
const ng_component_1 = require("../../../utils/angular/ng-component");
|
|
7
6
|
const add_unique_import_1 = require("../../../utils/add-unique-import");
|
|
8
7
|
const get_component_templates_1 = require("../../../utils/templates/get-component-templates");
|
|
9
8
|
const elements_1 = require("../../../utils/templates/elements");
|
|
10
|
-
function migrateInputSlider(
|
|
11
|
-
const fileSystem = new devkit_file_system_1.DevkitFileSystem(tree);
|
|
9
|
+
function migrateInputSlider(fileSystem) {
|
|
12
10
|
const templateResources = get_component_templates_1.getComponentTemplates('**/**');
|
|
13
11
|
const COMPONENTS_WITH_MIN_MAX_LABELS = new Set();
|
|
14
12
|
for (const templateResource of templateResources) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function migrateTemplates(
|
|
1
|
+
import { DevkitFileSystem } from 'ng-morph/project/classes/devkit-file-system';
|
|
2
|
+
export declare function migrateTemplates(fileSystem: DevkitFileSystem): void;
|
|
@@ -3,15 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const get_component_templates_1 = require("../../utils/templates/get-component-templates");
|
|
4
4
|
const templates_1 = require("../constants/templates");
|
|
5
5
|
const elements_1 = require("../../utils/templates/elements");
|
|
6
|
-
const devkit_file_system_1 = require("ng-morph/project/classes/devkit-file-system");
|
|
7
6
|
const ng_component_input_manipulations_1 = require("../../utils/templates/ng-component-input-manipulations");
|
|
8
7
|
const template_resource_1 = require("../../utils/templates/template-resource");
|
|
9
8
|
const ng_morph_1 = require("ng-morph");
|
|
9
|
+
const ng_component_1 = require("../../utils/angular/ng-component");
|
|
10
|
+
const add_unique_import_1 = require("../../utils/add-unique-import");
|
|
10
11
|
const START_TAG_OFFSET = 1;
|
|
11
12
|
const END_TAG_OFFSET = 2;
|
|
12
|
-
function migrateTemplates(
|
|
13
|
-
const
|
|
14
|
-
const componentWithTemplatesPaths = get_component_templates_1.getComponentTemplates('**/**').map(({ componentPath }) => componentPath);
|
|
13
|
+
function migrateTemplates(fileSystem) {
|
|
14
|
+
const componentWithTemplatesPaths = get_component_templates_1.getComponentTemplates('**/**');
|
|
15
15
|
const actions = [
|
|
16
16
|
replaceTags,
|
|
17
17
|
replaceAttrs,
|
|
@@ -19,30 +19,21 @@ function migrateTemplates(tree) {
|
|
|
19
19
|
replaceBreadcrumbs,
|
|
20
20
|
replaceFieldError,
|
|
21
21
|
addHTMLCommentTags,
|
|
22
|
+
addEditorProviders,
|
|
23
|
+
migrateTuiHideSelectedPipe,
|
|
24
|
+
removeInputs,
|
|
22
25
|
];
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const path = fileSystem.resolve(template_resource_1.getPathFromTemplateResource(resource));
|
|
28
|
-
const recorder = fileSystem.edit(path);
|
|
26
|
+
componentWithTemplatesPaths.forEach(resource => {
|
|
27
|
+
const path = fileSystem.resolve(template_resource_1.getPathFromTemplateResource(resource));
|
|
28
|
+
const recorder = fileSystem.edit(path);
|
|
29
|
+
actions.forEach(action => {
|
|
29
30
|
action({ resource, fileSystem, recorder });
|
|
30
31
|
});
|
|
31
|
-
save(fileSystem);
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
exports.migrateTemplates = migrateTemplates;
|
|
35
|
-
/**
|
|
36
|
-
* We should update virtual file tree
|
|
37
|
-
* otherwise all following ng-morph commands will overwrite all previous template manipulations
|
|
38
|
-
* */
|
|
39
|
-
function save(fileSystem) {
|
|
40
|
-
fileSystem.commitEdits();
|
|
41
|
-
ng_morph_1.saveActiveProject();
|
|
42
|
-
ng_morph_1.setActiveProject(ng_morph_1.createProject(fileSystem.tree, '/', '**/**'));
|
|
43
|
-
}
|
|
44
35
|
function replaceAttrsByDirective({ resource, fileSystem, }) {
|
|
45
|
-
templates_1.ATTR_TO_DIRECTIVE.forEach(({ componentSelector, directiveModule, directive, inputProperty }) => {
|
|
36
|
+
templates_1.ATTR_TO_DIRECTIVE.forEach(({ componentSelector, directiveModule, directive, inputProperty, filterFn }) => {
|
|
46
37
|
ng_component_input_manipulations_1.replaceInputPropertyByDirective({
|
|
47
38
|
componentSelector,
|
|
48
39
|
directiveModule,
|
|
@@ -50,6 +41,7 @@ function replaceAttrsByDirective({ resource, fileSystem, }) {
|
|
|
50
41
|
inputProperty,
|
|
51
42
|
fileSystem,
|
|
52
43
|
templateResource: resource,
|
|
44
|
+
filterFn,
|
|
53
45
|
});
|
|
54
46
|
});
|
|
55
47
|
}
|
|
@@ -58,11 +50,11 @@ function replaceAttrs({ resource, recorder, fileSystem, }) {
|
|
|
58
50
|
const templateOffset = template_resource_1.getTemplateOffset(resource);
|
|
59
51
|
templates_1.ATTRS_TO_REPLACE.forEach(({ from, to }) => {
|
|
60
52
|
const offsets = [
|
|
61
|
-
...elements_1.findAttributeOnElementWithTag(template, from.attrName, from.withTagNames || []),
|
|
62
|
-
...elements_1.findAttributeOnElementWithAttrs(template, from.attrName, from.withAttrsNames || []),
|
|
53
|
+
...elements_1.findAttributeOnElementWithTag(template, from.attrName, from.withTagNames || [], from.filterFn),
|
|
54
|
+
...elements_1.findAttributeOnElementWithAttrs(template, from.attrName, from.withAttrsNames || [], from.filterFn),
|
|
63
55
|
];
|
|
64
56
|
offsets.forEach(offset => {
|
|
65
|
-
recorder.remove(offset + templateOffset, from.attrName.length
|
|
57
|
+
recorder.remove(offset + templateOffset, from.attrName.length);
|
|
66
58
|
recorder.insertRight(offset + templateOffset, to.attrName);
|
|
67
59
|
});
|
|
68
60
|
});
|
|
@@ -147,3 +139,50 @@ function replaceTag(recorder, sourceCodeLocation, from, to, templateOffset = 0,
|
|
|
147
139
|
recorder.remove(startTagOffset + templateOffset + START_TAG_OFFSET, from.length);
|
|
148
140
|
recorder.insertRight(startTagOffset + templateOffset + START_TAG_OFFSET, `${to} ${addAttributes.join(' ')}`);
|
|
149
141
|
}
|
|
142
|
+
function addEditorProviders({ resource, fileSystem, }) {
|
|
143
|
+
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
|
144
|
+
const elements = elements_1.findElementsByTagName(template, 'tui-editor').filter(element => !elements_1.hasElementAttribute(element, 'new'));
|
|
145
|
+
if (elements.length) {
|
|
146
|
+
const componentPath = resource.componentPath;
|
|
147
|
+
const componentClass = ng_component_1.getNgComponents(componentPath);
|
|
148
|
+
ng_morph_1.addProviderToComponent(componentClass[0], `{
|
|
149
|
+
provide: TUI_EDITOR_EXTENSIONS,
|
|
150
|
+
useValue: defaultEditorExtensions
|
|
151
|
+
}`, { unique: true });
|
|
152
|
+
add_unique_import_1.addUniqueImport(componentPath, 'TUI_EDITOR_EXTENSIONS', '@taiga-ui/addon-editor');
|
|
153
|
+
add_unique_import_1.addUniqueImport(componentPath, 'defaultEditorExtensions', '@taiga-ui/addon-editor');
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const HIDE_SELECTED_PIPE_WITH_ARGS_REG = /\|\s*tuiHideSelected(\s*:\s*[^|'"]*)?/gi;
|
|
157
|
+
function migrateTuiHideSelectedPipe({ resource, fileSystem, recorder, }) {
|
|
158
|
+
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
|
159
|
+
const templateOffset = template_resource_1.getTemplateOffset(resource);
|
|
160
|
+
const elementsWithPipe = elements_1.findElementByFn(template, el => { var _a; return (_a = el.attrs) === null || _a === void 0 ? void 0 : _a.some(attr => attr.value.match(HIDE_SELECTED_PIPE_WITH_ARGS_REG)); });
|
|
161
|
+
elementsWithPipe.forEach(el => {
|
|
162
|
+
var _a;
|
|
163
|
+
const { name, value: oldValue } = el.attrs.find(attr => attr.value.match(HIDE_SELECTED_PIPE_WITH_ARGS_REG)) ||
|
|
164
|
+
{};
|
|
165
|
+
const attrLocations = (_a = el.sourceCodeLocation) === null || _a === void 0 ? void 0 : _a.attrs;
|
|
166
|
+
if (!name || !oldValue || !attrLocations) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const newValue = oldValue.replace(HIDE_SELECTED_PIPE_WITH_ARGS_REG, '| tuiHideSelected');
|
|
170
|
+
const { startOffset } = attrLocations[name];
|
|
171
|
+
const valueOffset = templateOffset + startOffset + name.length + '="'.length;
|
|
172
|
+
recorder.remove(valueOffset, oldValue.length);
|
|
173
|
+
recorder.insertRight(valueOffset, newValue);
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
function removeInputs({ resource, fileSystem, recorder, }) {
|
|
177
|
+
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
|
178
|
+
const templateOffset = template_resource_1.getTemplateOffset(resource);
|
|
179
|
+
templates_1.INPUTS_TO_REMOVE.forEach(({ inputName, tags }) => {
|
|
180
|
+
const offsets = [
|
|
181
|
+
...ng_component_input_manipulations_1.getInputPropertyOffsets(template, inputName, tags),
|
|
182
|
+
...ng_component_input_manipulations_1.getInputPropertyOffsets(template, `[${inputName}]`, tags),
|
|
183
|
+
];
|
|
184
|
+
offsets.forEach(([start, end]) => {
|
|
185
|
+
recorder.remove(start + templateOffset, end - start);
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
}
|
|
@@ -2,6 +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 insert_todo_1 = require("../../utils/insert-todo");
|
|
5
6
|
function miscellaneousMigrations() {
|
|
6
7
|
replaceEnumProperty({
|
|
7
8
|
enumName: 'TuiCurrency',
|
|
@@ -52,14 +53,9 @@ function checkMethod(node, method, message) {
|
|
|
52
53
|
if (ng_morph_1.Node.isPropertyAccessExpression(parent)) {
|
|
53
54
|
parent.getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier).forEach(identifier => {
|
|
54
55
|
if (identifier.getText() === method) {
|
|
55
|
-
insertTodo(identifier, message);
|
|
56
|
+
insert_todo_1.insertTodo(identifier, message);
|
|
56
57
|
}
|
|
57
58
|
});
|
|
58
59
|
}
|
|
59
60
|
});
|
|
60
61
|
}
|
|
61
|
-
function insertTodo(identifier, message) {
|
|
62
|
-
const startLinePos = identifier.getStartLinePos();
|
|
63
|
-
const sourceFile = identifier.getSourceFile();
|
|
64
|
-
sourceFile.insertText(startLinePos, `// TODO: ${message}\n`);
|
|
65
|
-
}
|
|
@@ -3,13 +3,25 @@ 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
5
|
const import_manipulations_1 = require("../../utils/import-manipulations");
|
|
6
|
+
const deprecated_functions_1 = require("../constants/deprecated-functions");
|
|
6
7
|
function replaceFunctions() {
|
|
7
8
|
replacePadStart(get_named_import_references_1.getNamedImportReferences('padStart', '@taiga-ui/cdk'));
|
|
8
9
|
replaceFallbackValue(get_named_import_references_1.getNamedImportReferences('fallbackValue', '@taiga-ui/cdk'));
|
|
9
10
|
replaceCustomEvent(get_named_import_references_1.getNamedImportReferences('tuiCustomEvent', '@taiga-ui/cdk'));
|
|
10
11
|
replaceClosestElement(get_named_import_references_1.getNamedImportReferences('getClosestElement', '@taiga-ui/cdk'));
|
|
12
|
+
replaceDeprecatedFunction();
|
|
11
13
|
}
|
|
12
14
|
exports.replaceFunctions = replaceFunctions;
|
|
15
|
+
function replaceDeprecatedFunction() {
|
|
16
|
+
deprecated_functions_1.DEPRECATED_FUNCTIONS.forEach(({ from, to, moduleSpecifier }) => {
|
|
17
|
+
get_named_import_references_1.getNamedImportReferences(from, moduleSpecifier).forEach(ref => {
|
|
18
|
+
const parent = ref.getParent();
|
|
19
|
+
if (ng_morph_1.Node.isImportSpecifier(parent) || ng_morph_1.Node.isCallExpression(parent)) {
|
|
20
|
+
parent === null || parent === void 0 ? void 0 : parent.replaceWithText(parent === null || parent === void 0 ? void 0 : parent.getFullText().trim().replace(from, to !== null && to !== void 0 ? to : from));
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}
|
|
13
25
|
function replacePadStart(references) {
|
|
14
26
|
references.forEach(ref => {
|
|
15
27
|
var _a;
|