-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(igx-combo): add empty combo sample #1260
- Loading branch information
Showing
9 changed files
with
153 additions
and
0 deletions.
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
Empty file.
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,6 @@ | ||
<div class="sample-wrapper"> | ||
<page-header title="Combo" description="Combo lets you choose value from a list"></page-header> | ||
<section class="sample-content"> | ||
<igx-combo data="items"></igx-combo> | ||
</section> | ||
</div> |
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,107 @@ | ||
import { Component, OnInit, ViewChild } from "@angular/core"; | ||
import { IgxComboComponent } from "../../lib/main"; | ||
@Component({ | ||
// tslint:disable-next-line:component-selector | ||
selector: "combo-sample", | ||
templateUrl: "./sample.component.html", | ||
styleUrls: ["sample.component.css"] | ||
}) | ||
export class ComboSampleComponent implements OnInit { | ||
private width = "160px"; | ||
@ViewChild(IgxComboComponent) public igxCombo: IgxComboComponent; | ||
|
||
items: any[] = []; | ||
|
||
ngOnInit() { | ||
|
||
} | ||
|
||
constructor() { | ||
const states = [ | ||
"New England", | ||
"Connecticut", | ||
"Maine", | ||
"Massachusetts", | ||
"New Hampshire", | ||
"Rhode Island", | ||
"Vermont", | ||
"Mid-Atlantic", | ||
"New Jersey", | ||
"New York", | ||
"Pennsylvania", | ||
"East North Central", | ||
"Illinois", | ||
"Indiana", | ||
"Michigan", | ||
"Ohio", | ||
"Wisconsin", | ||
"West North Central", | ||
"Iowa", | ||
"Kansas", | ||
"Minnesota", | ||
"Missouri", | ||
"Nebraska", | ||
"North Dakota", | ||
"South Dakota", | ||
"South Atlantic", | ||
"Delaware", | ||
"Florida", | ||
"Georgia", | ||
"Maryland", | ||
"North Carolina", | ||
"South Carolina", | ||
"Virginia", | ||
"District of Columbia", | ||
"West Virginia", | ||
"East South Central", | ||
"Alabama", | ||
"Kentucky", | ||
"Mississippi", | ||
"Tennessee", | ||
"West South Central", | ||
"Arkansas", | ||
"Louisiana", | ||
"Oklahoma", | ||
"Texas", | ||
"Mountain", | ||
"Arizona", | ||
"Colorado", | ||
"Idaho", | ||
"Montana", | ||
"Nevada", | ||
"New Mexico", | ||
"Utah", | ||
"Wyoming", | ||
"Pacific", | ||
"Alaska", | ||
"California", | ||
"Hawaii", | ||
"Oregon", | ||
"Washington"]; | ||
|
||
const areas = [ | ||
"New England", | ||
"Mid-Atlantic", | ||
"East North Central", | ||
"West North Central", | ||
"South Atlantic", | ||
"East South Central", | ||
"West South Central", | ||
"Mountain", | ||
"Pacific" | ||
]; | ||
|
||
for (let i = 0; i < states.length; i += 1) { | ||
const item = { field: states[i] }; | ||
if (areas.indexOf(states[i]) !== -1) { | ||
item["header"] = true; | ||
} else if (i % 7 === 4 || i > 49) { | ||
item["disabled"] = true; | ||
} | ||
this.items.push(item); | ||
} | ||
} | ||
|
||
onSelection(ev) { | ||
} | ||
} |
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,12 @@ | ||
import { CommonModule } from "@angular/common"; | ||
import { NgModule } from "@angular/core"; | ||
|
||
import { IgxComboModule } from "../../lib/main"; | ||
import { PageHeaderModule } from "../pageHeading/pageHeading.module"; | ||
import { ComboSampleComponent } from "./sample.component"; | ||
|
||
@NgModule({ | ||
declarations: [ComboSampleComponent], | ||
imports: [CommonModule, PageHeaderModule, IgxComboModule] | ||
}) | ||
export class ComboSampleModule { } |
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,15 @@ | ||
import { async, ComponentFixture, TestBed } from "@angular/core/testing"; | ||
import { IgxComboComponent, IgxComboModule } from "./combo.component"; | ||
|
||
describe("Combo", () => { | ||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [/*BasicComboComponent*/], | ||
imports: [IgxComboModule] | ||
}).compileComponents(); | ||
})); | ||
|
||
it("Initialize combo", () => { | ||
|
||
}); | ||
}); |
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