@taiga-ui/cdk 3.59.0 → 3.60.0-canary.799e7d6
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-abstract.umd.js +11 -11
- package/bundles/taiga-ui-cdk-abstract.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-coercion.umd.js +1 -1
- package/bundles/taiga-ui-cdk-coercion.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js +2 -2
- package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.js +80 -80
- package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-date-time.umd.js +27 -27
- package/bundles/taiga-ui-cdk-date-time.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-decorators.umd.js +4 -4
- package/bundles/taiga-ui-cdk-decorators.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js +30 -30
- package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-hovered.umd.js +2 -2
- package/bundles/taiga-ui-cdk-directives-hovered.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-exceptions.umd.js +13 -13
- package/bundles/taiga-ui-cdk-exceptions.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-observables.umd.js +9 -9
- package/bundles/taiga-ui-cdk-observables.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-pipes-filter.umd.js +1 -1
- package/bundles/taiga-ui-cdk-pipes-filter.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-pipes-is-present.umd.js +1 -1
- package/bundles/taiga-ui-cdk-pipes-is-present.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-pipes-keys.umd.js +1 -1
- package/bundles/taiga-ui-cdk-pipes-keys.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-pipes-mapper.umd.js +1 -1
- package/bundles/taiga-ui-cdk-pipes-mapper.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-pipes-replace.umd.js +2 -2
- package/bundles/taiga-ui-cdk-pipes-replace.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-services.umd.js +28 -25
- package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.js +24 -24
- package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-browser.umd.js +8 -8
- package/bundles/taiga-ui-cdk-utils-browser.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-color.umd.js +20 -20
- package/bundles/taiga-ui-cdk-utils-color.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-dom.umd.js +11 -11
- package/bundles/taiga-ui-cdk-utils-dom.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-focus.umd.js +19 -19
- package/bundles/taiga-ui-cdk-utils-focus.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-format.umd.js +1 -1
- package/bundles/taiga-ui-cdk-utils-format.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-math.umd.js +7 -7
- package/bundles/taiga-ui-cdk-utils-math.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js +15 -15
- package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-os.umd.js +1 -1
- package/bundles/taiga-ui-cdk-utils-os.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-svg.umd.js +11 -11
- package/bundles/taiga-ui-cdk-utils-svg.umd.js.map +1 -1
- package/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/esm2015/abstract/control.js +4 -4
- package/esm2015/abstract/interactive.js +7 -7
- package/esm2015/abstract/portal-host.js +2 -2
- package/esm2015/abstract/theme-switcher.js +2 -2
- package/esm2015/coercion/coerce-boolean-property.js +2 -2
- package/esm2015/components/dropdown-host/dropdown-portal.service.js +3 -3
- package/esm2015/constants/parent-animation.js +4 -4
- package/esm2015/constants/svg-node-filter.js +2 -2
- package/esm2015/constants/unicode-chars.js +13 -13
- package/esm2015/constants/used-icons.js +64 -64
- package/esm2015/constants/version.js +2 -2
- package/esm2015/date-time/date-format.js +2 -2
- package/esm2015/date-time/date-separator.js +2 -2
- package/esm2015/date-time/day-range.js +3 -3
- package/esm2015/date-time/day.js +14 -14
- package/esm2015/date-time/month.js +2 -2
- package/esm2015/date-time/time.js +7 -7
- package/esm2015/date-time/year.js +2 -2
- package/esm2015/decorators/pure.js +5 -5
- package/esm2015/directives/auto-focus/autofocus.options.js +2 -2
- package/esm2015/directives/auto-focus/handlers/abstract.handler.js +2 -2
- package/esm2015/directives/auto-focus/handlers/default.handler.js +2 -2
- package/esm2015/directives/auto-focus/handlers/ios.handler.js +28 -28
- package/esm2015/directives/hovered/hovered.service.js +3 -3
- package/esm2015/exceptions/computed-document.exception.js +2 -2
- package/esm2015/exceptions/document-selection.exception.js +2 -2
- package/esm2015/exceptions/invalid-day.exception.js +2 -2
- package/esm2015/exceptions/invalid-month.exception.js +2 -2
- package/esm2015/exceptions/invalid-year.exception.js +2 -2
- package/esm2015/exceptions/no-host.exception.js +2 -2
- package/esm2015/exceptions/owner-document.exception.js +2 -2
- package/esm2015/exceptions/pure.exception.js +2 -2
- package/esm2015/exceptions/table-sort-key.exception.js +2 -2
- package/esm2015/exceptions/ts-parser.exception.js +2 -2
- package/esm2015/exceptions/value-changes.exception.js +2 -2
- package/esm2015/exceptions/value-present.exception.js +2 -2
- package/esm2015/exceptions/xml-parsing.exception.js +2 -2
- package/esm2015/observables/drag-and-drop-from.js +2 -2
- package/esm2015/observables/focus-visible-observable.js +5 -5
- package/esm2015/observables/is-observed.js +2 -2
- package/esm2015/observables/mouse-drag-finish-from.js +2 -2
- package/esm2015/observables/pressed-observable.js +2 -2
- package/esm2015/observables/scroll-from.js +2 -2
- package/esm2015/pipes/filter/filter.pipe.js +2 -2
- package/esm2015/pipes/is-present/is-present.pipe.js +2 -2
- package/esm2015/pipes/keys/keys.pipe.js +2 -2
- package/esm2015/pipes/mapper/mapper.pipe.js +2 -2
- package/esm2015/pipes/replace/replace.pipe.js +3 -3
- package/esm2015/services/directive-styles.service.js +6 -3
- package/esm2015/services/id.service.js +4 -4
- package/esm2015/services/obscured.service.js +2 -2
- package/esm2015/services/pan.service.js +5 -5
- package/esm2015/services/parents-scroll.service.js +2 -2
- package/esm2015/services/scroll.service.js +8 -8
- package/esm2015/services/static-request.service.js +4 -4
- package/esm2015/services/swipe.service.js +2 -2
- package/esm2015/services/zoom.service.js +3 -3
- package/esm2015/tokens/active-element.js +9 -9
- package/esm2015/tokens/base-href.js +2 -2
- package/esm2015/tokens/ensure-base-href.js +4 -4
- package/esm2015/tokens/focusable-item-accessor.js +2 -2
- package/esm2015/tokens/fonts-ready.js +2 -2
- package/esm2015/tokens/is-firefox.js +2 -2
- package/esm2015/tokens/is-stackblitz.js +2 -2
- package/esm2015/tokens/platform.js +5 -5
- package/esm2015/tokens/touch-supported.js +2 -2
- package/esm2015/tokens/window-size.js +3 -3
- package/esm2015/utils/browser/is-edge-older-than.js +2 -2
- package/esm2015/utils/browser/is-edge.js +2 -2
- package/esm2015/utils/browser/is-firefox.js +2 -2
- package/esm2015/utils/browser/is-safari.js +6 -6
- package/esm2015/utils/color/hex-to-rgb.js +4 -4
- package/esm2015/utils/color/hex-to-rgba.js +5 -5
- package/esm2015/utils/color/parse-color.js +7 -7
- package/esm2015/utils/color/rgb-to-hex.js +2 -2
- package/esm2015/utils/color/rgba-to-hex.js +7 -7
- package/esm2015/utils/dom/element-checks.js +4 -4
- package/esm2015/utils/dom/get-clipboard-data-text.js +4 -4
- package/esm2015/utils/dom/get-document-or-shadow-root.js +2 -2
- package/esm2015/utils/dom/get-element-offset.js +2 -2
- package/esm2015/utils/dom/retarget-boundary-crossing.js +4 -4
- package/esm2015/utils/focus/is-native-keyboard-focusable.js +14 -14
- package/esm2015/utils/focus/is-native-mouse-focusable.js +3 -3
- package/esm2015/utils/focus/set-native-mouse-focused.js +5 -5
- package/esm2015/utils/format/px.js +2 -2
- package/esm2015/utils/math/round-with.js +4 -4
- package/esm2015/utils/math/round.js +5 -5
- package/esm2015/utils/miscellaneous/clean-object.js +2 -2
- package/esm2015/utils/miscellaneous/create-token.js +2 -2
- package/esm2015/utils/miscellaneous/ease-in-out-quad.js +2 -2
- package/esm2015/utils/miscellaneous/get-swipe-direction.js +3 -3
- package/esm2015/utils/miscellaneous/is-number.js +2 -2
- package/esm2015/utils/miscellaneous/is-object.js +2 -2
- package/esm2015/utils/miscellaneous/is-string.js +2 -2
- package/esm2015/utils/miscellaneous/is-valid-url.js +8 -8
- package/esm2015/utils/os/is-apple-platform.js +2 -2
- package/esm2015/utils/svg/svg-linear-gradient-processor.js +12 -12
- package/fesm2015/taiga-ui-cdk-abstract.js +11 -11
- package/fesm2015/taiga-ui-cdk-abstract.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-coercion.js +1 -1
- package/fesm2015/taiga-ui-cdk-coercion.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-components-dropdown-host.js +2 -2
- package/fesm2015/taiga-ui-cdk-components-dropdown-host.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-constants.js +80 -80
- package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-date-time.js +25 -25
- package/fesm2015/taiga-ui-cdk-date-time.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-decorators.js +4 -4
- package/fesm2015/taiga-ui-cdk-decorators.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-auto-focus.js +30 -30
- package/fesm2015/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-hovered.js +2 -2
- package/fesm2015/taiga-ui-cdk-directives-hovered.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-exceptions.js +13 -13
- package/fesm2015/taiga-ui-cdk-exceptions.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-observables.js +9 -9
- package/fesm2015/taiga-ui-cdk-observables.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-filter.js +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-filter.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-is-present.js +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-is-present.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-keys.js +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-keys.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-mapper.js +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-mapper.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-replace.js +2 -2
- package/fesm2015/taiga-ui-cdk-pipes-replace.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-services.js +27 -24
- package/fesm2015/taiga-ui-cdk-services.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-tokens.js +23 -23
- package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-browser.js +8 -8
- package/fesm2015/taiga-ui-cdk-utils-browser.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-color.js +20 -20
- package/fesm2015/taiga-ui-cdk-utils-color.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-dom.js +11 -11
- package/fesm2015/taiga-ui-cdk-utils-dom.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-focus.js +19 -19
- package/fesm2015/taiga-ui-cdk-utils-focus.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-format.js +1 -1
- package/fesm2015/taiga-ui-cdk-utils-format.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-math.js +7 -7
- package/fesm2015/taiga-ui-cdk-utils-math.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js +15 -15
- package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-os.js +1 -1
- package/fesm2015/taiga-ui-cdk-utils-os.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-svg.js +11 -11
- package/fesm2015/taiga-ui-cdk-utils-svg.js.map +1 -1
- package/package.json +69 -69
- package/schematics/constants/file-globs.js +24 -24
- package/schematics/constants/taiga-styles.js +4 -4
- package/schematics/ng-add/constants/modules.js +12 -12
- package/schematics/ng-add/constants/packages.js +1 -1
- package/schematics/ng-add/constants/versions.js +3 -3
- package/schematics/ng-add/index.js +10 -10
- package/schematics/ng-add/steps/add-taiga-icons.js +4 -4
- package/schematics/ng-add/steps/add-taiga-modules.js +14 -14
- package/schematics/ng-add/steps/wrap-with-tui-root.js +12 -12
- package/schematics/ng-update/steps/icons/replace-imports.js +2 -2
- package/schematics/ng-update/steps/remove-module.js +2 -2
- package/schematics/ng-update/steps/rename-types.js +5 -5
- package/schematics/ng-update/steps/replace-deep-import.js +4 -4
- package/schematics/ng-update/steps/replace-enums.js +2 -2
- package/schematics/ng-update/steps/replace-identifier.js +2 -2
- package/schematics/ng-update/steps/replace-services.js +4 -4
- package/schematics/ng-update/steps/show-warnings.js +1 -1
- package/schematics/ng-update/utils/replace-text.js +1 -1
- package/schematics/ng-update/utils/templates/replace-tag.js +1 -1
- package/schematics/ng-update/v3/constants/breakpoints.js +27 -27
- package/schematics/ng-update/v3/constants/constants.js +187 -187
- package/schematics/ng-update/v3/constants/deprecated-functions.js +405 -405
- package/schematics/ng-update/v3/constants/enums.js +153 -153
- package/schematics/ng-update/v3/constants/modules.js +4 -4
- package/schematics/ng-update/v3/constants/services.js +16 -16
- package/schematics/ng-update/v3/constants/templates.js +295 -295
- package/schematics/ng-update/v3/constants/tui-interactive-selectors.js +50 -50
- package/schematics/ng-update/v3/constants/types.js +88 -88
- package/schematics/ng-update/v3/constants/warnings.js +62 -62
- package/schematics/ng-update/v3/index.js +7 -7
- package/schematics/ng-update/v3/steps/migrate-date-time.js +42 -42
- package/schematics/ng-update/v3/steps/migrate-polymorpheus.js +14 -14
- package/schematics/ng-update/v3/steps/migrate-progress.js +6 -6
- package/schematics/ng-update/v3/steps/migrate-sliders/index.js +4 -4
- package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-range.js +27 -27
- package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-slider.js +26 -26
- package/schematics/ng-update/v3/steps/migrate-taiga-proprietary-icons.js +7 -7
- package/schematics/ng-update/v3/steps/migrate-templates.js +18 -18
- package/schematics/ng-update/v3/steps/migrate-textfield-controller.js +33 -33
- package/schematics/ng-update/v3/steps/miscellaneous.js +16 -16
- package/schematics/ng-update/v3/steps/replace-functions.js +17 -17
- package/schematics/ng-update/v3/steps/replace-styles.js +12 -12
- package/schematics/ng-update/v3-30/constants/constants.js +2 -2
- package/schematics/ng-update/v3-30/constants/icons.js +494 -494
- package/schematics/ng-update/v3-30/index.js +4 -4
- package/schematics/ng-update/v3-35/constants/constants.js +2 -2
- package/schematics/ng-update/v3-35/constants/icons.js +1266 -1266
- package/schematics/ng-update/v3-35/index.js +5 -5
- package/schematics/ng-update/v3-36/index.js +6 -6
- package/schematics/ng-update/v3-40/index.js +11 -11
- package/schematics/ng-update/v3-5/index.js +1 -1
- package/schematics/ng-update/v3-5/steps/migrate-expand-templates.js +7 -7
- package/schematics/ng-update/v4/index.js +2 -2
- package/schematics/ng-update/v4/steps/constants/attr-to-directive-replace.js +19 -19
- package/schematics/ng-update/v4/steps/constants/attrs-to-replace.js +21 -21
- package/schematics/ng-update/v4/steps/constants/html-comments.js +9 -9
- package/schematics/ng-update/v4/steps/constants/identifiers-to-replace.js +21 -21
- package/schematics/ng-update/v4/steps/constants/inputs-to-remove.js +4 -4
- package/schematics/ng-update/v4/steps/constants/tags-to-replace.js +2 -2
- package/schematics/ng-update/v4/steps/migrate-templates.js +3 -3
- package/schematics/ng-update/v4/steps/restore-tui-mapper.js +6 -6
- package/schematics/ng-update/v4/steps/restore-tui-matcher.js +6 -6
- package/schematics/ng-update/v4/steps/templates/migrate-avatar.js +14 -14
- package/schematics/ng-update/v4/steps/templates/migrate-badge.js +3 -3
- package/schematics/ng-update/v4/steps/templates/toggles/common.js +5 -5
- package/schematics/ng-update/v4/steps/templates/toggles/migrate-checkbox.js +4 -4
- package/schematics/ng-update/v4/steps/templates/toggles/migrate-radio.js +4 -4
- package/schematics/ng-update/v4/steps/templates/toggles/migrate-toggle.js +4 -4
- package/schematics/utils/add-import-to-component.js +1 -1
- package/schematics/utils/angular/is-standalone-component.js +3 -3
- package/schematics/utils/angular/ng-component.js +1 -1
- package/schematics/utils/angular/ng-module.js +1 -1
- package/schematics/utils/angular-json-manipulations.js +5 -5
- package/schematics/utils/colored-log.js +11 -11
- package/schematics/utils/create-angular-json.js +3 -3
- package/schematics/utils/get-component-from-identifier.js +1 -1
- package/schematics/utils/get-named-import-references.js +1 -1
- package/schematics/utils/get-projects.js +2 -2
- package/schematics/utils/get-standalone-bootstrap-function.js +1 -1
- package/schematics/utils/insert-todo.js +1 -1
- package/schematics/utils/is-ci.js +1 -1
- package/schematics/utils/progress.js +2 -2
- package/schematics/utils/project-root.js +1 -1
- package/schematics/utils/push-to-array-property.js +1 -1
- package/schematics/utils/templates/elements.js +1 -1
- package/schematics/utils/templates/get-component-templates.js +5 -5
- package/schematics/utils/templates/ng-component-input-manipulations.js +5 -5
- package/schematics/utils/templates/template-resource.js +3 -3
- package/services/directive-styles.service.d.ts +3 -2
- package/utils/miscellaneous/is-string.js +1 -1
@@ -79,7 +79,7 @@ function replaceIdentifierReferences(identifier, from, callback) {
|
|
79
79
|
if (parent === null || parent === void 0 ? void 0 : parent.wasForgotten()) {
|
80
80
|
return;
|
81
81
|
}
|
82
|
-
if (parent === null || parent === void 0 ? void 0 : parent.getText().startsWith(
|
82
|
+
if (parent === null || parent === void 0 ? void 0 : parent.getText().startsWith('this')) {
|
83
83
|
parent = parent === null || parent === void 0 ? void 0 : parent.getParent();
|
84
84
|
}
|
85
85
|
if (ng_morph_1.Node.isPropertyAccessExpression(parent)) {
|
@@ -97,10 +97,10 @@ function changeNormalizeArgs(node) {
|
|
97
97
|
if (args.length > 2) {
|
98
98
|
node.removeArgument(2);
|
99
99
|
node.removeArgument(1);
|
100
|
-
node.addArgument(
|
100
|
+
node.addArgument('"DMY"');
|
101
101
|
}
|
102
102
|
else if (args.length === 1) {
|
103
|
-
node.addArgument(
|
103
|
+
node.addArgument('"DMY"');
|
104
104
|
}
|
105
105
|
}
|
106
106
|
function insertTodoBeforeNode(node, message) {
|
@@ -114,35 +114,35 @@ function areBothObjectDestructuring(ref, identifier) {
|
|
114
114
|
ref.getFirstAncestorByKind(ng_morph_1.SyntaxKind.BindingElement));
|
115
115
|
}
|
116
116
|
function dateTimeMigrations(options) {
|
117
|
-
!options[
|
117
|
+
!options['skip-logs'] &&
|
118
118
|
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating taiga date/time...`);
|
119
119
|
let start = perf_hooks_1.performance.now();
|
120
120
|
migrateProperty({
|
121
|
-
namedImport:
|
122
|
-
moduleSpecifier:
|
123
|
-
from:
|
124
|
-
callback: node => node.replaceWithText(node.getText().replace(
|
121
|
+
namedImport: 'TuiDay',
|
122
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
123
|
+
from: 'formattedDay',
|
124
|
+
callback: node => node.replaceWithText(node.getText().replace('formattedDay', 'getFormattedDay("DMY", ".")')),
|
125
125
|
});
|
126
|
-
!options[
|
126
|
+
!options['skip-logs'] &&
|
127
127
|
colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}TuiDay.formattedDay ` +
|
128
128
|
`(${get_execution_time_1.getExecutionTime(start, perf_hooks_1.performance.now())})`);
|
129
129
|
start = perf_hooks_1.performance.now();
|
130
130
|
migrateProperty({
|
131
|
-
namedImport:
|
132
|
-
moduleSpecifier:
|
133
|
-
from:
|
131
|
+
namedImport: 'TuiDayRange',
|
132
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
133
|
+
from: 'formattedDayRange',
|
134
134
|
callback: node => node.replaceWithText(node
|
135
135
|
.getText()
|
136
|
-
.replace(
|
136
|
+
.replace('formattedDayRange', 'getFormattedDayRange("DMY", ".")')),
|
137
137
|
});
|
138
|
-
!options[
|
138
|
+
!options['skip-logs'] &&
|
139
139
|
colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}TuiDayRange.formattedDayRange ` +
|
140
140
|
`(${get_execution_time_1.getExecutionTime(start, perf_hooks_1.performance.now())})`);
|
141
141
|
start = perf_hooks_1.performance.now();
|
142
142
|
migrateProperty({
|
143
|
-
namedImport:
|
144
|
-
moduleSpecifier:
|
145
|
-
from:
|
143
|
+
namedImport: 'TuiDayRange',
|
144
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
145
|
+
from: 'normalizeParse',
|
146
146
|
callback: node => {
|
147
147
|
const parent = node.getParent();
|
148
148
|
if (ng_morph_1.Node.isCallExpression(parent)) {
|
@@ -150,58 +150,58 @@ function dateTimeMigrations(options) {
|
|
150
150
|
}
|
151
151
|
},
|
152
152
|
});
|
153
|
-
!options[
|
153
|
+
!options['skip-logs'] &&
|
154
154
|
colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}TuiDayRange.normalizeParse ` +
|
155
155
|
`(${get_execution_time_1.getExecutionTime(start, perf_hooks_1.performance.now())})`);
|
156
156
|
[
|
157
157
|
{
|
158
|
-
namedImport:
|
159
|
-
field:
|
160
|
-
message:
|
158
|
+
namedImport: 'TuiMonthRange',
|
159
|
+
field: 'formattedMonthRange',
|
160
|
+
message: 'formattedMonthRange has been removed in 3.0. Please use TUI_MONTH_FORMATTER from @taiga-ui/kit',
|
161
161
|
},
|
162
162
|
{
|
163
|
-
namedImport:
|
164
|
-
field:
|
165
|
-
message:
|
163
|
+
namedImport: 'TuiMonth',
|
164
|
+
field: 'formattedMonth',
|
165
|
+
message: 'formattedMonth has been removed in 3.0. Please use TUI_MONTH_FORMATTER from @taiga-ui/kit',
|
166
166
|
},
|
167
167
|
{
|
168
|
-
namedImport:
|
169
|
-
field:
|
170
|
-
message:
|
168
|
+
namedImport: 'TuiDay',
|
169
|
+
field: 'getDayFromMonthRowCol',
|
170
|
+
message: 'getDayFromMonthRowCol has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet',
|
171
171
|
},
|
172
172
|
{
|
173
|
-
namedImport:
|
174
|
-
field:
|
175
|
-
message:
|
173
|
+
namedImport: 'TuiMonth',
|
174
|
+
field: 'monthStartDaysOffset',
|
175
|
+
message: 'monthStartDaysOffset has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet',
|
176
176
|
},
|
177
177
|
{
|
178
|
-
namedImport:
|
179
|
-
field:
|
180
|
-
message:
|
178
|
+
namedImport: 'TuiMonth',
|
179
|
+
field: 'weeksRowsCount',
|
180
|
+
message: 'weeksRowsCount has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet',
|
181
181
|
},
|
182
182
|
{
|
183
|
-
namedImport:
|
184
|
-
field:
|
185
|
-
message:
|
183
|
+
namedImport: 'TuiYear',
|
184
|
+
field: 'getYearStartDaysOffset',
|
185
|
+
message: 'getYearStartDaysOffset has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet',
|
186
186
|
},
|
187
187
|
{
|
188
|
-
namedImport:
|
189
|
-
field:
|
190
|
-
message:
|
188
|
+
namedImport: 'TuiYear',
|
189
|
+
field: 'weeksRowsCount',
|
190
|
+
message: 'weeksRowsCount has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet',
|
191
191
|
},
|
192
192
|
].forEach(({ namedImport, field, message }) => {
|
193
193
|
start = perf_hooks_1.performance.now();
|
194
194
|
migrateProperty({
|
195
195
|
namedImport,
|
196
|
-
moduleSpecifier:
|
196
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
197
197
|
from: field,
|
198
198
|
callback: node => insertTodoBeforeNode(node, message),
|
199
199
|
});
|
200
|
-
!options[
|
200
|
+
!options['skip-logs'] &&
|
201
201
|
colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}${namedImport}.${field} ` +
|
202
202
|
`(${get_execution_time_1.getExecutionTime(start, perf_hooks_1.performance.now())})`);
|
203
203
|
});
|
204
|
-
!options[
|
204
|
+
!options['skip-logs'] &&
|
205
205
|
colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} date/time migrated \n`);
|
206
206
|
}
|
207
207
|
exports.dateTimeMigrations = dateTimeMigrations;
|
@@ -8,7 +8,7 @@ const replace_tag_1 = require("../../utils/templates/replace-tag");
|
|
8
8
|
function insertPolymorpheus({ element, contentVal, contextVal, recorder, templateOffset, }) {
|
9
9
|
var _a, _b;
|
10
10
|
const content = `
|
11
|
-
<ng-container *polymorpheusOutlet="${contentVal} as text${contextVal ? `; context: ${contextVal}` :
|
11
|
+
<ng-container *polymorpheusOutlet="${contentVal} as text${contextVal ? `; context: ${contextVal}` : ''}">
|
12
12
|
{{ text }}
|
13
13
|
</ng-container>`;
|
14
14
|
const insertTo = (_b = (_a = element.sourceCodeLocation) === null || _a === void 0 ? void 0 : _a.startTag) === null || _b === void 0 ? void 0 : _b.endOffset;
|
@@ -18,9 +18,9 @@ function insertPolymorpheus({ element, contentVal, contextVal, recorder, templat
|
|
18
18
|
}
|
19
19
|
function removeOldInputs(recorder, template, templateOffset) {
|
20
20
|
const offsets = [
|
21
|
-
...ng_component_input_manipulations_1.getInputPropertyOffsets(template,
|
22
|
-
...ng_component_input_manipulations_1.getInputPropertyOffsets(template,
|
23
|
-
...ng_component_input_manipulations_1.getInputPropertyOffsets(template,
|
21
|
+
...ng_component_input_manipulations_1.getInputPropertyOffsets(template, '[content]', ['*'], el => elements_1.hasElementAttribute(el, 'polymorpheus-outlet')),
|
22
|
+
...ng_component_input_manipulations_1.getInputPropertyOffsets(template, '[context]', ['*'], el => elements_1.hasElementAttribute(el, 'polymorpheus-outlet')),
|
23
|
+
...ng_component_input_manipulations_1.getInputPropertyOffsets(template, 'polymorpheus-outlet', ['*'], el => elements_1.hasElementAttribute(el, 'polymorpheus-outlet')),
|
24
24
|
];
|
25
25
|
offsets.forEach(([start, end]) => {
|
26
26
|
recorder.remove(start + templateOffset, end - start);
|
@@ -28,14 +28,14 @@ function removeOldInputs(recorder, template, templateOffset) {
|
|
28
28
|
}
|
29
29
|
function insertPolymorpheusWithDefault({ template, defaultTemplateEl, recorder, templateOffset, contentVal, contextVal, }) {
|
30
30
|
var _a, _b;
|
31
|
-
const templateVar = defaultTemplateEl.attrs.find(attr => attr.name.startsWith(
|
31
|
+
const templateVar = defaultTemplateEl.attrs.find(attr => attr.name.startsWith('let-'));
|
32
32
|
let templateVarName = templateVar === null || templateVar === void 0 ? void 0 : templateVar.name;
|
33
|
-
if (templateVarName === null || templateVarName === void 0 ? void 0 : templateVarName.startsWith(
|
34
|
-
templateVarName = (_a = template.match(new RegExp(templateVarName,
|
33
|
+
if (templateVarName === null || templateVarName === void 0 ? void 0 : templateVarName.startsWith('let-')) {
|
34
|
+
templateVarName = (_a = template.match(new RegExp(templateVarName, 'i'))) === null || _a === void 0 ? void 0 : _a[0];
|
35
35
|
}
|
36
|
-
const varName = templateVarName === null || templateVarName === void 0 ? void 0 : templateVarName.replace(
|
37
|
-
const attr = `*polymorpheusOutlet="${contentVal} as ${varName}${contextVal ? `; context: ${contextVal}` :
|
38
|
-
replace_tag_1.replaceTag(recorder, defaultTemplateEl.sourceCodeLocation,
|
36
|
+
const varName = templateVarName === null || templateVarName === void 0 ? void 0 : templateVarName.replace('let-', '');
|
37
|
+
const attr = `*polymorpheusOutlet="${contentVal} as ${varName}${contextVal ? `; context: ${contextVal}` : ''}"`;
|
38
|
+
replace_tag_1.replaceTag(recorder, defaultTemplateEl.sourceCodeLocation, 'ng-template', 'ng-container', templateOffset, [attr]);
|
39
39
|
if (((_b = defaultTemplateEl.sourceCodeLocation) === null || _b === void 0 ? void 0 : _b.attrs) && (templateVar === null || templateVar === void 0 ? void 0 : templateVar.name)) {
|
40
40
|
recorder.remove(defaultTemplateEl.sourceCodeLocation.attrs[templateVar.name].startOffset +
|
41
41
|
templateOffset, templateVar.name.length);
|
@@ -44,12 +44,12 @@ function insertPolymorpheusWithDefault({ template, defaultTemplateEl, recorder,
|
|
44
44
|
function migratePolymorpheus({ resource, fileSystem, recorder, }) {
|
45
45
|
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
46
46
|
const templateOffset = template_resource_1.getTemplateOffset(resource);
|
47
|
-
const elements = elements_1.findElementsWithAttribute(template,
|
47
|
+
const elements = elements_1.findElementsWithAttribute(template, 'polymorpheus-outlet');
|
48
48
|
elements.forEach(element => {
|
49
49
|
var _a, _b;
|
50
|
-
const contentVal = (_a = element.attrs.find(attr => attr.name ===
|
51
|
-
const contextVal = (_b = element.attrs.find(attr => attr.name ===
|
52
|
-
const defaultTemplateEl = elements_1.findElementsByFn(element.childNodes, el => el.tagName ===
|
50
|
+
const contentVal = (_a = element.attrs.find(attr => attr.name === '[content]')) === null || _a === void 0 ? void 0 : _a.value;
|
51
|
+
const contextVal = (_b = element.attrs.find(attr => attr.name === '[context]')) === null || _b === void 0 ? void 0 : _b.value;
|
52
|
+
const defaultTemplateEl = elements_1.findElementsByFn(element.childNodes, el => el.tagName === 'ng-template')[0];
|
53
53
|
if (!contentVal) {
|
54
54
|
return;
|
55
55
|
}
|
@@ -8,7 +8,7 @@ const project_root_1 = require("../../../utils/project-root");
|
|
8
8
|
const elements_1 = require("../../../utils/templates/elements");
|
9
9
|
const get_component_templates_1 = require("../../../utils/templates/get-component-templates");
|
10
10
|
const template_resource_1 = require("../../../utils/templates/template-resource");
|
11
|
-
const PROPERTY_FOR_DEPRECATED_PIPES =
|
11
|
+
const PROPERTY_FOR_DEPRECATED_PIPES = '[color]';
|
12
12
|
exports.DEPRECATED_PROGRESS_PIPES_REG =
|
13
13
|
// eslint-disable-next-line unicorn/no-unsafe-regex
|
14
14
|
/\s*\|\s*tuiProgressColorSegments(Async\s*\|\s*async)?/gi;
|
@@ -21,8 +21,8 @@ function replaceProgressColorSegmentsPipe(templateResource, fileSystem) {
|
|
21
21
|
.filter(isProgressWithDeprecatedPipe)
|
22
22
|
.forEach(progressEl => {
|
23
23
|
var _a, _b;
|
24
|
-
const oldValue = ((_a = progressEl.attrs.find(attr => attr.name === PROPERTY_FOR_DEPRECATED_PIPES)) === null || _a === void 0 ? void 0 : _a.value) ||
|
25
|
-
const newValue = oldValue.replace(exports.DEPRECATED_PROGRESS_PIPES_REG,
|
24
|
+
const oldValue = ((_a = progressEl.attrs.find(attr => attr.name === PROPERTY_FOR_DEPRECATED_PIPES)) === null || _a === void 0 ? void 0 : _a.value) || '';
|
25
|
+
const newValue = oldValue.replace(exports.DEPRECATED_PROGRESS_PIPES_REG, '');
|
26
26
|
const attrLocations = (_b = progressEl.sourceCodeLocation) === null || _b === void 0 ? void 0 : _b.attrs;
|
27
27
|
if (attrLocations) {
|
28
28
|
const { startOffset, endOffset } = attrLocations[PROPERTY_FOR_DEPRECATED_PIPES];
|
@@ -33,19 +33,19 @@ function replaceProgressColorSegmentsPipe(templateResource, fileSystem) {
|
|
33
33
|
}
|
34
34
|
exports.replaceProgressColorSegmentsPipe = replaceProgressColorSegmentsPipe;
|
35
35
|
function isProgressWithDeprecatedPipe(element) {
|
36
|
-
return (element.tagName ===
|
36
|
+
return (element.tagName === 'progress' &&
|
37
37
|
element.attrs.some(attr => attr.name === PROPERTY_FOR_DEPRECATED_PIPES &&
|
38
38
|
attr.value.match(exports.DEPRECATED_PROGRESS_PIPES_REG)));
|
39
39
|
}
|
40
40
|
exports.isProgressWithDeprecatedPipe = isProgressWithDeprecatedPipe;
|
41
41
|
function migrateProgress(fileSystem, options) {
|
42
|
-
!options[
|
42
|
+
!options['skip-logs'] &&
|
43
43
|
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating progress bars...`);
|
44
44
|
get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES).forEach(templateResource => replaceProgressColorSegmentsPipe(templateResource, fileSystem));
|
45
45
|
fileSystem.commitEdits();
|
46
46
|
ng_morph_1.saveActiveProject();
|
47
47
|
ng_morph_1.setActiveProject(ng_morph_1.createProject(fileSystem.tree, project_root_1.projectRoot(), constants_1.ALL_FILES));
|
48
|
-
!options[
|
48
|
+
!options['skip-logs'] &&
|
49
49
|
colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} progress bars migrated \n`);
|
50
50
|
}
|
51
51
|
exports.migrateProgress = migrateProgress;
|
@@ -5,15 +5,15 @@ const colored_log_1 = require("../../../../utils/colored-log");
|
|
5
5
|
const migrate_input_range_1 = require("./migrate-input-range");
|
6
6
|
const migrate_input_slider_1 = require("./migrate-input-slider");
|
7
7
|
function migrateSliders(fileSystem, options) {
|
8
|
-
!options[
|
8
|
+
!options['skip-logs'] &&
|
9
9
|
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating sliders...`);
|
10
|
-
!options[
|
10
|
+
!options['skip-logs'] &&
|
11
11
|
colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}InputSlider...`);
|
12
12
|
migrate_input_slider_1.migrateInputSlider(fileSystem, options);
|
13
|
-
!options[
|
13
|
+
!options['skip-logs'] &&
|
14
14
|
colored_log_1.processLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.PROCESSING_SYMBOL}InputRange...`);
|
15
15
|
migrate_input_range_1.migrateInputRange(fileSystem, options);
|
16
|
-
!options[
|
16
|
+
!options['skip-logs'] &&
|
17
17
|
colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} sliders migrated \n`);
|
18
18
|
}
|
19
19
|
exports.migrateSliders = migrateSliders;
|
@@ -9,15 +9,15 @@ const progress_1 = require("../../../../utils/progress");
|
|
9
9
|
const project_root_1 = require("../../../../utils/project-root");
|
10
10
|
const get_component_templates_1 = require("../../../../utils/templates/get-component-templates");
|
11
11
|
const ng_component_input_manipulations_1 = require("../../../../utils/templates/ng-component-input-manipulations");
|
12
|
-
const MIN_LABELS_MIGRATION_METHOD_NAME =
|
13
|
-
const MAX_LABELS_MIGRATION_METHOD_NAME =
|
12
|
+
const MIN_LABELS_MIGRATION_METHOD_NAME = 'tuiMigrationInputRangeMinLabel';
|
13
|
+
const MAX_LABELS_MIGRATION_METHOD_NAME = 'tuiMigrationInputRangeMaxLabel';
|
14
14
|
function replaceMinLabel(templateResource, fileSystem, modifiedComponentStorage) {
|
15
15
|
const wasModified = ng_component_input_manipulations_1.replaceInputProperty({
|
16
16
|
templateResource,
|
17
17
|
fileSystem,
|
18
|
-
componentSelector:
|
19
|
-
from:
|
20
|
-
to:
|
18
|
+
componentSelector: 'tui-input-range',
|
19
|
+
from: 'minLabel',
|
20
|
+
to: '[leftValueContent]',
|
21
21
|
newValue: MIN_LABELS_MIGRATION_METHOD_NAME,
|
22
22
|
});
|
23
23
|
if (wasModified) {
|
@@ -28,9 +28,9 @@ function replaceMaxLabel(templateResource, fileSystem, modifiedComponentStorage)
|
|
28
28
|
const wasModified = ng_component_input_manipulations_1.replaceInputProperty({
|
29
29
|
templateResource,
|
30
30
|
fileSystem,
|
31
|
-
componentSelector:
|
32
|
-
from:
|
33
|
-
to:
|
31
|
+
componentSelector: 'tui-input-range',
|
32
|
+
from: 'maxLabel',
|
33
|
+
to: '[rightValueContent]',
|
34
34
|
newValue: MAX_LABELS_MIGRATION_METHOD_NAME,
|
35
35
|
});
|
36
36
|
if (wasModified) {
|
@@ -40,11 +40,11 @@ function replaceMaxLabel(templateResource, fileSystem, modifiedComponentStorage)
|
|
40
40
|
function addMinMaxLabelMethod(componentPath, methodName, methodCode) {
|
41
41
|
const [ngComponent] = ng_component_1.getNgComponents(componentPath);
|
42
42
|
if (ngComponent) {
|
43
|
-
add_unique_import_1.addUniqueImport(ngComponent.getSourceFile().getFilePath(),
|
43
|
+
add_unique_import_1.addUniqueImport(ngComponent.getSourceFile().getFilePath(), 'TuiContextWithImplicit', '@taiga-ui/cdk');
|
44
44
|
ng_morph_1.addMethods(ngComponent, {
|
45
45
|
name: methodName,
|
46
|
-
returnType:
|
47
|
-
parameters: [{ name:
|
46
|
+
returnType: 'string',
|
47
|
+
parameters: [{ name: 'context', type: 'TuiContextWithImplicit<number>' }],
|
48
48
|
statements: methodCode,
|
49
49
|
});
|
50
50
|
}
|
@@ -64,40 +64,40 @@ function migrateInputRange(fileSystem, options) {
|
|
64
64
|
const COMPONENTS_WITH_MAX_LABELS = new Set();
|
65
65
|
let progressLog = progress_1.setupProgressLogger({
|
66
66
|
total: templateResources.length,
|
67
|
-
prefix:
|
67
|
+
prefix: '[replaceMinMaxLabel]',
|
68
68
|
});
|
69
69
|
templateResources.forEach(templateResource => {
|
70
|
-
!options[
|
70
|
+
!options['skip-logs'] && progressLog(templateResource.componentPath);
|
71
71
|
replaceMinLabel(templateResource, fileSystem, COMPONENTS_WITH_MIN_LABELS);
|
72
72
|
replaceMaxLabel(templateResource, fileSystem, COMPONENTS_WITH_MAX_LABELS);
|
73
73
|
});
|
74
74
|
save(fileSystem);
|
75
75
|
progressLog = progress_1.setupProgressLogger({
|
76
76
|
total: COMPONENTS_WITH_MIN_LABELS.size,
|
77
|
-
prefix:
|
77
|
+
prefix: '[COMPONENTS_WITH_MIN_LABELS]',
|
78
78
|
});
|
79
79
|
Array.from(COMPONENTS_WITH_MIN_LABELS).forEach(componentPath => {
|
80
|
-
!options[
|
80
|
+
!options['skip-logs'] && progressLog(componentPath);
|
81
81
|
addMinMaxLabelMethod(componentPath, MIN_LABELS_MIGRATION_METHOD_NAME, [
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
82
|
+
'const currentValue = context.$implicit;',
|
83
|
+
'const minValue = 0; // TODO: (Taiga UI migration) replace with the MIN value of the input-range',
|
84
|
+
'const minLabelText = "Min"; // TODO: (Taiga UI migration) replace with the required label',
|
85
|
+
'if (currentValue === minValue) return minLabelText;',
|
86
|
+
'return String(currentValue);',
|
87
87
|
]);
|
88
88
|
});
|
89
89
|
progressLog = progress_1.setupProgressLogger({
|
90
90
|
total: COMPONENTS_WITH_MAX_LABELS.size,
|
91
|
-
prefix:
|
91
|
+
prefix: '[COMPONENTS_WITH_MAX_LABELS]',
|
92
92
|
});
|
93
93
|
Array.from(COMPONENTS_WITH_MAX_LABELS).forEach(componentPath => {
|
94
|
-
!options[
|
94
|
+
!options['skip-logs'] && progressLog(componentPath);
|
95
95
|
addMinMaxLabelMethod(componentPath, MAX_LABELS_MIGRATION_METHOD_NAME, [
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
96
|
+
'const currentValue = context.$implicit;',
|
97
|
+
'const maxValue = 100; // TODO: (Taiga UI migration) replace with the MAX value of the input',
|
98
|
+
'const maxLabelText = "Max"; // TODO: (Taiga UI migration) replace with the required label',
|
99
|
+
'if (currentValue === maxValue) return maxLabelText;',
|
100
|
+
'return String(currentValue);',
|
101
101
|
]);
|
102
102
|
});
|
103
103
|
}
|
@@ -10,31 +10,31 @@ const project_root_1 = require("../../../../utils/project-root");
|
|
10
10
|
const elements_1 = require("../../../../utils/templates/elements");
|
11
11
|
const get_component_templates_1 = require("../../../../utils/templates/get-component-templates");
|
12
12
|
const ng_component_input_manipulations_1 = require("../../../../utils/templates/ng-component-input-manipulations");
|
13
|
-
const MIN_MAX_LABELS_MIGRATION_METHOD_NAME =
|
13
|
+
const MIN_MAX_LABELS_MIGRATION_METHOD_NAME = 'tuiMigrationMinMaxLabel';
|
14
14
|
function replaceMinMaxLabels(templateResource, fileSystem, modifiedComponentStorage) {
|
15
15
|
const wasMaxLabelModified = ng_component_input_manipulations_1.replaceInputProperty({
|
16
16
|
templateResource,
|
17
17
|
fileSystem,
|
18
|
-
componentSelector:
|
19
|
-
from:
|
20
|
-
to:
|
18
|
+
componentSelector: 'tui-input-slider',
|
19
|
+
from: 'maxLabel',
|
20
|
+
to: '[valueContent]',
|
21
21
|
newValue: MIN_MAX_LABELS_MIGRATION_METHOD_NAME,
|
22
22
|
});
|
23
23
|
const wasMinLabelModified = ng_component_input_manipulations_1.replaceInputProperty({
|
24
24
|
templateResource,
|
25
25
|
fileSystem,
|
26
|
-
componentSelector:
|
27
|
-
from:
|
28
|
-
to:
|
26
|
+
componentSelector: 'tui-input-slider',
|
27
|
+
from: 'minLabel',
|
28
|
+
to: '[valueContent]',
|
29
29
|
newValue: MIN_MAX_LABELS_MIGRATION_METHOD_NAME,
|
30
|
-
filterFn: element => !elements_1.hasElementAttribute(element,
|
30
|
+
filterFn: element => !elements_1.hasElementAttribute(element, 'maxLabel'),
|
31
31
|
});
|
32
32
|
ng_component_input_manipulations_1.removeInputProperty({
|
33
33
|
templateResource,
|
34
34
|
fileSystem,
|
35
|
-
componentSelector:
|
36
|
-
inputProperty:
|
37
|
-
filterFn: element => elements_1.hasElementAttribute(element,
|
35
|
+
componentSelector: 'tui-input-slider',
|
36
|
+
inputProperty: 'minLabel',
|
37
|
+
filterFn: element => elements_1.hasElementAttribute(element, 'maxLabel'),
|
38
38
|
});
|
39
39
|
if (wasMaxLabelModified || wasMinLabelModified) {
|
40
40
|
modifiedComponentStorage.add(templateResource.componentPath);
|
@@ -43,20 +43,20 @@ function replaceMinMaxLabels(templateResource, fileSystem, modifiedComponentStor
|
|
43
43
|
function addMinMaxLabelMethod(componentPath) {
|
44
44
|
const [ngComponent] = ng_component_1.getNgComponents(componentPath);
|
45
45
|
if (ngComponent) {
|
46
|
-
add_unique_import_1.addUniqueImport(componentPath,
|
46
|
+
add_unique_import_1.addUniqueImport(componentPath, 'TuiContextWithImplicit', '@taiga-ui/cdk');
|
47
47
|
ng_morph_1.addMethods(ngComponent, {
|
48
48
|
name: MIN_MAX_LABELS_MIGRATION_METHOD_NAME,
|
49
|
-
returnType:
|
50
|
-
parameters: [{ name:
|
49
|
+
returnType: 'string',
|
50
|
+
parameters: [{ name: 'context', type: 'TuiContextWithImplicit<number>' }],
|
51
51
|
statements: [
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
52
|
+
'const currentValue = context.$implicit;',
|
53
|
+
'const maxValue = 100; // TODO: (Taiga UI migration) replace with the MAX value of the input',
|
54
|
+
'const maxLabelText = "Max"; // TODO: (Taiga UI migration) replace with the required label',
|
55
|
+
'const minValue = 0; // TODO: (Taiga UI migration) replace with the MIN value of the input',
|
56
|
+
'const minLabelText = "Min"; // TODO: (Taiga UI migration) replace with the required label',
|
57
|
+
'if (currentValue === maxValue) return maxLabelText;',
|
58
|
+
'if (currentValue === minValue) return minLabelText;',
|
59
|
+
'return String(currentValue);',
|
60
60
|
],
|
61
61
|
});
|
62
62
|
}
|
@@ -66,10 +66,10 @@ function migrateInputSlider(fileSystem, options) {
|
|
66
66
|
const COMPONENTS_WITH_MIN_MAX_LABELS = new Set();
|
67
67
|
let progressLog = progress_1.setupProgressLogger({
|
68
68
|
total: templateResources.length,
|
69
|
-
prefix:
|
69
|
+
prefix: '[replaceMinMaxLabels]',
|
70
70
|
});
|
71
71
|
templateResources.forEach(templateResource => {
|
72
|
-
!options[
|
72
|
+
!options['skip-logs'] && progressLog(templateResource.componentPath);
|
73
73
|
replaceMinMaxLabels(templateResource, fileSystem, COMPONENTS_WITH_MIN_MAX_LABELS);
|
74
74
|
});
|
75
75
|
/**
|
@@ -81,10 +81,10 @@ function migrateInputSlider(fileSystem, options) {
|
|
81
81
|
ng_morph_1.setActiveProject(ng_morph_1.createProject(fileSystem.tree, project_root_1.projectRoot(), constants_1.ALL_FILES));
|
82
82
|
progressLog = progress_1.setupProgressLogger({
|
83
83
|
total: COMPONENTS_WITH_MIN_MAX_LABELS.size,
|
84
|
-
prefix:
|
84
|
+
prefix: '[addMinMaxLabelMethod]',
|
85
85
|
});
|
86
86
|
Array.from(COMPONENTS_WITH_MIN_MAX_LABELS).forEach(componentPath => {
|
87
|
-
!options[
|
87
|
+
!options['skip-logs'] && progressLog(componentPath);
|
88
88
|
addMinMaxLabelMethod(componentPath);
|
89
89
|
});
|
90
90
|
}
|
@@ -9,9 +9,9 @@ const angular_json_manipulations_1 = require("../../../utils/angular-json-manipu
|
|
9
9
|
const get_project_target_options_1 = require("../../../utils/get-project-target-options");
|
10
10
|
const get_projects_1 = require("../../../utils/get-projects");
|
11
11
|
const PROPRIETARY_TDS_ICON_ASSETS = {
|
12
|
-
glob:
|
13
|
-
input:
|
14
|
-
output:
|
12
|
+
glob: '**/*',
|
13
|
+
input: 'node_modules/@taiga-ui/proprietary-tds-icons/src',
|
14
|
+
output: 'assets/taiga-ui/icons',
|
15
15
|
};
|
16
16
|
const MANUAL_MIGRATION_TIPS = `Add ${JSON.stringify(PROPRIETARY_TDS_ICON_ASSETS, null, 4)} to angular.json manually`;
|
17
17
|
function migrateTaigaProprietaryIcons(options) {
|
@@ -20,7 +20,7 @@ function migrateTaigaProprietaryIcons(options) {
|
|
20
20
|
let proprietaryIcons = null;
|
21
21
|
try {
|
22
22
|
proprietaryIcons =
|
23
|
-
((_a = ng_morph_1.getPackageJsonDependency(tree,
|
23
|
+
((_a = ng_morph_1.getPackageJsonDependency(tree, '@taiga-ui/proprietary-icons')) === null || _a === void 0 ? void 0 : _a.version) ||
|
24
24
|
null;
|
25
25
|
}
|
26
26
|
catch (_b) {
|
@@ -30,7 +30,7 @@ function migrateTaigaProprietaryIcons(options) {
|
|
30
30
|
context.logger.warn(`[WARNING]: Schematics don't support this version of angular.json. ${MANUAL_MIGRATION_TIPS}`);
|
31
31
|
return;
|
32
32
|
}
|
33
|
-
return ng_morph_1.getSourceFiles(
|
33
|
+
return ng_morph_1.getSourceFiles('**/angular.json').length > 0
|
34
34
|
? workspace_1.updateWorkspace(workspace => {
|
35
35
|
if (proprietaryIcons === null) {
|
36
36
|
return;
|
@@ -43,14 +43,14 @@ function migrateTaigaProprietaryIcons(options) {
|
|
43
43
|
for (const project of projects) {
|
44
44
|
let targetOptions;
|
45
45
|
try {
|
46
|
-
targetOptions = get_project_target_options_1.getProjectTargetOptions(project,
|
46
|
+
targetOptions = get_project_target_options_1.getProjectTargetOptions(project, 'build');
|
47
47
|
}
|
48
48
|
catch (_a) {
|
49
49
|
context.logger.warn(`[WARNING]: No buildable project was found. ${MANUAL_MIGRATION_TIPS}`);
|
50
50
|
return;
|
51
51
|
}
|
52
52
|
if (Array.isArray(targetOptions === null || targetOptions === void 0 ? void 0 : targetOptions.assets)) {
|
53
|
-
const tdsSrc =
|
53
|
+
const tdsSrc = '@taiga-ui/proprietary-tds-icons/src';
|
54
54
|
const hasIcons = targetOptions.assets.find(asset => {
|
55
55
|
var _a;
|
56
56
|
return is_string_1.tuiIsString(asset)
|