Skip to content

Commit 15037a3

Browse files
authored
Merge branch 'master' into master
2 parents 9a82864 + 020a017 commit 15037a3

File tree

12 files changed

+164
-47
lines changed

12 files changed

+164
-47
lines changed

src/checkbox/checkbox.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export class CheckboxChange {
6767
[indeterminate]="indeterminate"
6868
[attr.aria-label]="ariaLabel"
6969
[attr.aria-labelledby]="ariaLabelledby"
70-
[attr.aria-checked]="indeterminate ? 'mixed' : checked"
70+
[attr.aria-checked]="(indeterminate ? 'mixed' : checked)"
7171
(change)="onChange($event)"
7272
(click)="onClick($event)">
7373
<label [for]="id" class="bx--checkbox-label">

src/combobox/combobox.component.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,11 @@ import { NG_VALUE_ACCESSOR } from "@angular/forms";
6161
</div>
6262
<input
6363
[disabled]="disabled"
64-
[attr.aria-expanded]="open"
6564
(click)="toggleDropdown()"
6665
(keyup)="onSearch($event.target.value)"
6766
[value]="selectedValue"
6867
class="bx--text-input"
6968
aria-label="ListBox input field"
70-
role="combobox"
71-
aria-autocomplete="list"
7269
autocomplete="off"
7370
placeholder="Filter..."/>
7471
<div
@@ -200,7 +197,7 @@ export class ComboBox implements OnChanges, OnInit, AfterViewInit, AfterContentI
200197
@ContentChild(AbstractDropdownView) view: AbstractDropdownView;
201198
@ViewChild("dropdownMenu") dropdownMenu;
202199
@HostBinding("class") class = "bx--combo-box bx--list-box";
203-
@HostBinding("attr.role") role = "listbox";
200+
@HostBinding("attr.role") role = "combobox";
204201
@HostBinding("style.display") display = "block";
205202

206203
public open = false;

src/dialog/overflow-menu/overflow-menu.component.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ import { Component, ElementRef } from "@angular/core";
55
*
66
* html:
77
* ```
8-
* <ibm-overflow-menu [options]="overflowContent"></ibm-overflow-menu>
9-
* <ng-template #overflowContent>
8+
* <ibm-overflow-menu>
109
* <ibm-overflow-menu-option>Option 1</ibm-overflow-menu-option>
1110
* <ibm-overflow-menu-option>Option 2</ibm-overflow-menu-option>
12-
* </ng-template>
11+
* </ibm-overflow-menu>
1312
* ```
1413
*/
1514
@Component({

src/dropdown/dropdown.component.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,16 @@ import {
44
Output,
55
EventEmitter,
66
ElementRef,
7-
ViewEncapsulation,
87
ContentChild,
98
OnInit,
109
ViewChild,
1110
AfterContentInit,
12-
AfterViewInit,
1311
HostListener,
14-
forwardRef,
15-
OnDestroy,
16-
HostBinding
12+
OnDestroy
1713
} from "@angular/core";
1814
import { NG_VALUE_ACCESSOR } from "@angular/forms";
1915

16+
// Observable import is required here so typescript can compile correctly
2017
import { Observable, fromEvent, of, Subscription } from "rxjs";
2118
import { throttleTime } from "rxjs/operators";
2219

src/dropdown/list/dropdown-list.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ import { ScrollableList } from "./../scrollable-list.directive";
5353
@Component({
5454
selector: "ibm-dropdown-list",
5555
template: `
56-
<ul #list class="bx--list-box__menu">
56+
<ul
57+
#list
58+
role="listbox"
59+
class="bx--list-box__menu">
5760
<li tabindex="{{item.disabled? -1 : 0}}"
5861
role="option"
5962
*ngFor="let item of displayItems"
@@ -72,7 +75,8 @@ import { ScrollableList } from "./../scrollable-list.directive";
7275
type="checkbox"
7376
[checked]="item.selected"
7477
[disabled]="item.disabled"
75-
(click)="doClick($event, item)">
78+
(click)="doClick($event, item)"
79+
tabindex="-1">
7680
<label class="bx--checkbox-label">{{item.content}}</label>
7781
</div>
7882
<ng-container *ngIf="!listTpl && type === 'single'">{{item.content}}</ng-container>

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ export * from "./radio/radio.module";
2121
export * from "./input/input.module";
2222
export * from "./select/select.module";
2323
export * from "./tiles/tiles.module";
24+
export * from "./progress-indicator/progress-indicator.module";
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { Component, Input } from "@angular/core";
2+
3+
@Component({
4+
selector: "ibm-progress-indicator",
5+
template: `
6+
<ul data-progress data-progress-current class="bx--progress">
7+
<li
8+
class="bx--progress-step bx--progress-step--{{step.state}}"
9+
*ngFor="let step of steps; let i = index">
10+
<svg *ngIf="step.state == 'complete'" width="16" height="16" viewBox="0 0 16 16">
11+
<g fill-rule="nonzero">
12+
<path d="M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"/>
13+
<path d="M11.646 5.146l.708.708-5.604 5.603-3.104-3.103.708-.708 2.396 2.397z"/>
14+
</g>
15+
</svg>
16+
<svg *ngIf="step.state == 'current'">
17+
<circle cx="12" cy="12" r="12"></circle>
18+
<circle cx="12" cy="12" r="6"></circle>
19+
</svg>
20+
<svg *ngIf="step.state == 'incomplete'">
21+
<circle cx="12" cy="12" r="12"></circle>
22+
</svg>
23+
<p class="bx--progress-label">{{step.text}}</p>
24+
<span class="bx--progress-line"></span>
25+
</li>
26+
</ul>
27+
`
28+
})
29+
export class ProgressIndicator {
30+
@Input() steps = [];
31+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { NgModule } from "@angular/core";
2+
import { CommonModule } from "@angular/common";
3+
4+
import { ProgressIndicator } from "./progress-indicator.component";
5+
6+
7+
@NgModule({
8+
declarations: [
9+
ProgressIndicator
10+
],
11+
exports: [
12+
ProgressIndicator
13+
],
14+
imports: [CommonModule]
15+
})
16+
export class ProgressIndicatorModule { }
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { storiesOf, moduleMetadata } from "@storybook/angular";
2+
import { withNotes } from "@storybook/addon-notes";
3+
import { action } from "@storybook/addon-actions";
4+
import { withKnobs, boolean, object } from "@storybook/addon-knobs/angular";
5+
6+
import { ProgressIndicatorModule } from "../";
7+
8+
storiesOf("ProgressIndicator", module)
9+
.addDecorator(
10+
moduleMetadata({
11+
imports: [
12+
ProgressIndicatorModule
13+
]
14+
})
15+
)
16+
.addDecorator(withKnobs)
17+
.add("Basic", () => ({
18+
template: `
19+
<ibm-progress-indicator [steps]="steps">
20+
</ibm-progress-indicator>
21+
`,
22+
props: {
23+
steps : [
24+
{
25+
text: "1. ONE",
26+
state: ["complete"]
27+
},
28+
{
29+
text: "2. TWO",
30+
state: ["complete"]
31+
},
32+
{
33+
text: "3. THREE",
34+
state: ["current"]
35+
},
36+
{
37+
text: "4. FOUR",
38+
state: ["incomplete"]
39+
},
40+
{
41+
text: "5. FIVE",
42+
state: ["incomplete"]
43+
},
44+
{
45+
text: "6. SIX",
46+
state: ["incomplete"]
47+
}
48+
]
49+
}
50+
}));

src/table/table-model.class.spec.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,24 @@ describe("Table", () => {
88
expect(tableModel.totalDataLength).toEqual(0);
99
});
1010

11+
it("model should handle different variants of empty data", () => {
12+
let tableModel = new TableModel();
13+
tableModel.data = undefined;
14+
15+
expect(tableModel.data).toEqual([[]]);
16+
expect(tableModel.totalDataLength).toEqual(0);
17+
18+
tableModel.data = null;
19+
20+
expect(tableModel.data).toEqual([[]]);
21+
expect(tableModel.totalDataLength).toEqual(0);
22+
23+
tableModel.data = [];
24+
25+
expect(tableModel.data).toEqual([[]]);
26+
expect(tableModel.totalDataLength).toEqual(0);
27+
});
28+
1129
it("should set rowsSelected when setting data", () => {
1230
let tableModel = new TableModel();
1331
tableModel.data = [

0 commit comments

Comments
 (0)