Skip to content

Commit 787a644

Browse files
authored
Sync to master (#3505)
* fix(focus-trap): enabled property not being coerced (#3417) * docs(autocomplete): fix a11y of autocomplete example * docs(autocomplete): add guidance about filter criteria * fix(ripple): fade-out-all should hide all ripples (#3400) * fix(checkbox): show checkbox animation only if user click or indeterminate state (#3137) Fixes #2783 * feat(checkbox): add value attribute to md-checkbox (#2701) Fixes #2583 * fix(radio): add focus indication (#3402) Fixes #3102 * fix(autocomplete): remove max width for autocomplete panel (#3297) Fixes #3198 * fix(button-toggle): fix color for selected button toggle and selected disabled button toggle (#3418) Fixes #3382 * fix(input): make icons in prefix/suffix the right size (#3342) * refactor(focus-origin-monitor): complete stream when stopping monitor (#3404) * docs(dialog): update dialog afterClosed (#3411) * docs(progress-spinner): fix typo in progress spinner example (#3299) Fixes #3148 * fix(checkbox): add focus indication (#3403) Fixes #3102 * feat(ripple): add way to globally disable ripples (#3383) * refactor: consistent module declaration (#3095) * fix(focus-trap): avoid closure compiler issues when adding anchors (#3448) * chore(menu): switch menu-item to common coercion logic (#3065) * `MdMenuItem` to use the common coercion logic when determining the disabled state. * Gets rid of the `@HostBinding` in favor of passing them through the `host` option. Relates to #2985. * fix(list-key-manager): exception when no initial active item (#3431) * fix(list-key-manager): exception when no initial active item Fixes an exception that is thrown when the user presses a key on ListKeyManager that doesn't have a default active item. The problem was due to the fact that we have a check for `null` a little bit down, that handles cases like this, however the active index is `undefined` by default. Fixes #3317. * fix: it it * fix(focus-trap): exception when element contains SVG on IE (#3432) Fixes an exception being thrown by the focus trap, if it contains an SVG element on IE. The problem was that on IE, SVG elements don't have the `children` property, which means that we have to fall back to `childNodes`. Fixes #3410. * fix(select): initial value not being displayed with FormControl and OnPush (#3434) * fix(select): initial value not being displayed with FormControl and OnPush Fixes the initial value not being displayed in a select that has a `FormControl` and is placed in a component with `ChangeDetectionStrategy.onPush`. Relates to #2269 (comment). * chore: remove unused properties * build: run tslint on tool files (#3436) * Since we had a lot of TSLint issues on our tooling scripts & tasks, we should run TSLint on those as well. * Also updates Dgeni to latest version, because it now supports TypeScript typings. * build: upgrade dev dependencies (#3440) * Upgrades outdated devDependencies to the latest version. * feat(data-table): initial prototype with sorting
1 parent d1e8ad9 commit 787a644

File tree

97 files changed

+2641
-974
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+2641
-974
lines changed

package.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,24 @@
4848
"@types/jasmine": "2.5.41",
4949
"@types/merge2": "^0.3.29",
5050
"@types/minimist": "^1.2.0",
51-
"@types/node": "^7.0.4",
51+
"@types/node": "^7.0.5",
5252
"@types/run-sequence": "^0.0.28",
5353
"@types/rx": "2.5.33",
5454
"axe-core": "^2.1.7",
5555
"axe-webdriverjs": "^0.5.0",
5656
"conventional-changelog": "^1.1.0",
57-
"dgeni": "^0.4.2",
57+
"dgeni": "^0.4.7",
5858
"dgeni-packages": "^0.16.5",
59-
"firebase-admin": "^4.0.6",
59+
"firebase-admin": "^4.1.2",
6060
"firebase-tools": "^2.2.1",
6161
"fs-extra": "^2.0.0",
6262
"glob": "^7.1.1",
63-
"google-cloud": "^0.45.1",
63+
"google-cloud": "^0.48.0",
6464
"gulp": "^3.9.1",
6565
"gulp-autoprefixer": "^3.1.1",
6666
"gulp-better-rollup": "^1.0.2",
6767
"gulp-clean": "^0.3.2",
68-
"gulp-clean-css": "^2.3.2",
68+
"gulp-clean-css": "^3.0.3",
6969
"gulp-cli": "^1.2.2",
7070
"gulp-connect": "^5.0.0",
7171
"gulp-flatten": "^0.3.1",
@@ -75,35 +75,35 @@
7575
"gulp-markdown": "^1.2.0",
7676
"gulp-rename": "^1.2.2",
7777
"gulp-sass": "^3.1.0",
78-
"gulp-sourcemaps": "^2.4.0",
78+
"gulp-sourcemaps": "^2.4.1",
7979
"gulp-transform": "^1.1.0",
8080
"hammerjs": "^2.0.8",
8181
"highlight.js": "^9.9.0",
8282
"image-diff": "^1.6.3",
8383
"jasmine-core": "^2.5.2",
84-
"karma": "^1.4.1",
84+
"karma": "^1.5.0",
8585
"karma-browserstack-launcher": "^1.2.0",
8686
"karma-chrome-launcher": "^2.0.0",
87-
"karma-firefox-launcher": "^1.0.0",
87+
"karma-firefox-launcher": "^1.0.1",
8888
"karma-jasmine": "^1.1.0",
8989
"karma-sauce-launcher": "^1.1.0",
9090
"karma-sourcemap-loader": "^0.3.7",
91-
"madge": "^1.5.0",
91+
"madge": "^1.6.0",
9292
"merge2": "^1.0.2",
9393
"minimist": "^1.2.0",
94-
"node-sass": "^4.3.0",
95-
"protractor": "^5.1.0",
94+
"node-sass": "^4.5.0",
95+
"protractor": "^5.1.1",
9696
"resolve-bin": "^0.4.0",
9797
"run-sequence": "^1.2.2",
9898
"sass": "^0.5.0",
99-
"selenium-webdriver": "^3.0.1",
99+
"selenium-webdriver": "^3.1.0",
100100
"stylelint": "^7.8.0",
101101
"travis-after-modes": "0.0.7",
102-
"ts-node": "^2.0.0",
102+
"ts-node": "^2.1.0",
103103
"tslint": "^4.4.2",
104104
"tslint-no-unused-var": "0.0.6",
105105
"typescript": "~2.0.10",
106-
"uglify-js": "^2.7.5",
106+
"uglify-js": "^2.8.7",
107107
"web-animations-js": "^2.2.2"
108108
}
109109
}

