-
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.
chore(demo): add example with form fieldset (#9368)
- Loading branch information
Showing
4 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
projects/demo/src/modules/components/textfield/examples/6/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,36 @@ | ||
<fieldset [disabled]="disable()"> | ||
<legend>Payment fieldset</legend> | ||
|
||
<tui-textfield | ||
iconStart="@tui.credit-card" | ||
tuiTextfieldSize="s" | ||
> | ||
<label tuiLabel>Card number</label> | ||
<input | ||
tuiTextfield | ||
[(ngModel)]="card" | ||
/> | ||
</tui-textfield> | ||
|
||
<tui-textfield | ||
iconStart="@tui.user" | ||
tuiTextfieldSize="s" | ||
> | ||
<label tuiLabel>Card holder</label> | ||
<input | ||
tuiTextfield | ||
[(ngModel)]="name" | ||
/> | ||
</tui-textfield> | ||
</fieldset> | ||
|
||
<label class="t-label"> | ||
<input | ||
size="s" | ||
tuiSwitch | ||
type="checkbox" | ||
[ngModel]="disable()" | ||
(ngModelChange)="disable.set($event)" | ||
/> | ||
Disable | ||
</label> |
14 changes: 14 additions & 0 deletions
14
projects/demo/src/modules/components/textfield/examples/6/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,14 @@ | ||
fieldset { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
} | ||
|
||
.t-label { | ||
display: flex; | ||
align-items: center; | ||
gap: 0.5rem; | ||
margin-top: 0.25rem; | ||
inline-size: fit-content; | ||
cursor: pointer; | ||
} |
20 changes: 20 additions & 0 deletions
20
projects/demo/src/modules/components/textfield/examples/6/index.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,20 @@ | ||
import {Component, signal} from '@angular/core'; | ||
import {FormsModule} from '@angular/forms'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {encapsulation} from '@demo/emulate/encapsulation'; | ||
import {TuiTextfield} from '@taiga-ui/core'; | ||
import {TuiSwitch} from '@taiga-ui/kit'; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [FormsModule, TuiSwitch, TuiTextfield], | ||
templateUrl: './index.html', | ||
styleUrls: ['./index.less'], | ||
encapsulation, | ||
changeDetection, | ||
}) | ||
export default class Example { | ||
protected readonly disable = signal(true); | ||
protected card = '1111 1111 1111 1111'; | ||
protected name = 'Test User'; | ||
} |
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