@mirai/ui 1.0.40 → 1.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -36,7 +36,7 @@ var getLayerPosition = function getLayerPosition() {
|
|
|
36
36
|
var top = componentTop + componentHeight;
|
|
37
37
|
var gapTop = componentTop;
|
|
38
38
|
var gapBottom = height - top;
|
|
39
|
-
if (
|
|
39
|
+
if (contentHeight > gapBottom && gapTop > gapBottom && !forceBottom || forceTop) top = componentTop - contentHeight;
|
|
40
40
|
var left = componentLeft;
|
|
41
41
|
var gapLeft = componentLeft + componentWidth;
|
|
42
42
|
var gapRight = width - componentLeft;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLayerPosition.js","names":["getLayerPosition","componentLayout","contentLayout","device","centered","forceBottom","forceLeft","forceRight","forceTop","left","componentLeft","top","componentTop","width","componentWidth","height","componentHeight","contentWidth","contentHeight","gapTop","gapBottom","gapLeft","gapRight","gapCenter","space"],"sources":["../../../../src/primitives/Layer/helpers/getLayerPosition.js"],"sourcesContent":["export const getLayerPosition = (\n componentLayout = {},\n contentLayout = {},\n device = {},\n { centered, forceBottom, forceLeft, forceRight, forceTop } = {},\n) => {\n const {\n left: componentLeft = 0,\n top: componentTop = 0,\n width: componentWidth = 0,\n height: componentHeight = 0,\n } = componentLayout;\n const { width: contentWidth = 0, height: contentHeight = 0 } = contentLayout;\n const { height = 0, width = 0 } = device;\n\n let top = componentTop + componentHeight;\n const gapTop = componentTop;\n const gapBottom = height - top;\n if ((
|
|
1
|
+
{"version":3,"file":"getLayerPosition.js","names":["getLayerPosition","componentLayout","contentLayout","device","centered","forceBottom","forceLeft","forceRight","forceTop","left","componentLeft","top","componentTop","width","componentWidth","height","componentHeight","contentWidth","contentHeight","gapTop","gapBottom","gapLeft","gapRight","gapCenter","space"],"sources":["../../../../src/primitives/Layer/helpers/getLayerPosition.js"],"sourcesContent":["export const getLayerPosition = (\n componentLayout = {},\n contentLayout = {},\n device = {},\n { centered, forceBottom, forceLeft, forceRight, forceTop } = {},\n) => {\n const {\n left: componentLeft = 0,\n top: componentTop = 0,\n width: componentWidth = 0,\n height: componentHeight = 0,\n } = componentLayout;\n const { width: contentWidth = 0, height: contentHeight = 0 } = contentLayout;\n const { height = 0, width = 0 } = device;\n\n let top = componentTop + componentHeight;\n const gapTop = componentTop;\n const gapBottom = height - top;\n if ((contentHeight > gapBottom && gapTop > gapBottom && !forceBottom) || forceTop) top = componentTop - contentHeight;\n\n let left = componentLeft;\n const gapLeft = componentLeft + componentWidth;\n const gapRight = width - componentLeft;\n\n if ((contentWidth > gapRight && gapLeft > gapRight && !forceLeft) || forceRight)\n left = componentLeft - contentWidth + componentWidth;\n\n if (centered) {\n const gapCenter = (componentWidth + contentWidth) / 2;\n const space = (contentWidth - componentWidth) / 2;\n if (gapLeft > gapRight) left = componentLeft - contentWidth + componentWidth;\n if (gapLeft > gapCenter && gapRight > gapCenter) left += space * (gapLeft > gapRight ? 1 : -1);\n }\n\n return { left, top };\n};\n"],"mappings":";;;;;;;AAAO,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,GAK3B;EAAA,IAJHC,eAIG,uEAJe,EAIf;EAAA,IAHHC,aAGG,uEAHa,EAGb;EAAA,IAFHC,MAEG,uEAFM,EAEN;;EAAA,+EAD0D,EAC1D;EAAA,IADDC,QACC,QADDA,QACC;EAAA,IADSC,WACT,QADSA,WACT;EAAA,IADsBC,SACtB,QADsBA,SACtB;EAAA,IADiCC,UACjC,QADiCA,UACjC;EAAA,IAD6CC,QAC7C,QAD6CA,QAC7C;;EACH,4BAKIP,eALJ,CACEQ,IADF;EAAA,IACQC,aADR,sCACwB,CADxB;EAAA,2BAKIT,eALJ,CAEEU,GAFF;EAAA,IAEOC,YAFP,qCAEsB,CAFtB;EAAA,4BAKIX,eALJ,CAGEY,KAHF;EAAA,IAGSC,cAHT,sCAG0B,CAH1B;EAAA,4BAKIb,eALJ,CAIEc,MAJF;E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