From fa944ee8d828f2eef56c74d46e6debd912c87c36 Mon Sep 17 00:00:00 2001 From: Vladimir Potekhin <46284632+vladimirpotekhin@users.noreply.github.com> Date: Mon, 12 Aug 2024 15:29:52 +0300 Subject: [PATCH] chore: fix appearance migration (#8473) --- .../steps/constants/attr-with-values-to-replace.ts | 12 ------------ .../ng-update/v4/steps/constants/attrs-to-replace.ts | 9 +++++++++ .../v4/tests/schematic-migrate-blocked.spec.ts | 2 +- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/projects/cdk/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.ts b/projects/cdk/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.ts index b3b9fc4875c3..a1c67bbde04f 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.ts @@ -36,24 +36,12 @@ export const ATTR_WITH_VALUES_TO_REPLACE: ReplacementAttributeValue[] = [ withTagNames: hasPseudo, valueReplacer: (condition) => `${condition} ? 'active' : null`, }, - { - attrNames: ['[pseudoFocus]'], - newAttrName: '[tuiAppearanceState]', - withTagNames: hasPseudo, - valueReplacer: (condition) => `${condition} ? 'focus' : null`, - }, { attrNames: ['[pseudoHover]'], newAttrName: '[tuiAppearanceState]', withTagNames: hasPseudo, valueReplacer: (condition) => `${condition} ? 'hover' : null`, }, - { - attrNames: ['[pseudoInvalid]'], - newAttrName: '[tuiAppearanceState]', - withTagNames: hasPseudo, - valueReplacer: (condition) => `${condition} ? 'invalid' : null`, - }, { attrNames: ['[pseudoDisabled]'], newAttrName: '[tuiAppearanceState]', diff --git a/projects/cdk/schematics/ng-update/v4/steps/constants/attrs-to-replace.ts b/projects/cdk/schematics/ng-update/v4/steps/constants/attrs-to-replace.ts index 37a0193d970a..161d7a433052 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/constants/attrs-to-replace.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/constants/attrs-to-replace.ts @@ -287,4 +287,13 @@ export const ATTRS_TO_REPLACE: ReplacementAttribute[] = [ }, to: {attrName: '[appearance]'}, }, + { + from: { + attrName: '[pseudoFocus]', + withTagNames: ['*'], + }, + to: { + attrName: '[tuiAppearanceFocus]', + }, + }, ]; diff --git a/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-blocked.spec.ts b/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-blocked.spec.ts index 6017012dacc6..248ad20ea098 100644 --- a/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-blocked.spec.ts +++ b/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-blocked.spec.ts @@ -87,7 +87,7 @@ const TEMPLATE_BEFORE = ` `.trim(); const TEMPLATE_AFTER = ` - +