-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update combobox with latest fundamental-styles (#2188)
* update combobox to 0.6.0 * add two column example source * two column combobox * groupBy progress - selecting item in 2nd group does not work * fix selecting item in other group * update list messages * template cleanup * demonstrate groupFunction * fix tests * fix tests again and rename menu keydown to list keydown * fix build * force build * address pr comments * pr comments * accidentally committed hunk * separate lifecycle logic in to own methods * more pr comments. open/close behavior will be addressed in a new branch * more combobox improvements
- Loading branch information
1 parent
430e09c
commit 6a987a1
Showing
19 changed files
with
347 additions
and
133 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
12 changes: 12 additions & 0 deletions
12
...ocs/src/app/core/component-docs/combobox/examples/combobox-columns-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,12 @@ | ||
<fd-combobox [(ngModel)]="searchTerm" | ||
[dropdownValues]="dropdownValues" | ||
[itemTemplate]="columnTemplate" | ||
[placeholder]="'Type some text...'" | ||
[maxHeight]="'250px'" | ||
[displayFn]="displayFunc"> | ||
</fd-combobox> | ||
|
||
<ng-template #columnTemplate let-item> | ||
<span fd-list-title>{{item.name}}</span> | ||
<span fd-list-secondary>{{item.price}}</span> | ||
</ng-template> |
25 changes: 25 additions & 0 deletions
25
.../docs/src/app/core/component-docs/combobox/examples/combobox-columns-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,25 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'fd-combobox-columns-example', | ||
templateUrl: './combobox-columns-example.component.html' | ||
}) | ||
export class ComboboxColumnsExampleComponent { | ||
|
||
searchTerm = ''; | ||
|
||
dropdownValues = [ | ||
{name: 'Apple', price: '1.00 USD'}, | ||
{name: 'Banana', price: '0.50 USD'}, | ||
{name: 'Kiwi', price: '1.00 USD'}, | ||
{name: 'Pineapple', price: '3.00 USD'}, | ||
{name: 'Strawberries', price: '4.00 USD'} | ||
]; | ||
|
||
displayFunc(obj: {name: string, price: string}): string { | ||
if (obj) { | ||
return obj.name + ' - ' + obj.price; | ||
} | ||
} | ||
|
||
} |
10 changes: 0 additions & 10 deletions
10
...cs/src/app/core/component-docs/combobox/examples/combobox-disabled-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
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
7 changes: 7 additions & 0 deletions
7
.../docs/src/app/core/component-docs/combobox/examples/combobox-group-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,7 @@ | ||
<fd-combobox [(ngModel)]="searchTerm" | ||
[dropdownValues]="dropdownValues" | ||
[groupFn]="groupFunc" | ||
[displayFn]="displayFunc" | ||
[placeholder]="'Type some text...'" | ||
[maxHeight]="'250px'"> | ||
</fd-combobox> |
35 changes: 35 additions & 0 deletions
35
apps/docs/src/app/core/component-docs/combobox/examples/combobox-group-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,35 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'fd-combobox-group-example', | ||
templateUrl: './combobox-group-example.component.html' | ||
}) | ||
export class ComboboxGroupExampleComponent { | ||
|
||
searchTerm = ''; | ||
|
||
dropdownValues = [ | ||
{name: 'Apple', type: 'Fruits'}, | ||
{name: 'Banana', type: 'Fruits'}, | ||
{name: 'Pineapple', type: 'Fruits'}, | ||
{name: 'Strawberry', type: 'Fruits'}, | ||
{name: 'Broccoli', type: 'Vegetables'}, | ||
{name: 'Carrot', type: 'Vegetables'}, | ||
{name: 'Jalapeño', type: 'Vegetables'}, | ||
{name: 'Spinach', type: 'Vegetables'} | ||
]; | ||
|
||
displayFunc(obj: {name: string, price: string}): string | void { | ||
if (obj) { | ||
return obj.name; | ||
} | ||
} | ||
|
||
groupFunc(items: {name: string, type: string}[]): {} { | ||
return { | ||
Fruits: items.filter(item => item.type === 'Fruits'), | ||
Vegetables: items.filter(item => item.type === 'Vegetables') | ||
} | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...app/core/component-docs/combobox/examples/combobox-search-function-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
Oops, something went wrong.