Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 0 additions & 7 deletions ngcomponents/lib/angular_components.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import 'focus/focus_list.dart';
import 'focus/focus_trap.dart';
import 'focus/keyboard_only_focus_indicator.dart';
import 'glyph/glyph.dart';
import 'highlighted_text/highlighted_text.dart';
import 'highlighted_text/highlighted_value.dart';
import 'laminate/components/modal/modal.dart';
import 'material_button/material_button.dart';
import 'material_button/material_fab.dart';
Expand Down Expand Up @@ -104,8 +102,6 @@ export 'focus/focus_trap.dart';
export 'focus/keyboard_only_focus_indicator.dart';
export 'forms/error_renderer.dart';
export 'glyph/glyph.dart';
export 'highlighted_text/highlighted_text.dart';
export 'highlighted_text/highlighted_value.dart';
export 'laminate/components/modal/modal.dart';
export 'laminate/enums/alignment.dart';
export 'laminate/overlay/module.dart';
Expand Down Expand Up @@ -194,7 +190,6 @@ export 'material_yes_no_buttons/material_yes_no_buttons.dart';
export 'mixins/button_wrapper.dart';
export 'mixins/focusable_mixin.dart';
export 'mixins/has_tab_index.dart';
export 'mixins/highlight_assistant_mixin.dart';
export 'mixins/material_dropdown_base.dart';
export 'mixins/track_layout_changes.dart';
export 'model/date/date.dart';
Expand Down Expand Up @@ -240,8 +235,6 @@ const List<dynamic> materialDirectives = [
FocusableDirective,
FocusTrapComponent,
GlyphComponent,
HighlightedTextComponent,
HighlightedValueComponent,
KeyboardOnlyFocusIndicatorDirective,
LowerBoundValidator,
MaterialAutoSuggestInputComponent,
Expand Down
32 changes: 0 additions & 32 deletions ngcomponents/lib/highlighted_text/highlighted_text.dart

This file was deleted.

8 changes: 0 additions & 8 deletions ngcomponents/lib/highlighted_text/highlighted_text.html

This file was deleted.

9 changes: 0 additions & 9 deletions ngcomponents/lib/highlighted_text/highlighted_text.scss

This file was deleted.

36 changes: 0 additions & 36 deletions ngcomponents/lib/highlighted_text/highlighted_value.dart

This file was deleted.

4 changes: 2 additions & 2 deletions ngcomponents/lib/material_input/base_material_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class BaseMaterialInput extends FocusableMixin
///
/// Character count always is displayed when the value is non-null.
@Input()
int maxCount = 0;
int? maxCount;

ValidityCheck _checkValid = (v) => '';
ValidityCheck get checkValid => _checkValid;
Expand Down Expand Up @@ -268,7 +268,7 @@ class BaseMaterialInput extends FocusableMixin
_localValidationMessage = requiredErrorMsg;
return {materialInputErrorKey: _localValidationMessage};
}
if (inputTextLength > maxCount) {
if (maxCount != null && inputTextLength > maxCount!) {
_localValidationMessage = _errorMsg;
return {materialInputErrorKey: _localValidationMessage};
}
Expand Down
26 changes: 1 addition & 25 deletions ngcomponents/lib/material_input/material_auto_suggest_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import 'package:ngcomponents/material_select/material_select_base.dart';
import 'package:ngcomponents/material_select/material_select_dropdown_item.dart';
import 'package:ngcomponents/material_spinner/material_spinner.dart';
import 'package:ngcomponents/material_tooltip/material_tooltip.dart';
import 'package:ngcomponents/mixins/highlight_assistant_mixin.dart';
import 'package:ngcomponents/mixins/material_dropdown_base.dart';
import 'package:ngcomponents/mixins/selection_input_adapter.dart';
import 'package:ngcomponents/model/a11y/active_item.dart';
Expand All @@ -36,7 +35,6 @@ import 'package:ngcomponents/model/selection/selection_model.dart';
import 'package:ngcomponents/model/selection/selection_options.dart';
import 'package:ngcomponents/model/selection/string_selection_options.dart';
import 'package:ngcomponents/model/ui/has_factory.dart';
import 'package:ngcomponents/model/ui/highlight_provider.dart';
import 'package:ngcomponents/model/ui/template_support.dart';
import 'package:ngcomponents/stop_propagation/stop_propagation.dart';
import 'package:ngcomponents/utils/angular/properties/properties.dart';
Expand All @@ -58,7 +56,6 @@ typedef InputChangeCallback = dynamic Function(Object inputText,
ExistingProvider(HasDisabled, MaterialAutoSuggestInputComponent),
ExistingProvider(HasRenderer, MaterialAutoSuggestInputComponent),
ExistingProvider(SelectionContainer, MaterialAutoSuggestInputComponent),
ExistingProvider(HighlightProvider, MaterialAutoSuggestInputComponent),
ExistingProvider(DropdownHandle, MaterialAutoSuggestInputComponent),
//ExistingProvider(HasComponentRenderer, MaterialAutoSuggestInputComponent),
ExistingProvider(HasFactoryRenderer, MaterialAutoSuggestInputComponent),
Expand Down Expand Up @@ -100,16 +97,14 @@ class MaterialAutoSuggestInputComponent<T> extends MaterialSelectBase<T>
with
SelectionInputAdapter<T>,
MaterialInputWrapper,
KeyboardHandlerMixin,
HighlightAssistantMixin<T>
KeyboardHandlerMixin
implements
AfterChanges,
ControlValueAccessor<Object>,
Focusable,
OnInit,
OnDestroy,
HasRenderer<T>,
//HasComponentRenderer<RendersValue, Object>,
HasFactoryRenderer<RendersValue, T>,
DropdownHandle,
PopupSizeProvider {
Expand Down Expand Up @@ -508,25 +503,6 @@ class MaterialAutoSuggestInputComponent<T> extends MaterialSelectBase<T>
/// Whether an option is hidden.
bool isOptionHidden(T item) => Selectable.isHiddenIn(options, item, false);

/// Whether to highlight options.
/// Default value is `true`.
@Input()
bool highlightOptions = true;

//@override
//ComponentRenderer? get componentRenderer => highlightOptions &&
// super.componentRenderer == null &&
// super.factoryRenderer == null
// ? highlightComponentRenderer
// : super.componentRenderer;

@override
FactoryRenderer<RendersValue, T>? get factoryRenderer =>
highlightOptions && super.factoryRenderer == null
// && super.componentRenderer == null
? highlightFactoryRenderer
: super.factoryRenderer;

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

/// Publishes event when the showPopup changes.
Expand Down
31 changes: 0 additions & 31 deletions ngcomponents/lib/material_menu/menu_item_groups.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import 'package:ngcomponents/content/deferred_content.dart';
import 'package:ngcomponents/focus/focus.dart';
import 'package:ngcomponents/focus/focus_activable_item.dart';
import 'package:ngcomponents/focus/focus_trap.dart';
import 'package:ngcomponents/highlighted_text/highlighted_text.dart';
import 'package:ngcomponents/laminate/enums/alignment.dart';
import 'package:ngcomponents/material_icon/material_icon.dart';
import 'package:ngcomponents/material_list/material_list.dart';
Expand All @@ -29,7 +28,6 @@ import 'package:ngcomponents/model/menu/menu.dart';
import 'package:ngcomponents/model/menu/selectable_menu.dart';
import 'package:ngcomponents/model/selection/select.dart';
import 'package:ngcomponents/model/selection/selection_model.dart';
import 'package:ngcomponents/model/ui/highlighted_text_model.dart';
import 'package:ngcomponents/utils/disposer/disposer.dart';
import 'package:ngcomponents/utils/id_generator/id_generator.dart';
import 'package:quiver/core.dart' as qc show Optional;
Expand All @@ -45,7 +43,6 @@ import 'package:quiver/core.dart' as qc show Optional;
FocusActivableItemDirective,
FocusableDirective,
FocusTrapComponent,
HighlightedTextComponent,
MaterialIconComponent,
MaterialListComponent,
MaterialMenuComponent,
Expand All @@ -54,7 +51,6 @@ import 'package:quiver/core.dart' as qc show Optional;
MenuItemGroupsComponent,
MaterialTooltipDirective,
MaterialSelectItemComponent,
HighlightedTextComponent,
NgClass,
NgFor,
NgIf,
Expand Down Expand Up @@ -190,19 +186,6 @@ class MenuItemGroupsComponent
Stream<MenuItem> get selected => _selected.stream;
final _selected = StreamController<MenuItem>.broadcast();

/// Highlighter to use, need to be to be provided if [highlight] is used.
@Input()
TextHighlighter? highlighter;

/// Part of the string to highlight.
@Input()
set highlight(String value) {
_highlight = value;
_highlightCache = {};
}

String _highlight = '';

/// CSS classes to append onto the sub-menu popups.
///
/// These CSS classes will be copied into the sub-menu popup overlays.
Expand All @@ -212,10 +195,6 @@ class MenuItemGroupsComponent
@Input()
String popupClass = '';

bool get hasHighlight => _highlight.isNotEmpty;

var _highlightCache = <String, List<HighlightedTextSegment>>{};

factory MenuItemGroupsComponent(
MenuRoot menuRoot,
ChangeDetectorRef changeDetector,
Expand All @@ -230,16 +209,6 @@ class MenuItemGroupsComponent
this._subMenuOpener = DelayedAction(_menuDelay, _openSubMenuOnHover);
}

/// Returns list of highlighted segments for a given input, using provided
/// highlighter.
List<HighlightedTextSegment> highlighted(String input) {
if (_highlightCache.containsKey(input)) {
return _highlightCache[input] ?? [];
}
return _highlightCache[input] =
highlighter?.highlight(input, [_highlight]) ?? [];
}

@HostListener('mouseover')
void onMouseOver(MouseEvent event) {
// If not triggered by mouse movement, don't handle it. This can happen when
Expand Down
10 changes: 1 addition & 9 deletions ngcomponents/lib/material_menu/menu_item_groups.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,7 @@
[icon]="item.icon">
</material-icon>
<span class="menu-item-label-section">
<span *ngIf="hasHighlight" class="menu-item-label">
<highlighted-text [segments]="highlighted(item.uiDisplayName)">
</highlighted-text>
<sup *ngIf="item.labelAnnotation != null && item.labelAnnotation.isNotEmpty"
class="label-annotation">
{{item.labelAnnotation}}
</sup>
</span>
<span *ngIf="!hasHighlight" class="menu-item-label">
<span class="menu-item-label">
{{item.uiDisplayName}}
<sup *ngIf="item.labelAnnotation != null && item.labelAnnotation.isNotEmpty"
class="label-annotation">
Expand Down
79 changes: 0 additions & 79 deletions ngcomponents/lib/mixins/highlight_assistant_mixin.dart

This file was deleted.

Loading