@@ -22,73 +22,74 @@ export const A11yMixin = (superClass) =>
2222 } ;
2323 }
2424 static get observers ( ) {
25- return [ '_a11yUpdateGridSize (size, _columnTree, __emptyState)' ] ;
25+ return [ '__a11yUpdateGridSize (size, _columnTree, __emptyState)' ] ;
2626 }
2727
2828 /** @private */
29- _a11yGetHeaderRowCount ( _columnTree ) {
29+ __a11yGetHeaderRowCount ( _columnTree ) {
3030 return _columnTree . filter ( ( level ) =>
3131 level . some ( ( col ) => col . headerRenderer || ( col . path && col . header !== null ) || col . header ) ,
3232 ) . length ;
3333 }
3434
3535 /** @private */
36- _a11yGetFooterRowCount ( _columnTree ) {
36+ __a11yGetFooterRowCount ( _columnTree ) {
3737 return _columnTree . filter ( ( level ) => level . some ( ( col ) => col . footerRenderer ) ) . length ;
3838 }
3939
4040 /** @private */
41- _a11yUpdateGridSize ( size , _columnTree , emptyState ) {
41+ __a11yUpdateGridSize ( size , _columnTree , emptyState ) {
4242 if ( size === undefined || _columnTree === undefined ) {
4343 return ;
4444 }
4545
46- const headerRowsCount = this . _a11yGetHeaderRowCount ( _columnTree ) ;
47- const footerRowsCount = this . _a11yGetFooterRowCount ( _columnTree ) ;
46+ const headerRowsCount = this . __a11yGetHeaderRowCount ( _columnTree ) ;
47+ const footerRowsCount = this . __a11yGetFooterRowCount ( _columnTree ) ;
4848 const bodyRowsCount = emptyState ? 1 : size ;
4949 const rowsCount = bodyRowsCount + headerRowsCount + footerRowsCount ;
5050
5151 this . $ . table . setAttribute ( 'aria-rowcount' , rowsCount ) ;
5252
5353 const bodyColumns = _columnTree [ _columnTree . length - 1 ] ;
54+
5455 // If no header and footer rows while the empty state is active, count as one column
5556 // Otherwise, use the number of body columns, if present
5657 const columnsCount = emptyState ? 1 : ( rowsCount && bodyColumns && bodyColumns . length ) || 0 ;
5758 this . $ . table . setAttribute ( 'aria-colcount' , columnsCount ) ;
5859
59- this . _a11yUpdateHeaderRows ( ) ;
60- this . _a11yUpdateFooterRows ( ) ;
60+ this . __a11yUpdateHeaderRows ( ) ;
61+ this . __a11yUpdateFooterRows ( ) ;
6162 }
6263
63- /** @protected */
64- _a11yUpdateHeaderRows ( ) {
64+ /** @private */
65+ __a11yUpdateHeaderRows ( ) {
6566 iterateChildren ( this . $ . header , ( headerRow , index ) => {
6667 headerRow . setAttribute ( 'aria-rowindex' , index + 1 ) ;
6768 } ) ;
6869 }
6970
70- /** @protected */
71- _a11yUpdateFooterRows ( ) {
71+ /** @private */
72+ __a11yUpdateFooterRows ( ) {
7273 iterateChildren ( this . $ . footer , ( footerRow , index ) => {
73- footerRow . setAttribute ( 'aria-rowindex' , this . _a11yGetHeaderRowCount ( this . _columnTree ) + this . size + index + 1 ) ;
74+ footerRow . setAttribute ( 'aria-rowindex' , this . __a11yGetHeaderRowCount ( this . _columnTree ) + this . size + index + 1 ) ;
7475 } ) ;
7576 }
7677
7778 /**
7879 * @param {!HTMLElement } row
7980 * @param {number } index
80- * @protected
81+ * @private
8182 */
82- _a11yUpdateRowRowindex ( row , index ) {
83- row . setAttribute ( 'aria-rowindex' , index + this . _a11yGetHeaderRowCount ( this . _columnTree ) + 1 ) ;
83+ __a11yUpdateRowRowindex ( row , index ) {
84+ row . setAttribute ( 'aria-rowindex' , index + this . __a11yGetHeaderRowCount ( this . _columnTree ) + 1 ) ;
8485 }
8586
8687 /**
8788 * @param {!HTMLElement } row
8889 * @param {boolean } selected
89- * @protected
90+ * @private
9091 */
91- _a11yUpdateRowSelected ( row , selected ) {
92+ __a11yUpdateRowSelected ( row , selected ) {
9293 // Jaws reads selection only for rows, NVDA only for cells
9394 row . setAttribute ( 'aria-selected' , Boolean ( selected ) ) ;
9495 iterateRowCells ( row , ( cell ) => {
@@ -98,9 +99,9 @@ export const A11yMixin = (superClass) =>
9899
99100 /**
100101 * @param {!HTMLElement } row
101- * @protected
102+ * @private
102103 */
103- _a11yUpdateRowExpanded ( row ) {
104+ __a11yUpdateRowExpanded ( row ) {
104105 const toggleCell = findTreeToggleCell ( row ) ;
105106 if ( this . __isRowExpandable ( row ) ) {
106107 row . setAttribute ( 'aria-expanded' , 'false' ) ;
@@ -123,9 +124,9 @@ export const A11yMixin = (superClass) =>
123124 /**
124125 * @param {!HTMLElement } row
125126 * @param {number } level
126- * @protected
127+ * @private
127128 */
128- _a11yUpdateRowLevel ( row , level ) {
129+ __a11yUpdateRowLevel ( row , level ) {
129130 // Set level for the expandable rows itself, and all the nested rows.
130131 if ( level > 0 || this . __isRowCollapsible ( row ) || this . __isRowExpandable ( row ) ) {
131132 row . setAttribute ( 'aria-level' , level + 1 ) ;
@@ -137,9 +138,9 @@ export const A11yMixin = (superClass) =>
137138 /**
138139 * @param {!HTMLElement } row
139140 * @param {!HTMLElement } detailsCell
140- * @protected
141+ * @private
141142 */
142- _a11ySetRowDetailsCell ( row , detailsCell ) {
143+ __a11ySetRowDetailsCell ( row , detailsCell ) {
143144 iterateRowCells ( row , ( cell ) => {
144145 if ( cell !== detailsCell ) {
145146 cell . setAttribute ( 'aria-controls' , detailsCell . id ) ;
@@ -150,14 +151,14 @@ export const A11yMixin = (superClass) =>
150151 /**
151152 * @param {!HTMLElement } cell
152153 * @param {number } colspan
153- * @protected
154+ * @private
154155 */
155- _a11yUpdateCellColspan ( cell , colspan ) {
156+ __a11yUpdateCellColspan ( cell , colspan ) {
156157 cell . setAttribute ( 'aria-colspan' , Number ( colspan ) ) ;
157158 }
158159
159- /** @protected */
160- _a11yUpdateSorters ( ) {
160+ /** @private */
161+ __a11yUpdateSorters ( ) {
161162 Array . from ( this . querySelectorAll ( 'vaadin-grid-sorter' ) ) . forEach ( ( sorter ) => {
162163 let cellContent = sorter . parentNode ;
163164 while ( cellContent && cellContent . localName !== 'vaadin-grid-cell-content' ) {
0 commit comments