@mirai/ui 1.0.167 → 1.0.169
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.
- package/build/components/Calendar/Calendar.module.css +5 -1
- package/build/primitives/Layer/helpers/getElementLayout.js +2 -0
- package/build/primitives/Layer/helpers/getElementLayout.js.map +1 -1
- package/build/primitives/Layer/helpers/getLayerPosition.js +5 -3
- package/build/primitives/Layer/helpers/getLayerPosition.js.map +1 -1
- package/package.json +1 -1
|
@@ -11,12 +11,14 @@ var getElementLayout = function getElementLayout() {
|
|
|
11
11
|
height = element.offsetHeight,
|
|
12
12
|
width = element.offsetWidth;
|
|
13
13
|
var _ref = element.getBoundingClientRect && element.getBoundingClientRect() || {},
|
|
14
|
+
screenLeft = _ref.left,
|
|
14
15
|
screenTop = _ref.top;
|
|
15
16
|
return {
|
|
16
17
|
left: left,
|
|
17
18
|
top: top,
|
|
18
19
|
height: height,
|
|
19
20
|
width: width,
|
|
21
|
+
screenLeft: screenLeft,
|
|
20
22
|
screenTop: screenTop
|
|
21
23
|
};
|
|
22
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getElementLayout.js","names":["getElementLayout","element","left","offsetLeft","top","offsetTop","height","offsetHeight","width","offsetWidth","getBoundingClientRect","screenTop"],"sources":["../../../../src/primitives/Layer/helpers/getElementLayout.js"],"sourcesContent":["export const getElementLayout = (element = {}) => {\n const { offsetLeft: left, offsetTop: top, offsetHeight: height, offsetWidth: width } = element;\n const { top: screenTop } = (element.getBoundingClientRect && element.getBoundingClientRect()) || {};\n\n return { left, top, height, width, screenTop };\n};\n"],"mappings":";;;;;;AAAO,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgB,GAAqB;EAAA,IAAjBC,OAAO,uEAAG,CAAC,CAAC;EAC3C,IAAoBC,IAAI,GAA+DD,OAAO,CAAtFE,UAAU;IAAmBC,GAAG,GAA+CH,OAAO,CAApEI,SAAS;IAAqBC,MAAM,GAAyBL,OAAO,CAApDM,YAAY;IAAuBC,KAAK,GAAKP,OAAO,CAA9BQ,WAAW;EAC3E,
|
|
1
|
+
{"version":3,"file":"getElementLayout.js","names":["getElementLayout","element","left","offsetLeft","top","offsetTop","height","offsetHeight","width","offsetWidth","getBoundingClientRect","screenLeft","screenTop"],"sources":["../../../../src/primitives/Layer/helpers/getElementLayout.js"],"sourcesContent":["export const getElementLayout = (element = {}) => {\n const { offsetLeft: left, offsetTop: top, offsetHeight: height, offsetWidth: width } = element;\n const { left: screenLeft, top: screenTop } = (element.getBoundingClientRect && element.getBoundingClientRect()) || {};\n\n return { left, top, height, width, screenLeft, screenTop };\n};\n"],"mappings":";;;;;;AAAO,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgB,GAAqB;EAAA,IAAjBC,OAAO,uEAAG,CAAC,CAAC;EAC3C,IAAoBC,IAAI,GAA+DD,OAAO,CAAtFE,UAAU;IAAmBC,GAAG,GAA+CH,OAAO,CAApEI,SAAS;IAAqBC,MAAM,GAAyBL,OAAO,CAApDM,YAAY;IAAuBC,KAAK,GAAKP,OAAO,CAA9BQ,WAAW;EAC3E,WAA8CR,OAAO,CAACS,qBAAqB,IAAIT,OAAO,CAACS,qBAAqB,EAAE,IAAK,CAAC,CAAC;IAAvGC,UAAU,QAAhBT,IAAI;IAAmBU,SAAS,QAAdR,GAAG;EAE7B,OAAO;IAAEF,IAAI,EAAJA,IAAI;IAAEE,GAAG,EAAHA,GAAG;IAAEE,MAAM,EAANA,MAAM;IAAEE,KAAK,EAALA,KAAK;IAAEG,UAAU,EAAVA,UAAU;IAAEC,SAAS,EAATA;EAAU,CAAC;AAC5D,CAAC;AAAC"}
|
|
@@ -30,8 +30,10 @@ var getLayerPosition = function getLayerPosition() {
|
|
|
30
30
|
componentWidth = _componentLayout$widt === void 0 ? 0 : _componentLayout$widt,
|
|
31
31
|
_componentLayout$heig = componentLayout.height,
|
|
32
32
|
componentHeight = _componentLayout$heig === void 0 ? 0 : _componentLayout$heig,
|
|
33
|
-
_componentLayout$scre = componentLayout.
|
|
34
|
-
|
|
33
|
+
_componentLayout$scre = componentLayout.screenLeft,
|
|
34
|
+
screenLeft = _componentLayout$scre === void 0 ? componentLeft || 0 : _componentLayout$scre,
|
|
35
|
+
_componentLayout$scre2 = componentLayout.screenTop,
|
|
36
|
+
screenTop = _componentLayout$scre2 === void 0 ? componentTop || 0 : _componentLayout$scre2;
|
|
35
37
|
var _contentLayout$width = contentLayout.width,
|
|
36
38
|
contentWidth = _contentLayout$width === void 0 ? 0 : _contentLayout$width,
|
|
37
39
|
_contentLayout$height = contentLayout.height,
|
|
@@ -54,7 +56,7 @@ var getLayerPosition = function getLayerPosition() {
|
|
|
54
56
|
}
|
|
55
57
|
var left = componentLeft;
|
|
56
58
|
var gapLeft = componentLeft + componentWidth;
|
|
57
|
-
var gapRight = width -
|
|
59
|
+
var gapRight = width - screenLeft;
|
|
58
60
|
if (contentWidth > gapRight && gapLeft > gapRight && !forceLeft || forceRight) {
|
|
59
61
|
left = componentLeft - contentWidth + componentWidth;
|
|
60
62
|
orientation = _objectSpread(_objectSpread({}, orientation), {}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLayerPosition.js","names":["getLayerPosition","componentLayout","contentLayout","device","centered","forceBottom","forceLeft","forceRight","forceTop","left","componentLeft","scrollTop","top","componentTop","width","componentWidth","height","componentHeight","screenTop","contentWidth","contentHeight","aline","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 { 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 screenTop = componentTop || 0,\n } = componentLayout;\n const { width: contentWidth = 0, height: contentHeight = 0 } = contentLayout;\n const { height = 0, width = 0 } = device;\n const aline = centered && (forceLeft || forceRight);\n let orientation = { left: true };\n\n let top = componentTop + componentHeight - scrollTop;\n const gapBottom = height - (screenTop + componentHeight);\n if ((contentHeight > gapBottom && screenTop > gapBottom && !forceBottom) || forceTop) {\n top = componentTop - contentHeight - scrollTop;\n orientation = { ...orientation, top: true };\n }\n\n let left = componentLeft;\n const gapLeft = componentLeft + componentWidth;\n const gapRight = width -
|
|
1
|
+
{"version":3,"file":"getLayerPosition.js","names":["getLayerPosition","componentLayout","contentLayout","device","centered","forceBottom","forceLeft","forceRight","forceTop","left","componentLeft","scrollTop","top","componentTop","width","componentWidth","height","componentHeight","screenLeft","screenTop","contentWidth","contentHeight","aline","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 { 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 } = device;\n const aline = centered && (forceLeft || forceRight);\n let orientation = { left: true };\n\n let top = componentTop + componentHeight - scrollTop;\n const gapBottom = height - (screenTop + componentHeight);\n if ((contentHeight > gapBottom && screenTop > gapBottom && !forceBottom) || forceTop) {\n top = componentTop - contentHeight - scrollTop;\n orientation = { ...orientation, top: true };\n }\n\n let left = componentLeft;\n const gapLeft = componentLeft + componentWidth;\n const gapRight = width - screenLeft;\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,GAKxB;EAAA,IAJHC,eAAe,uEAAG,CAAC,CAAC;EAAA,IACpBC,aAAa,uEAAG,CAAC,CAAC;EAAA,IAClBC,MAAM,uEAAG,CAAC,CAAC;EAAA,+EACkD,CAAC,CAAC;IAA7DC,QAAQ,QAARA,QAAQ;IAAEC,WAAW,QAAXA,WAAW;IAAEC,SAAS,QAATA,SAAS;IAAEC,UAAU,QAAVA,UAAU;IAAEC,QAAQ,QAARA,QAAQ;EAExD,4BAQIP,eAAe,CAPjBQ,IAAI;IAAEC,aAAa,sCAAG,CAAC;IAAA,wBAOrBT,eAAe,CANjBU,SAAS;IAATA,SAAS,sCAAG,CAAC;IAAA,uBAMXV,eAAe,CALjBW,GAAG;IAAEC,YAAY,qCAAG,CAAC;IAAA,wBAKnBZ,eAAe,CAJjBa,KAAK;IAAEC,cAAc,sCAAG,CAAC;IAAA,wBAIvBd,eAAe,CAHjBe,MAAM;IAAEC,eAAe,sCAAG,CAAC;IAAA,wBAGzBhB,eAAe,CAFjBiB,UAAU;IAAVA,UAAU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