File tree 9 files changed +153
-0
lines changed 9 files changed +153
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,11 @@ export class AppComponent implements OnInit {
60
60
icon : "view_carousel" ,
61
61
name : "Carousel"
62
62
} ,
63
+ {
64
+ link : "/combo" ,
65
+ icon : "arrow_drop_down_circle" ,
66
+ name : "Combo"
67
+ } ,
63
68
{
64
69
link : "/datePicker" ,
65
70
icon : "date_range" ,
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import { ButtonGroupSampleModule } from "./buttonGroup/sample.module";
16
16
import { IgxCalendarSampleModule } from "./calendar/sample.module" ;
17
17
import { IgxCardSampleModule } from "./card/sample.module" ;
18
18
import { CarouselSampleModule } from "./carousel/sample.module" ;
19
+ import { ComboSampleModule } from "./combo/sample.module" ;
19
20
import { IgxDatePickerSampleModule } from "./date-picker/sample.module" ;
20
21
import { DialogSampleModule } from "./dialog/sample.module" ;
21
22
import { MaskSampleModule } from "./directives/mask/sample.module" ;
@@ -66,6 +67,7 @@ import { VirtualForSampleModule } from "./virtual-for-directive/sample.module";
66
67
IgxAvatarModule ,
67
68
InputSampleModule ,
68
69
CarouselSampleModule ,
70
+ ComboSampleModule ,
69
71
TabBarSampleModule ,
70
72
TabsSampleModule ,
71
73
ListSampleModule ,
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { ButtonGroupSampleComponent } from "./buttonGroup/sample.component";
8
8
import { IgxCalendarSampleComponent } from "./calendar/sample.component" ;
9
9
import { IgxCardSampleComponent } from "./card/sample.component" ;
10
10
import { CarouselSampleComponent } from "./carousel/sample.component" ;
11
+ import { ComboSampleComponent } from "./combo/sample.component" ;
11
12
import { IgxDatePickerSampleComponent } from "./date-picker/sample.component" ;
12
13
import { DialogSampleComponent } from "./dialog/sample.component" ;
13
14
import { MaskSampleComponent } from "./directives/mask/sample.component" ;
@@ -63,6 +64,10 @@ const appRoutes: Routes = [
63
64
component : CarouselSampleComponent ,
64
65
path : "carousel"
65
66
} ,
67
+ {
68
+ component : ComboSampleComponent ,
69
+ path : "combo"
70
+ } ,
66
71
{
67
72
component : TabBarSampleComponent ,
68
73
path : "tabbar"
Original file line number Diff line number Diff line change
1
+ < div class ="sample-wrapper ">
2
+ < page-header title ="Combo " description ="Combo lets you choose value from a list "> </ page-header >
3
+ < section class ="sample-content ">
4
+ < igx-combo data ="items "> </ igx-combo >
5
+ </ section >
6
+ </ div >
Original file line number Diff line number Diff line change
1
+ import { Component , OnInit , ViewChild } from "@angular/core" ;
2
+ import { IgxComboComponent } from "../../lib/main" ;
3
+ @Component ( {
4
+ // tslint:disable-next-line:component-selector
5
+ selector : "combo-sample" ,
6
+ templateUrl : "./sample.component.html" ,
7
+ styleUrls : [ "sample.component.css" ]
8
+ } )
9
+ export class ComboSampleComponent implements OnInit {
10
+ private width = "160px" ;
11
+ @ViewChild ( IgxComboComponent ) public igxCombo : IgxComboComponent ;
12
+
13
+ items : any [ ] = [ ] ;
14
+
15
+ ngOnInit ( ) {
16
+
17
+ }
18
+
19
+ constructor ( ) {
20
+ const states = [
21
+ "New England" ,
22
+ "Connecticut" ,
23
+ "Maine" ,
24
+ "Massachusetts" ,
25
+ "New Hampshire" ,
26
+ "Rhode Island" ,
27
+ "Vermont" ,
28
+ "Mid-Atlantic" ,
29
+ "New Jersey" ,
30
+ "New York" ,
31
+ "Pennsylvania" ,
32
+ "East North Central" ,
33
+ "Illinois" ,
34
+ "Indiana" ,
35
+ "Michigan" ,
36
+ "Ohio" ,
37
+ "Wisconsin" ,
38
+ "West North Central" ,
39
+ "Iowa" ,
40
+ "Kansas" ,
41
+ "Minnesota" ,
42
+ "Missouri" ,
43
+ "Nebraska" ,
44
+ "North Dakota" ,
45
+ "South Dakota" ,
46
+ "South Atlantic" ,
47
+ "Delaware" ,
48
+ "Florida" ,
49
+ "Georgia" ,
50
+ "Maryland" ,
51
+ "North Carolina" ,
52
+ "South Carolina" ,
53
+ "Virginia" ,
54
+ "District of Columbia" ,
55
+ "West Virginia" ,
56
+ "East South Central" ,
57
+ "Alabama" ,
58
+ "Kentucky" ,
59
+ "Mississippi" ,
60
+ "Tennessee" ,
61
+ "West South Central" ,
62
+ "Arkansas" ,
63
+ "Louisiana" ,
64
+ "Oklahoma" ,
65
+ "Texas" ,
66
+ "Mountain" ,
67
+ "Arizona" ,
68
+ "Colorado" ,
69
+ "Idaho" ,
70
+ "Montana" ,
71
+ "Nevada" ,
72
+ "New Mexico" ,
73
+ "Utah" ,
74
+ "Wyoming" ,
75
+ "Pacific" ,
76
+ "Alaska" ,
77
+ "California" ,
78
+ "Hawaii" ,
79
+ "Oregon" ,
80
+ "Washington" ] ;
81
+
82
+ const areas = [
83
+ "New England" ,
84
+ "Mid-Atlantic" ,
85
+ "East North Central" ,
86
+ "West North Central" ,
87
+ "South Atlantic" ,
88
+ "East South Central" ,
89
+ "West South Central" ,
90
+ "Mountain" ,
91
+ "Pacific"
92
+ ] ;
93
+
94
+ for ( let i = 0 ; i < states . length ; i += 1 ) {
95
+ const item = { field : states [ i ] } ;
96
+ if ( areas . indexOf ( states [ i ] ) !== - 1 ) {
97
+ item [ "header" ] = true ;
98
+ } else if ( i % 7 === 4 || i > 49 ) {
99
+ item [ "disabled" ] = true ;
100
+ }
101
+ this . items . push ( item ) ;
102
+ }
103
+ }
104
+
105
+ onSelection ( ev ) {
106
+ }
107
+ }
Original file line number Diff line number Diff line change
1
+ import { CommonModule } from "@angular/common" ;
2
+ import { NgModule } from "@angular/core" ;
3
+
4
+ import { IgxComboModule } from "../../lib/main" ;
5
+ import { PageHeaderModule } from "../pageHeading/pageHeading.module" ;
6
+ import { ComboSampleComponent } from "./sample.component" ;
7
+
8
+ @NgModule ( {
9
+ declarations : [ ComboSampleComponent ] ,
10
+ imports : [ CommonModule , PageHeaderModule , IgxComboModule ]
11
+ } )
12
+ export class ComboSampleModule { }
Original file line number Diff line number Diff line change
1
+ import { async , ComponentFixture , TestBed } from "@angular/core/testing" ;
2
+ import { IgxComboComponent , IgxComboModule } from "./combo.component" ;
3
+
4
+ describe ( "Combo" , ( ) => {
5
+ beforeEach ( async ( ( ) => {
6
+ TestBed . configureTestingModule ( {
7
+ declarations : [ /*BasicComboComponent*/ ] ,
8
+ imports : [ IgxComboModule ]
9
+ } ) . compileComponents ( ) ;
10
+ } ) ) ;
11
+
12
+ it ( "Initialize combo" , ( ) => {
13
+
14
+ } ) ;
15
+ } ) ;
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export * from "./calendar";
26
26
export * from "./card/card.component" ;
27
27
export * from "./carousel/carousel.component" ;
28
28
export * from "./checkbox/checkbox.component" ;
29
+ export * from "./combo/combo.component" ;
29
30
export * from "./date-picker/date-picker.component" ;
30
31
export * from "./dialog/dialog.component" ;
31
32
export * from "./input-group/input-group.component" ;
You can’t perform that action at this time.
0 commit comments