-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(optgroup): added optgroup in select and list (#UIM-318)
- Loading branch information
lkramarov
committed
Dec 17, 2019
1 parent
eca1775
commit 71bcf34
Showing
22 changed files
with
166 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ module.exports = { | |
'list', | ||
'modal', | ||
'navbar', | ||
'optgroup', | ||
'panel', | ||
'popover', | ||
'progress-bar', | ||
|
1 change: 1 addition & 0 deletions
1
packages/mosaic-examples/mosaic/list/list-groups/list-groups-example.css
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 @@ | ||
/** No CSS for this example */ |
8 changes: 8 additions & 0 deletions
8
packages/mosaic-examples/mosaic/list/list-groups/list-groups-example.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,8 @@ | ||
<mc-list-selection> | ||
<mc-optgroup *ngFor="let group of pokemonTypes" [label]="group.name" [disabled]="group.disabled"> | ||
<mc-list-option *ngFor="let pokemon of group.pokemon" [value]="pokemon.value"> | ||
{{ pokemon.viewValue }} | ||
</mc-list-option> | ||
</mc-optgroup> | ||
<mc-list-option value="mime-11">Mr. Mime</mc-list-option> | ||
</mc-list-selection> |
47 changes: 47 additions & 0 deletions
47
packages/mosaic-examples/mosaic/list/list-groups/list-groups-example.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,47 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
|
||
/** | ||
* @title Basic list | ||
*/ | ||
@Component({ | ||
selector: 'list-groups-example', | ||
templateUrl: 'list-groups-example.html', | ||
styleUrls: ['list-groups-example.css'] | ||
}) | ||
export class ListGroupsExample { | ||
pokemonTypes = [ | ||
{ | ||
name: 'Grass', | ||
pokemon: [ | ||
{ value: 'bulbasaur-0', viewValue: 'Bulbasaur' }, | ||
{ value: 'oddish-1', viewValue: 'Oddish' }, | ||
{ value: 'bellsprout-2', viewValue: 'Bellsprout' } | ||
] | ||
}, | ||
{ | ||
name: 'Water', | ||
disabled: true, | ||
pokemon: [ | ||
{ value: 'squirtle-3', viewValue: 'Squirtle' }, | ||
{ value: 'psyduck-4', viewValue: 'Psyduck' }, | ||
{ value: 'horsea-5', viewValue: 'Horsea' } | ||
] | ||
}, | ||
{ | ||
name: 'Fire', | ||
pokemon: [ | ||
{ value: 'charmander-6', viewValue: 'Charmander' }, | ||
{ value: 'vulpix-7', viewValue: 'Vulpix' }, | ||
{ value: 'flareon-8', viewValue: 'Flareon' } | ||
] | ||
}, | ||
{ | ||
name: 'Psychic', | ||
pokemon: [ | ||
{ value: 'mew-9', viewValue: 'Mew' }, | ||
{ value: 'mewtwo-10', viewValue: 'Mewtwo' } | ||
] | ||
} | ||
]; | ||
} |
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
1 change: 1 addition & 0 deletions
1
packages/mosaic-examples/mosaic/select/select-groups/select-groups-example.css
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 @@ | ||
/** No CSS for this example */ |
8 changes: 8 additions & 0 deletions
8
packages/mosaic-examples/mosaic/select/select-groups/select-groups-example.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,8 @@ | ||
<mc-form-field> | ||
<mc-select> | ||
<mc-optgroup *ngFor="let group of pokemonTypes" [label]="group.name" [disabled]="group.disabled"> | ||
<mc-option *ngFor="let pokemon of group.pokemon" [value]="pokemon.value">{{ pokemon.viewValue }}</mc-option> | ||
</mc-optgroup> | ||
<mc-option value="mime-11">Mr. Mime</mc-option> | ||
</mc-select> | ||
</mc-form-field> |
47 changes: 47 additions & 0 deletions
47
packages/mosaic-examples/mosaic/select/select-groups/select-groups-example.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,47 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
|
||
/** | ||
* @title Basic Select | ||
*/ | ||
@Component({ | ||
selector: 'select-groups-example', | ||
templateUrl: 'select-groups-example.html', | ||
styleUrls: ['select-groups-example.css'] | ||
}) | ||
export class SelectGroupsExample { | ||
pokemonTypes = [ | ||
{ | ||
name: 'Grass', | ||
pokemon: [ | ||
{ value: 'bulbasaur-0', viewValue: 'Bulbasaur' }, | ||
{ value: 'oddish-1', viewValue: 'Oddish' }, | ||
{ value: 'bellsprout-2', viewValue: 'Bellsprout' } | ||
] | ||
}, | ||
{ | ||
name: 'Water', | ||
disabled: true, | ||
pokemon: [ | ||
{ value: 'squirtle-3', viewValue: 'Squirtle' }, | ||
{ value: 'psyduck-4', viewValue: 'Psyduck' }, | ||
{ value: 'horsea-5', viewValue: 'Horsea' } | ||
] | ||
}, | ||
{ | ||
name: 'Fire', | ||
pokemon: [ | ||
{ value: 'charmander-6', viewValue: 'Charmander' }, | ||
{ value: 'vulpix-7', viewValue: 'Vulpix' }, | ||
{ value: 'flareon-8', viewValue: 'Flareon' } | ||
] | ||
}, | ||
{ | ||
name: 'Psychic', | ||
pokemon: [ | ||
{ value: 'mew-9', viewValue: 'Mew' }, | ||
{ value: 'mewtwo-10', viewValue: 'Mewtwo' } | ||
] | ||
} | ||
]; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<label class="mc-optgroup-label" [id]="labelId">{{ label }}</label> | ||
<ng-content select="mc-option, ng-container"></ng-content> | ||
<ng-content select="mc-option, mc-list-option, ng-container"></ng-content> |
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 |
---|---|---|
|
@@ -2,6 +2,9 @@ | |
|
||
|
||
.mc-optgroup-label { | ||
padding-left: 16px; | ||
|
||
@include user-select(none); | ||
|
||
cursor: default; | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,6 @@ | |
} | ||
} | ||
|
||
.mc-list-option:not([disabled]) { | ||
.mc-list-option:not([disabled]):not(.mc-disabled){ | ||
cursor: pointer; | ||
} |
Oops, something went wrong.