Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 6 additions & 6 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 5 additions & 5 deletions
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

Lines changed: 10 additions & 10 deletions
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

Lines changed: 6 additions & 6 deletions
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
});

0 commit comments

Comments
 (0)