src/demo-app/autocomplete/autocomplete-demo.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ export class AutocompleteDemo {
8888
}
8989

9090
filterStates(val: string) {
91-
return val ? this.states.filter((s) => s.name.match(new RegExp(val, 'gi'))) : this.states;
91+
return val ? this.states.filter(s => new RegExp(`^${val}`, 'gi').test(s.name))
92+
: this.states;
9293
}
9394

9495
}

src/demo-app/checkbox/checkbox-demo.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<h1>md-checkbox: Basic Example</h1>
22
<form>
33
<md-checkbox [(ngModel)]="isChecked"
4-
name="cb"
4+
name="cb"
5+
value="basic_checkbox"
56
[color]="checkboxColor()"
67
(change)="isIndeterminate = false"
78
[indeterminate]="isIndeterminate"

src/demo-app/input/input-demo.html

+2-7
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,8 @@ <h4>Textarea</h4>
206206
Both:
207207
<md-input-container align="end">
208208
<input mdInput #email placeholder="Email Address" value="angular-core">
209-
<span mdPrefix>
210-
<md-icon [class.primary]="email.focused" class="demo-icons demo-transform">email</md-icon>
211-
&nbsp;
212-
</span>
213-
<span mdSuffix class="demo-transform" [class.primary]="email.focused">
214-
&nbsp;@gmail.com
215-
</span>
209+
<span mdPrefix><md-icon [class.primary]="email.focused">email</md-icon>&nbsp;</span>
210+
<span mdSuffix [class.primary]="email.focused">&nbsp;@gmail.com</span>
216211
</md-input-container>
217212
</p>
218213

src/examples/autocomplete-overview/autocomplete-overview-example.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ export class AutocompleteOverviewExample {
7171
}
7272

7373
filterStates(val: string) {
74-
return val ? this.states.filter((s) => new RegExp(val, 'gi').test(s)) : this.states;
74+
return val ? this.states.filter(s => new RegExp(`^${val}`, 'gi').test(s))
75+
: this.states;
7576
}
7677

7778
}

src/examples/progress-spinner-configurable/progress-spinner-configurable-example.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {Component} from '@angular/core';
77
styleUrls: ['./progress-spinner-configurable-example.css'],
88
})
99
export class ProgressSpinnerConfigurableExample {
10-
color = 'praimry';
10+
color = 'primary';
1111
mode = 'determinate';
1212
value = 50;
1313
}

src/lib/autocomplete/autocomplete.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,19 @@ local template variable (here we called it "auto"), and binding that variable to
4848
At this point, the autocomplete panel should be toggleable on focus and options should be selectable. But if we want
4949
our options to filter when we type, we need to add a custom filter.
5050

