UEA-PRODEM
This commit is contained in:
+5
-8
@@ -20,10 +20,6 @@ const oppositeSideMap = {
|
||||
bottom: 'top',
|
||||
top: 'bottom'
|
||||
};
|
||||
const oppositeAlignmentMap = {
|
||||
start: 'end',
|
||||
end: 'start'
|
||||
};
|
||||
function clamp(start, value, end) {
|
||||
return max(start, min(value, end));
|
||||
}
|
||||
@@ -42,9 +38,9 @@ function getOppositeAxis(axis) {
|
||||
function getAxisLength(axis) {
|
||||
return axis === 'y' ? 'height' : 'width';
|
||||
}
|
||||
const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
|
||||
function getSideAxis(placement) {
|
||||
return yAxisSides.has(getSide(placement)) ? 'y' : 'x';
|
||||
const firstChar = placement[0];
|
||||
return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';
|
||||
}
|
||||
function getAlignmentAxis(placement) {
|
||||
return getOppositeAxis(getSideAxis(placement));
|
||||
@@ -67,7 +63,7 @@ function getExpandedPlacements(placement) {
|
||||
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
||||
}
|
||||
function getOppositeAlignmentPlacement(placement) {
|
||||
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
||||
return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');
|
||||
}
|
||||
const lrPlacement = ['left', 'right'];
|
||||
const rlPlacement = ['right', 'left'];
|
||||
@@ -98,7 +94,8 @@ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
||||
return list;
|
||||
}
|
||||
function getOppositePlacement(placement) {
|
||||
return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
|
||||
const side = getSide(placement);
|
||||
return oppositeSideMap[side] + placement.slice(side.length);
|
||||
}
|
||||
function expandPaddingObject(padding) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user