shlomiassaf / ngrid

A angular grid for the enterprise
https://shlomiassaf.github.io/ngrid
MIT License
241 stars 41 forks source link

Build fails if used with latest @angular/cdk #161

Closed skrtheboss closed 3 years ago

skrtheboss commented 3 years ago

What is the expected behavior?

Build should pass.

What is the current behavior?

Build fails with the following error:

Error: node_modules/@pebula/ngrid/drag/lib/column-resize/column-resize.component.d.ts:37:135 - error TS2344: Type 'PblNgridDragResizeComponent' does not satisfy the constraint '{ isDragging(): boolean; }'. Property 'isDragging' is missing in type 'PblNgridDragResizeComponent' but required in type '{ isDragging(): boolean; }'.

37 constructor(element: ElementRef, _ngZone: NgZone, _viewportRuler: ViewportRuler, _dragDropRegistry: DragDropRegistry<PblNgridDragResizeComponent, any>, _config: DragDropConfig);


  node_modules/@angular/cdk/drag-drop/drag-drop-registry.d.ts:17:5
    17     isDragging(): boolean;
'isDragging' is declared here.

Which versions of Angular, CDK, Material, NGrid, OS, TypeScript, browsers are affected?

Angular: 11.0.9 Angular CDK: 11.0.4 Angular Material: 11.0.4 NGrid: 3.0.0 Typescript: 4.0.5

berkyl commented 3 years ago

Have you found a combination that works with NGrid 3 and Angular 11? I'm currently struggling getting row reordering to work, because with NGrid 2 there seems to be an odd bug that rows don't snap into place as seen here: Stackblitz NGrid Starter v2

jean-merelis commented 3 years ago

@berkyl, Downgrade to "@angular/cdk": "11.0.3", "@angular/material": "11.0.3"

shlomiassaf commented 3 years ago

Cdk probably changed their api again.

I'll issue a fix but you can workaround it with basic type augmentation on the interface

shlomiassaf commented 3 years ago

@berkyl

Have you found a combination that works with NGrid 3 and Angular 11? I'm currently struggling getting row reordering to work, because with NGrid 2 there seems to be an odd bug that rows don't snap into place as seen here: Stackblitz NGrid Starter v2

Go to the code there, in app.component.html and see the comment. It's not enabled.

I've removed the column that allows reordering.

If you want to add it, just add the directive rowReorder to pbl-ngrid