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

Commit 25f22fa

Browse files
authored
Add Material Tooltip (#48)
Add Material Tooltip * Material Ripple: * Add GPU acceleration. * `rippleBindings` have been removed as they are no longer used. * Internal updates for compatibility with Angular 3.0.0-alpha. * Material Expansion Panel: * Fix CSS rule that causes header text to turn gray on hover/focus. * Support auto-focus on a content element when the material expansion panel expands. * Fix Yes/No button ordering. * Material Input: * Add a blur update value accessor. * Add multiple attribute. * Remove unused properties: rows and maxRows. * Material Input Multiline: Add auto grow in size. * Material Popup: Update change detection for OnPush. * Material Progress: Update to animate when main thread is blocked. * Material Radio: Adjust size to 24px. * Material Yes/No: Add toggle for yes button visibility. * Scorecard: Update change detection. * Fix flipped alignment positions when isRtl is used. * Fix popup event handling. * Remove 'uninitialized' as a default value. * Remove unused CSS rules. * Update styles to meet Material UI spec. * Bug fixes. * Strong Mode fixes.
1 parent 35a783b commit 25f22fa

File tree

87 files changed

+1939
-754
lines changed

Some content is hidden

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

87 files changed

+1939
-754
lines changed

CHANGELOG.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,40 @@
1+
## 0.3.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.
5+
6+
* Add Material Tooltip.
7+
* Material Ripple:
8+
* Add GPU acceleration.
9+
* `rippleBindings` have been removed as they are no longer used.
10+
* Internal updates for compatibility with Angular 3.0.0-alpha.
11+
* Material Expansion Panel:
12+
* Fix CSS rule that causes header text to turn gray on hover/focus.
13+
* Support auto-focus on a content element when the material expansion panel expands.
14+
* Fix Yes/No button ordering.
15+
* Material Input:
16+
* Add a blur update value accessor.
17+
* Add multiple attribute.
18+
* Remove unused properties: rows and maxRows.
19+
* Material Input Multiline: Add auto grow in size.
20+
* Material Popup: Update change detection for OnPush.
21+
* Material Progress: Update to animate when main thread is blocked.
22+
* Material Radio: Adjust size to 24px.
23+
* Material Yes/No: Add toggle for yes button visibility.
24+
* Scorecard: Update change detection.
25+
* Fix flipped alignment positions when isRtl is used.
26+
* Fix popup event handling.
27+
* Remove 'uninitialized' as a default value.
28+
* Remove unused CSS rules.
29+
* Update styles to meet Material UI spec.
30+
* Bug fixes.
31+
* Strong Mode fixes.
32+
133
## 0.2.2
234

335
* Add Material Popup, a basic popup component.
436
* Update Material Checkbox icon size.
5-
* Cleanup framework stabilizers since [issue #24843](https://github.com/dart-lang/sdk/issues/24843)
37+
* Cleanup framework stabilizers since [issue #24843](https://github.com/dart-lang/sdk/issues/24843)
638
in the Dart SDK has been resolved.
739
* Remove unused files.
840

@@ -15,7 +47,7 @@
1547

1648
* Add a modal dialog window called material_dialog.
1749
* Rename MultilineMaterialInputComponent to MaterialMultilineInputComponent.
18-
* Make the deferredContent placeholder element optional, off by default.
50+
* Make the deferredContent placeholder element optional, off by default.
1951
* Remove InputTextModel.
2052
* Cleanup linter warnings.
2153
* Refactor color support.

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
**Preview Release**
1+
## Preview Release
22

33
These are the AngularDart components that Google uses to build many of its web
44
applications.
55

6+
These components are a productive and stable set of widgets, contributed to by
7+
hundreds of Googlers. Being able to debug your apps across all layers in Dart,
8+
supporting tree shaking for minimal code size, and strict latency policies make
9+
them an excellent fit for AngularDart projects.
10+
611
Only a small fragment of all the components is available right now. We want
712
developers to have an opportunity to play around with the package as soon as
813
possible.
@@ -25,13 +30,17 @@ possible.
2530
*`<material-input>`
2631
*`<material-dialog>`
2732
*`<material-popup>`
28-
*`<material-tooltip>`
33+
*`<material-tooltip>`
34+
*`<material-list>`
35+
*`<material-select>`
2936
*`<material-auto-suggest-input>`
3037
*`<material-date-range-picker>`
31-
*`<material-list>`
3238
*`<material-menu>`
3339
* many more, including a fast table
3440

41+
At this time we are not taking pull requests but please file an issue and we will
42+
work with you.
43+
3544
**Officially Supported Browsers:** The last two versions of Chrome, Edge, Firefox, and Safari.
3645

3746
## Useful links

lib/angular2_components.dart

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ const List<Type> materialDirectives = const [
1313
AutoDismissDirective,
1414
AutoFocusDirective,
1515
CachingDeferredContentDirective,
16+
ClickableTooltipTargetDirective,
17+
DarkThemeDirective,
1618
DeferredContentDirective,
1719
FixedMaterialTabStripComponent,
1820
FocusActivableItemDirective,
@@ -29,8 +31,12 @@ const List<Type> materialDirectives = const [
2931
MaterialExpansionPanel,
3032
MaterialExpansionPanelSet,
3133
MaterialFabComponent,
34+
MaterialIconTooltipComponent,
35+
MaterialInkTooltipComponent,
3236
MaterialInputComponent,
3337
MaterialInputDefaultValueAccessor,
38+
MaterialMultilineInputComponent,
39+
MaterialPaperTooltipComponent,
3440
MaterialPopupComponent,
3541
MaterialProgressComponent,
3642
MaterialRadioComponent,
@@ -40,8 +46,10 @@ const List<Type> materialDirectives = const [
4046
MaterialTabComponent,
4147
MaterialTabPanelComponent,
4248
MaterialToggleComponent,
49+
MaterialTooltipDirective,
50+
MaterialTooltipSourceDirective,
51+
MaterialTooltipTargetDirective,
4352
MaterialYesNoButtonsComponent,
44-
MaterialMultilineInputComponent,
4553
ModalComponent,
4654
NgModel,
4755
PopupSourceDirective,
@@ -53,5 +61,4 @@ const List<Type> materialDirectives = const [
5361
/// A convenience list of all providers exposed by this package.
5462
const List<List<Provider>> materialProviders = const <List<Provider>>[
5563
popupBindings,
56-
rippleBindings,
5764
];

lib/src/all_components.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,14 @@ export 'components/material_progress/material_progress.dart';
3838
export 'components/material_radio/material_radio.dart';
3939
export 'components/material_radio/material_radio_group.dart';
4040
export 'components/material_ripple/material_ripple.dart';
41-
export 'components/material_ripple/module.dart';
4241
export 'components/material_spinner/material_spinner.dart';
4342
export 'components/material_tab/fixed_material_tab_strip.dart';
4443
export 'components/material_tab/material_tab.dart';
4544
export 'components/material_tab/material_tab_panel.dart';
4645
export 'components/material_tab/tab_change_event.dart';
4746
export 'components/material_toggle/material_toggle.dart';
47+
export 'components/material_tooltip/material_tooltip.dart';
48+
export 'components/material_tooltip/module.dart';
4849
export 'components/material_yes_no_buttons/material_yes_no_buttons.dart';
4950
export 'components/mixins/focusable_mixin.dart';
5051
export 'components/mixins/has_tab_index.dart';

lib/src/components/annotations/rtl_annotation.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ const rtlProvider =
1818
const Provider(rtlToken, useFactory: determineRtl, deps: const [Document]);
1919

2020
@Injectable()
21-
bool determineRtl(Document document) => 'rtl' == document.documentElement.dir;
21+
bool determineRtl(Document document) =>
22+
document.documentElement.dir == 'rtl' ||
23+
(document as HtmlDocument).body.dir == 'rtl';

lib/src/components/material_button/material_button.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ import 'material_button_base.dart';
5252
/// By default the ripple is the same color as the foreground at 25% opacity.
5353
/// You may customize the color using this selector:
5454
/// /* Make #myButton use a blue ripple instead of foreground color */
55-
/// #myButton material-ripple {
55+
/// #myButton gpu-ripple {
5656
/// color: blue;
5757
/// }
5858
///
@@ -72,6 +72,7 @@ import 'material_button_base.dart';
7272
host: const {
7373
'[class.is-disabled]': 'disabled',
7474
'[class.is-raised]': 'raised',
75+
'[class.is-focused]': 'visualFocus',
7576
'(mousedown)': r'onMouseDown($event)',
7677
'(mouseup)': r'onMouseUp($event)',
7778
'(click)': r'handleClick($event)',

lib/src/components/material_button/material_button.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@
99
</div>
1010
<!-- Add a material ripple effect. When pressed, we will increase the z -->
1111
<material-ripple (mousedown)="onMouseDown($event)"
12-
(mouseup)="onMouseUp($event)"
13-
[focused]="visualFocus">
12+
(mouseup)="onMouseUp($event)">
1413
</material-ripple>

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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ class MaterialButtonBase extends ButtonDirective {
4747
/// Whether button appears focused right now.
4848
bool get visualFocus => _focused;
4949

50+
/// Whether the mouse is currently pressed on the button.
51+
bool get isMouseDown => _isMouseDown;
52+
5053
/// The elevation the material-shadow component should show.
5154
///
5255
/// When a button is pressed, this is increased.

lib/src/components/material_button/material_fab.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ import 'material_button_base.dart';
5656
host: const {
5757
'[class.is-disabled]': 'disabled',
5858
'[class.is-raised]': 'raised',
59+
'[class.is-focused]': 'visualFocus',
5960
'(mousedown)': r'onMouseDown($event)',
6061
'(mouseup)': r'onMouseUp($event)',
6162
'(click)': r'handleClick($event)',

0 commit comments

Comments
 (0)