diff --git a/CHANGELOG.md b/CHANGELOG.md index b50650da7..35a5f02ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,27 @@ +## 0.5.1 + + * Glyph: Add baseline attribute. + * Material Expansionpanel: + * Allow programmatic `expand` and `collapse` requests even if the panel is + `disabled`. + * Change `preserveWhitespace` default to false. + * Add `enterAccepts` flag. + * Material Input: + * Show counter regardless of focus. + * Add error message to `MaterialPercentInputDirective`. + * Material List: Allow pointer events when disabled. + * Material Popup: Fix positioning when `matchMinSourceWidth` is true. + * Material Ripple: Show a centered ripple on keypress. + * Material Select: + * Only display underline when border is also set. + * Add `useCheckMarks` to use check marks instead of checkboxes. + * Material Tooltips: Resize to fit contents. + * Material Yes/No Buttons: Add `enterAccepts` flag. + * Deprecate LazyStreamController and migrate to StreamController. + * Migrate use of LazyEventController to StreamController. + * Documentation fixes. + * Strong mode fixes. + ## 0.5.0 * Rename library to angular_components. diff --git a/lib/angular_components.dart b/lib/angular_components.dart index 71c560812..724b215fc 100644 --- a/lib/angular_components.dart +++ b/lib/angular_components.dart @@ -5,7 +5,9 @@ library angular_components; import 'package:angular2/angular2.dart' show Provider; + import 'src/all_components.dart'; + export 'src/all_components.dart'; /// A convenience list of all Directives exposed by this package. diff --git a/lib/src/all_components.dart b/lib/src/all_components.dart index 8786c33d7..012b0f4bd 100644 --- a/lib/src/all_components.dart +++ b/lib/src/all_components.dart @@ -59,7 +59,9 @@ export 'components/material_spinner/material_spinner.dart'; export 'components/material_tab/fixed_material_tab_strip.dart'; export 'components/material_tab/material_tab.dart'; export 'components/material_tab/material_tab_panel.dart'; +export 'components/material_tab/tab_button.dart'; export 'components/material_tab/tab_change_event.dart'; +export 'components/material_tab/tab_mixin.dart'; export 'components/material_toggle/material_toggle.dart'; export 'components/material_tooltip/material_tooltip.dart'; export 'components/material_tooltip/module.dart'; @@ -69,6 +71,7 @@ export 'components/mixins/focusable_mixin.dart'; export 'components/mixins/has_tab_index.dart'; export 'components/mixins/material_dropdown_base.dart'; export 'components/mixins/track_layout_changes.dart'; +export 'components/reorder_list/reorder_events.dart'; export 'components/reorder_list/reorder_list.dart'; export 'components/scorecard/scoreboard.dart'; export 'components/scorecard/scorecard.dart'; diff --git a/lib/src/components/auto_dismiss/auto_dismiss.dart b/lib/src/components/auto_dismiss/auto_dismiss.dart index 81c95f24e..56e6b043a 100644 --- a/lib/src/components/auto_dismiss/auto_dismiss.dart +++ b/lib/src/components/auto_dismiss/auto_dismiss.dart @@ -46,7 +46,7 @@ class AutoDismissDirective { // If a click set autoDismissable to `true`, then we don't want the same // click to dismiss right away. Stop listening for clicks until we see a // click event, or until the next event loop. - _ignoreClicks = b; + _ignoreClicks = _autoDismissable; _click.first.then(_listenForClicks); // Run the timer outside of Angular so that it doesn't trigger a new digest // cycle. diff --git a/lib/src/components/button_decorator/button_decorator.dart b/lib/src/components/button_decorator/button_decorator.dart index 080bc0749..02c687ade 100644 --- a/lib/src/components/button_decorator/button_decorator.dart +++ b/lib/src/components/button_decorator/button_decorator.dart @@ -4,12 +4,13 @@ import 'dart:html'; -import '../focus/focus.dart'; -import '../mixins/has_tab_index.dart'; +import 'package:angular2/angular2.dart'; + import '../../utils/angular/properties/properties.dart'; import '../../utils/async/async.dart'; import '../../utils/browser/events/events.dart'; -import 'package:angular2/angular2.dart'; +import '../focus/focus.dart'; +import '../mixins/has_tab_index.dart'; /// ButtonDirective adds all basic required a11y functional for any element, /// that are designed to work as a button (clickable icon, etc.) @@ -49,7 +50,7 @@ class ButtonDirective extends RootFocusable with HasTabIndex { /// Is the button disabled. bool get disabled => _disabled; @Input() - set disabled(value) { + set disabled(dynamic value) { _disabled = getBool(value); } diff --git a/lib/src/components/content/deferred_content.dart b/lib/src/components/content/deferred_content.dart index 7c43b3495..4ca314169 100644 --- a/lib/src/components/content/deferred_content.dart +++ b/lib/src/components/content/deferred_content.dart @@ -8,7 +8,6 @@ import 'package:angular2/angular2.dart'; import '../../utils/angular/properties/properties.dart'; import '../../utils/disposer/disposer.dart'; - import 'deferred_content_aware.dart'; /// When put on an element B, this directive creates B each time the nearest diff --git a/lib/src/components/dynamic_component/dynamic_component.dart b/lib/src/components/dynamic_component/dynamic_component.dart index ea1904ee3..a347d89f6 100644 --- a/lib/src/components/dynamic_component/dynamic_component.dart +++ b/lib/src/components/dynamic_component/dynamic_component.dart @@ -4,9 +4,10 @@ import 'dart:async'; +import 'package:angular2/angular2.dart'; + import '../../model/ui/has_renderer.dart'; import '../../utils/async/async.dart'; -import 'package:angular2/angular2.dart'; /// Dynamically renders another component, setting the [value] field on the /// dynamic component if it implements [RendersValue] (and not if the component diff --git a/lib/src/components/focus/focus_item.dart b/lib/src/components/focus/focus_item.dart index 17e99f96f..7892ab75f 100644 --- a/lib/src/components/focus/focus_item.dart +++ b/lib/src/components/focus/focus_item.dart @@ -7,8 +7,8 @@ import 'dart:html' show KeyboardEvent; import 'package:angular2/angular2.dart'; -import './focus.dart'; import '../../utils/async/async.dart'; +import './focus.dart'; /// `FocusItemDirective`, used in conjunction with [FocusListDirective], /// provides a means to move focus between a list of components (or elements) diff --git a/lib/src/components/focus/focus_list.dart b/lib/src/components/focus/focus_list.dart index c2812ba57..b882ac2d1 100644 --- a/lib/src/components/focus/focus_list.dart +++ b/lib/src/components/focus/focus_list.dart @@ -4,10 +4,10 @@ import 'package:angular2/angular2.dart'; -import './focus.dart'; import '../../utils/angular/managed_zone/angular_2.dart'; import '../../utils/angular/properties/properties.dart'; import '../../utils/disposer/disposer.dart'; +import './focus.dart'; /// `FocusListDirective`, used in conjunction with [FocusItemDirective] or /// other directive implementing [FocusableItem], to provide a means to move diff --git a/lib/src/components/focus/focus_trap.dart b/lib/src/components/focus/focus_trap.dart index 3cd3ba438..4922da562 100644 --- a/lib/src/components/focus/focus_trap.dart +++ b/lib/src/components/focus/focus_trap.dart @@ -4,10 +4,11 @@ import 'dart:html'; -import './focus.dart'; +import 'package:angular2/angular2.dart'; + import '../../utils/browser/dom_iterator/dom_iterator.dart'; import '../../utils/disposer/disposer.dart'; -import 'package:angular2/angular2.dart'; +import './focus.dart'; /// Focus trap designed for usage of popups and modals. /// diff --git a/lib/src/components/glyph/glyph.scss.css b/lib/src/components/glyph/glyph.scss.css index 43a264a2c..b2e601f2f 100644 --- a/lib/src/components/glyph/glyph.scss.css +++ b/lib/src/components/glyph/glyph.scss.css @@ -3,4 +3,4 @@ * 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. */ -:host{display:-webkit-inline-flex;display:inline-flex}:host[light]{opacity:0.54}:host[size="x-small"] /deep/ i{font-size:12px;height:1em;line-height:1em;width:1em}:host[size="small"] /deep/ i{font-size:13px;height:1em;line-height:1em;width:1em}:host[size="medium"] /deep/ i{font-size:16px;height:1em;line-height:1em;width:1em}:host[size="large"] /deep/ i{font-size:18px;height:1em;line-height:1em;width:1em}:host[size="x-large"] /deep/ i{font-size:20px;height:1em;line-height:1em;width:1em}:host-context([dir="rtl"])[flip] .glyph-i{transform:scaleX(-1)} +:host{display:inline-flex}:host[light]{opacity:0.54}:host[size="x-small"] /deep/ i{font-size:12px;height:1em;line-height:1em;width:1em}:host[size="small"] /deep/ i{font-size:13px;height:1em;line-height:1em;width:1em}:host[size="medium"] /deep/ i{font-size:16px;height:1em;line-height:1em;width:1em}:host[size="large"] /deep/ i{font-size:18px;height:1em;line-height:1em;width:1em}:host[size="x-large"] /deep/ i{font-size:20px;height:1em;line-height:1em;width:1em}:host-context([dir="rtl"])[flip] .glyph-i{transform:scaleX(-1)}:host[baseline]{align-items:center}:host[baseline]::before{content:'-';display:inline-block;width:0;visibility:hidden}:host[baseline] .glyph-i{margin-bottom:.1em} diff --git a/lib/src/components/material_button/material_button.dart b/lib/src/components/material_button/material_button.dart index e7b612559..1d352d851 100644 --- a/lib/src/components/material_button/material_button.dart +++ b/lib/src/components/material_button/material_button.dart @@ -2,11 +2,11 @@ // 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 'package:angular2/angular2.dart'; + import '../button_decorator/button_decorator.dart'; import '../material_ripple/material_ripple.dart'; import '../theme/dark_theme.dart'; -import 'package:angular2/angular2.dart'; - import 'material_button_base.dart'; /// Material button is a button. diff --git a/lib/src/components/material_button/material_button.scss.css b/lib/src/components/material_button/material_button.scss.css index 66059f13c..6db022dc8 100644 --- a/lib/src/components/material_button/material_button.scss.css +++ b/lib/src/components/material_button/material_button.scss.css @@ -3,4 +3,4 @@ * 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. */ -:host{font-size:14px;font-weight:500;text-transform:uppercase;-moz-user-select:-moz-none;-ms-user-select:none;-webkit-user-select:none;user-select:none;background:transparent;border-radius:inherit;box-sizing:border-box;cursor:pointer;display:inline-block;letter-spacing:.01em;line-height:normal;outline:none;position:relative;text-align:center}:host.acx-theme-dark{color:#fff}:host.acx-theme-dark[raised]{background-color:#4285f4}:host[animated]{transition:box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1)}:host[elevation="1"]{/*! @noflip */;box-shadow:0 2px 2px 0 rgba(0,0,0,0.14),0 3px 1px -2px rgba(0,0,0,0.12),0 1px 5px 0 rgba(0,0,0,0.2)}:host[elevation="2"]{/*! @noflip */;box-shadow:0 4px 5px 0 rgba(0,0,0,0.14),0 1px 10px 0 rgba(0,0,0,0.12),0 2px 4px -1px rgba(0,0,0,0.2)}:host[elevation="3"]{/*! @noflip */;box-shadow:0 6px 10px 0 rgba(0,0,0,0.14),0 1px 18px 0 rgba(0,0,0,0.12),0 3px 5px -1px rgba(0,0,0,0.2)}:host[elevation="4"]{/*! @noflip */;box-shadow:0 8px 10px 1px rgba(0,0,0,0.14),0 3px 14px 2px rgba(0,0,0,0.12),0 5px 5px -3px rgba(0,0,0,0.2)}:host[elevation="5"]{/*! @noflip */;box-shadow:0 16px 24px 2px rgba(0,0,0,0.14),0 6px 30px 5px rgba(0,0,0,0.12),0 8px 10px -5px rgba(0,0,0,0.2)}:host[elevation="6"]{/*! @noflip */;box-shadow:0 24px 38px 3px rgba(0,0,0,0.14),0 9px 46px 8px rgba(0,0,0,0.12),0 11px 15px -7px rgba(0,0,0,0.2)}:host:not([icon]){margin:0 .29em}:host[dense]{height:32px;font-size:13px}:host[disabled]{color:rgba(0,0,0,0.26);cursor:not-allowed}:host[disabled].acx-theme-dark{color:rgba(255,255,255,0.3)}:host[disabled]>*{pointer-events:none}:host[disabled][raised]{background:rgba(0,0,0,0.12)}:host[disabled][raised].acx-theme-dark{background:#4285f4}:host:not([raised]):not([disabled]):not([icon]):hover{background-color:rgba(158,158,158,0.2)}:host.is-focused::after{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;background-color:currentColor;opacity:0.12;border-radius:inherit;pointer-events:none}:host:not([raised]),:host[disabled][raised]{box-shadow:none}:host[no-ink] material-ripple{display:none}:host[clear-size]{margin:0}:host .content{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center}:host .content>::content *{text-transform:inherit}:host:not([icon]){border-radius:2px;min-width:5.14em}:host:not([icon]) .content{padding:0.7em 0.57em}:host[icon]{border-radius:50%}:host[icon] .content{padding:8px}:host[clear-size]{min-width:0} +:host{font-size:14px;font-weight:500;text-transform:uppercase;-moz-user-select:-moz-none;-ms-user-select:none;-webkit-user-select:none;user-select:none;background:transparent;border-radius:inherit;box-sizing:border-box;cursor:pointer;display:inline-block;letter-spacing:.01em;line-height:normal;outline:none;position:relative;text-align:center}:host.acx-theme-dark{color:#fff}:host.acx-theme-dark[raised]{background-color:#4285f4}:host[animated]{transition:box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1)}:host[elevation="1"]{/*! @noflip */;box-shadow:0 2px 2px 0 rgba(0,0,0,0.14),0 3px 1px -2px rgba(0,0,0,0.12),0 1px 5px 0 rgba(0,0,0,0.2)}:host[elevation="2"]{/*! @noflip */;box-shadow:0 4px 5px 0 rgba(0,0,0,0.14),0 1px 10px 0 rgba(0,0,0,0.12),0 2px 4px -1px rgba(0,0,0,0.2)}:host[elevation="3"]{/*! @noflip */;box-shadow:0 6px 10px 0 rgba(0,0,0,0.14),0 1px 18px 0 rgba(0,0,0,0.12),0 3px 5px -1px rgba(0,0,0,0.2)}:host[elevation="4"]{/*! @noflip */;box-shadow:0 8px 10px 1px rgba(0,0,0,0.14),0 3px 14px 2px rgba(0,0,0,0.12),0 5px 5px -3px rgba(0,0,0,0.2)}:host[elevation="5"]{/*! @noflip */;box-shadow:0 16px 24px 2px rgba(0,0,0,0.14),0 6px 30px 5px rgba(0,0,0,0.12),0 8px 10px -5px rgba(0,0,0,0.2)}:host[elevation="6"]{/*! @noflip */;box-shadow:0 24px 38px 3px rgba(0,0,0,0.14),0 9px 46px 8px rgba(0,0,0,0.12),0 11px 15px -7px rgba(0,0,0,0.2)}:host:not([icon]){margin:0 .29em}:host[dense]{height:32px;font-size:13px}:host[disabled]{color:rgba(0,0,0,0.26);cursor:not-allowed}:host[disabled].acx-theme-dark{color:rgba(255,255,255,0.3)}:host[disabled]>*{pointer-events:none}:host[disabled][raised]{background:rgba(0,0,0,0.12)}:host[disabled][raised].acx-theme-dark{background:#4285f4}:host:not([raised]):not([disabled]):not([icon]):hover{background-color:rgba(158,158,158,0.2)}:host.is-focused::after{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;background-color:currentColor;opacity:0.12;border-radius:inherit;pointer-events:none}:host:not([raised]),:host[disabled][raised]{box-shadow:none}:host[no-ink] material-ripple{display:none}:host[clear-size]{margin:0}:host .content{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center}:host:not([icon]){border-radius:2px;min-width:5.14em}:host:not([icon]) .content{padding:0.7em 0.57em}:host[icon]{border-radius:50%}:host[icon] .content{padding:8px}:host[clear-size]{min-width:0} diff --git a/lib/src/components/material_button/material_button_base.dart b/lib/src/components/material_button/material_button_base.dart index 7b3d7097c..758dddd06 100644 --- a/lib/src/components/material_button/material_button_base.dart +++ b/lib/src/components/material_button/material_button_base.dart @@ -5,10 +5,11 @@ import 'dart:async'; import 'dart:html'; -import '../button_decorator/button_decorator.dart'; -import '../../utils/angular/properties/properties.dart'; import 'package:angular2/angular2.dart'; +import '../../utils/angular/properties/properties.dart'; +import '../button_decorator/button_decorator.dart'; + /// A base class from which to build buttons. /// /// __Expected Properties:__ diff --git a/lib/src/components/material_button/material_fab.dart b/lib/src/components/material_button/material_fab.dart index ea7333d29..a1f0ecf3e 100644 --- a/lib/src/components/material_button/material_fab.dart +++ b/lib/src/components/material_button/material_fab.dart @@ -2,9 +2,9 @@ // 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 '../material_ripple/material_ripple.dart'; import 'package:angular2/angular2.dart'; +import '../material_ripple/material_ripple.dart'; import 'material_button_base.dart'; /// Material FAB is a Floating Action Button. It is round, and behaves mostly diff --git a/lib/src/components/material_button/material_fab.scss.css b/lib/src/components/material_button/material_fab.scss.css index 3db8ddbdb..249f1b7ba 100644 --- a/lib/src/components/material_button/material_fab.scss.css +++ b/lib/src/components/material_button/material_fab.scss.css @@ -3,4 +3,4 @@ * 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. */ -:host{font-size:14px;font-weight:500;text-transform:uppercase;-moz-user-select:-moz-none;-ms-user-select:none;-webkit-user-select:none;user-select:none;background:transparent;border-radius:inherit;box-sizing:border-box;cursor:pointer;display:inline-block;letter-spacing:.01em;line-height:normal;outline:none;position:relative;text-align:center;border-radius:28px}:host.acx-theme-dark{color:#fff}:host.acx-theme-dark[raised]{background-color:#4285f4}:host[animated]{transition:box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1)}:host[elevation="1"]{/*! @noflip */;box-shadow:0 2px 2px 0 rgba(0,0,0,0.14),0 3px 1px -2px rgba(0,0,0,0.12),0 1px 5px 0 rgba(0,0,0,0.2)}:host[elevation="2"]{/*! @noflip */;box-shadow:0 4px 5px 0 rgba(0,0,0,0.14),0 1px 10px 0 rgba(0,0,0,0.12),0 2px 4px -1px rgba(0,0,0,0.2)}:host[elevation="3"]{/*! @noflip */;box-shadow:0 6px 10px 0 rgba(0,0,0,0.14),0 1px 18px 0 rgba(0,0,0,0.12),0 3px 5px -1px rgba(0,0,0,0.2)}:host[elevation="4"]{/*! @noflip */;box-shadow:0 8px 10px 1px rgba(0,0,0,0.14),0 3px 14px 2px rgba(0,0,0,0.12),0 5px 5px -3px rgba(0,0,0,0.2)}:host[elevation="5"]{/*! @noflip */;box-shadow:0 16px 24px 2px rgba(0,0,0,0.14),0 6px 30px 5px rgba(0,0,0,0.12),0 8px 10px -5px rgba(0,0,0,0.2)}:host[elevation="6"]{/*! @noflip */;box-shadow:0 24px 38px 3px rgba(0,0,0,0.14),0 9px 46px 8px rgba(0,0,0,0.12),0 11px 15px -7px rgba(0,0,0,0.2)}:host:not([icon]){margin:0 .29em}:host[dense]{height:32px;font-size:13px}:host[disabled]{color:rgba(0,0,0,0.26);cursor:not-allowed}:host[disabled].acx-theme-dark{color:rgba(255,255,255,0.3)}:host[disabled]>*{pointer-events:none}:host[disabled][raised]{background:rgba(0,0,0,0.12)}:host[disabled][raised].acx-theme-dark{background:#4285f4}:host:not([raised]):not([disabled]):not([icon]):hover{background-color:rgba(158,158,158,0.2)}:host.is-focused::after{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;background-color:currentColor;opacity:0.12;border-radius:inherit;pointer-events:none}:host:not([raised]),:host[disabled][raised]{box-shadow:none}:host[no-ink] material-ripple{display:none}:host[clear-size]{margin:0}:host .content{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center}:host .content>::content *{text-transform:inherit}:host .content{-webkit-justify-content:center;justify-content:center;height:56px;width:56px}:host glyph /deep/ i{font-size:24px;height:1em;line-height:1em;width:1em}:host[mini]{font-size:14px;font-weight:500;text-transform:uppercase;-moz-user-select:-moz-none;-ms-user-select:none;-webkit-user-select:none;user-select:none;background:transparent;border-radius:inherit;box-sizing:border-box;cursor:pointer;display:inline-block;letter-spacing:.01em;line-height:normal;outline:none;position:relative;text-align:center;border-radius:20px}:host[mini].acx-theme-dark{color:#fff}:host[mini].acx-theme-dark[raised]{background-color:#4285f4}:host[mini][animated]{transition:box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1)}:host[mini][elevation="1"]{/*! @noflip */;box-shadow:0 2px 2px 0 rgba(0,0,0,0.14),0 3px 1px -2px rgba(0,0,0,0.12),0 1px 5px 0 rgba(0,0,0,0.2)}:host[mini][elevation="2"]{/*! @noflip */;box-shadow:0 4px 5px 0 rgba(0,0,0,0.14),0 1px 10px 0 rgba(0,0,0,0.12),0 2px 4px -1px rgba(0,0,0,0.2)}:host[mini][elevation="3"]{/*! @noflip */;box-shadow:0 6px 10px 0 rgba(0,0,0,0.14),0 1px 18px 0 rgba(0,0,0,0.12),0 3px 5px -1px rgba(0,0,0,0.2)}:host[mini][elevation="4"]{/*! @noflip */;box-shadow:0 8px 10px 1px rgba(0,0,0,0.14),0 3px 14px 2px rgba(0,0,0,0.12),0 5px 5px -3px rgba(0,0,0,0.2)}:host[mini][elevation="5"]{/*! @noflip */;box-shadow:0 16px 24px 2px rgba(0,0,0,0.14),0 6px 30px 5px rgba(0,0,0,0.12),0 8px 10px -5px rgba(0,0,0,0.2)}:host[mini][elevation="6"]{/*! @noflip */;box-shadow:0 24px 38px 3px rgba(0,0,0,0.14),0 9px 46px 8px rgba(0,0,0,0.12),0 11px 15px -7px rgba(0,0,0,0.2)}:host[mini]:not([icon]){margin:0 .29em}:host[mini][dense]{height:32px;font-size:13px}:host[mini][disabled]{color:rgba(0,0,0,0.26);cursor:not-allowed}:host[mini][disabled].acx-theme-dark{color:rgba(255,255,255,0.3)}:host[mini][disabled]>*{pointer-events:none}:host[mini][disabled][raised]{background:rgba(0,0,0,0.12)}:host[mini][disabled][raised].acx-theme-dark{background:#4285f4}:host[mini]:not([raised]):not([disabled]):not([icon]):hover{background-color:rgba(158,158,158,0.2)}:host[mini].is-focused::after{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;background-color:currentColor;opacity:0.12;border-radius:inherit;pointer-events:none}:host[mini]:not([raised]),:host[mini][disabled][raised]{box-shadow:none}:host[mini][no-ink] material-ripple{display:none}:host[mini][clear-size]{margin:0}:host[mini] .content{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center}:host[mini] .content>::content *{text-transform:inherit}:host[mini] .content{-webkit-justify-content:center;justify-content:center;height:40px;width:40px} +:host{font-size:14px;font-weight:500;text-transform:uppercase;-moz-user-select:-moz-none;-ms-user-select:none;-webkit-user-select:none;user-select:none;background:transparent;border-radius:inherit;box-sizing:border-box;cursor:pointer;display:inline-block;letter-spacing:.01em;line-height:normal;outline:none;position:relative;text-align:center;border-radius:28px}:host.acx-theme-dark{color:#fff}:host.acx-theme-dark[raised]{background-color:#4285f4}:host[animated]{transition:box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1)}:host[elevation="1"]{/*! @noflip */;box-shadow:0 2px 2px 0 rgba(0,0,0,0.14),0 3px 1px -2px rgba(0,0,0,0.12),0 1px 5px 0 rgba(0,0,0,0.2)}:host[elevation="2"]{/*! @noflip */;box-shadow:0 4px 5px 0 rgba(0,0,0,0.14),0 1px 10px 0 rgba(0,0,0,0.12),0 2px 4px -1px rgba(0,0,0,0.2)}:host[elevation="3"]{/*! @noflip */;box-shadow:0 6px 10px 0 rgba(0,0,0,0.14),0 1px 18px 0 rgba(0,0,0,0.12),0 3px 5px -1px rgba(0,0,0,0.2)}:host[elevation="4"]{/*! @noflip */;box-shadow:0 8px 10px 1px rgba(0,0,0,0.14),0 3px 14px 2px rgba(0,0,0,0.12),0 5px 5px -3px rgba(0,0,0,0.2)}:host[elevation="5"]{/*! @noflip */;box-shadow:0 16px 24px 2px rgba(0,0,0,0.14),0 6px 30px 5px rgba(0,0,0,0.12),0 8px 10px -5px rgba(0,0,0,0.2)}:host[elevation="6"]{/*! @noflip */;box-shadow:0 24px 38px 3px rgba(0,0,0,0.14),0 9px 46px 8px rgba(0,0,0,0.12),0 11px 15px -7px rgba(0,0,0,0.2)}:host:not([icon]){margin:0 .29em}:host[dense]{height:32px;font-size:13px}:host[disabled]{color:rgba(0,0,0,0.26);cursor:not-allowed}:host[disabled].acx-theme-dark{color:rgba(255,255,255,0.3)}:host[disabled]>*{pointer-events:none}:host[disabled][raised]{background:rgba(0,0,0,0.12)}:host[disabled][raised].acx-theme-dark{background:#4285f4}:host:not([raised]):not([disabled]):not([icon]):hover{background-color:rgba(158,158,158,0.2)}:host.is-focused::after{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;background-color:currentColor;opacity:0.12;border-radius:inherit;pointer-events:none}:host:not([raised]),:host[disabled][raised]{box-shadow:none}:host[no-ink] material-ripple{display:none}:host[clear-size]{margin:0}:host .content{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center}:host .content{-webkit-justify-content:center;justify-content:center;height:56px;width:56px}:host glyph /deep/ i{font-size:24px;height:1em;line-height:1em;width:1em}:host[mini]{font-size:14px;font-weight:500;text-transform:uppercase;-moz-user-select:-moz-none;-ms-user-select:none;-webkit-user-select:none;user-select:none;background:transparent;border-radius:inherit;box-sizing:border-box;cursor:pointer;display:inline-block;letter-spacing:.01em;line-height:normal;outline:none;position:relative;text-align:center;border-radius:20px}:host[mini].acx-theme-dark{color:#fff}:host[mini].acx-theme-dark[raised]{background-color:#4285f4}:host[mini][animated]{transition:box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1)}:host[mini][elevation="1"]{/*! @noflip */;box-shadow:0 2px 2px 0 rgba(0,0,0,0.14),0 3px 1px -2px rgba(0,0,0,0.12),0 1px 5px 0 rgba(0,0,0,0.2)}:host[mini][elevation="2"]{/*! @noflip */;box-shadow:0 4px 5px 0 rgba(0,0,0,0.14),0 1px 10px 0 rgba(0,0,0,0.12),0 2px 4px -1px rgba(0,0,0,0.2)}:host[mini][elevation="3"]{/*! @noflip */;box-shadow:0 6px 10px 0 rgba(0,0,0,0.14),0 1px 18px 0 rgba(0,0,0,0.12),0 3px 5px -1px rgba(0,0,0,0.2)}:host[mini][elevation="4"]{/*! @noflip */;box-shadow:0 8px 10px 1px rgba(0,0,0,0.14),0 3px 14px 2px rgba(0,0,0,0.12),0 5px 5px -3px rgba(0,0,0,0.2)}:host[mini][elevation="5"]{/*! @noflip */;box-shadow:0 16px 24px 2px rgba(0,0,0,0.14),0 6px 30px 5px rgba(0,0,0,0.12),0 8px 10px -5px rgba(0,0,0,0.2)}:host[mini][elevation="6"]{/*! @noflip */;box-shadow:0 24px 38px 3px rgba(0,0,0,0.14),0 9px 46px 8px rgba(0,0,0,0.12),0 11px 15px -7px rgba(0,0,0,0.2)}:host[mini]:not([icon]){margin:0 .29em}:host[mini][dense]{height:32px;font-size:13px}:host[mini][disabled]{color:rgba(0,0,0,0.26);cursor:not-allowed}:host[mini][disabled].acx-theme-dark{color:rgba(255,255,255,0.3)}:host[mini][disabled]>*{pointer-events:none}:host[mini][disabled][raised]{background:rgba(0,0,0,0.12)}:host[mini][disabled][raised].acx-theme-dark{background:#4285f4}:host[mini]:not([raised]):not([disabled]):not([icon]):hover{background-color:rgba(158,158,158,0.2)}:host[mini].is-focused::after{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;background-color:currentColor;opacity:0.12;border-radius:inherit;pointer-events:none}:host[mini]:not([raised]),:host[mini][disabled][raised]{box-shadow:none}:host[mini][no-ink] material-ripple{display:none}:host[mini][clear-size]{margin:0}:host[mini] .content{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center}:host[mini] .content{-webkit-justify-content:center;justify-content:center;height:40px;width:40px} diff --git a/lib/src/components/material_checkbox/material_checkbox.dart b/lib/src/components/material_checkbox/material_checkbox.dart index c9191049a..3ac4ca727 100644 --- a/lib/src/components/material_checkbox/material_checkbox.dart +++ b/lib/src/components/material_checkbox/material_checkbox.dart @@ -2,14 +2,15 @@ // 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:async'; import 'dart:html'; -import '../glyph/glyph.dart'; -import '../material_ripple/material_ripple.dart'; +import 'package:angular2/angular2.dart'; + import '../../model/ui/icon.dart'; -import '../../utils/async/async.dart'; import '../../utils/browser/events/events.dart'; -import 'package:angular2/angular2.dart'; +import '../glyph/glyph.dart'; +import '../material_ripple/material_ripple.dart'; const Icon uncheckedIcon = const Icon('check_box_outline_blank'); const Icon checkedIcon = const Icon('check_box'); @@ -57,8 +58,6 @@ const indeterminateAriaState = 'mixed'; /// - `checked: bool` -- Published when the check state changes. /// - `indeterminate: bool` -- Published when the indeterminate state changes. /// -/// TODO(google): restore example usage (latest ng2 tries to eval example code) -/// @Component( selector: 'material-checkbox', inputs: const [ @@ -69,11 +68,6 @@ const indeterminateAriaState = 'mixed'; 'label', 'themeColor' ], - outputs: const [ - 'onChange: change', - 'onChecked: checkedChange', - 'onIndeterminate: indeterminateChange' - ], host: const { 'class': 'themeable', '(click)': r'handleClick($event)', @@ -135,14 +129,20 @@ class MaterialCheckboxComponent implements ControlValueAccessor { /// Fired when checkbox is checked or unchecked, but not when set /// indeterminate. Sends the state of [checked]. - final onChecked = new LazyEventEmitter.broadcast(sync: false); + @Output('checkedChange') + Stream get onChecked => _onChecked.stream; + final _onChecked = new StreamController.broadcast(); /// Fired when checkbox goes in and out of indeterminate state, but not when /// set to checked. Sends the state of [indeterminate]; - final onIndeterminate = new LazyEventEmitter(); + @Output('indeterminateChange') + Stream get onIndeterminate => _onIndeterminate.stream; + final _onIndeterminate = new StreamController.broadcast(); /// Fired when checkbox state changes, sends [checkedStr], i.e. ARIA state. - final onChange = new LazyEventEmitter(); + @Output('change') + Stream get onChange => _onChange.stream; + final _onChange = new StreamController.broadcast(); /// Determines the state to go into when [indeterminate] state is toggled. /// `true` will go to checked and `false` will go to unchecked. @@ -211,16 +211,16 @@ class MaterialCheckboxComponent implements ControlValueAccessor { : _checked ? checkedIcon : uncheckedIcon; if (_checked != prevChecked) { - onChecked.add(_checked); + _onChecked.add(_checked); } if (_indeterminate != prevIndeterminate) { - onIndeterminate.add(_indeterminate); + _onIndeterminate.add(_indeterminate); } if (_checkedStr != prevState) { _syncAriaChecked(); - onChange.add(_checkedStr); + _onChange.add(_checkedStr); } } diff --git a/lib/src/components/material_chips/material_chip.dart b/lib/src/components/material_chips/material_chip.dart index 451423372..71299884c 100644 --- a/lib/src/components/material_chips/material_chip.dart +++ b/lib/src/components/material_chips/material_chip.dart @@ -5,13 +5,13 @@ import 'package:angular2/angular2.dart'; import 'package:intl/intl.dart'; -import '../button_decorator/button_decorator.dart'; -import '../focus/focus.dart'; -import '../glyph/glyph.dart'; import '../../model/selection/selection_model.dart'; import '../../model/ui/has_renderer.dart'; import '../../utils/async/async.dart'; import '../../utils/id_generator/id_generator.dart'; +import '../button_decorator/button_decorator.dart'; +import '../focus/focus.dart'; +import '../glyph/glyph.dart'; /// A "chip" widget renders an object in the 'chip' format - a rounded box with /// a shadow, typically used in a horizontal list. Any object implementing the diff --git a/lib/src/components/material_chips/material_chips.dart b/lib/src/components/material_chips/material_chips.dart index e04804664..c3cea8fd6 100644 --- a/lib/src/components/material_chips/material_chips.dart +++ b/lib/src/components/material_chips/material_chips.dart @@ -4,10 +4,10 @@ import 'package:angular2/angular2.dart'; -import './material_chip.dart'; import '../../model/selection/selection_model.dart'; import '../../model/ui/has_renderer.dart'; import '../../utils/disposer/disposer.dart'; +import './material_chip.dart'; /// A __chips__ collection widget, displaying a list of objects as Chips. /// diff --git a/lib/src/components/material_dialog/material_dialog.dart b/lib/src/components/material_dialog/material_dialog.dart index b18b81cc8..4303e9734 100644 --- a/lib/src/components/material_dialog/material_dialog.dart +++ b/lib/src/components/material_dialog/material_dialog.dart @@ -4,12 +4,13 @@ import 'dart:html'; -import '../focus/focus_trap.dart'; +import 'package:angular2/angular2.dart'; + import '../../laminate/components/modal/modal.dart'; import '../../utils/angular/properties/properties.dart'; import '../../utils/browser/dom_service/dom_service.dart'; import '../../utils/disposer/disposer.dart'; -import 'package:angular2/angular2.dart'; +import '../focus/focus_trap.dart'; /// A styled container following the Material Spec for Dialogs. /// diff --git a/lib/src/components/material_dialog/material_dialog.scss.css b/lib/src/components/material_dialog/material_dialog.scss.css index e4a4d0dfb..42c40225c 100644 --- a/lib/src/components/material_dialog/material_dialog.scss.css +++ b/lib/src/components/material_dialog/material_dialog.scss.css @@ -3,4 +3,5 @@ * 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. */ -:host{/*! @noflip */;box-shadow:0 24px 38px 3px rgba(0,0,0,0.14),0 9px 46px 8px rgba(0,0,0,0.12),0 11px 15px -7px rgba(0,0,0,0.2);background:#fff;border-radius:2px;display:block;height:auto;overflow:hidden}focus-trap{height:inherit;max-height:inherit;width:100%}.wrapper{display:-webkit-flex;-webkit-flex-direction:column;display:flex;flex-direction:column;height:inherit;max-height:inherit}.error{-moz-box-sizing:border-box;box-sizing:border-box;-ms-flex-negative:0;-webkit-flex-shrink:0;flex-shrink:0;font-size:13px;font-weight:400;background:#eee;color:#c53929;padding:0 24px;transition:padding 218ms cubic-bezier(0.4, 0, 0.2, 1) 0s;width:100%}.error.expanded{border-bottom:1px #e0e0e0 solid;border-top:1px #e0e0e0 solid;padding:8px 24px}main{-moz-box-sizing:border-box;box-sizing:border-box;-ms-flex-positive:1;-webkit-flex-grow:1;flex-grow:1;font-size:13px;font-weight:400;color:rgba(0,0,0,0.87);overflow:auto;padding:0 24px;width:100%}main.top-scroll-stroke{border-top:1px #e0e0e0 solid}main.bottom-scroll-stroke{border-bottom:1px #e0e0e0 solid}footer{-moz-box-sizing:border-box;box-sizing:border-box;-ms-flex-negative:0;-webkit-flex-shrink:0;flex-shrink:0;padding:0 8px 8px;width:100%}:host .wrapper>header{-moz-box-sizing:border-box;box-sizing:border-box;padding:24px 24px 0;width:100%;-ms-flex-negative:0;-webkit-flex-shrink:0;flex-shrink:0}:host .wrapper>header /deep/ h3{font-size:20px;font-weight:500;margin:0 0 8px}:host .wrapper>header /deep/ p{font-size:12px;font-weight:400;margin:0}:host .wrapper>footer /deep/ [footer]{display:-webkit-flex;-webkit-flex-shrink:0;-webkit-justify-content:flex-end;display:flex;flex-shrink:0;justify-content:flex-end}:host[headered] .wrapper>header{-moz-box-sizing:border-box;box-sizing:border-box;padding:24px 24px 0;width:100%;background:#616161;padding-bottom:16px}:host[headered] .wrapper>header /deep/ h3{font-size:20px;font-weight:500;margin:0 0 8px}:host[headered] .wrapper>header /deep/ p{font-size:12px;font-weight:400;margin:0}:host[headered] .wrapper>header /deep/ h3{color:#fff;margin-bottom:4px}:host[headered] .wrapper>header /deep/ p{color:#fff}:host[headered] .wrapper>main{padding-top:8px}:host[info] .wrapper>header /deep/ h3{line-height:40px;margin:0}:host[info] .wrapper>header /deep/ material-button{float:right}:host[info] .wrapper>footer{padding-bottom:24px} +:host{/*! @noflip */box-shadow:0 24px 38px 3px rgba(0,0,0,0.14),0 9px 46px 8px rgba(0,0,0,0.12),0 11px 15px -7px rgba(0,0,0,0.2);background:#fff;border-radius:2px;display:block;height:auto;overflow:hidden}focus-trap{height:inherit;max-height:inherit;width:100%}.wrapper{display:-webkit-flex;-webkit-flex-direction:column;display:flex;flex-direction:column;height:inherit;max-height:inherit}.error{-moz-box-sizing:border-box;box-sizing:border-box;-ms-flex-negative:0;-webkit-flex-shrink:0;flex-shrink:0;font-size:13px;font-weight:400;background:#eee;color:#c53929;padding:0 24px;transition:padding 218ms cubic-bezier(0.4, 0, 0.2, 1) 0s;width:100%}.error.expanded{border-bottom:1px #e0e0e0 solid;border-top:1px #e0e0e0 solid;padding:8px 24px}main{-moz-box-sizing:border-box;box-sizing:border-box;-ms-flex-positive:1;-webkit-flex-grow:1;flex-grow:1;font-size:13px;font-weight:400;color:rgba(0,0,0,0.87);overflow:auto;padding:0 24px;width:100%}main.top-scroll-stroke{border-top:1px #e0e0e0 solid}main.bottom-scroll-stroke{border-bottom:1px #e0e0e0 solid}footer{-moz-box-sizing:border-box;box-sizing:border-box;-ms-flex-negative:0;-webkit-flex-shrink:0;flex-shrink:0;padding:0 8px 8px;width:100%}:host .wrapper>header{-moz-box-sizing:border-box;box-sizing:border-box;padding:24px 24px 0;width:100%;-ms-flex-negative:0;-webkit-flex-shrink:0;flex-shrink:0}:host .wrapper>header /deep/ h3{font-size:20px;font-weight:500;margin:0 0 8px}:host .wrapper>header /deep/ p{font-size:12px;font-weight:400;margin:0}:host .wrapper>footer /deep/ [footer]{display:-webkit-flex;-webkit-flex-shrink:0;-webkit-justify-content:flex-end;display:flex;flex-shrink:0;justify-content:flex-end}:host[headered] .wrapper>header{-moz-box-sizing:border-box;box-sizing:border-box;padding:24px 24px 0;width:100%;background:#616161;padding-bottom:16px}:host[headered] .wrapper>header /deep/ h3{font-size:20px;font-weight:500;margin:0 0 8px}:host[headered] .wrapper>header /deep/ p{font-size:12px;font-weight:400;margin:0}:host[headered] .wrapper>header /deep/ h3{color:#fff;margin-bottom:4px}:host[headered] .wrapper>header /deep/ p{color:#fff}:host[headered] .wrapper>main{padding-top:8px}:host[info] .wrapper>header /deep/ h3{line-height:40px;margin:0}:host[info] .wrapper>header /deep/ material-button{float:right}:host[info] .wrapper>footer{padding-bottom:24px} + diff --git a/lib/src/components/material_expansionpanel/material_expansionpanel.dart b/lib/src/components/material_expansionpanel/material_expansionpanel.dart index 1e1330acb..7743517ea 100644 --- a/lib/src/components/material_expansionpanel/material_expansionpanel.dart +++ b/lib/src/components/material_expansionpanel/material_expansionpanel.dart @@ -4,19 +4,20 @@ import 'dart:async'; -import '../button_decorator/button_decorator.dart'; -import '../content/deferred_content_aware.dart'; -import '../focus/focus.dart'; -import '../glyph/glyph.dart'; -import '../material_yes_no_buttons/material_yes_no_buttons.dart'; +import 'package:angular2/angular2.dart'; +import 'package:intl/intl.dart'; + import '../../model/action/async_action.dart'; import '../../utils/angular/managed_zone/angular_2.dart'; import '../../utils/angular/properties/properties.dart'; import '../../utils/async/async.dart'; import '../../utils/browser/dom_service/dom_service.dart'; import '../../utils/disposer/disposer.dart'; -import 'package:angular2/angular2.dart'; -import 'package:intl/intl.dart'; +import '../button_decorator/button_decorator.dart'; +import '../content/deferred_content_aware.dart'; +import '../focus/focus.dart'; +import '../glyph/glyph.dart'; +import '../material_yes_no_buttons/material_yes_no_buttons.dart'; /// A material-styled expansion-panel. /// @@ -84,6 +85,7 @@ import 'package:intl/intl.dart'; /// - `cancelText: String` -- The text to be shown on the cancel button (e.g. /// "dismiss", "not now"). The default text is "cancel". /// - `saveDisabled: bool` -- If true, the save button is disabled. +/// - `enterAccepts: bool` -- If true, enterAccepts is enabled. /// /// __Events:__ /// @@ -108,12 +110,15 @@ import 'package:intl/intl.dart'; MaterialSaveCancelButtonsDirective, MaterialYesNoButtonsComponent, NgIf, + EnterAcceptsDirective, + KeyUpBoundaryDirective ], providers: const [ const Provider(DeferredContentAware, useExisting: MaterialExpansionPanel) ], templateUrl: 'material_expansionpanel.html', styleUrls: const ['material_expansionpanel.scss.css'], + preserveWhitespace: false, changeDetection: ChangeDetectionStrategy.OnPush) class MaterialExpansionPanel implements DeferredContentAware, OnInit, OnDestroy { @@ -239,6 +244,15 @@ class MaterialExpansionPanel @Input() bool showSaveCancel = true; + bool _enterAccepts = false; + @Input() + set enterAccepts(value) { + _enterAccepts = getBool(value); + } + + /// Flag for enabling the EnterAcceptsDirective directive. + bool get enterAccepts => _enterAccepts; + /// The text to be shown on the save button. /// /// For example: "Ok", "Apply", etc. Default value is "Save". @@ -288,13 +302,13 @@ class MaterialExpansionPanel examples: const {'panelName': 'Conversions'}); final _openController = - new LazyStreamController>.broadcast(sync: true); + new StreamController>.broadcast(sync: true); final _closeController = - new LazyStreamController>.broadcast(sync: true); + new StreamController>.broadcast(sync: true); final _saveController = - new LazyStreamController>.broadcast(sync: true); + new StreamController>.broadcast(sync: true); final _cancelController = - new LazyStreamController>.broadcast(sync: true); + new StreamController>.broadcast(sync: true); /// Event fired when panel is trying to close. /// @@ -348,12 +362,12 @@ class MaterialExpansionPanel } Future expand({bool byUserAction: true}) { - if (disabled) return new Future.value(false); + if (disabled && byUserAction) return new Future.value(false); return changeState(true, byUserAction, _openController); } Future collapse({bool byUserAction: true}) { - if (disabled) return new Future.value(false); + if (disabled && byUserAction) return new Future.value(false); return changeState(false, byUserAction, _closeController); } diff --git a/lib/src/components/material_expansionpanel/material_expansionpanel.html b/lib/src/components/material_expansionpanel/material_expansionpanel.html index 0dbd71b61..25bdd8727 100644 --- a/lib/src/components/material_expansionpanel/material_expansionpanel.html +++ b/lib/src/components/material_expansionpanel/material_expansionpanel.html @@ -8,7 +8,8 @@ [attr.aria-label]="name" [attr.aria-expanded]="isExpanded" [class.open]="isExpanded" - [class.background]="anotherExpanded"> + [class.background]="anotherExpanded" + keyupBoundary>
diff --git a/lib/src/components/material_expansionpanel/material_expansionpanel_set.dart b/lib/src/components/material_expansionpanel/material_expansionpanel_set.dart index 7672b7287..addca6ca3 100644 --- a/lib/src/components/material_expansionpanel/material_expansionpanel_set.dart +++ b/lib/src/components/material_expansionpanel/material_expansionpanel_set.dart @@ -6,7 +6,6 @@ import 'package:angular2/angular2.dart'; import '../../model/action/async_action.dart'; import '../../utils/disposer/disposer.dart'; - import 'material_expansionpanel.dart'; /// A directive which will turn a set of expansion panels into an accordian diff --git a/lib/src/components/material_expansionpanel/src/material_expansionpanel_auto_dismiss.dart b/lib/src/components/material_expansionpanel/src/material_expansionpanel_auto_dismiss.dart index 54f9e61ad..691f6c0e4 100644 --- a/lib/src/components/material_expansionpanel/src/material_expansionpanel_auto_dismiss.dart +++ b/lib/src/components/material_expansionpanel/src/material_expansionpanel_auto_dismiss.dart @@ -7,8 +7,8 @@ import 'dart:html'; import 'package:angular2/angular2.dart'; -import '../material_expansionpanel.dart'; import '../../../laminate/overlay/module.dart' show overlayContainerToken; +import '../material_expansionpanel.dart'; /// A directive that automatically collapses [MaterialExpansionPanel]. /// diff --git a/lib/src/components/material_input/base_material_input.dart b/lib/src/components/material_input/base_material_input.dart index 54bc8fa25..2a6de6089 100644 --- a/lib/src/components/material_input/base_material_input.dart +++ b/lib/src/components/material_input/base_material_input.dart @@ -5,15 +5,14 @@ import 'dart:async'; import 'dart:html'; -import '../focus/focus.dart'; -import '../mixins/focusable_mixin.dart'; -import '../../utils/angular/properties/properties.dart'; -import '../../utils/async/async.dart'; -import '../../utils/disposer/disposer.dart'; import 'package:angular2/angular2.dart'; import 'package:intl/intl.dart'; import 'package:quiver/strings.dart' show isEmpty, isNotEmpty; +import '../../utils/angular/properties/properties.dart'; +import '../../utils/disposer/disposer.dart'; +import '../focus/focus.dart'; +import '../mixins/focusable_mixin.dart'; import 'deferred_validator.dart'; /// Key used in the Control's error map, when there is an error. @@ -243,19 +242,18 @@ class BaseMaterialInput extends FocusableMixin } final _keypressController = - new LazyStreamController.broadcast(sync: true); + new StreamController.broadcast(sync: true); /// Publishes events whenever input text changes (each keypress). Stream get onKeypress => _keypressController.stream; - final _changeController = - new LazyStreamController.broadcast(sync: true); + final _changeController = new StreamController.broadcast(sync: true); /// Publishes events when a change event is fired. (On enter, or on blur.) Stream get onChange => _changeController.stream; final _blurController = - new LazyStreamController.broadcast(sync: true); + new StreamController.broadcast(sync: true); /// Publishes events when a blur event is fired. Stream get onBlur => _blurController.stream; diff --git a/lib/src/components/material_input/material_input.dart b/lib/src/components/material_input/material_input.dart index 0b8f1054a..dba8eb153 100644 --- a/lib/src/components/material_input/material_input.dart +++ b/lib/src/components/material_input/material_input.dart @@ -2,13 +2,13 @@ // 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 '../focus/focus.dart'; -import '../glyph/glyph.dart'; -import '../../utils/angular/reference/reference.dart'; import 'package:angular2/angular2.dart'; import 'package:quiver/strings.dart' show isNotEmpty; -import '../../utils/angular/properties/properties.dart'; +import '../../utils/angular/properties/properties.dart'; +import '../../utils/angular/reference/reference.dart'; +import '../focus/focus.dart'; +import '../glyph/glyph.dart'; import 'base_material_input.dart'; import 'deferred_validator.dart'; import 'material_input_default_value_accessor.dart'; diff --git a/lib/src/components/material_input/material_input.html b/lib/src/components/material_input/material_input.html index ebbf9de1a..3a71d6cb0 100644 --- a/lib/src/components/material_input/material_input.html +++ b/lib/src/components/material_input/material_input.html @@ -96,7 +96,7 @@ (focus)="$event.stopPropagation()">   - -