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

Commit aa4363b

Browse files
committed
Project import generated by Copybara.
PiperOrigin-RevId: 173174950
1 parent acadfd7 commit aa4363b

File tree

93 files changed

+664
-341
lines changed

Some content is hidden

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

93 files changed

+664
-341
lines changed

CHANGELOG.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,48 @@
1+
## 0.9.0-alpha
2+
3+
* Application Layout: Provide list-item changes as a mixin to be used in
4+
components that wrap drawer contents.
5+
* Material Auto Suggest Input: Protect against method being called after it is
6+
destroyed.
7+
* Material Button:
8+
* Update hover, focus, and disabled styles to be inline with Material Spec.
9+
* Update mixin names and fix to prevent styles leaking outside of the
10+
component.
11+
* Material Checkbox:
12+
* Implement onTouched logic.
13+
* Fix disabled state to match Material Spec which is a light grey not a
14+
certain opacity of the checkbox.
15+
* Material Dialog:
16+
* Remove `preserveWhitespace: false`.
17+
* Material Expansionpanel:
18+
* Smooth appearance/disappearance of expansion panel contents.
19+
* Add mixin to allow change the panel name min width.
20+
* Remove `preserveWhitespace: false`.
21+
* Material Input: Fix unexpected `)` in selector for
22+
`MaterialInputDefaultValueAccessor`.
23+
* Material Popup:
24+
* Listen to DomService.trackLayoutChange streams for overlayRepositionLoop
25+
popups.
26+
* Material Progress: Fall back to the non-optimized animation if the width is 0
27+
after view init.
28+
* Material Select:
29+
* Add `showButtonBorder` input to Material Dropdown Select component.
30+
* Cleanup unused styles.
31+
* Material Tabs: Increase space between labels.
32+
* Material Tooltip: Fix material-paper-tooltip content that are change detected
33+
and using deferred content by having the visible property be set in an async
34+
manner so that the value isn't added in the middle of a change detection
35+
loop.
36+
* Material Tree: Clear filter inside the popup when MaterialTreeDropdown
37+
closes.
38+
* Scorecard: Add a tooltip field.
39+
* Add color contrast ratio utility.
40+
* Remove deprecated box-sizing styles.
41+
* Deprecate `ManagedZone` and replace with `NgZone`.
42+
* Remove unnecessary uses of `::ng-deep`.
43+
* Add `visibility: Visibility.none` to most components for reduced code size.
44+
* Update documentation.
45+
146
## 0.8.0
247

348
* Move entry points to all components out of the lib/src/ directory.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ the transformer.
7979

