-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(kit):
MultiSelect
fix incorrect height with multiline value con…
…tent (#5618)
- Loading branch information
1 parent
ca941e2
commit 5c41e09
Showing
10 changed files
with
123 additions
and
9 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
41 changes: 41 additions & 0 deletions
41
projects/demo/src/modules/components/multi-select/examples/11/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,41 @@ | ||
<tui-multi-select | ||
[tuiTextfieldLabelOutside]="true" | ||
[valueContent]="valueContent" | ||
[(ngModel)]="value" | ||
> | ||
<tui-data-list-wrapper | ||
*tuiDataList | ||
tuiMultiSelectGroup | ||
[items]="items" | ||
></tui-data-list-wrapper> | ||
</tui-multi-select> | ||
|
||
<tui-multi-select | ||
class="tui-space_top-4" | ||
[valueContent]="content" | ||
[(ngModel)]="value" | ||
> | ||
Select | ||
<tui-data-list-wrapper | ||
*tuiDataList | ||
tuiMultiSelectGroup | ||
[items]="items" | ||
></tui-data-list-wrapper> | ||
</tui-multi-select> | ||
|
||
<ng-template | ||
#valueContent | ||
let-list | ||
> | ||
<div class="t-wrapper"> | ||
<ng-container *ngFor="let item of list"> | ||
<tui-tag | ||
size="l" | ||
class="t-tag" | ||
[removable]="true" | ||
[value]="item" | ||
(edited)="remove(item)" | ||
></tui-tag> | ||
</ng-container> | ||
</div> | ||
</ng-template> |
8 changes: 8 additions & 0 deletions
8
projects/demo/src/modules/components/multi-select/examples/11/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,8 @@ | ||
.t-tag { | ||
margin: 0.125rem 0.5rem 0.125rem -0.25rem; | ||
} | ||
|
||
.t-wrapper { | ||
flex-wrap: wrap; | ||
padding-inline-start: 0.25rem; | ||
} |
33 changes: 33 additions & 0 deletions
33
projects/demo/src/modules/components/multi-select/examples/11/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,33 @@ | ||
import {Component} from '@angular/core'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {encapsulation} from '@demo/emulate/encapsulation'; | ||
import {TuiContextWithImplicit} from '@taiga-ui/cdk'; | ||
import {PolymorpheusContent} from '@tinkoff/ng-polymorpheus'; | ||
|
||
@Component({ | ||
selector: 'tui-multi-select-example-11', | ||
templateUrl: './index.html', | ||
styleUrls: ['./index.less'], | ||
changeDetection, | ||
encapsulation, | ||
}) | ||
export class TuiMultiSelectExample11 { | ||
readonly items = [ | ||
'Luke Skywalker', | ||
'Leia Organa Solo', | ||
'Darth Vader', | ||
'Han Solo', | ||
'Obi-Wan Kenobi', | ||
'Yoda', | ||
]; | ||
|
||
value: string[] = this.items; | ||
|
||
content: PolymorpheusContent<TuiContextWithImplicit<string[]>> = ({ | ||
$implicit: {length}, | ||
}) => `Selected: ${length}`; | ||
|
||
remove(item: string): void { | ||
this.value = this.value.filter(val => val !== item); | ||
} | ||
} |
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
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