@mirai/ui 2.0.39 → 2.0.40
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.
|
@@ -59,7 +59,7 @@ var getLayerPosition = function getLayerPosition() {
|
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
var left = componentLeft;
|
|
62
|
-
var gapLeft =
|
|
62
|
+
var gapLeft = screenLeft + componentWidth;
|
|
63
63
|
var gapRight = width - offsetLeft;
|
|
64
64
|
if (contentWidth > gapRight && gapLeft > gapRight && !forceLeft || forceRight) {
|
|
65
65
|
left = componentLeft - contentWidth + componentWidth;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLayerPosition.js","names":["getLayerPosition","componentLayout","contentLayout","device","modal","centered","forceBottom","forceLeft","forceRight","forceTop","left","componentLeft","scrollTop","top","componentTop","width","componentWidth","height","componentHeight","screenLeft","screenTop","contentWidth","contentHeight","aline","offsetLeft","offsetTop","orientation","gapBottom","gapLeft","gapRight","undefined","right","gapCenter","space","center"],"sources":["../../../../src/primitives/Layer/helpers/getLayerPosition.js"],"sourcesContent":["export const getLayerPosition = (\n componentLayout = {},\n contentLayout = {},\n device = {},\n modal,\n { centered, forceBottom, forceLeft, forceRight, forceTop } = {},\n) => {\n const {\n left: componentLeft = 0,\n scrollTop = 0,\n top: componentTop = 0,\n width: componentWidth = 0,\n height: componentHeight = 0,\n screenLeft = componentLeft || 0,\n screenTop = componentTop || 0,\n } = componentLayout;\n const { width: contentWidth = 0, height: contentHeight = 0 } = contentLayout;\n const { height = 0, width = 0 } = modal || device;\n const aline = centered && (forceLeft || forceRight);\n const offsetLeft = modal ? componentLeft : screenLeft;\n const offsetTop = modal ? componentTop : screenTop;\n let orientation = { left: true };\n\n let top = componentTop + componentHeight - scrollTop;\n const gapBottom = height - (offsetTop + componentHeight);\n if ((contentHeight > gapBottom && offsetTop > gapBottom && !forceBottom) || forceTop) {\n top = componentTop - contentHeight - scrollTop;\n orientation = { ...orientation, top: true };\n }\n\n let left = componentLeft;\n const gapLeft =
|
|
1
|
+
{"version":3,"file":"getLayerPosition.js","names":["getLayerPosition","componentLayout","contentLayout","device","modal","centered","forceBottom","forceLeft","forceRight","forceTop","left","componentLeft","scrollTop","top","componentTop","width","componentWidth","height","componentHeight","screenLeft","screenTop","contentWidth","contentHeight","aline","offsetLeft","offsetTop","orientation","gapBottom","gapLeft","gapRight","undefined","right","gapCenter","space","center"],"sources":["../../../../src/primitives/Layer/helpers/getLayerPosition.js"],"sourcesContent":["export const getLayerPosition = (\n componentLayout = {},\n contentLayout = {},\n device = {},\n modal,\n { centered, forceBottom, forceLeft, forceRight, forceTop } = {},\n) => {\n const {\n left: componentLeft = 0,\n scrollTop = 0,\n top: componentTop = 0,\n width: componentWidth = 0,\n height: componentHeight = 0,\n screenLeft = componentLeft || 0,\n screenTop = componentTop || 0,\n } = componentLayout;\n const { width: contentWidth = 0, height: contentHeight = 0 } = contentLayout;\n const { height = 0, width = 0 } = modal || device;\n const aline = centered && (forceLeft || forceRight);\n const offsetLeft = modal ? componentLeft : screenLeft;\n const offsetTop = modal ? componentTop : screenTop;\n let orientation = { left: true };\n\n let top = componentTop + componentHeight - scrollTop;\n const gapBottom = height - (offsetTop + componentHeight);\n if ((contentHeight > gapBottom && offsetTop > gapBottom && !forceBottom) || forceTop) {\n top = componentTop - contentHeight - scrollTop;\n orientation = { ...orientation, top: true };\n }\n\n let left = componentLeft;\n const gapLeft = screenLeft + componentWidth;\n const gapRight = width - offsetLeft;\n if ((contentWidth > gapRight && gapLeft > gapRight && !forceLeft) || forceRight) {\n left = componentLeft - contentWidth + componentWidth;\n orientation = { ...orientation, left: undefined, right: true };\n }\n\n if (aline) {\n orientation = { ...orientation, left: forceLeft, right: forceRight, top: undefined };\n if (forceLeft && contentWidth > gapLeft && gapRight > gapLeft)\n orientation = { ...orientation, left: undefined, right: true };\n else if (forceRight && contentWidth > gapRight && gapLeft > gapRight)\n orientation = { ...orientation, left: true, right: undefined };\n\n left = orientation.left ? componentLeft - contentWidth : componentLeft + componentWidth;\n top = componentTop - (contentHeight - componentHeight) / 2 - scrollTop;\n } else if (centered) {\n const gapCenter = (componentWidth + contentWidth) / 2;\n const space = (contentWidth - componentWidth) / 2;\n orientation = { ...orientation, left: true, right: undefined };\n\n if (gapLeft > gapRight) {\n left = componentLeft - contentWidth + componentWidth;\n orientation = { ...orientation, left: undefined, right: true };\n }\n if (gapLeft > gapCenter && gapRight > gapCenter) {\n left += space * (gapLeft > gapRight ? 1 : -1);\n orientation = { ...orientation, left: undefined, right: undefined, center: true };\n }\n }\n\n return { left, top, orientation };\n};\n"],"mappings":";;;;;;;;;;;;AAAO,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgB,GAMxB;EAAA,IALHC,eAAe,uEAAG,CAAC,CAAC;EAAA,IACpBC,aAAa,uEAAG,CAAC,CAAC;EAAA,IAClBC,MAAM,uEAAG,CAAC,CAAC;EAAA,IACXC,KAAK;EAAA,+EACwD,CAAC,CAAC;IAA7DC,QAAQ,QAARA,QAAQ;IAAEC,WAAW,QAAXA,WAAW;IAAEC,SAAS,QAATA,SAAS;IAAEC,UAAU,QAAVA,UAAU;IAAEC,QAAQ,QAARA,QAAQ;EAExD,4BAQIR,eAAe,CAPjBS,IAAI;IAAEC,aAAa,sCAAG,CAAC;IAAA,wBAOrBV,eAAe,CANjBW,SAAS;IAATA,SAAS,sCAAG,CAAC;IAAA,uBAMXX,eAAe,CALjBY,GAAG;IAAEC,YAAY,qCAAG,CAAC;IAAA,wBAKnBb,eAAe,CAJjBc,KAAK;IAAEC,cAAc,sCAAG,CAAC;IAAA,wBAIvBf,eAAe,CAHjBgB,MAAM;IAAEC,eAAe,sCAAG,CAAC;IAAA,wBAGzBjB,eAAe,CAFjBkB,UAAU;IAAVA,UAAU,sCAAGR,aAAa,IAAI,CAAC;IAAA,yBAE7BV,eAAe,CADjBmB,SAAS;IAATA,SAAS,uCAAGN,YAAY,IAAI,CAAC;EAE/B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