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

Commit dedd4cb

Browse files
authored
Component updates (#57)
Rollup of all internal changes since last release. No new components added. Waiting for angular2 to publish a revision before publishing these changes to pub. Requires analyzer 0.29.7 to build.
1 parent d48c103 commit dedd4cb

Some content is hidden

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

48 files changed

+530
-218
lines changed

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
1+
## 0.4.0-alpha
2+
3+
This code is considered production quality, but depends on angular2: 3.0.0-alpha.
4+
The alpha tag represents the evolving nature of the AngularDart api, not
5+
code quality (3.0.0-alpha is used in production Google apps).
6+
7+
### Breaking Changes
8+
* Update for generic syntax and `FutureOr` type introduced in Dart SDK 1.22.0.
9+
* Material Toggle: Remove the deprecated `color` theme input.
10+
* Material Button, Fab, Yes/No:
11+
* Remove is-disabled and is-raised HTML classes used for styling.
12+
Custom styles should now use `[disabled]` and `[raised]` instead of `.is-disabled` and
13+
`.is-raised` when targeting buttons.
14+
* Remove z-index of 0.
15+
16+
### Other Changes
17+
* Focus: Fix AX_ARIA_08 a11y issue.
18+
* Material Chips: Use :host to remove need for wrapper div.
19+
* Material Expansionpanel: Fix panel overflow issues.
20+
* Material Input:
21+
* Add new number accessors and validators.
22+
* Fix AX_TEXT_01 a11y issue.
23+
* Material List: Block pointer events for disabled list items.
24+
* Material Popup: Disable animation delay when there is nothing to animate.
25+
* Material Radio: Fix styling issue, flex for IE11.
26+
* Material Tab Panel: Fix issue that prevents displaying tabs on initialization.
27+
* Scorecard:
28+
* Add support for RTL languages in scrollable scoreboards.
29+
* Add support for themes.
30+
* Compute the ARIA roles only once per instance.
31+
* Fix dom update issues.
32+
* Add proper types to injected providers.
33+
* Add missing imports and remove unsupported Angular imports.
34+
* Strong mode fixes.
35+
136
## 0.3.1-alpha
237

338
This code is considered production quality, but depends on angular2: 3.0.0-alpha.

lib/src/all_components.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export 'components/material_input/material_input.dart'
3333
hide materialInputErrorKey;
3434
export 'components/material_input/material_input_default_value_accessor.dart';
3535
export 'components/material_input/material_input_multiline.dart';
36+
export 'components/material_input/material_number_accessor.dart';
37+
export 'components/material_input/material_number_validators.dart';
3638
export 'components/material_list/material_list.dart';
3739
export 'components/material_list/material_list_item.dart';
3840
export 'components/material_list/material_list_size.dart';

lib/src/components/focus/focus_item.dart

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,19 @@ import '../../utils/async/async.dart';
2424
///
2525
@Directive(selector: '[focusItem]', host: const {
2626
'[attr.tabindex]': 'tabIndex',
27-
'(keydown)': r'keydown($event)'
27+
'[attr.role]': 'role',
28+
'(keydown)': r'keydown($event)',
2829
}, providers: const [
2930
const Provider(FocusableItem, useExisting: FocusItemDirective)
3031
])
3132
class FocusItemDirective extends RootFocusable implements FocusableItem {
32-
FocusItemDirective(ElementRef element) : super(element);
33+
final String role;
3334

34-
String tabIndex = "0";
35+
FocusItemDirective(ElementRef element, @Attribute('role') String role)
36+
: this.role = role ?? 'listitem',
37+
super(element);
38+
39+
String tabIndex = '0';
3540

3641
final _focusMoveCtrl =
3742
new LazyStreamController<FocusMoveEvent>.broadcast(sync: true);
@@ -47,6 +52,6 @@ class FocusItemDirective extends RootFocusable implements FocusableItem {
4752

4853
@override
4954
set tabbable(bool value) {
50-
tabIndex = value ? "0" : "-1";
55+
tabIndex = value ? '0' : '-1';
5156
}
5257
}

lib/src/components/focus/focus_list.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,27 @@ import '../../utils/disposer/disposer.dart';
3131
/// <div focusItem>Item 3</div>
3232
/// </div>
3333
///
34-
@Directive(selector: '[focusList]', host: const {'role': 'list'})
34+
@Directive(selector: '[focusList]', host: const {'[attr.role]': 'role'})
3535
class FocusListDirective implements OnDestroy {
3636
final ManagedZone _managedZone;
37-
final List<FocusableItem> _children = <FocusableItem>[];
37+
final String role;
38+
final _disposer = new Disposer.multi();
39+
final _children = <FocusableItem>[];
3840
int get _length => _children.length;
39-
Disposer _disposer = new Disposer.multi();
4041

41-
FocusListDirective(this._managedZone);
42+
FocusListDirective(this._managedZone, @Attribute('role') String role)
43+
: this.role = role ?? 'list';
4244

4345
bool _loop = false;
4446

4547
/// Whether focus movement loops from the end of the list to the beginning of
4648
/// the list. Default is `false`.
49+
bool get loop => _loop;
4750
@Input()
4851
set loop(val) {
4952
_loop = getBool(val);
5053
}
5154

52-
bool get loop => _loop;
53-
5455
@ContentChildren(FocusableItem)
5556
set listItems(QueryList<FocusableItem> listItems) {
5657
_children.clear();

lib/src/components/material_button/material_button.dart

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ import 'package:angular2/angular2.dart';
99

1010
import 'material_button_base.dart';
1111

12-
// TODO(google): Right now we use is-raised and isDisabled for CSS styling.
13-
// When Angular supports conditionally adding/removing an attribute, use.
14-
// See https://github.com/angular/angular/issues/2869.
15-
1612
/// Material button is a button.
1713
///
1814
/// When the user touches the button, a ripple effect emanates from the point of
@@ -61,6 +57,12 @@ import 'material_button_base.dart';
6157
/// __Attributes:__
6258
///
6359
/// Button
60+
/// - `disabled` -- Linked to the disabled property. If present, sets the
61+
/// disabled property to true. If the disabled property is true, this
62+
/// attribute will be present.
63+
/// - `raised` -- Linked to the raised property. If present, sets the raised
64+
/// property to true. If the raised property is true, this attribute will be
65+
/// present.
6466
/// - `icon` -- If present, removes the minimum width style of the button.
6567
/// - `no-ink` -- If present, removes the ripple effect from the button.
6668
/// - `clear-size` -- If present, removes both the min-width and margin from
@@ -70,8 +72,8 @@ import 'material_button_base.dart';
7072
@Component(
7173
selector: 'material-button',
7274
host: const {
73-
'[class.is-disabled]': 'disabled',
74-
'[class.is-raised]': 'raised',
75+
'[attr.disabled]': r'disabled ? "" : null',
76+
'[attr.raised]': r'raised ? "" : null',
7577
'[class.is-focused]': 'visualFocus',
7678
'(mousedown)': r'onMouseDown($event)',
7779
'(mouseup)': r'onMouseUp($event)',

lib/src/components/material_button/material_button.scss.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/components/material_button/material_button_base.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ import '../button_decorator/button_decorator.dart';
99
import '../../utils/angular/properties/properties.dart';
1010
import 'package:angular2/angular2.dart';
1111

12-
// TODO(google): Right now we use is-raised and isDisabled for CSS styling.
13-
// When Angular supports conditionally adding/removing an attribute, use.
14-
// See https://github.com/angular/angular/issues/2869.
15-
1612
/// A base class from which to build buttons.
1713
///
1814
/// __Expected Properties:__

lib/src/components/material_button/material_fab.dart

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ import 'package:angular2/angular2.dart';
77

88
import 'material_button_base.dart';
99

10-
// TODO(google): Right now we use is-raised and isDisabled for CSS styling.
11-
// When Angular supports conditionally adding/removing an attribute, use.
12-
// See https://github.com/angular/angular/issues/2869.
13-
1410
/// Material FAB is a Floating Action Button. It is round, and behaves mostly
1511
/// the same as a MaterialButton.
1612
///
@@ -54,8 +50,8 @@ import 'material_button_base.dart';
5450
@Component(
5551
selector: 'material-fab',
5652
host: const {
57-
'[class.is-disabled]': 'disabled',
58-
'[class.is-raised]': 'raised',
53+
'[attr.disabled]': r'disabled ? "" : null',
54+
'[attr.raised]': r'raised ? "" : null',
5955
'[class.is-focused]': 'visualFocus',
6056
'(mousedown)': r'onMouseDown($event)',
6157
'(mouseup)': r'onMouseUp($event)',

0 commit comments

Comments
 (0)