Skip to content

Commit fe076ed

Browse files
authored
refactor!: rename updateRow to initRow, mark it as private (#9690)
1 parent cc7eb33 commit fe076ed

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ export const GridMixin = (superClass) =>
345345
row.setAttribute('role', 'row');
346346
row.setAttribute('tabindex', '-1');
347347
if (this._columnTree) {
348-
this._updateRow(row, this._columnTree[this._columnTree.length - 1], 'body', false, true);
348+
this.__initRow(row, this._columnTree[this._columnTree.length - 1], 'body', false, true);
349349
}
350350
rows.push(row);
351351
}
@@ -457,9 +457,9 @@ export const GridMixin = (superClass) =>
457457
* @param {?string} section
458458
* @param {boolean} isColumnRow
459459
* @param {boolean} noNotify
460-
* @protected
460+
* @private
461461
*/
462-
_updateRow(row, columns, section = 'body', isColumnRow = false, noNotify = false) {
462+
__initRow(row, columns, section = 'body', isColumnRow = false, noNotify = false) {
463463
const contentsFragment = document.createDocumentFragment();
464464

465465
iterateRowCells(row, (cell) => {
@@ -683,7 +683,7 @@ export const GridMixin = (superClass) =>
683683
*/
684684
_renderColumnTree(columnTree) {
685685
iterateChildren(this.$.items, (row) => {
686-
this._updateRow(row, columnTree[columnTree.length - 1], 'body', false, true);
686+
this.__initRow(row, columnTree[columnTree.length - 1], 'body', false, true);
687687

688688
const model = this.__getRowModel(row);
689689
this._updateRowOrderParts(row);
@@ -710,23 +710,23 @@ export const GridMixin = (superClass) =>
710710
}
711711

712712
iterateChildren(this.$.header, (headerRow, index, rows) => {
713-
this._updateRow(headerRow, columnTree[index], 'header', index === columnTree.length - 1);
713+
this.__initRow(headerRow, columnTree[index], 'header', index === columnTree.length - 1);
714714

715715
const cells = getBodyRowCells(headerRow);
716716
updateCellsPart(cells, 'first-header-row-cell', index === 0);
717717
updateCellsPart(cells, 'last-header-row-cell', index === rows.length - 1);
718718
});
719719

720720
iterateChildren(this.$.footer, (footerRow, index, rows) => {
721-
this._updateRow(footerRow, columnTree[columnTree.length - 1 - index], 'footer', index === 0);
721+
this.__initRow(footerRow, columnTree[columnTree.length - 1 - index], 'footer', index === 0);
722722

723723
const cells = getBodyRowCells(footerRow);
724724
updateCellsPart(cells, 'first-footer-row-cell', index === 0);
725725
updateCellsPart(cells, 'last-footer-row-cell', index === rows.length - 1);
726726
});
727727

728728
// Sizer rows
729-
this._updateRow(this.$.sizer, columnTree[columnTree.length - 1]);
729+
this.__initRow(this.$.sizer, columnTree[columnTree.length - 1]);
730730

731731
this._resizeHandler();
732732
this._frozenCellsChanged();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export const RowDetailsMixin = (superClass) =>
8585
// Only update the rows if the column tree has already been initialized
8686
iterateChildren(this.$.items, (row) => {
8787
if (!row.querySelector('[part~=details-cell]')) {
88-
this._updateRow(row, this._columnTree[this._columnTree.length - 1]);
88+
this.__initRow(row, this._columnTree[this._columnTree.length - 1]);
8989
const isDetailsOpened = this._isDetailsOpened(row._item);
9090
this._toggleDetailsCell(row, isDetailsOpened);
9191
}

packages/grid/test/row-details.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe('row details', () => {
3737
flushGrid(grid);
3838
}
3939

40-
it('should not increase row update count', () => {
40+
it('should not increase row init count', () => {
4141
grid = fixtureSync(`
4242
<vaadin-grid style="width: 50px; height: 400px" size="100">
4343
<vaadin-grid-column></vaadin-grid-column>
@@ -46,7 +46,7 @@ describe('row details', () => {
4646
grid.rowDetailsRenderer = simpleDetailsRenderer;
4747
grid.querySelector('vaadin-grid-column').renderer = indexRenderer;
4848

49-
const spy = sinon.spy(grid, '_updateRow');
49+
const spy = sinon.spy(grid, '__initRow');
5050
grid.size = 1;
5151
grid.dataProvider = infiniteDataProvider;
5252
flushGrid(grid);

0 commit comments

Comments
 (0)