51-
You can filter the options in any way you want based on the text input. Here we will do a simple string test on the
52-
input value to see if it matches the option value. We already have access to the built-in `valueChanges` observable on
53-
the `FormControl`, so we can simply map the text input's values to the suggested options by passing them through this
54-
filter. The resulting observable (`filteredOptions`) can be added to the template in place of the `options` property
55-
using the `async` pipe.
51+
You can filter the options in any way you like based on the text input*. Here we will perform a simple string test on
52+
the option value to see if it matches the input value, starting from the option's first letter. We already have access
53+
to the built-in `valueChanges` observable on the `FormControl`, so we can simply map the text input's values to the
54+
suggested options by passing them through this filter. The resulting observable (`filteredOptions`) can be added to the
55+
template in place of the `options` property using the `async` pipe.
5656

5757
Below we are also priming our value change stream with `null` so that the options are filtered by that value on init
5858
(before there are any value changes).
5959

60+
*For optimal accessibility, you may want to consider adding text guidance on the page to explain filter criteria.
61+
This is especially helpful for screenreader users if you're using a non-standard filter that doesn't limit matches
62+
to the beginning of the string.
63+
6064
*my-comp.ts*
6165
```ts
6266
class MyComp {
@@ -75,7 +79,7 @@ class MyComp {
7579
}
7680

7781
filter(val: string): string[] {
78-
return this.options.filter(option => new RegExp(val, 'gi').test(option));
82+
return this.options.filter(option => new RegExp(`^${val}`, 'gi').test(option));
7983
}
8084
}
8185
```
@@ -134,7 +138,7 @@ class MyComp {
134138
}
135139

136140
filter(name: string): User[] {
137-
return this.options.filter(option => new RegExp(name, 'gi').test(option));
141+
return this.options.filter(option => new RegExp(`^${name}`, 'gi').test(option));
138142
}
139143

140144
displayFn(user: User): string {

src/lib/autocomplete/autocomplete.scss

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ $mat-autocomplete-panel-above-offset: -24px !default;
1515
.mat-autocomplete-panel {
1616
@include mat-menu-base();
1717
visibility: hidden;
18-
18+
19+
max-width: none;
1920
max-height: $mat-autocomplete-panel-max-height;
2021
position: relative;
2122

@@ -34,4 +35,4 @@ $mat-autocomplete-panel-above-offset: -24px !default;
3435
&.mat-autocomplete-hidden {
3536
visibility: hidden;
3637
}
37-
}
38+
}

src/lib/autocomplete/index.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import {MdOptionModule, OverlayModule, OVERLAY_PROVIDERS, CompatibilityModule} f
44
import {CommonModule} from '@angular/common';
55
import {MdAutocomplete} from './autocomplete';
66
import {MdAutocompleteTrigger} from './autocomplete-trigger';
7-
export * from './autocomplete';
8-
export * from './autocomplete-trigger';
97

108
@NgModule({
119
imports: [MdOptionModule, OverlayModule, CompatibilityModule, CommonModule],
@@ -21,3 +19,7 @@ export class MdAutocompleteModule {
2119
};
2220
}
2321
}
22+
23+
24+
export * from './autocomplete';
25+
export * from './autocomplete-trigger';

src/lib/button-toggle/_button-toggle-theme.scss

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@
2323
}
2424

2525
.mat-button-toggle-checked {
26-
background-color: mat-color($mat-grey, 300);
26+
background-color: mat-color($background, selected-button);
2727
color: mat-color($foreground, base);
2828
}
2929

3030
.mat-button-toggle-disabled {
31-
background-color: map_get($mat-grey, 200);
31+
background-color: mat-color($background, disabled-button-toggle);
3232
color: mat-color($foreground, disabled-button);
3333

3434
&.mat-button-toggle-checked {
35-
background-color: mat-color($mat-grey, 400);
35+
background-color: mat-color($background, selected-disabled-button);
3636
}
3737
}
3838
}

src/lib/button-toggle/button-toggle.spec.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ import {NgControl, FormsModule, ReactiveFormsModule, FormControl} from '@angular
99
import {Component, DebugElement} from '@angular/core';
1010
import {By} from '@angular/platform-browser';
1111
import {
12-
MdButtonToggleGroup,
13-
MdButtonToggle,
14-
MdButtonToggleGroupMultiple,
15-
MdButtonToggleChange, MdButtonToggleModule,
16-
} from './button-toggle';
12+
MdButtonToggleGroup,
13+
MdButtonToggle,
14+
MdButtonToggleGroupMultiple,
15+
MdButtonToggleChange,
16+
MdButtonToggleModule,
17+
} from './index';
1718

