Skip to content

Commit

Permalink
feat(drop-down): add drop-down related components style samples #1276
Browse files Browse the repository at this point in the history
  • Loading branch information
IvayloG authored and Lipata committed Jul 18, 2019
1 parent a9a8298 commit 24891b6
Show file tree
Hide file tree
Showing 19 changed files with 412 additions and 1 deletion.
11 changes: 11 additions & 0 deletions live-editing/configs/ComboConfigGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { RemoteService } from "../../src/app/grid/services/remote.service";
import { ComboFeatures } from "../../src/app/lists/combo/combo-features/combo-features.component";
import { ComboMainComponent } from "../../src/app/lists/combo/combo-main/combo-main.component";
import { ComboRemoteComponent } from "../../src/app/lists/combo/combo-remote/combo-remote.component";
import { ComboStyling } from "../../src/app/lists/combo/combo-styling/combo-styling.component";
import { ComboTemplateComponent } from "../../src/app/lists/combo/combo-template/combo-template.component";
import { CascadingCombos } from "./../../src/app/lists/combo/cascading-combos/cascading-combos.component";
import { AppModuleConfig } from "./core/AppModuleConfig";
Expand All @@ -25,6 +26,16 @@ export class ComboConfigGenerator implements IConfigGenerator {
shortenComponentPathBy: "/lists/combo/"
}));

configs.push(new Config({
additionalFiles: ["/src/app/data/heroData.ts"],
appModuleConfig: new AppModuleConfig({
imports: [IgxComboModule, ComboStyling],
ngDeclarations: [ComboStyling],
ngImports: [IgxComboModule]
}),
component: ComboStyling
}));

