2018-01-11 18:53:51 +08:00
|
|
|
const autoAdjustOverflow = {
|
|
|
|
adjustX: 1,
|
|
|
|
adjustY: 1,
|
2019-01-12 11:33:27 +08:00
|
|
|
};
|
2018-01-11 18:53:51 +08:00
|
|
|
|
2019-01-12 11:33:27 +08:00
|
|
|
const targetOffset = [0, 0];
|
2018-01-11 18:53:51 +08:00
|
|
|
|
|
|
|
export const placements = {
|
|
|
|
left: {
|
|
|
|
points: ['cr', 'cl'],
|
|
|
|
overflow: autoAdjustOverflow,
|
|
|
|
offset: [-4, 0],
|
|
|
|
targetOffset,
|
|
|
|
},
|
|
|
|
right: {
|
|
|
|
points: ['cl', 'cr'],
|
|
|
|
overflow: autoAdjustOverflow,
|
|
|
|
offset: [4, 0],
|
|
|
|
targetOffset,
|
|
|
|
},
|
|
|
|
top: {
|
|
|
|
points: ['bc', 'tc'],
|
|
|
|
overflow: autoAdjustOverflow,
|
|
|
|
offset: [0, -4],
|
|
|
|
targetOffset,
|
|
|
|
},
|
|
|
|
bottom: {
|
|
|
|
points: ['tc', 'bc'],
|
|
|
|
overflow: autoAdjustOverflow,
|
|
|
|
offset: [0, 4],
|
|
|
|
targetOffset,
|
|
|
|
},
|
|
|
|
topLeft: {
|
|
|
|
points: ['bl', 'tl'],
|
|
|
|
overflow: autoAdjustOverflow,
|
|
|
|
offset: [0, -4],
|
|
|
|
targetOffset,
|
|
|
|
},
|
|
|
|
leftTop: {
|
|
|
|
points: ['tr', 'tl'],
|
|
|
|
overflow: autoAdjustOverflow,
|
|
|
|
offset: [-4, 0],
|
|
|
|
targetOffset,
|
|
|
|
},
|
|
|
|
topRight: {
|
|
|
|
points: ['br', 'tr'],
|
|
|
|
overflow: autoAdjustOverflow,
|
|
|
|
offset: [0, -4],
|
|
|
|
targetOffset,
|
|
|
|
},
|
|
|
|
rightTop: {
|
|
|
|
points: ['tl', 'tr'],
|
|
|
|
overflow: autoAdjustOverflow,
|
|
|
|
offset: [4, 0],
|
|
|
|
targetOffset,
|
|
|
|
},
|
|
|
|
bottomRight: {
|
|
|
|
points: ['tr', 'br'],
|
|
|
|
overflow: autoAdjustOverflow,
|
|
|
|
offset: [0, 4],
|
|
|
|
targetOffset,
|
|
|
|
},
|
|
|
|
rightBottom: {
|
|
|
|
points: ['bl', 'br'],
|
|
|
|
overflow: autoAdjustOverflow,
|
|
|
|
offset: [4, 0],
|
|
|
|
targetOffset,
|
|
|
|
},
|
|
|
|
bottomLeft: {
|
|
|
|
points: ['tl', 'bl'],
|
|
|
|
overflow: autoAdjustOverflow,
|
|
|
|
offset: [0, 4],
|
|
|
|
targetOffset,
|
|
|
|
},
|
|
|
|
leftBottom: {
|
|
|
|
points: ['br', 'bl'],
|
|
|
|
overflow: autoAdjustOverflow,
|
|
|
|
offset: [-4, 0],
|
|
|
|
targetOffset,
|
|
|
|
},
|
2019-01-12 11:33:27 +08:00
|
|
|
};
|
2018-01-11 18:53:51 +08:00
|
|
|
|
2019-01-12 11:33:27 +08:00
|
|
|
export default placements;
|