Commit Graph

1294 Commits

Author SHA1 Message Date
Paul Gschwendtner 8d9bbbf008 fix(checkbox): margin for empty checkboxes incorrectly added (#4730)
* fix(checkbox): margin for empty checkboxes incorrectly added

With #2121 the margin will be removed for checkboxes that don't have any label set.

A problem is that the Checkbox uses the OnPush change detection strategy and therefore the checkbox is not able to detect any delayed / async label change.

This means that checkboxes that set their label from an async binding will not have any margin until the users clicks on the checkbox.

Using the `cdkObserveContent` seems to be an elegant approach when using the OnPush strategy.

The `:empty` CSS selector would be more elegant but it's very sensitive about whitespaces and therefore it doesn't work properly.

Fixes #4720

* Updates
2017-06-08 14:32:35 -07:00
Paul Gschwendtner 436858efb2 fix(slide-toggle): switch typography level to body-1 (#5000)
* With the typography the slide-toggle was switched accidentally from a font-weight of 500 to a font-weight of 400.
* The slide-toggle label should not be treated as a button because it's basically a normal body text.
2017-06-08 14:32:15 -07:00
Ģirts Ernstsons aafa6b0d04 fix(autocomplete example): regex metacharacter escape (#4921)
* fix(autocopmplete): regex metacharacter escape

autocomplete material example fails if regex metacharacter (ie *) is provided. Fixed by adding escapeSpecChars function

* Update autocomplete-overview-example.ts

* fix(autocopmplete): regex replaced with includes

* Extra newline removed

* Update autocomplete-overview-example.ts
2017-06-08 11:25:06 -07:00
Paul Gschwendtner a5b014f771 chore(checkbox): remove unused test variable (#5012)
* Removes a unused variable from a checkbox test component.
2017-06-08 11:24:40 -07:00
Paul Gschwendtner facb8ccd1b build: include roboto font in e2e-app (#5028)
* Includes the Roboto font in the e2e-app. This should help comparing font-weights of typography for the screendiffs.
2017-06-08 11:24:31 -07:00
Kristiyan Kostadinov d09aa896b6 feat(select): add md-optgroup component (#4432)
* feat(select): add md-optgroup component

Adds the `md-optgroup` component, which can be used to group options inside of `md-select`, in a similar way to the native `optgroup`.

Fixes #3182.

* fix: address feedback

* fix: address feedback
2017-06-08 11:22:46 -07:00
Rob Jacobs d0d79fd93a feat(placeholder): add global placeholder options (#4681) (#4681)
* Implement global placeholder options so the
default float option can be set to something
other than 'auto'

Fixes #4311
2017-06-08 11:22:31 -07:00
Kristiyan Kostadinov 66629cf1ed feat(dialog): allow disableClose option to be updated (#4964)
* Exposes the disableClose option via the `MdDialogRef` and allows for it to be updated.
* Makes the `containerInstance` private to `MdDialogRef` since it doesn't make sense for it to be public anymore.
* Completes the `backdropClick` observable once the associated `overlayRef` is destroyed. This avoids having to unsubscribe manually or having to use `Observable.first`.

Fixes #3938.
2017-06-08 11:22:03 -07:00
Jeremy Elbourn 657f0e829e fix(icon): remove automatic aria labelling and add a11y guidance (#4665)
The automatic application of aria-label for md-icon, in hindsight, was
not a great idea. Neither the ligature string nor the SVG filename are
likely to be meaningful descriptions. Even in cases where they *are*,
the icon may be used in such a way that the application of a label is
still the wrong thing. On top of that, adding `role="img"` is usually
not the right approach for an icon, as that role typically refers to
*content* images, rather than icons that are part of the UI.

Ultimately, it is up to the application developer to add the appropriate
meaning for icons based on how they're used. To this end, we add
guidance to the documentation for what to do in different situations.
2017-06-08 11:21:52 -07:00
Andrew Seguin 536add3652 fix(data-table): Add export to the UserProperties (#5018) 2017-06-07 20:27:17 -07:00
Andrew Seguin e81619bed0 feat(data-table): re-render when columns change (#4830)
* feat(data-table): re-render when columns change

* minor changes

* comment stuff

* add column type

* explicit testing:

* fix observable type

* sync

* remove fdescribe

* fix test
2017-06-07 16:56:29 -07:00
Joey Perrott cac7610460 feat(expansion-panel): introduce expansion panel" 2017-06-07 16:54:31 -07:00
Paul Gschwendtner 37df5d3c15 refactor(button): use color binding for fab button color (#4694)
* refactor(button): use color binding for fab button color

* No longer creates extra CSS selectors to set the default color for round buttons to `accent`.

* Server-side rendering improvements

* Use forwardRef for constructor DI
2017-06-07 16:53:40 -07:00
mmalerba 3bc82f6dc8 fix(sidenav): don't restore focus if focus isn't inside sidenav (#4578)
* fix(sidenav): don't restore focus if focus isn't inside sidenav

* inject document
2017-06-07 14:58:17 -07:00
Youssef Taghlabi b489fdd885 chore(focus-origin-monitor): remove unused method parameter (#4636)
* Remove the unused `renderer` parameter in the `focusvia` method.
2017-06-07 14:58:03 -07:00
Kristiyan Kostadinov 4658c85771 feat(dialog): allow setting the layout direction (#4778)
Allows users to set the layout direction of a dialog.
2017-06-07 14:57:39 -07:00
Jeremy Elbourn 4fcab5752a docs(card): add guidance for a11y (#4781) 2017-06-07 14:57:27 -07:00
Aleš 223a27bd5c feat(autocomplete): extend selector to match textarea (#4945) 2017-06-07 14:57:17 -07:00
Kristiyan Kostadinov 638a34a877 fix(select): panel in multiple mode not overlapping trigger (#4952)
* Fixes the select panel in multiple mode not overlapping the trigger completely.
* Reformats the select.html to make it a little more manageable.

Fixes #4943.
2017-06-07 14:57:00 -07:00
Paul Gschwendtner 3779395ef6 refactor: replace color getters and setters with mixin (#4974)
* refactor: replace color getters and setters with mixin

* Replaces the color getters and setters with a Mixin function (similar as for the disabled property)
* This should reduce payload and also should make it way easier to maintain the color functionality.

* Address comments

* Updates
2017-06-07 14:56:28 -07:00
Joey Perrott 28d2ddd098 fix(portal): detect changes for portal hostview while before attaching. (#4370) 2017-06-07 11:00:07 -07:00
Paul Gschwendtner 1f93cdb247 chore(data-table): hide stability warning in jasmine (#4840)
* No longer shows the data-table stability warning inside of jasmine tests.
2017-06-06 15:17:53 -07:00
Kristiyan Kostadinov e98372e461 fix(overlay): emit attach and detach at appropriate times (#4880)
* Emits the `attachments` when everything has been attached.
* Emits the `detachments` when everything has been detached.
* Completes the `attachments` observable before the `detachments`.

Fixes #4871.
2017-06-06 14:15:43 -07:00
Kristiyan Kostadinov c8b1e200ee fix(dialog): blurry content and slow animation in IE (#4809)
Fixes the dialog content being blurry and the animation being really janky in IE11.
2017-06-05 15:44:16 -07:00
Paul Gschwendtner 3e993b651c fix(dialog): invalid text color in dark themes (#4849)
In dark themes the dialog container will have a dark background and the text should therefore have a light text color.

Currently the text color is still dark on a dark background which causes the dialog to look bad in dark themes.
2017-06-05 15:43:56 -07:00
Kristiyan Kostadinov 6aaddbf526 fix(input): IE always adding scrollbar to textarea (#4917)
* Fixes IE always adding a scrollbar to Material textareas, even if they don't overflow.
* Removes a double theme toggle from the demo app. It was probably the result of a bad merge.
2017-06-05 15:43:28 -07:00
Kristiyan Kostadinov 7f298f72ab fix(datepicker): switch to typography api (#4950)
Switches the datepicker's typography styles to use the typography API and moves them into the theme file.
2017-06-05 15:43:20 -07:00
Kristiyan Kostadinov 22f0ea0393 fix(datepicker): inert calendar arrow direction in rtl (#4960)
Fixes the calendar arrows pointing in the wrong direction in RTL.
2017-06-05 15:43:12 -07:00
Paul Gschwendtner ed72d94e96 build: ambiguous imports in IDEs (#4958)
Recently the Universal App has been added to the repository. The universal-app contains a script that runs inside of Node and therefore uses Node APIs.

The global tsconfig file that is used to provide proper autocompletion in IDEs includes every TS file inside of `src/` and therefore the `prerender.ts` file is also included.

This is problematic because now the NodeJS @types are being loaded as well and ambiguous imports appear in editors. Causing for example `setTimeout` calls to return a `Timer` instead of a number (error in your IDEs)
2017-06-05 14:50:07 -07:00
Kristiyan Kostadinov 22746ced69 fix(tooltip): not rendering in IE and Edge without web animations polyfill (#4937)
Fixes the tooltip not being rendered in IE and Edge, if there is no web animations polyfill. When we don't animate the element, for some reason IE and Edge decide not to lay it out at all. We force the element to be shown by using the `zoom: 1` hack.

Fixes #4935.
2017-06-05 14:46:22 -07:00
Kristiyan Kostadinov a240c9ccef fix(list): set aria attributes to md-divider (#4925)
Sets the appropriate role and `aria-orientation` on the `md-divider` element.
2017-06-05 14:46:12 -07:00
Paul Gschwendtner 1055720fe1 feat(input): autosize sets default amount of rows to one (#4906)
* The autosize directive now sets the rows property of the textarea to one by default.
* This is necessary because browsers by default set the rows property to two and therefore setting the minRows and maxRows binding to something below two doesn't work.

Fixes #4852
2017-06-05 14:46:02 -07:00
Andrew Seguin 41c43cc3ec fix(navbar): update ink bar when links change (#4897)
* fix(navbar): update ink bar when links change

* remove add link

* fix test

* change strategy - use mutation observer

* cleanup
2017-06-05 14:45:19 -07:00
Kristiyan Kostadinov 2e3910c86c fix(select): unable to programmatically select falsy values (#4868)
Fixes not being able to set falsy values progammatically in `md-select`.

Fixes #4854.
2017-06-05 14:44:49 -07:00
Kristiyan Kostadinov ce9d253331 fix(focus-trap): focus initial element when zone stabilizes (#4867)
* fix(focus-trap): focus initial element when zone stabilizes

* Focuses the first element when the zone stabilizes, instead of when the microtask queue is empty. This avoids issues where the element might be focused before Angular is done doing change detection.
* Only runs the `onStable` callback if the zone is unstable.
* Avoids an extra DOM lookup by combining a couple of selectors.

Fixes #4864.

* chore: switch to for loop
2017-06-05 14:44:42 -07:00
Kristiyan Kostadinov 7e912705c3 feat(overlay): more flexible scroll strategy API and ability to define/override custom strategies (#4855)
* feat(overlay): more flexible scroll strategy API and ability to define/override custom strategies

* Refactors the overlay setup to allow for scroll strategies to be passed in by name, instead of by instance.
* Handles the scroll strategy dependency injection automatically.
* Adds an API for registering custom scroll strategies and overriding the existing ones.
* Adds a second parameter to the `attach` method, allowing for a config object to be passed in.
* Throws an error if there's an attempt to attach a scroll strategy multiple times. This is mostly a sanity check to ensure that we don't cache the scroll strategy instances.

Relates to #4093.

* refactor: switch to new approach without ReflectiveInjector

* refactor: switch to better approach

* refactor: switch to even simpler approach

* chore: address feedback
2017-06-05 14:44:34 -07:00
Kristiyan Kostadinov 70b31f177a fix(autocomplete): throw better error when autocomplete doesn't have a panel (#4851)
Adds a more informative error if the user tries to open an autocomplete that doesn't exist or hasn't been defined yet by the `@ViewChild` query.

Fixes #4844.
2017-06-05 14:44:25 -07:00
Elia Palme 9d4a34accd fix(dialog): add flex wrap to style (#4846)
Adding flex-wrap: wrap; would decrease the likelihood of hiding buttons on small screens.
2017-06-05 14:44:16 -07:00
Kristiyan Kostadinov 157bda19e2 fix(datepicker): focus trap not working inside popup (#4839)
Fixes focus trapping not working inside the datepicker in popup mode due to the A11yModule not being imported.

Relates to #4804.
2017-06-05 14:43:08 -07:00
Kristiyan Kostadinov cedf2197dd fix(dialog): componentInstance unavailable in afterClose (#4827)
Fixes the `dialogRef.componentInstance` being cleaned up too early, causing it to be unavailable in the `afterClosed` callback.

Fixes #4815.
2017-06-05 14:42:54 -07:00
Andrew Seguin 181820e8eb feat(data-table): use iterate differ to optimize rendering (#4823)
* feat(data-table): use iterate differ to optimize rendering

* minor changes

* let -> const

* add generic to cdktable

* readonly
2017-06-05 14:42:47 -07:00
Paul Gschwendtner a9ad62d0fa fix(slide-toggle) disabled state from a FormControl not updating (#4797)
When setting the disabled state of a slide-toggle using the FormControl's `enable()` and `disable()` methods the slide-toggle's view won't be updated properly.

Fixes #4774
2017-06-05 14:42:37 -07:00
mmalerba 16b65e8d24 fix(input): make input spacing match spec (#4788)
* make input match mocks better, WIP

still WIP

placeholder working, still WIP

fixed main styles, now just themes...

themes working again

icon button support

* add select to baseline demo

* fix IE bug

* address comments

* address comments

* remove forced font-size

* integrate typography system

* switch font-size to inherit

* fix non-floating placeholders
2017-06-02 14:14:25 -07:00
Paul Gschwendtner 970847e4a4 build: fix universal prerendering task (#4931)
Fixes the Universal Prerendering task by using the same workaround as for the AOT job (building sources in the output directory already)

Building the sources in the output directory (similar as for the AOT task) is theonly known workaround for https://github.com/angular/angular/issues/12249
2017-06-02 09:39:49 -07:00
Kristiyan Kostadinov 615fa2a3fc fix(button,tabs): potential clash with typography styles (#4915)
Since the buttons and tabs depend on their `line-height` for sizing, we shouldn't override it via the typography styles. This fix removes the `line-height` that is set from the typography, in order to prevent potential issues.
2017-06-01 13:26:52 -07:00
Jeremy Elbourn f169152638 build: add missing bits for material-examples package (#4887)
Adds:
* Missing `flatModuleId` from the ngc options
* Makes templateUrl and styleUrls for example components match material
components.
2017-05-31 16:17:50 -07:00
Kristiyan Kostadinov e650b049af feat: integrate typography api into all components (#4375)
* feat: integrate typography api into all components

* Includes the base typography styles for headers, body text etc.
* Adds mixins for typography next to the theme and moves out all of the component typography styles into them.
* Switches all the hardcoded typography values to use the ones from the spec.
* Adjusts the letter spacing on some of the headers to align them to the spec.

**Note:** While going through the components, I haven't checked whether the styles are accurate in regards to the spec. I've left notes in the places where the font sizes weren't a part of the pre-defined ones.

* fix: address feedback

* fix: explicit toolbar header typography

* chore: add comments about letter spacing

* fix: theme error

* chore: re-add $mat-font-family

* fix: missing typography for mat-icon-button
2017-05-31 13:53:20 -07:00
Kristiyan Kostadinov 0c03946ac6 fix(input): set aria-invalid on mdInput element (#4757)
* Sets the `aria-invalid` attribute on the `mdInput` node, depending on whether it is invalid.
* Moves the `_isErrorState` logic to the input child to avoid a circular dependency.
2017-05-30 17:00:20 -07:00
Jeremy Elbourn be8d3b23d2 fix(datepicker): generate api docs (#4756)
This also adds handling for directives with generics, which we have not had before. Dgeni treats this as "members" and they need to be disambiguated from properties.
2017-05-30 17:00:05 -07:00
Kara b3b6fdad1a fix(autocomplete): show hover style on selected options (#4724) 2017-05-30 16:59:53 -07:00