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

Commit 875afc2

Browse files
authored
Add Material Auto Suggest Input component (#164)
* Material Checkbox: Fix disabled state to match material-spec which is a light grey not a certain opacity of the checkbox. * Material Chips: Add high density mixin. * Material Input: * Add selectAll function for calling the underlying input element's select method that focuses the input and selects all its content. * Add ability to update the data on a change instead of keypress or blur for the standard Material Input. * Remove error color from floating label to conform to material spec. * Material Popup: * Fix mismatch between the variable used as a reference point for repositioning the popup and the variable used to initially set the popup's position. This caused issues when the tab was in the background because these variables could have changed significantly before the next animation frame fired (since requestAnimationFrame is throttled when the tab isn't visible). * Use `_sourceDimensions` instead of `layoutRects[1]` to take overlay container offset into account. Using popupSourceLayoutStream directly caused issues when the .acx-overlay-container offset was not (0, 0). * Material Select: Fix orientation when groups are used. * Scorecard: * Fix styling for extra-big cards. * Fix to allow selectable scorecards in a "custom" scoreboard. * Add a tooltip field enabling scenarios where more information about the value can be displayed. * Theme: Prepare dark theme for upcoming Visibility.None change. * Cleanup unused fields. * Update default material scrollbar width to 8px. This is easier to use with a mouse or touch input compared to the previous default of 4px. * Cleanup unused styles and reorganize `.scss` files. * Remove link hover style. * Migrate uses of `ElementRef` to `Element`. * Remove `visibility: Visibility.none` from all components since compatibility is not yet fully supported in Angular. Will be added in a future release. * Update documentation.
1 parent 2d5c3b8 commit 875afc2

File tree

77 files changed

+1447
-510
lines changed

Some content is hidden

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

77 files changed

+1447
-510
lines changed

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
## 0.7.1
2+
3+
* Add Material Auto Suggest Input component.
4+
* Material Checkbox: Fix disabled state to match material-spec which is a light
5+
grey not a certain opacity of the checkbox.
6+
* Material Chips: Add high density mixin.
7+
* Material Input:
8+
* Add selectAll function for calling the underlying input element's select
9+
method that focuses the input and selects all its content.
10+
* Add ability to update the data on a change instead of keypress or blur for
11+
the standard Material Input.
12+
* Remove error color from floating label to conform to material spec.
13+
* Material Popup:
14+
* Fix mismatch between the variable used as a reference point for
15+
repositioning the popup and the variable used to initially set the popup's
16+
position. This caused issues when the tab was in the background because
17+
these variables could have changed significantly before the next animation
18+
frame fired (since requestAnimationFrame is throttled when the tab isn't
19+
visible).
20+
* Use `_sourceDimensions` instead of `layoutRects[1]` to take overlay
21+
container offset into account. Using popupSourceLayoutStream directly
22+
caused issues when the .acx-overlay-container offset was not (0, 0).
23+
* Material Select: Fix orientation when groups are used.
24+
* Scorecard:
25+
* Fix styling for extra-big cards.
26+
* Fix to allow selectable scorecards in a "custom" scoreboard.
27+
* Add a tooltip field enabling scenarios where more information about the
28+
value can be displayed.
29+
* Theme: Prepare dark theme for upcoming Visibility.None change.
30+
* Cleanup unused fields.
31+
* Update default material scrollbar width to 8px. This is easier to use with a
32+
mouse or touch input compared to the previous default of 4px.
33+
* Cleanup unused styles and reorganize `.scss` files.
34+
* Remove link hover style.
35+
* Migrate uses of `ElementRef` to `Element`.
36+
* Remove `visibility: Visibility.none` from all components since compatibility
37+
is not yet fully supported. Will be added in an upcoming release.
38+
* Update documentation.
39+
140
## 0.7.0
241

342
* Material Button: Add raised mixin so that buttons can be made to be raised

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ developers to be able to use the package as soon as possible.
3232
*`<material-list>`
3333
*`<material-select>`
3434
*`<material-tree>`
35-
* `<material-auto-suggest-input>`
35+
* `<material-auto-suggest-input>`
3636
*`<material-date-range-picker>`
3737
*`<material-menu>`
3838
* many more, including a fast table

lib/src/all_components.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ export 'components/focus/focus_trap.dart';
2121
export 'components/focus/keyboard_only_focus_indicator.dart';
2222
export 'components/forms/error_renderer.dart';
2323
export 'components/glyph/glyph.dart';
24+
export 'components/highlighted_text/highlighted_text.dart';
25+
export 'components/highlighted_text/highlighted_value.dart';
2426
export 'components/material_button/material_button.dart';
2527
export 'components/material_button/material_button_base.dart';
2628
export 'components/material_button/material_fab.dart';
@@ -36,6 +38,7 @@ export 'components/material_icon/material_icon.dart';
3638
export 'components/material_input/base_material_input.dart';
3739
export 'components/material_input/deferred_validator.dart';
3840
export 'components/material_input/input_wrapper.dart';
41+
export 'components/material_input/material_auto_suggest_input.dart';
3942
export 'components/material_input/material_input.dart'
4043
hide materialInputErrorKey;
4144
export 'components/material_input/material_input_default_value_accessor.dart';
@@ -77,12 +80,14 @@ export 'components/material_yes_no_buttons/material_yes_no_buttons.dart';
7780
export 'components/mixins/button_wrapper.dart';
7881
export 'components/mixins/focusable_mixin.dart';
7982
export 'components/mixins/has_tab_index.dart';
83+
export 'components/mixins/highlight_assistant_mixin.dart';
8084
export 'components/mixins/material_dropdown_base.dart';
8185
export 'components/mixins/track_layout_changes.dart';
8286
export 'components/reorder_list/reorder_events.dart';
8387
export 'components/reorder_list/reorder_list.dart';
8488
export 'components/scorecard/scoreboard.dart';
8589
export 'components/scorecard/scorecard.dart';
90+
export 'components/stop_propagation/stop_propagation.dart';
8691
export 'components/theme/dark_theme.dart';
8792
export 'components/theme/module.dart';
8893
export 'laminate/components/modal/modal.dart';

lib/src/components/app_layout/layout.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
/// Styles provided to more easily layout an application.
1515
/// This includes:
1616
/// material-drawer (persistent and permanent)
17-
@import 'lib/src/components/material_shadow/css/shadow';
1817
@import 'material_drawer';
1918
@import 'lib/src/css/material/material';
19+
@import 'lib/src/css/material/shadow';
2020
@import 'lib/src/components/material_list/mixins';
2121

2222
$mat-toolbar-mobile-breakpoint: 599px;

lib/src/components/app_layout/material_temporary_drawer.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
* to include CSS generation from SASS files during the build process.
1212
*/
1313

14-
@import 'lib/src/components/material_shadow/css/shadow';
1514
@import 'material_drawer';
1615
@import 'lib/src/css/material/material';
16+
@import 'lib/src/css/material/shadow';
1717

1818
:host {
1919
@include fit;

lib/src/components/auto_dismiss/auto_dismiss.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ import '../../utils/browser/events/events.dart';
2626
/// <button (click)="disclaimerVisible = true">Confirm</button>
2727
/// </div>
2828
///
29-
@Directive(
30-
selector: '[autoDismissable]:not(material-expansionpanel)',
31-
visibility: Visibility.none)
29+
@Directive(selector: '[autoDismissable]:not(material-expansionpanel)')
3230
class AutoDismissDirective {
3331
final Stream _click;
3432
final NgZone _zone;

lib/src/components/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]', visibility: Visibility.none)
24+
@Directive(selector: '[deferredContent]')
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]', visibility: Visibility.none)
98+
@Directive(selector: '[cachedDeferredContent]')
9999
class CachingDeferredContentDirective implements OnDestroy {
100100
ViewContainerRef _viewContainer;
101101
TemplateRef _template;

lib/src/components/focus/focus.dart

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

lib/src/components/glyph/glyph.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ const List<String> _flippedIcons = const [
5555
templateUrl: 'glyph.html',
5656
styleUrls: const ['glyph.scss.css'],
5757
changeDetection: ChangeDetectionStrategy.OnPush,
58-
preserveWhitespace: false,
59-
visibility: Visibility.none)
58+
preserveWhitespace: false)
6059
class GlyphComponent {
6160
static const String _materialIconsExtended = 'material-icons-extended';
6261

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
import 'package:angular/angular.dart';
6+
7+
import '../../model/ui/highlighted_text_model.dart';
8+
9+
/// A component that presents a list of [HighlightedTextSegment]s.
10+
///
11+
/// Example parent component:
12+
///
13+
/// var highlighter = new TextHighlighter();
14+
/// var segments = highlighter.highlight(text, ['search', 'tokens']);
15+
///
16+
/// And template:
17+
///
18+
/// <highlighted-text [segments]="segments"></highlighted-text>
19+
///
20+
/// Use [HighlightedValueComponent] for highlighting a value instead of
21+
/// providing segments as required by this component.
22+
@Component(
23+
selector: 'highlighted-text',
24+
preserveWhitespace: false,
25+
templateUrl: 'highlighted_text.html',
26+
styleUrls: const ['highlighted_text.scss.css'],
27+
directives: const [NgFor],
28+
changeDetection: ChangeDetectionStrategy.OnPush)
29+
class HighlightedTextComponent {
30+
/// List of [HighlightedTextSegment]s to present.
31+
@Input()
32+
List<HighlightedTextSegment> segments;
33+
}

0 commit comments

Comments
 (0)