-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(drop-down): add drop-down related components style samples #1276
- Loading branch information
Showing
19 changed files
with
412 additions
and
1 deletion.
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
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
13 changes: 13 additions & 0 deletions
13
src/app/data-entries/dropdown/dropdown-styling/dropdown-styling.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,13 @@ | ||
<div class='control-wrapper'> | ||
<button #button class="drop-down" igxButton="raised" [igxToggleAction]="dropDown" [overlaySettings]="{outlet: elem}" | ||
[igxDropDownItemNavigation]="dropDown">{{ hero }}</button> | ||
<igx-drop-down #dropDown class="drop-down" (onSelection)="handleDropDownSelection($event)"> | ||
<div class="drop-down__scroll-container"> | ||
<igx-drop-down-item-group *ngFor="let classGroup of heroClasses" [label]="classGroup['name']"> | ||
<igx-drop-down-item *ngFor="let class of classGroup['entries']" [value]='class.name'> | ||
{{ class.name }} | ||
</igx-drop-down-item> | ||
</igx-drop-down-item-group> | ||
</div> | ||
</igx-drop-down> | ||
</div> |
60 changes: 60 additions & 0 deletions
60
src/app/data-entries/dropdown/dropdown-styling/dropdown-styling.component.scss
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,60 @@ | ||
// Browser samples related styling | ||
.control-wrapper { | ||
margin:10px; | ||
} | ||
|
||
.drop-down { | ||
width:180px; | ||
} | ||
|
||
.drop-down__scroll-container { | ||
max-height: 280px; | ||
} | ||
|
||
// Using Ignite UI for Angular Theming engine related styling | ||
// Import the IgniteUI themes library first | ||
@import '~igniteui-angular/lib/core/styles/themes/index'; | ||
$my-primary-color:#FFC314; | ||
$my-secondary-color: #7344df; | ||
$my-info-color: #ffffff; | ||
|
||
$my-color-palette: igx-palette( | ||
$primary: $my-primary-color, | ||
$secondary: $my-secondary-color, | ||
$info: $my-info-color | ||
); | ||
|
||
$custom-drop-down-theme: igx-drop-down-theme( | ||
$background-color: igx-color($my-color-palette, "secondary", 100), | ||
$header-text-color: igx-color($my-color-palette, "secondary", 600), | ||
$item-text-color: igx-color($my-info-color, "info"), | ||
$selected-item-background: igx-color($my-color-palette, "secondary", 400), | ||
$selected-item-text-color: igx-color($my-color-palette, "info"), | ||
$selected-hover-item-background: igx-color($my-color-palette, "secondary", 400), | ||
$selected-hover-item-text-color: igx-color($my-color-palette, "info"), | ||
$selected-focus-item-background: igx-color($my-color-palette, "secondary", 400), | ||
$selected-focus-item-text-color: igx-color($my-color-palette, "info"), | ||
$focused-item-background: igx-color($my-color-palette, "secondary", 300), | ||
$focused-item-text-color: igx-color($my-color-palette, "info"), | ||
$hover-item-background: igx-color($my-color-palette, "info"), | ||
$hover-item-text-color: igx-color($my-color-palette, "secondary", 600) | ||
); | ||
|
||
$custom-button-theme: igx-button-theme( | ||
$palette: $my-color-palette | ||
); | ||
|
||
:host { | ||
::ng-deep { | ||
@include igx-drop-down($custom-drop-down-theme); | ||
@include igx-button($custom-button-theme); | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
|
25 changes: 25 additions & 0 deletions
25
src/app/data-entries/dropdown/dropdown-styling/dropdown-styling.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, ElementRef, OnInit, ViewChild } from "@angular/core"; | ||
import { ISelectionEventArgs } from "igniteui-angular"; | ||
import { getHeroClassData, IHeroClass } from "../../../data/heroData"; | ||
|
||
@Component({ | ||
selector: "app-dropdown-styling", | ||
styleUrls: ["./dropdown-styling.component.scss"], | ||
templateUrl: "./dropdown-styling.component.html" | ||
}) | ||
export class DropDownStylingComponent implements OnInit { | ||
@ViewChild("button", { static: true }) public button: ElementRef; | ||
public heroClasses: IHeroClass[] = []; | ||
public hero = "Choose your hero"; | ||
|
||
constructor(public elem: ElementRef) { | ||
} | ||
|
||
public ngOnInit() { | ||
this.heroClasses = getHeroClassData(); | ||
} | ||
|
||
public handleDropDownSelection(event: ISelectionEventArgs) { | ||
this.hero = event.newSelection.value; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/app/data-entries/select/select-styling/select-styling.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 @@ | ||
<div class='select-wrapper'> | ||
<igx-select #select placeholder="Pick Up Your Armor" [overlaySettings]="{outlet: elem}"> | ||
<igx-select-item-group *ngFor="let armorGroup of armorData" [label]="armorGroup['type']"> | ||
<igx-select-item *ngFor="let armor of armorGroup['armor']" [value]="armor"> {{ armor }}</igx-select-item> | ||
</igx-select-item-group> | ||
</igx-select> | ||
</div> |
47 changes: 47 additions & 0 deletions
47
src/app/data-entries/select/select-styling/select-styling.component.scss
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 @@ | ||
// Browser sample related styling | ||
.select-wrapper { | ||
display: flex; | ||
padding-top: 160px; | ||
padding-left: 40px; | ||
} | ||
|
||
//Ignite UI for Angular Theming engine related styling | ||
// in component.scss | ||
@import '~igniteui-angular/lib/core/styles/themes/index'; | ||
$my-primary-color:#FFC314; | ||
$my-secondary-color: #7344df; | ||
$my-info-color: #ffffff; | ||
|
||
$my-color-palette: igx-palette( | ||
$primary: $my-primary-color, | ||
$secondary: $my-secondary-color, | ||
$info: $my-info-color | ||
); | ||
|
||
$custom-select-theme: igx-drop-down-theme( | ||
$background-color: igx-color($my-color-palette, "secondary", 100), | ||
$header-text-color: igx-color($my-color-palette, "secondary", 600), | ||
$item-text-color: igx-color($my-info-color, "info"), | ||
$selected-item-background: igx-color($my-color-palette, "secondary", 400), | ||
$selected-item-text-color: igx-color($my-color-palette, "info"), | ||
$selected-hover-item-background: igx-color($my-color-palette, "secondary", 400), | ||
$selected-hover-item-text-color: igx-color($my-color-palette, "info"), | ||
$selected-focus-item-background: igx-color($my-color-palette, "secondary", 400), | ||
$selected-focus-item-text-color: igx-color($my-color-palette, "info"), | ||
$focused-item-background: igx-color($my-color-palette, "secondary", 300), | ||
$focused-item-text-color: igx-color($my-color-palette, "info"), | ||
$hover-item-background: igx-color($my-color-palette, "info"), | ||
$hover-item-text-color: igx-color($my-color-palette, "secondary", 600) | ||
); | ||
|
||
// Pass our custom-select-theme to the `igx-drop-down` mixin | ||
@include igx-drop-down($custom-select-theme); | ||
|
||
:host { | ||
::ng-deep { | ||
@include igx-drop-down($custom-select-theme); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/app/data-entries/select/select-styling/select-styling.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,19 @@ | ||
import { Component, ElementRef, OnInit } from "@angular/core"; | ||
import { getHeroArmorsData, IHeroArmor } from "../../../data/heroData"; | ||
|
||
@Component({ | ||
selector: "select-styling", | ||
styleUrls: ["select-styling.component.scss"], | ||
templateUrl: "select-styling.component.html" | ||
}) | ||
|
||
export class SelectStylingComponent implements OnInit { | ||
public armorData: IHeroArmor[] = []; | ||
public armor; | ||
|
||
constructor(public elem: ElementRef) { | ||
} | ||
public ngOnInit() { | ||
this.armorData = getHeroArmorsData(); | ||
} | ||
} |
Oops, something went wrong.