MCPcopy Create free account
hub / github.com/adobe/react-spectrum / allowedOperationsToArray

Function allowedOperationsToArray

packages/react-aria/src/dnd/useDrop.ts:489–504  ·  view source on GitHub ↗
(allowedOperationsBits: DROP_OPERATION)

Source from the content-addressed store, hash-verified

487}
488
489function allowedOperationsToArray(allowedOperationsBits: DROP_OPERATION) {
490 let allowedOperations: Array<DropOperation> = [];
491 if (allowedOperationsBits & DROP_OPERATION.move) {
492 allowedOperations.push('move');
493 }
494
495 if (allowedOperationsBits & DROP_OPERATION.copy) {
496 allowedOperations.push('copy');
497 }
498
499 if (allowedOperationsBits & DROP_OPERATION.link) {
500 allowedOperations.push('link');
501 }
502
503 return allowedOperations;
504}
505
506function getDropOperation(allowedOperations: DROP_OPERATION, operation: DropOperation) {
507 let op = DROP_OPERATION[operation];

Callers 2

onDragOverFunction · 0.85
onDragEnterFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected