MCPcopy Create free account
hub / github.com/microsoft/SandDance / _getPositionData

Function _getPositionData

docs/app/js/sanddance-app.js:32002–32016  ·  view source on GitHub ↗

* Returns the appropriate IPositionData based on the props altered for RTL. * If directionalHintForRTL is passed in that is used if the page is RTL. * If directionalHint is specified, no directionalHintForRTL is available, and the page is RTL, the hint will be * flipped (e.g. bottomLeftEdge would

(directionalHint, directionalHintForRTL, previousPositions)

Source from the content-addressed store, hash-verified

32000 *
32001 * If there is no directionalHint passed in, bottomAutoEdge is chosen automatically.
32002 */ function _getPositionData(directionalHint, directionalHintForRTL, previousPositions) {
32003 if (directionalHint === void 0) directionalHint = (0, _directionalHint.DirectionalHint).bottomAutoEdge;
32004 if (previousPositions) return {
32005 alignmentEdge: previousPositions.alignmentEdge,
32006 isAuto: previousPositions.isAuto,
32007 targetEdge: previousPositions.targetEdge
32008 };
32009 var positionInformation = (0, _tslib.__assign)({}, DirectionalDictionary[directionalHint]);
32010 if ((0, _utilities.getRTL)()) {
32011 // If alignment edge exists and that alignment edge is -2 or 2, right or left, then flip it.
32012 if (positionInformation.alignmentEdge && positionInformation.alignmentEdge % 2 === 0) positionInformation.alignmentEdge = positionInformation.alignmentEdge * -1;
32013 return directionalHintForRTL !== undefined ? DirectionalDictionary[directionalHintForRTL] : positionInformation;
32014 }
32015 return positionInformation;
32016}
32017/**
32018 * Get's the alignment data for the given information. This only really matters if the positioning is Auto.
32019 * If it is auto then the alignmentEdge should be chosen based on the target edge's position relative to

Callers 1

_positionElementRelativeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected