@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
@@ -9,23 +9,23 @@ const replace_text_1 = require("../utils/replace-text");
|
|
9
9
|
const constants_1 = require("./constants/constants");
|
10
10
|
const icons_1 = require("./constants/icons");
|
11
11
|
function hasProprietaryIcons(tree) {
|
12
|
-
return !!ng_morph_1.getPackageJsonDependency(tree,
|
12
|
+
return !!ng_morph_1.getPackageJsonDependency(tree, '@taiga-ui/proprietary-icons');
|
13
13
|
}
|
14
14
|
function updateToV3_35(options) {
|
15
15
|
return (tree, _) => {
|
16
16
|
if (!hasProprietaryIcons(tree)) {
|
17
|
-
!options[
|
17
|
+
!options['skip-logs'] &&
|
18
18
|
colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} No migrations required\n`);
|
19
19
|
return;
|
20
20
|
}
|
21
21
|
const fileSystem = get_file_system_1.getFileSystem(tree);
|
22
22
|
replace_imports_1.replaceImports(constants_1.ICONS_TS, options);
|
23
|
-
!options[
|
23
|
+
!options['skip-logs'] &&
|
24
24
|
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing strings...`);
|
25
|
-
replace_text_1.replaceText(icons_1.ICONS.map(({ from, to }) => ({ from: new RegExp(`\\b${from}\\b`,
|
25
|
+
replace_text_1.replaceText(icons_1.ICONS.map(({ from, to }) => ({ from: new RegExp(`\\b${from}\\b`, 'g'), to })));
|
26
26
|
fileSystem.commitEdits();
|
27
27
|
ng_morph_1.saveActiveProject();
|
28
|
-
!options[
|
28
|
+
!options['skip-logs'] &&
|
29
29
|
colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} Icons successfully migrated \n`);
|
30
30
|
};
|
31
31
|
}
|
@@ -7,18 +7,18 @@ const constants_1 = require("../../constants");
|
|
7
7
|
const colored_log_1 = require("../../utils/colored-log");
|
8
8
|
const get_file_system_1 = require("../utils/get-file-system");
|
9
9
|
const replace_text_1 = require("../utils/replace-text");
|
10
|
-
const OLD_PACKAGE =
|
11
|
-
const NEW_PACKAGE =
|
12
|
-
const NEW_PACKAGE_VERSION =
|
10
|
+
const OLD_PACKAGE = '@taiga-ui/addon-editor';
|
11
|
+
const NEW_PACKAGE = '@tinkoff/tui-editor';
|
12
|
+
const NEW_PACKAGE_VERSION = '^1.0.1';
|
13
13
|
function updateToV3_36(options) {
|
14
14
|
return (tree, context) => {
|
15
15
|
if (!ng_morph_1.getPackageJsonDependency(tree, OLD_PACKAGE)) {
|
16
|
-
!options[
|
16
|
+
!options['skip-logs'] &&
|
17
17
|
colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} No migrations required for ${OLD_PACKAGE}\n`);
|
18
18
|
return;
|
19
19
|
}
|
20
20
|
const fileSystem = get_file_system_1.getFileSystem(tree);
|
21
|
-
!options[
|
21
|
+
!options['skip-logs'] &&
|
22
22
|
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing imports for ${OLD_PACKAGE}...`);
|
23
23
|
replace_text_1.replaceText([{ from: OLD_PACKAGE, to: NEW_PACKAGE }], constants_1.ALL_TS_FILES);
|
24
24
|
ng_morph_1.removePackageJsonDependency(tree, OLD_PACKAGE);
|
@@ -26,7 +26,7 @@ function updateToV3_36(options) {
|
|
26
26
|
context.addTask(new tasks_1.NodePackageInstallTask());
|
27
27
|
fileSystem.commitEdits();
|
28
28
|
ng_morph_1.saveActiveProject();
|
29
|
-
!options[
|
29
|
+
!options['skip-logs'] && colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} successfully migrated \n`);
|
30
30
|
};
|
31
31
|
}
|
32
32
|
exports.updateToV3_36 = updateToV3_36;
|
@@ -12,16 +12,16 @@ const get_file_system_1 = require("../utils/get-file-system");
|
|
12
12
|
const replace_text_1 = require("../utils/replace-text");
|
13
13
|
const replace_tag_1 = require("../utils/templates/replace-tag");
|
14
14
|
function replaceTextareaTag(options, fileSystem) {
|
15
|
-
!options[
|
15
|
+
!options['skip-logs'] &&
|
16
16
|
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing <tui-text-area /> to <tui-textarea />`);
|
17
17
|
get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES).forEach(resource => {
|
18
18
|
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
19
|
-
const elements = elements_1.findElementsByTagName(template,
|
19
|
+
const elements = elements_1.findElementsByTagName(template, 'tui-text-area');
|
20
20
|
const path = fileSystem.resolve(template_resource_1.getPathFromTemplateResource(resource));
|
21
21
|
const recorder = fileSystem.edit(path);
|
22
22
|
elements.forEach(({ sourceCodeLocation }) => {
|
23
23
|
if (sourceCodeLocation) {
|
24
|
-
replace_tag_1.replaceTag(recorder, sourceCodeLocation,
|
24
|
+
replace_tag_1.replaceTag(recorder, sourceCodeLocation, 'tui-text-area', 'tui-textarea');
|
25
25
|
}
|
26
26
|
});
|
27
27
|
});
|
@@ -30,20 +30,20 @@ function replaceTextareaTag(options, fileSystem) {
|
|
30
30
|
ng_morph_1.setActiveProject(ng_morph_1.createProject(fileSystem.tree, project_root_1.projectRoot(), constants_1.ALL_FILES));
|
31
31
|
}
|
32
32
|
function replaceTextareaReferenceTypes(options, fileSystem) {
|
33
|
-
!options[
|
33
|
+
!options['skip-logs'] &&
|
34
34
|
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing TuiTextArea(Module|Directive|Component) to TuiTextarea(Module|Directive|Component)`);
|
35
35
|
replace_text_1.replaceText([
|
36
36
|
{
|
37
|
-
from:
|
38
|
-
to:
|
37
|
+
from: 'TuiTextAreaModule',
|
38
|
+
to: 'TuiTextareaModule',
|
39
39
|
},
|
40
40
|
{
|
41
|
-
from:
|
42
|
-
to:
|
41
|
+
from: 'TuiTextAreaDirective',
|
42
|
+
to: 'TuiTextareaDirective',
|
43
43
|
},
|
44
44
|
{
|
45
|
-
from:
|
46
|
-
to:
|
45
|
+
from: 'TuiTextAreaComponent',
|
46
|
+
to: 'TuiTextareaComponent',
|
47
47
|
},
|
48
48
|
]);
|
49
49
|
fileSystem.commitEdits();
|
@@ -55,7 +55,7 @@ function updateToV3_40(options) {
|
|
55
55
|
const fileSystem = get_file_system_1.getFileSystem(tree);
|
56
56
|
replaceTextareaTag(options, fileSystem);
|
57
57
|
replaceTextareaReferenceTypes(options, fileSystem);
|
58
|
-
!options[
|
58
|
+
!options['skip-logs'] && colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} successfully migrated \n`);
|
59
59
|
};
|
60
60
|
}
|
61
61
|
exports.updateToV3_40 = updateToV3_40;
|
@@ -12,7 +12,7 @@ function updateToV3_5(options) {
|
|
12
12
|
migrate_expand_templates_1.migrateExpandTemplates(fileSystem, options);
|
13
13
|
fileSystem.commitEdits();
|
14
14
|
ng_morph_1.saveActiveProject();
|
15
|
-
!options[
|
15
|
+
!options['skip-logs'] &&
|
16
16
|
colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} We migrated packages to @taiga-ui/*@${versions_1.TAIGA_VERSION}\n`);
|
17
17
|
};
|
18
18
|
}
|
@@ -10,23 +10,23 @@ const template_resource_1 = require("../../../utils/templates/template-resource"
|
|
10
10
|
function migrateExpand({ resource, recorder, fileSystem, }) {
|
11
11
|
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
12
12
|
const templateOffset = template_resource_1.getTemplateOffset(resource);
|
13
|
-
const elements = elements_1.findElementsByTagName(template,
|
13
|
+
const elements = elements_1.findElementsByTagName(template, 'tui-expand');
|
14
14
|
elements.forEach(element => {
|
15
15
|
var _a;
|
16
|
-
const templateElement = elements_1.findElementsByFn(element.childNodes, el => el.tagName ===
|
16
|
+
const templateElement = elements_1.findElementsByFn(element.childNodes, el => el.tagName === 'ng-template')[0];
|
17
17
|
if (!templateElement) {
|
18
18
|
return;
|
19
19
|
}
|
20
|
-
const tuiExpandAttr = templateElement.attrs.find(attr => attr.name ===
|
20
|
+
const tuiExpandAttr = templateElement.attrs.find(attr => attr.name === 'tuiexpandcontent');
|
21
21
|
const insertTo = (_a = templateElement === null || templateElement === void 0 ? void 0 : templateElement.sourceCodeLocation) === null || _a === void 0 ? void 0 : _a.startTag.endOffset;
|
22
22
|
if (!insertTo || tuiExpandAttr) {
|
23
23
|
return;
|
24
24
|
}
|
25
|
-
recorder.insertRight(insertTo + templateOffset - 1,
|
25
|
+
recorder.insertRight(insertTo + templateOffset - 1, ' tuiExpandContent');
|
26
26
|
});
|
27
27
|
}
|
28
28
|
function migrateExpandTemplates(fileSystem, options) {
|
29
|
-
!options[
|
29
|
+
!options['skip-logs'] &&
|
30
30
|
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating templates...`);
|
31
31
|
const componentWithTemplatesPaths = get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES);
|
32
32
|
const progressLog = progress_1.setupProgressLogger({
|
@@ -35,10 +35,10 @@ function migrateExpandTemplates(fileSystem, options) {
|
|
35
35
|
componentWithTemplatesPaths.forEach(resource => {
|
36
36
|
const path = fileSystem.resolve(template_resource_1.getPathFromTemplateResource(resource));
|
37
37
|
const recorder = fileSystem.edit(path);
|
38
|
-
!options[
|
38
|
+
!options['skip-logs'] && progressLog('expand migration', true);
|
39
39
|
migrateExpand({ resource, fileSystem, recorder });
|
40
40
|
});
|
41
|
-
!options[
|
41
|
+
!options['skip-logs'] &&
|
42
42
|
colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} templates migrated \n`);
|
43
43
|
}
|
44
44
|
exports.migrateExpandTemplates = migrateExpandTemplates;
|
@@ -26,13 +26,13 @@ function main(options) {
|
|
26
26
|
}
|
27
27
|
function updateToV4(options) {
|
28
28
|
const t0 = perf_hooks_1.performance.now();
|
29
|
-
!options[
|
29
|
+
!options['skip-logs'] &&
|
30
30
|
colored_log_1.titleLog(`\n\n${colored_log_1.START_SYMBOL} Your packages will be updated to @taiga-ui/*@${versions_1.TAIGA_VERSION}\n`);
|
31
31
|
return schematics_1.chain([
|
32
32
|
main(options),
|
33
33
|
() => {
|
34
34
|
const executionTime = get_execution_time_1.getExecutionTime(t0, perf_hooks_1.performance.now());
|
35
|
-
!options[
|
35
|
+
!options['skip-logs'] &&
|
36
36
|
colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} We migrated packages to @taiga-ui/*@${versions_1.TAIGA_VERSION} in ${executionTime}. \n`);
|
37
37
|
},
|
38
38
|
]);
|
@@ -4,37 +4,37 @@ exports.ATTRS_TO_DIRECTIVE_REPLACE = void 0;
|
|
4
4
|
exports.ATTRS_TO_DIRECTIVE_REPLACE = [
|
5
5
|
{
|
6
6
|
componentSelector: [
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
'tui-primitive-textfield',
|
8
|
+
'tui-input-number',
|
9
|
+
'tui-input-slider',
|
10
10
|
],
|
11
|
-
inputProperty:
|
12
|
-
directive:
|
11
|
+
inputProperty: 'prefix',
|
12
|
+
directive: 'tuiTextfieldPrefix',
|
13
13
|
directiveModule: {
|
14
|
-
name:
|
15
|
-
moduleSpecifier:
|
14
|
+
name: 'TuiTextfieldControllerModule',
|
15
|
+
moduleSpecifier: '@taiga-ui/core',
|
16
16
|
},
|
17
17
|
},
|
18
18
|
{
|
19
19
|
componentSelector: [
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
'tui-primitive-textfield',
|
21
|
+
'tui-input-number',
|
22
|
+
'tui-input-slider',
|
23
23
|
],
|
24
|
-
inputProperty:
|
25
|
-
directive:
|
24
|
+
inputProperty: 'postfix',
|
25
|
+
directive: 'tuiTextfieldPostfix',
|
26
26
|
directiveModule: {
|
27
|
-
name:
|
28
|
-
moduleSpecifier:
|
27
|
+
name: 'TuiTextfieldControllerModule',
|
28
|
+
moduleSpecifier: '@taiga-ui/core',
|
29
29
|
},
|
30
30
|
},
|
31
31
|
{
|
32
|
-
componentSelector: [
|
33
|
-
inputProperty:
|
34
|
-
directive:
|
32
|
+
componentSelector: ['tui-primitive-textfield'],
|
33
|
+
inputProperty: 'filler',
|
34
|
+
directive: 'tuiTextfieldFiller',
|
35
35
|
directiveModule: {
|
36
|
-
name:
|
37
|
-
moduleSpecifier:
|
36
|
+
name: 'TuiTextfieldControllerModule',
|
37
|
+
moduleSpecifier: '@taiga-ui/core',
|
38
38
|
},
|
39
39
|
},
|
40
40
|
];
|
@@ -4,51 +4,51 @@ exports.ATTRS_TO_REPLACE = void 0;
|
|
4
4
|
exports.ATTRS_TO_REPLACE = [
|
5
5
|
{
|
6
6
|
from: {
|
7
|
-
attrName:
|
8
|
-
withTagNames: [
|
7
|
+
attrName: 'brandLogo',
|
8
|
+
withTagNames: ['tui-card', 'tui-thumbnail-card'],
|
9
9
|
},
|
10
|
-
to: { attrName:
|
10
|
+
to: { attrName: 'iconLeft' },
|
11
11
|
},
|
12
12
|
{
|
13
13
|
from: {
|
14
|
-
attrName:
|
15
|
-
withTagNames: [
|
14
|
+
attrName: '[brandLogo]',
|
15
|
+
withTagNames: ['tui-card', 'tui-thumbnail-card'],
|
16
16
|
},
|
17
|
-
to: { attrName:
|
17
|
+
to: { attrName: '[iconLeft]' },
|
18
18
|
},
|
19
19
|
{
|
20
20
|
from: {
|
21
|
-
attrName:
|
22
|
-
withTagNames: [
|
21
|
+
attrName: '[status]',
|
22
|
+
withTagNames: ['tui-badge'],
|
23
23
|
},
|
24
|
-
to: { attrName:
|
24
|
+
to: { attrName: '[appearance]' },
|
25
25
|
},
|
26
26
|
{
|
27
27
|
from: {
|
28
|
-
attrName:
|
29
|
-
withTagNames: [
|
28
|
+
attrName: 'status',
|
29
|
+
withTagNames: ['tui-badge'],
|
30
30
|
},
|
31
|
-
to: { attrName:
|
31
|
+
to: { attrName: 'appearance' },
|
32
32
|
},
|
33
33
|
{
|
34
34
|
from: {
|
35
|
-
attrName:
|
36
|
-
withTagNames: [
|
35
|
+
attrName: 'item',
|
36
|
+
withTagNames: ['tui-radio'],
|
37
37
|
},
|
38
|
-
to: { attrName:
|
38
|
+
to: { attrName: 'value' },
|
39
39
|
},
|
40
40
|
{
|
41
41
|
from: {
|
42
|
-
attrName:
|
43
|
-
withTagNames: [
|
42
|
+
attrName: '[item]',
|
43
|
+
withTagNames: ['tui-radio'],
|
44
44
|
},
|
45
|
-
to: { attrName:
|
45
|
+
to: { attrName: '[value]' },
|
46
46
|
},
|
47
47
|
{
|
48
48
|
from: {
|
49
|
-
attrName:
|
50
|
-
withTagNames: [
|
49
|
+
attrName: '[rounded]',
|
50
|
+
withTagNames: ['tui-avatar'],
|
51
51
|
},
|
52
|
-
to: { attrName:
|
52
|
+
to: { attrName: '[round]' },
|
53
53
|
},
|
54
54
|
];
|
@@ -3,18 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HTML_COMMENTS = void 0;
|
4
4
|
exports.HTML_COMMENTS = [
|
5
5
|
{
|
6
|
-
tag:
|
7
|
-
withAttrs: [
|
8
|
-
comment:
|
6
|
+
tag: 'tui-toggle',
|
7
|
+
withAttrs: ['singleColor', 'showLoader'],
|
8
|
+
comment: 'toggle [singleColor] and [showLoader] inputs have been removed due to design changes',
|
9
9
|
},
|
10
10
|
{
|
11
|
-
tag:
|
12
|
-
withAttrs: [
|
13
|
-
comment:
|
11
|
+
tag: 'tui-table-pagination',
|
12
|
+
withAttrs: ['[(page)]', '[(size)]', '(pageChange)', '(sizeChange)'],
|
13
|
+
comment: '(pageChange) and (sizeChange) outputs have been removed. Use (paginationChange) instead',
|
14
14
|
},
|
15
15
|
{
|
16
|
-
tag:
|
17
|
-
withAttrs: [
|
18
|
-
comment:
|
16
|
+
tag: 'tui-radio',
|
17
|
+
withAttrs: ['identityMatcher', 'showLoader'],
|
18
|
+
comment: 'radio [identityMatcher] and [pseudoDisabled] inputs have been removed. If you need a workaround, please start a discussion on GitHub to think together',
|
19
19
|
},
|
20
20
|
];
|
@@ -3,46 +3,46 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IDENTIFIERS_TO_REPLACE = void 0;
|
4
4
|
exports.IDENTIFIERS_TO_REPLACE = [
|
5
5
|
{
|
6
|
-
from: { name:
|
7
|
-
to: { name:
|
6
|
+
from: { name: 'TuiCardModule', moduleSpecifier: '@taiga-ui/addon-commerce' },
|
7
|
+
to: { name: 'TuiThumbnailCardModule', moduleSpecifier: '@taiga-ui/addon-commerce' },
|
8
8
|
},
|
9
9
|
{
|
10
|
-
from: { name:
|
10
|
+
from: { name: 'TuiCardComponent', moduleSpecifier: '@taiga-ui/addon-commerce' },
|
11
11
|
to: {
|
12
|
-
name:
|
13
|
-
moduleSpecifier:
|
12
|
+
name: 'TuiThumbnailCardComponent',
|
13
|
+
moduleSpecifier: '@taiga-ui/addon-commerce',
|
14
14
|
},
|
15
15
|
},
|
16
16
|
{
|
17
|
-
from: { name:
|
18
|
-
to: { name:
|
17
|
+
from: { name: 'TuiBadgeModule', moduleSpecifier: '@taiga-ui/experimental' },
|
18
|
+
to: { name: 'TuiBadgeModule', moduleSpecifier: '@taiga-ui/kit' },
|
19
19
|
},
|
20
20
|
{
|
21
|
-
from: { name:
|
22
|
-
to: { name:
|
21
|
+
from: { name: 'TuiCheckboxModule', moduleSpecifier: '@taiga-ui/experimental' },
|
22
|
+
to: { name: 'TuiCheckboxModule', moduleSpecifier: '@taiga-ui/kit' },
|
23
23
|
},
|
24
24
|
{
|
25
|
-
from: { name:
|
26
|
-
to: { name:
|
25
|
+
from: { name: 'TuiRadioModule', moduleSpecifier: '@taiga-ui/experimental' },
|
26
|
+
to: { name: 'TuiRadioModule', moduleSpecifier: '@taiga-ui/kit' },
|
27
27
|
},
|
28
28
|
{
|
29
|
-
from: { name:
|
30
|
-
to: { name:
|
29
|
+
from: { name: 'TuiAvatarModule', moduleSpecifier: '@taiga-ui/experimental' },
|
30
|
+
to: { name: 'TuiAvatarModule', moduleSpecifier: '@taiga-ui/kit' },
|
31
31
|
},
|
32
32
|
{
|
33
|
-
from: { name:
|
34
|
-
to: { name:
|
33
|
+
from: { name: 'TuiToggleModule', moduleSpecifier: '@taiga-ui/experimental' },
|
34
|
+
to: { name: 'TuiToggleModule', moduleSpecifier: '@taiga-ui/kit' },
|
35
35
|
},
|
36
36
|
{
|
37
|
-
from: { name:
|
38
|
-
to: { name:
|
37
|
+
from: { name: 'TuiTextAreaModule', moduleSpecifier: '@taiga-ui/kit' },
|
38
|
+
to: { name: 'TuiTextareaModule', moduleSpecifier: '@taiga-ui/kit' },
|
39
39
|
},
|
40
40
|
{
|
41
|
-
from: { name:
|
42
|
-
to: { name:
|
41
|
+
from: { name: 'TuiTextAreaDirective', moduleSpecifier: '@taiga-ui/kit' },
|
42
|
+
to: { name: 'TuiTextareaDirective', moduleSpecifier: '@taiga-ui/kit' },
|
43
43
|
},
|
44
44
|
{
|
45
|
-
from: { name:
|
46
|
-
to: { name:
|
45
|
+
from: { name: 'TuiTextAreaComponent', moduleSpecifier: '@taiga-ui/kit' },
|
46
|
+
to: { name: 'TuiTextareaComponent', moduleSpecifier: '@taiga-ui/kit' },
|
47
47
|
},
|
48
48
|
];
|
@@ -2,8 +2,8 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.INPUTS_TO_REMOVE = void 0;
|
4
4
|
exports.INPUTS_TO_REMOVE = [
|
5
|
-
{ inputName:
|
6
|
-
{ inputName:
|
7
|
-
{ inputName:
|
8
|
-
{ inputName:
|
5
|
+
{ inputName: 'active', tags: ['tui-card', 'tui-thumbnail-card'] },
|
6
|
+
{ inputName: 'showLoader', tags: ['tui-toggle'] },
|
7
|
+
{ inputName: 'singleColor', tags: ['tui-toggle'] },
|
8
|
+
{ inputName: 'hoverable', tags: ['tui-badge'] },
|
9
9
|
];
|
@@ -2,6 +2,6 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.TAGS_TO_REPLACE = void 0;
|
4
4
|
exports.TAGS_TO_REPLACE = [
|
5
|
-
{ from:
|
6
|
-
{ from:
|
5
|
+
{ from: 'tui-card', to: 'tui-thumbnail-card' },
|
6
|
+
{ from: 'tui-text-area', to: 'tui-textarea' },
|
7
7
|
];
|
@@ -14,7 +14,7 @@ function getAction({ action, requiredData, }) {
|
|
14
14
|
return ({ resource, fileSystem, recorder, }) => action({ resource, fileSystem, recorder, data: requiredData });
|
15
15
|
}
|
16
16
|
function migrateTemplates(fileSystem, options) {
|
17
|
-
!options[
|
17
|
+
!options['skip-logs'] &&
|
18
18
|
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating templates...`);
|
19
19
|
const componentWithTemplatesPaths = get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES);
|
20
20
|
const actions = [
|
@@ -40,11 +40,11 @@ function migrateTemplates(fileSystem, options) {
|
|
40
40
|
const recorder = fileSystem.edit(path);
|
41
41
|
actions.forEach((action, actionIndex) => {
|
42
42
|
const isLastAction = actionIndex === actions.length - 1;
|
43
|
-
!options[
|
43
|
+
!options['skip-logs'] && progressLog(action.name, isLastAction);
|
44
44
|
action({ resource, fileSystem, recorder });
|
45
45
|
});
|
46
46
|
});
|
47
|
-
!options[
|
47
|
+
!options['skip-logs'] &&
|
48
48
|
colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} templates migrated \n`);
|
49
49
|
}
|
50
50
|
exports.migrateTemplates = migrateTemplates;
|
@@ -6,9 +6,9 @@ const colored_log_1 = require("../../../utils/colored-log");
|
|
6
6
|
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
7
7
|
const replace_identifier_1 = require("../../steps/replace-identifier");
|
8
8
|
function updateTuiMapper(options) {
|
9
|
-
!options[
|
9
|
+
!options['skip-logs'] &&
|
10
10
|
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} updating TuiMapper typing to the typed version`);
|
11
|
-
const refs = get_named_import_references_1.getNamedImportReferences(
|
11
|
+
const refs = get_named_import_references_1.getNamedImportReferences('TuiMapper', '@taiga-ui/cdk');
|
12
12
|
for (const ref of refs) {
|
13
13
|
if (ref.wasForgotten()) {
|
14
14
|
return;
|
@@ -25,16 +25,16 @@ function updateTuiMapper(options) {
|
|
25
25
|
}
|
26
26
|
}
|
27
27
|
function renameTuiTypedMapper(options) {
|
28
|
-
!options[
|
28
|
+
!options['skip-logs'] &&
|
29
29
|
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} renaming TuiTypedMapper to TuiMapper`);
|
30
30
|
replace_identifier_1.replaceIdentifier({
|
31
|
-
from: { name:
|
32
|
-
to: { name:
|
31
|
+
from: { name: 'TuiTypedMapper', moduleSpecifier: '@taiga-ui/cdk' },
|
32
|
+
to: { name: 'TuiMapper', moduleSpecifier: '@taiga-ui/cdk' },
|
33
33
|
});
|
34
34
|
}
|
35
35
|
function restoreTuiMapper(options) {
|
36
36
|
updateTuiMapper(options);
|
37
37
|
renameTuiTypedMapper(options);
|
38
|
-
!options[
|
38
|
+
!options['skip-logs'] && colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} successfully migrated \n`);
|
39
39
|
}
|
40
40
|
exports.restoreTuiMapper = restoreTuiMapper;
|
@@ -6,9 +6,9 @@ const colored_log_1 = require("../../../utils/colored-log");
|
|
6
6
|
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
7
7
|
const replace_identifier_1 = require("../../steps/replace-identifier");
|
8
8
|
function updateTuiMatcher(options) {
|
9
|
-
!options[
|
9
|
+
!options['skip-logs'] &&
|
10
10
|
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} updating TuiMatcher typing to the typed version`);
|
11
|
-
const refs = get_named_import_references_1.getNamedImportReferences(
|
11
|
+
const refs = get_named_import_references_1.getNamedImportReferences('TuiMatcher', '@taiga-ui/cdk');
|
12
12
|
for (const ref of refs) {
|
13
13
|
if (ref.wasForgotten()) {
|
14
14
|
return;
|
@@ -25,16 +25,16 @@ function updateTuiMatcher(options) {
|
|
25
25
|
}
|
26
26
|
}
|
27
27
|
function renameTuiTypedMatcher(options) {
|
28
|
-
!options[
|
28
|
+
!options['skip-logs'] &&
|
29
29
|
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} renaming TuiTypedMatcher to TuiMatcher`);
|
30
30
|
replace_identifier_1.replaceIdentifier({
|
31
|
-
from: { name:
|
32
|
-
to: { name:
|
31
|
+
from: { name: 'TuiTypedMatcher', moduleSpecifier: '@taiga-ui/cdk' },
|
32
|
+
to: { name: 'TuiMatcher', moduleSpecifier: '@taiga-ui/cdk' },
|
33
33
|
});
|
34
34
|
}
|
35
35
|
function restoreTuiMatcher(options) {
|
36
36
|
updateTuiMatcher(options);
|
37
37
|
renameTuiTypedMatcher(options);
|
38
|
-
!options[
|
38
|
+
!options['skip-logs'] && colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} successfully migrated \n`);
|
39
39
|
}
|
40
40
|
exports.restoreTuiMatcher = restoreTuiMatcher;
|
@@ -23,20 +23,20 @@ function getFallbackValue(textValue, fallbackValue) {
|
|
23
23
|
if (textValue) {
|
24
24
|
return `(${textValue} | tuiInitials)`;
|
25
25
|
}
|
26
|
-
return textValue ? `(${textValue} | tuiInitials)` : fallbackValue ||
|
26
|
+
return textValue ? `(${textValue} | tuiInitials)` : fallbackValue || '';
|
27
27
|
}
|
28
28
|
function normalizeAttrValue(attrName, attrValue) {
|
29
|
-
return attrName.startsWith(
|
29
|
+
return attrName.startsWith('[') ? attrValue : `'${attrValue}'`;
|
30
30
|
}
|
31
31
|
function migrateAvatar({ resource, recorder, fileSystem, }) {
|
32
32
|
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
33
33
|
const templateOffset = template_resource_1.getTemplateOffset(resource);
|
34
|
-
const elements = elements_1.findElementsByTagName(template,
|
34
|
+
const elements = elements_1.findElementsByTagName(template, 'tui-avatar');
|
35
35
|
elements.forEach(({ attrs, sourceCodeLocation }) => {
|
36
|
-
const avatarUrlAttr = attrs.find(attr => attr.name ===
|
37
|
-
const fallbackAttr = attrs.find(attr => attr.name ===
|
38
|
-
const textAttr = attrs.find(attr => attr.name ===
|
39
|
-
const roundedAttr = attrs.find(attr => attr.name ===
|
36
|
+
const avatarUrlAttr = attrs.find(attr => attr.name === '[avatarurl]' || attr.name === 'avatarurl');
|
37
|
+
const fallbackAttr = attrs.find(attr => attr.name === '[fallback]' || attr.name === 'fallback');
|
38
|
+
const textAttr = attrs.find(attr => attr.name === '[text]' || attr.name === 'text');
|
39
|
+
const roundedAttr = attrs.find(attr => attr.name === '[rounded]' || attr.name === 'rounded');
|
40
40
|
if ((!avatarUrlAttr && !textAttr) || !sourceCodeLocation) {
|
41
41
|
return;
|
42
42
|
}
|
@@ -45,27 +45,27 @@ function migrateAvatar({ resource, recorder, fileSystem, }) {
|
|
45
45
|
const textAttrValue = (textAttr === null || textAttr === void 0 ? void 0 : textAttr.value) && normalizeAttrValue(textAttr.name, textAttr.value);
|
46
46
|
const fallbackAttrValue = (fallbackAttr === null || fallbackAttr === void 0 ? void 0 : fallbackAttr.value) &&
|
47
47
|
normalizeAttrValue(fallbackAttr.name, fallbackAttr.value);
|
48
|
-
const insertTo = sourceCodeLocation.startTag.startOffset +
|
48
|
+
const insertTo = sourceCodeLocation.startTag.startOffset + '<tui-avatar'.length;
|
49
49
|
if (!insertTo) {
|
50
50
|
return;
|
51
51
|
}
|
52
|
-
const mainSrc = urlAttrValue || (textAttrValue ? `${textAttrValue} | tuiInitials` :
|
52
|
+
const mainSrc = urlAttrValue || (textAttrValue ? `${textAttrValue} | tuiInitials` : '');
|
53
53
|
const fallbackValue = urlAttrValue
|
54
54
|
? getFallbackValue(textAttrValue, fallbackAttrValue)
|
55
|
-
:
|
55
|
+
: '';
|
56
56
|
const fallbackSrc = urlAttrValue && fallbackValue
|
57
57
|
? `| tuiFallbackSrc : ${fallbackValue} | async`
|
58
|
-
:
|
59
|
-
recorder.insertRight(insertTo + templateOffset, ` [src]="${mainSrc}${fallbackSrc ? ` ${fallbackSrc}` :
|
58
|
+
: '';
|
59
|
+
recorder.insertRight(insertTo + templateOffset, ` [src]="${mainSrc}${fallbackSrc ? ` ${fallbackSrc}` : ''}"${!roundedAttr ? ' [round]="false"' : ''}`);
|
60
60
|
const attrsToRemove = [avatarUrlAttr, textAttr, fallbackAttr].filter((attr) => attr !== undefined);
|
61
61
|
const fallbackModule = !!((avatarUrlAttr && textAttrValue) || fallbackAttr);
|
62
62
|
const initialsModule = !!textAttrValue;
|
63
63
|
const modules = [
|
64
64
|
...(fallbackModule
|
65
|
-
? [{ moduleName:
|
65
|
+
? [{ moduleName: 'TuiFallbackModule', moduleSpecifier: '@taiga-ui/cdk' }]
|
66
66
|
: []),
|
67
67
|
...(initialsModule
|
68
|
-
? [{ moduleName:
|
68
|
+
? [{ moduleName: 'TuiInitialsModule', moduleSpecifier: '@taiga-ui/cdk' }]
|
69
69
|
: []),
|
70
70
|
];
|
71
71
|
addModules(resource.componentPath, modules);
|
@@ -6,10 +6,10 @@ const template_resource_1 = require("../../../../utils/templates/template-resour
|
|
6
6
|
function migrateBadgeValue({ resource, recorder, fileSystem, }) {
|
7
7
|
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
8
8
|
const templateOffset = template_resource_1.getTemplateOffset(resource);
|
9
|
-
const elements = elements_1.findElementsWithAttributeOnTag(template, [
|
9
|
+
const elements = elements_1.findElementsWithAttributeOnTag(template, ['[value]', 'value'], ['tui-badge']);
|
10
10
|
elements.forEach(({ attrs, sourceCodeLocation }) => {
|
11
11
|
var _a;
|
12
|
-
const attr = attrs.find(attr => attr.name ===
|
12
|
+
const attr = attrs.find(attr => attr.name === '[value]' || attr.name === 'value');
|
13
13
|
if (!attr) {
|
14
14
|
return;
|
15
15
|
}
|
@@ -18,7 +18,7 @@ function migrateBadgeValue({ resource, recorder, fileSystem, }) {
|
|
18
18
|
if (!attrValue || !insertTo) {
|
19
19
|
return;
|
20
20
|
}
|
21
|
-
recorder.insertRight(insertTo + templateOffset, attr.name ===
|
21
|
+
recorder.insertRight(insertTo + templateOffset, attr.name === 'value' ? attrValue : `{{ ${attrValue} }}`);
|
22
22
|
const attrOffset = (_a = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.attrs) === null || _a === void 0 ? void 0 : _a[attr.name];
|
23
23
|
if (attrOffset) {
|
24
24
|
const { startOffset, endOffset } = attrOffset;
|