(e: DragEvent)
| 233 | }; |
| 234 | |
| 235 | let onDragEnter = (e: DragEvent) => { |
| 236 | e.preventDefault(); |
| 237 | e.stopPropagation(); |
| 238 | state.dragOverElements.add(getEventTarget(e)); |
| 239 | if (state.dragOverElements.size > 1) { |
| 240 | return; |
| 241 | } |
| 242 | |
| 243 | let allowedOperationsBits = getAllowedOperations(e); |
| 244 | let allowedOperations = allowedOperationsToArray(allowedOperationsBits); |
| 245 | let dropOperation = allowedOperations[0]; |
| 246 | |
| 247 | if (typeof options.getDropOperation === 'function') { |
| 248 | let types = new DragTypes(e.dataTransfer); |
| 249 | dropOperation = getDropOperation( |
| 250 | allowedOperationsBits, |
| 251 | options.getDropOperation(types, allowedOperations) |
| 252 | ); |
| 253 | } |
| 254 | |
| 255 | if (typeof options.getDropOperationForPoint === 'function') { |
| 256 | let types = new DragTypes(e.dataTransfer); |
| 257 | let rect = (e.currentTarget as HTMLElement).getBoundingClientRect(); |
| 258 | dropOperation = getDropOperation( |
| 259 | allowedOperationsBits, |
| 260 | options.getDropOperationForPoint( |
| 261 | types, |
| 262 | allowedOperations, |
| 263 | e.clientX - rect.x, |
| 264 | e.clientY - rect.y |
| 265 | ) |
| 266 | ); |
| 267 | } |
| 268 | |
| 269 | state.x = e.clientX; |
| 270 | state.y = e.clientY; |
| 271 | state.allowedOperations = allowedOperationsBits; |
| 272 | state.dropEffect = DROP_OPERATION_TO_DROP_EFFECT[dropOperation] || 'none'; |
| 273 | e.dataTransfer.dropEffect = state.dropEffect; |
| 274 | |
| 275 | if (dropOperation !== 'cancel') { |
| 276 | fireDropEnter(e); |
| 277 | } |
| 278 | }; |
| 279 | |
| 280 | let onDragLeave = (e: DragEvent) => { |
| 281 | e.preventDefault(); |
nothing calls this directly
no test coverage detected