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

Commit 428eeb2

Browse files
matanlureynshahan
authored andcommitted
This is a no-op, but I may not have changed _all_ of the host bindings or listeners in this CL (please await upcoming CLs). The host: const { ... } syntax is deprecated.
PiperOrigin-RevId: 197055857
1 parent bb86fdf commit 428eeb2

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

lib/material_tab/material_tab.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ abstract class Tab extends Focusable {
4848
/// </material-tab-panel>
4949
@Component(
5050
selector: 'material-tab',
51-
host: const {
52-
'role': 'tabpanel',
53-
'[attr.id]': 'panelId',
54-
'[attr.aria-labelledby]': 'tabId',
55-
'[class.material-tab]': 'active',
56-
},
5751
providers: const [
5852
const Provider(Tab, useExisting: MaterialTabComponent),
5953
const Provider(DeferredContentAware, useExisting: MaterialTabComponent)
@@ -67,6 +61,9 @@ abstract class Tab extends Focusable {
6761
)
6862
class MaterialTabComponent extends RootFocusable
6963
implements Tab, DeferredContentAware {
64+
@HostBinding('attr.role')
65+
static const hostRole = 'tabpanel';
66+
7067
final String _uuid;
7168
final _visible = new StreamController<bool>.broadcast(sync: true);
7269

@@ -95,13 +92,16 @@ class MaterialTabComponent extends RootFocusable
9592
Stream<bool> get contentVisible => _visible.stream;
9693

9794
/// Whether the tab is active.
95+
@HostBinding('class.material-tab')
9896
bool get active => _active;
9997
bool _active = false;
10098

10199
/// HTML ID for the panel.
100+
@HostBinding('attr.id')
102101
String get panelId => 'panel-$_uuid';
103102

104103
/// HTML ID for the tab.
104+
@HostBinding('attr.aria-labelledby')
105105
@override
106106
String get tabId => 'tab-$_uuid';
107107
}

lib/src/material_tree/group/material_tree_group.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ const materialTreeLeftPaddingToken = const OpaqueToken(
3838
NgIf,
3939
NgClass
4040
],
41-
host: const {'role': 'group'},
4241
templateUrl: 'material_tree_group.html',
4342
styleUrls: const ['material_tree_group.scss.css'],
4443
)
4544
class MaterialTreeGroupComponent extends MaterialTreeNode implements OnDestroy {
45+
@HostBinding('attr.role')
46+
static const hostRole = 'group';
47+
4648
static final defaultConstantLeftPadding = 24;
4749
static final baseGridStep = 8; // Based on $mat-grid
4850
static final rowIndentationStep =

0 commit comments

Comments
 (0)