Skip to content

Commit 028f108

Browse files
committed
fix(*): rename ApexGrid to IgcGridLite and other sub-components
1 parent 6c60736 commit 028f108

23 files changed

+131
-126
lines changed

demo/demo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
} from 'igniteui-webcomponents';
1010
import { html, render } from 'lit';
1111
import { ColumnConfiguration } from '../src/index';
12-
import { ApexGrid } from '../src/index.js';
12+
import { IgcGridLite } from '../src/index.js';
1313

1414
defineComponents(
1515
IgcAvatarComponent,
@@ -166,7 +166,7 @@ const columns: ColumnConfiguration<User>[] = [
166166
];
167167

168168
const data = generateData(1e4);
169-
ApexGrid.register();
169+
IgcGridLite.register();
170170

171171
render(
172172
html`${themeChoose}<igc-grid-lite

src/components/cell.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ import { html, LitElement } from 'lit';
22
import { property } from 'lit/decorators.js';
33
import { registerComponent } from '../internal/register.js';
44
import { GRID_CELL_TAG } from '../internal/tags.js';
5-
import type { ApexCellContext, ColumnConfiguration, PropertyType } from '../internal/types.js';
5+
import type { ColumnConfiguration, IgcCellContext, PropertyType } from '../internal/types.js';
66
import { styles } from '../styles/body-cell/body-cell.css.js';
7-
import type ApexGridRow from './row.js';
7+
import type IgcGridLiteRow from './row.js';
88

99
/**
10-
* Component representing a DOM cell of the Apex grid.
10+
* Component representing a DOM cell of the Igc grid.
1111
*/
12-
export default class ApexGridCell<T extends object> extends LitElement {
12+
export default class IgcGridLiteCell<T extends object> extends LitElement {
1313
public static get tagName() {
1414
return GRID_CELL_TAG;
1515
}
1616

1717
public static override styles = styles;
1818

1919
public static register(): void {
20-
registerComponent(ApexGridCell);
20+
registerComponent(IgcGridLiteCell);
2121
}
2222

2323
/**
@@ -42,26 +42,26 @@ export default class ApexGridCell<T extends object> extends LitElement {
4242
/**
4343
* The parent row component holding this cell.
4444
*/
45-
public row!: ApexGridRow<T>;
45+
public row!: IgcGridLiteRow<T>;
4646

47-
protected get context(): ApexCellContext<T> {
47+
protected get context(): IgcCellContext<T> {
4848
return {
4949
parent: this,
5050
row: this.row,
5151
column: this.column,
5252
value: this.value,
53-
} as unknown as ApexCellContext<T>;
53+
} as unknown as IgcCellContext<T>;
5454
}
5555

5656
protected override render() {
5757
return this.column.cellTemplate
58-
? this.column.cellTemplate(this.context as ApexCellContext<T> as any)
58+
? this.column.cellTemplate(this.context as IgcCellContext<T> as any)
5959
: html`${this.value}`;
6060
}
6161
}
6262

6363
declare global {
6464
interface HTMLElementTagNameMap {
65-
[ApexGridCell.tagName]: ApexGridCell<object>;
65+
[IgcGridLiteCell.tagName]: IgcGridLiteCell<object>;
6666
}
6767
}

src/components/filter-row.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ function prefixedIcon(icon?: string) {
3434
></igc-icon>`;
3535
}
3636

37-
export default class ApexFilterRow<T extends object> extends LitElement {
37+
export default class IgcFilterRow<T extends object> extends LitElement {
3838
public static get tagName() {
3939
return GRID_FILTER_ROW_TAG;
4040
}
4141

4242
public static override styles = styles;
4343

4444
public static register() {
45-
registerComponent(ApexFilterRow);
45+
registerComponent(IgcFilterRow);
4646
}
4747

4848
@consume({ context: gridStateContext, subscribe: true })
@@ -377,6 +377,6 @@ export default class ApexFilterRow<T extends object> extends LitElement {
377377

378378
declare global {
379379
interface HTMLElementTagNameMap {
380-
[ApexFilterRow.tagName]: ApexFilterRow<object>;
380+
[IgcFilterRow.tagName]: IgcFilterRow<object>;
381381
}
382382
}

src/components/grid.ts

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ import { styles as bootstrap } from '../styles/grid/themes/light/grid.bootstrap.
3030
import { styles as fluent } from '../styles/grid/themes/light/grid.fluent.css.js';
3131
import { styles as indigo } from '../styles/grid/themes/light/grid.indigo.css.js';
3232
import { styles as material } from '../styles/grid/themes/light/grid.material.css.js';
33-
import ApexGridCell from './cell.js';
34-
import ApexFilterRow from './filter-row.js';
35-
import ApexGridHeaderRow from './header-row.js';
36-
import ApexGridRow from './row.js';
37-
import ApexVirtualizer from './virtualizer.js';
33+
import IgcGridLiteCell from './cell.js';
34+
import IgcFilterRow from './filter-row.js';
35+
import IgcGridLiteHeaderRow from './header-row.js';
36+
import IgcGridLiteRow from './row.js';
37+
import IgcVirtualizer from './virtualizer.js';
3838

3939
/**
4040
* Event object for the filtering event of the grid.
4141
*/
42-
export interface ApexFilteringEvent<T extends object> {
42+
export interface IgcFilteringEvent<T extends object> {
4343
/**
4444
* The target column for the filter operation.
4545
*/
@@ -65,7 +65,7 @@ export interface ApexFilteringEvent<T extends object> {
6565
/**
6666
* Event object for the filtered event of the grid.
6767
*/
68-
export interface ApexFilteredEvent<T extends object> {
68+
export interface IgcFilteredEvent<T extends object> {
6969
/**
7070
* The target column for the filter operation.
7171
*/
@@ -80,7 +80,7 @@ export interface ApexFilteredEvent<T extends object> {
8080
/**
8181
* Events for the igc-grid-lite.
8282
*/
83-
export interface ApexGridEventMap<T extends object> {
83+
export interface IgcGridLiteEventMap<T extends object> {
8484
/**
8585
* Emitted when sorting is initiated through the UI.
8686
* Returns the sort expression which will be used for the operation.
@@ -108,18 +108,18 @@ export interface ApexGridEventMap<T extends object> {
108108
*
109109
* @event
110110
*/
111-
filtering: CustomEvent<ApexFilteringEvent<T>>;
111+
filtering: CustomEvent<IgcFilteringEvent<T>>;
112112
/**
113113
* Emitted when a filter operation initiated through the UI has completed.
114114
* Returns the filter state for the affected column.
115115
*
116116
* @event
117117
*/
118-
filtered: CustomEvent<ApexFilteredEvent<T>>;
118+
filtered: CustomEvent<IgcFilteredEvent<T>>;
119119
}
120120

121121
/**
122-
* Apex grid is a web component for displaying data in a tabular format quick and easy.
122+
* IgcGridLite is a web component for displaying data in a tabular format quick and easy.
123123
*
124124
* Out of the box it provides row virtualization, sort and filter operations (client and server side),
125125
* the ability to template cells and headers and column hiding.
@@ -132,7 +132,7 @@ export interface ApexGridEventMap<T extends object> {
132132
* @fires filtered - Emitted when a filter operation initiated through the UI has completed.
133133
*
134134
*/
135-
export class ApexGrid<T extends object> extends EventEmitterBase<ApexGridEventMap<T>> {
135+
export class IgcGridLite<T extends object> extends EventEmitterBase<IgcGridLiteEventMap<T>> {
136136
public static get tagName() {
137137
return GRID_TAG;
138138
}
@@ -141,11 +141,11 @@ export class ApexGrid<T extends object> extends EventEmitterBase<ApexGridEventMa
141141

142142
public static register() {
143143
registerComponent(
144-
ApexGrid,
145-
ApexVirtualizer,
146-
ApexGridRow,
147-
ApexGridHeaderRow,
148-
ApexFilterRow,
144+
IgcGridLite,
145+
IgcVirtualizer,
146+
IgcGridLiteRow,
147+
IgcGridLiteHeaderRow,
148+
IgcFilterRow,
149149
IgcButtonComponent,
150150
IgcChipComponent,
151151
IgcInputComponent,
@@ -162,20 +162,20 @@ export class ApexGrid<T extends object> extends EventEmitterBase<ApexGridEventMa
162162
initialValue: this.stateController,
163163
});
164164

165-
@query(ApexVirtualizer.tagName)
166-
protected scrollContainer!: ApexVirtualizer;
165+
@query(IgcVirtualizer.tagName)
166+
protected scrollContainer!: IgcVirtualizer;
167167

168-
@query(ApexGridHeaderRow.tagName)
169-
protected headerRow!: ApexGridHeaderRow<T>;
168+
@query(IgcGridLiteHeaderRow.tagName)
169+
protected headerRow!: IgcGridLiteHeaderRow<T>;
170170

171-
@query(ApexFilterRow.tagName)
172-
protected filterRow!: ApexFilterRow<T>;
171+
@query(IgcFilterRow.tagName)
172+
protected filterRow!: IgcFilterRow<T>;
173173

174174
@state()
175175
protected dataState: Array<T> = [];
176176

177-
@queryAll(ApexGridRow.tagName)
178-
protected _rows!: NodeListOf<ApexGridRow<T>>;
177+
@queryAll(IgcGridLiteRow.tagName)
178+
protected _rows!: NodeListOf<IgcGridLiteRow<T>>;
179179

180180
/** Column configuration for the grid. */
181181
@property({ attribute: false })
@@ -285,7 +285,7 @@ export class ApexGrid<T extends object> extends EventEmitterBase<ApexGridEventMa
285285
}
286286

287287
/**
288-
* The total number of items in the {@link ApexGrid.dataView} collection.
288+
* The total number of items in the {@link IgcGridLite.dataView} collection.
289289
*/
290290
public get totalItems() {
291291
return this.dataState.length;
@@ -387,7 +387,9 @@ export class ApexGrid<T extends object> extends EventEmitterBase<ApexGridEventMa
387387

388388
@eventOptions({ capture: true })
389389
protected bodyClickHandler(event: MouseEvent) {
390-
const target = event.composedPath().find((el) => el instanceof ApexGridCell) as ApexGridCell<T>;
390+
const target = event
391+
.composedPath()
392+
.find((el) => el instanceof IgcGridLiteCell) as IgcGridLiteCell<T>;
391393
if (target) {
392394
this.stateController.active = {
393395
column: target.column.key,
@@ -413,18 +415,18 @@ export class ApexGrid<T extends object> extends EventEmitterBase<ApexGridEventMa
413415

414416
protected renderBody() {
415417
return html`
416-
<apex-virtualizer
418+
<igc-virtualizer
417419
.items=${this.dataState}
418420
.renderItem=${this.DOM.rowRenderer}
419421
@click=${this.bodyClickHandler}
420422
@keydown=${this.bodyKeydownHandler}
421-
></apex-virtualizer>
423+
></igc-virtualizer>
422424
`;
423425
}
424426

425427
protected renderFilterRow() {
426428
return this.columns.some((column) => column.filter)
427-
? html`<apex-filter-row style=${styleMap(this.DOM.columnSizes)}></apex-filter-row>`
429+
? html`<igc-filter-row style=${styleMap(this.DOM.columnSizes)}></igc-filter-row>`
428430
: nothing;
429431
}
430432

@@ -440,6 +442,6 @@ export class ApexGrid<T extends object> extends EventEmitterBase<ApexGridEventMa
440442

441443
declare global {
442444
interface HTMLElementTagNameMap {
443-
[ApexGrid.tagName]: ApexGrid<object>;
445+
[IgcGridLite.tagName]: IgcGridLite<object>;
444446
}
445447
}

src/components/header-row.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ import { registerComponent } from '../internal/register.js';
88
import { GRID_HEADER_ROW_TAG } from '../internal/tags.js';
99
import type { ColumnConfiguration } from '../internal/types.js';
1010
import { styles } from '../styles/header-row/header-row.base.css.js';
11-
import ApexGridHeader from './header.js';
11+
import IgcGridLiteHeader from './header.js';
1212

13-
export default class ApexGridHeaderRow<T extends object> extends LitElement {
13+
export default class IgcGridLiteHeaderRow<T extends object> extends LitElement {
1414
public static get tagName() {
1515
return GRID_HEADER_ROW_TAG;
1616
}
1717
public static override styles = styles;
1818

1919
public static register(): void {
20-
registerComponent(ApexGridHeaderRow, ApexGridHeader);
20+
registerComponent(IgcGridLiteHeaderRow, IgcGridLiteHeader);
2121
}
2222

23-
@queryAll(ApexGridHeader.tagName)
24-
protected _headers!: NodeListOf<ApexGridHeader<T>>;
23+
@queryAll(IgcGridLiteHeader.tagName)
24+
protected _headers!: NodeListOf<IgcGridLiteHeader<T>>;
2525

2626
@consume({ context: gridStateContext, subscribe: true })
2727
@property({ attribute: false })
@@ -47,8 +47,8 @@ export default class ApexGridHeaderRow<T extends object> extends LitElement {
4747
#activeFilterColumn(event: MouseEvent) {
4848
const header = event
4949
.composedPath()
50-
.filter((target) => target instanceof ApexGridHeader)
51-
.at(0) as ApexGridHeader<T>;
50+
.filter((target) => target instanceof IgcGridLiteHeader)
51+
.at(0) as IgcGridLiteHeader<T>;
5252

5353
this.state.filtering.setActiveColumn(header?.column);
5454
}
@@ -79,6 +79,6 @@ export default class ApexGridHeaderRow<T extends object> extends LitElement {
7979

8080
declare global {
8181
interface HTMLElementTagNameMap {
82-
[ApexGridHeaderRow.tagName]: ApexGridHeaderRow<object>;
82+
[IgcGridLiteHeaderRow.tagName]: IgcGridLiteHeaderRow<object>;
8383
}
8484
}

src/components/header.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ import {
1111
import { partNameMap } from '../internal/part-map.js';
1212
import { registerComponent } from '../internal/register.js';
1313
import { GRID_HEADER_TAG } from '../internal/tags.js';
14-
import type { ApexHeaderContext, ColumnConfiguration } from '../internal/types.js';
14+
import type { ColumnConfiguration, IgcHeaderContext } from '../internal/types.js';
1515
import { styles } from '../styles/header-cell/header-cell.css.js';
1616

17-
export default class ApexGridHeader<T extends object> extends LitElement {
17+
export default class IgcGridLiteHeader<T extends object> extends LitElement {
1818
public static get tagName() {
1919
return GRID_HEADER_TAG;
2020
}
2121

2222
public static override styles = styles;
2323

2424
public static register(): void {
25-
registerComponent(ApexGridHeader, IgcIconComponent);
25+
registerComponent(IgcGridLiteHeader, IgcIconComponent);
2626
}
2727

28-
protected get context(): ApexHeaderContext<T> {
28+
protected get context(): IgcHeaderContext<T> {
2929
return {
3030
parent: this,
3131
column: this.column,
@@ -163,6 +163,6 @@ export default class ApexGridHeader<T extends object> extends LitElement {
163163

164164
declare global {
165165
interface HTMLElementTagNameMap {
166-
[ApexGridHeader.tagName]: ApexGridHeader<object>;
166+
[IgcGridLiteHeader.tagName]: IgcGridLiteHeader<object>;
167167
}
168168
}

src/components/row.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ import { registerComponent } from '../internal/register.js';
55
import { GRID_ROW_TAG } from '../internal/tags.js';
66
import type { ActiveNode, ColumnConfiguration } from '../internal/types.js';
77
import { styles } from '../styles/body-row/body-row.css.js';
8-
import ApexGridCell from './cell.js';
8+
import IgcGridLiteCell from './cell.js';
99

1010
/**
11-
* Component representing the DOM row in the Apex grid.
11+
* Component representing the DOM row in the IgcGridLite.
1212
*/
13-
export default class ApexGridRow<T extends object> extends LitElement {
13+
export default class IgcGridLiteRow<T extends object> extends LitElement {
1414
public static get tagName() {
1515
return GRID_ROW_TAG;
1616
}
1717
public static override styles = styles;
1818

1919
public static register(): void {
20-
registerComponent(ApexGridRow, ApexGridCell);
20+
registerComponent(IgcGridLiteRow, IgcGridLiteCell);
2121
}
2222

23-
@queryAll(ApexGridCell.tagName)
24-
protected _cells!: NodeListOf<ApexGridCell<T>>;
23+
@queryAll(IgcGridLiteCell.tagName)
24+
protected _cells!: NodeListOf<IgcGridLiteCell<T>>;
2525

2626
@property({ attribute: false })
2727
public data!: T;
@@ -55,7 +55,7 @@ export default class ApexGridRow<T extends object> extends LitElement {
5555
part="cell"
5656
.active=${key === column.key && index === this.index}
5757
.column=${column}
58-
.row=${this as ApexGridRow<T>}
58+
.row=${this as IgcGridLiteRow<T>}
5959
.value=${this.data[column.key]}
6060
></igc-grid-lite-cell>`
6161
)}
@@ -65,6 +65,6 @@ export default class ApexGridRow<T extends object> extends LitElement {
6565

6666
declare global {
6767
interface HTMLElementTagNameMap {
68-
[ApexGridRow.tagName]: ApexGridRow<object>;
68+
[IgcGridLiteRow.tagName]: IgcGridLiteRow<object>;
6969
}
7070
}

0 commit comments

Comments
 (0)