Skip to content

Commit 160b688

Browse files
josephperrottandrewseguin
authored andcommitted
chore(drag-drop): rename cdkDrop to cdkDropList (#13619)
1 parent 60b4a58 commit 160b688

20 files changed

+152
-149
lines changed

src/cdk/drag-drop/drag-drop-module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77
*/
88

99
import {NgModule} from '@angular/core';
10-
import {CdkDrop} from './drop';
10+
import {CdkDropList} from './drop-list';
1111
import {CdkDrag} from './drag';
1212
import {CdkDragHandle} from './drag-handle';
1313
import {CdkDragPreview} from './drag-preview';
1414
import {CdkDragPlaceholder} from './drag-placeholder';
1515

1616
@NgModule({
1717
declarations: [
18-
CdkDrop,
18+
CdkDropList,
1919
CdkDrag,
2020
CdkDragHandle,
2121
CdkDragPreview,
2222
CdkDragPlaceholder,
2323
],
2424
exports: [
25-
CdkDrop,
25+
CdkDropList,
2626
CdkDrag,
2727
CdkDragHandle,
2828
CdkDragPreview,

src/cdk/drag-drop/drag-drop-registry.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import {
99
import {DragDropRegistry} from './drag-drop-registry';
1010
import {DragDropModule} from './drag-drop-module';
1111
import {CdkDrag} from './drag';
12-
import {CdkDrop} from './drop';
12+
import {CdkDropList} from './drop-list';
1313

1414
describe('DragDropRegistry', () => {
1515
let fixture: ComponentFixture<SimpleDropZone>;
1616
let testComponent: SimpleDropZone;
17-
let registry: DragDropRegistry<CdkDrag, CdkDrop>;
17+
let registry: DragDropRegistry<CdkDrag, CdkDropList>;
1818

1919
beforeEach(fakeAsync(() => {
2020
TestBed.configureTestingModule({
@@ -26,7 +26,7 @@ describe('DragDropRegistry', () => {
2626
testComponent = fixture.componentInstance;
2727
fixture.detectChanges();
2828

29-
inject([DragDropRegistry], (c: DragDropRegistry<CdkDrag, CdkDrop>) => {
29+
inject([DragDropRegistry], (c: DragDropRegistry<CdkDrag, CdkDropList>) => {
3030
registry = c;
3131
})();
3232
}));
@@ -159,16 +159,16 @@ describe('DragDropRegistry', () => {
159159

160160
@Component({
161161
template: `
162-
<div cdkDrop id="items" [cdkDropData]="items">
162+
<div cdkDropList id="items" [cdkDropListData]="items">
163163
<div *ngFor="let item of items" cdkDrag>{{item}}</div>
164164
</div>
165165
166-
<div cdkDrop id="items" *ngIf="showDuplicateContainer"></div>
166+
<div cdkDropList id="items" *ngIf="showDuplicateContainer"></div>
167167
`
168168
})
169169
class SimpleDropZone {
170170
@ViewChildren(CdkDrag) dragItems: QueryList<CdkDrag>;
171-
@ViewChildren(CdkDrop) dropInstances: QueryList<CdkDrop>;
171+
@ViewChildren(CdkDropList) dropInstances: QueryList<CdkDropList>;
172172
items = ['Zero', 'One', 'Two', 'Three'];
173173
showDuplicateContainer = false;
174174
}

src/cdk/drag-drop/drag-drop.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,62 +6,62 @@ in addition to horizontal lists and locking along an axis.
66
### Getting started
77
Start by importing `DragDropModule` into the `NgModule` where you want to use drag-and-drop
88
features. You can now add the `cdkDrag` directive to elements to make them draggable. When
9-
outside of a `cdkDrop` element, draggable elements can be freely moved around the page.
10-
You can add `cdkDrop` elements to constrain where elements may be dropped.
9+
outside of a `cdkDropList` element, draggable elements can be freely moved around the page.
10+
You can add `cdkDropList` elements to constrain where elements may be dropped.
1111

1212
<!-- example(cdk-drag-drop-overview) -->
1313

1414
### Reordering lists
15-
Adding `cdkDrop` around a set of `cdkDrag` elements groups the draggables into a
15+
Adding `cdkDropList` around a set of `cdkDrag` elements groups the draggables into a
1616
reorderable collection. Items will automatically rearrange as an element moves. Note
17-
that this will *not* update your data model; you can listen to the `cdkDropDropped` event to
17+
that this will *not* update your data model; you can listen to the `cdkDropListDropped` event to
1818
update the data model once the user finishes dragging.
1919

2020
<!-- example(cdk-drag-drop-sorting) -->
2121

2222
### Transferring items between lists
23-
The `cdkDrop` directive supports transferring dragged items between connected drop zones.
24-
You can connect one or more `cdkDrop` instances together by setting the `cdkDropConnectedTo`
23+
The `cdkDropList` directive supports transferring dragged items between connected drop zones.
24+
You can connect one or more `cdkDropList` instances together by setting the `cdkDropListConnectedTo`
2525
property.
2626

2727
<!-- example(cdk-drag-drop-connected-sorting) -->
2828

29-
Note that `cdkDropConnectedTo` works both with a direct reference to another `cdkDrop`, or by
29+
Note that `cdkDropListConnectedTo` works both with a direct reference to another `cdkDropList`, or by
3030
referencing the `id` of another drop container:
3131

3232
```html
3333
<!-- This is valid -->
34-
<div cdkDrop #listOne="cdkDrop" [cdkDropConnectedTo]="[listTwo]"></div>
35-
<div cdkDrop #listTwo="cdkDrop" [cdkDropConnectedTo]="[listOne]"></div>
34+
<div cdkDropList #listOne="cdkDropList" [cdkDropListConnectedTo]="[listTwo]"></div>
35+
<div cdkDropList #listTwo="cdkDropList" [cdkDropListConnectedTo]="[listOne]"></div>
3636

3737
<!-- This is valid as well -->
38-
<div cdkDrop id="list-one" [cdkDropConnectedTo]="['list-two']"></div>
39-
<div cdkDrop id="list-two" [cdkDropConnectedTo]="['list-one']"></div>
38+
<div cdkDropList id="list-one" [cdkDropListConnectedTo]="['list-two']"></div>
39+
<div cdkDropList id="list-two" [cdkDropListConnectedTo]="['list-one']"></div>
4040
```
4141

4242
### Attaching data
43-
You can associate some arbitrary data with both `cdkDrag` and `cdkDrop` by setting `cdkDragData`
44-
or `cdkDropData`, respectively. Events fired from both directives include this data, allowing
43+
You can associate some arbitrary data with both `cdkDrag` and `cdkDropList` by setting `cdkDragData`
44+
or `cdkDropListData`, respectively. Events fired from both directives include this data, allowing
4545
you to easily identify the origin of the drag or drop interaction.
4646

4747
```html
48-
<div cdkDrop [cdkDropData]="list" *ngFor="let list of lists" (cdkDropDropped)="drop($event)">
48+
<div cdkDropList [cdkDropListData]="list" *ngFor="let list of lists" (cdkDropListDropped)="drop($event)">
4949
<div cdkDrag [cdkDragData]="item" *ngFor="let item of list"></div>
5050
</div>
5151
```
5252

5353
### Styling
54-
The `cdkDrag` and `cdkDrop` directive include only those styles strictly necessary for
54+
The `cdkDrag` and `cdkDropList` directive include only those styles strictly necessary for
5555
functionality. The application can then customize the elements by styling CSS classes added
5656
by the directives:
5757

5858
| Selector | Description |
5959
|---------------------|--------------------------------------------------------------------------|
60-
| `.cdk-drop` | Corresponds to the `cdkDrop` container. |
60+
| `.cdk-drop-list` | Corresponds to the `cdkDropList` container. |
6161
| `.cdk-drag` | Corresponds to a `cdkDrag` instance. |
6262
| `.cdk-drag-preview` | This is the element that will be rendered next to the user's cursor as they're dragging an item in a sortable list. By default the element looks exactly like the element that is being dragged. |
63-
| `.cdk-drag-placeholder` | This is element that will be shown instead of the real element as it's being dragged inside a `cdkDrop`. By default this will look exactly like the element that is being sorted. |
64-
| `.cdk-drop-dragging` | A class that is added to `cdkDrop` while the user is dragging an item. |
63+
| `.cdk-drag-placeholder` | This is element that will be shown instead of the real element as it's being dragged inside a `cdkDropList`. By default this will look exactly like the element that is being sorted. |
64+
| `.cdk-drop-dragging` | A class that is added to `cdkDropList` while the user is dragging an item. |
6565

6666
### Animations
6767
The drag-and-drop module supports animations both while sorting an element inside a list, as well as
@@ -73,7 +73,7 @@ following classes can be used for animations:
7373
through a list.
7474
* `.cdk-drag-animating` - This class is added to a `cdkDrag` when the user has stopped dragging.
7575
If you add a `transition` to it, the CDK will animate the element from its drop position to
76-
the final position inside the `cdkDrop` container.
76+
the final position inside the `cdkDropList` container.
7777

7878
Example animations:
7979

@@ -105,14 +105,14 @@ This preview can be customized, though, by providing a custom template via `*cdk
105105
<!-- example(cdk-drag-drop-custom-preview) -->
106106

107107
### List orientation
108-
The `cdkDrop` directive assumes that lists are vertical by default. This can be
108+
The `cdkDropList` directive assumes that lists are vertical by default. This can be
109109
changed by setting the `orientation` property to `"horizontal".
110110

111111
<!-- example(cdk-drag-drop-horizontal-sorting) -->
112112

113113
### Restricting movement along an axis
114114
By default, `cdkDrag` allows free movement in all directions. To restrict dragging to a
115-
specific axis, you can set `cdkDragLockAxis` on `cdkDrag` or `lockAxis` on `cdkDrop`
115+
specific axis, you can set `cdkDragLockAxis` on `cdkDrag` or `lockAxis` on `cdkDropList`
116116
to either `"x"` or `"y"`.
117117

118118
<!-- example(cdk-drag-drop-axis-lock) -->

src/cdk/drag-drop/drag-events.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import {CdkDrag} from './drag';
10-
import {CdkDropContainer} from './drop-container';
10+
import {CdkDropListContainer} from './drop-list-container';
1111

1212
/** Event emitted when the user starts dragging a draggable. */
1313
export interface CdkDragStart<T = any> {
@@ -24,7 +24,7 @@ export interface CdkDragEnd<T = any> {
2424
/** Event emitted when the user moves an item into a new drop container. */
2525
export interface CdkDragEnter<T = any, I = T> {
2626
/** Container into which the user has moved the item. */
27-
container: CdkDropContainer<T>;
27+
container: CdkDropListContainer<T>;
2828
/** Item that was removed from the container. */
2929
item: CdkDrag<I>;
3030
}
@@ -35,7 +35,7 @@ export interface CdkDragEnter<T = any, I = T> {
3535
*/
3636
export interface CdkDragExit<T = any, I = T> {
3737
/** Container from which the user has a removed an item. */
38-
container: CdkDropContainer<T>;
38+
container: CdkDropListContainer<T>;
3939
/** Item that was removed from the container. */
4040
item: CdkDrag<I>;
4141
}
@@ -50,9 +50,9 @@ export interface CdkDragDrop<T, O = T> {
5050
/** Item that is being dropped. */
5151
item: CdkDrag;
5252
/** Container in which the item was dropped. */
53-
container: CdkDropContainer<T>;
53+
container: CdkDropListContainer<T>;
5454
/** Container from which the item was picked up. Can be the same as the `container`. */
55-
previousContainer: CdkDropContainer<O>;
55+
previousContainer: CdkDropListContainer<O>;
5656
}
5757

5858
/** Event emitted as the user is dragging a draggable item. */

0 commit comments

Comments
 (0)