Fixes width of autocomplete panel.
This commit is contained in:
parent
dc7f05ffd2
commit
d89beeaf0f
|
@ -7,7 +7,7 @@
|
||||||
<input matInput #textInput autocomplete="off" (focus)="_onInputFocus()" [disabled]="disabled" [placeholder]="placeholder" [ngModel]="_inputValue" (ngModelChange)="_inputValueChange($event)" [matAutocomplete]="auto" [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes" [matChipInputAddOnBlur]="addOnBlur" (matChipInputTokenEnd)="_addItem($event)" (click)="_onInputClick($event)" />
|
<input matInput #textInput autocomplete="off" (focus)="_onInputFocus()" [disabled]="disabled" [placeholder]="placeholder" [ngModel]="_inputValue" (ngModelChange)="_inputValueChange($event)" [matAutocomplete]="auto" [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes" [matChipInputAddOnBlur]="addOnBlur" (matChipInputTokenEnd)="_addItem($event)" (click)="_onInputClick($event)" />
|
||||||
</mat-chip-list>
|
</mat-chip-list>
|
||||||
<mat-progress-spinner mode="indeterminate" class="multi-loading-bar col-auto" [class.not-loading]="!loading" [diameter]="22"></mat-progress-spinner>
|
<mat-progress-spinner mode="indeterminate" class="multi-loading-bar col-auto" [class.not-loading]="!loading" [diameter]="22"></mat-progress-spinner>
|
||||||
<mat-autocomplete [panelWidth]="auto" #auto="matAutocomplete" [displayWith]="_displayFn.bind(this)" (optionSelected)="_optionSelected($event)">
|
<mat-autocomplete [panelWidth]="auto" class="panel-width" #auto="matAutocomplete" [displayWith]="_displayFn.bind(this)" (optionSelected)="_optionSelected($event)">
|
||||||
<span *ngIf="_groupedItems">
|
<span *ngIf="_groupedItems">
|
||||||
<mat-optgroup *ngFor="let group of _groupedItems | async" [label]="group.title">
|
<mat-optgroup *ngFor="let group of _groupedItems | async" [label]="group.title">
|
||||||
<mat-option *ngFor="let item of group.items" [value]="item" [class.two-line-mat-option]="_subtitleFn(item)">
|
<mat-option *ngFor="let item of group.items" [value]="item" [class.two-line-mat-option]="_subtitleFn(item)">
|
||||||
|
|
|
@ -1,28 +1,32 @@
|
||||||
.multiple-auto-complete {
|
.multiple-auto-complete {
|
||||||
margin-left: inherit;
|
margin-left: inherit;
|
||||||
margin-right: inherit;
|
margin-right: inherit;
|
||||||
|
|
||||||
.multi-chip-list {
|
.multi-chip-list {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
|
|
||||||
.chip {
|
.chip {
|
||||||
border-radius: 2em !important;
|
border-radius: 2em !important;
|
||||||
height: auto !important;
|
height: auto !important;
|
||||||
min-width: fit-content !important;
|
min-width: fit-content !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.multi-loading-bar {
|
.multi-loading-bar {
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.not-loading {
|
.not-loading {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.two-line-mat-option {
|
.two-line-mat-option {
|
||||||
height: 3.5em;
|
height: 3.5em;
|
||||||
line-height: 1.2em;
|
line-height: 1.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
::ng-deep .mat-autocomplete-panel.panel-width {
|
||||||
|
max-width: 78vw !important;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
</mat-chip-list>
|
</mat-chip-list>
|
||||||
|
|
||||||
<mat-progress-spinner class="progress-loader" mode="indeterminate" [class.not-loading]="!loading" [diameter]="17"></mat-progress-spinner>
|
<mat-progress-spinner class="progress-loader" mode="indeterminate" [class.not-loading]="!loading" [diameter]="17"></mat-progress-spinner>
|
||||||
<mat-autocomplete #auto="matAutocomplete" [displayWith]="autoCompleteDisplayFn()" (optionSelected)="_optionSelected($event)">
|
<mat-autocomplete [panelWidth]="auto" class="panel-width" #auto="matAutocomplete" [displayWith]="autoCompleteDisplayFn()" (optionSelected)="_optionSelected($event)">
|
||||||
<span *ngIf="_groupedItems">
|
<span *ngIf="_groupedItems">
|
||||||
<mat-optgroup *ngFor="let group of _groupedItems | async" [label]="group.title">
|
<mat-optgroup *ngFor="let group of _groupedItems | async" [label]="group.title">
|
||||||
<mat-option *ngFor="let item of group.items" [value]="item" [class.two-line-mat-option]="_subtitleFn(item)">
|
<mat-option *ngFor="let item of group.items" [value]="item" [class.two-line-mat-option]="_subtitleFn(item)">
|
||||||
|
|
|
@ -1,22 +1,26 @@
|
||||||
.auto-complete {
|
.auto-complete {
|
||||||
margin-left: inherit;
|
margin-left: inherit;
|
||||||
margin-right: inherit;
|
margin-right: inherit;
|
||||||
|
|
||||||
.not-loading {
|
.not-loading {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chip-list {
|
.chip-list {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.progress-loader {
|
.progress-loader {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.two-line-mat-option {
|
.two-line-mat-option {
|
||||||
height: 3.5em;
|
height: 3.5em;
|
||||||
line-height: 1.2em;
|
line-height: 1.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
::ng-deep .mat-autocomplete-panel.panel-width {
|
||||||
|
max-width: 78vw !important;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue