Skip to content

Commit de128e8

Browse files
authored
refactor(drag-drop): remove deprecated APIs for version 10 (#19280)
1 parent 4eee81a commit de128e8

File tree

4 files changed

+7
-75
lines changed

4 files changed

+7
-75
lines changed

src/cdk/drag-drop/directives/config.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,3 @@ export interface DragDropConfig extends Partial<DragRefConfig> {
4444
listOrientation?: DropListOrientation;
4545
zIndex?: number;
4646
}
47-
48-
/**
49-
* @deprecated No longer being used. To be removed.
50-
* @breaking-change 10.0.0
51-
* @docs-private
52-
*/
53-
export function CDK_DRAG_CONFIG_FACTORY(): DragDropConfig {
54-
return {dragStartThreshold: 5, pointerDirectionChangeThreshold: 5};
55-
}

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,18 @@ export class CdkDrag<T = any> implements AfterViewInit, OnChanges, OnDestroy {
226226
/**
227227
* Returns the element that is being used as a placeholder
228228
* while the current element is being dragged.
229+
* @deprecated No longer being used to be removed.
230+
* @breaking-change 11.0.0
229231
*/
230232
getPlaceholderElement(): HTMLElement {
231233
return this._dragRef.getPlaceholderElement();
232234
}
233235

234-
/** Returns the root draggable element. */
236+
/**
237+
* Returns the root draggable element.
238+
* @deprecated No longer being used to be removed.
239+
* @breaking-change 11.0.0
240+
*/
235241
getRootElement(): HTMLElement {
236242
return this._dragRef.getRootElement();
237243
}

src/cdk/drag-drop/directives/drop-list.ts

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -233,64 +233,6 @@ export class CdkDropList<T = any> implements OnDestroy {
233233
this._destroyed.complete();
234234
}
235235

236-
/**
237-
* Starts dragging an item.
238-
* @deprecated No longer being used. To be removed.
239-
* @breaking-change 10.0.0
240-
*/
241-
start(): void {
242-
this._dropListRef.start();
243-
}
244-
245-
/**
246-
* Drops an item into this container.
247-
* @param item Item being dropped into the container.
248-
* @param currentIndex Index at which the item should be inserted.
249-
* @param previousContainer Container from which the item got dragged in.
250-
* @param isPointerOverContainer Whether the user's pointer was over the
251-
* container when the item was dropped.
252-
*
253-
* @deprecated No longer being used. To be removed.
254-
* @breaking-change 10.0.0
255-
*/
256-
drop(item: CdkDrag, currentIndex: number, previousContainer: CdkDropList,
257-
isPointerOverContainer: boolean): void {
258-
this._dropListRef.drop(item._dragRef, currentIndex, previousContainer._dropListRef,
259-
isPointerOverContainer, {x: 0, y: 0});
260-
}
261-
262-
/**
263-
* Emits an event to indicate that the user moved an item into the container.
264-
* @param item Item that was moved into the container.
265-
* @param pointerX Position of the item along the X axis.
266-
* @param pointerY Position of the item along the Y axis.
267-
* @deprecated No longer being used. To be removed.
268-
* @breaking-change 10.0.0
269-
*/
270-
enter(item: CdkDrag, pointerX: number, pointerY: number): void {
271-
this._dropListRef.enter(item._dragRef, pointerX, pointerY);
272-
}
273-
274-
/**
275-
* Removes an item from the container after it was dragged into another container by the user.
276-
* @param item Item that was dragged out.
277-
* @deprecated No longer being used. To be removed.
278-
* @breaking-change 10.0.0
279-
*/
280-
exit(item: CdkDrag): void {
281-
this._dropListRef.exit(item._dragRef);
282-
}
283-
284-
/**
285-
* Figures out the index of an item in the container.
286-
* @param item Item whose index should be determined.
287-
* @deprecated No longer being used. To be removed.
288-
* @breaking-change 10.0.0
289-
*/
290-
getItemIndex(item: CdkDrag): number {
291-
return this._dropListRef.getItemIndex(item._dragRef);
292-
}
293-
294236
/** Syncs the inputs of the CdkDropList with the options of the underlying DropListRef. */
295237
private _setupInputSyncSubscription(ref: DropListRef<CdkDropList>) {
296238
if (this._dir) {

tools/public_api_guard/cdk/drag-drop.d.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
export declare const CDK_DRAG_CONFIG: InjectionToken<DragDropConfig>;
22

3-
export declare function CDK_DRAG_CONFIG_FACTORY(): DragDropConfig;
4-
53
export declare const CDK_DROP_LIST: InjectionToken<CdkDropList>;
64

75
export declare class CdkDrag<T = any> implements AfterViewInit, OnChanges, OnDestroy {
@@ -166,14 +164,9 @@ export declare class CdkDropList<T = any> implements OnDestroy {
166164
element: ElementRef<HTMLElement>, dragDrop: DragDrop, _changeDetectorRef: ChangeDetectorRef, _dir?: Directionality | undefined, _group?: CdkDropListGroup<CdkDropList<any>> | undefined,
167165
_scrollDispatcher?: ScrollDispatcher | undefined, config?: DragDropConfig);
168166
addItem(item: CdkDrag): void;
169-
drop(item: CdkDrag, currentIndex: number, previousContainer: CdkDropList, isPointerOverContainer: boolean): void;
170-
enter(item: CdkDrag, pointerX: number, pointerY: number): void;
171-
exit(item: CdkDrag): void;
172-
getItemIndex(item: CdkDrag): number;
173167
getSortedItems(): CdkDrag[];
174168
ngOnDestroy(): void;
175169
removeItem(item: CdkDrag): void;
176-
start(): void;
177170
static ngAcceptInputType_autoScrollDisabled: BooleanInput;
178171
static ngAcceptInputType_disabled: BooleanInput;
179172
static ngAcceptInputType_sortingDisabled: BooleanInput;

0 commit comments

Comments
 (0)