(targetId, options = { shallow: false })
| 110 | } |
| 111 | |
| 112 | isOverTarget(targetId, options = { shallow: false }) { |
| 113 | const { shallow } = options; |
| 114 | if (!this.isDragging()) { |
| 115 | return false; |
| 116 | } |
| 117 | |
| 118 | const targetType = this.registry.getTargetType(targetId); |
| 119 | const draggedItemType = this.getItemType(); |
| 120 | if (!matchesType(targetType, draggedItemType)) { |
| 121 | return false; |
| 122 | } |
| 123 | |
| 124 | const targetIds = this.getTargetIds(); |
| 125 | if (!targetIds.length) { |
| 126 | return false; |
| 127 | } |
| 128 | |
| 129 | const index = targetIds.indexOf(targetId); |
| 130 | if (shallow) { |
| 131 | return index === targetIds.length - 1; |
| 132 | } else { |
| 133 | return index > -1; |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | getItemType() { |
| 138 | return this.store.getState().dragOperation.itemType; |
no test coverage detected