Skip to content

Commit

Permalink
chore: fix block migration (#9996)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirpotekhin authored Dec 23, 2024
1 parent 552d97e commit fb3bf1d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"significand",
"undoubtable",
"Clintock",
"Bonorum"
"Bonorum",
"hidecheckbox",
"hideradio"
],
"ignoreRegExpList": ["\\(https?://.*?\\)", "\\/{1}.+\\/{1}", "\\%2F.+", "\\%2C.+", "\\ɵ.+", "\\ыва.+"],
"overrides": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,29 @@ export const TAGS_TO_REPLACE: ReplacementTag[] = [
to: 'input',
addAttributes: ['tuiRadio', 'type="radio"'],
},
{
from: 'tui-checkbox-block',
to: 'input',
addAttributes: ['tuiCheckbox', 'type="checkbox"', 'tuiBlock'],
filterFn: (el) => el.attrs.some((attr) => attr.name === '[hidecheckbox]'),
},
{
from: 'tui-checkbox-block',
to: 'input',
addAttributes: ['tuiCheckbox', 'type="checkbox"'],
filterFn: (el) => !el.attrs.some((attr) => attr.name === '[hidecheckbox]'),
},
{
from: 'tui-radio-block',
to: 'input',
addAttributes: ['tuiRadio', 'type="radio"', 'tuiBlock'],
filterFn: (el) => el.attrs.some((attr) => attr.name === '[hideradio]'),
},
{
from: 'tui-radio-block',
to: 'input',
addAttributes: ['tuiRadio', 'type="radio"'],
filterFn: (el) => !el.attrs.some((attr) => attr.name === '[hideradio]'),
},
{
from: 'tui-hosted-dropdown',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const TEMPLATE_AFTER = `
</label>
</form>
<label *ngFor="let block of blocks" tuiBlock="m" appearance="">
<input tuiCheckbox type="checkbox"
<input tuiCheckbox type="checkbox" tuiBlock
${''}
${''}
${''}
Expand All @@ -122,15 +122,15 @@ const TEMPLATE_AFTER = `
{{ block.name }}
</label>
<label tuiBlock="s" appearance="">
<input tuiCheckbox type="checkbox"
<input tuiCheckbox type="checkbox" tuiBlock
formControlName="testValue3"
${''}
${''}
>
Pineapples
</label>
<label tuiBlock="l" appearance="">
<input tuiRadio type="radio"
<input tuiRadio type="radio" tuiBlock
formControlName="testValue"
${''}
${''}
Expand Down

0 comments on commit fb3bf1d

Please sign in to comment.