Skip to content

Commit d2b22bc

Browse files
committed
refactor!: mark A11yMixin methods as private
1 parent 66bec45 commit d2b22bc

File tree

4 files changed

+39
-39
lines changed

4 files changed

+39
-39
lines changed

packages/grid/src/vaadin-grid-a11y-mixin.js

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,67 +22,67 @@ export const A11yMixin = (superClass) =>
2222
};
2323
}
2424
static get observers() {
25-
return ['_a11yUpdateGridSize(size, _columnTree)'];
25+
return ['__updateA11yGridSize(size, _columnTree)'];
2626
}
2727

2828
/** @private */
29-
_a11yGetHeaderRowCount(_columnTree) {
29+
__getA11yHeaderRowCount(_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+
__getA11yFooterRowCount(_columnTree) {
3737
return _columnTree.filter((level) => level.some((col) => col.headerRenderer)).length;
3838
}
3939

4040
/** @private */
41-
_a11yUpdateGridSize(size, _columnTree) {
42-
if (size === undefined || _columnTree === undefined) {
41+
__updateA11yGridSize(size, columnTree) {
42+
if (size === undefined || columnTree === undefined) {
4343
return;
4444
}
4545

46-
const bodyColumns = _columnTree[_columnTree.length - 1];
46+
const bodyColumns = columnTree[columnTree.length - 1];
4747
this.$.table.setAttribute(
4848
'aria-rowcount',
49-
size + this._a11yGetHeaderRowCount(_columnTree) + this._a11yGetFooterRowCount(_columnTree),
49+
size + this.__getA11yHeaderRowCount(columnTree) + this.__getA11yFooterRowCount(columnTree),
5050
);
5151
this.$.table.setAttribute('aria-colcount', (bodyColumns && bodyColumns.length) || 0);
5252

53-
this._a11yUpdateHeaderRows();
54-
this._a11yUpdateFooterRows();
53+
this.__updateA11yHeaderRows();
54+
this.__updateA11yFooterRows();
5555
}
5656

57-
/** @protected */
58-
_a11yUpdateHeaderRows() {
57+
/** @private */
58+
__updateA11yHeaderRows() {
5959
iterateChildren(this.$.header, (headerRow, index) => {
6060
headerRow.setAttribute('aria-rowindex', index + 1);
6161
});
6262
}
6363

64-
/** @protected */
65-
_a11yUpdateFooterRows() {
64+
/** @private */
65+
__updateA11yFooterRows() {
6666
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);
6868
});
6969
}
7070

7171
/**
7272
* @param {!HTMLElement} row
7373
* @param {number} index
74-
* @protected
74+
* @private
7575
*/
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);
7878
}
7979

8080
/**
8181
* @param {!HTMLElement} row
8282
* @param {boolean} selected
83-
* @protected
83+
* @private
8484
*/
85-
_a11yUpdateRowSelected(row, selected) {
85+
__updateA11yRowSelected(row, selected) {
8686
// Jaws reads selection only for rows, NVDA only for cells
8787
row.setAttribute('aria-selected', Boolean(selected));
8888
iterateRowCells(row, (cell) => {
@@ -92,9 +92,9 @@ export const A11yMixin = (superClass) =>
9292

9393
/**
9494
* @param {!HTMLElement} row
95-
* @protected
95+
* @private
9696
*/
97-
_a11yUpdateRowExpanded(row) {
97+
__updateA11yRowExpanded(row) {
9898
if (this.__isRowExpandable(row)) {
9999
row.setAttribute('aria-expanded', 'false');
100100
} else if (this.__isRowCollapsible(row)) {
@@ -107,9 +107,9 @@ export const A11yMixin = (superClass) =>
107107
/**
108108
* @param {!HTMLElement} row
109109
* @param {number} level
110-
* @protected
110+
* @private
111111
*/
112-
_a11yUpdateRowLevel(row, level) {
112+
__updateA11yRowLevel(row, level) {
113113
// Set level for the expandable rows itself, and all the nested rows.
114114
if (level > 0 || this.__isRowCollapsible(row) || this.__isRowExpandable(row)) {
115115
row.setAttribute('aria-level', level + 1);
@@ -121,9 +121,9 @@ export const A11yMixin = (superClass) =>
121121
/**
122122
* @param {!HTMLElement} row
123123
* @param {!HTMLElement} detailsCell
124-
* @protected
124+
* @private
125125
*/
126-
_a11ySetRowDetailsCell(row, detailsCell) {
126+
__setA11yRowDetailsCell(row, detailsCell) {
127127
iterateRowCells(row, (cell) => {
128128
if (cell !== detailsCell) {
129129
cell.setAttribute('aria-controls', detailsCell.id);
@@ -134,14 +134,14 @@ export const A11yMixin = (superClass) =>
134134
/**
135135
* @param {!HTMLElement} row
136136
* @param {number} colspan
137-
* @protected
137+
* @private
138138
*/
139-
_a11yUpdateCellColspan(cell, colspan) {
139+
__updateA11yCellColspan(cell, colspan) {
140140
cell.setAttribute('aria-colspan', Number(colspan));
141141
}
142142

143-
/** @protected */
144-
_a11yUpdateSorters() {
143+
/** @private */
144+
__updateA11ySorters() {
145145
Array.from(this.querySelectorAll('vaadin-grid-sorter')).forEach((sorter) => {
146146
let cellContent = sorter.parentNode;
147147
while (cellContent && cellContent.localName !== 'vaadin-grid-cell-content') {

packages/grid/src/vaadin-grid-column-group-mixin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,13 +314,13 @@ export const GridColumnGroupMixin = (superClass) =>
314314
if (headerCell) {
315315
headerCell.setAttribute('colspan', colSpan);
316316
if (this._grid) {
317-
this._grid._a11yUpdateCellColspan(headerCell, colSpan);
317+
this._grid.__updateA11yCellColspan(headerCell, colSpan);
318318
}
319319
}
320320
if (footerCell) {
321321
footerCell.setAttribute('colspan', colSpan);
322322
if (this._grid) {
323-
this._grid._a11yUpdateCellColspan(footerCell, colSpan);
323+
this._grid.__updateA11yCellColspan(footerCell, colSpan);
324324
}
325325
}
326326
}

packages/grid/src/vaadin-grid-mixin.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ export const GridMixin = (superClass) =>
521521
row.appendChild(detailsCell);
522522
// Cache the details cell reference
523523
row.__detailsCell = detailsCell;
524-
this._a11ySetRowDetailsCell(row, detailsCell);
524+
this.__setA11yRowDetailsCell(row, detailsCell);
525525
detailsCell._vacant = false;
526526
}
527527

@@ -644,7 +644,7 @@ export const GridMixin = (superClass) =>
644644

645645
this._updateRowOrderParts(row, index);
646646

647-
this._a11yUpdateRowRowindex(row, index);
647+
this.__updateA11yRowRowindex(row, index);
648648

649649
this.__ensureRowItem(row);
650650
this.__ensureRowHierarchy(row);
@@ -738,8 +738,8 @@ export const GridMixin = (superClass) =>
738738
this._frozenCellsChanged();
739739
this._updateFirstAndLastColumn();
740740
this._resetKeyboardNavigation();
741-
this._a11yUpdateHeaderRows();
742-
this._a11yUpdateFooterRows();
741+
this.__updateA11yHeaderRows();
742+
this.__updateA11yFooterRows();
743743
this.generateCellClassNames();
744744
this.generateCellPartNames();
745745
this.__updateHeaderAndFooter();
@@ -784,8 +784,8 @@ export const GridMixin = (superClass) =>
784784

785785
this._toggleDetailsCell(row, model.detailsOpened);
786786

787-
this._a11yUpdateRowLevel(row, model.level);
788-
this._a11yUpdateRowSelected(row, model.selected);
787+
this.__updateA11yRowLevel(row, model.level);
788+
this.__updateA11yRowSelected(row, model.selected);
789789

790790
this._updateRowStateParts(row, model);
791791

@@ -806,7 +806,7 @@ export const GridMixin = (superClass) =>
806806

807807
this._updateDetailsCellHeight(row);
808808

809-
this._a11yUpdateRowExpanded(row, model.expanded);
809+
this.__updateA11yRowExpanded(row, model.expanded);
810810
}
811811

812812
/** @private */

packages/grid/src/vaadin-grid-sort-mixin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export const SortMixin = (superClass) =>
162162
this.__debounceClearCache();
163163
}
164164

165-
this._a11yUpdateSorters();
165+
this.__updateA11ySorters();
166166

167167
this._previousSorters = this._mapSorters();
168168
}

0 commit comments

Comments
 (0)