@gingkoo/pandora-metabase 1.0.152 → 1.0.154
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/cjs/components/dialog/custom-editor/index.d.ts +1 -0
- package/lib/cjs/components/dialog/custom-editor/index.js +10 -3
- package/lib/cjs/components/dialog/formula/index.d.ts +1 -0
- package/lib/cjs/components/dialog/formula/index.js +11 -3
- package/lib/cjs/components/dialog/formula-list/CaseWhenGroup.d.ts +2 -1
- package/lib/cjs/components/dialog/formula-list/CaseWhenGroup.js +7 -5
- package/lib/cjs/components/dialog/formula-list/LogicGroup.d.ts +2 -1
- package/lib/cjs/components/dialog/formula-list/LogicGroup.js +4 -2
- package/lib/cjs/components/dialog/formula-list/index.js +22 -11
- package/lib/cjs/components/dialog/select-column/index.d.ts +2 -1
- package/lib/cjs/components/dialog/select-column/index.js +10 -1
- package/lib/cjs/components/dialog/select-column-multiple/index.d.ts +2 -1
- package/lib/cjs/components/dialog/select-column-multiple/index.js +6 -3
- package/lib/cjs/components/dialog/select-summarize/index.d.ts +2 -1
- package/lib/cjs/components/dialog/select-summarize/index.js +5 -2
- package/lib/cjs/components/metabase/index.js +30 -2
- package/lib/cjs/components/modules/components/header.js +1 -1
- package/lib/cjs/components/modules/components/item-name.js +4 -1
- package/lib/cjs/components/modules/components/item-wrapper.js +1 -1
- package/lib/cjs/components/modules/components/meta-icon.js +4 -2
- package/lib/cjs/components/modules/custom-column.js +4 -2
- package/lib/cjs/components/modules/join-data.js +41 -41
- package/lib/cjs/components/modules/permission-table.js +1 -0
- package/lib/cjs/components/modules/row-limit.js +1 -0
- package/lib/cjs/components/modules/sort.js +2 -2
- package/lib/cjs/components/modules/summarize/group-by.js +8 -5
- package/lib/cjs/components/modules/summarize/select-index.js +5 -3
- package/lib/cjs/components/modules/table-data.js +7 -4
- package/lib/cjs/components/modules/union.js +1 -1
- package/lib/cjs/hooks/use-state.js +66 -52
- package/lib/cjs/index.js +7 -2
- package/lib/cjs/types.d.ts +1 -0
- package/lib/es/components/dialog/custom-editor/index.d.ts +1 -0
- package/lib/es/components/dialog/custom-editor/index.js +10 -3
- package/lib/es/components/dialog/formula/index.d.ts +1 -0
- package/lib/es/components/dialog/formula/index.js +11 -3
- package/lib/es/components/dialog/formula-list/CaseWhenGroup.d.ts +2 -1
- package/lib/es/components/dialog/formula-list/CaseWhenGroup.js +7 -5
- package/lib/es/components/dialog/formula-list/LogicGroup.d.ts +2 -1
- package/lib/es/components/dialog/formula-list/LogicGroup.js +4 -2
- package/lib/es/components/dialog/formula-list/index.js +22 -11
- package/lib/es/components/dialog/select-column/index.d.ts +2 -1
- package/lib/es/components/dialog/select-column/index.js +10 -1
- package/lib/es/components/dialog/select-column-multiple/index.d.ts +2 -1
- package/lib/es/components/dialog/select-column-multiple/index.js +6 -3
- package/lib/es/components/dialog/select-summarize/index.d.ts +2 -1
- package/lib/es/components/dialog/select-summarize/index.js +5 -2
- package/lib/es/components/metabase/index.js +30 -2
- package/lib/es/components/modules/components/header.js +1 -1
- package/lib/es/components/modules/components/item-name.js +4 -1
- package/lib/es/components/modules/components/item-wrapper.js +1 -1
- package/lib/es/components/modules/components/meta-icon.js +4 -2
- package/lib/es/components/modules/custom-column.js +4 -2
- package/lib/es/components/modules/join-data.js +41 -41
- package/lib/es/components/modules/permission-table.js +1 -0
- package/lib/es/components/modules/row-limit.js +1 -0
- package/lib/es/components/modules/sort.js +2 -2
- package/lib/es/components/modules/summarize/group-by.js +8 -5
- package/lib/es/components/modules/summarize/select-index.js +5 -3
- package/lib/es/components/modules/table-data.js +7 -4
- package/lib/es/components/modules/union.js +1 -1
- package/lib/es/hooks/use-state.js +66 -52
- package/lib/es/index.js +7 -2
- package/lib/es/types.d.ts +1 -0
- package/package.json +1 -1
package/lib/cjs/index.js
CHANGED
|
@@ -26,6 +26,8 @@ var SqlVisionBuilder = _react["default"].forwardRef(function (props, ref) {
|
|
|
26
26
|
loading = _props$loading === void 0 ? false : _props$loading,
|
|
27
27
|
_props$showFields = props.showFields,
|
|
28
28
|
showFields = _props$showFields === void 0 ? true : _props$showFields,
|
|
29
|
+
_props$snapshotMode = props.snapshotMode,
|
|
30
|
+
snapshotMode = _props$snapshotMode === void 0 ? false : _props$snapshotMode,
|
|
29
31
|
getTables = props.getTables,
|
|
30
32
|
getColumns = props.getColumns,
|
|
31
33
|
onChange = props.onChange,
|
|
@@ -131,6 +133,7 @@ var SqlVisionBuilder = _react["default"].forwardRef(function (props, ref) {
|
|
|
131
133
|
store.setGroupByEnableAlias(groupByEnableAlias);
|
|
132
134
|
store.setIsSelectFields(isSelectFields);
|
|
133
135
|
store.setTableFlat(tableFlat);
|
|
136
|
+
store.setSnapshotMode(snapshotMode);
|
|
134
137
|
store.setCopyType(copyType || EMPTY_ARRAY);
|
|
135
138
|
store.setMetabaseCopy(metabaseCopy);
|
|
136
139
|
store.setModuleDiff(moduleDiff);
|
|
@@ -141,7 +144,7 @@ var SqlVisionBuilder = _react["default"].forwardRef(function (props, ref) {
|
|
|
141
144
|
store.setModuleCopy(moduleCopy);
|
|
142
145
|
store.setJoinAliasConflictCheck(joinAliasConflictCheck);
|
|
143
146
|
store.setOperatorList(operatorList || EMPTY_ARRAY);
|
|
144
|
-
}, [showFields, fieldNameTpl, tableNameTpl, toolbar, showSubquery, subShowSubquery, constantList, formulaTemplates, ignoreGroupByType, filterCustomType, isExit, tableEnableAlias, fieldEnableAlias, groupByEnableAlias, isSelectFields, tableFlat, copyType, metabaseCopy, moduleDiff, showFormulaSql, showFormulaDiff, matchBrackets, getFormulaSqlCode, getFormulaDiffCode, isSubquery, moduleCopy, joinAliasConflictCheck, operatorList]);
|
|
147
|
+
}, [showFields, fieldNameTpl, tableNameTpl, toolbar, showSubquery, subShowSubquery, constantList, formulaTemplates, ignoreGroupByType, filterCustomType, isExit, tableEnableAlias, fieldEnableAlias, groupByEnableAlias, isSelectFields, tableFlat, snapshotMode, copyType, metabaseCopy, moduleDiff, showFormulaSql, showFormulaDiff, matchBrackets, getFormulaSqlCode, getFormulaDiffCode, isSubquery, moduleCopy, joinAliasConflictCheck, operatorList]);
|
|
145
148
|
_react["default"].useImperativeHandle(ref, function () {
|
|
146
149
|
return {
|
|
147
150
|
reset: function reset() {
|
|
@@ -161,7 +164,9 @@ var SqlVisionBuilder = _react["default"].forwardRef(function (props, ref) {
|
|
|
161
164
|
msg: (0, _locale.__)('loading')
|
|
162
165
|
});
|
|
163
166
|
return (0, _jsxRuntime.jsx)(_useProvider.Provider, {
|
|
164
|
-
value: store,
|
|
167
|
+
value: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, store), {}, {
|
|
168
|
+
snapshotMode: snapshotMode
|
|
169
|
+
}),
|
|
165
170
|
children: (0, _jsxRuntime.jsx)(_metabase["default"], (0, _objectSpread2["default"])({}, props))
|
|
166
171
|
});
|
|
167
172
|
});
|
package/lib/cjs/types.d.ts
CHANGED
|
@@ -23,7 +23,9 @@ var CaseEditor = function CaseEditor(props) {
|
|
|
23
23
|
data = props.data,
|
|
24
24
|
exitData = props.exitData,
|
|
25
25
|
onOk = props.onOk,
|
|
26
|
-
onCancel = props.onCancel
|
|
26
|
+
onCancel = props.onCancel,
|
|
27
|
+
_props$readonly = props.readonly,
|
|
28
|
+
readonly = _props$readonly === void 0 ? false : _props$readonly;
|
|
27
29
|
var store = useStore();
|
|
28
30
|
var _useState = useState(value.formulaList || []),
|
|
29
31
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -41,6 +43,7 @@ var CaseEditor = function CaseEditor(props) {
|
|
|
41
43
|
onCancel === null || onCancel === void 0 || onCancel();
|
|
42
44
|
};
|
|
43
45
|
var _onOk = function _onOk() {
|
|
46
|
+
if (readonly) return;
|
|
44
47
|
if (!isValidSQLAlias(name)) {
|
|
45
48
|
Toast.warning(__('SqlQueryBuilder.nameForRules'));
|
|
46
49
|
return false;
|
|
@@ -74,6 +77,7 @@ var CaseEditor = function CaseEditor(props) {
|
|
|
74
77
|
placeholder: __('customColumn.somethingAwesomeToDocument'),
|
|
75
78
|
size: 'large',
|
|
76
79
|
onChange: function onChange(val) {
|
|
80
|
+
if (readonly) return;
|
|
77
81
|
setName(val);
|
|
78
82
|
}
|
|
79
83
|
})
|
|
@@ -85,7 +89,10 @@ var CaseEditor = function CaseEditor(props) {
|
|
|
85
89
|
data: data,
|
|
86
90
|
exitData: exitData,
|
|
87
91
|
ref: ref,
|
|
88
|
-
onChange:
|
|
92
|
+
onChange: function onChange(nextList) {
|
|
93
|
+
if (readonly) return;
|
|
94
|
+
setCaseList(nextList);
|
|
95
|
+
},
|
|
89
96
|
_type: FormulaTypeEnum.CUSTOM
|
|
90
97
|
})]
|
|
91
98
|
})
|
|
@@ -102,7 +109,7 @@ var CaseEditor = function CaseEditor(props) {
|
|
|
102
109
|
return _onClose();
|
|
103
110
|
},
|
|
104
111
|
children: __('customColumn.cancel')
|
|
105
|
-
}), _jsx("button", {
|
|
112
|
+
}), !readonly && _jsx("button", {
|
|
106
113
|
className: cx("btn ml-4", {
|
|
107
114
|
usable: usable
|
|
108
115
|
}),
|
|
@@ -30,7 +30,9 @@ var CaseEditor = React.forwardRef(function (props, ref) {
|
|
|
30
30
|
var value = props.value,
|
|
31
31
|
data = props.data,
|
|
32
32
|
onOk = props.onOk,
|
|
33
|
-
onCancel = props.onCancel
|
|
33
|
+
onCancel = props.onCancel,
|
|
34
|
+
_props$readonly = props.readonly,
|
|
35
|
+
readonly = _props$readonly === void 0 ? false : _props$readonly;
|
|
34
36
|
var _useState = useState(function () {
|
|
35
37
|
return _objectSpread(_objectSpread({}, value), {}, {
|
|
36
38
|
id: value.id || value.name
|
|
@@ -85,6 +87,7 @@ var CaseEditor = React.forwardRef(function (props, ref) {
|
|
|
85
87
|
onCancel === null || onCancel === void 0 || onCancel();
|
|
86
88
|
};
|
|
87
89
|
var _onOk = function _onOk() {
|
|
90
|
+
if (readonly) return;
|
|
88
91
|
typeof onOk === 'function' && (onOk === null || onOk === void 0 ? void 0 : onOk(_objectSpread(_objectSpread({}, fun), {}, {
|
|
89
92
|
arity: effectiveArity,
|
|
90
93
|
id: currentFormulaKey,
|
|
@@ -95,6 +98,7 @@ var CaseEditor = React.forwardRef(function (props, ref) {
|
|
|
95
98
|
var handleFunName = function handleFunName(id) {
|
|
96
99
|
var _formulaList$id, _formulaList$id2, _formulaList$id3;
|
|
97
100
|
var isId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
101
|
+
if (readonly) return;
|
|
98
102
|
setFun(_objectSpread(_objectSpread({}, fun), {}, {
|
|
99
103
|
args: getTemArgs(formulaList === null || formulaList === void 0 ? void 0 : formulaList[id].args, formulaList === null || formulaList === void 0 || (_formulaList$id = formulaList[id]) === null || _formulaList$id === void 0 ? void 0 : _formulaList$id.arity),
|
|
100
104
|
arity: formulaList === null || formulaList === void 0 || (_formulaList$id2 = formulaList[id]) === null || _formulaList$id2 === void 0 ? void 0 : _formulaList$id2.arity,
|
|
@@ -103,6 +107,7 @@ var CaseEditor = React.forwardRef(function (props, ref) {
|
|
|
103
107
|
}));
|
|
104
108
|
};
|
|
105
109
|
var addParams = function addParams(index) {
|
|
110
|
+
if (readonly) return;
|
|
106
111
|
var _args = cloneDeep(fun.args);
|
|
107
112
|
var tem = getTemArgs(currentFormulaTemplate === null || currentFormulaTemplate === void 0 ? void 0 : currentFormulaTemplate.args)[index + 1] || {
|
|
108
113
|
type: AtomsTypeEnum.COLLECTION,
|
|
@@ -115,6 +120,7 @@ var CaseEditor = React.forwardRef(function (props, ref) {
|
|
|
115
120
|
}));
|
|
116
121
|
};
|
|
117
122
|
var delParams = function delParams(index) {
|
|
123
|
+
if (readonly) return;
|
|
118
124
|
var _args = cloneDeep(fun.args);
|
|
119
125
|
_args.splice(index, 1);
|
|
120
126
|
setFun(_objectSpread(_objectSpread({}, fun), {}, {
|
|
@@ -165,6 +171,7 @@ var CaseEditor = React.forwardRef(function (props, ref) {
|
|
|
165
171
|
});
|
|
166
172
|
},
|
|
167
173
|
onChange: function onChange(val) {
|
|
174
|
+
if (readonly) return;
|
|
168
175
|
handleFunName(val);
|
|
169
176
|
},
|
|
170
177
|
children: (_store$formulaTemplat = store.formulaTemplates) === null || _store$formulaTemplat === void 0 ? void 0 : _store$formulaTemplat.map(function (options, index) {
|
|
@@ -214,6 +221,7 @@ var CaseEditor = React.forwardRef(function (props, ref) {
|
|
|
214
221
|
ref: _ref,
|
|
215
222
|
_type: FormulaTypeEnum.FORMULA,
|
|
216
223
|
onChange: function onChange(data, _quotes) {
|
|
224
|
+
if (readonly) return;
|
|
217
225
|
var _args = cloneDeep(fun.args);
|
|
218
226
|
_args[i].list = data;
|
|
219
227
|
setFun(_objectSpread(_objectSpread({}, fun), {}, {
|
|
@@ -222,7 +230,7 @@ var CaseEditor = React.forwardRef(function (props, ref) {
|
|
|
222
230
|
}));
|
|
223
231
|
}
|
|
224
232
|
})]
|
|
225
|
-
}), _jsxs("div", {
|
|
233
|
+
}), !readonly && _jsxs("div", {
|
|
226
234
|
className: 'Sqb-item-opr',
|
|
227
235
|
children: [_jsx(Button, {
|
|
228
236
|
primary: true,
|
|
@@ -264,7 +272,7 @@ var CaseEditor = React.forwardRef(function (props, ref) {
|
|
|
264
272
|
return _onClose();
|
|
265
273
|
},
|
|
266
274
|
children: __('customColumn.cancel')
|
|
267
|
-
}), _jsx("button", {
|
|
275
|
+
}), !readonly && _jsx("button", {
|
|
268
276
|
className: cx("btn ml-4", {
|
|
269
277
|
usable: usable
|
|
270
278
|
}),
|
|
@@ -17,6 +17,7 @@ type Props = {
|
|
|
17
17
|
onZoomCase?: (e: any) => void;
|
|
18
18
|
onDeleteCase?: (e: any) => void;
|
|
19
19
|
showTools?: boolean;
|
|
20
|
+
readonly?: boolean;
|
|
20
21
|
isNested?: boolean;
|
|
21
22
|
useBranchScrollInner?: boolean;
|
|
22
23
|
caseRegionKey?: string;
|
|
@@ -24,5 +25,5 @@ type Props = {
|
|
|
24
25
|
activeRegionKey?: string | null;
|
|
25
26
|
onActivateRegion?: (key: string) => void;
|
|
26
27
|
};
|
|
27
|
-
declare const CaseWhenGroup: ({ caseAtomsContent, whenClauses, elseContent, onAddBranch, onAddElse, onRemoveElse, onZoomCase, onDeleteCase, showTools, isNested, useBranchScrollInner, caseRegionKey, elseRegionKey, activeRegionKey, onActivateRegion, }: Props) => React.JSX.Element;
|
|
28
|
+
declare const CaseWhenGroup: ({ caseAtomsContent, whenClauses, elseContent, onAddBranch, onAddElse, onRemoveElse, onZoomCase, onDeleteCase, showTools, readonly, isNested, useBranchScrollInner, caseRegionKey, elseRegionKey, activeRegionKey, onActivateRegion, }: Props) => React.JSX.Element;
|
|
28
29
|
export default CaseWhenGroup;
|
|
@@ -69,6 +69,8 @@ var CaseWhenGroup = function CaseWhenGroup(_ref) {
|
|
|
69
69
|
onDeleteCase = _ref.onDeleteCase,
|
|
70
70
|
_ref$showTools = _ref.showTools,
|
|
71
71
|
showTools = _ref$showTools === void 0 ? true : _ref$showTools,
|
|
72
|
+
_ref$readonly = _ref.readonly,
|
|
73
|
+
readonly = _ref$readonly === void 0 ? false : _ref$readonly,
|
|
72
74
|
_ref$isNested = _ref.isNested,
|
|
73
75
|
isNested = _ref$isNested === void 0 ? false : _ref$isNested,
|
|
74
76
|
_ref$useBranchScrollI = _ref.useBranchScrollInner,
|
|
@@ -105,7 +107,7 @@ var CaseWhenGroup = function CaseWhenGroup(_ref) {
|
|
|
105
107
|
className: cx('Sqb-FormulaGroup', 'flow-group', 'formula-node-group', 'Sqb-CaseWhenGroup', {
|
|
106
108
|
'Sqb-CaseWhenGroup--nested': isNested
|
|
107
109
|
}),
|
|
108
|
-
children: [showTools && _jsxs("div", {
|
|
110
|
+
children: [showTools && !readonly && _jsxs("div", {
|
|
109
111
|
className: 'Sqb-CaseWhenTools',
|
|
110
112
|
children: [onZoomCase && _jsx(Tooltip, {
|
|
111
113
|
title: "\u7F16\u8F91 caseWhen",
|
|
@@ -177,7 +179,7 @@ var CaseWhenGroup = function CaseWhenGroup(_ref) {
|
|
|
177
179
|
})]
|
|
178
180
|
})]
|
|
179
181
|
}))
|
|
180
|
-
}), _jsxs("div", {
|
|
182
|
+
}), !readonly && _jsxs("div", {
|
|
181
183
|
className: 'Sqb-CaseRow-actions when-row-actions',
|
|
182
184
|
children: [_jsx(Tooltip, {
|
|
183
185
|
title: "\u65B0\u589E when",
|
|
@@ -206,7 +208,7 @@ var CaseWhenGroup = function CaseWhenGroup(_ref) {
|
|
|
206
208
|
})]
|
|
207
209
|
})]
|
|
208
210
|
}, branch.key);
|
|
209
|
-
}), whenClauses.length < 1 && _jsx(Tooltip, {
|
|
211
|
+
}), !readonly && whenClauses.length < 1 && _jsx(Tooltip, {
|
|
210
212
|
title: "\u65B0\u589E when",
|
|
211
213
|
children: _jsxs("button", {
|
|
212
214
|
type: 'button',
|
|
@@ -237,7 +239,7 @@ var CaseWhenGroup = function CaseWhenGroup(_ref) {
|
|
|
237
239
|
children: elseContent
|
|
238
240
|
})]
|
|
239
241
|
}))
|
|
240
|
-
}), _jsx("div", {
|
|
242
|
+
}), !readonly && _jsx("div", {
|
|
241
243
|
className: 'Sqb-CaseRow-actions when-row-actions',
|
|
242
244
|
children: _jsx(Tooltip, {
|
|
243
245
|
title: "\u5220\u9664 else",
|
|
@@ -253,7 +255,7 @@ var CaseWhenGroup = function CaseWhenGroup(_ref) {
|
|
|
253
255
|
})
|
|
254
256
|
})
|
|
255
257
|
})]
|
|
256
|
-
}), !elseContent && _jsx(Tooltip, {
|
|
258
|
+
}), !readonly && !elseContent && _jsx(Tooltip, {
|
|
257
259
|
title: "\u65B0\u589E else",
|
|
258
260
|
children: _jsxs("button", {
|
|
259
261
|
type: 'button',
|
|
@@ -8,6 +8,7 @@ type Props = {
|
|
|
8
8
|
onAddItem: () => void;
|
|
9
9
|
onDeleteItem: (operatorIndex: number, side: 'left' | 'right') => void;
|
|
10
10
|
onDelete: (e: any) => void;
|
|
11
|
+
readonly?: boolean;
|
|
11
12
|
};
|
|
12
|
-
declare const LogicGroup: ({ items, onChangeOperator, onAddItem, onDeleteItem, onDelete, }: Props) => React.JSX.Element;
|
|
13
|
+
declare const LogicGroup: ({ items, onChangeOperator, onAddItem, onDeleteItem, onDelete, readonly, }: Props) => React.JSX.Element;
|
|
13
14
|
export default LogicGroup;
|
|
@@ -19,7 +19,9 @@ var LogicGroup = function LogicGroup(_ref) {
|
|
|
19
19
|
onChangeOperator = _ref.onChangeOperator,
|
|
20
20
|
onAddItem = _ref.onAddItem,
|
|
21
21
|
onDeleteItem = _ref.onDeleteItem,
|
|
22
|
-
onDelete = _ref.onDelete
|
|
22
|
+
onDelete = _ref.onDelete,
|
|
23
|
+
_ref$readonly = _ref.readonly,
|
|
24
|
+
readonly = _ref$readonly === void 0 ? false : _ref$readonly;
|
|
23
25
|
var canDeleteItem = items.length > 2;
|
|
24
26
|
var handleOperatorMenuChange = function handleOperatorMenuChange(operatorIndex, action) {
|
|
25
27
|
if (action === 'add') {
|
|
@@ -76,7 +78,7 @@ var LogicGroup = function LogicGroup(_ref) {
|
|
|
76
78
|
}), _jsx("span", {
|
|
77
79
|
className: 'Sqb-CaseKeyword',
|
|
78
80
|
children: ")"
|
|
79
|
-
}), _jsx(Tooltip, {
|
|
81
|
+
}), !readonly && _jsx(Tooltip, {
|
|
80
82
|
title: "\u5220\u9664 and/or",
|
|
81
83
|
children: _jsx("button", {
|
|
82
84
|
type: 'button',
|
|
@@ -156,6 +156,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
156
156
|
};
|
|
157
157
|
}, []);
|
|
158
158
|
var store = useStore();
|
|
159
|
+
var snapshotMode = Boolean(store.snapshotMode);
|
|
159
160
|
var _props$value = props.value,
|
|
160
161
|
value = _props$value === void 0 ? [] : _props$value,
|
|
161
162
|
data = props.data,
|
|
@@ -957,6 +958,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
957
958
|
var caseRegionKey = "case-".concat(index, "-case");
|
|
958
959
|
var elseRegionKey = "case-".concat(index, "-else");
|
|
959
960
|
return _jsx(CaseWhenGroup, {
|
|
961
|
+
readonly: snapshotMode,
|
|
960
962
|
isNested: embedded,
|
|
961
963
|
useBranchScrollInner: !embedded,
|
|
962
964
|
caseRegionKey: caseRegionKey,
|
|
@@ -1068,6 +1070,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
1068
1070
|
updateAtomAt(index, buildAndOrItem(value, nextItems));
|
|
1069
1071
|
};
|
|
1070
1072
|
return _jsx(LogicGroup, {
|
|
1073
|
+
readonly: snapshotMode,
|
|
1071
1074
|
items: items.map(function (item, itemIndex) {
|
|
1072
1075
|
return {
|
|
1073
1076
|
operator: item.operator,
|
|
@@ -1420,6 +1423,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
1420
1423
|
multiple: false,
|
|
1421
1424
|
value: [val],
|
|
1422
1425
|
theme: ColumnsPopupThemeEnum.skyBlue,
|
|
1426
|
+
readonly: snapshotMode,
|
|
1423
1427
|
onSelect: function onSelect(fields) {
|
|
1424
1428
|
var _caseList = caseList.slice();
|
|
1425
1429
|
_caseList[i] = fields[0];
|
|
@@ -1820,6 +1824,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
1820
1824
|
children: _jsx(Formula, {
|
|
1821
1825
|
data: data,
|
|
1822
1826
|
value: _value,
|
|
1827
|
+
readonly: snapshotMode,
|
|
1823
1828
|
onCancel: function onCancel() {
|
|
1824
1829
|
o.close();
|
|
1825
1830
|
},
|
|
@@ -2088,6 +2093,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
2088
2093
|
var copyDom = function copyDom() {
|
|
2089
2094
|
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
2090
2095
|
var positioned = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
2096
|
+
if (snapshotMode) return null;
|
|
2091
2097
|
if (embedded) return null;
|
|
2092
2098
|
if (!isCopy || selectedIndices.length === 0 && checkedItemsCount === 0) return null;
|
|
2093
2099
|
return _jsx("div", {
|
|
@@ -2120,8 +2126,9 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
2120
2126
|
var showCheckbox = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
|
2121
2127
|
var itemContent = itemDom(v, i, groupType);
|
|
2122
2128
|
var isCompositeAtom = v.type === AtomsTypeEnum.CASE_WHEN || v.type === AtomsTypeEnum.AND_OR;
|
|
2123
|
-
var showAfterArrow = canShowItemInsertArrows(v, groupType);
|
|
2124
|
-
var showBeforeArrow = canShowItemInsertArrows(v, groupType);
|
|
2129
|
+
var showAfterArrow = !snapshotMode && canShowItemInsertArrows(v, groupType);
|
|
2130
|
+
var showBeforeArrow = !snapshotMode && canShowItemInsertArrows(v, groupType);
|
|
2131
|
+
var canOpenInSnapshot = v.type === AtomsTypeEnum.FORMULA || v.type === AtomsTypeEnum.FIELD || v.type === AtomsTypeEnum.SUB_QUERY || v.type === AtomsTypeEnum.EXISTS || v.type === AtomsTypeEnum.NOT_EXISTS;
|
|
2125
2132
|
return _jsx(React.Fragment, {
|
|
2126
2133
|
children: _jsxs("div", {
|
|
2127
2134
|
className: cx('Sqb-Filter-item', _defineProperty({
|
|
@@ -2160,7 +2167,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
2160
2167
|
ind: i,
|
|
2161
2168
|
position: 'before',
|
|
2162
2169
|
trigger: 'hover'
|
|
2163
|
-
}), !embedded && showCheckbox && v.type !== AtomsTypeEnum.UNKNOWN && _jsx(Checkbox, {
|
|
2170
|
+
}), !snapshotMode && !embedded && showCheckbox && v.type !== AtomsTypeEnum.UNKNOWN && _jsx(Checkbox, {
|
|
2164
2171
|
className: 'item-check',
|
|
2165
2172
|
checked: selectedIndices.includes(i),
|
|
2166
2173
|
disabled: globalSelectionActive && globalSelectionOwner !== myInstanceIdRef.current,
|
|
@@ -2170,7 +2177,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
2170
2177
|
}
|
|
2171
2178
|
}), _jsx("div", {
|
|
2172
2179
|
style: {
|
|
2173
|
-
pointerEvents: isCheck || store.isMetabaseCopy ? 'none' : 'auto'
|
|
2180
|
+
pointerEvents: snapshotMode && !canOpenInSnapshot || isCheck || store.isMetabaseCopy ? 'none' : 'auto'
|
|
2174
2181
|
},
|
|
2175
2182
|
className: cx('Sqb-Filter-item-node', {
|
|
2176
2183
|
openCheck: isCheck && !isCompositeAtom
|
|
@@ -2178,8 +2185,11 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
2178
2185
|
children: itemContent.raw ? itemContent.node : _jsx(ItemName, _objectSpread(_objectSpread({}, getItemNameProps(v)), {}, {
|
|
2179
2186
|
children: _jsx(RightClickValue, {
|
|
2180
2187
|
value: v,
|
|
2181
|
-
children: _jsx("div", _objectSpread(_objectSpread({
|
|
2182
|
-
className: cx('Sqb-TableName', itemContent.className)
|
|
2188
|
+
children: _jsx("div", _objectSpread(_objectSpread(_objectSpread({
|
|
2189
|
+
className: cx('Sqb-TableName', itemContent.className)
|
|
2190
|
+
}, snapshotMode && canOpenInSnapshot ? {
|
|
2191
|
+
'data-sqb-snapshot-allow': 'true'
|
|
2192
|
+
} : {}), {}, {
|
|
2183
2193
|
onClick: itemContent.onClick,
|
|
2184
2194
|
style: getTokenStyleByClassName(itemContent.className, itemContent.style)
|
|
2185
2195
|
}, itemContent.attrs || {}), {}, {
|
|
@@ -2214,6 +2224,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
2214
2224
|
});
|
|
2215
2225
|
};
|
|
2216
2226
|
var renderDeleteIcon = function renderDeleteIcon(item, index, groupType) {
|
|
2227
|
+
if (snapshotMode) return null;
|
|
2217
2228
|
if (!canDeleteItem(item, groupType)) return null;
|
|
2218
2229
|
return _jsx(Tooltip, {
|
|
2219
2230
|
title: "\u5220\u9664",
|
|
@@ -2266,8 +2277,8 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
2266
2277
|
trigger: 'hover'
|
|
2267
2278
|
});
|
|
2268
2279
|
};
|
|
2269
|
-
var showFormulaListZoom = !embedded && enableZoom;
|
|
2270
|
-
var showCopyTools = !embedded && isCopy && caseList.length > 0;
|
|
2280
|
+
var showFormulaListZoom = !snapshotMode && !embedded && enableZoom;
|
|
2281
|
+
var showCopyTools = !snapshotMode && !embedded && isCopy && caseList.length > 0;
|
|
2271
2282
|
var renderFormulaListZoomButton = function renderFormulaListZoomButton() {
|
|
2272
2283
|
return _jsx(Tooltip, {
|
|
2273
2284
|
title: "\u7F16\u8F91",
|
|
@@ -2332,7 +2343,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
2332
2343
|
children: renderFormulaListZoomButton()
|
|
2333
2344
|
}), caseList.map(function (item, itemIndex) {
|
|
2334
2345
|
return renderItemShell(item, itemIndex, 'single');
|
|
2335
|
-
}), Array.from(caseList).length < 1 && selectOperator({
|
|
2346
|
+
}), !snapshotMode && Array.from(caseList).length < 1 && selectOperator({
|
|
2336
2347
|
triggerElement: function triggerElement() {
|
|
2337
2348
|
return _jsx(Tooltip, {
|
|
2338
2349
|
title: "\u6DFB\u52A0",
|
|
@@ -2346,7 +2357,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
2346
2357
|
ind: -1,
|
|
2347
2358
|
position: 'add',
|
|
2348
2359
|
trigger: 'click'
|
|
2349
|
-
}), !embedded && copyDom(-1, false), !embedded && showPreview && _jsx("div", {
|
|
2360
|
+
}), !embedded && !snapshotMode && copyDom(-1, false), !snapshotMode && !embedded && showPreview && _jsx("div", {
|
|
2350
2361
|
className: cx("mb-2 font-bold uppercase tracking-wider preview-box"),
|
|
2351
2362
|
style: {
|
|
2352
2363
|
fontSize: 12,
|
|
@@ -2376,7 +2387,7 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
2376
2387
|
onClick: showFormulaDiff,
|
|
2377
2388
|
children: "\u5BF9\u6BD4\u7ED3\u679C"
|
|
2378
2389
|
})]
|
|
2379
|
-
}), _jsx("div", {
|
|
2390
|
+
}), !snapshotMode && _jsx("div", {
|
|
2380
2391
|
className: 'errorMsg mt-2',
|
|
2381
2392
|
children: errorInfo.isError && _jsxs(_Fragment, {
|
|
2382
2393
|
children: ["\u63D0\u793A\uFF1A", _jsx("span", {
|
|
@@ -6,7 +6,8 @@ interface PropsType {
|
|
|
6
6
|
table?: Partial<MetaData_TableType>;
|
|
7
7
|
metaIndex?: number;
|
|
8
8
|
groupIndex: number;
|
|
9
|
+
readonly?: boolean;
|
|
9
10
|
onChange: (record: MetaData_ColumnsType[], newMetaList?: any[]) => void;
|
|
10
11
|
}
|
|
11
|
-
declare const SelectColumn: ({ data, table, metaIndex, groupIndex, onChange }: PropsType) => React.JSX.Element;
|
|
12
|
+
declare const SelectColumn: ({ data, table, metaIndex, groupIndex, readonly, onChange, }: PropsType) => React.JSX.Element;
|
|
12
13
|
export default SelectColumn;
|
|
@@ -22,6 +22,8 @@ var SelectColumn = function SelectColumn(_ref) {
|
|
|
22
22
|
table = _ref.table,
|
|
23
23
|
metaIndex = _ref.metaIndex,
|
|
24
24
|
groupIndex = _ref.groupIndex,
|
|
25
|
+
_ref$readonly = _ref.readonly,
|
|
26
|
+
readonly = _ref$readonly === void 0 ? false : _ref$readonly,
|
|
25
27
|
onChange = _ref.onChange;
|
|
26
28
|
var _useState = useState([]),
|
|
27
29
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -88,6 +90,7 @@ var SelectColumn = function SelectColumn(_ref) {
|
|
|
88
90
|
}, [isAllSelect]);
|
|
89
91
|
function onSelect(columns, newMetaList) {
|
|
90
92
|
var useColumnsDirectly = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
93
|
+
if (readonly) return;
|
|
91
94
|
var originalData = cloneDeep(originList);
|
|
92
95
|
var mergedColumns = useColumnsDirectly ? cloneDeep(columns) : originalData.map(function (item) {
|
|
93
96
|
var match = columns.find(function (col) {
|
|
@@ -100,6 +103,7 @@ var SelectColumn = function SelectColumn(_ref) {
|
|
|
100
103
|
typeof onChange === 'function' && onChange(mergedColumns, newMetaList);
|
|
101
104
|
}
|
|
102
105
|
var onChangeFieldAlias = function onChangeFieldAlias(val, i) {
|
|
106
|
+
if (readonly) return;
|
|
103
107
|
var fieldAlias = val || '';
|
|
104
108
|
var currentColumn = columns[i];
|
|
105
109
|
Modal.confirm({
|
|
@@ -177,11 +181,15 @@ var SelectColumn = function SelectColumn(_ref) {
|
|
|
177
181
|
return _jsx("div", {
|
|
178
182
|
className: "Sqb-SelectColumn--box",
|
|
179
183
|
children: _jsxs("div", {
|
|
184
|
+
style: readonly ? {
|
|
185
|
+
cursor: 'default'
|
|
186
|
+
} : undefined,
|
|
180
187
|
children: [_jsxs("div", {
|
|
181
188
|
className: 'Sqb-SelectColumn--header pt-2',
|
|
182
189
|
children: [_jsx("div", {
|
|
183
190
|
className: cx("SelectColumn-border mb-2 pb-2 px-2 flex items-center", {}),
|
|
184
191
|
onClick: function onClick() {
|
|
192
|
+
if (readonly) return;
|
|
185
193
|
var newColumns = columns.map(function (v) {
|
|
186
194
|
return _objectSpread(_objectSpread({}, v), {}, {
|
|
187
195
|
select: !isAllSelect
|
|
@@ -209,6 +217,7 @@ var SelectColumn = function SelectColumn(_ref) {
|
|
|
209
217
|
return _jsxs("div", {
|
|
210
218
|
className: 'pb-2 px-2 flex items-center',
|
|
211
219
|
onClick: function onClick() {
|
|
220
|
+
if (readonly) return;
|
|
212
221
|
var newColumns = cloneDeep(columns);
|
|
213
222
|
newColumns[i].select = !v.select;
|
|
214
223
|
onSelect(newColumns);
|
|
@@ -218,7 +227,7 @@ var SelectColumn = function SelectColumn(_ref) {
|
|
|
218
227
|
children: _jsx(SelectIcon, {})
|
|
219
228
|
}) : _jsx("div", {
|
|
220
229
|
className: 'no-select mr-2'
|
|
221
|
-
}), v.name, v.name_zh ? " \uFF08".concat(v.name_zh, "\uFF09") : '', v.fieldAlias ? " as ".concat(v.fieldAlias) : '', store.fieldEnableAlias && _jsx(Tooltip, {
|
|
230
|
+
}), v.name, v.name_zh ? " \uFF08".concat(v.name_zh, "\uFF09") : '', v.fieldAlias ? " as ".concat(v.fieldAlias) : '', store.fieldEnableAlias && !readonly && _jsx(Tooltip, {
|
|
222
231
|
title: __('SqlQueryBuilder.alias'),
|
|
223
232
|
children: _jsx(Button, {
|
|
224
233
|
className: ':Sqb-TableName-as',
|
|
@@ -42,6 +42,7 @@ interface PropsType {
|
|
|
42
42
|
showNextBtn?: boolean;
|
|
43
43
|
nextBtnText?: string;
|
|
44
44
|
onNextStep?: () => void;
|
|
45
|
+
readonly?: boolean;
|
|
45
46
|
}
|
|
46
|
-
declare const SelectJoinColumn: ({ data, value: _value, theme, onSelect, isGroup, onGroup, didUpdate, multiple, showNextBtn, nextBtnText, onNextStep, }: PropsType) => React.JSX.Element;
|
|
47
|
+
declare const SelectJoinColumn: ({ data, value: _value, theme, onSelect, isGroup, onGroup, didUpdate, multiple, showNextBtn, nextBtnText, onNextStep, readonly, }: PropsType) => React.JSX.Element;
|
|
47
48
|
export default SelectJoinColumn;
|
|
@@ -49,7 +49,9 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
49
49
|
showNextBtn = _ref$showNextBtn === void 0 ? false : _ref$showNextBtn,
|
|
50
50
|
_ref$nextBtnText = _ref.nextBtnText,
|
|
51
51
|
nextBtnText = _ref$nextBtnText === void 0 ? __('metabase.nextBtn') : _ref$nextBtnText,
|
|
52
|
-
onNextStep = _ref.onNextStep
|
|
52
|
+
onNextStep = _ref.onNextStep,
|
|
53
|
+
_ref$readonly = _ref.readonly,
|
|
54
|
+
readonly = _ref$readonly === void 0 ? false : _ref$readonly;
|
|
53
55
|
var store = useStore();
|
|
54
56
|
var selectedTableUuid = (_value === null || _value === void 0 || (_value$ = _value[0]) === null || _value$ === void 0 ? void 0 : _value$.tableId) === SummarizeAlias ? '' : (_value === null || _value === void 0 || (_value$2 = _value[0]) === null || _value$2 === void 0 ? void 0 : _value$2.tableUuid) || '';
|
|
55
57
|
var _useState = useState(_value),
|
|
@@ -262,11 +264,12 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
262
264
|
return matchedColumn ? syncSelectedFieldByColumn(field, matchedColumn, tableItem) : field;
|
|
263
265
|
});
|
|
264
266
|
setValue(syncedValue);
|
|
265
|
-
if (!isEqual(syncedValue, _value || [])) {
|
|
267
|
+
if (!readonly && !isEqual(syncedValue, _value || [])) {
|
|
266
268
|
onSelect === null || onSelect === void 0 || onSelect(syncedValue, getQuotes(syncedValue));
|
|
267
269
|
}
|
|
268
270
|
}, [data, _value]);
|
|
269
271
|
var changeValue = function changeValue(tableUuid, val) {
|
|
272
|
+
if (readonly) return;
|
|
270
273
|
if (!multiple) {
|
|
271
274
|
var _data = val ? [val] : [];
|
|
272
275
|
setValue(_data);
|
|
@@ -512,7 +515,7 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
512
515
|
}, (tableUuid || tableAlias) + '' + i);
|
|
513
516
|
})]
|
|
514
517
|
})
|
|
515
|
-
}), showNextBtn && multiple && _jsx(Button, {
|
|
518
|
+
}), !readonly && showNextBtn && multiple && _jsx(Button, {
|
|
516
519
|
block: true,
|
|
517
520
|
disabled: (value === null || value === void 0 ? void 0 : value.length) < 1,
|
|
518
521
|
primary: true,
|
|
@@ -17,6 +17,7 @@ interface PropsType {
|
|
|
17
17
|
onChange: (reocrd: ValueType) => void;
|
|
18
18
|
didUpdate?: Function;
|
|
19
19
|
ignoreGroupByType?: boolean;
|
|
20
|
+
readonly?: boolean;
|
|
20
21
|
}
|
|
21
|
-
declare const SelectSummarize: ({ data, value, onChange, didUpdate, ignoreGroupByType }: PropsType) => React.JSX.Element;
|
|
22
|
+
declare const SelectSummarize: ({ data, value, onChange, didUpdate, ignoreGroupByType, readonly, }: PropsType) => React.JSX.Element;
|
|
22
23
|
export default SelectSummarize;
|
|
@@ -77,7 +77,8 @@ var SelectSummarize = function SelectSummarize(_ref) {
|
|
|
77
77
|
value = _ref.value,
|
|
78
78
|
onChange = _ref.onChange,
|
|
79
79
|
didUpdate = _ref.didUpdate,
|
|
80
|
-
ignoreGroupByType = _ref.ignoreGroupByType
|
|
80
|
+
ignoreGroupByType = _ref.ignoreGroupByType,
|
|
81
|
+
readonly = _ref.readonly;
|
|
81
82
|
var _useState = useState(value.condition),
|
|
82
83
|
_useState2 = _slicedToArray(_useState, 2),
|
|
83
84
|
condition = _useState2[0],
|
|
@@ -113,6 +114,7 @@ var SelectSummarize = function SelectSummarize(_ref) {
|
|
|
113
114
|
atoms = _useState4[0],
|
|
114
115
|
setAtoms = _useState4[1];
|
|
115
116
|
function goPrevPage() {
|
|
117
|
+
if (readonly) return;
|
|
116
118
|
setCondition('');
|
|
117
119
|
}
|
|
118
120
|
function getFormulaSummary() {
|
|
@@ -227,7 +229,7 @@ var SelectSummarize = function SelectSummarize(_ref) {
|
|
|
227
229
|
})
|
|
228
230
|
})
|
|
229
231
|
})
|
|
230
|
-
}), _jsx("div", {
|
|
232
|
+
}), !readonly && _jsx("div", {
|
|
231
233
|
className: 'Sqb-SelectSummarize-formula-footer',
|
|
232
234
|
children: _jsx(Button, {
|
|
233
235
|
primary: true,
|
|
@@ -273,6 +275,7 @@ var SelectSummarize = function SelectSummarize(_ref) {
|
|
|
273
275
|
active: condition === v.name
|
|
274
276
|
}),
|
|
275
277
|
onClick: function onClick() {
|
|
278
|
+
if (readonly) return;
|
|
276
279
|
if (~Special.indexOf(v.name)) {
|
|
277
280
|
setAtoms([]);
|
|
278
281
|
handleSelect(v.name, {});
|
|
@@ -34,6 +34,7 @@ var Metabase = function Metabase(props) {
|
|
|
34
34
|
rightClickMenu = _props$rightClickMenu === void 0 ? EMPTY_ARRAY : _props$rightClickMenu,
|
|
35
35
|
onRightClickMenuClick = props.onRightClickMenuClick;
|
|
36
36
|
var store = useStore();
|
|
37
|
+
var readonlyMode = readonly || store.snapshotMode;
|
|
37
38
|
var _useState = useState(false),
|
|
38
39
|
_useState2 = _slicedToArray(_useState, 2),
|
|
39
40
|
saveLoading = _useState2[0],
|
|
@@ -153,7 +154,18 @@ var Metabase = function Metabase(props) {
|
|
|
153
154
|
store.setRightClickMenu(rightClickMenu || EMPTY_ARRAY);
|
|
154
155
|
store.setRightClickMenuClick(onRightClickMenuClick);
|
|
155
156
|
}, [rightClickMenu, onRightClickMenuClick]);
|
|
157
|
+
useEffect(function () {
|
|
158
|
+
if (!readonlyMode) return;
|
|
159
|
+
store.setPopup({
|
|
160
|
+
visible: false
|
|
161
|
+
});
|
|
162
|
+
store.setPopup2({
|
|
163
|
+
visible: false
|
|
164
|
+
});
|
|
165
|
+
store.setRightClickMenuState(null);
|
|
166
|
+
}, [readonlyMode]);
|
|
156
167
|
var copy = function copy() {
|
|
168
|
+
if (readonlyMode) return null;
|
|
157
169
|
return _jsxs(Space, {
|
|
158
170
|
children: [moduleCopy && _jsx(_Fragment, {
|
|
159
171
|
children: _jsx(Tooltip, {
|
|
@@ -213,10 +225,22 @@ var Metabase = function Metabase(props) {
|
|
|
213
225
|
})]
|
|
214
226
|
});
|
|
215
227
|
};
|
|
228
|
+
var stopReadonlyInteraction = function stopReadonlyInteraction(e) {
|
|
229
|
+
var _target$closest;
|
|
230
|
+
if (!readonlyMode) return;
|
|
231
|
+
var target = e.target;
|
|
232
|
+
if (target !== null && target !== void 0 && (_target$closest = target.closest) !== null && _target$closest !== void 0 && _target$closest.call(target, '[data-sqb-snapshot-allow="true"]')) return;
|
|
233
|
+
e.preventDefault();
|
|
234
|
+
e.stopPropagation();
|
|
235
|
+
};
|
|
216
236
|
return _jsx(VisualBox, {
|
|
217
237
|
ref: store.popupContainer,
|
|
218
238
|
onContextMenu: function onContextMenu(e) {
|
|
219
|
-
|
|
239
|
+
if (readonlyMode) {
|
|
240
|
+
e.preventDefault();
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
openSqbRightClickMenu(store, e);
|
|
220
244
|
},
|
|
221
245
|
children: _jsxs("div", {
|
|
222
246
|
className: 'Sqb',
|
|
@@ -228,6 +252,8 @@ var Metabase = function Metabase(props) {
|
|
|
228
252
|
if (v.type === 'union' && v.union) {
|
|
229
253
|
return _jsx("div", {
|
|
230
254
|
className: cx("Sqb-list"),
|
|
255
|
+
onMouseDownCapture: stopReadonlyInteraction,
|
|
256
|
+
onClickCapture: stopReadonlyInteraction,
|
|
231
257
|
children: _jsx(Union, {
|
|
232
258
|
union: v.union,
|
|
233
259
|
meta: v,
|
|
@@ -237,6 +263,8 @@ var Metabase = function Metabase(props) {
|
|
|
237
263
|
}
|
|
238
264
|
return _jsx("div", {
|
|
239
265
|
className: cx("Sqb-list"),
|
|
266
|
+
onMouseDownCapture: stopReadonlyInteraction,
|
|
267
|
+
onClickCapture: stopReadonlyInteraction,
|
|
240
268
|
children: v === null || v === void 0 || (_v$list2 = v.list) === null || _v$list2 === void 0 ? void 0 : _v$list2.map(function (meta) {
|
|
241
269
|
var metaType = meta.type,
|
|
242
270
|
metaKey = meta.metaKey,
|
|
@@ -249,7 +277,7 @@ var Metabase = function Metabase(props) {
|
|
|
249
277
|
}, metaKey);
|
|
250
278
|
})
|
|
251
279
|
}, 'group' + index);
|
|
252
|
-
}), !
|
|
280
|
+
}), !readonlyMode && typeof onOk === 'function' ? _jsx(Button, {
|
|
253
281
|
type: 'primary',
|
|
254
282
|
className: ":Sqb-btn",
|
|
255
283
|
loading: saveLoading,
|