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

Sync latest updates to all components #203

Merged
merged 46 commits into from
Dec 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
e24cb3b
cleanup(material_auto_suggest_input): Add optional punctuation around…
alorenzen Nov 29, 2017
e4b8936
cleanup(material_dropdown_select): Add optional punctuation around tr…
alorenzen Nov 29, 2017
0b8c300
cleanup(material_select): Add optional punctuation around trackBy fun…
alorenzen Nov 29, 2017
1e599ff
Protected against input being destroyed and blur event still happenin…
TedSander Dec 4, 2017
1d5e565
Fix columns to be ordered alphabetically by columnGroup first, then b…
a-googler Dec 5, 2017
70f8679
Change material_tooltip to use ComponentLoader instead of slow compon…
TedSander Dec 6, 2017
939ea3b
Optionally inject `SlowComponentLoader`
leonsenft Dec 6, 2017
51b62b9
Adds material input mixin for fixed width error text.
a-googler Dec 6, 2017
b3154f8
add a mixin to material_expansionpanel so that we can define customiz…
a-googler Dec 7, 2017
88c947f
Change portal to use ComponentLoader instead of slow component loader…
TedSander Dec 8, 2017
5db3ccf
Add path to use angular factories in imperative_view instead of SlowC…
TedSander Dec 8, 2017
c92e971
Use material icon instead of glyph inside the material menu.
rkj Dec 8, 2017
41ffa9a
Add type to PopupSizeProviderDirective ctor params.
tijoforyou Dec 8, 2017
38d9e92
Remove insertAngularComponent in favor of using component factories w…
TedSander Dec 9, 2017
9af654d
Remove unused dependency on glyph component from menu_popup.
rkj Dec 9, 2017
5e86e6b
Use material-icon instead of glyph in fab menu.
rkj Dec 9, 2017
425b0d7
Fix the styling for disabled icons in menu item groups.
rkj Dec 9, 2017
d111e14
Fix many things in app_layout code.
tijoforyou Dec 11, 2017
2258c35
Adding mixin to display toggle label to the right of the switch.
a-googler Dec 12, 2017
ca3f95c
Remove binding to non-existent `visible` property of menu-popup compo…
tijoforyou Dec 12, 2017
f0326e2
Renames `Visibility.none` to `Visibility.local`
leonsenft Dec 12, 2017
6786dde
Renames `Visibility.none` to `Visibility.local`
leonsenft Dec 12, 2017
86d786d
Renames `Visibility.none` to `Visibility.local`
leonsenft Dec 12, 2017
017b56d
Renames `Visibility.none` to `Visibility.local`
leonsenft Dec 12, 2017
f66c9df
Renames `Visibility.none` to `Visibility.local`
leonsenft Dec 12, 2017
a76d6ee
Prep for github export.
nshahan Dec 12, 2017
a2ddda1
Adding ability to give a tooltip for the clear icon in the material-a…
a-googler Dec 12, 2017
68a17cc
Fix type errors so tests can run in DDC.
nshahan Dec 13, 2017
2d9c57f
Add mixin to change material-select-dropdown-item padding and move AC…
a-googler Dec 13, 2017
572fe1f
Avoid analyzer errors when using this component in the external repo …
nshahan Dec 14, 2017
80016c5
Remove explicit initialization to null
tijoforyou Dec 14, 2017
dcd2d6f
Use StreamController directly, instead of deprecated LazyStreamContro…
tijoforyou Dec 15, 2017
ebd88eb
Migrate material_radio package off of deprecated GlyphComponent.
tijoforyou Dec 16, 2017
9378687
Allow DynamicComponent to handle both Type & ComponentFactory for the…
a-googler Dec 16, 2017
89eac2d
Migrate material_tooltip package off of deprecated GlyphComponent.
tijoforyou Dec 18, 2017
f97af66
Migrate material_expansionpanel package off of deprecated GlyphCompon…
tijoforyou Dec 18, 2017
e77a562
Migrate material_input package off of deprecated GlyphComponent.
tijoforyou Dec 18, 2017
7f59b41
Append the alias in the suggestion for go-to search to make it more c…
a-googler Dec 18, 2017
421b973
Provide a path to use Component Factories when using acx code that wa…
TedSander Dec 18, 2017
ea99e52
Make material menu button text in toolbelt lower case
a-googler Dec 19, 2017
504d062
Add factoryRenderer pattern to material_auto_suggest, and material_se…
TedSander Dec 19, 2017
a019c83
Fix generic types in typedef
tijoforyou Dec 19, 2017
0468c08
Update MaterialDropdownSelect to hide item from the option list when …
a-googler Dec 19, 2017
5e8eaf3
Fix typo in the binding to componentFactory
tijoforyou Dec 19, 2017
3c99f8d
Allow material scrollbar mixin to be used in global css (without angu…
a-googler Dec 19, 2017
c2054cf
Prep to sync externally and publish version 0.9.0-alpha+2.
nshahan Dec 19, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
## 0.9.0-alpha+2

> NOTE: This code is considered production quality, but depends on angular:
> 5.0.0-alpha+2. The alpha tag represents the evolving nature of the AngularDart
> api, not code quality (5.0.0-alpha+2 is used in production Google apps).

**NOTE**: As of `angular 5.0.0-alpha+1` [`dependency_overrides`][dep_overrides]
are **required**:

```yaml
dependency_overrides:
analyzer: ^0.31.0-alpha.1
```

* Material Auto-Suggest Input: Add ability to give a tooltip for the clear
icon.
* Material Expansionpanel: Add mixin for flat on collapse.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Material Expansion Panel

* Material Input:
* Protected against input being destroyed and blur event still happening.
* Add mixin for fixed width error text.
* Material Menu: Add mixin for lowercase button text.
* Material Toggle: Add mixin to display label on the right.
* Material Select: Add mixin to change `material-select-dropdown-item` padding.
* Allow `material-scrollbar` mixin to be used in global css (without angular).
* Add directives for Material Menu to `materialDirectives`.
* Remove `MaterialButtonBase` from `materialDirectives`.
* Migrate from Glyph to Material Icon.
* Provide a path to use Component Factories when using code that was previously
using the `ComponentRenderer` pattern.
* Generic type fixes.
* Continue migration from `SlowComponentLoader` to `ComponentLoader`.
* Continue migration from `LazyStreamController` to `StreamController`.
* Cleanup Angular static analysis warnings.
* Rename `Visibility.none` to `Visibility.local`.
* Add optional punctuation around trackBy functions.

## 0.9.0-alpha+1

> NOTE: This code is considered production quality, but depends on angular:
Expand Down
3 changes: 2 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
analyzer:
strong-mode: true
errors:
dead_code: warning
unused_element: warning
unused_import: warning
unused_local_variable: warning
dead_code: warning
uri_has_not_been_generated: ignore
23 changes: 21 additions & 2 deletions lib/angular_components.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import 'laminate/components/modal/modal.dart';
import 'laminate/popup/module.dart';
import 'laminate/popup/popup.dart';
import 'material_button/material_button.dart';
import 'material_button/material_button_base.dart';
import 'material_button/material_fab.dart';
import 'material_checkbox/material_checkbox.dart'
show MaterialCheckboxComponent;
Expand All @@ -45,6 +44,13 @@ import 'material_input/material_number_validators.dart';
import 'material_input/material_percent_directive.dart';
import 'material_list/material_list.dart';
import 'material_list/material_list_item.dart';
import 'material_menu/dropdown_menu.dart';
import 'material_menu/material_fab_menu.dart';
import 'material_menu/material_menu.dart';
import 'material_menu/menu_item_affix_list.dart';
import 'material_menu/menu_item_groups.dart';
import 'material_menu/menu_popup.dart';
import 'material_menu/menu_root.dart';
import 'material_popup/material_popup.dart';
import 'material_progress/material_progress.dart';
import 'material_radio/material_radio.dart';
Expand Down Expand Up @@ -122,6 +128,13 @@ export 'material_input/material_percent_directive.dart';
export 'material_list/material_list.dart';
export 'material_list/material_list_item.dart';
export 'material_list/material_list_size.dart';
export 'material_menu/dropdown_menu.dart';
export 'material_menu/material_fab_menu.dart';
export 'material_menu/material_menu.dart';
export 'material_menu/menu_item_affix_list.dart';
export 'material_menu/menu_item_groups.dart';
export 'material_menu/menu_popup.dart';
export 'material_menu/menu_popup_wrapper.dart';
export 'material_popup/material_popup.dart';
export 'material_progress/material_progress.dart';
export 'material_radio/material_radio.dart';
Expand Down Expand Up @@ -183,6 +196,7 @@ const List<dynamic> materialDirectives = const [
DeferredContentDirective,
displayNameRendererDirective,
DropdownButtonComponent,
DropdownMenuComponent,
DynamicComponent,
FixedMaterialTabStripComponent,
FocusActivableItemDirective,
Expand All @@ -197,7 +211,6 @@ const List<dynamic> materialDirectives = const [
LowerBoundValidator,
MaterialAutoSuggestInputComponent,
MaterialButtonComponent,
MaterialButtonBase,
MaterialCheckboxComponent,
MaterialChipComponent,
MaterialChipsComponent,
Expand All @@ -207,13 +220,17 @@ const List<dynamic> materialDirectives = const [
MaterialExpansionPanelAutoDismiss,
MaterialExpansionPanelSet,
MaterialFabComponent,
MaterialFabMenuComponent,
MaterialIconComponent,
MaterialIconTooltipComponent,
MaterialInkTooltipComponent,
MaterialInputComponent,
MaterialInputDefaultValueAccessor,
MenuItemAffixListComponent,
MenuItemGroupsComponent,
MaterialListComponent,
MaterialListItemComponent,
MaterialMenuComponent,
MaterialMultilineInputComponent,
MaterialPaperTooltipComponent,
MaterialPercentInputDirective,
Expand All @@ -238,6 +255,8 @@ const List<dynamic> materialDirectives = const [
MaterialTooltipSourceDirective,
MaterialTooltipTargetDirective,
MaterialYesNoButtonsComponent,
MenuPopupComponent,
MenuRootDirective,
ModalComponent,
NgModel,
PositiveNumValidator,
Expand Down
9 changes: 3 additions & 6 deletions lib/app_layout/material_drawer_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// BSD-style license that can be found in the LICENSE file.

import 'dart:async';
import 'dart:html';

import 'package:angular/angular.dart';
import 'package:angular_components/content/deferred_content_aware.dart';
Expand All @@ -13,9 +12,7 @@ import 'package:angular_components/content/deferred_content_aware.dart';
const animationDuration = const Duration(milliseconds: 500);

class MaterialDrawerBase implements DeferredContentAware, OnInit {
MaterialDrawerBase(this._element, {bool visible = true}) : _visible = visible;

final HtmlElement _element;
MaterialDrawerBase({bool visible = true}) : _visible = visible;

bool _visible;

Expand All @@ -30,7 +27,7 @@ class MaterialDrawerBase implements DeferredContentAware, OnInit {
if (!_visible) {
// Wait until after the animation to remove the content
new Timer(animationDuration, () {
// Make sure we are still not visible incase the drawer was toggled
// Make sure we are still not visible in case the drawer was toggled
// quickly before the animation was done.
if (!_visible) _visibleChange.add(_visible);
});
Expand All @@ -42,7 +39,7 @@ class MaterialDrawerBase implements DeferredContentAware, OnInit {

final _visibleChange = new StreamController<bool>.broadcast(sync: true);

/// Event fired when the visibilty of the drawer changes.
/// Event fired when the visibility of the drawer changes.
///
/// Note: does not fire until after the animation is complete.
@Output('visibleChange')
Expand Down
4 changes: 1 addition & 3 deletions lib/app_layout/material_persistent_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:html';

import 'package:angular/angular.dart';
import 'package:angular_components/content/deferred_content_aware.dart';

Expand Down Expand Up @@ -35,5 +33,5 @@ import 'material_drawer_base.dart';
},
)
class MaterialPersistentDrawerDirective extends MaterialDrawerBase {
MaterialPersistentDrawerDirective(HtmlElement element) : super(element);
MaterialPersistentDrawerDirective() : super();
}
5 changes: 1 addition & 4 deletions lib/app_layout/material_temporary_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:html';

import 'package:angular/angular.dart';
import 'package:angular_components/content/deferred_content_aware.dart';

Expand Down Expand Up @@ -38,6 +36,5 @@ import 'material_drawer_base.dart';
changeDetection: ChangeDetectionStrategy.OnPush,
)
class MaterialTemporaryDrawerComponent extends MaterialDrawerBase {
MaterialTemporaryDrawerComponent(HtmlElement element)
: super(element, visible: false);
MaterialTemporaryDrawerComponent() : super(visible: false);
}
2 changes: 1 addition & 1 deletion lib/auto_dismiss/auto_dismiss.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import 'package:angular_components/utils/browser/events/events.dart';
///
@Directive(
selector: '[autoDismissable]:not(material-expansionpanel)',
visibility: Visibility.none)
visibility: Visibility.local)
class AutoDismissDirective {
final Stream _click;
final NgZone _zone;
Expand Down
4 changes: 2 additions & 2 deletions lib/content/deferred_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import 'deferred_content_aware.dart';
/// <modal [(visible)]="visible">
/// <expensive-content *deferredContent></expensive-content>
/// </modal>
@Directive(selector: '[deferredContent]', visibility: Visibility.none)
@Directive(selector: '[deferredContent]', visibility: Visibility.local)
class DeferredContentDirective implements OnDestroy {
final _disposer = new Disposer.oneShot();
final _placeholder = new DivElement();
Expand Down Expand Up @@ -96,7 +96,7 @@ class DeferredContentDirective implements OnDestroy {
/// This directive is not recommended as it will cause Angular to change-detect
/// the contents even when hidden. If your hidden content has push-detection
/// enabled, go for it.
@Directive(selector: '[cachedDeferredContent]', visibility: Visibility.none)
@Directive(selector: '[cachedDeferredContent]', visibility: Visibility.local)
class CachingDeferredContentDirective implements OnDestroy {
ViewContainerRef _viewContainer;
TemplateRef _template;
Expand Down
20 changes: 17 additions & 3 deletions lib/css/material/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,21 @@
$thumb-hover-color,
$scrollbar-size: $mat-grid-type,
$thumb-min-size: 6 * $mat-grid) {
::ng-deep ::-webkit-scrollbar {
::ng-deep {
@include material-scrollbar(
$thumb-hover-color, $scrollbar-size, $thumb-min-size);
}
}

/// Style all scrollbars within the scope to material spec.
///
/// Note: This is the same as material-scrollbar-theme expect it can be used
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expect --> except

/// globally outside the context angular components.
@mixin material-scrollbar(
$thumb-hover-color,
$scrollbar-size: $mat-grid-type,
$thumb-min-size: 6 * $mat-grid) {
::-webkit-scrollbar {
background-color: $mat-scrollbar-background;

// Height only applies to horizontal scrollbars.
Expand All @@ -29,7 +43,7 @@
}
}

::ng-deep ::-webkit-scrollbar-thumb {
::-webkit-scrollbar-thumb {
background-color: $mat-scrollbar-thumb;

// min-height only applies to vertical scrollbar thumbs.
Expand All @@ -43,7 +57,7 @@
}
}

::ng-deep ::-webkit-scrollbar-button {
::-webkit-scrollbar-button {
width: 0;
height: 0;
}
Expand Down
50 changes: 31 additions & 19 deletions lib/dynamic_component/dynamic_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'dart:async';

import 'package:angular/angular.dart';
import 'package:angular_components/model/ui/has_renderer.dart';
import 'package:angular_components/utils/async/async.dart';

/// Dynamically renders another component, setting the [value] field on the
/// dynamic component if it implements [RendersValue] (and not if the component
Expand All @@ -28,7 +27,7 @@ class DynamicComponent implements OnDestroy {
final SlowComponentLoader _slowComponentLoader;
final ComponentLoader _componentLoader;
final ChangeDetectorRef _changeDetectorRef;
final _onLoadController = new LazyStreamController<ComponentRef>();
final _onLoadController = new StreamController<ComponentRef>();

ViewContainerRef _viewContainerRef;
bool _loadDeferred = false;
Expand Down Expand Up @@ -69,15 +68,8 @@ class DynamicComponent implements OnDestroy {
_childComponent = null;
}

/// The type of component to dynamically render.
@Deprecated('Use componentFactory instead as it is more tree-shakable')
@Input()
set componentType(Type dartType) {
void _checkAndInitialize() {
_disposeChildComponent();
_componentType = dartType;
if (dartType == null) {
return;
}
if (_viewContainerRef != null) {
_initialize();
} else {
Expand All @@ -86,17 +78,37 @@ class DynamicComponent implements OnDestroy {
}

/// The type of component to dynamically render.
///
/// If something other than a null or Type is passed in, it will
/// be ignored.
@Deprecated('Use componentFactory instead as it is more tree-shakable')
@Input()
set componentFactory(ComponentFactory component) {
_disposeChildComponent();
_componentFactory = component;
if (component == null) {
return;
set componentType(Object dartType) {
// Ignore unsupported type.
if (dartType == null) {
_disposeChildComponent();
} else if (dartType is Type) {
_componentFactory = null;
_componentType = dartType;
_checkAndInitialize();
}
if (_viewContainerRef != null) {
_initialize();
} else {
_loadDeferred = true;
}

/// The ComponentFactory of component to dynamically render.
///
/// If something other than a null or ComponentFactory is passed in, it will
/// be ignored. Note: This only temporarially supports Object to allow for
/// an easier transition of code. This does make this code slightly slower,
/// but will be changed to [ComponentFactory] when [componentType] is
/// removed.
@Input()
set componentFactory(Object component) {
if (component == null) {
_disposeChildComponent();
} else if (component is ComponentFactory) {
_componentType = null;
_componentFactory = component;
_checkAndInitialize();
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/focus/focus.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class FocusMoveEvent {
///
/// Please put only on content that appears after user action and
/// requires focus to be changed to it.
@Directive(selector: '[autoFocus]', visibility: Visibility.none)
@Directive(selector: '[autoFocus]', visibility: Visibility.local)
class AutoFocusDirective extends RootFocusable implements OnInit, OnDestroy {
final _disposer = new Disposer.oneShot();

Expand Down
5 changes: 2 additions & 3 deletions lib/focus/focus_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'dart:html' show KeyboardEvent, HtmlElement;

import 'package:angular/angular.dart';
import 'package:angular_components/focus/focus.dart';
import 'package:angular_components/utils/async/async.dart';

/// `FocusItemDirective`, used in conjunction with [FocusListDirective],
/// provides a means to move focus between a list of components (or elements)
Expand All @@ -31,7 +30,7 @@ import 'package:angular_components/utils/async/async.dart';
providers: const [
const Provider(FocusableItem, useExisting: FocusItemDirective)
],
visibility: Visibility.none)
visibility: Visibility.local)
class FocusItemDirective extends RootFocusable implements FocusableItem {
final String role;

Expand All @@ -42,7 +41,7 @@ class FocusItemDirective extends RootFocusable implements FocusableItem {
String tabIndex = '0';

final _focusMoveCtrl =
new LazyStreamController<FocusMoveEvent>.broadcast(sync: true);
new StreamController<FocusMoveEvent>.broadcast(sync: true);
@override
Stream<FocusMoveEvent> get focusmove => _focusMoveCtrl.stream;

Expand Down
2 changes: 1 addition & 1 deletion lib/glyph/glyph.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const List<String> _flippedIcons = const [
templateUrl: 'glyph.html',
styleUrls: const ['glyph.scss.css'],
changeDetection: ChangeDetectionStrategy.OnPush,
visibility: Visibility.none)
visibility: Visibility.local)
class GlyphComponent {
static const String _materialIconsExtended = 'material-icons-extended';

Expand Down
Loading