From a5895d3c7f9ace4703abd0216655c38c7e20d8ea Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Sat, 22 Jul 2023 11:40:07 -0400 Subject: [PATCH] chore: align some interface types with SlickGrid --- .../common/src/interfaces/slickDataView.interface.ts | 3 +-- .../row-detail-view-plugin/src/slickRowDetailView.ts | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/common/src/interfaces/slickDataView.interface.ts b/packages/common/src/interfaces/slickDataView.interface.ts index ff3950638..86c04429e 100644 --- a/packages/common/src/interfaces/slickDataView.interface.ts +++ b/packages/common/src/interfaces/slickDataView.interface.ts @@ -169,8 +169,7 @@ export interface SlickDataView { setGrouping(groupingInfo: Grouping | Grouping[]): void; /** Set a Filter that will be used by the DataView */ - // eslint-disable-next-line @typescript-eslint/ban-types - setFilter(filterFn: Function): void; + setFilter(filterFn: ((item1: any, item2: any) => boolean)): void; /** Set extra Filter arguments which will be used by the Filter method */ setFilterArgs(args: any): void; diff --git a/packages/row-detail-view-plugin/src/slickRowDetailView.ts b/packages/row-detail-view-plugin/src/slickRowDetailView.ts index 9c1ba3130..1d23c3dd1 100644 --- a/packages/row-detail-view-plugin/src/slickRowDetailView.ts +++ b/packages/row-detail-view-plugin/src/slickRowDetailView.ts @@ -46,11 +46,11 @@ export class SlickRowDetailView implements ExternalResource, UniversalRowDetailV field: '_detail_selector', cssClass: 'detailView-toggle', collapseAllOnSort: true, - collapsedClass: null, - expandedClass: null, + collapsedClass: undefined, + expandedClass: undefined, keyPrefix: '_', loadOnce: false, - maxRows: null, + maxRows: undefined, saveDetailViewOnScroll: true, singleRowExpand: false, useSimpleViewportCalc: false, @@ -437,7 +437,7 @@ export class SlickRowDetailView implements ExternalResource, UniversalRowDetailV item[`${this._keyPrefix}height`] = itemHeight; let outterHeight = (item[`${this._keyPrefix}sizePadding`] * rowHeight); - if (this._addonOptions.maxRows !== null && item[`${this._keyPrefix}sizePadding`] > this._addonOptions.maxRows!) { + if (this._addonOptions.maxRows !== undefined && item[`${this._keyPrefix}sizePadding`] > this._addonOptions.maxRows) { outterHeight = this._addonOptions.maxRows! * rowHeight; item[`${this._keyPrefix}sizePadding`] = this._addonOptions.maxRows; } @@ -620,7 +620,7 @@ export class SlickRowDetailView implements ExternalResource, UniversalRowDetailV } return `
`; } else { - const html = []; + const html: string[] = []; const rowHeight = this.gridOptions.rowHeight || 0; let outterHeight = (dataContext[`${this._keyPrefix}sizePadding`] || 0) * this.gridOptions.rowHeight!;