Skip to content

Commit

Permalink
chore(schematics): valid migration for anchor (#10128)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Jan 13, 2025
1 parent 32e78bf commit c2f40e9
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,11 @@ export const HTML_COMMENTS: HtmlComment[] = [
comment:
'tuiFormatNumber pipe API has been changed. Learn how to migrate decimalLimit, decimal, zeroPadding: https://github.com/taiga-family/taiga-ui/issues/8335#migration',
},
{
tag: 'a',
pattern: /\|\s?(tuiIconButton|tuiButton)\s?:/g,
withAttrs: ['disabled'],
comment:
'A link cannot have a "disabled" attribute. If you want a disabled appearance, use the tuiAppearanceState directive. See https://taiga-ui.dev/directives/appearance/API?tuiAppearanceState=disabled',
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@ export const INPUTS_TO_REMOVE: RemovableInput[] = [
tags: ['button', 'a'],
filterFn: (el) => hasElementAttribute(el, 'tuiLink'),
},
{
inputName: 'disabled',
tags: ['a'],
filterFn: (el) =>
hasElementAttribute(el, 'tuiIconButton') ||
hasElementAttribute(el, 'tuiButton'),
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,20 @@ const TEMPLATE_BEFORE = `
[showLoader]="true"
href="https://taiga-ui.dev"
></a>
<button
tuiIconButton
type="button"
[icon]="icon"
[disabled]="true"
></button>
<a
tuiIconButton
[icon]="icon"
[disabled]="true"
href="https://taiga-ui.dev"
></a>
`;

const TEMPLATE_AFTER = `
Expand Down Expand Up @@ -115,6 +129,21 @@ const TEMPLATE_AFTER = `
[loading]="true"
href="https://taiga-ui.dev"
></a>
<button
tuiIconButton
type="button"
[iconStart]="icon"
[disabled]="true"
></button>
<!-- TODO: (Taiga UI migration) A link cannot have a "disabled" attribute. If you want a disabled appearance, use the tuiAppearanceState directive. See https://taiga-ui.dev/directives/appearance/API?tuiAppearanceState=disabled -->
<a
tuiIconButton
[iconStart]="icon"
${''}
href="https://taiga-ui.dev"
></a>
`;

const INLINE_TEMPLATE_COMPONENT_BEFORE = `
Expand Down

0 comments on commit c2f40e9

Please sign in to comment.