Commit Graph

3560 Commits

Author SHA1 Message Date
Joey Perrott 6575ade81a chore: use computed radius size for checkbox ripple during 2018 material spec update transition (#13038) 2018-09-11 12:33:28 -07:00
Kristiyan Kostadinov 948e563ed9 fix(ripple): ripples not being cleared if touch sequence is canceled (#12936)
If the browser's touch sequence gets canceled by something, the `touchend` event won't fire which means that the ripples won't be cleared from the ripple container. These changes add an extra handler to make sure that they are.
2018-09-11 10:58:50 -07:00
Kristiyan Kostadinov cfb83a0ebc fix(grid-list): better handling of negative columns (#12939)
Currently if, by any chance, assigns a negative number to the `cols` of a grid list, they'll get a cryptic error like `Invalid array length`, because down-the-line we use that number to create an array. These changes ensure that the value is always a positive number.
2018-09-11 10:58:08 -07:00
Daniel Schuba e24f24a6a0 fix(tree): theming nested notes (#12938)
changes nested-tree-nodes to be styled the same as tree-nodes
2018-09-11 10:57:46 -07:00
Paul Gschwendtner 722dfb3633 fix(tooltip): not showing up on touch devices (#12940)
* Currently if someone long presses a tooltip trigger on a touch device, the tooltip will not show up. This is because the `longpress` event does reset immediately and not fire if a `slide` event is being recognized. The `slide` event most likely fires most of the time because of a `threshold = 0` (for smooth sliding)

Fixes #12917
2018-09-11 10:45:03 -07:00
Paul Gschwendtner 0389d12309 fix(tooltip): text fields not editable if tooltip is applied in safari (#12959)
Applying `matTooltip` directly on a `<input>` or `<textarea>` element causes HammerJS to add a `user-select: none` inline style. This prevents users from typing into the text fields in Safari.

Since the `user-select: none` is not needed for the `longpress` event, we can just **always reset** the `user-select` if a tooltip is applied on a text-field because we want to avoid such issues.

Fixes #12953
2018-09-11 10:43:40 -07:00
Kristiyan Kostadinov be510149e8 refactor(list): remove redundant focus logic (#12965)
Currently both the regular list and the selection list have focus and blur handlers whose job it is to toggle a focused class. This is redundant, because the same can be achieved with a `:focus` selector, without having to go through change detection.
2018-09-11 10:43:22 -07:00
Kristiyan Kostadinov cbfbaded96 fix(form-field): don't set up mutation observer on non-outline appearances (#12976)
Currently we use a `MutationObserver` to update the label gap when the label content changes. This is unnecessary on any appearance aside from `outline`.
2018-09-11 10:42:59 -07:00
Kristiyan Kostadinov 62136c16c4 refactor(focus-monitor): accept ElementRef in focusVia (#12978)
Looks like something that was missed in #12712. For consistency with `monitor` and `stopMonitoring`, accepts an `ElementRef` in `focusVia`.
2018-09-11 10:42:19 -07:00
Kristiyan Kostadinov f39e0911ca fix(portal): remove dependency on deprecated parentInjector (#12986)
The `ViewContainerRef.parentInjector` property is deprecated. These changes remove our dependency on it.
2018-09-11 10:41:40 -07:00
vivian-hu 69fa76236a feat(list): add new '<mat-action-list>' (#12415)
An action-list is a list where each list item is a native '<button>' element, meant to be used in cases where each list item has a single action with no sub-action, navigation or selection.
2018-09-11 10:41:20 -07:00
Kristiyan Kostadinov 8ee5fb66c6 fix(drag-drop): text selection not disabled on safari if user drags out of the viewport (#12864)
Currently we disable text selection on all draggable elements and their handles, however that doesn't seem to be enough on Safari, because moving your cursor towards the end of the viewport causes the entire body text to be marked. These changes also disable text marking on the entire body while the user is dragging.
2018-09-11 10:40:20 -07:00
Kristiyan Kostadinov ec0de52b68 fix(drag-drop): dragging class not being applied on drop container (#12921)
Fixes the `cdk-drop-dragging` class not being applied to the drop container after 5d0ec23b1d. The introduction of the `onStable` call caused the event to be bound outside the `NgZone`.
2018-09-11 10:39:42 -07:00
Kristiyan Kostadinov fb7bf900c0 fix(drag-drop): DOM element not being returned to initial container on drop (#12948)
Currently when an item is dropped, we return it to its initial position in the DOM so Angular can take over and re-render it if necessary, however this breaks down if the item is the only child of the drop container and we weren't able to grab a reference element that we can use to restore its position. These changes address the issue by using the initial drop container as a reference.

Fixes #12944.
2018-09-11 10:39:27 -07:00
Kristiyan Kostadinov d1c27ae1c4 refactor(drag-drop): expose delta in moved event (#12952)
Since we now have the delta of the movement easily available, we can expose it via the `cdkDragMoved` event.
2018-09-11 10:39:11 -07:00
Kristiyan Kostadinov 951add921d fix(drag-drop): incorrectly picking up transitions on non-transform properties (#12966)
Currently we wait for the transition on a dropped item to end before completing the sequence or timing it out. Our current approach works for a single property transition (e.g. `transition: transform 300ms`), but will break down for multi-property ones (`transition: opacity 300ms, transform: 600ms`) or ones that don't target `transform` at all. The following changes rework the logic to handle the extra cases.
2018-09-11 10:38:51 -07:00
Jeremy Elbourn 5718975b57 Revert "feat(button): align with 2018 material design spec (#12537)" (#13080)
This reverts commit 4ddbde93ea.
2018-09-11 10:31:05 -07:00
Joey Perrott 1908b3e8eb chore(dialog): update dialog animations for 2018 material spec update (#13059) 2018-09-11 10:21:38 -07:00
Paul Gschwendtner 05563d95f8 chore(schematics): add missing constructor checks data (#13052)
Adds the constructor signature check data for https://github.com/angular/material2/pull/11706 which is already published in `7.0.0-beta.0`.
2018-09-10 16:03:24 -07:00
Ben Lesh 0a25fca2d7 fix(typings): update typings to support more strict typings in RxJS 6.3.2 (#12979) 2018-09-10 13:23:27 -07:00
Paul Gschwendtner 9886b1b198 refactor(schematics): avoid typescript version conflicts (#12989)
The Angular Material schematics parse TypeScript sources files and pass the AST to the `@schematics/angular` package which defined an explicit dependency on `typescript`. Since we currently just always require the flattened `typescript` dependency (`node_modules/typescript`), there could be either no TypeScript version or a different TypeScript version that causes the AST operations of the `@schematics/angular` utility functions to not work properly (e.g. different `SyntaxKind` ids)

We should primarily try to load the same TypeScript version that has been shipped with the `@schematics/angular`. If that one couldn't be found, fall back to the top level `typescript` version.

Includes workaround for Bazel ts module resolution
2018-09-10 07:20:16 -07:00
Paul Gschwendtner c54c89769c refactor(schematics): constructor checks should respect assignability (#13050)
Reworks the constructor signature check rule to take advantage of the TypeScript pre-emit diagnostics. This is necessary because there is no public API to check the relation of two types (e.g. checking if the super-call arguments are assignable to the actual constructor parameter signature)

This now means that the constructor checks respect type assignability (e.g. it won't throw incorrectly if a developer does something like:

```ts
class ExtendedPlatform extends Platform {}

new NativeDateAdapter(a, new ExtendedPlatform(...))`
```
2018-09-10 07:19:26 -07:00
Kristiyan Kostadinov 7c4fa66d53 build: don't allow trailing whitespace in CSS files (#13014)
Similar to TS files, doesn't allow trailing whitespace in CSS.
2018-09-06 15:14:43 -07:00
Paul Gschwendtner 098f25a2fd refactor(schematics): enable strict null checks (#12983)
* Enables strict null checks for the schematics and fixes a few potential unsafe accesses.
* Supports specifying a project for `ng-add`.
2018-09-06 13:53:21 -07:00
Paul Gschwendtner e124418d07 refactor(ng-update): better check for updated constructor signatures (#12970)
Instead of just checking the length of the constructor arguments, we now check the types of the constructor or super call. This means that we can *way* better report invalid signatures for constructor changes like for the `MatCalendar` (https://github.com/angular/material2/pull/9775). Just relying on the length of arguments means that *order*  is being ignored.

This also makes maintaining the constructor signature changes easier (there are a lot of instances for V7).
2018-09-05 16:31:24 -07:00
Kristiyan Kostadinov 86be1dcb19 docs(overlay): add note about pre-built styles (#12993)
Adds a note about the pre-built overlay styles since we have not mention of them anywhere else in the docs.

Fixes #8717.
2018-09-05 13:39:26 -07:00
Paul Gschwendtner 5d9ab9eeb2 refactor(schematics): re-add disabled aliases (#12982)
* Due to a devkit issue, we temporarily had to remove the schematic aliases in order to be able to run the tests. Since this issue has been fixed a long time ago, we can re-add the aliases.
* Also adds more aliases to other schematics for consistency.
* Locks the devkit and schematics version because there is an ongoing type definition bug within the devkit (https://unpkg.com/@angular-devkit/core@0.7.5/src/virtual-fs/host/test.d.ts).
2018-09-05 10:39:14 -07:00
Paul Gschwendtner fe642115de fix(ng-update): do not throw if imports without named bindings are used (#12866) (#12984)
Currently if someone uses a namespace import or an import without named bindings in an Angular application, the `ng-update` schematics from Angular Material will fail due to missing safety checks before casting.

Fixes #11571
2018-09-05 10:29:55 -07:00
Kristiyan Kostadinov 4ddbde93ea feat(button): align with 2018 material design spec (#12537)
Aligns the button component with the latest Material design spec.
2018-09-05 08:03:11 -07:00
Paul Gschwendtner cfb4f58eda refactor(schematics): split up upgrade data for target version (#12951) 2018-09-04 11:54:08 -07:00
Paul Gschwendtner be691cb869 build: suppress bazel schematic tsconfig warnings (#12957)
* Since the schematics are also built through Gulp, we need to specify the `exclude` option in the `tsconfig`. Bazel warns because those options will be ignored. Similarly to all other tsconfig files, we should suppress the warnings.
2018-09-04 11:49:52 -07:00
Paul Gschwendtner b884295641 refactor(schematics): resolve rule directories automatically (#12958)
* Instead of hard-coding the rule directories and potentially forgetting about adding directories if new rules have been created, we automatically resolve the directories through `glob`. Glob is already used in various schematic parts, and can be used here as well.
2018-09-04 11:48:54 -07:00
Kristiyan Kostadinov 42f98a596f docs(drag-drop): text blending in with card on dark theme (#12922)
Fixes the text inside the drag&drop boxes blending in on a dark theme.
2018-08-31 08:25:30 -07:00
Paul Gschwendtner fbee9c7d8a refactor(schematics): table schematic not inlining style file (#12905)
This is not a bug fix because the styleext file is basically empty. But in case we add styles to the styleext template file, we should automatically properly inline the styles if `--inlineStyle` is specified.
2018-08-30 18:21:24 -07:00
Kristiyan Kostadinov c812268ac3 feat(menu): align with 2018 material design spec (#12331)
Aligns the menu component with the latest version of the Material design spec. Includes making `overlapTrigger` false by default.
2018-08-30 17:28:20 -07:00
Kristiyan Kostadinov b2d74e163e refactor(drag-drop): remove usages of findIndex (#12913)
Removes uses of `Array.prototype.findIndex` from `cdk/drag-drop`.
2018-08-30 14:34:05 -07:00
Kristiyan Kostadinov 86ed40c871 chore: fix compilation error in form field (#12907)
Fixes a compilation error in the `matNativeControl` directive.
2018-08-30 12:00:11 -07:00
Kristiyan Kostadinov ac8ed31d36 fix(expansion-panel): elevation transition not working (#12860)
Fixes the elevation transition being applied to the expansion panel and then being overridden immediately by the margin transition.
2018-08-30 07:07:13 -07:00
Kristiyan Kostadinov 7bc8670d3f fix(selection-list): proper styling not being applied when using mat-list-icon (#12879)
Fixes the correct class not being applied to the `mat-list-option`, if it's using `mat-list-icon` which leads to the spacing not being correct. For reference: https://stackblitz.com/edit/angular-9tnpjv.
2018-08-30 07:06:35 -07:00
Kristiyan Kostadinov 548d2b7c04 fix(datepicker): able to open from readonly input using keyboard control (#12880)
Fixes users being able to open a datepicker through a `readonly` input by using the alt + down arrow key combination.
2018-08-30 07:03:36 -07:00
Kristiyan Kostadinov 5d0ec23b1d feat(drag-drop): add the ability to set an alternate root element (#12895)
Adds the `cdkDragRootElement` input which allows consumers to pass in a selector that will be used to determine which elements is going to become draggable, starting from the `cdkDrag` element and going up the DOM.
2018-08-30 07:03:14 -07:00
vivian-hu 4e419855ad feat(form-field): support native select element (#12707) 2018-08-30 07:02:48 -07:00
Paul Gschwendtner 8087ccb0b2 refactor(schematics): add entry point for v7 upgrade (#12884)
* Refactors the update schematics to support running `ng update` for V7 of Angular Material. Note that the actual upgrade data and general version distinction is not implemented yet. This is an initial commit that should allow the data distinction in future changes.
2018-08-29 15:16:19 -07:00
Paul Gschwendtner 74a3179565 chore(ripple): fake mousedown test not running (#12865)
* With 4639a874c7 a new test has been introduced. Due to a wrong syntax the test does not run properly.
2018-08-29 14:01:58 -07:00
Paul Gschwendtner 8831a7aabb feat(ng-add): respect project default inlineStyle, inlineTemplate and spec option value (#12888)
If developers create a new Angular CLI project, options like `--skipTests`, `--inlineTemplate` or `--inlineStyle` can be specified. These options will be stored in the workspace config file and will be respected if someone generates another component on the existing project.

Since we technically also generate components, we should respect the default option value for those options if _not_ explicitly specified.

Closes #11874
2018-08-29 14:00:57 -07:00
Kristiyan Kostadinov e4ca3cfaad test(grid-list): avoid recompiling all fixtures for each test (#12896)
Reworks the grid list to avoid having to recompile all the other fixture for each test. This shaves of a few seconds of the test runs. Also does some minor cleanup.
2018-08-29 14:00:19 -07:00
Kristiyan Kostadinov db1d51f9a3 fix(badge): apply view encapsulation attributes on badge element (#12870)
Since we create the badge content element dynamically, the view encapsulation attributes won't be applied. These changes use the renderer to create the element, which will respect view encapsulation.
2018-08-29 10:15:18 -07:00
mmalerba 0d406b3f26 fix(virtual-scroll): emit on viewChange inside the NgZone (#12873) 2018-08-29 10:15:04 -07:00
Jeremy Elbourn 515912b23f fix: explictly declare types for mixin base classes (#12876)
As of TypeScript 2.9, tsc will inline imports for inferred types with
the `import("...")` syntax. However, this inlining happens *after*
`paths` are resolved. This means that in places where we import from
`@angular/material/core` in source end up having relative paths (e.g.
`../core/common-behaviors/index`) in the generated d.ts files. These
relative import paths become incorrect when moved into our package
structure, breaking downstream apps.
2018-08-29 10:14:37 -07:00
Kristiyan Kostadinov 73d54a428b chore: fix selection lint warning (#12872)
Fixes a lint warning that got in through a long-running PR.
2018-08-28 13:37:06 -07:00