cloud-b2b 1.1.5 → 1.1.8
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/es/Area/Area.js +1 -1
- package/es/NumberInput/NumberInput.js +2 -2
- package/es/SuperForm2/SuperForm.js +2 -2
- package/es/SuperTable2/SuperTable2.js +49 -30
- package/lib/Area/Area.js +1 -1
- package/lib/NumberInput/NumberInput.js +2 -2
- package/lib/SuperForm2/SuperForm.js +2 -2
- package/lib/SuperTable2/SuperTable2.js +50 -30
- package/package.json +1 -1
package/es/Area/Area.js
CHANGED
|
@@ -151,7 +151,7 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
151
151
|
onSearch: _bindInstanceProperty(_context2 = _this2.onSearch).call(_context2, _this2, item.key, item, parentKey),
|
|
152
152
|
onChange: _bindInstanceProperty(_context3 = _this2.onChange).call(_context3, _this2, item.key),
|
|
153
153
|
options: childOptions,
|
|
154
|
-
value: value[item.key].title ? value[item.key].title : value[item.key],
|
|
154
|
+
value: value[item.key] && value[item.key].title ? value[item.key].title : value[item.key],
|
|
155
155
|
type: readonly ? 'readonly' : item.type
|
|
156
156
|
});
|
|
157
157
|
|
|
@@ -166,9 +166,9 @@ var NumberInput = /*#__PURE__*/function (_React$Component) {
|
|
|
166
166
|
if (!invalid) {
|
|
167
167
|
onChange && onChange(value);
|
|
168
168
|
}
|
|
169
|
-
}
|
|
170
169
|
|
|
171
|
-
|
|
170
|
+
onBlur && onBlur(event); //有输入才触发外部失去焦点事件,避免非必要请求
|
|
171
|
+
}
|
|
172
172
|
});
|
|
173
173
|
|
|
174
174
|
_defineProperty(_assertThisInitialized(_this), "hasSpecialChar", function (value) {
|
|
@@ -43,7 +43,7 @@ import helper from '../helper';
|
|
|
43
43
|
import Control, { getTitle, makeString } from '../Control';
|
|
44
44
|
import variables from '../variables';
|
|
45
45
|
var FormItem = _Form.Item;
|
|
46
|
-
var defaultSize = '
|
|
46
|
+
var defaultSize = 'large';
|
|
47
47
|
var defaultColNum = 4;
|
|
48
48
|
var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'captcha', 'area', 'uploadImg', 'cascader'];
|
|
49
49
|
/**
|
|
@@ -133,7 +133,7 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
|
133
133
|
* checkable:是否显示checkbox选择框
|
|
134
134
|
* onOpenChange:控制日期框显示隐藏回调func(key, open)
|
|
135
135
|
* onAreaSearch:联级选择器触发,原型为func(key - 当前联级key, title - 输入值, parentKey - 主体联级key)
|
|
136
|
-
*
|
|
136
|
+
* onFileChange:上传组件触发,原型为func(key,{fileList, fileDeleteList})
|
|
137
137
|
*/
|
|
138
138
|
|
|
139
139
|
|
|
@@ -55,6 +55,7 @@ import SuperTableCell from './SuperTableCell';
|
|
|
55
55
|
import fixed from '../SuperTable/fixed';
|
|
56
56
|
import SuperToolbar from '../SuperToolbar';
|
|
57
57
|
import variables from '../variables';
|
|
58
|
+
import helper from '../helper';
|
|
58
59
|
var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select', //存储value
|
|
59
60
|
'selectText', //存储title
|
|
60
61
|
'search', 'searchText', 'selectSearch', //多选下拉搜索
|
|
@@ -89,7 +90,8 @@ var ColType = {
|
|
|
89
90
|
/**
|
|
90
91
|
* onCheck:点击复选框时触发,原型func(rowIndex, keyName, checked)
|
|
91
92
|
* onContentChange: 输入框内容改变时触发,原型为function(rowIndex, keyName, value)
|
|
92
|
-
*
|
|
93
|
+
* onBlur: 输入框失去焦点时触发,原型为function(rowIndex, keyName, value)
|
|
94
|
+
* onSearch:search组件输入内容时触发,原型为function(rowIndex, keyName, value, col)
|
|
93
95
|
* onLink: 点击超链接时触发,原型为function(keyName, rowIndex, item)
|
|
94
96
|
* onAdd:点击+号时触发,原型为function(keyName)
|
|
95
97
|
* onRenderCustom:(废弃)用于渲染type为custom类型的单元格,原型为function(rowIndex, keyName, value,props)
|
|
@@ -100,6 +102,7 @@ var CallbackType = {
|
|
|
100
102
|
onExitValid: PropTypes.func,
|
|
101
103
|
onCheck: PropTypes.func,
|
|
102
104
|
onContentChange: PropTypes.func,
|
|
105
|
+
onBlur: PropTypes.func,
|
|
103
106
|
onSearch: PropTypes.func,
|
|
104
107
|
onLink: PropTypes.func,
|
|
105
108
|
onAdd: PropTypes.func,
|
|
@@ -185,8 +188,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
185
188
|
};
|
|
186
189
|
});
|
|
187
190
|
|
|
188
|
-
_defineProperty(_assertThisInitialized(_this), "onBlur", function () {
|
|
189
|
-
|
|
191
|
+
_defineProperty(_assertThisInitialized(_this), "onBlur", function (key, rowIndex) {
|
|
192
|
+
return function (value) {
|
|
193
|
+
var _ref7 = _this.props.callback || {},
|
|
194
|
+
onBlur = _ref7.onBlur;
|
|
195
|
+
|
|
196
|
+
_this.closeValid();
|
|
197
|
+
|
|
198
|
+
onBlur && onBlur(_this.getIndex(rowIndex), key, value);
|
|
199
|
+
};
|
|
190
200
|
});
|
|
191
201
|
|
|
192
202
|
_defineProperty(_assertThisInitialized(_this), "closeValid", function () {
|
|
@@ -248,7 +258,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
248
258
|
options: _this.getOptions(key, options, index),
|
|
249
259
|
onChange: _this.onChange(key, index),
|
|
250
260
|
onSearch: _this.onSearch(key, index, config),
|
|
251
|
-
onBlur: _this.onBlur
|
|
261
|
+
onBlur: _this.onBlur(key, index)
|
|
252
262
|
};
|
|
253
263
|
|
|
254
264
|
if (showRowAdd && _Array$isArray(isRequired) && _includesInstanceProperty(isRequired).call(isRequired, key)) {
|
|
@@ -328,8 +338,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
328
338
|
var split = index2 === list.length - 1 ? '' : ',';
|
|
329
339
|
|
|
330
340
|
var onClick = function onClick() {
|
|
331
|
-
var
|
|
332
|
-
onLink =
|
|
341
|
+
var _ref8 = _this.props.callback || {},
|
|
342
|
+
onLink = _ref8.onLink;
|
|
333
343
|
|
|
334
344
|
onLink && onLink(col.key, index, item2);
|
|
335
345
|
};
|
|
@@ -343,8 +353,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
343
353
|
var title = typeof col.link === 'string' ? col.link : value;
|
|
344
354
|
|
|
345
355
|
var onClick = function onClick() {
|
|
346
|
-
var
|
|
347
|
-
onLink =
|
|
356
|
+
var _ref9 = _this.props.callback || {},
|
|
357
|
+
onLink = _ref9.onLink;
|
|
348
358
|
|
|
349
359
|
onLink && onLink(col.key, index, record);
|
|
350
360
|
};
|
|
@@ -499,12 +509,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
499
509
|
}
|
|
500
510
|
});
|
|
501
511
|
|
|
502
|
-
_defineProperty(_assertThisInitialized(_this), "getColumnTitle", function (
|
|
503
|
-
var required =
|
|
504
|
-
title =
|
|
505
|
-
type =
|
|
506
|
-
key =
|
|
507
|
-
showAdd =
|
|
512
|
+
_defineProperty(_assertThisInitialized(_this), "getColumnTitle", function (_ref10) {
|
|
513
|
+
var required = _ref10.required,
|
|
514
|
+
title = _ref10.title,
|
|
515
|
+
type = _ref10.type,
|
|
516
|
+
key = _ref10.key,
|
|
517
|
+
showAdd = _ref10.showAdd;
|
|
508
518
|
|
|
509
519
|
if (type === 'checkbox') {
|
|
510
520
|
var status = _this.getCheckedStatus(key);
|
|
@@ -520,9 +530,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
520
530
|
}
|
|
521
531
|
});
|
|
522
532
|
|
|
523
|
-
_defineProperty(_assertThisInitialized(_this), "getColumnClassName", function (
|
|
524
|
-
var type =
|
|
525
|
-
align =
|
|
533
|
+
_defineProperty(_assertThisInitialized(_this), "getColumnClassName", function (_ref11) {
|
|
534
|
+
var type = _ref11.type,
|
|
535
|
+
align = _ref11.align;
|
|
526
536
|
|
|
527
537
|
if (type === 'index' || type === 'checkbox') {
|
|
528
538
|
return 'ant-table-selection-column';
|
|
@@ -543,8 +553,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
543
553
|
var readonly = _this.props.readonly;
|
|
544
554
|
return _mapInstanceProperty(_context8 = _filterInstanceProperty(cols).call(cols, function (col) {
|
|
545
555
|
return !col.hide;
|
|
546
|
-
})).call(_context8, function (
|
|
547
|
-
var col = _extends({},
|
|
556
|
+
})).call(_context8, function (_ref12, index) {
|
|
557
|
+
var col = _extends({}, _ref12);
|
|
548
558
|
|
|
549
559
|
col.className = _this.getColumnClassName(col);
|
|
550
560
|
col.title = _this.getColumnTitle(col);
|
|
@@ -570,12 +580,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
570
580
|
|
|
571
581
|
_defineProperty(_assertThisInitialized(_this), "getDataSource", function (items, cols) {
|
|
572
582
|
return _mapInstanceProperty(items).call(items, function (item, index) {
|
|
573
|
-
return _reduceInstanceProperty(cols).call(cols, function (result,
|
|
583
|
+
return _reduceInstanceProperty(cols).call(cols, function (result, _ref13) {
|
|
574
584
|
var _context9;
|
|
575
585
|
|
|
576
|
-
var key =
|
|
577
|
-
type =
|
|
578
|
-
options =
|
|
586
|
+
var key = _ref13.key,
|
|
587
|
+
type = _ref13.type,
|
|
588
|
+
options = _ref13.options;
|
|
579
589
|
|
|
580
590
|
if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || _Array$isArray(item.isReadonly) && !_includesInstanceProperty(_context9 = item.isReadonly).call(_context9, key))) {
|
|
581
591
|
result[key] = item[key];
|
|
@@ -624,7 +634,11 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
624
634
|
pagination = _this$props3$paginati === void 0 ? false : _this$props3$paginati,
|
|
625
635
|
_this$props3$isEmphas = _this$props3.isEmphasized,
|
|
626
636
|
isEmphasized = _this$props3$isEmphas === void 0 ? false : _this$props3$isEmphas,
|
|
627
|
-
maxHeight = _this$props3.maxHeight
|
|
637
|
+
maxHeight = _this$props3.maxHeight,
|
|
638
|
+
_this$props3$expanded = _this$props3.expandedRowRender,
|
|
639
|
+
expandedRowRender = _this$props3$expanded === void 0 ? undefined : _this$props3$expanded,
|
|
640
|
+
_this$props3$onExpand = _this$props3.onExpand,
|
|
641
|
+
onExpand = _this$props3$onExpand === void 0 ? undefined : _this$props3$onExpand;
|
|
628
642
|
|
|
629
643
|
var widthX = _reduceInstanceProperty(_context10 = _filterInstanceProperty(cols).call(cols, function (col) {
|
|
630
644
|
return !col.hide;
|
|
@@ -632,7 +646,13 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
632
646
|
return width += item.width ? item.width : 120;
|
|
633
647
|
}, 0);
|
|
634
648
|
|
|
635
|
-
|
|
649
|
+
var scrollProps = !helper.isEmpty2(expandedRowRender) ? {} : {
|
|
650
|
+
scroll: {
|
|
651
|
+
x: widthX,
|
|
652
|
+
y: maxHeight
|
|
653
|
+
}
|
|
654
|
+
};
|
|
655
|
+
return _objectSpread(_objectSpread({
|
|
636
656
|
className: !isEmphasized ? variables('SuperTable2') : variables('SuperTable2').noTransition,
|
|
637
657
|
columns: _this.getColumns(cols),
|
|
638
658
|
dataSource: _this.getDataSource(items, cols),
|
|
@@ -640,16 +660,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
640
660
|
whiteSpace: 'nowrap'
|
|
641
661
|
}, style),
|
|
642
662
|
size: 'small',
|
|
643
|
-
scroll: {
|
|
644
|
-
x: widthX,
|
|
645
|
-
y: maxHeight
|
|
646
|
-
},
|
|
647
663
|
pagination: pagination,
|
|
648
664
|
footer: footer,
|
|
649
665
|
locale: _this.props.emptyText ? {
|
|
650
666
|
emptyText: _this.props.emptyText
|
|
651
667
|
} : null
|
|
652
|
-
}, _this.getPropsByCheckbox())
|
|
668
|
+
}, _this.getPropsByCheckbox()), {}, {
|
|
669
|
+
expandedRowRender: expandedRowRender,
|
|
670
|
+
onExpand: onExpand
|
|
671
|
+
}, scrollProps);
|
|
653
672
|
});
|
|
654
673
|
|
|
655
674
|
_defineProperty(_assertThisInitialized(_this), "setScroll", function () {
|
package/lib/Area/Area.js
CHANGED
|
@@ -179,7 +179,7 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
179
179
|
onSearch: (0, _bind["default"])(_context2 = _this2.onSearch).call(_context2, _this2, item.key, item, parentKey),
|
|
180
180
|
onChange: (0, _bind["default"])(_context3 = _this2.onChange).call(_context3, _this2, item.key),
|
|
181
181
|
options: childOptions,
|
|
182
|
-
value: value[item.key].title ? value[item.key].title : value[item.key],
|
|
182
|
+
value: value[item.key] && value[item.key].title ? value[item.key].title : value[item.key],
|
|
183
183
|
type: readonly ? 'readonly' : item.type
|
|
184
184
|
});
|
|
185
185
|
|
|
@@ -194,9 +194,9 @@ var NumberInput = /*#__PURE__*/function (_React$Component) {
|
|
|
194
194
|
if (!invalid) {
|
|
195
195
|
onChange && onChange(value);
|
|
196
196
|
}
|
|
197
|
-
}
|
|
198
197
|
|
|
199
|
-
|
|
198
|
+
onBlur && onBlur(event); //有输入才触发外部失去焦点事件,避免非必要请求
|
|
199
|
+
}
|
|
200
200
|
});
|
|
201
201
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "hasSpecialChar", function (value) {
|
|
202
202
|
if ((0, _includes["default"])(value).call(value, '+')) {
|
|
@@ -97,7 +97,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
97
97
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
98
98
|
|
|
99
99
|
var FormItem = _form["default"].Item;
|
|
100
|
-
var defaultSize = '
|
|
100
|
+
var defaultSize = 'large';
|
|
101
101
|
var defaultColNum = 4;
|
|
102
102
|
var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'captcha', 'area', 'uploadImg', 'cascader'];
|
|
103
103
|
/**
|
|
@@ -183,7 +183,7 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
|
183
183
|
* checkable:是否显示checkbox选择框
|
|
184
184
|
* onOpenChange:控制日期框显示隐藏回调func(key, open)
|
|
185
185
|
* onAreaSearch:联级选择器触发,原型为func(key - 当前联级key, title - 输入值, parentKey - 主体联级key)
|
|
186
|
-
*
|
|
186
|
+
* onFileChange:上传组件触发,原型为func(key,{fileList, fileDeleteList})
|
|
187
187
|
*/
|
|
188
188
|
|
|
189
189
|
|
|
@@ -94,6 +94,8 @@ var _SuperToolbar = _interopRequireDefault(require("../SuperToolbar"));
|
|
|
94
94
|
|
|
95
95
|
var _variables = _interopRequireDefault(require("../variables"));
|
|
96
96
|
|
|
97
|
+
var _helper = _interopRequireDefault(require("../helper"));
|
|
98
|
+
|
|
97
99
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (_Array$isArray2(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
98
100
|
|
|
99
101
|
function _unsupportedIterableToArray(o, minLen) { var _context13; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context13 = Object.prototype.toString.call(o)).call(_context13, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -142,7 +144,8 @@ var ColType = {
|
|
|
142
144
|
/**
|
|
143
145
|
* onCheck:点击复选框时触发,原型func(rowIndex, keyName, checked)
|
|
144
146
|
* onContentChange: 输入框内容改变时触发,原型为function(rowIndex, keyName, value)
|
|
145
|
-
*
|
|
147
|
+
* onBlur: 输入框失去焦点时触发,原型为function(rowIndex, keyName, value)
|
|
148
|
+
* onSearch:search组件输入内容时触发,原型为function(rowIndex, keyName, value, col)
|
|
146
149
|
* onLink: 点击超链接时触发,原型为function(keyName, rowIndex, item)
|
|
147
150
|
* onAdd:点击+号时触发,原型为function(keyName)
|
|
148
151
|
* onRenderCustom:(废弃)用于渲染type为custom类型的单元格,原型为function(rowIndex, keyName, value,props)
|
|
@@ -153,6 +156,7 @@ var CallbackType = {
|
|
|
153
156
|
onExitValid: _propTypes["default"].func,
|
|
154
157
|
onCheck: _propTypes["default"].func,
|
|
155
158
|
onContentChange: _propTypes["default"].func,
|
|
159
|
+
onBlur: _propTypes["default"].func,
|
|
156
160
|
onSearch: _propTypes["default"].func,
|
|
157
161
|
onLink: _propTypes["default"].func,
|
|
158
162
|
onAdd: _propTypes["default"].func,
|
|
@@ -231,8 +235,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
231
235
|
onLink && onLink(key, index, _this.props.items[index]);
|
|
232
236
|
};
|
|
233
237
|
});
|
|
234
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onBlur", function () {
|
|
235
|
-
|
|
238
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onBlur", function (key, rowIndex) {
|
|
239
|
+
return function (value) {
|
|
240
|
+
var _ref7 = _this.props.callback || {},
|
|
241
|
+
onBlur = _ref7.onBlur;
|
|
242
|
+
|
|
243
|
+
_this.closeValid();
|
|
244
|
+
|
|
245
|
+
onBlur && onBlur(_this.getIndex(rowIndex), key, value);
|
|
246
|
+
};
|
|
236
247
|
});
|
|
237
248
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "closeValid", function () {
|
|
238
249
|
var _this$props = _this.props,
|
|
@@ -290,7 +301,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
290
301
|
options: _this.getOptions(key, options, index),
|
|
291
302
|
onChange: _this.onChange(key, index),
|
|
292
303
|
onSearch: _this.onSearch(key, index, config),
|
|
293
|
-
onBlur: _this.onBlur
|
|
304
|
+
onBlur: _this.onBlur(key, index)
|
|
294
305
|
};
|
|
295
306
|
|
|
296
307
|
if (showRowAdd && (0, _isArray["default"])(isRequired) && (0, _includes["default"])(isRequired).call(isRequired, key)) {
|
|
@@ -369,8 +380,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
369
380
|
var split = index2 === list.length - 1 ? '' : ',';
|
|
370
381
|
|
|
371
382
|
var onClick = function onClick() {
|
|
372
|
-
var
|
|
373
|
-
onLink =
|
|
383
|
+
var _ref8 = _this.props.callback || {},
|
|
384
|
+
onLink = _ref8.onLink;
|
|
374
385
|
|
|
375
386
|
onLink && onLink(col.key, index, item2);
|
|
376
387
|
};
|
|
@@ -384,8 +395,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
384
395
|
var title = typeof col.link === 'string' ? col.link : value;
|
|
385
396
|
|
|
386
397
|
var onClick = function onClick() {
|
|
387
|
-
var
|
|
388
|
-
onLink =
|
|
398
|
+
var _ref9 = _this.props.callback || {},
|
|
399
|
+
onLink = _ref9.onLink;
|
|
389
400
|
|
|
390
401
|
onLink && onLink(col.key, index, record);
|
|
391
402
|
};
|
|
@@ -535,12 +546,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
535
546
|
return null;
|
|
536
547
|
}
|
|
537
548
|
});
|
|
538
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnTitle", function (
|
|
539
|
-
var required =
|
|
540
|
-
title =
|
|
541
|
-
type =
|
|
542
|
-
key =
|
|
543
|
-
showAdd =
|
|
549
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnTitle", function (_ref10) {
|
|
550
|
+
var required = _ref10.required,
|
|
551
|
+
title = _ref10.title,
|
|
552
|
+
type = _ref10.type,
|
|
553
|
+
key = _ref10.key,
|
|
554
|
+
showAdd = _ref10.showAdd;
|
|
544
555
|
|
|
545
556
|
if (type === 'checkbox') {
|
|
546
557
|
var status = _this.getCheckedStatus(key);
|
|
@@ -555,9 +566,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
555
566
|
}, title, _this.toAdd(key, showAdd));
|
|
556
567
|
}
|
|
557
568
|
});
|
|
558
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnClassName", function (
|
|
559
|
-
var type =
|
|
560
|
-
align =
|
|
569
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnClassName", function (_ref11) {
|
|
570
|
+
var type = _ref11.type,
|
|
571
|
+
align = _ref11.align;
|
|
561
572
|
|
|
562
573
|
if (type === 'index' || type === 'checkbox') {
|
|
563
574
|
return 'ant-table-selection-column';
|
|
@@ -576,8 +587,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
576
587
|
var readonly = _this.props.readonly;
|
|
577
588
|
return (0, _map["default"])(_context8 = (0, _filter["default"])(cols).call(cols, function (col) {
|
|
578
589
|
return !col.hide;
|
|
579
|
-
})).call(_context8, function (
|
|
580
|
-
var col = (0, _extends2["default"])({},
|
|
590
|
+
})).call(_context8, function (_ref12, index) {
|
|
591
|
+
var col = (0, _extends2["default"])({}, _ref12);
|
|
581
592
|
col.className = _this.getColumnClassName(col);
|
|
582
593
|
col.title = _this.getColumnTitle(col);
|
|
583
594
|
col.dataIndex = col.key;
|
|
@@ -601,12 +612,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
601
612
|
});
|
|
602
613
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getDataSource", function (items, cols) {
|
|
603
614
|
return (0, _map["default"])(items).call(items, function (item, index) {
|
|
604
|
-
return (0, _reduce["default"])(cols).call(cols, function (result,
|
|
615
|
+
return (0, _reduce["default"])(cols).call(cols, function (result, _ref13) {
|
|
605
616
|
var _context9;
|
|
606
617
|
|
|
607
|
-
var key =
|
|
608
|
-
type =
|
|
609
|
-
options =
|
|
618
|
+
var key = _ref13.key,
|
|
619
|
+
type = _ref13.type,
|
|
620
|
+
options = _ref13.options;
|
|
610
621
|
|
|
611
622
|
if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || (0, _isArray["default"])(item.isReadonly) && !(0, _includes["default"])(_context9 = item.isReadonly).call(_context9, key))) {
|
|
612
623
|
result[key] = item[key];
|
|
@@ -653,13 +664,23 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
653
664
|
pagination = _this$props3$paginati === void 0 ? false : _this$props3$paginati,
|
|
654
665
|
_this$props3$isEmphas = _this$props3.isEmphasized,
|
|
655
666
|
isEmphasized = _this$props3$isEmphas === void 0 ? false : _this$props3$isEmphas,
|
|
656
|
-
maxHeight = _this$props3.maxHeight
|
|
667
|
+
maxHeight = _this$props3.maxHeight,
|
|
668
|
+
_this$props3$expanded = _this$props3.expandedRowRender,
|
|
669
|
+
expandedRowRender = _this$props3$expanded === void 0 ? undefined : _this$props3$expanded,
|
|
670
|
+
_this$props3$onExpand = _this$props3.onExpand,
|
|
671
|
+
onExpand = _this$props3$onExpand === void 0 ? undefined : _this$props3$onExpand;
|
|
657
672
|
var widthX = (0, _reduce["default"])(_context10 = (0, _filter["default"])(cols).call(cols, function (col) {
|
|
658
673
|
return !col.hide;
|
|
659
674
|
})).call(_context10, function (width, item) {
|
|
660
675
|
return width += item.width ? item.width : 120;
|
|
661
676
|
}, 0);
|
|
662
|
-
|
|
677
|
+
var scrollProps = !_helper["default"].isEmpty2(expandedRowRender) ? {} : {
|
|
678
|
+
scroll: {
|
|
679
|
+
x: widthX,
|
|
680
|
+
y: maxHeight
|
|
681
|
+
}
|
|
682
|
+
};
|
|
683
|
+
return _objectSpread(_objectSpread({
|
|
663
684
|
className: !isEmphasized ? (0, _variables["default"])('SuperTable2') : (0, _variables["default"])('SuperTable2').noTransition,
|
|
664
685
|
columns: _this.getColumns(cols),
|
|
665
686
|
dataSource: _this.getDataSource(items, cols),
|
|
@@ -667,16 +688,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
667
688
|
whiteSpace: 'nowrap'
|
|
668
689
|
}, style),
|
|
669
690
|
size: 'small',
|
|
670
|
-
scroll: {
|
|
671
|
-
x: widthX,
|
|
672
|
-
y: maxHeight
|
|
673
|
-
},
|
|
674
691
|
pagination: pagination,
|
|
675
692
|
footer: footer,
|
|
676
693
|
locale: _this.props.emptyText ? {
|
|
677
694
|
emptyText: _this.props.emptyText
|
|
678
695
|
} : null
|
|
679
|
-
}, _this.getPropsByCheckbox())
|
|
696
|
+
}, _this.getPropsByCheckbox()), {}, {
|
|
697
|
+
expandedRowRender: expandedRowRender,
|
|
698
|
+
onExpand: onExpand
|
|
699
|
+
}, scrollProps);
|
|
680
700
|
});
|
|
681
701
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setScroll", function () {
|
|
682
702
|
if (_this.props.maxHeight && _this.props.items.length) {
|