DropIndicator.js
907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = DropIndicator;
var React = _interopRequireWildcard(require("react"));
function DropIndicator(_ref) {
var dropPosition = _ref.dropPosition,
dropLevelOffset = _ref.dropLevelOffset,
indent = _ref.indent;
var style = {
pointerEvents: 'none',
position: 'absolute',
right: 0,
backgroundColor: 'red',
height: 2
};
switch (dropPosition) {
case -1:
style.top = 0;
style.left = -dropLevelOffset * indent;
break;
case 1:
style.bottom = 0;
style.left = -dropLevelOffset * indent;
break;
case 0:
style.bottom = 0;
style.left = indent;
break;
}
return /*#__PURE__*/React.createElement("div", {
style: style
});
}