Skip to content

Commit d40da65

Browse files
authored
refactor(cdk/drag-drop): move sorting and positioning logic into a separate class (#25044)
This is an internal reorganization of the drop list to make it easier to eventually add support for mixed orientation. Includes: * Moving out all the sorting and positioning-related code out of `DropListRef` and into a separate class. The existing logic is very specific to our approach that moves items around using `transform`. The future mixed orientation will likely move the DOM nodes themselves which would've been difficult to manage if we kept the positioning logic within `DropListRef`. * Moves some of the DOM-related utilities into the `dom` directory in order to reduce clutter in the root of the package.
1 parent 13d257c commit d40da65

File tree

10 files changed

+546
-384
lines changed

10 files changed

+546
-384
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {of as observableOf} from 'rxjs';
3030
import {DragDropModule} from '../drag-drop-module';
3131
import {CdkDragDrop, CdkDragEnter, CdkDragStart} from '../drag-events';
3232
import {Point, DragRef, PreviewContainer} from '../drag-ref';
33-
import {extendStyles} from '../drag-styling';
33+
import {extendStyles} from '../dom/styling';
3434
import {moveItemInArray} from '../drag-utils';
3535

3636
import {CdkDrag} from './drag';
File renamed without changes.
File renamed without changes.

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ import {
2525
extendStyles,
2626
toggleNativeDragInteractions,
2727
toggleVisibility,
28-
} from './drag-styling';
29-
import {getTransformTransitionDurationInMs} from './transition-duration';
30-
import {getMutableClientRect, adjustClientRect} from './client-rect';
31-
import {ParentPositionTracker} from './parent-position-tracker';
32-
import {deepCloneNode} from './clone-node';
28+
} from './dom/styling';
29+
import {getTransformTransitionDurationInMs} from './dom/transition-duration';
30+
import {getMutableClientRect, adjustClientRect} from './dom/client-rect';
31+
import {ParentPositionTracker} from './dom/parent-position-tracker';
32+
import {deepCloneNode} from './dom/clone-node';
3333

3434
/** Object that can be used to configure the behavior of DragRef. */
3535
export interface DragRefConfig {

0 commit comments

Comments
 (0)