Skip to content

Commit 92a43c6

Browse files
authored
refactor: drop updateColumns method after declarative refactor (#19)
1 parent 804d5e4 commit 92a43c6

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
> **Note:** This project is currently in initial development (0.0.x versions). Until version 1.0.0 is released, the public API is not considered stable and breaking changes may occur in any release without following semantic versioning conventions.
99
10+
## [0.3.1] - 2025-12-12
11+
12+
### Changed
13+
14+
- **BREAKING:** Removed `updateColumns` method as declarative columns can be updated directly now.
15+
1016
## [0.3.0] - 2025-12-11
1117

1218
### Changed

src/components/grid.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,6 @@ export class IgcGridLite<T extends object> extends EventEmitterBase<IgcGridLiteE
410410
);
411411
}
412412

413-
/**
414-
* Updates the column configuration of the grid.
415-
*/
416-
public updateColumns(columns: ColumnConfiguration<T> | ColumnConfiguration<T>[]): void {
417-
this._stateController.updateColumnsConfiguration(asArray(columns));
418-
}
419-
420413
@eventOptions({ capture: true })
421414
protected _bodyClickHandler(event: PointerEvent): void {
422415
const target = getElementFromEventPath<IgcGridLiteCell<T>>(IgcGridLiteCell.tagName, event);

test/utils/grid-fixture.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import IgcFilterRow from '../../src/components/filter-row.js';
33
import { IgcGridLite } from '../../src/components/grid.js';
44
import IgcGridLiteHeaderRow from '../../src/components/header-row.js';
55
import IgcVirtualizer from '../../src/components/virtualizer.js';
6+
import { GRID_COLUMN_TAG } from '../../src/internal/tags.js';
67
import type { ColumnConfiguration, Keys } from '../../src/internal/types.js';
7-
import { isNumber } from '../../src/internal/utils.js';
8+
import { asArray, isNumber } from '../../src/internal/utils.js';
89
import type { FilterExpression } from '../../src/operations/filter/types.js';
910
import type { SortingExpression } from '../../src/operations/sort/types.js';
1011
import type CellTestFixture from './cell-fixture.js';
@@ -194,7 +195,11 @@ export default class GridTestFixture<T extends object> {
194195
}
195196

196197
public async updateColumns(columns: ColumnConfiguration<T> | ColumnConfiguration<T>[]) {
197-
this.grid.updateColumns(columns);
198+
const colElements = Array.from(this.grid.querySelectorAll(GRID_COLUMN_TAG));
199+
for (const col of asArray(columns)) {
200+
const elem = colElements.find((x) => x.field === col.field);
201+
elem && Object.assign(elem, col);
202+
}
198203
await this.waitForUpdate();
199204
return this;
200205
}

0 commit comments

Comments
 (0)