Skip to content

Commit 94f4ae2

Browse files
committed
docs(cdk\drag-drop): Add table drag drop example
Adds an example that shows how to drag and drop table rows Fixes #25168
1 parent 11ade32 commit 94f4ae2

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed
Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
table {
2-
width: 100%;
3-
}
4-
5-
.dragCursor {
6-
margin-right: 16px;
7-
cursor: move;
8-
}
9-
10-
.cdk-drag-preview {
11-
box-sizing: border-box;
12-
border-radius: 4px;
13-
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),
14-
0 8px 10px 1px rgba(0, 0, 0, 0.14),
15-
0 3px 14px 2px rgba(0, 0, 0, 0.12);
16-
}
17-
18-
.cdk-drag-placeholder {
19-
background: #e0e0e0;
20-
}
21-
22-
.cdk-drag-animating {
23-
transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
24-
}
25-
26-
.cdk-drop-list-dragging .mat-row:not(.cdk-drag-placeholder) {
27-
transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
28-
}
1+
table {
2+
width: 100%;
3+
}
4+
5+
.example-drag-cursor {
6+
margin-right: 16px;
7+
cursor: move;
8+
}
9+
10+
.cdk-drag-preview {
11+
box-sizing: border-box;
12+
border-radius: 4px;
13+
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),
14+
0 8px 10px 1px rgba(0, 0, 0, 0.14),
15+
0 3px 14px 2px rgba(0, 0, 0, 0.12);
16+
}
17+
18+
.cdk-drag-placeholder {
19+
background: #e0e0e0;
20+
}
21+
22+
.cdk-drag-animating {
23+
transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
24+
}
25+
26+
.cdk-drop-list-dragging .mat-row:not(.cdk-drag-placeholder) {
27+
transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
28+
}

src/components-examples/cdk/drag-drop/cdk-drag-drop-table/cdk-drag-drop-table-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<ng-container matColumnDef="position" sticky>
55
<mat-header-cell *matHeaderCellDef> No. </mat-header-cell>
66
<mat-cell *matCellDef="let element">
7-
<mat-icon class="dragCursor" (mousedown)="dragDisabled = false;">reorder</mat-icon>
7+
<mat-icon class="example-drag-cursor" (mousedown)="dragDisabled = false;">reorder</mat-icon>
88
<span>{{element.position}}</span>
99
</mat-cell>
1010
</ng-container>

0 commit comments

Comments
 (0)