@gingkoo/pandora-metabase 1.0.116 → 1.0.117
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.
|
@@ -182,6 +182,10 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
182
182
|
_useState20 = (0, _slicedToArray2["default"])(_useState19, 2),
|
|
183
183
|
selectedIndices = _useState20[0],
|
|
184
184
|
setSelectedIndices = _useState20[1];
|
|
185
|
+
var _useState21 = (0, _react.useState)(null),
|
|
186
|
+
_useState22 = (0, _slicedToArray2["default"])(_useState21, 2),
|
|
187
|
+
hoveredCopyIndex = _useState22[0],
|
|
188
|
+
setHoveredCopyIndex = _useState22[1];
|
|
185
189
|
(0, _react.useEffect)(function () {
|
|
186
190
|
// Skip if this update came from setCaseList (to avoid infinite loop)
|
|
187
191
|
if (isSettingCaseList.current) {
|
|
@@ -428,13 +432,13 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
428
432
|
// 确认删除吗
|
|
429
433
|
onOk: function () {
|
|
430
434
|
var _onOk = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
431
|
-
var _caseList;
|
|
435
|
+
var selectedIndexSet, _caseList;
|
|
432
436
|
return _regenerator["default"].wrap(function (_context) {
|
|
433
437
|
while (1) switch (_context.prev = _context.next) {
|
|
434
438
|
case 0:
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
439
|
+
selectedIndexSet = new Set(selectedIndices);
|
|
440
|
+
_caseList = caseList.filter(function (_, index) {
|
|
441
|
+
return !selectedIndexSet.has(index);
|
|
438
442
|
});
|
|
439
443
|
setCaseList(_caseList);
|
|
440
444
|
initPaste();
|
|
@@ -670,6 +674,7 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
670
674
|
return showNotExists(index);
|
|
671
675
|
},
|
|
672
676
|
children: [v.type, " ( * )", (0, _jsxRuntime.jsx)("span", {
|
|
677
|
+
className: 'item-del',
|
|
673
678
|
style: {
|
|
674
679
|
fontSize: 0
|
|
675
680
|
},
|
|
@@ -689,6 +694,7 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
689
694
|
return showSubQuery(index);
|
|
690
695
|
},
|
|
691
696
|
children: [v.label || (0, _locale.__)('SqlQueryBuilder.subquery'), (0, _jsxRuntime.jsx)("span", {
|
|
697
|
+
className: 'item-del',
|
|
692
698
|
style: {
|
|
693
699
|
fontSize: 0
|
|
694
700
|
},
|
|
@@ -711,6 +717,7 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
711
717
|
return handleField(e, index, v);
|
|
712
718
|
},
|
|
713
719
|
children: [!(v !== null && v !== void 0 && v.fieldName) && (0, _locale.__)('customColumn.selectField'), v.fieldName, (0, _jsxRuntime.jsx)("span", {
|
|
720
|
+
className: 'item-del',
|
|
714
721
|
style: {
|
|
715
722
|
fontSize: 0
|
|
716
723
|
},
|
|
@@ -734,6 +741,7 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
734
741
|
handleConstant(val, index);
|
|
735
742
|
}
|
|
736
743
|
}), (0, _jsxRuntime.jsx)("span", {
|
|
744
|
+
className: 'item-del',
|
|
737
745
|
style: {
|
|
738
746
|
fontSize: 0
|
|
739
747
|
},
|
|
@@ -756,6 +764,7 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
756
764
|
handleConstant(val, index);
|
|
757
765
|
}
|
|
758
766
|
}), (0, _jsxRuntime.jsx)("span", {
|
|
767
|
+
className: 'item-del',
|
|
759
768
|
style: {
|
|
760
769
|
fontSize: 0
|
|
761
770
|
},
|
|
@@ -778,6 +787,7 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
778
787
|
notSelected: !v.val
|
|
779
788
|
}),
|
|
780
789
|
children: [!v.val && (0, _locale.__)('customColumn.selectOperator'), v.val, (0, _jsxRuntime.jsx)("span", {
|
|
790
|
+
className: 'item-del',
|
|
781
791
|
style: {
|
|
782
792
|
fontSize: 0
|
|
783
793
|
},
|
|
@@ -811,6 +821,7 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
811
821
|
"v-val": v.id || v.val,
|
|
812
822
|
onClick: selectConstant,
|
|
813
823
|
children: [(0, _utils3.getConstantLabel)(store.constantList, v.id || v.val, v.val) || (0, _locale.__)('SqlQueryBuilder.pickConstant'), (0, _jsxRuntime.jsx)("span", {
|
|
824
|
+
className: 'item-del',
|
|
814
825
|
style: {
|
|
815
826
|
fontSize: 0
|
|
816
827
|
},
|
|
@@ -837,6 +848,7 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
837
848
|
"v-type": type,
|
|
838
849
|
onClick: selectConstant,
|
|
839
850
|
children: [(0, _utils3.getConstantLabel)(listSource, v.id || v.val, v.val) || "\u8BF7\u9009\u62E9".concat(currentOtherType.label), (0, _jsxRuntime.jsx)("span", {
|
|
851
|
+
className: 'item-del',
|
|
840
852
|
style: {
|
|
841
853
|
fontSize: 0
|
|
842
854
|
},
|
|
@@ -866,6 +878,7 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
866
878
|
return handleExpression(e, index, v);
|
|
867
879
|
},
|
|
868
880
|
children: [v.quotes ? v.quotes : (0, _locale.__)('customColumn.selectExpression'), (0, _jsxRuntime.jsx)("span", {
|
|
881
|
+
className: 'item-del',
|
|
869
882
|
style: {
|
|
870
883
|
fontSize: 0
|
|
871
884
|
},
|
|
@@ -887,6 +900,7 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
887
900
|
return showFunction(e, index);
|
|
888
901
|
},
|
|
889
902
|
children: [v.name ? (0, _utils.getQuotes)(v, v.args, formulaList) : (0, _locale.__)('customColumn.selectFormula'), (0, _jsxRuntime.jsx)("span", {
|
|
903
|
+
className: 'item-del',
|
|
890
904
|
style: {
|
|
891
905
|
fontSize: 0
|
|
892
906
|
},
|
|
@@ -911,6 +925,7 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
911
925
|
notSelected: !v.val
|
|
912
926
|
}),
|
|
913
927
|
children: [!v.val && (0, _locale.__)('customColumn.selectOperator'), v.val, !v.fixed && (0, _jsxRuntime.jsx)("span", {
|
|
928
|
+
className: 'item-del',
|
|
914
929
|
style: {
|
|
915
930
|
fontSize: 0
|
|
916
931
|
},
|
|
@@ -939,6 +954,7 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
939
954
|
notSelected: true
|
|
940
955
|
}),
|
|
941
956
|
children: [(0, _locale.__)('customColumn.selectCustomInput'), (0, _jsxRuntime.jsx)("span", {
|
|
957
|
+
className: 'item-del',
|
|
942
958
|
style: {
|
|
943
959
|
fontSize: 0
|
|
944
960
|
},
|
|
@@ -956,16 +972,31 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
956
972
|
};
|
|
957
973
|
var copyDom = function copyDom() {
|
|
958
974
|
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
975
|
+
var positioned = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
959
976
|
if (!isCopy || selectedIndices.length === 0 && checkedItemsCount === 0) return null;
|
|
960
|
-
return (0, _jsxRuntime.jsx)(
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
977
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
978
|
+
className: (0, _classnames["default"])('Sqb-Filter-item-copy', {
|
|
979
|
+
'Sqb-Filter-item-copy-static': !positioned
|
|
980
|
+
}),
|
|
981
|
+
onMouseEnter: function onMouseEnter() {
|
|
982
|
+
if (!positioned) return;
|
|
983
|
+
setHoveredCopyIndex(index);
|
|
984
|
+
},
|
|
985
|
+
onMouseLeave: function onMouseLeave() {
|
|
986
|
+
if (!positioned) return;
|
|
987
|
+
setHoveredCopyIndex(function (current) {
|
|
988
|
+
return current === index ? null : current;
|
|
989
|
+
});
|
|
990
|
+
},
|
|
991
|
+
children: (0, _jsxRuntime.jsx)(_pandora.Tooltip, {
|
|
992
|
+
title: "\u5728\u6B64\u5904\u7C98\u8D34(".concat(selectedIndices.length || checkedItemsCount, ")\u9879"),
|
|
993
|
+
children: (0, _jsxRuntime.jsx)(_pandora.Button, {
|
|
994
|
+
onClick: function onClick() {
|
|
995
|
+
return handlePaste(index);
|
|
996
|
+
},
|
|
997
|
+
iconOnly: true,
|
|
998
|
+
icon: (0, _jsxRuntime.jsx)(_pandoraIcons.FfPlus, {})
|
|
999
|
+
})
|
|
969
1000
|
})
|
|
970
1001
|
});
|
|
971
1002
|
};
|
|
@@ -1012,10 +1043,10 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
1012
1043
|
children: "\u6E05\u9664\u590D\u5236"
|
|
1013
1044
|
})]
|
|
1014
1045
|
}), (_caseList2 = caseList) === null || _caseList2 === void 0 ? void 0 : _caseList2.map(function (v, i) {
|
|
1015
|
-
return (0, _jsxRuntime.
|
|
1016
|
-
children:
|
|
1046
|
+
return (0, _jsxRuntime.jsx)(_react["default"].Fragment, {
|
|
1047
|
+
children: (0, _jsxRuntime.jsxs)("div", {
|
|
1017
1048
|
className: (0, _classnames["default"])('Sqb-Filter-item', {
|
|
1018
|
-
hover: ind === i,
|
|
1049
|
+
hover: ind === i && hoveredCopyIndex !== i,
|
|
1019
1050
|
'item-fixed': v.fixed || false,
|
|
1020
1051
|
'item-selected': isCheck
|
|
1021
1052
|
}),
|
|
@@ -1027,7 +1058,7 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
1027
1058
|
if (isCheck) return;
|
|
1028
1059
|
setInd(-1);
|
|
1029
1060
|
},
|
|
1030
|
-
children: [selectOperator({
|
|
1061
|
+
children: [copyDom(i), selectOperator({
|
|
1031
1062
|
triggerElement: function triggerElement() {
|
|
1032
1063
|
return (0, _jsxRuntime.jsx)("div", {
|
|
1033
1064
|
className: 'left-arrow',
|
|
@@ -1056,7 +1087,7 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
1056
1087
|
style: {
|
|
1057
1088
|
pointerEvents: isCheck || store.isMetabaseCopy ? 'none' : 'auto'
|
|
1058
1089
|
},
|
|
1059
|
-
className: (0, _classnames["default"])({
|
|
1090
|
+
className: (0, _classnames["default"])('Sqb-Filter-item-content', {
|
|
1060
1091
|
openCheck: isCheck
|
|
1061
1092
|
}),
|
|
1062
1093
|
children: itemDom(v, i)
|
|
@@ -1078,7 +1109,7 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
1078
1109
|
position: 'after',
|
|
1079
1110
|
trigger: 'hover'
|
|
1080
1111
|
})]
|
|
1081
|
-
}, i)
|
|
1112
|
+
}, i)
|
|
1082
1113
|
}, i);
|
|
1083
1114
|
}), Array.from(caseList).length < 1 && selectOperator({
|
|
1084
1115
|
triggerElement: function triggerElement() {
|
|
@@ -1090,7 +1121,7 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
1090
1121
|
ind: -1,
|
|
1091
1122
|
position: 'add',
|
|
1092
1123
|
trigger: 'click'
|
|
1093
|
-
}), copyDom(), showPreview && (0, _jsxRuntime.jsx)("div", {
|
|
1124
|
+
}), copyDom(-1, false), showPreview && (0, _jsxRuntime.jsx)("div", {
|
|
1094
1125
|
className: (0, _classnames["default"])("mb-2 font-bold uppercase tracking-wider preview-box"),
|
|
1095
1126
|
style: {
|
|
1096
1127
|
fontSize: 12,
|
|
@@ -22,22 +22,32 @@
|
|
|
22
22
|
}
|
|
23
23
|
.Sqb-Filter-item {
|
|
24
24
|
position: relative;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
&-content {
|
|
26
|
+
position: relative;
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
}
|
|
30
|
+
&-copy {
|
|
31
|
+
position: absolute;
|
|
32
|
+
left: -14px;
|
|
33
|
+
top: 50%;
|
|
34
|
+
transform: translate(-50%, -50%);
|
|
35
|
+
|
|
36
|
+
&-static {
|
|
37
|
+
position: static;
|
|
38
|
+
display: inline-flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
margin-bottom: 8px;
|
|
41
|
+
transform: none;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
38
44
|
.openCheck {
|
|
39
45
|
.Sqb-TableName {
|
|
40
|
-
padding-left:
|
|
46
|
+
padding-left: 28px;
|
|
47
|
+
|
|
48
|
+
.item-del {
|
|
49
|
+
display: none;
|
|
50
|
+
}
|
|
41
51
|
}
|
|
42
52
|
}
|
|
43
53
|
&.item-selected {
|
|
@@ -48,16 +58,21 @@
|
|
|
48
58
|
.item-check {
|
|
49
59
|
display: none;
|
|
50
60
|
position: absolute;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
z-index:
|
|
61
|
+
left: 0;
|
|
62
|
+
top: 0;
|
|
63
|
+
z-index: 2;
|
|
54
64
|
margin: 0;
|
|
55
65
|
padding: 0;
|
|
56
66
|
width: 100%;
|
|
57
|
-
height:
|
|
67
|
+
height: calc(100% - 8px);
|
|
58
68
|
.pd-Checkbox-mask-wrapper {
|
|
59
|
-
margin
|
|
60
|
-
|
|
69
|
+
margin: 0;
|
|
70
|
+
width: 100%;
|
|
71
|
+
height: 100%;
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: flex-start;
|
|
75
|
+
padding-left: 8px;
|
|
61
76
|
}
|
|
62
77
|
}
|
|
63
78
|
}
|
|
@@ -174,6 +174,10 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
174
174
|
_useState20 = _slicedToArray(_useState19, 2),
|
|
175
175
|
selectedIndices = _useState20[0],
|
|
176
176
|
setSelectedIndices = _useState20[1];
|
|
177
|
+
var _useState21 = useState(null),
|
|
178
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
179
|
+
hoveredCopyIndex = _useState22[0],
|
|
180
|
+
setHoveredCopyIndex = _useState22[1];
|
|
177
181
|
useEffect(function () {
|
|
178
182
|
// Skip if this update came from setCaseList (to avoid infinite loop)
|
|
179
183
|
if (isSettingCaseList.current) {
|
|
@@ -420,13 +424,13 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
420
424
|
// 确认删除吗
|
|
421
425
|
onOk: function () {
|
|
422
426
|
var _onOk = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
423
|
-
var _caseList;
|
|
427
|
+
var selectedIndexSet, _caseList;
|
|
424
428
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
425
429
|
while (1) switch (_context.prev = _context.next) {
|
|
426
430
|
case 0:
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
431
|
+
selectedIndexSet = new Set(selectedIndices);
|
|
432
|
+
_caseList = caseList.filter(function (_, index) {
|
|
433
|
+
return !selectedIndexSet.has(index);
|
|
430
434
|
});
|
|
431
435
|
setCaseList(_caseList);
|
|
432
436
|
initPaste();
|
|
@@ -662,6 +666,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
662
666
|
return showNotExists(index);
|
|
663
667
|
},
|
|
664
668
|
children: [v.type, " ( * )", _jsx("span", {
|
|
669
|
+
className: 'item-del',
|
|
665
670
|
style: {
|
|
666
671
|
fontSize: 0
|
|
667
672
|
},
|
|
@@ -681,6 +686,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
681
686
|
return showSubQuery(index);
|
|
682
687
|
},
|
|
683
688
|
children: [v.label || __('SqlQueryBuilder.subquery'), _jsx("span", {
|
|
689
|
+
className: 'item-del',
|
|
684
690
|
style: {
|
|
685
691
|
fontSize: 0
|
|
686
692
|
},
|
|
@@ -703,6 +709,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
703
709
|
return handleField(e, index, v);
|
|
704
710
|
},
|
|
705
711
|
children: [!(v !== null && v !== void 0 && v.fieldName) && __('customColumn.selectField'), v.fieldName, _jsx("span", {
|
|
712
|
+
className: 'item-del',
|
|
706
713
|
style: {
|
|
707
714
|
fontSize: 0
|
|
708
715
|
},
|
|
@@ -726,6 +733,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
726
733
|
handleConstant(val, index);
|
|
727
734
|
}
|
|
728
735
|
}), _jsx("span", {
|
|
736
|
+
className: 'item-del',
|
|
729
737
|
style: {
|
|
730
738
|
fontSize: 0
|
|
731
739
|
},
|
|
@@ -748,6 +756,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
748
756
|
handleConstant(val, index);
|
|
749
757
|
}
|
|
750
758
|
}), _jsx("span", {
|
|
759
|
+
className: 'item-del',
|
|
751
760
|
style: {
|
|
752
761
|
fontSize: 0
|
|
753
762
|
},
|
|
@@ -770,6 +779,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
770
779
|
notSelected: !v.val
|
|
771
780
|
}),
|
|
772
781
|
children: [!v.val && __('customColumn.selectOperator'), v.val, _jsx("span", {
|
|
782
|
+
className: 'item-del',
|
|
773
783
|
style: {
|
|
774
784
|
fontSize: 0
|
|
775
785
|
},
|
|
@@ -803,6 +813,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
803
813
|
"v-val": v.id || v.val,
|
|
804
814
|
onClick: selectConstant,
|
|
805
815
|
children: [getConstantLabel(store.constantList, v.id || v.val, v.val) || __('SqlQueryBuilder.pickConstant'), _jsx("span", {
|
|
816
|
+
className: 'item-del',
|
|
806
817
|
style: {
|
|
807
818
|
fontSize: 0
|
|
808
819
|
},
|
|
@@ -829,6 +840,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
829
840
|
"v-type": type,
|
|
830
841
|
onClick: selectConstant,
|
|
831
842
|
children: [getConstantLabel(listSource, v.id || v.val, v.val) || "\u8BF7\u9009\u62E9".concat(currentOtherType.label), _jsx("span", {
|
|
843
|
+
className: 'item-del',
|
|
832
844
|
style: {
|
|
833
845
|
fontSize: 0
|
|
834
846
|
},
|
|
@@ -858,6 +870,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
858
870
|
return handleExpression(e, index, v);
|
|
859
871
|
},
|
|
860
872
|
children: [v.quotes ? v.quotes : __('customColumn.selectExpression'), _jsx("span", {
|
|
873
|
+
className: 'item-del',
|
|
861
874
|
style: {
|
|
862
875
|
fontSize: 0
|
|
863
876
|
},
|
|
@@ -879,6 +892,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
879
892
|
return showFunction(e, index);
|
|
880
893
|
},
|
|
881
894
|
children: [v.name ? getQuotes(v, v.args, formulaList) : __('customColumn.selectFormula'), _jsx("span", {
|
|
895
|
+
className: 'item-del',
|
|
882
896
|
style: {
|
|
883
897
|
fontSize: 0
|
|
884
898
|
},
|
|
@@ -903,6 +917,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
903
917
|
notSelected: !v.val
|
|
904
918
|
}),
|
|
905
919
|
children: [!v.val && __('customColumn.selectOperator'), v.val, !v.fixed && _jsx("span", {
|
|
920
|
+
className: 'item-del',
|
|
906
921
|
style: {
|
|
907
922
|
fontSize: 0
|
|
908
923
|
},
|
|
@@ -931,6 +946,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
931
946
|
notSelected: true
|
|
932
947
|
}),
|
|
933
948
|
children: [__('customColumn.selectCustomInput'), _jsx("span", {
|
|
949
|
+
className: 'item-del',
|
|
934
950
|
style: {
|
|
935
951
|
fontSize: 0
|
|
936
952
|
},
|
|
@@ -948,16 +964,31 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
948
964
|
};
|
|
949
965
|
var copyDom = function copyDom() {
|
|
950
966
|
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
967
|
+
var positioned = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
951
968
|
if (!isCopy || selectedIndices.length === 0 && checkedItemsCount === 0) return null;
|
|
952
|
-
return _jsx(
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
969
|
+
return _jsx("div", {
|
|
970
|
+
className: cx('Sqb-Filter-item-copy', {
|
|
971
|
+
'Sqb-Filter-item-copy-static': !positioned
|
|
972
|
+
}),
|
|
973
|
+
onMouseEnter: function onMouseEnter() {
|
|
974
|
+
if (!positioned) return;
|
|
975
|
+
setHoveredCopyIndex(index);
|
|
976
|
+
},
|
|
977
|
+
onMouseLeave: function onMouseLeave() {
|
|
978
|
+
if (!positioned) return;
|
|
979
|
+
setHoveredCopyIndex(function (current) {
|
|
980
|
+
return current === index ? null : current;
|
|
981
|
+
});
|
|
982
|
+
},
|
|
983
|
+
children: _jsx(Tooltip, {
|
|
984
|
+
title: "\u5728\u6B64\u5904\u7C98\u8D34(".concat(selectedIndices.length || checkedItemsCount, ")\u9879"),
|
|
985
|
+
children: _jsx(Button, {
|
|
986
|
+
onClick: function onClick() {
|
|
987
|
+
return handlePaste(index);
|
|
988
|
+
},
|
|
989
|
+
iconOnly: true,
|
|
990
|
+
icon: _jsx(FfPlus, {})
|
|
991
|
+
})
|
|
961
992
|
})
|
|
962
993
|
});
|
|
963
994
|
};
|
|
@@ -1004,10 +1035,10 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
1004
1035
|
children: "\u6E05\u9664\u590D\u5236"
|
|
1005
1036
|
})]
|
|
1006
1037
|
}), (_caseList2 = caseList) === null || _caseList2 === void 0 ? void 0 : _caseList2.map(function (v, i) {
|
|
1007
|
-
return
|
|
1008
|
-
children:
|
|
1038
|
+
return _jsx(React.Fragment, {
|
|
1039
|
+
children: _jsxs("div", {
|
|
1009
1040
|
className: cx('Sqb-Filter-item', {
|
|
1010
|
-
hover: ind === i,
|
|
1041
|
+
hover: ind === i && hoveredCopyIndex !== i,
|
|
1011
1042
|
'item-fixed': v.fixed || false,
|
|
1012
1043
|
'item-selected': isCheck
|
|
1013
1044
|
}),
|
|
@@ -1019,7 +1050,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
1019
1050
|
if (isCheck) return;
|
|
1020
1051
|
setInd(-1);
|
|
1021
1052
|
},
|
|
1022
|
-
children: [selectOperator({
|
|
1053
|
+
children: [copyDom(i), selectOperator({
|
|
1023
1054
|
triggerElement: function triggerElement() {
|
|
1024
1055
|
return _jsx("div", {
|
|
1025
1056
|
className: 'left-arrow',
|
|
@@ -1048,7 +1079,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
1048
1079
|
style: {
|
|
1049
1080
|
pointerEvents: isCheck || store.isMetabaseCopy ? 'none' : 'auto'
|
|
1050
1081
|
},
|
|
1051
|
-
className: cx({
|
|
1082
|
+
className: cx('Sqb-Filter-item-content', {
|
|
1052
1083
|
openCheck: isCheck
|
|
1053
1084
|
}),
|
|
1054
1085
|
children: itemDom(v, i)
|
|
@@ -1070,7 +1101,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
1070
1101
|
position: 'after',
|
|
1071
1102
|
trigger: 'hover'
|
|
1072
1103
|
})]
|
|
1073
|
-
}, i)
|
|
1104
|
+
}, i)
|
|
1074
1105
|
}, i);
|
|
1075
1106
|
}), Array.from(caseList).length < 1 && selectOperator({
|
|
1076
1107
|
triggerElement: function triggerElement() {
|
|
@@ -1082,7 +1113,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
1082
1113
|
ind: -1,
|
|
1083
1114
|
position: 'add',
|
|
1084
1115
|
trigger: 'click'
|
|
1085
|
-
}), copyDom(), showPreview && _jsx("div", {
|
|
1116
|
+
}), copyDom(-1, false), showPreview && _jsx("div", {
|
|
1086
1117
|
className: cx("mb-2 font-bold uppercase tracking-wider preview-box"),
|
|
1087
1118
|
style: {
|
|
1088
1119
|
fontSize: 12,
|
|
@@ -22,22 +22,32 @@
|
|
|
22
22
|
}
|
|
23
23
|
.Sqb-Filter-item {
|
|
24
24
|
position: relative;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
&-content {
|
|
26
|
+
position: relative;
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
}
|
|
30
|
+
&-copy {
|
|
31
|
+
position: absolute;
|
|
32
|
+
left: -14px;
|
|
33
|
+
top: 50%;
|
|
34
|
+
transform: translate(-50%, -50%);
|
|
35
|
+
|
|
36
|
+
&-static {
|
|
37
|
+
position: static;
|
|
38
|
+
display: inline-flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
margin-bottom: 8px;
|
|
41
|
+
transform: none;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
38
44
|
.openCheck {
|
|
39
45
|
.Sqb-TableName {
|
|
40
|
-
padding-left:
|
|
46
|
+
padding-left: 28px;
|
|
47
|
+
|
|
48
|
+
.item-del {
|
|
49
|
+
display: none;
|
|
50
|
+
}
|
|
41
51
|
}
|
|
42
52
|
}
|
|
43
53
|
&.item-selected {
|
|
@@ -48,16 +58,21 @@
|
|
|
48
58
|
.item-check {
|
|
49
59
|
display: none;
|
|
50
60
|
position: absolute;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
z-index:
|
|
61
|
+
left: 0;
|
|
62
|
+
top: 0;
|
|
63
|
+
z-index: 2;
|
|
54
64
|
margin: 0;
|
|
55
65
|
padding: 0;
|
|
56
66
|
width: 100%;
|
|
57
|
-
height:
|
|
67
|
+
height: calc(100% - 8px);
|
|
58
68
|
.pd-Checkbox-mask-wrapper {
|
|
59
|
-
margin
|
|
60
|
-
|
|
69
|
+
margin: 0;
|
|
70
|
+
width: 100%;
|
|
71
|
+
height: 100%;
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: flex-start;
|
|
75
|
+
padding-left: 8px;
|
|
61
76
|
}
|
|
62
77
|
}
|
|
63
78
|
}
|