1819

1920
describe('MdButtonToggle', () => {

src/lib/button-toggle/button-toggle.ts

+18-48
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,24 @@
11
import {
2-
NgModule,
3-
ModuleWithProviders,
4-
Component,
5-
ContentChildren,
6-
Directive,
7-
ElementRef,
8-
Renderer,
9-
EventEmitter,
10-
HostBinding,
11-
Input,
12-
OnInit,
13-
Optional,
14-
Output,
15-
QueryList,
16-
ViewChild,
17-
ViewEncapsulation,
18-
forwardRef,
19-
AfterViewInit
2+
Component,
3+
ContentChildren,
4+
Directive,
5+
ElementRef,
6+
Renderer,
7+
EventEmitter,
8+
HostBinding,
9+
Input,
10+
OnInit,
11+
Optional,
12+
Output,
13+
QueryList,
14+
ViewChild,
15+
ViewEncapsulation,
16+
forwardRef,
17+
AfterViewInit,
2018
} from '@angular/core';
21-
import {NG_VALUE_ACCESSOR, ControlValueAccessor, FormsModule} from '@angular/forms';
19+
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms';
2220
import {Observable} from 'rxjs/Observable';
23-
import {
24-
FocusOriginMonitor,
25-
UniqueSelectionDispatcher,
26-
coerceBooleanProperty,
27-
UNIQUE_SELECTION_DISPATCHER_PROVIDER,
28-
CompatibilityModule,
29-
} from '../core';
21+
import {UniqueSelectionDispatcher, coerceBooleanProperty, FocusOriginMonitor} from '../core';
3022

3123
/** Acceptable types for a button toggle. */
3224
export type ToggleType = 'checkbox' | 'radio';
@@ -469,25 +461,3 @@ export class MdButtonToggle implements OnInit {
469461
this._renderer.invokeElementMethod(this._inputElement.nativeElement, 'focus');
470462
}
471463
}
472-
473-
474-
@NgModule({
475-
imports: [FormsModule, CompatibilityModule],
476-
exports: [
477-
MdButtonToggleGroup,
478-
MdButtonToggleGroupMultiple,
479-
MdButtonToggle,
480-
CompatibilityModule,
481-
],
482-
declarations: [MdButtonToggleGroup, MdButtonToggleGroupMultiple, MdButtonToggle],
483-
providers: [UNIQUE_SELECTION_DISPATCHER_PROVIDER, FocusOriginMonitor]
484-
})
485-
export class MdButtonToggleModule {
486-
/** @deprecated */
487-
static forRoot(): ModuleWithProviders {
488-
return {
489-
ngModule: MdButtonToggleModule,
490-
providers: []
491-
};
492-
}
493-
}

src/lib/button-toggle/index.ts

+32
Original file line numberDiff line numberDiff line change
@@ -1 +1,33 @@
1+
import {NgModule, ModuleWithProviders} from '@angular/core';
2+
import {FormsModule} from '@angular/forms';
3+
import {MdButtonToggleGroup, MdButtonToggleGroupMultiple, MdButtonToggle} from './button-toggle';
4+
import {
5+
UNIQUE_SELECTION_DISPATCHER_PROVIDER,
6+
CompatibilityModule,
7+
FocusOriginMonitor,
8+
} from '../core';
9+
10+
11+
@NgModule({
12+
imports: [FormsModule, CompatibilityModule],
13+
exports: [
14+
MdButtonToggleGroup,
15+
MdButtonToggleGroupMultiple,
16+
MdButtonToggle,
17+
CompatibilityModule,
18+
],
19+
declarations: [MdButtonToggleGroup, MdButtonToggleGroupMultiple, MdButtonToggle],
20+
providers: [UNIQUE_SELECTION_DISPATCHER_PROVIDER, FocusOriginMonitor]
21+
})
22+
export class MdButtonToggleModule {
23+
/** @deprecated */
24+
static forRoot(): ModuleWithProviders {
25+
return {
26+
ngModule: MdButtonToggleModule,
27+
providers: []
28+
};
29+
}
30+
}
31+
32+
133
export * from './button-toggle';

src/lib/button/button.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {async, TestBed, ComponentFixture} from '@angular/core/testing';
22
import {Component} from '@angular/core';
33
import {By} from '@angular/platform-browser';
4-
import {MdButtonModule} from './button';
4+
import {MdButtonModule} from './index';
55
import {ViewportRuler} from '../core/overlay/position/viewport-ruler';
66
import {FakeViewportRuler} from '../core/overlay/position/fake-viewport-ruler';
77

0 commit comments

Comments
 (0)