Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(platform): multi-combobox, fix selection in mobile mode (#7483)
* fix(platform): multi-combobox, fix selection in mobile mode * fix(platform): multi-combobox, add states support * fix(platform): minor fixes of selection and unit tests * fix(platform): fix conflicts * fix(platform): fix failed e2e test * fix(platform): fix e2e Co-authored-by: Evgeny Beregovoy <evgeny.beregovoy@valor-software.com>
- Loading branch information
Showing
11 changed files
with
416 additions
and
207 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
68 changes: 68 additions & 0 deletions
68
...ulti-combobox/examples/multi-combobox-states/multi-combobox-states-example.component.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,68 @@ | ||
<fdp-form-group [noLabelLayout]="false" mainTitle="Playground" columnLayout="XL2-L2-M1-S1"> | ||
<fdp-form-field id="multi-combobox-states" label="Select state" column="1"> | ||
<fdp-combobox | ||
name="multi-combobox-states" | ||
placeholder="Select state" | ||
[dataSource]="states" | ||
[value]="selectedState" | ||
(selectionChange)="onSelectState($event)" | ||
></fdp-combobox> | ||
</fdp-form-field> | ||
<fdp-form-field id="multi-combobox-state-1" label="Selected state" column="2"> | ||
<fdp-multi-combobox | ||
name="multi-combobox-state-1" | ||
placeholder="Type some text..." | ||
displayKey="name" | ||
[state]="selectedState?.toLowerCase()" | ||
[stateMessage]="selectedState + ' state message'" | ||
[dataSource]="dataSource" | ||
> | ||
</fdp-multi-combobox> | ||
</fdp-form-field> | ||
</fdp-form-group> | ||
|
||
<fdp-form-group mainTitle="States" columnLayout="XL2-L2-M1-S1"> | ||
<fdp-form-field id="multi-combobox-state-success" label="Success state" column="1"> | ||
<fdp-multi-combobox | ||
name="multi-combobox-state-success" | ||
placeholder="Type some text..." | ||
state="success" | ||
stateMessage="Success state message" | ||
displayKey="name" | ||
[dataSource]="dataSource" | ||
></fdp-multi-combobox> | ||
</fdp-form-field> | ||
|
||
<fdp-form-field id="multi-combobox-state-error" label="Error state" column="2"> | ||
<fdp-multi-combobox | ||
name="multi-combobox-error-state" | ||
placeholder="Type some text..." | ||
state="error" | ||
stateMessage="Error state message" | ||
displayKey="name" | ||
[dataSource]="dataSource" | ||
></fdp-multi-combobox> | ||
</fdp-form-field> | ||
|
||
<fdp-form-field id="multi-combobox-state-warning" label="Warning state" column="1"> | ||
<fdp-multi-combobox | ||
name="multi-combobox-warning-state" | ||
placeholder="Type some text..." | ||
state="warning" | ||
stateMessage="Warning state message" | ||
displayKey="name" | ||
[dataSource]="dataSource" | ||
></fdp-multi-combobox> | ||
</fdp-form-field> | ||
|
||
<fdp-form-field id="multi-combobox-state-info" label="Information state" column="2"> | ||
<fdp-multi-combobox | ||
name="multi-combobox-information-state" | ||
placeholder="Type some text..." | ||
state="information" | ||
stateMessage="Information state message" | ||
displayKey="name" | ||
[dataSource]="dataSource" | ||
></fdp-multi-combobox> | ||
</fdp-form-field> | ||
</fdp-form-group> |
38 changes: 38 additions & 0 deletions
38
...-multi-combobox/examples/multi-combobox-states/multi-combobox-states-example.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,38 @@ | ||
import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core'; | ||
import { ComboboxSelectionChangeEvent } from '@fundamental-ngx/platform/form'; | ||
|
||
import { DATA_PROVIDERS } from '@fundamental-ngx/platform/shared'; | ||
|
||
@Component({ | ||
selector: 'fdp-multi-combobox-states-example', | ||
templateUrl: './multi-combobox-states-example.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
encapsulation: ViewEncapsulation.None, | ||
providers: [{ provide: DATA_PROVIDERS, useValue: new Map() }], | ||
styles: [ | ||
` | ||
fdp-form-group .fd-row__form-item > .fd-col:first-child { | ||
margin-bottom: 1rem; | ||
} | ||
` | ||
] | ||
}) | ||
export class MultiComboboxStatesExampleComponent { | ||
dataSource = [ | ||
{ name: 'Apple' }, | ||
{ name: 'Banana' }, | ||
{ name: 'Pineapple' }, | ||
{ name: 'Strawberry' }, | ||
{ name: 'Broccoli' }, | ||
{ name: 'Carrot' }, | ||
{ name: 'Jalapeño' }, | ||
{ name: 'Spinach' } | ||
]; | ||
|
||
states = ['Default', 'Success', 'Error', 'Warning', 'Information']; | ||
selectedState = this.states[0]; | ||
|
||
onSelectState(item: ComboboxSelectionChangeEvent): void { | ||
this.selectedState = item.payload; | ||
} | ||
} |
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
Oops, something went wrong.