Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit eb956f1

Browse files
authored
Update all components (#129)
* Add Material Icon. * Deprecate `GlyphComponent` in favor of `MaterialIconComponent`. * Update dependency to angular: 4.0.0-alpha+1. * Material Checkbox: Add mixin for checkbox with no left margin. * Material Chips: Add ability to specify background color for left icon. * Material Expansionpanel: Add mixin to allow changes to panels without affecting nested panels. * Material Input: * Add upper and lower bounds validators. * Re-calculate text length when custom character counter is set. * Prevent mirror-text overflow in multiline material input. * Remove unnecessary selector argument from mixins. * Material Popup: Only set content removed if the popup is still not visible when the timer is finished. * Material Radio: * Add mixin for radio button with no left margin. * Fix mixin to respect disabled status when a theme is applied. * Material Select: * Fix `MaterialSelectItemComponent` to not cache the label. * Add input to material-dropdown-select to define custom a renderer for group labels. * Fix checkbox display handling and label padding in dropdown. * Material Toggle: Set the attribute instead of the property to fix a bug with incorrect type, and not setting the right property. * Material Tree: * Add ability to preserve expansion state. * Fix indentation of first child group. * Add input `showDisabledCheckboxes`. * Add a max-height mixin. * Reorder List: * Update to recommended syntax for ngFor. * Migrate from ManagedZone to NgZone. * Scorecard: * Replace deprecated Glyph with Material Icon. * Invoke inherited click handler from derived click handler. * Avoid adding placeholder for deferred content if the element is detached. * Selection Models: * Add deselect all option. * Add a limited filtering model. * Fix `selectAll` to only trigger a selection change event for the values that were added. * Add comparator as optional param to tree selection options for custom sorting. * Updates to use metadata inheritance. * Migrate away from comment-style generic syntax. * Migrate stylesheet combinators `/deep/` and `>>>` to `::ng-deep`. * Migrate away from use of angular's `@View`. * Update animations to new Material specs. * Update documentation. * Remove unused library statements.
1 parent 47fec8f commit eb956f1

File tree

170 files changed

+1329
-614
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+1329
-614
lines changed

CHANGELOG.md

Lines changed: 68 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,69 @@
1-
## 0.6.0-alpha
2-
3-
This code is considered production quality, but depends on angular:
4-
4.0.0-alpha. The alpha tag represents the evolving nature of the AngularDart
5-
api, not code quality (4.0.0-alpha is used in production Google apps).
6-
1+
## 0.6.0-alpha+1
2+
3+
> NOTE: This code is considered production quality, but depends on angular:
4+
> 4.0.0-alpha+1. The alpha tag represents the evolving nature of the AngularDart
5+
> api, not code quality (4.0.0-alpha is used in production Google apps).
6+
7+
* Add Material Icon.
8+
* Deprecate `GlyphComponent` in favor of `MaterialIconComponent`.
9+
* Update dependency to angular: 4.0.0-alpha+1.
10+
* Material Checkbox: Add mixin for checkbox with no left margin.
11+
* Material Chips: Add ability to specify background color for left icon.
12+
* Material Expansionpanel: Add mixin to allow changes to panels without
13+
affecting nested panels.
14+
* Material Input:
15+
* Add upper and lower bounds validators.
16+
* Re-calculate text length when custom character counter is set.
17+
* Prevent mirror-text overflow in multiline material input.
18+
* Remove unnecessary selector argument from mixins.
19+
* Material Popup: Only set content removed if the popup is still not visible
20+
when the timer is finished.
21+
* Material Radio:
22+
* Add mixin for radio button with no left margin.
23+
* Fix mixin to respect disabled status when a theme is applied.
24+
* Material Select:
25+
* Fix `MaterialSelectItemComponent` to not cache the label.
26+
* Add input to material-dropdown-select to define custom a renderer for group
27+
labels.
28+
* Fix checkbox display handling and label padding in dropdown.
29+
* Material Toggle: Set the attribute instead of the property to fix a bug with
30+
incorrect type, and not setting the right property.
31+
* Material Tree:
32+
* Add ability to preserve expansion state.
33+
* Fix indentation of first child group.
34+
* Add input `showDisabledCheckboxes`.
35+
* Add a max-height mixin.
36+
* Reorder List:
37+
* Update to recommended syntax for ngFor.
38+
* Migrate from ManagedZone to NgZone.
39+
* Scorecard:
40+
* Replace deprecated Glyph with Material Icon.
41+
* Invoke inherited click handler from derived click handler.
42+
* Avoid adding placeholder for deferred content if the element is detached.
43+
* Selection Models:
44+
* Add deselect all option.
45+
* Add a limited filtering model.
46+
* Fix `selectAll` to only trigger a selection change event for the values
47+
that were added.
48+
* Add comparator as optional param to tree selection options for custom
49+
sorting.
50+
* Updates to use metadata inheritance.
51+
* Migrate away from comment-style generic syntax.
52+
* Migrate stylesheet combinators `/deep/` and `>>>` to `::ng-deep`.
53+
* Migrate away from use of angular's `@View`.
54+
* Update animations to new Material specs.
55+
* Update documentation.
56+
* Remove unused library statements.
57+
58+
## 0.6.0-alpha
59+
60+
> NOTE: This code is considered production quality, but depends on angular:
61+
> 4.0.0-alpha. The alpha tag represents the evolving nature of the AngularDart
62+
> api, not code quality (4.0.0-alpha is used in production Google apps).
63+
764
* Update dependency to `angular: 4.0.0-alpha`.
865
* Update SDK dependencies.
9-
66+
1067
### Known Issues
1168
* Warnings are present when building with dart2js. Specifically:
1269
_Method type variables are treated as `dynamic` in `as` expressions._
@@ -18,8 +75,8 @@
1875
> corresponding .css files in a separate process. We are working on a solution
1976
> to include CSS generation from SASS files during the build process.
2077
21-
* Add SASS files.
22-
* Rename .analysis_options -> analysis_options.yaml
78+
* Add SASS files.
79+
* Rename .analysis_options -> analysis_options.yaml
2380

2481
## 0.5.3
2582

@@ -37,8 +94,8 @@
3794
## 0.5.2
3895

3996
* Material Progress: Cleanup animations on destroy to prevent memory leaks.
40-
* Material Select:
41-
* Support deselect item in Material dropdown select with single selection
97+
* Material Select:
98+
* Support deselect item in Material dropdown select with single selection
4299
model.
43100
* Unified template files (deleted material_select_dropdown_item.html).
44101
* Add support for `Selectable` `SelectionOptions`.

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
## Preview Release
22

3-
These are the AngularDart components that Google uses to build the sophisticated,
4-
mission-critical apps that bring in much of Google’s revenue.
3+
These are the AngularDart components that Google uses to build the
4+
sophisticated, mission-critical apps that bring in much of Google’s revenue.
55

6-
This productive and stable set of widgets, contributed to by hundreds of Googlers,
7-
make debugging and deploying your app easier. Strict latency and testing policies
8-
make these widgets an excellent fit for AngularDart projects.
6+
This productive and stable set of widgets, contributed to by hundreds of
7+
Googlers, make debugging and deploying your app easier. Strict latency and
8+
testing policies make these widgets an excellent fit for AngularDart projects.
99

1010
Only a small fragment of all the components is available right now. We want
1111
developers to be able to use the package as soon as possible.
1212

13-
*`<glyph>`
13+
*`<material-icon>`
1414
*`<material-button>`
1515
*`<material-fab>`
1616
*`<material-checkbox>`
@@ -65,6 +65,6 @@ by copying them and importing
6565
in your SASS files.
6666

6767

68-
> NOTE: These .scss files are not used during the build step, but we are planning
69-
> to add this support. See
68+
> NOTE: These .scss files are not used during the build step, but we are
69+
> planning to add this support. See
7070
> [issue #45](https://github.com/dart-lang/angular_components/issues/45).

lib/src/all_components.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export 'components/focus/focus_item.dart';
1616
export 'components/focus/focus_list.dart';
1717
export 'components/focus/focus_trap.dart';
1818
export 'components/focus/keyboard_only_focus_indicator.dart';
19+
export 'components/forms/error_renderer.dart';
1920
export 'components/glyph/glyph.dart';
2021
export 'components/material_button/material_button.dart';
2122
export 'components/material_button/material_button_base.dart';
@@ -28,6 +29,7 @@ export 'components/material_dialog/material_dialog.dart';
2829
export 'components/material_expansionpanel/material_expansionpanel.dart';
2930
export 'components/material_expansionpanel/material_expansionpanel_auto_dismiss.dart';
3031
export 'components/material_expansionpanel/material_expansionpanel_set.dart';
32+
export 'components/material_icon/material_icon.dart';
3133
export 'components/material_input/base_material_input.dart';
3234
export 'components/material_input/deferred_validator.dart';
3335
export 'components/material_input/input_wrapper.dart';
@@ -91,4 +93,5 @@ export 'model/selection/src/interfaces/selectable.dart';
9193
export 'model/selection/string_selection_options.dart';
9294
export 'model/ui/display_name.dart';
9395
export 'model/ui/has_renderer.dart';
96+
export 'model/ui/icon.dart';
9497
export 'utils/async/async.dart';

lib/src/components/button_decorator/_mixins.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313

1414
@mixin disabled-cursor($cursor-style) {
15-
/deep/ [buttonDecorator].is-disabled {
15+
::ng-deep [buttonDecorator].is-disabled {
1616
cursor: $cursor-style;
1717
}
1818
}

lib/src/components/button_decorator/button_decorator.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import '../mixins/has_tab_index.dart';
2626
@Directive(selector: '[buttonDecorator]', host: const {
2727
'(click)': r'handleClick($event)',
2828
'(keypress)': r'handleKeyPress($event)',
29-
'[tabindex]': 'tabIndex',
3029
'role': 'button',
3130
'[attr.aria-disabled]': 'disabledStr',
3231
'[class.is-disabled]': 'disabled',

lib/src/components/content/deferred_content.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import 'dart:html';
66

77
import 'package:angular/angular.dart';
8-
98
import '../../utils/angular/properties/properties.dart';
109
import '../../utils/disposer/disposer.dart';
10+
1111
import 'deferred_content_aware.dart';
1212

1313
/// When put on an element B, this directive creates B each time the nearest
@@ -73,7 +73,7 @@ class DeferredContentDirective implements OnDestroy {
7373
if (_preserveDimensions) {
7474
// Add the placeholder so the parent's size doesn't change.
7575
var container = _viewContainer.element?.nativeElement;
76-
if (container != null) {
76+
if (container?.parentNode != null) {
7777
container.parentNode.insertBefore(_placeholder, container);
7878
}
7979
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
/// A function which takes in an error map, and returns another modified errors
6+
/// map.
7+
typedef Map<String, dynamic> ErrorFn(Map<String, dynamic> errors);
8+
9+
/// Convience function for replacing multiple errors for Components using the
10+
/// errorRenderer pattern.
11+
ErrorFn replaceErrors(Map<String, String> overrides) =>
12+
(errors) => _replaceErrorsImpl(overrides, errors);
13+
14+
Map<String, dynamic> _replaceErrorsImpl(
15+
Map<String, String> overrides, Map<String, dynamic> errors) {
16+
final result = new Map<String, dynamic>.from(errors);
17+
for (var error in errors.keys) {
18+
if (overrides.containsKey(error)) result[error] = overrides[error];
19+
}
20+
return result;
21+
}

lib/src/components/glyph/_mixins.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/// be more specific to override the default.
2121
/// Note: The should be scoped to a shimmed selector outside.
2222
@mixin glyph-size($size) {
23-
/deep/ i {
23+
::ng-deep i {
2424
font-size: $size;
2525
height: 1em;
2626
line-height: 1em;
@@ -40,7 +40,7 @@
4040
/// Note: The selector must select to the `glyph` element.
4141
/// @Deprecated. Use glyph-size mixin instead.
4242
@mixin glyph-icon-size($selector, $value) {
43-
/deep/ #{$selector} i {
43+
::ng-deep #{$selector} i {
4444
font-size: $value;
4545
height: 1em;
4646
line-height: 1em;

lib/src/components/glyph/glyph.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const List<String> _flippedIcons = const [
4949
/// the icon, corresponding to 12px, 13px, 16px, 18px, and 20px, respectively.
5050
/// If no size is specified, the default of 24px is used.
5151
/// - `flip` -- Whether the icon should be flipped for RTL languages.
52+
@Deprecated('Use MaterialIconComponent instead')
5253
@Component(
5354
selector: 'glyph',
5455
templateUrl: 'glyph.html',
@@ -58,7 +59,7 @@ const List<String> _flippedIcons = const [
5859
class GlyphComponent {
5960
static const String _materialIconsExtended = 'material-icons-extended';
6061

61-
/// `Icon` model (/model/ui/icon.dart) or Icon identifier - see
62+
/// `Icon` model (lib/src/model/ui/icon.dart) or Icon identifier - see
6263
/// [https://www.google.com/design/icons/](https://goo.gl/YKrYlu) for
6364
/// available icons.
6465
@Input()

lib/src/components/glyph/glyph.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*/
1313

1414
@import 'lib/src/css/material/material';
15-
@import 'compass/css3/flexbox';
1615
@import 'mixins';
1716

1817
$x-small: $mat-grid-type * 3; // 12px

0 commit comments

Comments
 (0)