[ACS-12728] Allowed to decide if drag preview should be whole row or not

This commit is contained in:
Aleksander Sklorz
2026-09-09 14:42:50 +02:00
parent f82f86d99a
commit 090de510f2
4 changed files with 73 additions and 64 deletions
@@ -33,7 +33,8 @@
[enableDragRows]="enableDragRows" [enableDragRows]="enableDragRows"
[dropListConnectedTo]="dropListConnectedTo" [dropListConnectedTo]="dropListConnectedTo"
[dragBoundary]="dragBoundary" [dragBoundary]="dragBoundary"
[showDragIndicator]="showDragIndicator"> [showDragIndicator]="showDragIndicator"
[useWholeRowAsDragPreview]="useWholeRowAsDragPreview">
<div *ngIf="headerFilters"> <div *ngIf="headerFilters">
<adf-filter-header <adf-filter-header
@@ -399,6 +399,9 @@ export class DocumentListComponent extends DataTableSchema implements OnInit, On
@Input() @Input()
showDragIndicator = true; showDragIndicator = true;
@Input()
useWholeRowAsDragPreview = true;
/** /**
* Indicates if the data is provided externally. * Indicates if the data is provided externally.
* If true the component won't fetch data itself * If true the component won't fetch data itself
@@ -596,6 +596,7 @@
</div> </div>
} }
@if (!useWholeRowAsDragPreview) {
<div *cdkDragPreview class="adf-datatable-row__dragging-preview"> <div *cdkDragPreview class="adf-datatable-row__dragging-preview">
@for (col of getVisibleColumns(); track col.key) { @for (col of getVisibleColumns(); track col.key) {
@if (col.visibleInDragPreview) { @if (col.visibleInDragPreview) {
@@ -665,6 +666,7 @@
} }
} }
</div> </div>
}
</adf-datatable-row> </adf-datatable-row>
@if (isEmpty()) { @if (isEmpty()) {
<div role="row" class="adf-datatable-row"> <div role="row" class="adf-datatable-row">
@@ -239,6 +239,9 @@ export class DataTableComponent implements OnInit, AfterContentInit, OnChanges,
@Input() @Input()
showDragIndicator = true; showDragIndicator = true;
@Input()
useWholeRowAsDragPreview = true;
/** Emitted when the user clicks a row. */ /** Emitted when the user clicks a row. */
@Output() @Output()
rowClick = new EventEmitter<DataRowEvent>(); rowClick = new EventEmitter<DataRowEvent>();