cloud-b2b 1.1.79 → 1.1.80
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 +10 -13
- package/es/CodeInput/CodeInput.js +16 -19
- package/es/Enhance/Dialogs.js +11 -14
- package/es/Enhance/Loading.js +15 -18
- package/es/Header/Header.js +17 -20
- package/es/Header/Vertical.js +11 -14
- package/es/ImageView/ImageView.js +10 -13
- package/es/InpurCascader/InputCascader.js +11 -14
- package/es/InputEditor/InputEditor.js +16 -18
- package/es/InputSearch/InputSearch.js +20 -23
- package/es/InputSelect/InputSelect.js +14 -17
- package/es/InputTreeSelect/InputTreeSelect.js +10 -13
- package/es/InputWriting/InputWriting.js +12 -15
- package/es/Layout/Layout.js +14 -17
- package/es/Link/Link.js +7 -10
- package/es/NumberInput/NumberInput.js +13 -16
- package/es/Search/Search.js +52 -55
- package/es/Search2/Search.js +83 -86
- package/es/Search2/Search.less +64 -64
- package/es/Search2/package.json +6 -6
- package/es/Sidebar/Sidebar.js +11 -14
- package/es/Sidebar2/Sidebar.js +13 -16
- package/es/SuperForm/SuperForm.js +74 -79
- package/es/SuperForm2/SuperForm.js +107 -112
- package/es/SuperPagination/SuperPagination.js +8 -11
- package/es/SuperTab/SuperTab.js +12 -15
- package/es/SuperTab2/SuperTab2.js +13 -16
- package/es/SuperTable/DragSortRow.js +12 -15
- package/es/SuperTable/FilterDropDown.js +11 -14
- package/es/SuperTable/SuperTable.js +70 -73
- package/es/SuperTable2/SuperTable2.js +89 -92
- package/es/SuperTable2/SuperTable2.less +3 -1
- package/es/SuperTable2/SuperTableCell.js +27 -30
- package/es/SuperTable3/FilterDropDown.js +11 -14
- package/es/SuperTable3/SuperTable.js +58 -61
- package/es/SuperToolbar/SuperToolbar.js +12 -15
- package/es/SuperUpload/SuperUpload.js +38 -38
- package/es/Viewer/ImageViews.js +16 -19
- package/es/Viewer/Viewer.js +11 -14
- package/es/helper.js +18 -17
- package/lib/Area/Area.js +10 -13
- package/lib/CodeInput/CodeInput.js +16 -19
- package/lib/Enhance/Dialogs.js +11 -14
- package/lib/Enhance/Loading.js +15 -18
- package/lib/Header/Header.js +17 -20
- package/lib/Header/Vertical.js +11 -14
- package/lib/ImageView/ImageView.js +10 -13
- package/lib/InpurCascader/InputCascader.js +11 -14
- package/lib/InputEditor/InputEditor.js +16 -18
- package/lib/InputSearch/InputSearch.js +20 -23
- package/lib/InputSelect/InputSelect.js +14 -17
- package/lib/InputTreeSelect/InputTreeSelect.js +10 -13
- package/lib/InputWriting/InputWriting.js +12 -15
- package/lib/Layout/Layout.js +14 -17
- package/lib/LayoutLink/LayoutLink.js +1 -2
- package/lib/Link/Link.js +7 -10
- package/lib/NumberInput/NumberInput.js +13 -16
- package/lib/Search/Search.js +53 -57
- package/lib/Search2/Search.js +84 -88
- package/lib/Search2/Search.less +64 -64
- package/lib/Search2/package.json +6 -6
- package/lib/Sidebar/Sidebar.js +11 -14
- package/lib/Sidebar2/Sidebar.js +13 -16
- package/lib/SuperForm/SuperForm.js +75 -81
- package/lib/SuperForm2/SuperForm.js +108 -114
- package/lib/SuperPagination/SuperPagination.js +8 -11
- package/lib/SuperTab/SuperTab.js +12 -15
- package/lib/SuperTab2/SuperTab2.js +13 -16
- package/lib/SuperTable/DragSortRow.js +12 -15
- package/lib/SuperTable/FilterDropDown.js +11 -14
- package/lib/SuperTable/SuperTable.js +70 -73
- package/lib/SuperTable2/SuperTable2.js +90 -94
- package/lib/SuperTable2/SuperTable2.less +3 -1
- package/lib/SuperTable2/SuperTableCell.js +27 -30
- package/lib/SuperTable3/FilterDropDown.js +11 -14
- package/lib/SuperTable3/SuperTable.js +58 -61
- package/lib/SuperToolbar/SuperToolbar.js +12 -15
- package/lib/SuperUpload/SuperUpload.js +39 -40
- package/lib/Viewer/ImageViews.js +16 -19
- package/lib/Viewer/Viewer.js +11 -14
- package/lib/helper.js +18 -17
- package/package.json +1 -1
|
@@ -15,14 +15,13 @@ import _Icon from "antd/es/icon";
|
|
|
15
15
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
16
16
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
17
17
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
18
|
-
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
|
19
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
20
18
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
21
19
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
20
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
22
21
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
23
22
|
var _excluded = ["onRowClick"];
|
|
24
23
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
24
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context0, _context1; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context0 = ownKeys(Object(t), !0)).call(_context0, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context1 = ownKeys(Object(t))).call(_context1, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26
25
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
27
26
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
28
27
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
@@ -38,8 +37,8 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
|
|
|
38
37
|
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
39
38
|
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
40
39
|
import _parseFloat from "@babel/runtime-corejs3/core-js-stable/parse-float";
|
|
41
|
-
function
|
|
42
|
-
function _isNativeReflectConstruct() {
|
|
40
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
41
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
43
42
|
import React from 'react';
|
|
44
43
|
import PropTypes from 'prop-types';
|
|
45
44
|
import ReactDOM from 'react-dom';
|
|
@@ -111,8 +110,6 @@ var CallbackType = {
|
|
|
111
110
|
* searchTotal: [可选], 表格汇总数据对象,该属性不为空时pageTotal默认开启,当dragSort为true时,该选项失效
|
|
112
111
|
*/
|
|
113
112
|
var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
114
|
-
_inherits(SuperTable, _React$Component);
|
|
115
|
-
var _super = _createSuper(SuperTable);
|
|
116
113
|
function SuperTable() {
|
|
117
114
|
var _context;
|
|
118
115
|
var _this;
|
|
@@ -120,18 +117,18 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
120
117
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
121
118
|
args[_key] = arguments[_key];
|
|
122
119
|
}
|
|
123
|
-
_this =
|
|
124
|
-
_defineProperty(
|
|
120
|
+
_this = _callSuper(this, SuperTable, _concatInstanceProperty(_context = []).call(_context, args));
|
|
121
|
+
_defineProperty(_this, "state", {
|
|
125
122
|
filterVisibleKey: ''
|
|
126
123
|
});
|
|
127
|
-
_defineProperty(
|
|
124
|
+
_defineProperty(_this, "onTableChange", function (pagination, filters, sorter) {
|
|
128
125
|
var _ref = _this.props.callback || {},
|
|
129
126
|
onTableChange = _ref.onTableChange;
|
|
130
127
|
var _this$props$filterInf = _this.props.filterInfo,
|
|
131
128
|
filterInfo = _this$props$filterInf === void 0 ? null : _this$props$filterInf;
|
|
132
129
|
onTableChange && onTableChange(sorter, filterInfo);
|
|
133
130
|
});
|
|
134
|
-
_defineProperty(
|
|
131
|
+
_defineProperty(_this, "onChange", function () {
|
|
135
132
|
var selectedKeyArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
136
133
|
var _ref2 = _this.props.callback || {},
|
|
137
134
|
onCheck = _ref2.onCheck;
|
|
@@ -178,22 +175,22 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
178
175
|
}
|
|
179
176
|
}
|
|
180
177
|
});
|
|
181
|
-
_defineProperty(
|
|
178
|
+
_defineProperty(_this, "onCheckChange", function (selectedKeys) {
|
|
182
179
|
var _ref3 = _this.props.callback || {},
|
|
183
180
|
onCheck = _ref3.onCheck;
|
|
184
181
|
onCheck && onCheck(selectedKeys);
|
|
185
182
|
});
|
|
186
|
-
_defineProperty(
|
|
183
|
+
_defineProperty(_this, "onRadioChange", function (selectedKeys) {
|
|
187
184
|
var _ref4 = _this.props.callback || {},
|
|
188
185
|
onRadio = _ref4.onRadio;
|
|
189
186
|
onRadio && onRadio(selectedKeys);
|
|
190
187
|
});
|
|
191
|
-
_defineProperty(
|
|
188
|
+
_defineProperty(_this, "onRadioRowClick", function (record) {
|
|
192
189
|
var _ref5 = _this.props.callback || {},
|
|
193
190
|
onRadio = _ref5.onRadio;
|
|
194
191
|
onRadio && onRadio([record.key]);
|
|
195
192
|
});
|
|
196
|
-
_defineProperty(
|
|
193
|
+
_defineProperty(_this, "onRowClick", function (record) {
|
|
197
194
|
var _this$props2 = _this.props,
|
|
198
195
|
_this$props2$isWeaken = _this$props2.isWeaken,
|
|
199
196
|
isWeaken = _this$props2$isWeaken === void 0 ? false : _this$props2$isWeaken,
|
|
@@ -223,33 +220,33 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
223
220
|
}
|
|
224
221
|
}, 250);
|
|
225
222
|
});
|
|
226
|
-
_defineProperty(
|
|
223
|
+
_defineProperty(_this, "onDoubleClick", function (record) {
|
|
227
224
|
clearTimeout(_this.timer);
|
|
228
225
|
var _ref7 = _this.props.callback || {},
|
|
229
226
|
onDoubleClick = _ref7.onDoubleClick;
|
|
230
227
|
onDoubleClick && onDoubleClick(record.key);
|
|
231
228
|
});
|
|
232
|
-
_defineProperty(
|
|
229
|
+
_defineProperty(_this, "onLink", function (key, index, item, e) {
|
|
233
230
|
var _ref8 = _this.props.callback || {},
|
|
234
231
|
onLink = _ref8.onLink;
|
|
235
232
|
onLink && onLink(key, index, item);
|
|
236
233
|
e.stopPropagation();
|
|
237
234
|
});
|
|
238
|
-
_defineProperty(
|
|
235
|
+
_defineProperty(_this, "onLinkDouble", function (e) {
|
|
239
236
|
e.stopPropagation();
|
|
240
237
|
});
|
|
241
|
-
_defineProperty(
|
|
238
|
+
_defineProperty(_this, "onMoveRow", function (dragIndex, targetIndex) {
|
|
242
239
|
var _ref9 = _this.props.callback || {},
|
|
243
240
|
onMoveRow = _ref9.onMoveRow;
|
|
244
241
|
onMoveRow && onMoveRow(dragIndex, targetIndex);
|
|
245
242
|
});
|
|
246
|
-
_defineProperty(
|
|
243
|
+
_defineProperty(_this, "getSelectedRowKeys", function (items) {
|
|
247
244
|
return _reduceInstanceProperty(items).call(items, function (result, item, index) {
|
|
248
245
|
item.checked && result.push(index);
|
|
249
246
|
return result;
|
|
250
247
|
}, []);
|
|
251
248
|
});
|
|
252
|
-
_defineProperty(
|
|
249
|
+
_defineProperty(_this, "getIndexInfo", function () {
|
|
253
250
|
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
254
251
|
var _this$props4 = _this.props,
|
|
255
252
|
_this$props4$index = _this$props4.index,
|
|
@@ -264,7 +261,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
264
261
|
}
|
|
265
262
|
}] : [];
|
|
266
263
|
});
|
|
267
|
-
_defineProperty(
|
|
264
|
+
_defineProperty(_this, "setSortInfo", function (col, sortInfo) {
|
|
268
265
|
if (col.sorter === 'string') {
|
|
269
266
|
col.sortOrder = sortInfo.columnKey === col.key && sortInfo.order;
|
|
270
267
|
col.sorter = function (row1, row2) {
|
|
@@ -287,13 +284,13 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
287
284
|
delete col.sorter;
|
|
288
285
|
}
|
|
289
286
|
});
|
|
290
|
-
_defineProperty(
|
|
287
|
+
_defineProperty(_this, "setFilterInfo", function (col, filterInfo, visibleKey) {
|
|
291
288
|
if (_filterInstanceProperty(col)) {
|
|
292
289
|
var _col$isDateFilterBySt = col.isDateFilterByStartAndEnd,
|
|
293
290
|
isDateFilterByStartAndEnd = _col$isDateFilterBySt === void 0 ? false : _col$isDateFilterBySt;
|
|
294
291
|
var onSearch = function onSearch(value) {
|
|
295
|
-
var
|
|
296
|
-
onTableChange =
|
|
292
|
+
var _ref0 = _this.props.callback || {},
|
|
293
|
+
onTableChange = _ref0.onTableChange;
|
|
297
294
|
var _this$props$sortInfo = _this.props.sortInfo,
|
|
298
295
|
sortInfo = _this$props$sortInfo === void 0 ? null : _this$props$sortInfo;
|
|
299
296
|
var newFilterInfo = _Object$assign({}, filterInfo, _defineProperty({}, col.key, value));
|
|
@@ -341,7 +338,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
341
338
|
}
|
|
342
339
|
delete col.filter;
|
|
343
340
|
});
|
|
344
|
-
_defineProperty(
|
|
341
|
+
_defineProperty(_this, "linkList", function (key, index, item) {
|
|
345
342
|
var linkTitleKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'fileName';
|
|
346
343
|
var list = item[key] || [];
|
|
347
344
|
return /*#__PURE__*/React.createElement("div", null, _mapInstanceProperty(list).call(list, function (item2, index2) {
|
|
@@ -355,7 +352,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
355
352
|
}, _concatInstanceProperty(_context3 = "".concat(item2[linkTitleKey])).call(_context3, split));
|
|
356
353
|
}));
|
|
357
354
|
});
|
|
358
|
-
_defineProperty(
|
|
355
|
+
_defineProperty(_this, "waring", function (key, index, item, warningKey) {
|
|
359
356
|
var text = item[key] ? item[key] : '';
|
|
360
357
|
var color = item[warningKey] == 1 ? 'red' : 'rgba(0, 0, 0, 0.65)';
|
|
361
358
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", {
|
|
@@ -364,7 +361,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
364
361
|
}
|
|
365
362
|
}, text.title ? text.title : text));
|
|
366
363
|
});
|
|
367
|
-
_defineProperty(
|
|
364
|
+
_defineProperty(_this, "defaultList", function (key, index, item, text, link) {
|
|
368
365
|
var _context4;
|
|
369
366
|
var onClick = _bindInstanceProperty(_context4 = _this.onLink).call(_context4, null, key, index, item);
|
|
370
367
|
if (link && typeof link === 'string') {
|
|
@@ -375,8 +372,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
375
372
|
}
|
|
376
373
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, text));
|
|
377
374
|
});
|
|
378
|
-
_defineProperty(
|
|
379
|
-
var tags =
|
|
375
|
+
_defineProperty(_this, "tags", function (key, index, item, _ref1) {
|
|
376
|
+
var tags = _ref1.tags;
|
|
380
377
|
var list = item[key] || [];
|
|
381
378
|
return /*#__PURE__*/React.createElement("div", null, _mapInstanceProperty(list).call(list, function (item2, index2) {
|
|
382
379
|
var _context5;
|
|
@@ -411,7 +408,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
411
408
|
}, /*#__PURE__*/React.createElement(_Tag, tagProps, item2[tags])) : /*#__PURE__*/React.createElement(_Tag, tagProps, item2[tags]);
|
|
412
409
|
}));
|
|
413
410
|
});
|
|
414
|
-
_defineProperty(
|
|
411
|
+
_defineProperty(_this, "getColumns", function (cols, items) {
|
|
415
412
|
var _context6, _context7;
|
|
416
413
|
var _this$props5 = _this.props,
|
|
417
414
|
sortInfo = _this$props5.sortInfo,
|
|
@@ -419,8 +416,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
419
416
|
var filterVisibleKey = _this.state.filterVisibleKey;
|
|
420
417
|
return _mapInstanceProperty(_context6 = _concatInstanceProperty(_context7 = _this.getIndexInfo(items)).call(_context7, _filterInstanceProperty(cols).call(cols, function (col) {
|
|
421
418
|
return !col.hide;
|
|
422
|
-
}))).call(_context6, function (
|
|
423
|
-
var col = _extends({}, (_objectDestructuringEmpty(
|
|
419
|
+
}))).call(_context6, function (_ref10) {
|
|
420
|
+
var col = _extends({}, (_objectDestructuringEmpty(_ref10), _ref10));
|
|
424
421
|
col.dataIndex = col.key;
|
|
425
422
|
col.className = col.key === 'index' ? 'ant-table-selection-column' : col.align ? variables('SuperTable')[col.align] : '';
|
|
426
423
|
col.noWrap && (col.className = variables('SuperTable').noWrap);
|
|
@@ -458,7 +455,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
458
455
|
return col;
|
|
459
456
|
});
|
|
460
457
|
});
|
|
461
|
-
_defineProperty(
|
|
458
|
+
_defineProperty(_this, "getText", function (value, options) {
|
|
462
459
|
if (_Array$isArray(value)) {
|
|
463
460
|
return _mapInstanceProperty(value).call(value, function (v) {
|
|
464
461
|
return getTitle(v, options);
|
|
@@ -467,7 +464,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
467
464
|
return getTitle(value, options);
|
|
468
465
|
}
|
|
469
466
|
});
|
|
470
|
-
_defineProperty(
|
|
467
|
+
_defineProperty(_this, "link", function (key, index, item, text) {
|
|
471
468
|
var _context8;
|
|
472
469
|
var onClick = _bindInstanceProperty(_context8 = _this.onLink).call(_context8, null, key, index, item);
|
|
473
470
|
return /*#__PURE__*/React.createElement("a", {
|
|
@@ -475,16 +472,16 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
475
472
|
onDoubleClick: _this.onLinkDouble
|
|
476
473
|
}, text);
|
|
477
474
|
});
|
|
478
|
-
_defineProperty(
|
|
479
|
-
var tipLen =
|
|
480
|
-
options =
|
|
475
|
+
_defineProperty(_this, "tooltip", function (key, index, item, _ref11) {
|
|
476
|
+
var tipLen = _ref11.tooltip,
|
|
477
|
+
options = _ref11.options;
|
|
481
478
|
var text = _this.getText(item[key], options);
|
|
482
479
|
var needTip = tipLen > 1 && text && typeof text === 'string' && text.length > tipLen;
|
|
483
480
|
return needTip ? /*#__PURE__*/React.createElement(_Tooltip, {
|
|
484
481
|
title: text
|
|
485
482
|
}, /*#__PURE__*/React.createElement("span", null, _sliceInstanceProperty(text).call(text, 0, tipLen) + '...')) : /*#__PURE__*/React.createElement("span", null, _Array$isArray(text) ? text.join(',') : text);
|
|
486
483
|
});
|
|
487
|
-
_defineProperty(
|
|
484
|
+
_defineProperty(_this, "getImgSrc", function (value, options) {
|
|
488
485
|
var index = _findIndexInstanceProperty(options).call(options, function (obj) {
|
|
489
486
|
return obj.value == value;
|
|
490
487
|
});
|
|
@@ -497,7 +494,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
497
494
|
* @param options{array}:字段options
|
|
498
495
|
* @param dataSource{string,array}:数据源,如果列数据有多层则用此决定
|
|
499
496
|
*/
|
|
500
|
-
_defineProperty(
|
|
497
|
+
_defineProperty(_this, "getSourceText", function (item, key, options, dataSource) {
|
|
501
498
|
var value = {};
|
|
502
499
|
if (typeof dataSource === 'string') {
|
|
503
500
|
value = item[dataSource] || {};
|
|
@@ -517,14 +514,14 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
517
514
|
}
|
|
518
515
|
return _this.getText(value, options);
|
|
519
516
|
});
|
|
520
|
-
_defineProperty(
|
|
517
|
+
_defineProperty(_this, "getDataSource", function (items, cols) {
|
|
521
518
|
return _mapInstanceProperty(items).call(items, function (item, index) {
|
|
522
|
-
return _reduceInstanceProperty(cols).call(cols, function (result,
|
|
523
|
-
var key =
|
|
524
|
-
options =
|
|
525
|
-
link =
|
|
526
|
-
icon =
|
|
527
|
-
dataSource =
|
|
519
|
+
return _reduceInstanceProperty(cols).call(cols, function (result, _ref12) {
|
|
520
|
+
var key = _ref12.key,
|
|
521
|
+
options = _ref12.options,
|
|
522
|
+
link = _ref12.link,
|
|
523
|
+
icon = _ref12.icon,
|
|
524
|
+
dataSource = _ref12.dataSource;
|
|
528
525
|
if (link) {
|
|
529
526
|
if (typeof link === 'boolean') {
|
|
530
527
|
result[key] = _this.link(key, index, item, _this.getText(item[key], options));
|
|
@@ -550,7 +547,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
550
547
|
});
|
|
551
548
|
});
|
|
552
549
|
});
|
|
553
|
-
_defineProperty(
|
|
550
|
+
_defineProperty(_this, "getPropsByCheckbox", function (items) {
|
|
554
551
|
var _this$props6 = _this.props,
|
|
555
552
|
_this$props6$checkbox = _this$props6.checkbox,
|
|
556
553
|
checkbox = _this$props6$checkbox === void 0 ? true : _this$props6$checkbox,
|
|
@@ -635,7 +632,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
635
632
|
};
|
|
636
633
|
}
|
|
637
634
|
});
|
|
638
|
-
_defineProperty(
|
|
635
|
+
_defineProperty(_this, "getRowProps", function (onRowClick, items) {
|
|
639
636
|
return function (record) {
|
|
640
637
|
var item = items[record.key];
|
|
641
638
|
var rowProps = {
|
|
@@ -652,7 +649,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
652
649
|
return rowProps;
|
|
653
650
|
};
|
|
654
651
|
});
|
|
655
|
-
_defineProperty(
|
|
652
|
+
_defineProperty(_this, "getRowPropsForDrag", function () {
|
|
656
653
|
return function (record, index) {
|
|
657
654
|
return {
|
|
658
655
|
index: index,
|
|
@@ -660,7 +657,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
660
657
|
};
|
|
661
658
|
};
|
|
662
659
|
});
|
|
663
|
-
_defineProperty(
|
|
660
|
+
_defineProperty(_this, "getItems", function () {
|
|
664
661
|
var _this$props7 = _this.props,
|
|
665
662
|
items = _this$props7.items,
|
|
666
663
|
cols = _this$props7.cols,
|
|
@@ -672,10 +669,10 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
672
669
|
var resItems = items;
|
|
673
670
|
if (!dragSort && items.length > 1) {
|
|
674
671
|
if (pageTotal || searchTotal) {
|
|
675
|
-
var totalItem = _reduceInstanceProperty(cols).call(cols, function (result,
|
|
676
|
-
var key =
|
|
677
|
-
|
|
678
|
-
total =
|
|
672
|
+
var totalItem = _reduceInstanceProperty(cols).call(cols, function (result, _ref13) {
|
|
673
|
+
var key = _ref13.key,
|
|
674
|
+
_ref13$total = _ref13.total,
|
|
675
|
+
total = _ref13$total === void 0 ? false : _ref13$total;
|
|
679
676
|
if (total) {
|
|
680
677
|
result[key] = _parseFloat(Number(_reduceInstanceProperty(items).call(items, function (result, item) {
|
|
681
678
|
return _parseFloat(String(item[key] || 0)) + result;
|
|
@@ -697,7 +694,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
697
694
|
}
|
|
698
695
|
return resItems;
|
|
699
696
|
});
|
|
700
|
-
_defineProperty(
|
|
697
|
+
_defineProperty(_this, "toTotalFooter", function () {
|
|
701
698
|
var _this$props8 = _this.props,
|
|
702
699
|
cols = _this$props8.cols,
|
|
703
700
|
items = _this$props8.items,
|
|
@@ -713,11 +710,11 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
713
710
|
return item.checked;
|
|
714
711
|
});
|
|
715
712
|
var countItems = checkedItems.length ? checkedItems : items;
|
|
716
|
-
var totalItems = _mapInstanceProperty(totalCols).call(totalCols, function (
|
|
717
|
-
var title =
|
|
718
|
-
key =
|
|
719
|
-
|
|
720
|
-
props =
|
|
713
|
+
var totalItems = _mapInstanceProperty(totalCols).call(totalCols, function (_ref14) {
|
|
714
|
+
var title = _ref14.title,
|
|
715
|
+
key = _ref14.key,
|
|
716
|
+
_ref14$props = _ref14.props,
|
|
717
|
+
props = _ref14$props === void 0 ? {} : _ref14$props;
|
|
721
718
|
var value = _reduceInstanceProperty(countItems).call(countItems, function (result, item) {
|
|
722
719
|
return _parseFloat((result + Number(item[key] || 0)).toFixed(props.precision || 6));
|
|
723
720
|
}, 0);
|
|
@@ -735,9 +732,9 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
735
732
|
style: {
|
|
736
733
|
marginRight: "15px"
|
|
737
734
|
}
|
|
738
|
-
}, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), _mapInstanceProperty(totalItems).call(totalItems, function (
|
|
739
|
-
var title =
|
|
740
|
-
value =
|
|
735
|
+
}, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), _mapInstanceProperty(totalItems).call(totalItems, function (_ref15, index) {
|
|
736
|
+
var title = _ref15.title,
|
|
737
|
+
value = _ref15.value;
|
|
741
738
|
return /*#__PURE__*/React.createElement("span", {
|
|
742
739
|
key: index,
|
|
743
740
|
style: {
|
|
@@ -753,7 +750,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
753
750
|
return null;
|
|
754
751
|
}
|
|
755
752
|
});
|
|
756
|
-
_defineProperty(
|
|
753
|
+
_defineProperty(_this, "getProps", function () {
|
|
757
754
|
var _this$props9 = _this.props,
|
|
758
755
|
cols = _this$props9.cols,
|
|
759
756
|
_this$props9$isPaging = _this$props9.isPaging,
|
|
@@ -789,13 +786,13 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
789
786
|
}, extraProps);
|
|
790
787
|
return renderProps;
|
|
791
788
|
});
|
|
792
|
-
_defineProperty(
|
|
793
|
-
var _this$
|
|
794
|
-
maxHeight = _this$
|
|
795
|
-
pageTotal = _this$
|
|
796
|
-
searchTotal = _this$
|
|
789
|
+
_defineProperty(_this, "setScroll", function () {
|
|
790
|
+
var _this$props0 = _this.props,
|
|
791
|
+
maxHeight = _this$props0.maxHeight,
|
|
792
|
+
pageTotal = _this$props0.pageTotal,
|
|
793
|
+
searchTotal = _this$props0.searchTotal;
|
|
797
794
|
if (maxHeight && _this.getItems().length) {
|
|
798
|
-
var root = ReactDOM.findDOMNode(
|
|
795
|
+
var root = ReactDOM.findDOMNode(_this);
|
|
799
796
|
var container = root.getElementsByClassName('ant-table-body')[0];
|
|
800
797
|
var header = root.getElementsByClassName('ant-table-thead')[0];
|
|
801
798
|
var tbody = root.getElementsByClassName('ant-table-tbody')[0];
|
|
@@ -810,7 +807,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
810
807
|
});
|
|
811
808
|
return _this;
|
|
812
809
|
}
|
|
813
|
-
|
|
810
|
+
_inherits(SuperTable, _React$Component);
|
|
811
|
+
return _createClass(SuperTable, [{
|
|
814
812
|
key: "shouldComponentUpdate",
|
|
815
813
|
value: function shouldComponentUpdate(props, state) {
|
|
816
814
|
var _this2 = this;
|
|
@@ -837,7 +835,6 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
837
835
|
}));
|
|
838
836
|
}
|
|
839
837
|
}]);
|
|
840
|
-
return SuperTable;
|
|
841
838
|
}(React.Component);
|
|
842
839
|
_defineProperty(SuperTable, "propTypes", {
|
|
843
840
|
cols: PropTypes.arrayOf(PropTypes.shape(ColType)).isRequired,
|