Skip to content

Commit 2d30b27

Browse files
authored
Merge branch 'master' into ddimitrov/fix-1189
2 parents ba691ac + ad1171d commit 2d30b27

5 files changed

+26
-45
lines changed

src/app/theming/styles/theme-classes.scss

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88

99

1010
//Set the light themes for the components.
11-
&.default-theme {
11+
&.light-theme {
1212
background: $light-color;
1313
::ng-deep {
14+
.sort-icon.material-icons.igx-icon {
15+
color: white;
16+
}
1417
@include igx-grid($light-grid-theme);
1518
@include igx-snackbar($light-snackbar-theme);
1619
@include igx-input-group($light-input-group-theme);

src/app/theming/theme-chooser/theme-chooser-sample.component.html

+6-11
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,11 @@
2828
<div igxOverlayOutlet>
2929
<div class="grid-options" igxLayout igxLayoutDir="row" igxLayoutWrap="wrap">
3030
<button igxButton="raised" class="addProdBtn" (click)="openDialog()">Add New Product</button>
31-
<button class="drop-down-button" igxButton="raised" (click)="toggleDropDown($event, dropdown)"
32-
[igxDropDownItemNavigation]="dropdown">Themes</button>
33-
<igx-drop-down #dropdown class="theme-chooser">
34-
<igx-drop-down-item class="light-theme-option" (click)="selectTheme(THEME.LIGHT)">
35-
</igx-drop-down-item>
36-
<igx-drop-down-item class="dark-theme-option" (click)="selectTheme(THEME.DARK)">
37-
</igx-drop-down-item>
38-
<igx-drop-down-item class="black-theme-option" (click)="selectTheme(THEME.BLACK)">
39-
</igx-drop-down-item>
40-
</igx-drop-down>
31+
<igx-select type="box">
32+
<label igxLabel>Themes</label>
33+
<igx-select-item *ngFor="let theme of themes" [class]="'theme ' + theme + '-option'" (click)="selectTheme(theme)">
34+
</igx-select-item>
35+
</igx-select>
4136
</div>
4237
<igx-grid [data]="data" [autoGenerate]="false" height="550px" width="100%" [paging]="true" [perPage]="10"
4338
displayDensity="comfortable" #grid1 [allowFiltering]="true">
@@ -67,4 +62,4 @@
6762
<igx-snackbar #snackbar [autoHide]="true" displayTime="2500" actionText="Undo" (onAction)="restoreRow()">
6863
</igx-snackbar>
6964
</div>
70-
</div>
65+
</div>

src/app/theming/theme-chooser/theme-chooser-sample.component.scss

+12-12
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
.addProdBtn {
44
margin-bottom: 5px;
5+
margin-right: 10px;
56
}
67

78
.dialogNewRecord {
@@ -18,12 +19,6 @@
1819
display: flex;
1920
justify-content: flex-end;
2021
padding: 8px 16px;
21-
[igxButton] + [igxButton] {
22-
margin-left: 8px;
23-
}
24-
.drop-down-button {
25-
width: 92.6719px;
26-
}
2722
}
2823

2924
.snackbar_wrapper{
@@ -42,7 +37,7 @@
4237
height: $chooser-size;
4338
border-radius: $chooser-size / 2;
4439
overflow: hidden;
45-
cursor: pointer;
40+
// cursor: pointer;
4641
}
4742

4843

@@ -51,7 +46,6 @@
5146
background-color: $primary;
5247
color: $secondary;
5348
padding-left: 22px;
54-
5549
&::before {
5650
position: relative;
5751
content: $text;
@@ -80,22 +74,28 @@
8074
@include theme-chooser-icon($primary, $secondary)
8175
}
8276
&:hover {
77+
z-index: 999;
8378
box-shadow: 3px 0 2px 3px $secondary;
8479
}
8580
}
8681

87-
.default-theme-option {
88-
width:92.6719px;
82+
.light-theme-option {
8983
@include theme-chooser-item(#f8f8f8, #4169E1,'LIGHT');
9084
}
9185

9286
.dark-theme-option {
93-
width:92.6719px;
9487
@include theme-chooser-item(#282828, #FFA500, 'DARK');
9588
}
9689

9790
.black-theme-option {
98-
width:92.6719px;
9991
@include theme-chooser-item(#000000, #00BFFF, 'BLACK');
10092
}
10193

94+
.theme{
95+
cursor: pointer;
96+
}
97+
98+
igx-select{
99+
width: 120px;
100+
margin-left: 10px;
101+
}

src/app/theming/theme-chooser/theme-chooser-sample.component.ts

+1-19
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export class ThemeChooserSampleComponent implements OnInit {
2929
public THEME: typeof THEME = THEME;
3030
public data: any[] = DATA;
3131
public record;
32+
public themes = [THEME.LIGHT, THEME.DARK, THEME.BLACK];
3233

3334
@HostBinding("class")
3435
public themesClass: THEME = THEME.LIGHT;
@@ -50,18 +51,6 @@ export class ThemeChooserSampleComponent implements OnInit {
5051

5152
private deletedRow;
5253

53-
private _dropdownPositionSettings = {
54-
horizontalStartPoint: HorizontalAlignment.Left,
55-
verticalStartPoint: VerticalAlignment.Bottom
56-
};
57-
58-
private _dropDownOverlaySettings = {
59-
closeOnOutsideClick: true,
60-
modal: false,
61-
positionStrategy: new ConnectedPositioningStrategy(this._dropdownPositionSettings),
62-
scrollStrategy: new CloseScrollStrategy()
63-
};
64-
6554
private _dialogOverlaySettings2 = {
6655
closeOnOutsideClick: true,
6756
modal: true,
@@ -75,12 +64,6 @@ export class ThemeChooserSampleComponent implements OnInit {
7564
this.themesClass = value;
7665
}
7766

78-
public toggleDropDown(eventArgs, selectedDropDown: IgxDropDownComponent) {
79-
const dropDown = selectedDropDown;
80-
this._dropDownOverlaySettings.positionStrategy.settings.target = eventArgs.target;
81-
dropDown.toggle(this._dropDownOverlaySettings);
82-
}
83-
8467
public addRow() {
8568
this.grid1.addRow(this.record);
8669
this.cancel();
@@ -111,7 +94,6 @@ export class ThemeChooserSampleComponent implements OnInit {
11194

11295
public ngOnInit() {
11396
this.datePicker.outlet = this.outlet;
114-
// this.grid1.outletDirective = this.outlet;
11597
this.data = DATA;
11698
this.record = new Record();
11799
}

src/app/theming/theming.module.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { NgModule } from "@angular/core";
33
import { FormsModule } from "@angular/forms";
44
import { IgxButtonGroupModule, IgxButtonModule, IgxCalendarModule, IgxCardModule, IgxDatePickerModule,
55
IgxDialogModule, IgxDropDownModule, IgxGridModule, IgxIconModule, IgxInputGroupModule,
6-
IgxLayoutModule, IgxRippleModule, IgxSnackbarModule, IgxToggleModule } from "igniteui-angular";
6+
IgxLayoutModule, IgxRippleModule, IgxSelectModule, IgxSnackbarModule, IgxToggleModule } from "igniteui-angular";
77
import { DarkThemeSampleComponent } from "./dark-theme-sample/dark-theme-sample.component";
88
import { DefaultThemeSampleComponent } from "./default-theme-sample/default-theme-sample.component";
99
import { DisplayDensityComponent } from "./display-density/display-density.component";
@@ -40,7 +40,8 @@ import { ThemingRoutingModule } from "./theming-routing.module";
4040
IgxLayoutModule,
4141
IgxRippleModule,
4242
IgxSnackbarModule,
43-
IgxToggleModule
43+
IgxToggleModule,
44+
IgxSelectModule
4445
]
4546
})
4647
export class ThemingModule {}

0 commit comments

Comments
 (0)