Commit Graph

1342 Commits

Author SHA1 Message Date
Paul Gschwendtner 1326234117 ci: run with LTS node version (#3906)
* Updates the previous LTS version to the current LTS version of node.
2017-04-06 09:51:09 -06:00
Daniel H 98c0b1d58e build: fix build script in package.json (#3915)
Previously the build script tried to run an invalid gulp task.
2017-04-05 11:18:50 -06:00
Mac 59c62893ac docs(dialog): document viewContainerRef config option (#3825) 2017-04-04 17:49:44 -07:00
Mac 1d865640b0 docs(theming): list prebuilt themes (#3826) 2017-04-04 17:22:59 -07:00
Jeremy Elbourn 3f5894efc7 fix: deprecate MaterialModule (#3840)
We've found that, with the current state of tree-shaking in the world,
that using an aggregate NgModule like `MaterialModule` leads to tools
not being able to eliminate code for components that aren't used.

In order to ensure that users end up with the smallest code size
possible, we're deprecating MaterialModule, to be removed in the a
subsequent release.

To replace `MaterialModule`, users can create their own "Material"
modul within their application (e.g., `GmailMaterialModule`) that
imports only the set of components actually used in the application.
2017-04-04 17:22:04 -07:00
Mac 4c407f0dc8 docs(tabs): use two-way binding syntax in API doc (#3885) 2017-04-04 17:19:40 -07:00
tinayuangao 9361ced850 chore: fix screenshot results to be per-sha (#3887) 2017-04-04 17:18:20 -07:00
Johan Bruning bc074a19b9 docs(dialog): fix misleading code comment (#3894) 2017-04-04 17:17:27 -07:00
Kristiyan Kostadinov c486cf817a test(select): various test inconsistencies (#3861)
* test(select): various test inconsistencies

* Fixes a select test that occasionally fails to capture the error inside the expect, causing it to get logged without actually being thrown. This seems to be a Zone-related issue since wrapping a few calls in `async` makes it behave correctly.
* Fixes an RTL test that fails if it is made async. This incorporates the changes from #3866 and #3163 and fixes the underlying issue. It appears that the test was failing, because IE does a slight twitch on the select panel since it goes from a pixel-based `min-width` to one with `calc` and percentages to just percentages. I've set the default width to 100% which is the same as the pixel-based one, which appears to make IE happy.

* chore: verify that changing the min-width causes failures

* chore: revert min-width change

* chore: remove a few unnecessary expressions
2017-04-04 17:17:09 -07:00
Paul Gschwendtner f40296e0fa fix: aot runtime issues (#3807)
* fix: aot runtime issues

Currently when using the `MdSnackBar` in AOT, there will be runtime exceptions from the NgFactory. Those are caused by the re-exports of DI tokens.

The Angular compiler will then look for the first export e.g `MdLiveAnnouncer` and the normal `LiveAnnouncer` export wont be included in the factory.

This is breaking at runtime now, because the NgFactory searches for `LiveAnnouncer` but there is only the `LiveAnnouncer` (DI exception)

Since this deprecation is pretty old we can safely remove it anyways. Although this is probably an Angular that should be reported separately.

Also this commit fixes the output directory of the `aot` gulp task. Currently it outputs the factories in a wrong directory. (This allows us to serve the aot demo-app in the future)

* Remove MdUniqueSelectionDispatcher
2017-04-01 07:14:25 +08:00
Jeremy Elbourn e7a4a03d68 fix: use correct access tokens for artifact publishing (#3860) 2017-04-01 02:51:22 +08:00
Paul Gschwendtner 904c71e17f fix(slide-toggle): fix unavailable unmonitor call (#3862)
* fix(slide-toggle): fix unavailable unmonitor call

* Remove variable
2017-04-01 02:50:43 +08:00
Paul Gschwendtner 724170df24 demo(slide-toggle): fix slide-toggle required demo (#3793)
Fixes the slide-toggle required demo, where the component will be compared with the native required state.

Basically in the demo, the form should be validated native and should show the browsers popup if the slide-toggle is required.
2017-04-01 01:43:13 +08:00
Paul Gschwendtner a225b77fc4 build: silent sass bundling (#3784)
* No longer prints the whole SASS file-tree when running the `build:release` task.
* Added a new options that allows disabling STDOUT messages. STDERR is important for error messages.
2017-04-01 01:42:44 +08:00
Paul Gschwendtner 2240b6c5a8 refactor(focus-origin-monitor): rename unmonitor to stopMonitoring (#3783)
* Renames the `unmonitor` function to `stopMonitoring`.
* Removes unnecessary code that keeps track of the `FocusOriginMonitor` subscription. After calling `stopMonitoring` the observable will complete.
2017-04-01 01:42:35 +08:00
Kristiyan Kostadinov a71a5af2ea feat(dialog): allow for the dialog dimensions to be updated (#2940)
* feat(dialog): allow for the dialog dimensions to be updated

Adds an `updateDimensions` method to the `MdDialogRef` which allows the user to update a dialog's dimensions after it has been created.

Fixes #2930.

* refactor: split dimensions method into two

* refactor: rename updateDimensions to updateSize

* refactor: add back _getOverlayState method

* chore: fix aot issue
2017-04-01 01:42:24 +08:00
Paul Gschwendtner ab77fa95da build: fix closure tsconfig path (#3835)
* Due to the TSConfig file renaming in #3791 and the fact that they were merged at the same time, the path in the closure-compiler script is now invalid.
2017-03-30 05:32:24 +08:00
Kristiyan Kostadinov e82457c118 fix(select): exception if selected value is accessed on init (#3785)
Fixes an error that is thrown if something attempts to access the `selected` value of `md-select` too early. The issue comes from the fact that the underlying `SelectionModel` gets initialized too late in `ngAfterContentInit`.

Fixes #3750.
2017-03-30 05:32:10 +08:00
Kristiyan Kostadinov 4282917f0c feat(theming): log a warning if core theme isn't loaded (#3781)
* feat(theming): log a warning if core theme isn't loaded

* Checks the user's loaded stylesheets and logs a warning if the Material core theme isn't loaded.
* Fixes a wrong `typeof` check when determining the doctype.

Fixes #2828.

Note: I originally went with looping through the `document.styleSheets` to check whether the selector is defined, however I had to switch back to `getComputedStyle`, because browsers don't expose the `document.styleSheets`, if the CSS file is being loaded from another domain. This would've caused the warning to be logged if the user loads over a CDN.

* refactor: address feedback
2017-03-30 05:31:55 +08:00
Paul Gschwendtner c4ec662390 feat(slide-toggle): add ripple focus indicator (#3739)
* feat(slide-toggle): add ripple focus indicator

* Introduces a focus indiactor using the persistent ripples.

* Address comments
2017-03-30 05:31:42 +08:00
Jeferson Estevo bedf5a1e42 fix(autocomplete): do not trigger submit on ENTER (#3727)
* fix(autocomplete): do not trigger submit on ENTER

When an option is selected with the ENTER key, it should not submit the form and prevent the default input behavior

Fixes #3159

* test(autocomplete): removing extra detectChanges
2017-03-30 05:31:28 +08:00
mmalerba 6d6c12dc16 fix(input): don't add empty prefix & suffix wrappers (#3724)
* fix(input): don't add empty prefix & suffix wrappers

* add tests
2017-03-30 05:31:17 +08:00
Kristiyan Kostadinov 07793a48ea fix(tabs): re-align ink bar on direction change (#3622)
Re-aligns the ink bar if the user's layout direction changed.

Fixes #3615.
2017-03-30 05:31:04 +08:00
Kristiyan Kostadinov 52ea7a34e2 fix(select): wrong item order in label in rtl (#3567)
Fixes selected items not having the proper order in the label when `md-select` is in `multiple` mode and in RTL.
2017-03-30 05:30:32 +08:00
Kristiyan Kostadinov 8e6720b602 fix(dialog): leaking MdDialogContainer references (#2944)
* fix(dialog): leaking MdDialogContainer references

Fixes an issue that caused the `MdDialogContainer` references to not be cleaned up, and as a result, any of the `MdDialogRef` and `MdDialogConfig` instances as well. The issue seems to come from the fact that a couple of blocks that look like:
```
this._ngZone.onMicrotaskEmpty.first().subscribe(() => {
  this._elementFocusedBeforeDialogWasOpened = document.activeElement;
  this._focusTrap.focusFirstTabbableElement();
});
```

End up being transpiled to:
```
var _this = this;
this._ngZone.onMicrotaskEmpty.first().subscribe(function () {
    _this._elementFocusedBeforeDialogWasOpened = document.activeElement;
    _this._focusTrap.focusFirstTabbableElement();
});
```

This seems to cause the browser to retain the `_this` reference after the dialog has been destroyed.

Fixes #2876.

* chore: add comment about `this` usage in zone
2017-03-30 05:30:20 +08:00
Paul Gschwendtner 07bc4add13 build: fix serve task (#3794)
* build: fix serve task

* Currently when serving the dev-app or e2e-app and chanages are recognized, the library task will run. This task clears the whole `dist/` and rebuilds then.

* This is problematic because sometimes only the library will be rebuilt and for example the `dev-app` won't be rebuilt. After the task ran, the `dev-app` is removed and the serve task will crash.

* Rename to library:clean-build
2017-03-30 02:13:45 +08:00
Paul Gschwendtner becb7a87e0 build: tsconfig for editor warnings (#3791)
* build: tsconfig for editor warnings

Currently when using a code editor that uses the TypeScript language service (Webstorm / VS Code / Atom / Sublime) there will be TypeScript errors in the `.spec` files.

This is because the editor finds the `tsconfig.json` file that doesn't match the spec files. Therefore it complains about the `experimentalDecorators`.

In `angular/angular` there is a global `tsconfig` file that matches everything and is therefore fixing the editor warnings. This file is also used to compile all `.spec` files for the whole project.

We can add such a `tsconfig.json` file as well, and in the future we can use it for compiling the specs as well.

* Add docs for tsconfig files
2017-03-30 02:13:33 +08:00
Paul Gschwendtner 51cfb5f75f build: run closure-compiler (#3789)
* build: run closure-compiler

* Adds a script that runs the closure-compiler against the devapp / demo-app.
* The script will run on the CI as a new mode. Ensuring that all our components are closure-compatible.

Fixes #1206.

* Address feedback
2017-03-30 02:13:19 +08:00
Kristiyan Kostadinov d7d2b16fa0 fix(dialog): delay focus until animation is done (#3774)
Delays focusing the first tabbable element in a dialog until animation is done. This prevents issues where other components (e.g. autocomplete) may have a wrong position on load, because they measured dialog while it was animating.

Note on lack of tests: This is kind of hard to test, because we don't have much control over how the animations runs.

Fixes #3722.
2017-03-30 02:12:55 +08:00
Paul Gschwendtner cd0b853d39 fix(slide-toggle): remove host element margin (#3761)
* Angular Material components should not have any outer-margin on component host elements. Similar as for the checkbox component.
2017-03-30 02:10:43 +08:00
Zhoucheng Li 3464011fb4 fix(list): add font-family style to subheader (#3056) 2017-03-30 02:10:04 +08:00
mmalerba 28f1ec32c6 feat(slider): add theme color support (#3766) 2017-03-29 04:29:00 +08:00
Kristiyan Kostadinov ccdd0f23cc chore(progress-spinner): remove md-progress-circle alias (#3735)
Removes the deprecated `md-progress-circle` alias.
2017-03-29 04:28:45 +08:00
Kristiyan Kostadinov 68db6ba118 fix(scroll-dispatcher): unable to unsubscribe from global listener (#3729)
Fixes not being able to unsubscribe from the global `scrolled` listener.
2017-03-29 04:28:30 +08:00
Jeferson Estevo 61085633ef bug(autocomplete): deselect the other options when the user select an option (#3690)
* bug(autocomplete): deselect the other options when the user select one from the autocomplete

Fixes #3689

* bug(autocomplete): only call deselect on the previous selected option. Unit tests.
2017-03-29 04:28:18 +08:00
Kristiyan Kostadinov 1ae81a4450 fix(progress-spinner): not redrawing when changing modes (#3672)
* Fixes the progress spinner not redrawing when the mode is changed dynamically from `indeterminate` to `determinate`.
* Some minor cleanup in the progress spinner.

Fixes #3648.
2017-03-29 04:28:03 +08:00
Paul Gschwendtner 038a337967 fix(select): allow custom aria-label (#3765)
* fix(select): allow custom aria-label

* Adds support for custom `aria-label` attributes on the select host element.
* Also fixes that the `aria-labelledby` attribute is overwritten by the placeholder `aria-label`.

Fixes #3762.

* Fix typos
2017-03-28 07:39:21 +08:00
Paul Gschwendtner 7a60489204 fix(checkbox): focus origin for focus method (#3763)
* Currently when developers call the `focus` method on the checkbox, the checkbox focuses via keyboard. This makes the focus-classes of the `FocusOriginMonitor` invalid.
* To be consistent with native input controls, the focus indicator should also show for programmatic focus.
2017-03-28 07:39:11 +08:00
mmalerba 2ccf0ae170 fix(input): change dividerColor to color (#3726)
* fix(input): change dividerColor to color

* change over docs and demo usages
2017-03-28 07:38:56 +08:00
mmalerba 7cff349c6c fix(input): baseline alignment on textarea (#3714)
* fix(input): baseline alignment on textarea

* add mdTextareaAutosize to baseline demo
2017-03-28 07:38:44 +08:00
mmalerba cb85eeb23f fix(input): fix blank aria-describedBy (#3713) 2017-03-28 07:38:31 +08:00
mmalerba 49c3675f8c add exportAs to focusTrap directive (#3688) 2017-03-28 07:38:21 +08:00
Kristiyan Kostadinov aa5925bb0f fix(overlay): ensure proper stacking order when attaching (#3581)
Fixes a case where the order of overlays can be invalid if one overlay is detached, while another is destroyed. Next time both of them are open, the one that was disposed will end up beneath the freshly-created one, no matter the order of attachment. This PR adds some logic that will ensure that all each newly-opened overlay will be at the top of the stacking order.

Fixes #3574.
2017-03-28 07:37:51 +08:00
Kristiyan Kostadinov c29f8ca44a feat(input): add directive for displaying error messages (#3560)
* feat(input): add directive for displayed error messages

Adds the `md-error` directive that can be utilised to display validation errors to the user. Example:

```
<md-input-container>
  <input mdInput placeholder="email" [formControl]="emailFormControl">
  <md-error *ngIf="emailFormControl.errors.required">This field is required</md-error>
  <md-error *ngIf="emailFormControl.errors.pattern">
    Please enter a valid email address
  </md-error>
</md-input-container>
```

The `md-input-container` behavior is as follows:
* If there is an error and the user interacted with the input, the errors will be shown.
* If there is an error and the user submitted the a form that wraps the input, the errors will be shown.
* If there are errors to be shown on an input container that has `md-hint`-s, the hints will be hidden.
* If an input with hints and errors becomes valid, the hint won't be displayed anymore.

**Note:** At the moment, all hints will be hidden when an error is shown. This might not be intended for some cases (e.g. with a character counter). It might make sense to only hide the one in the `start` slot, but this could be addressed separately.

* chore: lint and aot errors

* fix: address feedback

* fix: address more feedback

* chore: use FormGroup properly

* refactor: switch back to showing hints when valid

* errror
2017-03-28 07:37:34 +08:00
Elad Bezalel e482cb6821 style(button): polished icon buttons ripples (#3208)
- changed Icon button ripples to start from the center and removed hover style on icon buttons
2017-03-28 07:37:15 +08:00
Jeferson Estevo e9647346cc fix(select): show focus indicator even with validation errors (#3743)
Fixes #3742
2017-03-27 10:17:34 -07:00
mmalerba 220163e28a fix(input): make sure injected NgControl belongs to the input (#3700) 2017-03-27 10:17:17 -07:00
mmalerba dc5c869ffb fix(input): don't animate label when value is set programmatically (#3691) 2017-03-27 10:16:56 -07:00
Kristiyan Kostadinov 5c2b44903d perf(scroll-dispatcher): avoid triggering change detection on scroll (#3687)
* Avoids triggering change detection when listening to global scroll events in the `ScrollDispatcher`.
* Avoids triggering change detection when scrolling inside of `Scrollable` instances.
* Switches a `ScrollDispatcher` test to use spies, instead of toggling booleans.
2017-03-27 10:16:12 -07:00
Kristiyan Kostadinov 75996b51b5 fix(autocomplete): not showing panel on first focus in certain cases (#3775)
Fixes a case where the first time an autocomplete is focused by clicking within its input container (note not directly on the input), the panel is invisible, because its `showPanel` flag hasn't been set yet.

Relates to #3722.
2017-03-24 20:37:59 -07:00