amis-rpc-design/node_modules/rc-tooltip/es/placements.js

84 lines
1.8 KiB
JavaScript
Raw Normal View History

2023-10-07 19:42:30 +08:00
var autoAdjustOverflowTopBottom = {
shiftX: 64,
adjustY: 1
};
var autoAdjustOverflowLeftRight = {
adjustX: 1,
shiftY: true
};
var targetOffset = [0, 0];
export var placements = {
left: {
points: ['cr', 'cl'],
overflow: autoAdjustOverflowLeftRight,
offset: [-4, 0],
targetOffset: targetOffset
},
right: {
points: ['cl', 'cr'],
overflow: autoAdjustOverflowLeftRight,
offset: [4, 0],
targetOffset: targetOffset
},
top: {
points: ['bc', 'tc'],
overflow: autoAdjustOverflowTopBottom,
offset: [0, -4],
targetOffset: targetOffset
},
bottom: {
points: ['tc', 'bc'],
overflow: autoAdjustOverflowTopBottom,
offset: [0, 4],
targetOffset: targetOffset
},
topLeft: {
points: ['bl', 'tl'],
overflow: autoAdjustOverflowTopBottom,
offset: [0, -4],
targetOffset: targetOffset
},
leftTop: {
points: ['tr', 'tl'],
overflow: autoAdjustOverflowLeftRight,
offset: [-4, 0],
targetOffset: targetOffset
},
topRight: {
points: ['br', 'tr'],
overflow: autoAdjustOverflowTopBottom,
offset: [0, -4],
targetOffset: targetOffset
},
rightTop: {
points: ['tl', 'tr'],
overflow: autoAdjustOverflowLeftRight,
offset: [4, 0],
targetOffset: targetOffset
},
bottomRight: {
points: ['tr', 'br'],
overflow: autoAdjustOverflowTopBottom,
offset: [0, 4],
targetOffset: targetOffset
},
rightBottom: {
points: ['bl', 'br'],
overflow: autoAdjustOverflowLeftRight,
offset: [4, 0],
targetOffset: targetOffset
},
bottomLeft: {
points: ['tl', 'bl'],
overflow: autoAdjustOverflowTopBottom,
offset: [0, 4],
targetOffset: targetOffset
},
leftBottom: {
points: ['br', 'bl'],
overflow: autoAdjustOverflowLeftRight,
offset: [-4, 0],
targetOffset: targetOffset
}
};
export default placements;