Skip to content

Commit 7219249

Browse files
authored
fix(build): enable tsconfig strict mode tsconfig, fixes #675 (#702)
* fix(build): enable tsconfig strict mode tsconfig, fixes #675
1 parent 269f1e9 commit 7219249

File tree

133 files changed

+1098
-1093
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+1098
-1093
lines changed

src/app/examples/custom-actionFormatter.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { Component } from '@angular/core';
2121
})
2222
export class CustomActionFormatterComponent {
2323
parent: any; // parent component context
24-
row: number;
24+
row!: number;
2525
dataContext: any;
2626
dropdownId = 'myDrop';
2727
dropDownToggleId = 'toggleDrop';

src/app/examples/custom-angularComponentEditor.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ export class CustomAngularComponentEditor implements Editor {
1919
private _subscriptions: Subscription[] = [];
2020

2121
/** Angular Component Reference */
22-
componentRef: ComponentRef<any>;
22+
componentRef!: ComponentRef<any>;
2323

2424
/** default item Id */
25-
defaultId: string;
25+
defaultId = '';
2626

2727
/** default item object */
2828
defaultItem: any;
@@ -46,7 +46,7 @@ export class CustomAngularComponentEditor implements Editor {
4646

4747
/** Get the Collection */
4848
get collection(): any[] {
49-
return this.columnDef && this.columnDef.internalColumnEditor.collection || [];
49+
return this.columnDef && this.columnDef.internalColumnEditor!.collection || [];
5050
}
5151

5252
/** Get Column Definition object */
@@ -69,7 +69,7 @@ export class CustomAngularComponentEditor implements Editor {
6969
}
7070

7171
/** Get the Validator function, can be passed in Editor property or Column Definition */
72-
get validator(): EditorValidator {
72+
get validator(): EditorValidator | undefined {
7373
return this.columnEditor.validator || this.columnDef.validator;
7474
}
7575

src/app/examples/custom-angularComponentFilter.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ export class CustomAngularComponentFilter implements Filter {
2222
private _subscriptions: Subscription[] = [];
2323

2424
/** Angular Component Reference */
25-
componentRef: ComponentRef<any>;
25+
componentRef!: ComponentRef<any>;
2626

2727
grid: any;
28-
searchTerms: SearchTerm[];
29-
columnDef: Column;
30-
callback: FilterCallback;
28+
searchTerms: SearchTerm[] = [];
29+
columnDef!: Column;
30+
callback!: FilterCallback;
3131
operator: OperatorType | OperatorString = OperatorType.equal;
3232

3333
constructor() { }
@@ -86,7 +86,7 @@ export class CustomAngularComponentFilter implements Filter {
8686
Object.assign(componentOuput.componentRef.instance, { collection: this.collection });
8787

8888
this._subscriptions.push(
89-
componentOuput.componentRef.instance.onItemChanged.subscribe((item) => {
89+
componentOuput.componentRef.instance.onItemChanged.subscribe((item: any) => {
9090
this.callback(undefined, { columnDef: this.columnDef, operator: this.operator, searchTerms: [item.id], shouldTriggerQuery: this._shouldTriggerQuery });
9191
// reset flag for next use
9292
this._shouldTriggerQuery = true;
@@ -117,7 +117,7 @@ export class CustomAngularComponentFilter implements Filter {
117117
}
118118

119119
/** Set value(s) on the DOM element */
120-
setValues(values) {
120+
setValues(values: SearchTerm[] | SearchTerm) {
121121
if (this.componentRef && this.componentRef.instance && this.componentRef.instance.hasOwnProperty('selectedId')) {
122122
this.componentRef.instance.selectedId = values;
123123
}

src/app/examples/custom-inputEditor.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ declare const $: any;
88
* KeyDown events are also handled to provide handling for Tab, Shift-Tab, Esc and Ctrl-Enter.
99
*/
1010
export class CustomInputEditor implements Editor {
11-
private _lastInputEvent: JQuery.Event;
11+
private _lastInputEvent?: JQuery.Event;
1212
$input: any;
1313
defaultValue: any;
1414

@@ -31,7 +31,7 @@ export class CustomInputEditor implements Editor {
3131
}
3232

3333
/** Get the Validator function, can be passed in Editor property or Column Definition */
34-
get validator(): EditorValidator {
34+
get validator(): EditorValidator | undefined {
3535
return this.columnEditor.validator || this.columnDef.validator;
3636
}
3737

src/app/examples/custom-inputFilter.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ export class CustomInputFilter implements Filter {
1818
private _shouldTriggerQuery = true;
1919
private $filterElm: any;
2020
grid: any;
21-
searchTerms: SearchTerm[];
22-
columnDef: Column;
23-
callback: FilterCallback;
21+
searchTerms: SearchTerm[] = [];
22+
columnDef!: Column;
23+
callback!: FilterCallback;
2424
operator: OperatorType | OperatorString = OperatorType.equal;
2525

2626
constructor() { }
@@ -96,7 +96,7 @@ export class CustomInputFilter implements Filter {
9696
}
9797

9898
/** Set value(s) on the DOM element */
99-
setValues(values) {
99+
setValues(values: SearchTerm | SearchTerm[]) {
100100
if (values) {
101101
this.$filterElm.val(values);
102102
}

src/app/examples/editor-ng-select.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import { Subject } from 'rxjs';
2121
</ng-select>`
2222
})
2323
export class EditorNgSelectComponent {
24-
selectedId: string;
24+
selectedId = '';
2525
selectedItem: any;
26-
collection; // this will be filled by the collection of your column definition
26+
collection?: any[]; // this will be filled by the collection of your column definition
2727
onItemChanged = new Subject<any>(); // object
2828

2929
onChange(item: any) {

src/app/examples/filter-ng-select.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import { Subject } from 'rxjs';
2020
</ng-select>`
2121
})
2222
export class FilterNgSelectComponent {
23-
selectedId: string;
23+
selectedId = '';
2424
selectedItem: any;
25-
collection; // this will be filled by the collection of your column definition
25+
collection?: any[]; // this will be filled by the collection of your column definition
2626
onItemChanged = new Subject<any>(); // object
2727

2828
onChange(item: any) {

src/app/examples/grid-additem.component.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ export class GridAddItemComponent implements OnInit {
2828
</ul>
2929
`;
3030

31-
angularGrid: AngularGridInstance;
31+
angularGrid!: AngularGridInstance;
3232
grid: any;
33-
gridService: GridService;
33+
gridService!: GridService;
3434
dataView: any;
35-
columnDefinitions: Column[];
36-
gridOptions: GridOption;
35+
columnDefinitions: Column[] = [];
36+
gridOptions!: GridOption;
3737
dataset: any[];
3838
updatedObject: any;
3939

@@ -177,7 +177,7 @@ export class GridAddItemComponent implements OnInit {
177177
createNewItem(incrementIdByHowMany = 1) {
178178
const dataset = this.angularGrid.dataView.getItems();
179179
let highestId = 0;
180-
dataset.forEach(item => {
180+
dataset.forEach((item: any) => {
181181
if (item.id > highestId) {
182182
highestId = item.id;
183183
}

src/app/examples/grid-angular.component.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ export class GridAngularComponent implements OnInit {
5353
</ul>
5454
`;
5555

56-
private _commandQueue = [];
57-
angularGrid: AngularGridInstance;
58-
columnDefinitions: Column[];
59-
gridOptions: GridOption;
60-
dataset: any[];
56+
private _commandQueue: any[] = [];
57+
angularGrid!: AngularGridInstance;
58+
columnDefinitions: Column[] = [];
59+
gridOptions!: GridOption;
60+
dataset!: any[];
6161
gridObj: any;
6262
isAutoEdit = true;
6363
alertWarning: any;
@@ -270,7 +270,7 @@ export class GridAngularComponent implements OnInit {
270270
this.dataset = this.mockData(NB_ITEMS);
271271
}
272272

273-
mockData(itemCount, startingIndex = 0) {
273+
mockData(itemCount: number, startingIndex = 0) {
274274
// mock a dataset
275275
const tempDataset = [];
276276
for (let i = startingIndex; i < (startingIndex + itemCount); i++) {
@@ -294,11 +294,11 @@ export class GridAngularComponent implements OnInit {
294294
return tempDataset;
295295
}
296296

297-
onCellChanged(e, args) {
297+
onCellChanged(e: Event, args: any) {
298298
this.updatedObject = args.item;
299299
}
300300

301-
onCellClicked(e, args) {
301+
onCellClicked(e: Event, args: any) {
302302
const metadata = this.angularGrid.gridService.getColumnFromEventArguments(args);
303303
console.log(metadata);
304304

@@ -317,7 +317,7 @@ export class GridAngularComponent implements OnInit {
317317
}
318318
}
319319

320-
onCellValidation(e, args) {
320+
onCellValidation(e: Event, args: any) {
321321
alert(args.validationResults.msg);
322322
}
323323

@@ -329,7 +329,7 @@ export class GridAngularComponent implements OnInit {
329329
return true;
330330
}
331331

332-
setAutoEdit(isAutoEdit) {
332+
setAutoEdit(isAutoEdit: boolean) {
333333
this.isAutoEdit = isAutoEdit;
334334
this.gridObj.setOptions({ autoEdit: isAutoEdit }); // change the grid option dynamically
335335
return true;

src/app/examples/grid-autoheight.component.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ export class GridAutoHeightComponent implements OnInit {
2525
</ul>
2626
`;
2727

28-
angularGrid: AngularGridInstance;
28+
angularGrid!: AngularGridInstance;
2929
grid: any;
3030
dataView: any;
31-
columnDefinitions: Column[];
32-
gridOptions: GridOption;
33-
dataset: any[];
31+
columnDefinitions: Column[] = [];
32+
gridOptions!: GridOption;
33+
dataset!: any[];
3434
operatorList: OperatorString[] = ['=', '<', '<=', '>', '>=', '<>', 'StartsWith', 'EndsWith'];
3535
selectedOperator = '=';
3636
searchValue = '';
37-
selectedColumn: Column;
37+
selectedColumn?: Column;
3838

3939
constructor() { }
4040

@@ -138,7 +138,7 @@ export class GridAutoHeightComponent implements OnInit {
138138

139139
updateFilter() {
140140
this.angularGrid.filterService.updateSingleFilter({
141-
columnId: `${this.selectedColumn.id || ''}`,
141+
columnId: `${this.selectedColumn!.id || ''}`,
142142
operator: this.selectedOperator as OperatorString,
143143
searchTerms: [this.searchValue || '']
144144
});

src/app/examples/grid-basic.component.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ export class GridBasicComponent implements OnInit {
1515
</ul>
1616
`;
1717

18-
columnDefinitions1: Column[];
19-
columnDefinitions2: Column[];
20-
gridOptions1: GridOption;
21-
gridOptions2: GridOption;
22-
dataset1: any[];
23-
dataset2: any[];
18+
columnDefinitions1: Column[] = [];
19+
columnDefinitions2: Column[] = [];
20+
gridOptions1!: GridOption;
21+
gridOptions2!: GridOption;
22+
dataset1!: any[];
23+
dataset2!: any[];
2424

2525
ngOnInit(): void {
2626
this.columnDefinitions1 = [

src/app/examples/grid-clientside.component.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ <h2>{{title}}</h2>
2121
</button>
2222

2323
<angular-slickgrid gridId="grid4" [columnDefinitions]="columnDefinitions" [gridOptions]="gridOptions"
24-
[dataset]="dataset" (onAngularGridCreated)="angularGridReady($event)"
25-
(onGridStateChanged)="gridStateChanged($event)" (onBeforeGridDestroy)="saveCurrentGridState($event)"
26-
(sgOnRowCountChanged)="refreshMetrics($event.detail.eventData, $event.detail.args)">
24+
[dataset]="dataset" (onAngularGridCreated)="angularGridReady($event)"
25+
(onGridStateChanged)="gridStateChanged($event)" (onBeforeGridDestroy)="saveCurrentGridState()"
26+
(sgOnRowCountChanged)="refreshMetrics($event.detail.eventData, $event.detail.args)">
2727
</angular-slickgrid>
28-
</div>
28+
</div>

src/app/examples/grid-clientside.component.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
OperatorType,
1717
} from './../modules/angular-slickgrid';
1818

19-
function randomBetween(min, max) {
19+
function randomBetween(min: number, max: number) {
2020
return Math.floor(Math.random() * (max - min + 1) + min);
2121
}
2222
const NB_ITEMS = 1500;
@@ -50,11 +50,11 @@ export class GridClientSideComponent implements OnInit {
5050
</ul>
5151
`;
5252

53-
angularGrid: AngularGridInstance;
54-
columnDefinitions: Column[];
55-
gridOptions: GridOption;
56-
dataset: any[];
57-
metrics: Metrics;
53+
angularGrid!: AngularGridInstance;
54+
columnDefinitions: Column[] = [];
55+
gridOptions!: GridOption;
56+
dataset!: any[];
57+
metrics!: Metrics;
5858

5959
constructor(private http: HttpClient, private translate: TranslateService) { }
6060

@@ -205,7 +205,7 @@ export class GridClientSideComponent implements OnInit {
205205
this.angularGrid = angularGrid;
206206
}
207207

208-
mockData(itemCount, startingIndex = 0): any[] {
208+
mockData(itemCount: number, startingIndex = 0): any[] {
209209
// mock a dataset
210210
const tempDataset = [];
211211
for (let i = startingIndex; i < (startingIndex + itemCount); i++) {
@@ -246,7 +246,7 @@ export class GridClientSideComponent implements OnInit {
246246
}
247247

248248
/** Save current Filters, Sorters in LocaleStorage or DB */
249-
saveCurrentGridState(grid) {
249+
saveCurrentGridState() {
250250
console.log('Client sample, last Grid State:: ', this.angularGrid.gridStateService.getCurrentGridState());
251251
}
252252

@@ -268,7 +268,7 @@ export class GridClientSideComponent implements OnInit {
268268
]);
269269
}
270270

271-
refreshMetrics(e, args) {
271+
refreshMetrics(e: Event, args: any) {
272272
if (args && args.current >= 0) {
273273
setTimeout(() => {
274274
this.metrics = {

src/app/examples/grid-colspan.component.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ export class GridColspanComponent implements OnInit {
2222
</ul>
2323
`;
2424

25-
angularGrid2: AngularGridInstance;
25+
angularGrid2!: AngularGridInstance;
2626
gridObj2: any;
27-
columnDefinitions1: Column[];
28-
columnDefinitions2: Column[];
29-
gridOptions1: GridOption;
30-
gridOptions2: GridOption;
31-
dataset1 = [];
32-
dataset2 = [];
27+
columnDefinitions1!: Column[];
28+
columnDefinitions2!: Column[];
29+
gridOptions1!: GridOption;
30+
gridOptions2!: GridOption;
31+
dataset1: any[] = [];
32+
dataset2: any[] = [];
3333

3434
ngOnInit(): void {
3535
this.prepareGrid1();

src/app/examples/grid-contextmenu.component.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ export class GridContextMenuComponent implements OnInit, OnDestroy {
8989
</ul>`;
9090

9191
private subscriptions: Subscription[] = [];
92-
angularGrid: AngularGridInstance;
93-
columnDefinitions: Column[];
94-
gridOptions: GridOption;
95-
dataset: any[];
92+
angularGrid!: AngularGridInstance;
93+
columnDefinitions!: Column[];
94+
gridOptions!: GridOption;
95+
dataset!: any[];
9696
selectedLanguage: string;
9797

9898
constructor(private translate: TranslateService) {
@@ -301,7 +301,7 @@ export class GridContextMenuComponent implements OnInit, OnDestroy {
301301
};
302302
}
303303

304-
executeCommand(e, args) {
304+
executeCommand(e: Event, args: any) {
305305
const columnDef = args.column;
306306
const command = args.command;
307307
const dataContext = args.dataContext;
@@ -448,7 +448,7 @@ export class GridContextMenuComponent implements OnInit, OnDestroy {
448448
});
449449
}
450450

451-
showCellMenuCommandsAndOptions(showBothList) {
451+
showCellMenuCommandsAndOptions(showBothList: boolean) {
452452
// change via the plugin setOptions
453453
this.cellMenuInstance.setOptions({
454454
hideOptionSection: !showBothList

0 commit comments

Comments
 (0)