-
Notifications
You must be signed in to change notification settings - Fork 477
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(kit):
Block
add new component (#6892)
Co-authored-by: taiga-family-bot <[email protected]>
- Loading branch information
1 parent
0979914
commit c5e714d
Showing
82 changed files
with
790 additions
and
1,972 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,10 @@ | |
z-index: 6; | ||
} | ||
|
||
&:has([tuiBlock]:checked) { | ||
z-index: 6; | ||
} | ||
|
||
&._focus-visible { | ||
&._focused, | ||
&._active, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
projects/demo/src/modules/components/block/block.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {Component} from '@angular/core'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
|
||
@Component({ | ||
selector: 'example-tui-block', | ||
templateUrl: './block.template.html', | ||
changeDetection, | ||
}) | ||
export class ExampleTuiBlockComponent { | ||
protected readonly exampleModule = import('./examples/import/import-module.md?raw'); | ||
protected readonly exampleHtml = import('./examples/import/insert-template.md?raw'); | ||
} |
48 changes: 48 additions & 0 deletions
48
projects/demo/src/modules/components/block/block.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import {CommonModule} from '@angular/common'; | ||
import {NgModule} from '@angular/core'; | ||
import {FormsModule, ReactiveFormsModule} from '@angular/forms'; | ||
import {TuiExamplePipe} from '@demo/utils'; | ||
import {tuiGetDocModules} from '@taiga-ui/addon-doc'; | ||
import {TuiGroupDirective, TuiTooltipModule} from '@taiga-ui/core'; | ||
import { | ||
TuiCheckboxModule, | ||
TuiFadeModule, | ||
TuiIconModule, | ||
TuiRadioModule, | ||
TuiTitleModule, | ||
TuiToggleModule, | ||
} from '@taiga-ui/experimental'; | ||
import {TuiAvatarComponent, TuiBlockDirective} from '@taiga-ui/kit'; | ||
|
||
import {ExampleTuiBlockComponent} from './block.component'; | ||
import {TuiBlockExample1} from './examples/1'; | ||
import {TuiBlockExample2} from './examples/2'; | ||
import {TuiBlockExample3} from './examples/3'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
FormsModule, | ||
ReactiveFormsModule, | ||
TuiBlockDirective, | ||
TuiGroupDirective, | ||
TuiAvatarComponent, | ||
TuiTooltipModule, | ||
TuiCheckboxModule, | ||
TuiRadioModule, | ||
TuiFadeModule, | ||
TuiTitleModule, | ||
TuiToggleModule, | ||
TuiIconModule, | ||
TuiExamplePipe, | ||
tuiGetDocModules(ExampleTuiBlockComponent), | ||
], | ||
declarations: [ | ||
TuiBlockExample1, | ||
TuiBlockExample2, | ||
TuiBlockExample3, | ||
ExampleTuiBlockComponent, | ||
], | ||
exports: [ExampleTuiBlockComponent], | ||
}) | ||
export class ExampleTuiBlockModule {} |
58 changes: 58 additions & 0 deletions
58
projects/demo/src/modules/components/block/block.template.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<tui-doc-page | ||
header="Block" | ||
package="KIT" | ||
type="components" | ||
> | ||
<ng-template pageTab> | ||
<p> | ||
<code>Block</code> | ||
is a special presentation of a checkbox/radiobutton which can display actual control or be a control itself | ||
</p> | ||
|
||
<tui-doc-example | ||
id="sizes" | ||
heading="Sizes" | ||
[content]="1 | tuiExample: 'html'" | ||
> | ||
<tui-block-example-1></tui-block-example-1> | ||
</tui-doc-example> | ||
|
||
<tui-doc-example | ||
id="groups" | ||
heading="Groups" | ||
[content]="2 | tuiExample: 'html'" | ||
> | ||
<tui-block-example-2></tui-block-example-2> | ||
</tui-doc-example> | ||
|
||
<tui-doc-example | ||
id="custom" | ||
heading="Custom" | ||
[content]="3 | tuiExample: 'html'" | ||
> | ||
<tui-block-example-3></tui-block-example-3> | ||
</tui-doc-example> | ||
</ng-template> | ||
|
||
<ng-template pageTab="Setup"> | ||
<ol class="b-demo-steps"> | ||
<li> | ||
<p>Add an import:</p> | ||
|
||
<tui-doc-code | ||
filename="my.module.ts" | ||
[code]="exampleModule" | ||
></tui-doc-code> | ||
</li> | ||
|
||
<li> | ||
<p>Add to the template:</p> | ||
|
||
<tui-doc-code | ||
filename="my.component.html" | ||
[code]="exampleHtml" | ||
></tui-doc-code> | ||
</li> | ||
</ol> | ||
</ng-template> | ||
</tui-doc-page> |
37 changes: 37 additions & 0 deletions
37
projects/demo/src/modules/components/block/examples/1/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<form [formGroup]="testForm"> | ||
<label tuiBlock="xs"> | ||
Grapes | ||
<input | ||
formControlName="testValue1" | ||
size="s" | ||
tuiCheckbox | ||
type="checkbox" | ||
/> | ||
</label> | ||
<label tuiBlock="s"> | ||
Qiwi | ||
<input | ||
formControlName="testValue2" | ||
size="s" | ||
tuiCheckbox | ||
type="checkbox" | ||
/> | ||
</label> | ||
<label tuiBlock="m"> | ||
Oranges | ||
<input | ||
formControlName="testValue3" | ||
size="s" | ||
tuiCheckbox | ||
type="checkbox" | ||
/> | ||
</label> | ||
<label tuiBlock> | ||
Watermelons | ||
<input | ||
formControlName="testValue4" | ||
tuiCheckbox | ||
type="checkbox" | ||
/> | ||
</label> | ||
</form> |
6 changes: 6 additions & 0 deletions
6
projects/demo/src/modules/components/block/examples/1/index.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
form { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 1rem; | ||
} |
Oops, something went wrong.