Commit Graph

3874 Commits

Author SHA1 Message Date
Kristiyan Kostadinov 78998638d3 feat(keycodes): add utilities for checking modifier keys (#13933)
Based off of the conversation in #13790, these changes add some utilities for dealing with modifier keys on keyboard events.
2018-11-07 10:40:09 -08:00
Kristiyan Kostadinov 31bffb38fe fix(datepicker): unable to disable ripple on datepicker toggle (#13997)
Allows for the ripple on the datepicker toggle to be disabled.

Fixes #13986.
2018-11-07 10:39:20 -08:00
Kristiyan Kostadinov d94d17614c fix(bidi): preserve user dir attribute (#13859)
Currently we normalize any values that aren't `ltr` or `rtl` to `ltr` in order to have a predictable value when using the directionality in components, however this ends up overwriting the consumer's value which might not necessarily be used by Angular (e.g. setting it to `auto`). These changes switch to preserving the attribute while normalizing the value for when it gets injected.

Fixes #13855.
2018-11-07 10:26:08 -08:00
Kristiyan Kostadinov 4ce5ee0a6c fix(icon): account for query params when prefixing external references (#13930)
Fixes `mat-icon` ignoring query params when prefixing external references inside the SVG.

Fixes #13924.
2018-11-07 10:25:22 -08:00
Kristiyan Kostadinov 2290063ec8 fix(progress-bar): account for query params when prefixing references (#13942)
Fixes the progress bar not accounting for URL query params when it prefixes its SVG references.

Related to #13930.
2018-11-07 10:24:31 -08:00
Kristiyan Kostadinov 27347b58b4 fix(focus-trap): warn if initial element is not focusable (#13960)
Currently if the consumer sets the `cdkFocusInitial` group on a non-focusable element, nothing will happen. These changes add a warning if the app is running in dev mode.

Relates to #13953.
2018-11-07 10:23:35 -08:00
Kristiyan Kostadinov 4be1b06edd feat(datepicker): allow custom classes to be applied to individual dates (#13971)
Adds the `dateClass` function which allows consumers to apply custom CSS classes to specific dates. This is useful for highlighting specific dates like a holiday.

Fixes #13943.
2018-11-07 10:22:43 -08:00
Joey Perrott 69ffd3306e fix(snackbar): set aria role based on if announcement message is provided (#13993) 2018-11-07 10:21:41 -08:00
Kristiyan Kostadinov 81f8fb9582 fix(button-toggle): not forwarding focus to underlying control (#14001)
Fixes the button toggle host element not being able to receive focus which means that it can't be used with the focus trap directives. Also fixes that when it does receive focus, it won't forward it to the underlying `button` element.
2018-11-07 10:20:26 -08:00
Kristiyan Kostadinov ec4809ff1b fix(slide-toggle): redirect focus to underlying input element (#13957)
Currently the `mat-slide-toggle` doesn't redirect focus to the underlying `input` element. This means that things like the focus trap's `cdkFocusInitial` won't work when they're set on the toggle host. These changes add a `tabindex` and set up a `focus` listener to forward focus to the input.

Relates to #13953.
2018-11-07 10:19:07 -08:00
Kristiyan Kostadinov fa944b7fe4 fix(drag-drop): ignore enter predicate when returning item to its initial container (#13972)
Something I noticed while putting together an example for the `enterPredicate` a while ago. Currently we allow an item to be returned to its initial container, even if the initial container isn't connected to the new one, however we don't do the same for the `enterPredicate`. This means that the user can get into the situation where they drag an item out, but then they're not allowed to return it, which seems weird. These changes will ignore the `enterPredicate`, if an item is being returned to the initial container.
2018-11-07 10:11:18 -08:00
Kristiyan Kostadinov 20f89245f4 fix(scrolling): leaking subscription if same element is registered multiple times (#13974)
If the `ScrollDispatcher.register` method is called twice in a row, the consumer will end up with a subscription that can't be cleaned up. These changes add an extra check to prevent the same scrollable from being re-registered.
2018-11-07 10:10:35 -08:00
Kristiyan Kostadinov 6fe84f317e fix(drag-drop): error if drag item is destroyed zone has stabilized (#13978)
We initialize the `rootElement` in an `NgZone.onStable` callback, however if the zone doesn't stabilize before the `cdkDrag` is destroyed, we'll throw an error because there is no `rootElement`. These changes add an extra check to ensure that we don't throw.
2018-11-07 10:10:05 -08:00
Pascal Zwick 6c0fd37a29 docs(drag-drop): Fix wrong class name (#14018) 2018-11-07 10:07:44 -08:00
Jeremy Elbourn d50b9f28c1 Revert "fix(dialog,bottom-sheet): enter animation blocking child animations (#13888)" (#14017)
This reverts commit 235add9401.

This change broke an app inside of Google where tabs appear inside of a
dialog. The tabs get stuck in a weird frozen animation state.
2018-11-06 17:10:09 -08:00
Jeremy Elbourn 4508fa116e Revert "Revert "fix(tabs): duplicate animation events on some browsers (#13674)" (#14015)" (#14016)
This reverts commit 11c96d65a1.

Turns out the original change wasn't actually the problem. It was #13888
instead.
2018-11-06 17:07:21 -08:00
Jeremy Elbourn 11c96d65a1 Revert "fix(tabs): duplicate animation events on some browsers (#13674)" (#14015)
This reverts commit 28e3d3641b.

This change caused a problem in at least one Google app where tabs
inside of a dialog would end up in some kind of frozen animation state
and not rendering.
2018-11-06 16:16:59 -08:00
Sunny Liu 8c464780ea chore(radio): fix typo in test name (#14000) 2018-11-06 09:50:56 -08:00
Jeremy Elbourn 6c741c4363 fix(chips): remove circular dependency between chip-list and chip-input (#13994)
This change is necessary because some Google-internal infrastructure has
started encountering errors because of this particular circular dep.
2018-11-05 13:32:28 -08:00
Kristiyan Kostadinov 12c15ba999 fix(drag-drop): drop list not toggling dragging class inside component with OnPush change detection (#13703)
Fixes the `CdkDropList` not toggling its `cdk-drop-list-dragging` class if it's placed inside a component with `OnPush` change detection.

Fixes #13680.
2018-11-05 13:16:05 -08:00
Paul Gschwendtner b662bfa94e build: do not throw if example module is created through gulp (#13966)
* In case someone uses both Gulp and Bazel to build Angular Material, there will be an error because our gulp process generates the `example-module` as an actual source file.  This is problematic because the `genrule` cannot have the `example-module` as an `input` and an `output` at the same time.
2018-11-05 10:23:15 -08:00
Paul Gschwendtner 057909de15 build: update bazel sass_rules (#13963)
* Updates to the new API of the Sass rules (https://github.com/bazelbuild/rules_sass/commit/8b61ad6953fde55031658e1731c335220f881369).
* This finally means that the thousand of source-map warnings from the sass_rules are gone.
2018-11-05 10:19:41 -08:00
Kristiyan Kostadinov 76044e8b5c fix(list): add ripples to action list items (#13799)
Sets up ripples for the items inside an action list and makes it a little easier to set ripples up in the future, if we add other list types.

Fixes #13795.
2018-11-02 17:28:09 -07:00
Kristiyan Kostadinov 235add9401 fix(dialog,bottom-sheet): enter animation blocking child animations (#13888)
Currently the enter animations for the Material dialog, CDK dialog and bottom sheet are set up to be blocking, which means that any components with an initial animation inside them will be blocked until they're done. These changes allow for the child animations to run in parallel.

Fixes #13870.
2018-11-02 17:27:01 -07:00
Kristiyan Kostadinov 28e3d3641b fix(tabs): duplicate animation events on some browsers (#13674)
Fixes all the animation-related events from the tab body being fired twice. Since a lot of the tabs functionality is tied to animations, this could cause multiple consecutive style recalculations, in addition to the `animationDone` event being fired too many times.
2018-11-02 17:25:45 -07:00
Kristiyan Kostadinov a320af2d64 fix(button-toggle): remove hover state on touch devices (#13724)
Negates the `:hover` state on touch devices, in order to prevent it from lingering after the user taps on a button toggle. Also fixes the native tap highlight showing up if the user taps on a disabled toggle group.
2018-11-02 17:24:36 -07:00
Kristiyan Kostadinov 8fad5d180f fix(tabs): mat-align-tabs not working on mat-tab-nav-bar (#13818)
For consistency with `mat-tab-group`, adds support for `mat-align-tabs` to `mat-tab-nav-bar`.

Fixes #13798.
2018-11-02 17:24:20 -07:00
Kristiyan Kostadinov 1fb1c5550e fix(menu): unable to swap menu panel after first open (#13819)
Fixes the menu trigger being locked into the first menu panel that is passed in, after it has been opened at least once.

Relates to #13812.
2018-11-02 17:24:04 -07:00
Joey Perrott 077f68e3cb fix(breakpoints): set max-widths for breakpoints to non-integers to handle subpixel queries (#13828) 2018-11-02 17:23:47 -07:00
Joey Perrott 670360516f fix(snackbar): override min-width of snackbar on mobile (#13880) 2018-11-02 17:22:38 -07:00
Kristiyan Kostadinov 436809cba0 fix(drag-drop): multiple parallel drag sequences when dragging nested drag items (#13820)
Currently if we have a `cdkDrag` nested inside another `cdkDrag`, the user can start dragging both of the items at the same time if they starting dragging from the appropriate area. These change stop event propagation so only one drag sequence can be started from a certain area at a time.
2018-11-02 17:22:17 -07:00
Kristiyan Kostadinov 89701ef2ae fix(drag-drop): incorrectly laying out items with different height or margins (#13849)
Currently the `CdkDropList` makes some assumptions about the items not having a margin between each other. It also won't lay out and animate items with varying heights, in some cases. The following changes rework the directive to allow it to handle both varying heights and different margins.

Fixes #13483.
2018-11-02 17:21:41 -07:00
Kristiyan Kostadinov 50f999b5e5 fix(snack-bar): set appropriate role based on passed in politeness (#13864)
Currently we always have a `role` of `alert` on the snack bar container which has an implicit politeness of `assertive` and which can override the message announced by the live announcer. These changes set the role to `status` if it's set to `polite` or remove the role completely if the politeness is turned off.

Fixes #13493.
2018-11-02 17:21:24 -07:00
Kristiyan Kostadinov 99d2512888 fix(portal): use portal's ComponentFactoryResolver in portal outlet directive (#13886)
Follow-up from #12677 where we missed to add the new functionality to the `CdkPortalOutlet` directive.

Fixes #9712.
2018-11-02 17:21:09 -07:00
Kristiyan Kostadinov 8922100495 fix(virtual-scroll): not removing view from container if it's outside the template cache (#13916)
Currently when detaching a view, we check whether it would fit in the cache, and if it doesn't, we destroy it. Since we destroy the view on it's own, the `ViewContainerRef` still has a reference to it, which means that we'll trigger change detection on it the next time the data changes. These changes switch to destroying the view through the view container.

Fixes #13901.
2018-11-02 17:20:51 -07:00
Paul Gschwendtner 2a9e132e4f build: switch away missing deps from @npm namespace (#13949) 2018-11-02 15:29:33 -07:00
Paul Gschwendtner c64503e0bf build: build material-examples with bazel (#13932)
This includes a `genrule` to create the generated `ExampleModule`
2018-11-02 14:38:34 -07:00
Greg Magolan 150c964c32 fix: bazel support for downstream apps (#13836) 2018-11-02 14:33:07 -07:00
Paul Gschwendtner eb59e56eaf fix(ng-update): do not throw if typescript version is outdated (#13927)
* Running `ng update` doesn't necessarily mean that the `typescript` version is updated automatically. Therefore we need to avoid using the `isStringLiteralLike` method which has been added in `2.8`. Note that this does not mean that we cannot _compile_ with a higher TypeScript version.. we should just ensure that _at runtime_, imports from `typescript` are working for TypeScript@2.x.x
2018-11-01 16:59:22 -07:00
Paul Gschwendtner ece6b2d6be fix(ng-update): do not fail if @schematics/angular version is outdated (#13929)
* Currently the `ng update` could potentially fail if the version of `@schematics/angular` is outdated on the given project. We should avoid to depend on `@schematics/angular` for the `ng-update` schematic.
* No longer fails if the workspace configuration could not be found. It's very uncommon that someone tries to update a CLI project that still uses `.angular-cli.json` because:

     1) The CLI version for the project doesn't support `ng update` with custom downstream migrations
     2) In case the developer runs a different CLI version for _that_ outdated project, the CLI technically does run for an invalid project.

Even though, this is a rare case, it doesn't hurt not throwing if the workspace configuration couldn't be found when running `ng update`.
2018-11-01 16:57:53 -07:00
Paul Gschwendtner 44a86005db build: material-moment-adapter should not depend on all material packages (#13931)
Since we have the ability to only build specific parts of Material with Bazel, the `material-moment-adapter` should just depend on it's *actual*  dependencies and not on the _whole set_ of Material entry-points.
2018-11-01 16:52:28 -07:00
Kristiyan Kostadinov a619ddccc8 build(drag-drop): clean up bazel config (#13934)
Removes the `sass_binary` since we don't ship CSS with `cdk/drag-drop` anymore and removes `cdk/overlay` from the dependencies.
2018-11-01 16:21:57 -07:00
Paul Gschwendtner 4b431fec21 fix(button): stroked button crops applied badges (#13912)
Since we hide overflow for stroked buttons in order to properly handle the `border-radius` for the child ripple container and focus overlay, badges which are applied on the button will be clipped.

In order to fix this bug, we just remove the `overflow: hidden` and go back to the initial implemenation where the border radius is inherited for the child elements. Just to keep https://github.com/angular/material2/issues/13738 resolved, we ensure that the child elements fully cover the actual button element for the _correct_ border radius.

Fixes #13909
2018-11-01 14:42:52 -07:00
Adrien Crivelli 94e4a27db1 docs(virtual-scroll): fix minor typo (#13892) 2018-10-31 11:38:43 -07:00
Paul Gschwendtner 052673c62b chore(schematics): improve messages for ng-add (#13840)
In order to make the "failure" or "warning" messages with `ng-add` look more friendly and structured, we manually wrap the messages. Additionally `chalk` is being used more often in order to make it clear if something failed/passed or is just a warning.
2018-10-31 09:51:52 -07:00
Jeremy Elbourn f2c7205d66 Revert "fix: workaround for es2015 inheritance not always working (#13834)" (#13868)
This reverts commit a22a9fa3d7.

This change caused a new issue where Closure Compiler was not able to do
dead-code elimination due to the function call with unknown side
effects.
2018-10-30 12:55:38 -07:00
Kristiyan Kostadinov d0f0f0afd1 build: add tooling to avoid jit issues with empty NgModule definitions (#13843)
* Expands the decorator validation rule to allow us to run a regex against all the arguments of a decorator. This allows us to guard against cases like #13792.
* Fixes a similar issue as #13792 in the `LayoutModule` which was caught after the new changes to the rule.
2018-10-30 11:34:51 -07:00
Kristiyan Kostadinov a9e550e5bf fix(stepper): don't handle enter/space when modifier key is pressed (#13827)
Along the same lines as #13790. Doesn't handle the prevent the default action for ENTER and SPACE when one of the modifier keys is pressed, in order to avoid interefering with the native keyboard shortcuts.
2018-10-29 08:14:08 -07:00
Paul Gschwendtner a22a9fa3d7 fix: workaround for es2015 inheritance not always working (#13834)
Since the inherited `ctorParameters` can be either a static array or a function that returns an array, the workaround that landed with e9103a6 does not fully solve the issue, which developers experience when using Angular Material with ES2015. This improves the workaround and ensures that it handles both scenarios properly.

Also the workaround has been moved into a separate function in order to remove code duplication. This should also make it easier to delete the workaround if we need to.
2018-10-29 08:13:49 -07:00
Kristiyan Kostadinov 0589881a3b fix(list): remove disabled selection list hover feedback on mobile (#13850)
Currently on mobile devices we counteract the `:hover` styling by removing the background, however this ends up removing the disabled styling.
2018-10-29 08:13:29 -07:00