configs.push(new Config({
additionalFiles: ["/src/app/lists/combo/cascading-combos/local-data.ts"],
appModuleConfig: new AppModuleConfig({
Expand Down
12 changes: 12 additions & 0 deletions live-editing/configs/DropDownConfigGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import { DropDownSample4Component
} from "../../src/app/data-entries/dropdown/dropdown-sample-4/dropdown-sample-4.component";
import { DropDownSample5Component
} from "../../src/app/data-entries/dropdown/dropdown-sample-5/dropdown-sample-5.component";
import { DropDownStylingComponent
} from "../../src/app/data-entries/dropdown/dropdown-styling/dropdown-styling.component";
import { RemoteService } from "../../src/app/grid/services/remote.service";
import { AppModuleConfig } from "./core/AppModuleConfig";
import { Config } from "./core/Config";
Expand Down Expand Up @@ -67,6 +69,16 @@ export class DropDownConfigGenerator implements IConfigGenerator {
shortenComponentPathBy: "/data-entries/dropdown/"
}));

configs.push(new Config({
additionalFiles: ["/src/app/data/heroData.ts"],
component: DropDownStylingComponent,
appModuleConfig: new AppModuleConfig({
imports: [IgxDropDownModule, DropDownStylingComponent, IgxButtonModule, IgxToggleModule],
ngDeclarations: [DropDownStylingComponent],
ngImports: [IgxDropDownModule, IgxButtonModule, IgxToggleModule]
})
}));

configs.push(new Config({
component: DropDownSample4Component,
appModuleConfig: new AppModuleConfig({
Expand Down
12 changes: 12 additions & 0 deletions live-editing/configs/SelectConfigGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { SelectSample1Component } from "../../src/app/data-entries/select/select
import { SelectSample2Component } from "../../src/app/data-entries/select/select-sample-2/select-sample-2.component";
import { SelectSample3Component } from "../../src/app/data-entries/select/select-sample-3/select-sample-3.component";
import { SelectSample4Component } from "../../src/app/data-entries/select/select-sample-4/select-sample-4.component";
import { SelectStylingComponent } from "../../src/app/data-entries/select/select-styling/select-styling.component";

import { AppModuleConfig } from "./core/AppModuleConfig";
import { Config } from "./core/Config";
import { IConfigGenerator } from "./core/IConfigGenerator";
Expand Down Expand Up @@ -51,6 +53,16 @@ export class SelectConfigGenerator implements IConfigGenerator {
shortenComponentPathBy: "/data-entries/select/"
}));

configs.push(new Config({
additionalFiles: ["/src/app/data/heroData.ts"],
appModuleConfig: new AppModuleConfig({
imports: [IgxSelectModule, SelectStylingComponent],
ngDeclarations: [SelectStylingComponent],
ngImports: [IgxSelectModule]
}),
component: SelectStylingComponent
}));

return configs;
}
}
4 changes: 3 additions & 1 deletion src/app/data-entries/data-entries-routes-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const dataEntriesRoutesData = {
"dropdown-sample-2": { displayName: "Dropdown Selection", parentName: "Dropdown" },
"dropdown-sample-3": { displayName: "Dropdown Headers", parentName: "Dropdown" },
"dropdown-sample-5": { displayName: "Dropdown Groups", parentName: "Dropdown" },
"dropdown-styling": { displayName: "Dropdown Styling", parentName: "Dropdown" },
"dropdown-sample-4": { displayName: "Input Dropdown Selection", parentName: "Dropdown" },
"input-group-sample-1": { displayName: "Simple Input Group", parentName: "Input Group" },
"input-group-sample-2": { displayName: "Input Required", parentName: "Input Group" },
Expand All @@ -45,5 +46,6 @@ export const dataEntriesRoutesData = {
"select-sample-1": { displayName: "Simple Select", parentName: "Select" },
"select-sample-2": { displayName: "Select With Groups", parentName: "Select" },
"select-sample-3": { displayName: "Select With Forms", parentName: "Select" },
"select-sample-4": { displayName: "Custom Overlay Settings", parentName: "Select" }
"select-sample-4": { displayName: "Custom Overlay Settings", parentName: "Select" },
"select-styling": { displayName: "Select Styling", parentName: "Select" }
};
12 changes: 12 additions & 0 deletions src/app/data-entries/data-entries-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { DropDownSample2Component } from "./dropdown/dropdown-sample-2/dropdown-
import { DropDownSample3Component } from "./dropdown/dropdown-sample-3/dropdown-sample-3.component";
import { DropDownSample4Component } from "./dropdown/dropdown-sample-4/dropdown-sample-4.component";
import { DropDownSample5Component } from "./dropdown/dropdown-sample-5/dropdown-sample-5.component";
import { DropDownStylingComponent } from "./dropdown/dropdown-styling/dropdown-styling.component";
import { InputGroupSample1Component } from "./input-group/input-group-sample-1/input-group-sample-1.component";
import { InputGroupSample2Component } from "./input-group/input-group-sample-2/input-group-sample-2.component";
import { InputGroupSample3Component } from "./input-group/input-group-sample-3/input-group-sample-3.component";
Expand All @@ -44,6 +45,7 @@ import { SelectSample1Component } from "./select/select-sample-1/select-sample-1
import { SelectSample2Component } from "./select/select-sample-2/select-sample-2.component";
import { SelectSample3Component } from "./select/select-sample-3/select-sample-3.component";
import { SelectSample4Component } from "./select/select-sample-4/select-sample-4.component";
import { SelectStylingComponent } from "./select/select-styling/select-styling.component";
import { SwitchSample1Component } from "./switch/switch-sample-1/switch-sample-1.component";
import { SwitchSample2Component } from "./switch/switch-sample-2/switch-sample-2.component";

Expand Down Expand Up @@ -173,6 +175,11 @@ export const dataEntriesRoutes: Routes = [
data: dataEntriesRoutesData["dropdown-sample-5"],
path: "dropdown-sample-5"
},
{
component: DropDownStylingComponent,
data: dataEntriesRoutesData["dropdown-styling"],
path: "dropdown-styling"
},
{
component: DropDownSample4Component,
data: dataEntriesRoutesData["dropdown-sample-4"],
Expand Down Expand Up @@ -272,6 +279,11 @@ export const dataEntriesRoutes: Routes = [
component: SelectSample4Component,
data: dataEntriesRoutesData["select-sample-4"],
path: "select-sample-4"
},
{
component: SelectStylingComponent,
data: dataEntriesRoutesData["select-styling"],
path: "select-styling"
}
];

Expand Down
4 changes: 4 additions & 0 deletions src/app/data-entries/data-entries.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { DropDownSample2Component } from "./dropdown/dropdown-sample-2/dropdown-
import { DropDownSample3Component } from "./dropdown/dropdown-sample-3/dropdown-sample-3.component";
import { DropDownSample4Component } from "./dropdown/dropdown-sample-4/dropdown-sample-4.component";
import { DropDownSample5Component } from "./dropdown/dropdown-sample-5/dropdown-sample-5.component";
import { DropDownStylingComponent } from "./dropdown/dropdown-styling/dropdown-styling.component";
import { InputGroupSample1Component } from "./input-group/input-group-sample-1/input-group-sample-1.component";
import { InputGroupSample2Component } from "./input-group/input-group-sample-2/input-group-sample-2.component";
import { InputGroupSample3Component } from "./input-group/input-group-sample-3/input-group-sample-3.component";
Expand All @@ -56,6 +57,7 @@ import { SelectSample1Component } from "./select/select-sample-1/select-sample-1
import { SelectSample2Component } from "./select/select-sample-2/select-sample-2.component";
import { SelectSample3Component } from "./select/select-sample-3/select-sample-3.component";
import { SelectSample4Component } from "./select/select-sample-4/select-sample-4.component";
import { SelectStylingComponent } from "./select/select-styling/select-styling.component";
import { SwitchSample1Component } from "./switch/switch-sample-1/switch-sample-1.component";
import { SwitchSample2Component } from "./switch/switch-sample-2/switch-sample-2.component";

Expand Down Expand Up @@ -89,6 +91,7 @@ import { SwitchSample2Component } from "./switch/switch-sample-2/switch-sample-2
DropDownSample3Component,
DropDownSample4Component,
DropDownSample5Component,
DropDownStylingComponent,
InputGroupSample1Component,
InputGroupSample2Component,
InputGroupSample3Component,
Expand All @@ -107,6 +110,7 @@ import { SwitchSample2Component } from "./switch/switch-sample-2/switch-sample-2
SelectSample2Component,
SelectSample3Component,
SelectSample4Component,
SelectStylingComponent,
ButtonGroupSampleComponent,
ButtonsDisplayDensityComponent
],
Expand Down
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>
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);
}
}





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;
}
}
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>
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);
}
}
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();
}
}
Loading

0 comments on commit 24891b6

Please sign in to comment.