Skip to content

Commit

Permalink
chore: fix pseudo- migration (#8401)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirpotekhin authored Aug 7, 2024
1 parent 73da5db commit 92c0ce6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,49 +35,29 @@ export const ATTR_WITH_VALUES_TO_REPLACE: ReplacementAttributeValue[] = [
newAttrName: '[tuiAppearanceState]',
withTagNames: hasPseudo,
valueReplacer: (condition) => `${condition} ? 'active' : null`,
directiveModule: {
name: 'TuiAppearance',
moduleSpecifier: '@taiga-ui/core',
},
},
{
attrNames: ['[pseudoFocus]'],
newAttrName: '[tuiAppearanceState]',
withTagNames: hasPseudo,
valueReplacer: (condition) => `${condition} ? 'focus' : null`,
directiveModule: {
name: 'TuiAppearance',
moduleSpecifier: '@taiga-ui/core',
},
},
{
attrNames: ['[pseudoHover]'],
newAttrName: '[tuiAppearanceState]',
withTagNames: hasPseudo,
valueReplacer: (condition) => `${condition} ? 'hover' : null`,
directiveModule: {
name: 'TuiAppearance',
moduleSpecifier: '@taiga-ui/core',
},
},
{
attrNames: ['[pseudoInvalid]'],
newAttrName: '[tuiAppearanceState]',
withTagNames: hasPseudo,
valueReplacer: (condition) => `${condition} ? 'invalid' : null`,
directiveModule: {
name: 'TuiAppearance',
moduleSpecifier: '@taiga-ui/core',
},
},
{
attrNames: ['[pseudoDisabled]'],
newAttrName: '[tuiAppearanceState]',
withTagNames: ['tui-radio-block', 'tui-radio-labeled', 'tui-radio'],
valueReplacer: (condition) => `${condition} ? 'disabled' : null`,
directiveModule: {
name: 'TuiAppearance',
moduleSpecifier: '@taiga-ui/core',
},
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ import { TuiCheckboxBlockModule, TuiRadioBlockModule } from "@taiga-ui/kit";
})
export class Test {}`;

const COMPONENT_AFTER = `import { TuiAppearance } from "@taiga-ui/core";
const COMPONENT_AFTER = `
import {FormsModule} from '@angular/forms';
import { TuiBlock, TuiCheckbox, TuiRadio } from "@taiga-ui/kit";
@Component({
standalone: true,
templateUrl: './test.template.html',
imports: [FormsModule, TuiBlock, TuiCheckbox, TuiBlock, TuiRadio, TuiAppearance]
imports: [FormsModule, TuiBlock, TuiCheckbox, TuiBlock, TuiRadio]
})
export class Test {}`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ export class Test {
}`;

const COMPONENT_AFTER = `import { TuiButtonLoading } from "@taiga-ui/kit";
import { TuiButton, tuiButtonOptionsProvider, TuiAppearance } from "@taiga-ui/core";
import { TuiButton, tuiButtonOptionsProvider } from "@taiga-ui/core";
@Component({
standalone: true,
templateUrl: './test.template.html',
imports: [TuiButton, TuiButtonLoading, TuiAppearance],
imports: [TuiButton, TuiButtonLoading],
providers: [
tuiButtonOptionsProvider({size: 's'}),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ export class Test {
}`;

const COMPONENT_AFTER = `import { TuiCheckbox, TuiRadio } from "@taiga-ui/kit";
import { TuiLabel, TuiAppearance } from "@taiga-ui/core";
import { TuiLabel } from "@taiga-ui/core";
@Component({
standalone: true,
templateUrl: './test.template.html',
imports: [TuiLabel, TuiAppearance, TuiCheckbox, TuiRadio]
imports: [TuiLabel, TuiCheckbox, TuiRadio]
})
export class Test {
}`;
Expand Down

0 comments on commit 92c0ce6

Please sign in to comment.