@gingkoo/pandora-metabase 0.0.29 → 0.0.30
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/lib/es/components/popup.d.ts +1 -0
- package/lib/es/index.js +92 -67
- package/lib/es/index.js.map +1 -1
- package/lib/es/utils/helper-dom.d.ts +1 -0
- package/package.json +1 -1
package/lib/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @gingkoo/pandora-metabase v0.0.
|
|
2
|
+
* @gingkoo/pandora-metabase v0.0.30
|
|
3
3
|
*/
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import * as React from 'react';
|
|
@@ -1341,6 +1341,91 @@ const Loading = ({
|
|
|
1341
1341
|
var css_248z$b = ".mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.m-2 {\n margin: 0.5rem;\n}\n.mx-2 {\n margin-left: 0.5rem;\n margin-right: 0.5rem;\n}\n.ml-2 {\n margin-left: 0.5rem;\n}\n.mt-2 {\n margin-top: 0.5rem;\n}\n.mb-2 {\n margin-bottom: 0.5rem;\n}\n.mt-4 {\n margin-top: 1rem;\n}\n.ml-4 {\n margin-left: 1rem;\n}\n.mr-4 {\n margin-right: 1rem;\n}\n.mr-2 {\n margin-right: 0.5rem;\n}\n.pt-2 {\n padding-top: 0.5rem;\n}\n.pb-2 {\n padding-bottom: 0.5rem;\n}\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.pb-4 {\n padding-bottom: 1rem;\n}\n.pt-4 {\n padding-top: 1rem;\n}\n.block {\n display: block;\n}\n.w-full {\n width: 100%;\n}\n.font-bold {\n font-weight: 700;\n}\n.uppercase {\n text-transform: uppercase;\n}\n.tracking-wider {\n letter-spacing: 0.05em;\n}\n.relative {\n position: relative;\n}\n.absolute {\n position: absolute;\n}\n.top-0 {\n top: 0px;\n}\n.left-0 {\n left: 0;\n}\n.rounded-lg {\n border-radius: 0.5rem;\n}\n.text-gray-500 {\n color: #6b7280;\n}\n.flex {\n display: flex;\n}\n.items-center {\n align-items: center;\n}\n.justify-center {\n justify-content: center;\n}\n.visual-box {\n position: relative;\n width: 100%;\n height: 100%;\n overflow-y: scroll;\n overflow-x: hidden;\n transition: all 0.3s;\n z-index: 3;\n background-color: #fff;\n}\n.Sqb {\n padding: 0 20px 50px;\n}\n.Sqb-list {\n padding-top: 1.5rem;\n}\n.Sqb-hover-parent {\n margin-bottom: 16px;\n padding-bottom: 16px;\n}\n.Sqb-item {\n font-size: 14px;\n}\n.Sqb-item--text {\n color: #509ee3;\n width: 66.6667%;\n box-sizing: border-box;\n margin-bottom: 8px;\n display: flex;\n align-items: center;\n font-weight: 600;\n}\n.Sqb-item--text.purple-text {\n color: #7172ad;\n}\n.Sqb-item--text.gray-text {\n color: #93a1ab;\n}\n.Sqb-item--text.green-text {\n color: #88bf4d;\n}\n.Sqb-item-close {\n width: 16px;\n height: 16px;\n color: #b8bbc3;\n margin-left: auto;\n visibility: hidden;\n cursor: pointer;\n}\n.Sqb-item--content {\n width: 66.6667%;\n box-sizing: border-box;\n}\n.Sqb-item--content .Sqb-Filter-item {\n position: relative;\n margin: 0 10px;\n}\n.Sqb-item--content .Sqb-Filter-item .right-arrow,\n.Sqb-item--content .Sqb-Filter-item .left-arrow {\n position: absolute;\n top: 0;\n height: 40px;\n width: 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0.4;\n cursor: pointer;\n transform: scale(0);\n transition: all 0.3s;\n}\n.Sqb-item--content .Sqb-Filter-item .right-arrow img,\n.Sqb-item--content .Sqb-Filter-item .left-arrow img {\n transform: scale(0.8);\n}\n.Sqb-item--content .Sqb-Filter-item .right-arrow:hover,\n.Sqb-item--content .Sqb-Filter-item .left-arrow:hover {\n opacity: 1;\n}\n.Sqb-item--content .Sqb-Filter-item .left-arrow {\n transform: rotate(180deg) scale(0);\n transform-origin: 50% 50%;\n left: -30px;\n}\n.Sqb-item--content .Sqb-Filter-item .right-arrow {\n right: -20px;\n}\n.Sqb-item--content .Sqb-Filter-item.hover .left-arrow {\n transform: rotate(180deg) scale(1);\n}\n.Sqb-item--content .Sqb-Filter-item.hover .right-arrow {\n transform: scale(1);\n}\n.Sqb-item--content .Sqb-NotebookCell {\n box-sizing: border-box;\n padding: 16px 16px 8px;\n color: #509ee3;\n display: flex;\n flex-wrap: wrap;\n -webkit-box-align: center;\n align-items: center;\n border-radius: 8px;\n background-color: rgba(80, 158, 227, 0.1);\n}\n.Sqb-item--content .Sqb-NotebookCell-preview {\n flex-shrink: 0;\n width: 100%;\n}\n.Sqb-item--content .Sqb-NotebookCell.gray-bg {\n background-color: rgba(147, 161, 171, 0.1);\n}\n.Sqb-item--content .Sqb-NotebookCell.green-bg {\n background-color: rgba(136, 191, 77, 0.1);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName {\n border: 2px solid transparent;\n border-radius: 6px;\n color: white;\n background-color: #509ee3;\n transition: background 300ms linear 0s,\n border 300ms linear 0s;\n box-sizing: border-box;\n margin-bottom: 8px;\n margin-right: 8px;\n padding: 8px;\n display: flex;\n -webkit-box-align: center;\n align-items: center;\n cursor: pointer;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName-input {\n margin-bottom: 9px;\n margin-right: 8px;\n padding: 9px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName::selection {\n color: #ffffff;\n background-color: #d489ac;\n text-shadow: none;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName:hover {\n background-color: rgba(80, 158, 227, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.noClick {\n cursor: default;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.noClick:hover {\n background-color: #509ee3;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.notSelected {\n border: 2px solid rgba(80, 158, 227, 0.25);\n color: #509ee3;\n background-color: transparent;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.notSelected:hover {\n border-color: rgba(80, 158, 227, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name {\n color: white;\n background-color: #7172ad;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name:hover {\n background-color: rgba(113, 114, 173, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name.notSelected {\n border: 2px solid rgba(113, 114, 173, 0.25);\n color: #7172ad;\n background-color: transparent;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name.notSelected:hover {\n border-color: rgba(113, 114, 173, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.gray-name {\n color: white;\n background-color: #93a1ab;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.gray-name:hover {\n background-color: rgba(147, 161, 171, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.gray-name svg.sort-arrow {\n margin-right: 0.5rem;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.gray-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name {\n color: white;\n background-color: #88bf4d;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name:hover {\n background-color: rgba(136, 191, 77, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name.notSelected {\n border: 2px solid rgba(136, 191, 77, 0.25);\n color: #88bf4d;\n background-color: transparent;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name.notSelected:hover {\n border-color: rgba(136, 191, 77, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .ant-input-number {\n margin-bottom: 0.5rem;\n}\n.Sqb-item--content .Sqb-NotebookCell .ant-input-number .ant-input-number-input {\n height: 32px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-where {\n box-sizing: border-box;\n display: flex;\n -webkit-box-align: center;\n align-items: center;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-where.block {\n width: 100%;\n}\n.Sqb-item--content .Sqb-NotebookCell .operator-icon,\n.Sqb-item--content .Sqb-NotebookCell .operator-icon button {\n font-size: 18px !important;\n border: none !important;\n}\n.Sqb-item--content .Sqb-NotebookCell .subquery-icon {\n color: #93a1ab;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableColumns {\n font-weight: 600;\n margin-bottom: 0.5rem;\n margin-left: auto;\n cursor: pointer;\n}\n.Sqb-item--content .flex-row {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n align-items: center;\n flex-direction: row;\n}\n.Sqb-item--content .flex-row .Sqb-NotebookCell {\n width: 50%;\n}\n.Sqb-item--content .flex-row .pass {\n color: #88bf4d;\n margin: 4px 16px;\n font-size: 600;\n}\n.Sqb-item--func {\n box-sizing: border-box;\n margin-top: 8px;\n}\n.Sqb-item--func .Sqb-button {\n display: inline-block;\n box-sizing: border-box;\n text-decoration: none;\n cursor: pointer;\n font-weight: bold;\n padding: 12px 16px;\n border-radius: 6px;\n margin-right: 16px;\n margin-top: 16px;\n border: none;\n transition: background 300ms ease 0s;\n flex-shrink: 0;\n color: #93a1ab;\n background-color: #ffffff;\n}\n.Sqb-item--func .Sqb-button:hover {\n color: #7e8f9b;\n background-color: #eceff0;\n}\n.Sqb-item--func .Sqb-button > div {\n min-width: 60px;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n display: flex;\n}\n.Sqb-item--func .Sqb-button > div svg {\n flex-shrink: 0;\n}\n.Sqb-item--func .Sqb-button > div div {\n margin-top: 0.5rem;\n}\n.Sqb-item--func .Sqb-button.filter {\n color: #7172ad;\n background-color: #e0e0ed;\n}\n.Sqb-item--func .Sqb-button.filter:hover {\n color: #5d5ea0;\n background-color: #cccce1;\n}\n.Sqb-item--func .Sqb-button.summarize {\n color: #88bf4d;\n background-color: #d8eac5;\n}\n.Sqb-item--func .Sqb-button.summarize:hover {\n color: #79ae3f;\n background-color: #cae2af;\n}\n.Sqb-item--func .Sqb-button.joinData {\n color: #509ee3;\n background-color: #f1f7fd;\n}\n.Sqb-item--func .Sqb-button.joinData:hover {\n color: #328dde;\n background-color: #d4e7f8;\n}\n.Sqb-item--func .Sqb-button.small {\n margin-right: 8px;\n margin-top: 0;\n padding: 0.5rem;\n}\n.Sqb-item--func .Sqb-button.small > div {\n min-width: 0;\n}\n.Sqb-item--func .Sqb-button.small > div svg {\n width: 14px;\n height: 14px;\n}\n.Sqb-item--func .Sqb-button.small > div div {\n display: none;\n}\n.Sqb-item:hover .Sqb-item-close {\n visibility: visible;\n}\n.Sqb > .Sqb-btn {\n min-width: 220px;\n height: 36px;\n border-radius: 6px;\n color: #ffffff;\n background: #509ee3;\n border: 1px solid #509ee3;\n}\n.Sqb > .Sqb-btn:hover {\n background-color: rgba(80, 158, 227, 0.8) !important;\n}\n";
|
|
1342
1342
|
styleInject(css_248z$b);
|
|
1343
1343
|
|
|
1344
|
+
// 获取元素translate x y值
|
|
1345
|
+
const getComputedTranslate = obj => {
|
|
1346
|
+
if (!window.getComputedStyle) return {
|
|
1347
|
+
x: 0,
|
|
1348
|
+
y: 0
|
|
1349
|
+
};
|
|
1350
|
+
var style = getComputedStyle(obj),
|
|
1351
|
+
transform = style.transform || style.webkitTransform || style.mozTransform;
|
|
1352
|
+
var mat = transform.match(/^matrix3d\((.+)\)$/);
|
|
1353
|
+
if (mat) {
|
|
1354
|
+
return {
|
|
1355
|
+
x: parseFloat(mat[1].split(', ')[12]),
|
|
1356
|
+
y: parseFloat(mat[1].split(', ')[13])
|
|
1357
|
+
};
|
|
1358
|
+
}
|
|
1359
|
+
mat = transform.match(/^matrix\((.+)\)$/);
|
|
1360
|
+
if (mat) {
|
|
1361
|
+
return {
|
|
1362
|
+
x: parseFloat(mat[1].split(', ')[4]),
|
|
1363
|
+
y: parseFloat(mat[1].split(', ')[5])
|
|
1364
|
+
};
|
|
1365
|
+
}
|
|
1366
|
+
return {
|
|
1367
|
+
x: 0,
|
|
1368
|
+
y: 0
|
|
1369
|
+
};
|
|
1370
|
+
};
|
|
1371
|
+
// 获取元素距离浏览器顶部的距离
|
|
1372
|
+
const getElementTop = elem => {
|
|
1373
|
+
let elemTop = elem.offsetTop;
|
|
1374
|
+
let pElem = elem.offsetParent;
|
|
1375
|
+
while (pElem != null) {
|
|
1376
|
+
elemTop += pElem.offsetTop;
|
|
1377
|
+
if (pElem.style.transform) {
|
|
1378
|
+
elemTop += getComputedTranslate(pElem).y;
|
|
1379
|
+
}
|
|
1380
|
+
pElem = pElem.offsetParent;
|
|
1381
|
+
}
|
|
1382
|
+
return elemTop;
|
|
1383
|
+
};
|
|
1384
|
+
// 获取元素距离浏览器顶部的距离
|
|
1385
|
+
const getElementLeft = elem => {
|
|
1386
|
+
let elemLeft = elem.offsetLeft;
|
|
1387
|
+
let pElem = elem.offsetParent;
|
|
1388
|
+
while (pElem != null) {
|
|
1389
|
+
elemLeft += pElem.offsetLeft;
|
|
1390
|
+
if (pElem.style.transform) {
|
|
1391
|
+
elemLeft += getComputedTranslate(pElem).x;
|
|
1392
|
+
}
|
|
1393
|
+
pElem = pElem.offsetParent;
|
|
1394
|
+
}
|
|
1395
|
+
return elemLeft;
|
|
1396
|
+
};
|
|
1397
|
+
const getScrollTop = () => {
|
|
1398
|
+
return document.documentElement.scrollTop;
|
|
1399
|
+
};
|
|
1400
|
+
// 浏览器可视宽高
|
|
1401
|
+
const getWindowSize = () => {
|
|
1402
|
+
return {
|
|
1403
|
+
width: document.body.clientWidth,
|
|
1404
|
+
height: document.body.clientHeight
|
|
1405
|
+
};
|
|
1406
|
+
};
|
|
1407
|
+
// 获取元素父级最大的 z-index
|
|
1408
|
+
const getMaxZIndexInParents = element => {
|
|
1409
|
+
let currentElement = element;
|
|
1410
|
+
let maxZIndex = -Infinity;
|
|
1411
|
+
// 遍历当前元素及其所有父级元素
|
|
1412
|
+
while (currentElement && currentElement !== document.body) {
|
|
1413
|
+
// 获取当前元素的 z-index
|
|
1414
|
+
const zIndex = window.getComputedStyle(currentElement).zIndex;
|
|
1415
|
+
// 如果 z-index 是数字且比当前最大值大,则更新
|
|
1416
|
+
if (zIndex !== 'auto') {
|
|
1417
|
+
const zIndexNum = parseInt(zIndex, 10);
|
|
1418
|
+
if (!isNaN(zIndexNum) && zIndexNum > maxZIndex) {
|
|
1419
|
+
maxZIndex = zIndexNum;
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
// 移动到父级元素
|
|
1423
|
+
currentElement = currentElement.parentElement;
|
|
1424
|
+
}
|
|
1425
|
+
// 如果没有显式设置的 z-index,返回 'auto' 或默认值
|
|
1426
|
+
return maxZIndex !== -Infinity ? maxZIndex : 'auto';
|
|
1427
|
+
};
|
|
1428
|
+
|
|
1344
1429
|
var css_248z$a = ".Sqb-CustomColumn--box {\n box-sizing: border-box;\n min-width: 1em;\n max-width: 500px;\n background-color: #ffffff;\n overflow: hidden;\n}\n.Sqb-CustomColumn--box .input {\n color: #4c5773;\n font-size: 1.12em;\n padding: 0.75rem 0.75rem;\n border: 1px solid #f0f0f0;\n border-radius: 4px;\n transition: border 0.3s linear;\n font-family: Monaco, monospace;\n font-weight: 700;\n -webkit-font-smoothing: antialiased;\n}\n.Sqb-CustomColumn--box .input:focus {\n outline: none;\n border: 1px solid #509ee3;\n transition: border 0.3s linear;\n color: #4c5773;\n}\n.Sqb-CustomColumn--box .input::-webkit-input-placeholder {\n color: #949aab;\n}\n.Sqb-CustomColumn--box .input::-ms-input-placeholder {\n color: #949aab;\n}\n.Sqb-CustomColumn--box .input.border-error {\n border-color: #ed6e6e !important;\n}\n.Sqb-CustomColumn--box .text-error {\n color: #ed6e6e;\n}\n.Sqb-CustomColumn--box .btns {\n flex-direction: row;\n align-items: center;\n display: flex;\n border-top: 1px solid #f0f0f0;\n}\n.Sqb-CustomColumn--box .btns .btn {\n padding: 0.75rem 1rem;\n display: inline-block;\n box-sizing: border-box;\n background: transparent;\n border: 1px solid #e4e4e4;\n color: #4c5773;\n cursor: pointer;\n text-decoration: none;\n font-weight: bold;\n font-family: 'Lato', sans-serif;\n border-radius: 6px;\n outline: none;\n}\n.Sqb-CustomColumn--box .btns .btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n.Sqb-CustomColumn--box .btns .btn:not(:disabled):hover {\n color: #509ee3;\n border-color: #d6d6d6;\n background: #f9fbfc;\n transition: all 200ms linear;\n}\n.Sqb-CustomColumn--box .btns .btn.usable {\n color: #ffffff;\n background: #509ee3;\n border: 1px solid #509ee3;\n}\n.Sqb-CustomColumn--box .btns .btn.usable:hover {\n color: #ffffff;\n border-color: #509ee3;\n background-color: rgba(80, 158, 227, 0.88);\n}\n";
|
|
1345
1430
|
styleInject(css_248z$a);
|
|
1346
1431
|
|
|
@@ -2737,70 +2822,6 @@ var TokenizedInput$1 = /*#__PURE__*/forwardRef(function TokenizedInputWithForwar
|
|
|
2737
2822
|
});
|
|
2738
2823
|
});
|
|
2739
2824
|
|
|
2740
|
-
// 获取元素translate x y值
|
|
2741
|
-
const getComputedTranslate = obj => {
|
|
2742
|
-
if (!window.getComputedStyle) return {
|
|
2743
|
-
x: 0,
|
|
2744
|
-
y: 0
|
|
2745
|
-
};
|
|
2746
|
-
var style = getComputedStyle(obj),
|
|
2747
|
-
transform = style.transform || style.webkitTransform || style.mozTransform;
|
|
2748
|
-
var mat = transform.match(/^matrix3d\((.+)\)$/);
|
|
2749
|
-
if (mat) {
|
|
2750
|
-
return {
|
|
2751
|
-
x: parseFloat(mat[1].split(', ')[12]),
|
|
2752
|
-
y: parseFloat(mat[1].split(', ')[13])
|
|
2753
|
-
};
|
|
2754
|
-
}
|
|
2755
|
-
mat = transform.match(/^matrix\((.+)\)$/);
|
|
2756
|
-
if (mat) {
|
|
2757
|
-
return {
|
|
2758
|
-
x: parseFloat(mat[1].split(', ')[4]),
|
|
2759
|
-
y: parseFloat(mat[1].split(', ')[5])
|
|
2760
|
-
};
|
|
2761
|
-
}
|
|
2762
|
-
return {
|
|
2763
|
-
x: 0,
|
|
2764
|
-
y: 0
|
|
2765
|
-
};
|
|
2766
|
-
};
|
|
2767
|
-
// 获取元素距离浏览器顶部的距离
|
|
2768
|
-
const getElementTop = elem => {
|
|
2769
|
-
let elemTop = elem.offsetTop;
|
|
2770
|
-
let pElem = elem.offsetParent;
|
|
2771
|
-
while (pElem != null) {
|
|
2772
|
-
elemTop += pElem.offsetTop;
|
|
2773
|
-
if (pElem.style.transform) {
|
|
2774
|
-
elemTop += getComputedTranslate(pElem).y;
|
|
2775
|
-
}
|
|
2776
|
-
pElem = pElem.offsetParent;
|
|
2777
|
-
}
|
|
2778
|
-
return elemTop;
|
|
2779
|
-
};
|
|
2780
|
-
// 获取元素距离浏览器顶部的距离
|
|
2781
|
-
const getElementLeft = elem => {
|
|
2782
|
-
let elemLeft = elem.offsetLeft;
|
|
2783
|
-
let pElem = elem.offsetParent;
|
|
2784
|
-
while (pElem != null) {
|
|
2785
|
-
elemLeft += pElem.offsetLeft;
|
|
2786
|
-
if (pElem.style.transform) {
|
|
2787
|
-
elemLeft += getComputedTranslate(pElem).x;
|
|
2788
|
-
}
|
|
2789
|
-
pElem = pElem.offsetParent;
|
|
2790
|
-
}
|
|
2791
|
-
return elemLeft;
|
|
2792
|
-
};
|
|
2793
|
-
const getScrollTop = () => {
|
|
2794
|
-
return document.documentElement.scrollTop;
|
|
2795
|
-
};
|
|
2796
|
-
// 浏览器可视宽高
|
|
2797
|
-
const getWindowSize = () => {
|
|
2798
|
-
return {
|
|
2799
|
-
width: document.body.clientWidth,
|
|
2800
|
-
height: document.body.clientHeight
|
|
2801
|
-
};
|
|
2802
|
-
};
|
|
2803
|
-
|
|
2804
2825
|
// 节流
|
|
2805
2826
|
const throttle = (fn, wait = 200) => {
|
|
2806
2827
|
if (typeof fn !== 'function') return () => void 0;
|
|
@@ -2944,7 +2965,8 @@ function generateTrigger(PortalComponent) {
|
|
|
2944
2965
|
getContainer = () => {
|
|
2945
2966
|
let pos = this.getCurrentNodePos();
|
|
2946
2967
|
let {
|
|
2947
|
-
innerSpacing = 10
|
|
2968
|
+
innerSpacing = 10,
|
|
2969
|
+
zIndex
|
|
2948
2970
|
} = this.props;
|
|
2949
2971
|
const popupContainer = returnDocument().createElement('span');
|
|
2950
2972
|
popupContainer.style.position = 'absolute';
|
|
@@ -2952,7 +2974,7 @@ function generateTrigger(PortalComponent) {
|
|
|
2952
2974
|
popupContainer.style.left = '0px';
|
|
2953
2975
|
popupContainer.style.transform = `translateX(${pos.x}px) translateY(${pos.y + pos.h + innerSpacing}px) translateZ(0px)`;
|
|
2954
2976
|
popupContainer.style.pointerEvents = 'none';
|
|
2955
|
-
popupContainer.style.zIndex = '999';
|
|
2977
|
+
popupContainer.style.zIndex = zIndex || '999';
|
|
2956
2978
|
this.attachParent(popupContainer);
|
|
2957
2979
|
return popupContainer;
|
|
2958
2980
|
};
|
|
@@ -7603,6 +7625,7 @@ const Metabase = props => {
|
|
|
7603
7625
|
if (!visible) return null;
|
|
7604
7626
|
return content;
|
|
7605
7627
|
}, [store.popupData2]);
|
|
7628
|
+
let zIndex = popupContainer.current ? getMaxZIndexInParents(popupContainer.current) : null;
|
|
7606
7629
|
return (
|
|
7607
7630
|
// @ts-ignore
|
|
7608
7631
|
jsx(VisualBox, {
|
|
@@ -7643,6 +7666,7 @@ const Metabase = props => {
|
|
|
7643
7666
|
visible: store.popupData.visible,
|
|
7644
7667
|
node: store.popupData.node,
|
|
7645
7668
|
closable: store.popupClosable,
|
|
7669
|
+
zIndex: zIndex ? String(zIndex) : null,
|
|
7646
7670
|
hideVisible: () => {
|
|
7647
7671
|
store.setPopup({
|
|
7648
7672
|
visible: false
|
|
@@ -7654,6 +7678,7 @@ const Metabase = props => {
|
|
|
7654
7678
|
visible: store.popupData2.visible,
|
|
7655
7679
|
node: store.popupData2.node,
|
|
7656
7680
|
closable: store.popupClosable2,
|
|
7681
|
+
zIndex: zIndex ? String(zIndex) : null,
|
|
7657
7682
|
hideVisible: () => {
|
|
7658
7683
|
store.setClosable(true);
|
|
7659
7684
|
store.setPopup2({
|