Commit Graph

4709 Commits

Author SHA1 Message Date
Paul Gschwendtner ac3f8c4d1a feat(schematics): support for ng add (#13319)
* Introduces support for `ng add @angular/cdk`. Note that this currently just sets up the `package.json` but is necessary because otherwise the CLI will complain about the `ng-add` schematic not being available.
* Upgrades Bazel workspace rules in favor of removing Bazel manual-copying workarounds for the schematics. This also allows us to switch over to fine-grained dependencies in a follow-up (making it consistent with angular/angular).
* Use fine grained dependencies in schematics bazel rules
2018-09-27 07:44:49 -07:00
Kristiyan Kostadinov 4e475f91c7 build: consistent line breaks for css files (#12977)
Bumps to stylelint 9.5.0 and enables the line break checking for CSS files.
2018-09-27 07:18:18 -07:00
Kristiyan Kostadinov 210f3f9733 fix(grid-list): throw error if invalid value is assigned for rowHeight (#13254)
Currently if an invalid value is set to the grid list's `rowHeight`, we pass it on to the browser which may or may not handle it. These changes will throw an error if an invalid value is passed in, in order to make debugging these kinds of issues easier.

Fixes #13252.
2018-09-27 07:16:58 -07:00
Kristiyan Kostadinov f3bb0c7515 fix(drag-drop): emitting incorrect index for horizontal list in rtl (#13274)
Fixes the wrong index being emitted if the list is horizontal in an RTL layout.
2018-09-27 07:16:44 -07:00
Kristiyan Kostadinov 10e6502147 fix(form-field): always use native input value to determine whether control is empty (#13307)
Currently we use the input value accessor to figure out whether an input has a value. This doesn't handle the case with `matDatepicker` where we have a custom accessor whose model value may not change, even though the value in the input has changed. These changes switch to always using the value from the input element.

Fixes #13305.
2018-09-27 07:11:00 -07:00
Kristiyan Kostadinov 845388cdaa fix(checkbox): clear tabindex from host element (#13308)
Currently we forward the tabindex from the host element to the underlying input, however we leave behind the tabindex on the host, which means that consumers can end up with two layers of focusable elements.
2018-09-27 07:10:12 -07:00
Kristiyan Kostadinov 92a5f0e0f2 fix(form-field): native date/time input taller than text input (#13321)
Fixes the `type="date"` and `type="time"` inputs inside a form field making the field taller than a `type="input"`.

Fixes #13317.
2018-09-27 07:09:55 -07:00
Kristiyan Kostadinov 5c0a061b98 fix(radio): clear tabindex from host element (#13323)
Along the same lines as #13311 and #13308. Clears the `tabindex` from the radio button host element so we don't end up with multiple tab stops.
2018-09-27 07:09:31 -07:00
Kristiyan Kostadinov 877ef5d738 fix(list): set aria-multiselectable on selection list (#13325)
The `mat-selection-list` is set up as a listbox, however we never set `aria-multiselectable`, which means that the element is assumed to be single selection. These changes add `aria-multiselectable="true"` since selection lists are always multi-selection.
2018-09-27 07:09:11 -07:00
Kristiyan Kostadinov b5001f62c5 fix(tooltip): hiding and reopening for consecutive show calls (#13326)
If the tooltip's `show` method is called twice in a row (e.g. if the user hovered over the trigger and then focused it), it'll be closed and quickly reopened which is a little wasteful and looks glitchy. These changes switch it up so nothing is done, if the tooltip is open and there are no in-progress timeouts.
2018-09-27 07:08:56 -07:00
Jeremy Elbourn 39b5577c77 docs(icon): fix the bidi section interupting the a11y section (#13331) 2018-09-27 07:08:18 -07:00
Paul Gschwendtner 74fdedba56 build: ts compilation not reporting failures (#13312)
Currently if the TS compilation (either through `ngc` or `tsc`) fails, the gulp tasks won't report the error properly because the `reject()` call of the Promise does not have any error message. This causes compilation failures to be ignored. See: #13310
2018-09-26 11:25:42 -07:00
Kristiyan Kostadinov efd29932ca build: fix schematics TS errors (#13310)
Fixes some TS errors being logged out when building the schematics due to an outdated path in the `exclude` and an incorrect mapping in the `paths`.
2018-09-26 10:33:47 -07:00
Michael Prentice c454f7bb46 fix(schematics): sidenav toolbar should use default background (#13282) 2018-09-25 12:53:43 -07:00
Paul Gschwendtner 1afddfb71e feat(schematics): support for ng-update. (#13303)
Introduces support for `ng update` of `@angular/cdk`. The Angular Material update schematic will share code with the CDK schematics code.
2018-09-25 12:46:03 -07:00
Kristiyan Kostadinov d48b1baa3d feat(overlay): add option to automatically dispose on navigation (#12592)
Adds the opt-in `disposeOnNavigation` option which will dispose of an overlay when the user goes back/forward in history. This is something that we had in `MatDialog` and `MatBottomSheet` already, but it's a common-enough case, especially for global overlays, that it makes sense to have it in the CDK.

Fixes #12544.
2018-09-25 07:13:22 -07:00
Kristiyan Kostadinov 10b83534bb fix(form-field): incorrect arrow color for native select (#13046)
Currently the arrow for the form field's native select is done through a URL-encoded SVG set as a background image. This is inflexible, because it doesn't allow us to easily change its color, which means that we're locked into one color that doesn't account for dark themes, disabled state or whether the form field has validation errors. These changes rework the approach to use a pseudo element to render the arrow instead and to use the proper colors for the other states.
2018-09-25 07:10:44 -07:00
Kristiyan Kostadinov 18f46cfbbd refactor(grid-list): avoid recreating tile coordinator for every change detection (#13226)
Currently we recreate the `TileCoordinator` and throw out the old one on every change detection run. These changes reuse a single `TileCoordinator` and update it instead, which ends up shaving off a couple of milliseconds off each layout and reduces the amount of objects that need to be garbage collected.

**Note:** this is a breaking API change for the `TileCoordinator`, however it isn't exported through `material/grid-list`.
2018-09-25 07:08:28 -07:00
Kristiyan Kostadinov 0ac41a0896 fix(drag-drop): unable to return item to initial container within same drag sequence, if not connected to current drag container (#13247)
Handles the case where the consumer has two drop containers where only one is connected to the other. Currently once the user drags an element outside the first one, they won't be able to return it. With these changes we allow the element to be returned, as long as it hasn't been dropped into the new container.

Fixes #13246.
2018-09-25 07:08:11 -07:00
Kristiyan Kostadinov 40fb5cbe49 fix(stepper): vertical step header labels not centered on IE (#13262)
Fixes the step header circle labels not being completely centered in IE, because the step header only uses `max-height`.
2018-09-25 07:07:54 -07:00
Paul Gschwendtner 96e670f5a7 fix(snackbar): move elevation style to snackbar theme (#13273)
Fixes a remaining elevation style which is not created inside of the theme. (related to: https://github.com/angular/material2/pull/11344)
2018-09-25 07:07:29 -07:00
Kristiyan Kostadinov e1071f03fa fix(drag-drop): error on IE when customizing root element (#13279)
Fixes an error being thrown on IE when the root element is customized. The error comes from the fact that IE doesn't support `Element.prototype.matches`, but it does support `msMatchesSelector`.
2018-09-25 07:06:59 -07:00
Paul Gschwendtner 70dd33f143 chore(examples): disable user select in ripple-overview example (#13257)
* Since people often click on the ripple container of the example, we need to disable the user selection because otherwise the text will be accidentally selected.
* Disables the `no-prefixes` rule for example style files. The examples are not auto-prefixed and we don't want to show the `/** stylelint-disable` comments in the examples.
2018-09-25 07:06:45 -07:00
Michael Prentice 8d25fd1e54 fix(schematics): nav schematic generates TSLint errors (#13268)
Fix no-trailing-whitespace errors
2018-09-25 07:05:54 -07:00
Michael Prentice 543cb9ff0c fix(schematics): dashboard schematic fails parsing declaration in spec (#13269)
remove space between <% to make parsing work
remove space after %> to fix Dashboard Component to DashboardComponent
add blank lines at ends of html/css files
2018-09-25 07:05:27 -07:00
Michael Prentice d74e38c6fd fix(schematics): toolbar in nav w/o z-index causes issues with dashboard (#13270)
Without this z-index, scrolling a dashboard causes issues
- headers and background scroll under toolbar
- cards scroll over top of the toolbar
2018-09-25 07:04:58 -07:00
Paul Gschwendtner 93f832118e build: stylelint should not check node_modules (#13258)
Currently, if someone runs `gulp stylelint` and has the dashboard node modules installed, stylelint will lint the `tools/dashboard/node_modules/`. This causes stylelint to report thousands of failures due to some minified CSS files in the `node_modules/`.
2018-09-24 16:47:34 -07:00
Paul Gschwendtner 5f1f072d7e build: livereload not working for core/theming files (#13275)
Since most of the SCSS files inside of `core/theming` are not suffixed with `-theme.scss`, the livereload will rebuild the Material bundles, but not the theme SCSS files. This causes undesired slow-down and a non-working livereload.
2018-09-24 13:33:57 -07:00
Michael Prentice 0f818fd767 docs(schematics): clarify and refine the install schematic docs (#13267)
* Use ### header for consistency and to show up in table of contents
* Add CDK and Animations
* Add links to related guides
2018-09-24 13:31:22 -07:00
Michael Prentice 8558878274 fix(schematics): remove unnecessary semicolon in tree component (#13284)
add space after semicolon
2018-09-24 13:02:58 -07:00
Michael Prentice 0ccdfc8e5b fix(schematics): fix typo in table's datasource (#13283) 2018-09-24 13:02:33 -07:00
Paul Gschwendtner 21bc9b1c2d refactor(schematics): external resource nodes have incorrect offsets (#13289)
* Since TSLint is technically not supporting failures for source files which don't belong to the given rule walker, we need to create the `RuleFailure` objects ourself. Currently this results in using an inconsistent and unclear way of adding failures. With this change, the `ComponentWalker` includes utility functions which allow adding external rule failures consistently and easy.
* Fixes that the external resource `ts.SourceFile`'s have incorrect offsets for `getEnd()`, `.end`. This might cause unexpected results in the future.
* Fixes that `externalResource.getText()` is returning content that does not match with the original source file content.
2018-09-24 11:11:37 -07:00
Paul Gschwendtner f418f78978 refactor(schematics): do not rerun migrations for each test-case (#13256)
Instead of running the whole migration transformations for *each* test-case, we should just run the schematic once per target version. This speeds up the case testing of the schematics, and makes it easier to develop more.
2018-09-24 10:58:32 -07:00
Paul Gschwendtner 884762f872 fix(schematics): table schematic not expanding full width (#13234)
Currently the `table` schematic generates a `<table>` element that does not expand to the available width. By default, we should expand to the full width. Similarly to every table example on our docs. This makes it easier to play with the table and also gives people a better first glance of a table. Also currently it doesn't look that good (in perspective of layout) because the paginator expands to full width, but the table not.
2018-09-24 10:55:46 -07:00
Michael Prentice 267dd65e70 fix(schematics): addressForm: fix bad Validators definition and TSLint (#13285)
* Fix no-trailing-whitespace error
* Fix missing-whitespace errors
* Hook up form submission to the onSubmit() function
2018-09-24 10:48:34 -07:00
Paul Gschwendtner 1852563276 fix(tooltip): custom gesture config not set up (#12941)
* Currently if the `MatTooltip` directive is being used without any other modules that set up our "Material" hammer gesture config, the tooltip will use the default `platform-browser` gesture config and **never** fire the `(longpress)` event.

This could have been probably added to #12940, but I figured that out later and should be fine that way too.

Related to #12917
2018-09-23 09:13:28 -07:00
Kristiyan Kostadinov 0c5598cf2d feat(tabs): align with 2018 material design spec (#12605)
Aligns the tabs component with the latest Material design spec and adds the ability to align the tab labels in the middle or the end of the container.

![angular_material_-_google_chrome_2018-08-09_21-49-20](https://user-images.githubusercontent.com/4450522/43922278-7ddc9b7e-9c1e-11e8-9a16-86c4427efcf8.png)
![angular_material_-_google_chrome_2018-08-09_21-49-31](https://user-images.githubusercontent.com/4450522/43922279-7dfe19fc-9c1e-11e8-98a2-e4606a01a6ab.png)
2018-09-23 09:13:11 -07:00
Andrew Seguin 016ba5c936 fix(paginator): getNumberOfPages off by one (#10724)
Based off of #10720 (adding the demo page)

Changes the paginator's `getNumberOfPages` such that it returns the actual number of pages that are on the paginator rather than the max page index. This better matches the method name and description.

E.g. right now if you have one page, the function returns `0` rather than `1`, which is unexpected. 

Fixes #10699
2018-09-23 09:12:54 -07:00
Paul Gschwendtner 3bc52df940 refactor(schematics): remove ng-add skipPackageJson option (#13233)
* Removes the `skipPackageJson` option from the `ng-add` schematic. The option does not work properly because `ng add` by default saves the dependency to the `package.json` file. Also we have no way to disable saving when installing the CDK through the `NodePackageInstallTask`. See for reference: https://github.com/angular/angular-cli/commit/729d407fa1877d60d1e44efa3d657dc3ab4279e1
2018-09-21 10:21:17 -07:00
Kristiyan Kostadinov e0f3ae76a7 feat(overlay): add support for swappable position strategies (#12306)
Adds the ability for the consumer to swap out one position strategy for another, even while an overlay is open. This allows us to handle cases like having a menu that is a dropdown on desktop, but becomes a full-screen overlay on a mobile device.
2018-09-21 10:20:19 -07:00
Paul Gschwendtner a6c91bce3c update(ripple): remove deprecated speed factor option (#12258)
* update(ripple): remove deprecated speed factor option.

* Removes the deprecated `[matRippleSpeedFactor]` and global `baseSpeedFactor` option.
* Adds update rules that can automatically switch to the new API (as much as possible) and even calculate the new durations based on the previously specified speed factor.

BREAKING CHANGE: deprecated `[matRippleSpeedFactor]` and `baseSpeedFactor` for the ripples have been removed. Use the new animation config instead.

* Add test case; fix NodeJS version target circular dependency; Support for rule version constraints
2018-09-21 10:17:49 -07:00
Paolo Caleffi e4c6cc98bf Stepper alternative label (#12674)
Added the "alternative label" version, as by [(old) spec](https://material.io/archive/guidelines/components/steppers.html#steppers-types-of-steppers).

Tryed on Chrome, Firefox, Edge and IE11 and everything seems fine.
Added a paragraph in the stepper documentation and an example.

I'm not sure the code style is ok so if you have suggestions I'll be happy to clean it up a bit, just tell me how :)
2018-09-21 10:16:53 -07:00
Kristiyan Kostadinov d15431ba84 fix(common): account for async hammer loader when checking whether hammer is defined (#12933)
Since HammerJS can now be loaded asynchronously, we have to account for it in our sanity checks.
2018-09-21 10:16:38 -07:00
Kristiyan Kostadinov 38e492ff40 fix(form-field): native select outline not reset on firefox (#12967)
Currently we reset the focus outline for the `select` inside a form field for all browsers, however Firefox adds its own outline on top of it. These changes remove the extra Firefox outline since we have other focus indication already.

For reference:
![angular_material_-_mozilla_firefox_2018-09-03_22-08-46](https://user-images.githubusercontent.com/4450522/45000622-df53da00-afc6-11e8-8eb6-41716417025f.png)
2018-09-21 10:15:12 -07:00
vivian-hu 966cf5f089 fix(grid): fix mat-grid-tile position (#12980)
refresh gapStartIndex and gapEndIndex after move to a new row. Otherwise, they become out of sync and causes wrong calculation.
2018-09-21 10:07:30 -07:00
Kristiyan Kostadinov 590d2949d1 feat(tree): support units different than px for indentation (#12991)
Currently the tree assumes that the indentation level will always be in pixels, however this makes it hard to work with on responsive layouts. These changes add support for different CSS units.
2018-09-21 10:06:50 -07:00
Kristiyan Kostadinov 4e05745ed6 fix(snack-bar): button not centered inside snack bar on IE11 (#13062)
Fixes the snack bar's button appearing off-center on IE11. The flex styling that has been removed isn't necessary anymore after the recent design changes.
2018-09-21 10:06:06 -07:00
Kristiyan Kostadinov 1d8e9af7aa fix(overlay): connected overlay directive inputs not updating position strategy (#13066)
Ensures that all of the `@Input` changes get propagated to the underlying position strategy. Up until now we did it on a case-by-case basis which meant that a lot of them weren't, because we never added an extra call inside the `ngOnChanges`.
2018-09-21 10:05:04 -07:00
Kristiyan Kostadinov e7007a263d fix(grid-list): exception thrown when rowHeight is set before first change detection run (#13112)
Fixes the grid list throwing an error if the consumer sets the `rowHeight` programmatically before the first change detection run.

Fixes #13102.
2018-09-21 10:04:22 -07:00
pandrushka b62f64cd9f docs(autocomplete): fix missing example selector (#13244)
Option groups autocomplete example here(https://material.angular.io/components/autocomplete/overview) on stackblitz (https://stackblitz.com/angular/dkblpjpqklq?file=app%2Fautocomplete-optgroup-example.ts) is missing a selector
selector: 'autocomplete-optgroup-example',

@Component({ 
  selector: 'autocomplete-optgroup-example', 
  templateUrl: './autocomplete-optgroup-example.html', 
  styleUrls: ['./autocomplete-optgroup-example.css'], })
2018-09-21 10:03:36 -07:00