Commit Graph

3479 Commits

Author SHA1 Message Date
Kristiyan Kostadinov cc24766188 refactor(table): improved unit test speed (#10517)
Reduces the runtime of the table tests to about 1/3 of the one from master by not recompiling all the individual test cases for each test.
2018-03-22 14:21:12 -07:00
Jeremy Elbourn 9091b21f6f build(bazel): add rule for cdk npm package (#10509)
* build(bazel): add rule for cdk npm package

* Bump to rc0, remove moment from cdk rollup config

* Remove TODOs
2018-03-22 14:21:04 -07:00
Tobias Schweizer 4e1bb265e3 feat(datepicker): Add Custom Header to DatePicker (#9639)
* feature (add custom header to mat-calendar)

TODO: the custom header should be passed from datepicker

* refactor (define custom header component)

* refactor (remove useless text)

* refactor (pass custom header component type as input)

* refactor (add header as component portal)

* refactor (custom header as component portal)

- TODO: solve problem with directive cdkPortalOutlet in calendar.html

* refactor (switch for custom header component)

* refactor (define entry components)

* fix (correct entry point)

* refactor (custom header component): add test function to custom header component

* refactor (some code formatting)

* refactor (set indentation to two spaces)

* refactor (formatting)

* refactor (custom header for mat-calendar): renaming and code improvements

* refactor (calendarHeaderComponent) rename input of MatDatepicker

* refactor (calendarHeaderComponent): make a demo for custom header

* refactor (calendar header): make calendar header portal variable public

* refactor (calendar header): formatting

* tests (MatCalendar): fix tests

* tests (calendar): fix import issue

* tests (MatCalendar): remove unused import

* tests (MatCalendar): import MatDatepickerModule without redeclaration

* tests (MatCalendar): fix imports

* refactor (MatCalendar): default header comes with empty template

* refactor (MatCalendar): remove useless newline

* feature (MatCalendarHeader): move header in own template

* refactor (MatCalendar): some code reformatting

* fix (MatCalendar): add missin change detection for MatCalendarHeader

* refactor (MatCalendar): fix indentation

* fix (MatCalendar): clean stream up after component destruction

* fix (MatCalendar): fix change detection for MatCalendarHeader

* refactor (MatCalendarHeader): add dateadapter to constructor

* refactor (MatCalendarHeader): move methods to calendar header (ongoing)

* refactor (MatCalendarHeader): move label getter methods to MatCalendarHeader

* refactor (MatCalendarHeader): move MatCalendarHeader component in a separate file

* tests (MatCalendarHeader): move header related tests from MatCalendar (ongoing)

* refactor (MatCalendar): linting

* refactor (MatCalendarHeader): move MatCalendarHeader component back to calendar.ts (to avoid circular deps)

* refactor (MatCalendarHeader): move header related methods

* feature (MatCalendarHeader): add sample custom header controls to demo page

* refactor (MatCalendarHeader): fix some styling issues

* refactor (MatCalendarHeader): fix indentation

* refactor (MatCalendarHeader): make calendar private for custom header

* refactor (MatCalendarHeader): use type parameter for header (generics)

* refactor (MatCalendarHeader): make template file for custom header on demo page

* refactor (MatCalendarHeader): separate section own demo page

* refactor (MatCalendarHeader): style custom header

* refactor (MatCalendarHeader): fix styling issue

* refactor (package-lock.json): revert changes to version on master branch

* refactor (package-lock.json): revert to commit 6f63fd283e

* fix (MatCalendarHeader): correct forward reference to MatCalendar

* Add `stateChanges` to `MatCalendar`

* fix nits
2018-03-22 09:59:29 -07:00
Jeremy Elbourn f7b5d34449 feat(material): use scoped injectables (#10507)
* feat(material): use scoped injectables

* Remove module imports that were only for providers
2018-03-21 13:26:42 -07:00
Joey Perrott f88224315b chore(testing): use karma spec reporter to show karma results instead of built in dots (#10500) 2018-03-20 21:11:24 -07:00
Kristiyan Kostadinov 69217c4e43 refactor(autocomplete): disable flexible positioning (#10469)
Removes the flexible positioning, which is on by default, from the autocomplete, because we don't want the panel to be flexible when it hits the edge of the viewport.
2018-03-20 14:48:04 -07:00
Kristiyan Kostadinov eefa9c4a64 fix(overlay): incorrect bounding box styles if position is exactly zero (#10470)
Handles the edge case where the bounding box styles won't be set correctly, causing the overlay to jump to a wrong position, if either of its values works out to exactly zero.
2018-03-20 14:47:53 -07:00
Andrew Seguin e0321db13d fix(table): move padding from rows to cells (#10499) 2018-03-20 14:47:28 -07:00
Kristiyan Kostadinov 1dd8a276fc fix(overlay): incorrect bounding box bottom position when page is scrolled and content is flowing upwards (#10463)
* Fixes the bounding box position and height being calculated incorrectly when the overlay's content is flowing upwards and the page has been scrolled down.
* Fixes the "when scrolled" tests not scrolling the page down.
2018-03-20 14:41:34 -07:00
Kristiyan Kostadinov cdb6e408d8 fix(overlay): clear last calculated position when new set of positions is provided (#10462)
In the `FlexibleConnectedPositionStrategy` once we apply a position, we save a reference to it in order to be able to reuse it if the consumer wants to recalculate the overlay dimensions, however that cached position isn't being cleared. This means that if consumer were to provide a new set of positions and tried to re-apply the last calculated position, the cached position may no longer be a part of the list of preferred positions. These changes will clear the last position if it's not a part of the preferred positions anymore.

Relates to #10457.
2018-03-20 14:41:24 -07:00
Kristiyan Kostadinov 89ea4853e8 feat(tabs): support stretched tabs in mat-tab-nav-bar (#10368)
Adds support for stretched tabs in the tab nav bar. Also removes a duplicate selector.

Fixes #8871.
2018-03-19 13:20:08 -07:00
Paul Gschwendtner c3a8d0cab1 fix(button): theme font color being overwritten (#9771)
* Currently buttons with a background color (e.g. flat buttons, raised buttons, fabs) receive a font color by the theme. This font color is accidentally being overwritten by the normal button CSS that sets the `color` for every button to `inherit`. This can cause the text to be invisible in a dark theme. From now on, those buttons will no longer inherit the font color accidentally.

* Normal buttons, stroked buttons and icon buttons will still inherit the font color, because it's wrong to assume that those buttons are always placed inside of containers with the default background color. Otherwise those buttons would be invisible in some containers with a different background color (e.g. in a  themed toolbar).

* Removes the SSR check for `hasHostAttributes`. This method is essential for the color of the buttons, and needs to run inside of SSR. (now possible with Domino anyway)

* Cleans up the button theme while being at it.

Fixes #4614. Fixes #9231. Fixes #9634
2018-03-19 13:19:54 -07:00
Kristiyan Kostadinov 3c8a498422 feat(chips): allow for separatorKeyCodes to be configured globally (#10264)
Adds the `MAT_CHIPS_DEFAULT_OPTIONS` injection token that allows consumers to override `separatorKeyCodes`, as well as any other options that we decide to add in the future, for the entire module.

Fixes #10256.
2018-03-19 13:19:45 -07:00
Kristiyan Kostadinov 9a1ae9c5fb refactor(typography): remove deprecated variable (#10430)
Removes a typography variable that's been deprecated for a while.

BREAKING CHANGES:
* The `$mat-font-family` variable has been removed. Use the Material typography or redeclare in your project `$mat-font-family: Roboto, 'Helvetica Neue', sans-serif;`.
2018-03-19 13:19:36 -07:00
CaerusKaru c807ff3380 test(layout): remove async wrapper to prevent hiding test failure (#10305)
* With the async call around the checks in the layout test, the
  results of the subscribe are never actually checked
2018-03-19 13:19:28 -07:00
Kristiyan Kostadinov 8daa76020d refactor(input): run autofill monitor outside the NgZone (#10367)
Switches the autofill monitor to run outside the `NgZone`, because it toggles classes on the element directly and it has the potential of being fired very often if the user has other animations on the element. Also adds a description to an output that is part of the public API.
2018-03-19 13:19:21 -07:00
Kristiyan Kostadinov c14cf7caae fix(badge): invalid style declaration and too broad transition (#10433)
* Fixes the badge transition not working due to the `transition` declaration being invalid (no units on the duration).
* Fixes the badge animating all properties rather than only the `transform`.
* Avoids blurry text in IE.
2018-03-19 13:19:13 -07:00
Kristiyan Kostadinov 5e5aae3b2e refactor(text-field): make constructor parameters required (#10431)
Makes the `_ngZone` parameter in `CdkTextareaAutosize` a required one. This was intended as a deletion target, but we hadn't set up deletion targets when it was added.

BREAKING CHANGES:
* The `_ngZone` parameter in the `CdkTextareaAutosize` constructor is now required.
2018-03-19 13:18:49 -07:00
Kristiyan Kostadinov 8bc7ee9ce5 refactor(datepicker): remove 6.0.0 deletion targets (#10413)
Removes the deletion targets for 6.0.0 from `material/datepicker`.

BREAKING CHANGES:
* `selectedChanged` has been removed. Use `dateChange` or `dateInput` from `MatDatepickerInput`.
2018-03-19 13:18:40 -07:00
Kristiyan Kostadinov f0bf6e7b28 refactor(button-toggle): remove 6.0.0 deletion targets (#10416)
Removes the deletion targets for 6.0.0 from the `material/button-toggle` entry point.

BREAKING CHANGES:
* `selected` is no longer an input and is now readonly.
2018-03-19 13:18:31 -07:00
Jeremy Elbourn 6405da9b8e feat(cdk): switch injectables to new scope API (#10301)
* feat(cdk): switch injectables to new scope API

* Update rxjs version

* Update CDK to new API

* Fix TS 2.7 error.

* Update package lock
2018-03-19 11:44:04 -07:00
Kristiyan Kostadinov c28549d088 build: fix autocomplete test failures on ios (#10442)
Fixes a couple of positioning unit test failures on iOS Safari after the switch to the flexible connected position. The issue appears to be a combination of us stubbing out the `ScrollDispatcher` for all tests which means that if one test scrolls the window down, any subsequent tests won't pick up the scroll position correctly, as well as having a test that scrolls the page down, but doesn't reset it. These changes:

* Reset the position back to the top after the scrolling test is done.
* Rework the tests to only stub out the `ScrollDispatcher` in the two tests where it's relevant.
2018-03-16 08:58:42 -07:00
tinayuangao 5e5066ae1b docs(tree): add cdk tree examples to material-examples (#10426) 2018-03-15 14:22:46 -07:00
JJ Banda 997cae5d71 docs(divider): replace md class names with mat (#10436) 2018-03-15 09:10:43 -07:00
Pankaj Parkar b4b1745677 Changed directive name from MdAccordion to MatAccordion (#10434) 2018-03-15 09:10:12 -07:00
Johan CHOUQUET b0da9a6846 docs(cdk/scrolling): small fixes (#10432)
Re-wording of the 1st sentence in ###. I guess this is the correct meaning of what was wanted.
2018-03-15 09:09:52 -07:00
Kristiyan Kostadinov cd92571047 chore: fix aot check failure (#10429)
Fixes the aot CI check failing due to a faulty rebase.
2018-03-15 00:26:05 -07:00
Austin e3d2e14e8c Schematic fixes (#10388)
* fix(schematics): better formatting on index, insert body margin 0

* fix(schematics): fix wrong mode on init

* fix(schemtic): convert == to ===

* fix(schematic): fix check expression

* chore: pr feedback
2018-03-14 16:18:43 -07:00
Kristiyan Kostadinov 9f3bf274c4 refactor(snack-bar): remove overly broad animation variables (#10405)
Removes the `SHOW_ANIMATION` and `HIDE_ANIMATION` variables from the snack bar which were being exported all the way up to `@angular/material` and were implying that these are generic show and hide animations.

BREAKING CHANGES:
* `SHOW_ANIMATION` has been removed.
* `HIDE_ANIMATION` has been removed.
2018-03-14 16:15:15 -07:00
Kristiyan Kostadinov e8af5aed39 refactor(icon): remove 6.0.0 deletion targets (#10389)
Removes the `material/icon` deletion targets for 6.0.0.

BREAKING CHANGES:
* The `_document` parameter in the `MatIconRegistry` constructor is now required.
2018-03-14 16:14:49 -07:00
Kristiyan Kostadinov d8a365e2b8 refactor(list): remove 6.0.0 deletion targets (#10398)
Removes the 6.0.0 deletion targets from `material/list`.

BREAKING CHANGES:
* `selectionChange` on the `MatListOption`, which was deprecated in 5.0.0 has been removed. Use `selectionChange` on the `MatSelectionList` instead.
* `MatListOptionChange` which was deprecated in 5.0.0 has been removed.
2018-03-14 16:14:24 -07:00
Kristiyan Kostadinov 27e5f6e3bc feat(overlay): add support for flexible connected positioning (#9153)
* Adds the `FlexibleConnectedPositionStrategy` that builds on top of the `ConnectedPositionStrategy` adds the following:
  * The ability to have overlays with flexible sizing.
  * Being able to push overlays into the viewport if they don't fit.
  * Having a margin between the overlay and the viewport edge.
  * Being able to assign weights to the overlay positions.
* Refactors the `ConnectedPositionStrategy` to use the `FlexibleConnectedPositionStrategy` in order to avoid breaking API changes.
* Switches all of the components to the new position strategy.
* Adds an API to the `OverlayRef` that allows for the consumer to wrap the pane in a div. This is a common requirement between the `GlobalPositionStrategy` and the `FlexibleConnectedPositionStrategy`, and it's easier to keep track of the elements when the attaching and detaching is done in the `OverlayRef`.

Fixes #6534.
Fixes #2725.
Fixes #5267.
2018-03-14 16:13:59 -07:00
tinayuangao 57a5db6549 docs(tree): add cdk trees examples in demo app (#10408) 2018-03-14 12:47:37 -07:00
Kristiyan Kostadinov 57e081e90f chore: fix error in slider docs (#10409)
Fixes a couple of instances that were missed when removing the slider deletion targets.
2018-03-14 12:47:27 -07:00
tinayuangao 9aa8792af7 chore: change log for 5.2.4 (#10289) 2018-03-14 12:47:14 -07:00
Austin c490ac1482 docs(demo): add chips autocomplete example (#7830)
* docs(demo): add chips autocomplete example

* chore(nit): fix line break

* chore(nit): fix name

* chore(nit): updates per feedback

* chore: nit

* chore: pr feedback
2018-03-13 15:35:37 -07:00
Kristiyan Kostadinov 224e4eaa1b docs(stepper): use mat-icon for custom icons example (#10284)
Switches the custom icon example in the stepper to use `mat-icon` instead of the non-existing `custom-icon`. The idea with `custom-icon` was to show that consumers aren't limited to using `mat-icon`, however somebody that is copying from the examples would get a compilation error.

Fixes #10283.
2018-03-13 15:33:42 -07:00
Kristiyan Kostadinov c8cc414f7e refactor(slider): remove 6.0.0 deletion targets (#10373)
Removes the 6.0.0 deletion targets from the `material/slider` entry point.

BREAKING CHANGES:
* `thumb-label` which was deprecated in 5.0.0 has been removed. Use `thumbLabel` instead.
* `tick-interval` which was deprecated in 5.0.0 has been removed. Use `tickInterval` instead.
2018-03-13 15:32:01 -07:00
Kristiyan Kostadinov 999cb576f4 refactor(tooltip): remove 6.0.0 deletion targets (#10344)
Removes the deletion targets for 6.0.0 from the `material/tooltip` entry point.

BREAKING CHANGES:
* `tooltip-position` which was deprecated in 5.0.0 has been removed. Use `matTooltipPosition` instead.
* The `_defaultOptions` parameter in the `MatTooltip` constructor is now required.
2018-03-13 15:31:41 -07:00
Kristiyan Kostadinov a403bacd81 feat(button-toggle): general component cleanup and support value input in multiple mode (#9191)
* Reworks the `MatButtonToggleGroup` component to remove the need for the `MatButtonToggleGroupMultiple` component and to avoid having to implement features in two places.
* Reworks the `MatButtonToggleGroup` to use the `SelectionModel` for managing its state.
* Switches all of the `async` button toggle tests to run in `fakeAsync`.

As a side-effect of the above-mentioned changes, the toggle group in multiple mode now supports the same inputs as the one in single-selection mode (`value` input/output, `name` input, `change` event etc.).

Note: this is along the same lines as #2773, however #2773 got left behind for too long and it would need a lot more work to fit in our current setup.

Fixes #9058.
2018-03-13 15:31:19 -07:00
Kristiyan Kostadinov 2b745c4424 refactor(select): remove 6.0.0 deletion targets (#10163)
Removes the targets marked for 6.0.0 deletion from the `material/select` entry point.

BREAKING CHANGES:
* `onOpen`, which was deprecated in 5.0.0, has been removed.
* `onClose`, which was deprecated in 5.0.0, has been removed.
* `change`, which was deprecated in 5.0.0, has been removed.
2018-03-13 15:30:47 -07:00
Kristiyan Kostadinov 1a8106de24 refactor(chips): remove 6.0.0 deletion targets (#10311)
Removes the deletion targets for 6.0.0 in the `material/chips` entry point.

BREAKING CHANGES:
* `remove` which was deprecated in 5.0.0 has been removed. Use `removed` instead.
* `destroy` which was deprecated in 5.0.0 has been removed. Use `destroyed` instead.
2018-03-13 09:01:35 -07:00
Kristiyan Kostadinov 88abd9edee refactor(portal): remove 6.0.0 deletion targets (#10257)
Removes the deletion targets for 6.0.0 in the `cdk/portal` entry point.

BREAKING CHANGES:
* The `portalHost` and `cdkPortalHost` inputs which were deprecated in 5.0.0 have been removed. Use `cdkPortalOutlet` instead.
2018-03-13 09:01:12 -07:00
Kristiyan Kostadinov c1d4666c47 refactor(sidenav): remove 6.0.0 deletion targets (#10279)
Removes the deletion targets for 6.0.0 from the `material/drawer` entry point.

BREAKING CHANGES:
* The `MatDrawerToggleResult` class has been turned into an type.
* The promise returned from `open`, `close` and `toggle` now resolves with the `MatDrawerToggleResult` type rather than the class.
* `align` which was deprecated in 5.0.0 has been removed. Use `position` instead.
* `open` which was deprecated in 5.0.0 has been removed. Use `opened` instead.
* `close` which was deprecated in 5.0.0 has been removed. Use `closed` instead.
* `align-changed` which was deprecated in 5.0.0 has been removed. Use `positionChanged`.
2018-03-13 09:00:50 -07:00
mmalerba f133da94d0 refactor(form-field): remove deprecated @Inputs (#10294)
small piece of #10164, split out for presubmit reasons

BREAKING CHANGES:
- dividerColor which was deprecated in 5.0.0 has been removed. Use color instead.
- floatPlaceholder which was deprecated in 5.0.0 has been removed. Use floatLabel instead.
2018-03-13 09:00:28 -07:00
mmalerba ced9c90bee feat(cdk-input): move input autofill and autosize utils into cdk (#9831)
* move autofill to cdk

* move textarea autosize into cdk

* fix bazel build

* rename input to text-field

* set resize back to none for autosize in input css

* fix tsconfig
2018-03-13 09:00:11 -07:00
Kristiyan Kostadinov 54252d5c1b refactor(overlay): remove 6.0.0 deletion targets (#10161)
Removes all of the APIs that were marked for deletion in 6.0.0 from the `cdk/overlay` entry point.

BREAKING CHANGES:
* `ConnectedOverlayDirective` which was deprecated in 5.0.0 has been removed. Use `CdkConnectedOverlay` instead.
* `OverlayOrigin` which was deprecated in 5.0.0 has been removed. Use `CdkOverlayOrigin` instead.
* `hasBackdrop` which was deprecated in 5.0.0 has been removed. Use `cdkConnectedOverlayHasBackdrop` instead.
* `open` which was deprecated in 5.0.0 has been removed. Use `cdkConnectedOverlayOpen` instead.
* `scrollStrategy` which was deprecated in 5.0.0 has been removed. Use `cdkConnectedOverlayScrollStrategy` instead.
* `backdropClass` which was deprecated in 5.0.0 has been removed. Use `cdkConnectedOverlayBackdropClass` instead.
* `minHeight` which was deprecated in 5.0.0 has been removed. Use `cdkConnectedOverlayMinHeight` instead.
* `minWidth` which was deprecated in 5.0.0 has been removed. Use `cdkConnectedOverlayMinWidth` instead.
* `height` which was deprecated in 5.0.0 has been removed. Use `cdkConnectedOverlayHeight` instead.
* `width` which was deprecated in 5.0.0 has been removed. Use `cdkConnectedOverlayWidth` instead.
* `offsetX` which was deprecated in 5.0.0 has been removed. Use `cdkConnectedOverlayOffsetX` instead.
* `offsetY` which was deprecated in 5.0.0 has been removed. Use `cdkConnectedOverlayOffsetY` instead.
* `positions` which was deprecated in 5.0.0 has been removed. Use `cdkConnectedOverlayPositions` instead.
* `origin` which was deprecated in 5.0.0 has been removed. Use `cdkConnectedOverlayOrigin` instead.
2018-03-12 15:40:41 -07:00
mmalerba 9403eada8c docs(form-field): add docs for appearance and mention that color type is supported (#10274)
* docs(form-field): add docs for `appearance`

* add color to supported input types
2018-03-12 15:40:20 -07:00
Kristiyan Kostadinov 4d05cdab6a refactor(tabs): remove 6.0.0 deletion targets (#10309)
Removes the deletion targets for 6.0.0 from the `material/tabs` entry point.

BREAKING CHANGES:
* `mat-dynamic-height` which was deprecated in 5.0.0 has been removed. Use `dynamicHeight` instead.
* `selectChange` which was deprecated in 5.0.0 has been removed. Use `selectedTabChange`.
2018-03-12 15:39:34 -07:00
Kristiyan Kostadinov 9f8eec1d2b refactor(checkbox): remove 6.0.0 deletion targets (#10342)
Removes the 6.0.0 deletion targets from the `material/checkbox` entry point.

BREAKING CHANGES:
* `align` which was deprecated in 5.0.0 has been removed. Use `labelPosition` instead. Note that the values are different.
2018-03-12 15:38:15 -07:00