Skip to content

Commit

Permalink
chore: fix appearance migration (#8473)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirpotekhin authored Aug 12, 2024
1 parent b8f9675 commit fa944ee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,4 +287,13 @@ export const ATTRS_TO_REPLACE: ReplacementAttribute[] = [
},
to: {attrName: '[appearance]'},
},
{
from: {
attrName: '[pseudoFocus]',
withTagNames: ['*'],
},
to: {
attrName: '[tuiAppearanceFocus]',
},
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const TEMPLATE_BEFORE = `
`.trim();

const TEMPLATE_AFTER = `
<label tuiBlock><input tuiCheckbox type="checkbox" [(ngModel)]="value" [tuiAppearanceState]="pseudoFocus ? 'focus' : null">Content</label>
<label tuiBlock><input tuiCheckbox type="checkbox" [(ngModel)]="value" [tuiAppearanceFocus]="pseudoFocus">Content</label>
<form [formGroup]="testForm">
<label tuiBlock> <input tuiRadio type="radio"
Expand Down

0 comments on commit fa944ee

Please sign in to comment.