Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/components/column.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
/**
* @element igc-grid-lite-column
*/
export class IgcGridLiteColumn<T extends object>
export class IgcGridLiteColumn<T extends object = any>
extends LitElement
implements BaseColumnConfiguration<T>
{
Expand Down Expand Up @@ -88,7 +88,7 @@ export class IgcGridLiteColumn<T extends object>

/** Custom cell template for the column. */
@property({ attribute: false })
public cellTemplate?: (params: IgcCellContext<T>) => unknown;
public cellTemplate?: (params: IgcCellContext<T, any>) => unknown;

protected override update(props: PropertyValues<this>): void {
if (this.hasUpdated && props.size > 0) {
Expand All @@ -105,6 +105,6 @@ export class IgcGridLiteColumn<T extends object>

declare global {
interface HTMLElementTagNameMap {
[IgcGridLiteColumn.tagName]: IgcGridLiteColumn<object>;
[IgcGridLiteColumn.tagName]: IgcGridLiteColumn;
}
}
14 changes: 7 additions & 7 deletions src/components/grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function columnReducer<T extends Element>(acc: T[], el: T): T[] {
/**
* Event object for the filtering event of the grid.
*/
export interface IgcFilteringEvent<T extends object> {
export interface IgcFilteringEvent<T extends object = any> {
/**
* The target column for the filter operation.
*/
Expand All @@ -77,7 +77,7 @@ export interface IgcFilteringEvent<T extends object> {
/**
* Event object for the filtered event of the grid.
*/
export interface IgcFilteredEvent<T extends object> {
export interface IgcFilteredEvent<T extends object = any> {
/**
* The target column for the filter operation.
*/
Expand All @@ -92,7 +92,7 @@ export interface IgcFilteredEvent<T extends object> {
/**
* Events for the igc-grid-lite.
*/
export interface IgcGridLiteEventMap<T extends object> {
export interface IgcGridLiteEventMap<T extends object = any> {
/**
* Emitted when sorting is initiated through the UI.
* Returns the sort expression which will be used for the operation.
Expand All @@ -103,14 +103,14 @@ export interface IgcGridLiteEventMap<T extends object> {
*
* @event
*/
sorting: CustomEvent<SortingExpression<T>>;
sorting: CustomEvent<SortingExpression<T, any>>;
/**
* Emitted when a sort operation initiated through the UI has completed.
* Returns the sort expression used for the operation.
*
* @event
*/
sorted: CustomEvent<SortingExpression<T>>;
sorted: CustomEvent<SortingExpression<T, any>>;
/**
* Emitted when filtering is initiated through the UI.
*
Expand Down Expand Up @@ -144,7 +144,7 @@ export interface IgcGridLiteEventMap<T extends object> {
* @fires filtered - Emitted when a filter operation initiated through the UI has completed.
*
*/
export class IgcGridLite<T extends object> extends EventEmitterBase<IgcGridLiteEventMap<T>> {
export class IgcGridLite<T extends object = any> extends EventEmitterBase<IgcGridLiteEventMap<T>> {
public static get tagName() {
return GRID_TAG;
}
Expand Down Expand Up @@ -504,6 +504,6 @@ export class IgcGridLite<T extends object> extends EventEmitterBase<IgcGridLiteE

declare global {
interface HTMLElementTagNameMap {
[IgcGridLite.tagName]: IgcGridLite<object>;
[IgcGridLite.tagName]: IgcGridLite;
}
}
11 changes: 6 additions & 5 deletions src/internal/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,10 @@ export interface BaseColumnConfiguration<T extends object, K extends Keys<T> = K
/**
* See {@link BaseColumnConfiguration} for the full documentation.
*/
export type ColumnConfiguration<T extends object, K extends Keys<T> = Keys<T>> = K extends Keys<T>
? BaseColumnConfiguration<T, K>
: never;
export type ColumnConfiguration<
T extends object = any,
K extends Keys<T> = Keys<T>,
> = K extends Keys<T> ? BaseColumnConfiguration<T, K> : never;

export interface ActiveNode<T> {
column: Keys<T>;
Expand All @@ -182,7 +183,7 @@ export interface ActiveNode<T> {
/**
* Context object for the column header template callback.
*/
export interface IgcHeaderContext<T extends object> {
export interface IgcHeaderContext<T extends object = any> {
/**
* The header element parent of the template.
*/
Expand Down Expand Up @@ -218,7 +219,7 @@ export interface BaseIgcCellContext<T extends object, K extends Keys<T> = Keys<T
/**
* See {@link BaseIgcCellContext} for the full documentation.
*/
export type IgcCellContext<T extends object, K extends Keys<T> = Keys<T>> = K extends Keys<T>
export type IgcCellContext<T extends object = any, K extends Keys<T> = Keys<T>> = K extends Keys<T>
? BaseIgcCellContext<T, K>
: never;

Expand Down
2 changes: 1 addition & 1 deletion src/operations/filter/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export interface BaseFilterExpression<T, K extends Keys<T> = Keys<T>> {
/**
* See {@link BaseFilterExpression} for the full documentation.
*/
export type FilterExpression<T, K extends Keys<T> = Keys<T>> = K extends Keys<T>
export type FilterExpression<T = any, K extends Keys<T> = Keys<T>> = K extends Keys<T>
? BaseFilterExpression<T, K>
: never;

Expand Down
2 changes: 1 addition & 1 deletion src/operations/sort/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface BaseSortingExpression<T, K extends Keys<T> = Keys<T>> {
/**
* See {@link BaseSortingExpression} for the full documentation.
*/
export type SortingExpression<T, K extends Keys<T> = Keys<T>> = K extends Keys<T>
export type SortingExpression<T = any, K extends Keys<T> = Keys<T>> = K extends Keys<T>
? BaseSortingExpression<T, K>
: never;

Expand Down