@gingkoo/pandora-metabase 0.0.28 → 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 +114 -87
- 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';
|
|
@@ -1105,7 +1105,8 @@ register('en', {
|
|
|
1105
1105
|
'filter.contain': 'contain',
|
|
1106
1106
|
'filter.notInclude': 'not include',
|
|
1107
1107
|
'filter.startWith': 'start with',
|
|
1108
|
-
'filter.within': '
|
|
1108
|
+
'filter.within': 'IN',
|
|
1109
|
+
'filter.withnotin': 'NOT IN',
|
|
1109
1110
|
'filter.endWith': 'end with',
|
|
1110
1111
|
'filter.earlierThan': 'earlier than',
|
|
1111
1112
|
'filter.laterThan': 'later than',
|
|
@@ -1234,7 +1235,8 @@ register('zh', {
|
|
|
1234
1235
|
'filter.contain': '包含',
|
|
1235
1236
|
'filter.notInclude': '不包含',
|
|
1236
1237
|
'filter.startWith': '以...开始',
|
|
1237
|
-
'filter.within': '
|
|
1238
|
+
'filter.within': 'IN',
|
|
1239
|
+
'filter.withnotin': 'NOT IN',
|
|
1238
1240
|
'filter.endWith': '以...结束',
|
|
1239
1241
|
'filter.earlierThan': '早于',
|
|
1240
1242
|
'filter.laterThan': '晚于',
|
|
@@ -1339,6 +1341,91 @@ const Loading = ({
|
|
|
1339
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";
|
|
1340
1342
|
styleInject(css_248z$b);
|
|
1341
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
|
+
|
|
1342
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";
|
|
1343
1430
|
styleInject(css_248z$a);
|
|
1344
1431
|
|
|
@@ -2735,70 +2822,6 @@ var TokenizedInput$1 = /*#__PURE__*/forwardRef(function TokenizedInputWithForwar
|
|
|
2735
2822
|
});
|
|
2736
2823
|
});
|
|
2737
2824
|
|
|
2738
|
-
// 获取元素translate x y值
|
|
2739
|
-
const getComputedTranslate = obj => {
|
|
2740
|
-
if (!window.getComputedStyle) return {
|
|
2741
|
-
x: 0,
|
|
2742
|
-
y: 0
|
|
2743
|
-
};
|
|
2744
|
-
var style = getComputedStyle(obj),
|
|
2745
|
-
transform = style.transform || style.webkitTransform || style.mozTransform;
|
|
2746
|
-
var mat = transform.match(/^matrix3d\((.+)\)$/);
|
|
2747
|
-
if (mat) {
|
|
2748
|
-
return {
|
|
2749
|
-
x: parseFloat(mat[1].split(', ')[12]),
|
|
2750
|
-
y: parseFloat(mat[1].split(', ')[13])
|
|
2751
|
-
};
|
|
2752
|
-
}
|
|
2753
|
-
mat = transform.match(/^matrix\((.+)\)$/);
|
|
2754
|
-
if (mat) {
|
|
2755
|
-
return {
|
|
2756
|
-
x: parseFloat(mat[1].split(', ')[4]),
|
|
2757
|
-
y: parseFloat(mat[1].split(', ')[5])
|
|
2758
|
-
};
|
|
2759
|
-
}
|
|
2760
|
-
return {
|
|
2761
|
-
x: 0,
|
|
2762
|
-
y: 0
|
|
2763
|
-
};
|
|
2764
|
-
};
|
|
2765
|
-
// 获取元素距离浏览器顶部的距离
|
|
2766
|
-
const getElementTop = elem => {
|
|
2767
|
-
let elemTop = elem.offsetTop;
|
|
2768
|
-
let pElem = elem.offsetParent;
|
|
2769
|
-
while (pElem != null) {
|
|
2770
|
-
elemTop += pElem.offsetTop;
|
|
2771
|
-
if (pElem.style.transform) {
|
|
2772
|
-
elemTop += getComputedTranslate(pElem).y;
|
|
2773
|
-
}
|
|
2774
|
-
pElem = pElem.offsetParent;
|
|
2775
|
-
}
|
|
2776
|
-
return elemTop;
|
|
2777
|
-
};
|
|
2778
|
-
// 获取元素距离浏览器顶部的距离
|
|
2779
|
-
const getElementLeft = elem => {
|
|
2780
|
-
let elemLeft = elem.offsetLeft;
|
|
2781
|
-
let pElem = elem.offsetParent;
|
|
2782
|
-
while (pElem != null) {
|
|
2783
|
-
elemLeft += pElem.offsetLeft;
|
|
2784
|
-
if (pElem.style.transform) {
|
|
2785
|
-
elemLeft += getComputedTranslate(pElem).x;
|
|
2786
|
-
}
|
|
2787
|
-
pElem = pElem.offsetParent;
|
|
2788
|
-
}
|
|
2789
|
-
return elemLeft;
|
|
2790
|
-
};
|
|
2791
|
-
const getScrollTop = () => {
|
|
2792
|
-
return document.documentElement.scrollTop;
|
|
2793
|
-
};
|
|
2794
|
-
// 浏览器可视宽高
|
|
2795
|
-
const getWindowSize = () => {
|
|
2796
|
-
return {
|
|
2797
|
-
width: document.body.clientWidth,
|
|
2798
|
-
height: document.body.clientHeight
|
|
2799
|
-
};
|
|
2800
|
-
};
|
|
2801
|
-
|
|
2802
2825
|
// 节流
|
|
2803
2826
|
const throttle = (fn, wait = 200) => {
|
|
2804
2827
|
if (typeof fn !== 'function') return () => void 0;
|
|
@@ -2942,7 +2965,8 @@ function generateTrigger(PortalComponent) {
|
|
|
2942
2965
|
getContainer = () => {
|
|
2943
2966
|
let pos = this.getCurrentNodePos();
|
|
2944
2967
|
let {
|
|
2945
|
-
innerSpacing = 10
|
|
2968
|
+
innerSpacing = 10,
|
|
2969
|
+
zIndex
|
|
2946
2970
|
} = this.props;
|
|
2947
2971
|
const popupContainer = returnDocument().createElement('span');
|
|
2948
2972
|
popupContainer.style.position = 'absolute';
|
|
@@ -2950,7 +2974,7 @@ function generateTrigger(PortalComponent) {
|
|
|
2950
2974
|
popupContainer.style.left = '0px';
|
|
2951
2975
|
popupContainer.style.transform = `translateX(${pos.x}px) translateY(${pos.y + pos.h + innerSpacing}px) translateZ(0px)`;
|
|
2952
2976
|
popupContainer.style.pointerEvents = 'none';
|
|
2953
|
-
popupContainer.style.zIndex = '999';
|
|
2977
|
+
popupContainer.style.zIndex = zIndex || '999';
|
|
2954
2978
|
this.attachParent(popupContainer);
|
|
2955
2979
|
return popupContainer;
|
|
2956
2980
|
};
|
|
@@ -4028,14 +4052,14 @@ const SelectJoinColumn = ({
|
|
|
4028
4052
|
});
|
|
4029
4053
|
};
|
|
4030
4054
|
|
|
4031
|
-
var css_248z$4 = ".filter-page {\n min-width: 300px;\n}\n.filter-page .header {\n margin-bottom: 0.5rem;\n padding: 0.5rem;\n display: flex;\n align-items: center;\n color: #949aab;\n border-bottom: 1px solid #f0f0f0;\n}\n.filter-page .header .left-info {\n padding: 0.5rem 0.5rem 0.5rem 0;\n display: flex;\n align-items: center;\n}\n.filter-page .header .left-info-formula {\n display: flex;\n margin: 0 5px;\n gap: 5px;\n}\n.filter-page .header .left-info-formula .operator-icon {\n font-size: 18px !important;\n}\n.filter-page .header .left-info-formula-input {\n width:
|
|
4055
|
+
var css_248z$4 = ".filter-page {\n min-width: 300px;\n}\n.filter-page .header {\n margin-bottom: 0.5rem;\n padding: 0.5rem;\n display: flex;\n align-items: center;\n color: #949aab;\n border-bottom: 1px solid #f0f0f0;\n}\n.filter-page .header .left-info {\n padding: 0.5rem 0.5rem 0.5rem 0;\n display: flex;\n align-items: center;\n flex: 1;\n}\n.filter-page .header .left-info-formula {\n display: flex;\n margin: 0 5px;\n gap: 5px;\n}\n.filter-page .header .left-info-formula .operator-icon {\n font-size: 18px !important;\n}\n.filter-page .header .left-info-formula-input {\n width: 25px;\n margin: 0 5px;\n}\n.filter-page .header .left-info-formula-input .pd-Input-inner-wrapper {\n border-top: 0;\n border-left: 0;\n border-right: 0;\n border-radius: 0;\n padding: 0 3px;\n}\n.filter-page .header .left-info-formula-input .pd-Input-inner-wrapper input {\n text-align: center;\n}\n.filter-page .header .left-info .span-name {\n font-weight: 900;\n font-size: 16px;\n color: #4c5773;\n flex-grow: 1;\n display: flex;\n align-items: center;\n cursor: pointer;\n font-family: 'Lato', sans-serif;\n}\n.filter-page .header .left-info .span-name svg {\n margin-right: 0.5rem;\n}\n.filter-page .header .left-info .span-name:hover {\n color: #509ee3;\n}\n.filter-page .header .right-info {\n display: flex;\n align-items: center;\n}\n.filter-page .content {\n padding: 0.5rem;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.filter-page .content_l {\n flex: 1;\n}\n.filter-page .content .operator-icon {\n font-size: 18px !important;\n}\n.filter-page .content .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 box-sizing: border-box;\n padding: 8px;\n display: flex;\n -webkit-box-align: center;\n align-items: center;\n cursor: pointer;\n}\n.filter-page .content .Sqb-TableName-input {\n margin-bottom: 9px;\n margin-right: 8px;\n padding: 9px;\n}\n.filter-page .content .Sqb-TableName::selection {\n color: #ffffff;\n background-color: #d489ac;\n text-shadow: none;\n}\n.filter-page .content .Sqb-TableName:hover {\n background-color: rgba(80, 158, 227, 0.8);\n}\n.filter-page .content .Sqb-TableName.noClick {\n cursor: default;\n}\n.filter-page .content .Sqb-TableName.noClick:hover {\n background-color: #509ee3;\n}\n.filter-page .content .Sqb-TableName.notSelected {\n border: 2px solid rgba(80, 158, 227, 0.25);\n color: #509ee3;\n background-color: transparent;\n}\n.filter-page .content .Sqb-TableName.notSelected:hover {\n border-color: rgba(80, 158, 227, 0.8);\n}\n.filter-page .content .Sqb-TableName.purple-name {\n color: white;\n background-color: #7172ad;\n}\n.filter-page .content .Sqb-TableName.purple-name:hover {\n background-color: rgba(113, 114, 173, 0.8);\n}\n.filter-page .content .Sqb-TableName.purple-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.filter-page .content .Sqb-TableName.purple-name.notSelected {\n border: 2px solid rgba(113, 114, 173, 0.25);\n color: #7172ad;\n background-color: transparent;\n}\n.filter-page .content .Sqb-TableName.purple-name.notSelected:hover {\n border-color: rgba(113, 114, 173, 0.8);\n}\n.filter-page .content .Sqb-TableName.gray-name {\n color: white;\n background-color: #93a1ab;\n}\n.filter-page .content .Sqb-TableName.gray-name:hover {\n background-color: rgba(147, 161, 171, 0.8);\n}\n.filter-page .content .Sqb-TableName.gray-name svg.sort-arrow {\n margin-right: 0.5rem;\n}\n.filter-page .content .Sqb-TableName.gray-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.filter-page .content .Sqb-TableName.green-name {\n color: white;\n background-color: #88bf4d;\n}\n.filter-page .content .Sqb-TableName.green-name:hover {\n background-color: rgba(136, 191, 77, 0.8);\n}\n.filter-page .content .Sqb-TableName.green-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.filter-page .content .Sqb-TableName.green-name.notSelected {\n border: 2px solid rgba(136, 191, 77, 0.25);\n color: #88bf4d;\n background-color: transparent;\n}\n.filter-page .content .Sqb-TableName.green-name.notSelected:hover {\n border-color: rgba(136, 191, 77, 0.8);\n}\n.filter-page .content .w_300 {\n width: 300px;\n}\n.filter-page .content .input {\n border: 1px solid #f0f0f0;\n font-size: 16px;\n color: #4c5773;\n border-radius: 4px;\n transition: border 0.3s linear;\n padding: 9px 20px;\n height: 40px;\n outline: none;\n}\n.filter-page .content .input::placeholder {\n color: #ccc;\n}\n.filter-page .content .input + .input {\n margin-top: 10px;\n}\n.filter-page .content .input.inline {\n display: inline-block;\n flex: 1;\n margin-right: 15px;\n padding: 5px 20px;\n}\n.filter-page .footer {\n padding: 0 0.5rem 0.5rem;\n display: flex;\n align-items: center;\n}\n.filter-page .footer .button--purple {\n margin-left: auto;\n flex-shrink: 0;\n color: white;\n background-color: #7172ad;\n border: 1px solid #7172ad;\n padding: 6px 14px;\n font-size: 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 6px;\n cursor: pointer;\n}\n.filter-page .footer .button--purple.disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n.filter-page .footer .button--purple:hover {\n color: white;\n background-color: rgba(113, 114, 173, 0.88);\n border-color: rgba(113, 114, 173, 0.88);\n}\n.operator-btn {\n height: 38px !important;\n padding: 8px !important;\n text-align: left !important;\n display: flex !important;\n align-items: center !important;\n}\n.operator-btn > .anticon {\n margin-left: auto !important;\n}\n";
|
|
4032
4056
|
styleInject(css_248z$4);
|
|
4033
4057
|
|
|
4034
4058
|
const {
|
|
4035
4059
|
RangePicker
|
|
4036
4060
|
} = DatePicker;
|
|
4037
|
-
const NUMBER_LIST = ['等于', '不等于', '大于', '小于', '介于之间', '大于或等于', '小于或等于', '为空', '不为空', 'In'];
|
|
4038
|
-
const STRING_LIST = ['等于', '不等于', '包含', '不包含', '为空', '不为空', '以...开始', '以...结束', 'In'];
|
|
4061
|
+
const NUMBER_LIST = ['等于', '不等于', '大于', '小于', '介于之间', '大于或等于', '小于或等于', '为空', '不为空', 'In', 'Not In'];
|
|
4062
|
+
const STRING_LIST = ['等于', '不等于', '包含', '不包含', '为空', '不为空', '以...开始', '以...结束', 'In', 'Not In'];
|
|
4039
4063
|
const DATE_LIST = [
|
|
4040
4064
|
// '前', '下一个', '当前',
|
|
4041
4065
|
'早于', '晚于',
|
|
@@ -4056,7 +4080,7 @@ const SelectFilterColumn = ({
|
|
|
4056
4080
|
let table2Selected = Boolean(curColumn.table2?.name);
|
|
4057
4081
|
const disabled = useMemo(() => {
|
|
4058
4082
|
if (!condition) return true;
|
|
4059
|
-
if (curColumn.table2?.id && ~['
|
|
4083
|
+
if (curColumn.table2?.id && ~['等于', '不等于'].indexOf(condition)) {
|
|
4060
4084
|
return false;
|
|
4061
4085
|
}
|
|
4062
4086
|
if (~['为空', '不为空', '是空的', '不是空的'].indexOf(condition)) {
|
|
@@ -4150,6 +4174,9 @@ const SelectFilterColumn = ({
|
|
|
4150
4174
|
} else if (condition === 'In') {
|
|
4151
4175
|
let cond = __('filter.within');
|
|
4152
4176
|
quotes = getQuotesName(curColumn.name) + ' ' + cond + ' ' + `(${firstVal})`;
|
|
4177
|
+
} else if (condition === 'Not In') {
|
|
4178
|
+
let cond = __('filter.withnotin');
|
|
4179
|
+
quotes = getQuotesName(curColumn.name) + ' ' + cond + ' ' + `(${firstVal})`;
|
|
4153
4180
|
} else {
|
|
4154
4181
|
let cond = __({
|
|
4155
4182
|
等于: 'filter.equal',
|
|
@@ -4161,8 +4188,6 @@ const SelectFilterColumn = ({
|
|
|
4161
4188
|
小于或等于: 'filter.lessThanOrEqualTo',
|
|
4162
4189
|
为空: 'filter.empty',
|
|
4163
4190
|
不为空: 'filter.notEmpty',
|
|
4164
|
-
是: 'filter.is',
|
|
4165
|
-
不是: 'filter.isNo',
|
|
4166
4191
|
包含: 'filter.contain',
|
|
4167
4192
|
不包含: 'filter.notInclude',
|
|
4168
4193
|
'以...开始': 'filter.startWith',
|
|
@@ -4388,7 +4413,7 @@ const SelectFilterColumn = ({
|
|
|
4388
4413
|
}
|
|
4389
4414
|
})
|
|
4390
4415
|
});
|
|
4391
|
-
} else if (~['In'].indexOf(conditionText)) {
|
|
4416
|
+
} else if (~['In', 'Not In'].indexOf(conditionText)) {
|
|
4392
4417
|
const options = firstVal?.split(',') || [];
|
|
4393
4418
|
return jsx("div", {
|
|
4394
4419
|
children: jsx(Select, {
|
|
@@ -4406,7 +4431,7 @@ const SelectFilterColumn = ({
|
|
|
4406
4431
|
}, option))
|
|
4407
4432
|
})
|
|
4408
4433
|
});
|
|
4409
|
-
} else if (~['等于', '不等于', '大于', '小于', '大于或等于', '小于或等于', '
|
|
4434
|
+
} else if (~['等于', '不等于', '大于', '小于', '大于或等于', '小于或等于', '包含', '不包含', '以...开始', '以...结束'].indexOf(conditionText)) {
|
|
4410
4435
|
return jsx("div", {
|
|
4411
4436
|
children: jsx(Input, {
|
|
4412
4437
|
className: 'input',
|
|
@@ -4472,8 +4497,6 @@ const SelectFilterColumn = ({
|
|
|
4472
4497
|
小于或等于: 'filter.lessThanOrEqualTo',
|
|
4473
4498
|
为空: 'filter.empty',
|
|
4474
4499
|
不为空: 'filter.notEmpty',
|
|
4475
|
-
是: 'filter.is',
|
|
4476
|
-
不是: 'filter.isNo',
|
|
4477
4500
|
包含: 'filter.contain',
|
|
4478
4501
|
不包含: 'filter.notInclude',
|
|
4479
4502
|
'以...开始': 'filter.startWith',
|
|
@@ -4481,7 +4504,8 @@ const SelectFilterColumn = ({
|
|
|
4481
4504
|
早于: 'filter.earlierThan',
|
|
4482
4505
|
晚于: 'filter.laterThan',
|
|
4483
4506
|
是空的: 'filter.isEmpty',
|
|
4484
|
-
In: 'filter.within'
|
|
4507
|
+
In: 'filter.within',
|
|
4508
|
+
'Not In': 'filter.withnotin'
|
|
4485
4509
|
}[v])
|
|
4486
4510
|
};
|
|
4487
4511
|
});
|
|
@@ -4533,11 +4557,11 @@ const SelectFilterColumn = ({
|
|
|
4533
4557
|
const getName = name => {
|
|
4534
4558
|
switch (formula.type) {
|
|
4535
4559
|
case 'SUBSTR':
|
|
4536
|
-
// let str = formula.params?.join(',');
|
|
4537
4560
|
return jsxs("div", {
|
|
4538
|
-
children: ["SUBSTR
|
|
4561
|
+
children: ["SUBSTR(", name, ",", jsx(InputNumber, {
|
|
4539
4562
|
className: 'left-info-formula-input',
|
|
4540
4563
|
hideControl: true,
|
|
4564
|
+
placeholder: '',
|
|
4541
4565
|
onClick: e => {
|
|
4542
4566
|
e.stopPropagation();
|
|
4543
4567
|
return false;
|
|
@@ -4551,6 +4575,7 @@ const SelectFilterColumn = ({
|
|
|
4551
4575
|
className: 'left-info-formula-input',
|
|
4552
4576
|
hideControl: true,
|
|
4553
4577
|
quickEdit: true,
|
|
4578
|
+
placeholder: '',
|
|
4554
4579
|
onClick: e => {
|
|
4555
4580
|
e.stopPropagation();
|
|
4556
4581
|
return false;
|
|
@@ -4612,8 +4637,6 @@ const SelectFilterColumn = ({
|
|
|
4612
4637
|
小于或等于: 'filter.lessThanOrEqualTo',
|
|
4613
4638
|
为空: 'filter.empty',
|
|
4614
4639
|
不为空: 'filter.notEmpty',
|
|
4615
|
-
是: 'filter.is',
|
|
4616
|
-
不是: 'filter.isNo',
|
|
4617
4640
|
包含: 'filter.contain',
|
|
4618
4641
|
不包含: 'filter.notInclude',
|
|
4619
4642
|
'以...开始': 'filter.startWith',
|
|
@@ -4621,7 +4644,8 @@ const SelectFilterColumn = ({
|
|
|
4621
4644
|
早于: 'filter.earlierThan',
|
|
4622
4645
|
晚于: 'filter.laterThan',
|
|
4623
4646
|
是空的: 'filter.isEmpty',
|
|
4624
|
-
In: 'filter.within'
|
|
4647
|
+
In: 'filter.within',
|
|
4648
|
+
'Not In': 'filter.withnotin'
|
|
4625
4649
|
}[condition]), jsx(DownOutlined, {})]
|
|
4626
4650
|
})
|
|
4627
4651
|
})
|
|
@@ -4637,7 +4661,7 @@ const SelectFilterColumn = ({
|
|
|
4637
4661
|
}) : jsx("div", {
|
|
4638
4662
|
className: 'content_l',
|
|
4639
4663
|
children: renderFilter(type, condition)
|
|
4640
|
-
}), ~['
|
|
4664
|
+
}), ~['等于', '不等于'].indexOf(condition) ? jsx(Tooltip, {
|
|
4641
4665
|
title: __('SqlQueryBuilder.switch'),
|
|
4642
4666
|
children: jsx(Button, {
|
|
4643
4667
|
primary: true,
|
|
@@ -6742,7 +6766,7 @@ const Filter = props => {
|
|
|
6742
6766
|
} else {
|
|
6743
6767
|
return v.quotes;
|
|
6744
6768
|
}
|
|
6745
|
-
})]
|
|
6769
|
+
}).join(' ')]
|
|
6746
6770
|
})]
|
|
6747
6771
|
})
|
|
6748
6772
|
}), jsx(NextDom, {
|
|
@@ -7601,6 +7625,7 @@ const Metabase = props => {
|
|
|
7601
7625
|
if (!visible) return null;
|
|
7602
7626
|
return content;
|
|
7603
7627
|
}, [store.popupData2]);
|
|
7628
|
+
let zIndex = popupContainer.current ? getMaxZIndexInParents(popupContainer.current) : null;
|
|
7604
7629
|
return (
|
|
7605
7630
|
// @ts-ignore
|
|
7606
7631
|
jsx(VisualBox, {
|
|
@@ -7641,6 +7666,7 @@ const Metabase = props => {
|
|
|
7641
7666
|
visible: store.popupData.visible,
|
|
7642
7667
|
node: store.popupData.node,
|
|
7643
7668
|
closable: store.popupClosable,
|
|
7669
|
+
zIndex: zIndex ? String(zIndex) : null,
|
|
7644
7670
|
hideVisible: () => {
|
|
7645
7671
|
store.setPopup({
|
|
7646
7672
|
visible: false
|
|
@@ -7652,6 +7678,7 @@ const Metabase = props => {
|
|
|
7652
7678
|
visible: store.popupData2.visible,
|
|
7653
7679
|
node: store.popupData2.node,
|
|
7654
7680
|
closable: store.popupClosable2,
|
|
7681
|
+
zIndex: zIndex ? String(zIndex) : null,
|
|
7655
7682
|
hideVisible: () => {
|
|
7656
7683
|
store.setClosable(true);
|
|
7657
7684
|
store.setPopup2({
|