8080
```yaml
8181
dependencies:
82-
sass_builder ^1.0.0 # update for the latest version
82+
sass_builder ^1.0.1 # update for the latest version
8383
transformers:
8484
- sass_builder
8585
- angular

lib/app_layout/README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ the material spec.
1010
## Setup
1111

1212
The styles are provided by
13-
`package:angular_components/app_layout/layout.scss.css`. To use
14-
these styles in an angular component simply add it as a `styleUrls` value in
15-
your `Component` annotation. It is suggested that the style is added before any
16-
component specific styling so you can easily override style values as needed.
13+
`package:angular_components/app_layout/layout.scss.css`. To use these styles in
14+
an angular component simply add it as a `styleUrls` value in your `Component`
15+
annotation. It is suggested that the style is added before any component
16+
specific styling so you can easily override style values as needed.
1717

1818
```dart
1919
@Component(
@@ -264,3 +264,17 @@ Here is an example:
264264
</material-list>
265265
</material-drawer>
266266
```
267+
268+
If the list content isn't going to be directly in the drawer but instead will be
269+
wrapped in another component you will have to provide the above styles using a
270+
mixin, due to style encapsulation.
271+
272+
Example scss drawer content component:
273+
274+
```scss
275+
@import 'third_party/dart_src/acx/app_layout/lib/mixins';
276+
277+
:host {
278+
@include mat-drawer-list-items;
279+
}
280+
```

lib/app_layout/_mixins.scss

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
@import 'package:angular_components/material_list/mixins';
6+
57
/// Sets width of MaterialTemporaryDrawerComponent.
68
///
79
/// Must be applied to the component itself, e.g.:
@@ -24,3 +26,36 @@
2426
right: -$width;
2527
}
2628
}
29+
30+
/// Adds the mixins that apply the correct styles for material-list items inside
31+
/// of material-drawer.
32+
@mixin mat-drawer-list-items() {
33+
material-list {
34+
// Remove the padding on the default list component when it is used in the
35+
// drawer.
36+
padding: 0;
37+
}
38+
39+
// Use the label attribute from material-list but ensure the style is right
40+
// for the drawer.
41+
[label] {
42+
@include list-item-base;
43+
align-items: center;
44+
// TODO(google) Remove once material-list uses the right color value.
45+
color: $mat-light-transparent-black;
46+
display: flex;
47+
}
48+
49+
material-list-item,
50+
[label] {
51+
font-weight: $mat-font-weight-medium;
52+
// The default size/padding for list item is incorrect for the drawer spec.
53+
height: $mat-grid * 6;
54+
padding: 0 $mat-grid * 2;
55+
56+
material-icon {
57+
color: $mat-light-transparent-black;
58+
margin-right: $mat-grid * 4;
59+
}
60+
}
61+
}

lib/app_layout/layout.scss

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/// This includes:
77
/// material-drawer (persistent and permanent)
88
@import 'material_drawer';
9+
@import 'mixins';
910
@import 'package:angular_components/css/material/material';
1011
@import 'package:angular_components/css/material/shadow';
1112
@import 'package:angular_components/material_list/mixins';
@@ -233,32 +234,5 @@ $mat-header-dense-height: 48px;
233234

234235
// Changes to material-list when used inside of the drawer.
235236
material-drawer {
236-
material-list {
237-
// Remove the padding on the default list component when it is used in the
238-
// drawer.
239-
padding: 0;
240-
}
241-
242-
// Use the label attribute from material-list but ensure the style is right
243-
// for the drawer.
244-
[label] {
245-
@include list-item-base;
246-
align-items: center;
247-
// TODO(google) Remove once material-list uses the right color value.
248-
color: $mat-light-transparent-black;
249-
display: flex;
250-
}
251-
252-
material-list-item,
253-
[label] {
254-
font-weight: $mat-font-weight-medium;
255-
// The default size/padding for list item is incorrect for the drawer spec.
256-
height: $mat-grid * 6;
257-
padding: 0 $mat-grid * 2;
258-
259-
material-icon {
260-
color: $mat-light-transparent-black;
261-
margin-right: $mat-grid * 4;
262-
}
263-
}
237+
@include mat-drawer-list-items;
264238
}

lib/auto_dismiss/auto_dismiss.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ import 'package:angular_components/utils/browser/events/events.dart';
2525
/// <button (click)="disclaimerVisible = true">Confirm</button>
2626
/// </div>
2727
///
28-
@Directive(selector: '[autoDismissable]:not(material-expansionpanel)')
28+
@Directive(
29+
selector: '[autoDismissable]:not(material-expansionpanel)',
30+
visibility: Visibility.none)
2931
class AutoDismissDirective {
3032
final Stream _click;
3133
final NgZone _zone;

lib/content/deferred_content.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import 'deferred_content_aware.dart';
2121
/// <modal [(visible)]="visible">
2222
/// <expensive-content *deferredContent></expensive-content>
2323
/// </modal>
24-
@Directive(selector: '[deferredContent]')
24+
@Directive(selector: '[deferredContent]', visibility: Visibility.none)
2525
class DeferredContentDirective implements OnDestroy {
2626
final _disposer = new Disposer.oneShot();
2727
final _placeholder = new DivElement();
@@ -95,7 +95,7 @@ class DeferredContentDirective implements OnDestroy {
9595
/// This directive is not recommended as it will cause Angular to change-detect
9696
/// the contents even when hidden. If your hidden content has push-detection
9797
/// enabled, go for it.
98-
@Directive(selector: '[cachedDeferredContent]')
98+
@Directive(selector: '[cachedDeferredContent]', visibility: Visibility.none)
9999
class CachingDeferredContentDirective implements OnDestroy {
100100
ViewContainerRef _viewContainer;
101101
TemplateRef _template;

lib/css/material/const/_color.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,3 +525,4 @@ $mat-amber: $mat-amber-500;
525525
$mat-link-default: $mat-blue-700;
526526
$mat-link-visited: $mat-deep-purple-500;
527527
$mat-link-active: $mat-red-700;
528+

lib/css/material/const/_mixins.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,4 @@
214214
-moz-box-sizing: $type; // Firefox < 29
215215
box-sizing: $type; // Chrome, IE 8+, Opera, Safari 5.1
216216
}
217+

lib/focus/focus.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class FocusMoveEvent {
124124
///
125125
/// Please put only on content that appears after user action and
126126
/// requires focus to be changed to it.
127-
@Directive(selector: '[autoFocus]')
127+
@Directive(selector: '[autoFocus]', visibility: Visibility.none)
128128
class AutoFocusDirective extends RootFocusable implements OnInit, OnDestroy {
129129
final _disposer = new Disposer.oneShot();
130130

0 commit comments

Comments
 (0)