Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
package.dist.util.dragAndDrop.longDragOverHandler.js.map Maven / Gradle / Ivy
{"version":3,"file":"longDragOverHandler.js","sourceRoot":"","sources":["../../../src/util/dragAndDrop/longDragOverHandler.ts"],"names":[],"mappings":"AAAA,IAAI,UAAU,GAAuB,IAAI,CAAC;AAC1C,IAAI,uBAAuB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AACzC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAErC,MAAM,mBAAmB,GAAG,CAAC,eAAuB,EAAE,EAAE;IACvD,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,UAA4E,EAAE,EAAE;QACzH,MAAM,WAAW,GAAG,UAAU,CAAC,KAAM,CAAC;QAEtC,UAAU,CAAC,KAAK,GAAG,SAAS,cAAc,CAAC,CAAY;YACtD,IAAI,cAAc,GAAG,KAAK,CAAC;YAE3B,IAAI,CAAC,CAAC,MAAM,YAAY,WAAW,EAAE;gBACpC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAc,eAAe,CAAC,CAAC;gBAErE,IAAI,aAAa,KAAK,UAAU,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,uBAAuB,IAAI,wBAAwB,EAAE;oBACrG,cAAc,GAAG,IAAI,CAAC;iBACtB;qBAAM,IAAI,aAAa,KAAK,UAAU,EAAE;oBACxC,UAAU,GAAG,aAAa,CAAC;oBAC3B,uBAAuB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;iBACrC;aACD;YAED,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC;QAC9C,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACnB,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["let lastTarget: HTMLElement | null = null;\nlet lastTargetDragOverStart = Date.now();\nconst LONG_DRAG_OVER_THRESHOLD = 300;\n\nconst longDragOverHandler = (targetsSelector: string) => {\n\treturn (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<(arg0: DragEvent, arg1: boolean) => any>) => {\n\t\tconst origHandler = descriptor.value!;\n\n\t\tdescriptor.value = function handleDragOver(e: DragEvent) {\n\t\t\tlet isLongDragOver = false;\n\n\t\t\tif (e.target instanceof HTMLElement) {\n\t\t\t\tconst currentTarget = e.target.closest(targetsSelector);\n\n\t\t\t\tif (currentTarget === lastTarget && Date.now() - lastTargetDragOverStart >= LONG_DRAG_OVER_THRESHOLD) {\n\t\t\t\t\tisLongDragOver = true;\n\t\t\t\t} else if (currentTarget !== lastTarget) {\n\t\t\t\t\tlastTarget = currentTarget;\n\t\t\t\t\tlastTargetDragOverStart = Date.now();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\torigHandler.apply(this, [e, isLongDragOver]);\n\t\t};\n\n\t\treturn descriptor;\n\t};\n};\n\nexport default longDragOverHandler;\n"]}