ronds-metadata 1.0.57 → 1.0.60
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.
@@ -1,3 +1,5 @@
|
|
1
|
+
import "antd/es/popconfirm/style";
|
2
|
+
import _Popconfirm from "antd/es/popconfirm";
|
1
3
|
import "antd/es/divider/style";
|
2
4
|
import _Divider from "antd/es/divider";
|
3
5
|
import "antd/es/button/style";
|
@@ -38,6 +40,13 @@ var EditableAction = function EditableAction(props) {
|
|
38
40
|
type: 'onSingleSave',
|
39
41
|
payload: record
|
40
42
|
});
|
43
|
+
editableStream.next({
|
44
|
+
type: 'editCellKey',
|
45
|
+
payload: {
|
46
|
+
dataIndex: undefined,
|
47
|
+
rowIndex: undefined
|
48
|
+
}
|
49
|
+
});
|
41
50
|
};
|
42
51
|
|
43
52
|
var onDelete = function onDelete() {
|
@@ -80,13 +89,22 @@ var EditableAction = function EditableAction(props) {
|
|
80
89
|
title: '确定'
|
81
90
|
}), /*#__PURE__*/React.createElement(_Divider, {
|
82
91
|
type: "vertical"
|
83
|
-
}))), /*#__PURE__*/React.createElement(
|
92
|
+
}))), /*#__PURE__*/React.createElement(_Popconfirm, {
|
93
|
+
placement: 'left',
|
94
|
+
title: "\u786E\u8BA4\u5220\u9664\u8BE5\u6761\u6570\u636E\uFF1F",
|
95
|
+
onConfirm: onDelete,
|
96
|
+
onCancel: function onCancel(e) {
|
97
|
+
e.stopPropagation();
|
98
|
+
},
|
99
|
+
okText: "\u786E\u5B9A",
|
100
|
+
cancelText: "\u53D6\u6D88"
|
101
|
+
}, /*#__PURE__*/React.createElement(_Button, {
|
84
102
|
type: "link",
|
85
103
|
size: "small",
|
86
104
|
icon: /*#__PURE__*/React.createElement(DeleteOutlined, null),
|
87
105
|
onClick: onDelete,
|
88
106
|
title: '删除'
|
89
|
-
}));
|
107
|
+
})));
|
90
108
|
};
|
91
109
|
|
92
110
|
export default EditableAction;
|
@@ -1,4 +1,6 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
|
+
import "antd/es/popconfirm/style";
|
3
|
+
import _Popconfirm from "antd/es/popconfirm";
|
2
4
|
import "antd/es/popover/style";
|
3
5
|
import _Popover from "antd/es/popover";
|
4
6
|
import "antd/es/button/style";
|
@@ -70,6 +72,16 @@ var EditableHeardCell = function EditableHeardCell(props) {
|
|
70
72
|
};
|
71
73
|
};
|
72
74
|
|
75
|
+
var onDeleteColumn = function onDeleteColumn() {
|
76
|
+
setVisible(false);
|
77
|
+
editableStream.next({
|
78
|
+
type: 'onDeleteColumn',
|
79
|
+
payload: {
|
80
|
+
dataIndex: dataIndex
|
81
|
+
}
|
82
|
+
});
|
83
|
+
};
|
84
|
+
|
73
85
|
var content = /*#__PURE__*/React.createElement("div", {
|
74
86
|
style: {
|
75
87
|
width: '100px'
|
@@ -129,10 +141,19 @@ var EditableHeardCell = function EditableHeardCell(props) {
|
|
129
141
|
icon: /*#__PURE__*/React.createElement(PlusSquareOutlined, null)
|
130
142
|
}))), isAddColumn && /*#__PURE__*/React.createElement("div", {
|
131
143
|
className: "".concat(editConfig.editHeardCellKey === dataIndex ? 'editable-th-hover-delete' : 'display-none')
|
144
|
+
}, /*#__PURE__*/React.createElement(_Popconfirm, {
|
145
|
+
placement: 'left',
|
146
|
+
title: "\u786E\u8BA4\u5220\u9664\u8BE5\u6761\u5217\uFF1F",
|
147
|
+
onConfirm: onDeleteColumn,
|
148
|
+
onCancel: function onCancel(e) {
|
149
|
+
e.stopPropagation();
|
150
|
+
},
|
151
|
+
okText: "\u786E\u5B9A",
|
152
|
+
cancelText: "\u53D6\u6D88"
|
132
153
|
}, /*#__PURE__*/React.createElement(_Button, {
|
133
154
|
type: "link",
|
134
155
|
icon: /*#__PURE__*/React.createElement(DeleteOutlined, null)
|
135
|
-
})), /*#__PURE__*/React.createElement("div", {
|
156
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
136
157
|
onMouseOver: onMouseOver,
|
137
158
|
onMouseLeave: onMouseLeave
|
138
159
|
}, children)));
|
@@ -129,6 +129,10 @@ var Editable = function Editable(props) {
|
|
129
129
|
processAddColumnsData(data.payload);
|
130
130
|
break;
|
131
131
|
|
132
|
+
case 'onDeleteColumn':
|
133
|
+
processDeleteColumnsData(data.payload);
|
134
|
+
break;
|
135
|
+
|
132
136
|
case 'onSingleSave':
|
133
137
|
if (lastValueRef.current && lastValueRef.current.rowIdx === data.payload._rowKey_) {
|
134
138
|
onRowConfirm && onRowConfirm({
|
@@ -178,6 +182,12 @@ var Editable = function Editable(props) {
|
|
178
182
|
|
179
183
|
setEditRowkey(_editRowKey);
|
180
184
|
editRowKeyRef.current = _editRowKey;
|
185
|
+
editableStream.next({
|
186
|
+
type: 'editRowKey',
|
187
|
+
payload: {
|
188
|
+
_rowkey_: undefined
|
189
|
+
}
|
190
|
+
});
|
181
191
|
return;
|
182
192
|
}
|
183
193
|
|
@@ -214,6 +224,16 @@ var Editable = function Editable(props) {
|
|
214
224
|
|
215
225
|
_columns.splice(idx + 1, 0, _objectSpread(_objectSpread({}, _columns[0]), obj));
|
216
226
|
|
227
|
+
setAddColumns(_toConsumableArray(_columns));
|
228
|
+
addColumnsRef.current = _columns; // editableStream.next({ type: 'editHeardCellKey', payload: undefined });
|
229
|
+
};
|
230
|
+
|
231
|
+
var processDeleteColumnsData = function processDeleteColumnsData(data) {
|
232
|
+
var _columns = addColumnsRef.current.length > 0 ? addColumnsRef.current : columns;
|
233
|
+
|
234
|
+
_columns = _columns.filter(function (v) {
|
235
|
+
return v.dataIndex != data.dataIndex;
|
236
|
+
});
|
217
237
|
setAddColumns(_toConsumableArray(_columns));
|
218
238
|
addColumnsRef.current = _columns; // editableStream.next({ type: 'editHeardCellKey', payload: undefined });
|
219
239
|
}; // 返回stream的实例
|
@@ -311,6 +331,12 @@ var Editable = function Editable(props) {
|
|
311
331
|
|
312
332
|
var onAddRow = function onAddRow() {
|
313
333
|
if (defaultValue) {
|
334
|
+
if (type === 'freedom' && editRowKey) {
|
335
|
+
_message.warn('请先保存正在编辑的行');
|
336
|
+
|
337
|
+
return;
|
338
|
+
}
|
339
|
+
|
314
340
|
var _records = recordsRef.current;
|
315
341
|
|
316
342
|
if (addPosition === 'top') {
|