1 | import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2 |
|
3 | function isPointsEq(a1, a2, isAlignPoint) {
|
4 | if (isAlignPoint) {
|
5 | return a1[0] === a2[0];
|
6 | }
|
7 |
|
8 | return a1[0] === a2[0] && a1[1] === a2[1];
|
9 | }
|
10 |
|
11 | export function getAlignFromPlacement(builtinPlacements, placementStr, align) {
|
12 | var baseAlign = builtinPlacements[placementStr] || {};
|
13 | return _objectSpread(_objectSpread({}, baseAlign), align);
|
14 | }
|
15 | export function getAlignPopupClassName(builtinPlacements, prefixCls, align, isAlignPoint) {
|
16 | var points = align.points;
|
17 | var placements = Object.keys(builtinPlacements);
|
18 |
|
19 | for (var i = 0; i < placements.length; i += 1) {
|
20 | var placement = placements[i];
|
21 |
|
22 | if (isPointsEq(builtinPlacements[placement].points, points, isAlignPoint)) {
|
23 | return "".concat(prefixCls, "-placement-").concat(placement);
|
24 | }
|
25 | }
|
26 |
|
27 | return '';
|
28 | } |
\ | No newline at end of file |