Skip to content

Commit 9314a01

Browse files
authored
Merge pull request #5416 from IgniteUI/SKrastev/drag-drop-refactor
Drag and Drop improvements implementation.
2 parents ba936ff + 832a339 commit 9314a01

19 files changed

+1784
-467
lines changed

projects/igniteui-angular/src/lib/chips/chip.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
IDragStartEventArgs,
2020
IgxDropEnterEventArgs,
2121
IgxDropEventArgs
22-
} from '../directives/dragdrop/dragdrop.directive';
22+
} from '../directives/drag-drop/drag-drop.directive';
2323

2424

2525
export interface IBaseChipEventArgs {

projects/igniteui-angular/src/lib/chips/chips-area.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
} from './chip.component';
2424
import {
2525
IgxDropEnterEventArgs
26-
} from '../directives/dragdrop/dragdrop.directive';
26+
} from '../directives/drag-drop/drag-drop.directive';
2727
import { takeUntil } from 'rxjs/operators';
2828
import { Subject } from 'rxjs/internal/Subject';
2929

projects/igniteui-angular/src/lib/chips/chips.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { IgxAvatarModule } from '../avatar/avatar.component';
66
import { IgxIconModule } from '../icon/index';
77
import { IgxChipComponent } from './chip.component';
88
import { IgxChipsAreaComponent } from './chips-area.component';
9-
import { IgxDragDropModule } from '../directives/dragdrop/dragdrop.directive';
9+
import { IgxDragDropModule } from '../directives/drag-drop/drag-drop.directive';
1010
import { IgxPrefixModule, IgxPrefixDirective} from '../directives/prefix/prefix.directive';
1111
import { IgxSuffixModule, IgxSuffixDirective } from '../directives/suffix/suffix.directive';
1212

projects/igniteui-angular/src/lib/directives/dragdrop/README.md renamed to projects/igniteui-angular/src/lib/directives/drag-drop/README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## Usage
55
```html
6-
<div igxDrag [hideBaseOnDrag]="true" [animateOnRelease]="true" *ngFor="let elem of draggableElems" >
6+
<div igxDrag [animateOnRelease]="true" *ngFor="let elem of draggableElems" >
77
<span [style.margin]="'auto'">{{elem.label}}</span>
88
</div>
99
```
@@ -26,11 +26,9 @@ The `igxDrag` directive can be applied on any DOM element by just adding it to i
2626

2727
By default a drag operation starts when the end user swipes at least 5 px in any direction. Otherwise the interaction is considered as a click and the `dragClicked` event is emitted.
2828

29-
When dragging occurs a drag ghost element is spawned and moves along with the mouse cursor or touch interaction. The original element is still present, but it can be hidden automatically when dragging starts with the `hideBaseOnDrag` input.
29+
When dragging occurs a drag ghost element is spawned and moves along with the mouse cursor or touch interaction.The dragging can be canceled by setting the `cancel` property of the `dragStart` event to `true`. This will cancel the default dragging logic.
3030

31-
The dragging can be canceled by setting the `cancel` property of the `dragStart` event to `true`. This will cancel the default dragging logic.
32-
33-
After the user releases the mouse/touch the drag ghost element is removed from the DOM and if the `hideBaseOnDrag` is enabled it will make the original element visible again and the `dragEnd` event will be emitted. If the `animateOnRelease` input is set to `true` all this will execute after the default animation of the drag ghost is finished which consist of returning it from the last dragged position to the position of the original element. Then the drag ghost will be removed and the `returnMoveEnd` event will be emitted.
31+
After the user releases the mouse/touch the drag ghost element is removed from the DOM and the `dragEnd` event will be emitted. If the `animateOnRelease` input is set to `true` all this will execute after the default animation of the drag ghost is finished which consist of returning it from the last dragged position to the position of the original element. Then the drag ghost will be removed and the `returnMoveEnd` event will be emitted.
3432

3533
## API
3634

@@ -40,10 +38,9 @@ After the user releases the mouse/touch the drag ghost element is removed from t
4038
| :--- | :--- | :--- | :--- |
4139
| igxDrag | any | - | Input used to save data inside the `igxDrag` directive. This can be set when instancing `igxDrag` on an element. |
4240
| dragTolerance | number | 5 | Indicates when the drag should start (in pixels). By default the drag starts after the draggable element is moved by 5px |
41+
| dragGhostHost | any | null | Sets the element to which the dragged element will be appended.
4342
| ghostImageClass | string | '' | Sets a custom class that will be added to the `dragGhost` element. |
44-
| hideBaseOnDrag | boolean | false | Sets if the draggable element should hide when dragging starts. |
4543
| animateOnRelease | boolean | false | Enables/disables the draggable element animation when the element is released. |
46-
| dragGhostHost | any | null | Sets the element to which the dragged element will be appended.
4744

4845
### Outputs
4946

0 commit comments

Comments
 (0)