@internal TODO: set to public as called by DDDroppable!
()
| 490 | |
| 491 | /** @internal TODO: set to public as called by DDDroppable! */ |
| 492 | public ui(): DDUIData { |
| 493 | const containmentEl = this.el.parentElement; |
| 494 | const containmentRect = containmentEl.getBoundingClientRect(); |
| 495 | const offset = this.helper.getBoundingClientRect(); |
| 496 | |
| 497 | // RTL: GridStack measures column positions from the right side of the container, |
| 498 | // so we report `left` as the distance between the helper's right edge and the |
| 499 | // container's right edge (both in viewport-left coordinates via getBoundingClientRect). |
| 500 | const leftPos = this.option.rtl |
| 501 | ? (containmentRect.right - offset.right) * this.dragTransform.xScale |
| 502 | : (offset.left - containmentRect.left) * this.dragTransform.xScale; |
| 503 | |
| 504 | return { |
| 505 | position: { //Current CSS position of the helper as { top, left } object |
| 506 | top: (offset.top - containmentRect.top) * this.dragTransform.yScale, |
| 507 | left: leftPos |
| 508 | } |
| 509 | /* not used by GridStack for now... |
| 510 | helper: [this.helper], //The object arr representing the helper that's being dragged. |
| 511 | offset: { top: offset.top, left: offset.left } // Current offset position of the helper as { top, left } object. |
| 512 | */ |
| 513 | }; |
| 514 | } |
| 515 | } |
no outgoing calls
no test coverage detected