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

Commit 1779009

Browse files
committed
!fixup
1 parent 716dd41 commit 1779009

File tree

4 files changed

+194
-232
lines changed

4 files changed

+194
-232
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"devDependencies": {
1515
"@angular-devkit/build-angular": "0.803.25",
16-
"@angular-ru/eslint-config": "10.6.0",
16+
"@angular-ru/eslint-config": "12.3.0",
1717
"@angular-ru/prettier-config": "12.6.0",
1818
"@angular/animations": "8.2.14",
1919
"@angular/cdk": "8.2.3",

projects/table-builder/src/lib/table/table-builder.api.ts

Lines changed: 34 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -273,20 +273,18 @@ export abstract class TableBuilderApiImpl
273273
}
274274

275275
public filter(): void {
276-
this.ngZone.runOutsideAngular(
277-
(): void => {
278-
window.clearInterval(this.filterIdTask);
279-
this.filterIdTask = window.setTimeout((): void => {
280-
if (!this.enableFiltering) {
281-
throw new Error(
282-
'You forgot to enable filtering: \n <ngx-table-builder [enable-filtering]="true" />'
283-
);
284-
}
285-
286-
this.sortAndFilter().then((): void => this.reCheckDefinitions());
287-
}, MACRO_TIME);
288-
}
289-
);
276+
this.ngZone.runOutsideAngular((): void => {
277+
window.clearInterval(this.filterIdTask);
278+
this.filterIdTask = window.setTimeout((): void => {
279+
if (!this.enableFiltering) {
280+
throw new Error(
281+
'You forgot to enable filtering: \n <ngx-table-builder [enable-filtering]="true" />'
282+
);
283+
}
284+
285+
this.sortAndFilter().then((): void => this.reCheckDefinitions());
286+
}, MACRO_TIME);
287+
});
290288
}
291289

292290
public async sortAndFilter(): Promise<void> {
@@ -316,16 +314,12 @@ export abstract class TableBuilderApiImpl
316314
}
317315

318316
public idleDetectChanges(): void {
319-
this.ngZone.runOutsideAngular(
320-
(): void => {
321-
window.cancelAnimationFrame(this.idleDetectChangesId);
322-
this.idleDetectChangesId = window.requestAnimationFrame(
323-
(): void => {
324-
detectChanges(this.cd);
325-
}
326-
);
327-
}
328-
);
317+
this.ngZone.runOutsideAngular((): void => {
318+
window.cancelAnimationFrame(this.idleDetectChangesId);
319+
this.idleDetectChangesId = window.requestAnimationFrame((): void => {
320+
detectChanges(this.cd);
321+
});
322+
});
329323
}
330324

331325
public abstract markDirtyCheck(): void;
@@ -351,11 +345,9 @@ export abstract class TableBuilderApiImpl
351345
protected reCheckDefinitions(): void {
352346
this.filterable.definition = { ...this.filterable.definition };
353347
this.filterable.changeFilteringStatus();
354-
this.ngZone.runOutsideAngular(
355-
(): void => {
356-
window.setTimeout((): void => this.calculateViewport(true), TIME_RELOAD);
357-
}
358-
);
348+
this.ngZone.runOutsideAngular((): void => {
349+
window.setTimeout((): void => this.calculateViewport(true), TIME_RELOAD);
350+
});
359351
}
360352

361353
protected forceCalculateViewport(): void {
@@ -389,21 +381,17 @@ export abstract class TableBuilderApiImpl
389381
}
390382

391383
protected calculateColumnWidthSummary(): void {
392-
this.ngZone.runOutsideAngular(
393-
(): void => {
394-
clearInterval(this.columnFrameId);
395-
this.columnFrameId = window.setTimeout((): void => {
396-
let width: number = 0;
397-
this.columnList.forEach(
398-
(element: ElementRef<HTMLDivElement>): void => {
399-
width += element.nativeElement.offsetWidth;
400-
}
401-
);
402-
this.columnListWidth = width;
403-
this.idleDetectChanges();
404-
}, TIME_IDLE);
405-
}
406-
);
384+
this.ngZone.runOutsideAngular((): void => {
385+
clearInterval(this.columnFrameId);
386+
this.columnFrameId = window.setTimeout((): void => {
387+
let width: number = 0;
388+
this.columnList.forEach((element: ElementRef<HTMLDivElement>): void => {
389+
width += element.nativeElement.offsetWidth;
390+
});
391+
this.columnListWidth = width;
392+
this.idleDetectChanges();
393+
}, TIME_IDLE);
394+
});
407395
}
408396

409397
protected abstract updateViewportInfo(start: number, end: number): void;
@@ -443,9 +431,8 @@ export abstract class TableBuilderApiImpl
443431
return this.excludeKeys.length
444432
? keys.filter(
445433
(key: string): boolean =>
446-
!this.excludeKeys.some(
447-
(excludeKey: string | RegExp): boolean =>
448-
excludeKey instanceof RegExp ? !!key.match(excludeKey) : key === excludeKey
434+
!this.excludeKeys.some((excludeKey: string | RegExp): boolean =>
435+
excludeKey instanceof RegExp ? !!key.match(excludeKey) : key === excludeKey
449436
)
450437
)
451438
: keys;

0 commit comments

Comments
 (0)