@@ -22,67 +22,67 @@ export const A11yMixin = (superClass) =>
22
22
} ;
23
23
}
24
24
static get observers ( ) {
25
- return [ '_a11yUpdateGridSize (size, _columnTree)' ] ;
25
+ return [ '__updateA11yGridSize (size, _columnTree)' ] ;
26
26
}
27
27
28
28
/** @private */
29
- _a11yGetHeaderRowCount ( _columnTree ) {
29
+ __getA11yHeaderRowCount ( _columnTree ) {
30
30
return _columnTree . filter ( ( level ) =>
31
31
level . some ( ( col ) => col . headerRenderer || ( col . path && col . header !== null ) || col . header ) ,
32
32
) . length ;
33
33
}
34
34
35
35
/** @private */
36
- _a11yGetFooterRowCount ( _columnTree ) {
36
+ __getA11yFooterRowCount ( _columnTree ) {
37
37
return _columnTree . filter ( ( level ) => level . some ( ( col ) => col . headerRenderer ) ) . length ;
38
38
}
39
39
40
40
/** @private */
41
- _a11yUpdateGridSize ( size , _columnTree ) {
42
- if ( size === undefined || _columnTree === undefined ) {
41
+ __updateA11yGridSize ( size , columnTree ) {
42
+ if ( size === undefined || columnTree === undefined ) {
43
43
return ;
44
44
}
45
45
46
- const bodyColumns = _columnTree [ _columnTree . length - 1 ] ;
46
+ const bodyColumns = columnTree [ columnTree . length - 1 ] ;
47
47
this . $ . table . setAttribute (
48
48
'aria-rowcount' ,
49
- size + this . _a11yGetHeaderRowCount ( _columnTree ) + this . _a11yGetFooterRowCount ( _columnTree ) ,
49
+ size + this . __getA11yHeaderRowCount ( columnTree ) + this . __getA11yFooterRowCount ( columnTree ) ,
50
50
) ;
51
51
this . $ . table . setAttribute ( 'aria-colcount' , ( bodyColumns && bodyColumns . length ) || 0 ) ;
52
52
53
- this . _a11yUpdateHeaderRows ( ) ;
54
- this . _a11yUpdateFooterRows ( ) ;
53
+ this . __updateA11yHeaderRows ( ) ;
54
+ this . __updateA11yFooterRows ( ) ;
55
55
}
56
56
57
- /** @protected */
58
- _a11yUpdateHeaderRows ( ) {
57
+ /** @private */
58
+ __updateA11yHeaderRows ( ) {
59
59
iterateChildren ( this . $ . header , ( headerRow , index ) => {
60
60
headerRow . setAttribute ( 'aria-rowindex' , index + 1 ) ;
61
61
} ) ;
62
62
}
63
63
64
- /** @protected */
65
- _a11yUpdateFooterRows ( ) {
64
+ /** @private */
65
+ __updateA11yFooterRows ( ) {
66
66
iterateChildren ( this . $ . footer , ( footerRow , index ) => {
67
- footerRow . setAttribute ( 'aria-rowindex' , this . _a11yGetHeaderRowCount ( this . _columnTree ) + this . size + index + 1 ) ;
67
+ footerRow . setAttribute ( 'aria-rowindex' , this . __getA11yHeaderRowCount ( this . _columnTree ) + this . size + index + 1 ) ;
68
68
} ) ;
69
69
}
70
70
71
71
/**
72
72
* @param {!HTMLElement } row
73
73
* @param {number } index
74
- * @protected
74
+ * @private
75
75
*/
76
- _a11yUpdateRowRowindex ( row , index ) {
77
- row . setAttribute ( 'aria-rowindex' , index + this . _a11yGetHeaderRowCount ( this . _columnTree ) + 1 ) ;
76
+ __updateA11yRowRowindex ( row , index ) {
77
+ row . setAttribute ( 'aria-rowindex' , index + this . __getA11yHeaderRowCount ( this . _columnTree ) + 1 ) ;
78
78
}
79
79
80
80
/**
81
81
* @param {!HTMLElement } row
82
82
* @param {boolean } selected
83
- * @protected
83
+ * @private
84
84
*/
85
- _a11yUpdateRowSelected ( row , selected ) {
85
+ __updateA11yRowSelected ( row , selected ) {
86
86
// Jaws reads selection only for rows, NVDA only for cells
87
87
row . setAttribute ( 'aria-selected' , Boolean ( selected ) ) ;
88
88
iterateRowCells ( row , ( cell ) => {
@@ -92,9 +92,9 @@ export const A11yMixin = (superClass) =>
92
92
93
93
/**
94
94
* @param {!HTMLElement } row
95
- * @protected
95
+ * @private
96
96
*/
97
- _a11yUpdateRowExpanded ( row ) {
97
+ __updateA11yRowExpanded ( row ) {
98
98
if ( this . __isRowExpandable ( row ) ) {
99
99
row . setAttribute ( 'aria-expanded' , 'false' ) ;
100
100
} else if ( this . __isRowCollapsible ( row ) ) {
@@ -107,9 +107,9 @@ export const A11yMixin = (superClass) =>
107
107
/**
108
108
* @param {!HTMLElement } row
109
109
* @param {number } level
110
- * @protected
110
+ * @private
111
111
*/
112
- _a11yUpdateRowLevel ( row , level ) {
112
+ __updateA11yRowLevel ( row , level ) {
113
113
// Set level for the expandable rows itself, and all the nested rows.
114
114
if ( level > 0 || this . __isRowCollapsible ( row ) || this . __isRowExpandable ( row ) ) {
115
115
row . setAttribute ( 'aria-level' , level + 1 ) ;
@@ -121,9 +121,9 @@ export const A11yMixin = (superClass) =>
121
121
/**
122
122
* @param {!HTMLElement } row
123
123
* @param {!HTMLElement } detailsCell
124
- * @protected
124
+ * @private
125
125
*/
126
- _a11ySetRowDetailsCell ( row , detailsCell ) {
126
+ __setA11yRowDetailsCell ( row , detailsCell ) {
127
127
iterateRowCells ( row , ( cell ) => {
128
128
if ( cell !== detailsCell ) {
129
129
cell . setAttribute ( 'aria-controls' , detailsCell . id ) ;
@@ -134,14 +134,14 @@ export const A11yMixin = (superClass) =>
134
134
/**
135
135
* @param {!HTMLElement } row
136
136
* @param {number } colspan
137
- * @protected
137
+ * @private
138
138
*/
139
- _a11yUpdateCellColspan ( cell , colspan ) {
139
+ __updateA11yCellColspan ( cell , colspan ) {
140
140
cell . setAttribute ( 'aria-colspan' , Number ( colspan ) ) ;
141
141
}
142
142
143
- /** @protected */
144
- _a11yUpdateSorters ( ) {
143
+ /** @private */
144
+ __updateA11ySorters ( ) {
145
145
Array . from ( this . querySelectorAll ( 'vaadin-grid-sorter' ) ) . forEach ( ( sorter ) => {
146
146
let cellContent = sorter . parentNode ;
147
147
while ( cellContent && cellContent . localName !== 'vaadin-grid-cell-content' ) {
0 commit comments