File tree Expand file tree Collapse file tree 9 files changed +153
-0
lines changed
Expand file tree Collapse file tree 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 {
6060 icon : "view_carousel" ,
6161 name : "Carousel"
6262 } ,
63+ {
64+ link : "/combo" ,
65+ icon : "arrow_drop_down_circle" ,
66+ name : "Combo"
67+ } ,
6368 {
6469 link : "/datePicker" ,
6570 icon : "date_range" ,
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import { ButtonGroupSampleModule } from "./buttonGroup/sample.module";
1616import { IgxCalendarSampleModule } from "./calendar/sample.module" ;
1717import { IgxCardSampleModule } from "./card/sample.module" ;
1818import { CarouselSampleModule } from "./carousel/sample.module" ;
19+ import { ComboSampleModule } from "./combo/sample.module" ;
1920import { IgxDatePickerSampleModule } from "./date-picker/sample.module" ;
2021import { DialogSampleModule } from "./dialog/sample.module" ;
2122import { MaskSampleModule } from "./directives/mask/sample.module" ;
@@ -66,6 +67,7 @@ import { VirtualForSampleModule } from "./virtual-for-directive/sample.module";
6667 IgxAvatarModule ,
6768 InputSampleModule ,
6869 CarouselSampleModule ,
70+ ComboSampleModule ,
6971 TabBarSampleModule ,
7072 TabsSampleModule ,
7173 ListSampleModule ,
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { ButtonGroupSampleComponent } from "./buttonGroup/sample.component";
88import { IgxCalendarSampleComponent } from "./calendar/sample.component" ;
99import { IgxCardSampleComponent } from "./card/sample.component" ;
1010import { CarouselSampleComponent } from "./carousel/sample.component" ;
11+ import { ComboSampleComponent } from "./combo/sample.component" ;
1112import { IgxDatePickerSampleComponent } from "./date-picker/sample.component" ;
1213import { DialogSampleComponent } from "./dialog/sample.component" ;
1314import { MaskSampleComponent } from "./directives/mask/sample.component" ;
@@ -63,6 +64,10 @@ const appRoutes: Routes = [
6364 component : CarouselSampleComponent ,
6465 path : "carousel"
6566 } ,
67+ {
68+ component : ComboSampleComponent ,
69+ path : "combo"
70+ } ,
6671 {
6772 component : TabBarSampleComponent ,
6873 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 { IgxComboModule } 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 ( IgxComboModule ) public igxCombo : IgxComboModule ;
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";
2626export * from "./card/card.component" ;
2727export * from "./carousel/carousel.component" ;
2828export * from "./checkbox/checkbox.component" ;
29+ export * from "./combo/combo.component" ;
2930export * from "./date-picker/date-picker.component" ;
3031export * from "./dialog/dialog.component" ;
3132export * from "./input-group/input-group.component" ;
You can’t perform that action at this time.
0 commit comments