cloud-b2b 1.1.62 → 1.1.64
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 +8 -11
- 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 +19 -22
- 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 +85 -88
- 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 +95 -101
- 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 +68 -71
- package/es/SuperTable2/SuperTable2.js +85 -88
- 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 +11 -14
- package/es/SuperUpload/SuperUpload.js +107 -91
- 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 +8 -11
- 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 +19 -22
- 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 +86 -90
- 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 +96 -103
- 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 +68 -71
- package/lib/SuperTable2/SuperTable2.js +86 -90
- 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 +11 -14
- package/lib/SuperUpload/SuperUpload.js +96 -81
- 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
|
@@ -12,14 +12,13 @@ import _objectDestructuringEmpty from "@babel/runtime-corejs3/helpers/objectDest
|
|
|
12
12
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
13
13
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
14
14
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
15
|
-
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
|
16
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
17
15
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
18
16
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
17
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
19
18
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
20
19
|
var _excluded = ["onRowClick"];
|
|
21
20
|
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; }
|
|
22
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context9,
|
|
21
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context9, _context0; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context9 = ownKeys(Object(t), !0)).call(_context9, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context0 = ownKeys(Object(t))).call(_context0, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23
22
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
24
23
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
25
24
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
@@ -35,8 +34,8 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
|
|
|
35
34
|
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
36
35
|
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
37
36
|
import _parseFloat from "@babel/runtime-corejs3/core-js-stable/parse-float";
|
|
38
|
-
function
|
|
39
|
-
function _isNativeReflectConstruct() {
|
|
37
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
38
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
40
39
|
import React from 'react';
|
|
41
40
|
import PropTypes from 'prop-types';
|
|
42
41
|
import ReactDOM from 'react-dom';
|
|
@@ -106,8 +105,6 @@ var CallbackType = {
|
|
|
106
105
|
* searchTotal: [可选], 表格汇总数据对象,该属性不为空时pageTotal默认开启,当dragSort为true时,该选项失效
|
|
107
106
|
*/
|
|
108
107
|
var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
109
|
-
_inherits(SuperTable, _React$Component);
|
|
110
|
-
var _super = _createSuper(SuperTable);
|
|
111
108
|
function SuperTable() {
|
|
112
109
|
var _context;
|
|
113
110
|
var _this;
|
|
@@ -115,18 +112,18 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
115
112
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
116
113
|
args[_key] = arguments[_key];
|
|
117
114
|
}
|
|
118
|
-
_this =
|
|
119
|
-
_defineProperty(
|
|
115
|
+
_this = _callSuper(this, SuperTable, _concatInstanceProperty(_context = []).call(_context, args));
|
|
116
|
+
_defineProperty(_this, "state", {
|
|
120
117
|
filterVisibleKey: ''
|
|
121
118
|
});
|
|
122
|
-
_defineProperty(
|
|
119
|
+
_defineProperty(_this, "onTableChange", function (pagination, filters, sorter) {
|
|
123
120
|
var _ref = _this.props.callback || {},
|
|
124
121
|
onTableChange = _ref.onTableChange;
|
|
125
122
|
var _this$props$filterInf = _this.props.filterInfo,
|
|
126
123
|
filterInfo = _this$props$filterInf === void 0 ? null : _this$props$filterInf;
|
|
127
124
|
onTableChange && onTableChange(sorter, filterInfo);
|
|
128
125
|
});
|
|
129
|
-
_defineProperty(
|
|
126
|
+
_defineProperty(_this, "onChange", function () {
|
|
130
127
|
var selectedKeyArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
131
128
|
var _ref2 = _this.props.callback || {},
|
|
132
129
|
onCheck = _ref2.onCheck;
|
|
@@ -173,22 +170,22 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
173
170
|
}
|
|
174
171
|
}
|
|
175
172
|
});
|
|
176
|
-
_defineProperty(
|
|
173
|
+
_defineProperty(_this, "onCheckChange", function (selectedKeys) {
|
|
177
174
|
var _ref3 = _this.props.callback || {},
|
|
178
175
|
onCheck = _ref3.onCheck;
|
|
179
176
|
onCheck && onCheck(selectedKeys);
|
|
180
177
|
});
|
|
181
|
-
_defineProperty(
|
|
178
|
+
_defineProperty(_this, "onRadioChange", function (selectedKeys) {
|
|
182
179
|
var _ref4 = _this.props.callback || {},
|
|
183
180
|
onRadio = _ref4.onRadio;
|
|
184
181
|
onRadio && onRadio(selectedKeys);
|
|
185
182
|
});
|
|
186
|
-
_defineProperty(
|
|
183
|
+
_defineProperty(_this, "onRadioRowClick", function (record) {
|
|
187
184
|
var _ref5 = _this.props.callback || {},
|
|
188
185
|
onRadio = _ref5.onRadio;
|
|
189
186
|
onRadio && onRadio([record.key]);
|
|
190
187
|
});
|
|
191
|
-
_defineProperty(
|
|
188
|
+
_defineProperty(_this, "onRowClick", function (record) {
|
|
192
189
|
var _this$props2 = _this.props,
|
|
193
190
|
_this$props2$isWeaken = _this$props2.isWeaken,
|
|
194
191
|
isWeaken = _this$props2$isWeaken === void 0 ? false : _this$props2$isWeaken,
|
|
@@ -218,33 +215,33 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
218
215
|
}
|
|
219
216
|
}, 250);
|
|
220
217
|
});
|
|
221
|
-
_defineProperty(
|
|
218
|
+
_defineProperty(_this, "onDoubleClick", function (record) {
|
|
222
219
|
clearTimeout(_this.timer);
|
|
223
220
|
var _ref7 = _this.props.callback || {},
|
|
224
221
|
onDoubleClick = _ref7.onDoubleClick;
|
|
225
222
|
onDoubleClick && onDoubleClick(record.key);
|
|
226
223
|
});
|
|
227
|
-
_defineProperty(
|
|
224
|
+
_defineProperty(_this, "onLink", function (key, index, item, e) {
|
|
228
225
|
var _ref8 = _this.props.callback || {},
|
|
229
226
|
onLink = _ref8.onLink;
|
|
230
227
|
onLink && onLink(key, index, item);
|
|
231
228
|
e.stopPropagation();
|
|
232
229
|
});
|
|
233
|
-
_defineProperty(
|
|
230
|
+
_defineProperty(_this, "onLinkDouble", function (e) {
|
|
234
231
|
e.stopPropagation();
|
|
235
232
|
});
|
|
236
|
-
_defineProperty(
|
|
233
|
+
_defineProperty(_this, "onMoveRow", function (dragIndex, targetIndex) {
|
|
237
234
|
var _ref9 = _this.props.callback || {},
|
|
238
235
|
onMoveRow = _ref9.onMoveRow;
|
|
239
236
|
onMoveRow && onMoveRow(dragIndex, targetIndex);
|
|
240
237
|
});
|
|
241
|
-
_defineProperty(
|
|
238
|
+
_defineProperty(_this, "getSelectedRowKeys", function (items) {
|
|
242
239
|
return _reduceInstanceProperty(items).call(items, function (result, item, index) {
|
|
243
240
|
item.checked && result.push(index);
|
|
244
241
|
return result;
|
|
245
242
|
}, []);
|
|
246
243
|
});
|
|
247
|
-
_defineProperty(
|
|
244
|
+
_defineProperty(_this, "getIndexInfo", function () {
|
|
248
245
|
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
249
246
|
var _this$props4 = _this.props,
|
|
250
247
|
_this$props4$index = _this$props4.index,
|
|
@@ -259,7 +256,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
259
256
|
}
|
|
260
257
|
}] : [];
|
|
261
258
|
});
|
|
262
|
-
_defineProperty(
|
|
259
|
+
_defineProperty(_this, "setSortInfo", function (col, sortInfo) {
|
|
263
260
|
if (col.sorter === 'string') {
|
|
264
261
|
col.sortOrder = sortInfo.columnKey === col.key && sortInfo.order;
|
|
265
262
|
col.sorter = function (row1, row2) {
|
|
@@ -282,13 +279,13 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
282
279
|
delete col.sorter;
|
|
283
280
|
}
|
|
284
281
|
});
|
|
285
|
-
_defineProperty(
|
|
282
|
+
_defineProperty(_this, "setFilterInfo", function (col, filterInfo, visibleKey) {
|
|
286
283
|
if (_filterInstanceProperty(col)) {
|
|
287
284
|
var _col$isDateFilterBySt = col.isDateFilterByStartAndEnd,
|
|
288
285
|
isDateFilterByStartAndEnd = _col$isDateFilterBySt === void 0 ? false : _col$isDateFilterBySt;
|
|
289
286
|
var onSearch = function onSearch(value) {
|
|
290
|
-
var
|
|
291
|
-
onTableChange =
|
|
287
|
+
var _ref0 = _this.props.callback || {},
|
|
288
|
+
onTableChange = _ref0.onTableChange;
|
|
292
289
|
var _this$props$sortInfo = _this.props.sortInfo,
|
|
293
290
|
sortInfo = _this$props$sortInfo === void 0 ? null : _this$props$sortInfo;
|
|
294
291
|
var newFilterInfo = _Object$assign({}, filterInfo, _defineProperty({}, col.key, value));
|
|
@@ -336,7 +333,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
336
333
|
}
|
|
337
334
|
delete col.filter;
|
|
338
335
|
});
|
|
339
|
-
_defineProperty(
|
|
336
|
+
_defineProperty(_this, "linkList", function (key, index, item) {
|
|
340
337
|
var linkTitleKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'fileName';
|
|
341
338
|
var list = item[key] || [];
|
|
342
339
|
return /*#__PURE__*/React.createElement("div", null, _mapInstanceProperty(list).call(list, function (item2, index2) {
|
|
@@ -350,7 +347,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
350
347
|
}, _concatInstanceProperty(_context3 = "".concat(item2[linkTitleKey])).call(_context3, split));
|
|
351
348
|
}));
|
|
352
349
|
});
|
|
353
|
-
_defineProperty(
|
|
350
|
+
_defineProperty(_this, "waring", function (key, index, item, warningKey) {
|
|
354
351
|
var text = item[key] ? item[key] : '';
|
|
355
352
|
var color = item[warningKey] == 1 ? 'red' : 'rgba(0, 0, 0, 0.65)';
|
|
356
353
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", {
|
|
@@ -359,7 +356,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
359
356
|
}
|
|
360
357
|
}, text.title ? text.title : text));
|
|
361
358
|
});
|
|
362
|
-
_defineProperty(
|
|
359
|
+
_defineProperty(_this, "defaultList", function (key, index, item, text, link) {
|
|
363
360
|
var _context4;
|
|
364
361
|
var onClick = _bindInstanceProperty(_context4 = _this.onLink).call(_context4, null, key, index, item);
|
|
365
362
|
if (link && typeof link === 'string') {
|
|
@@ -370,7 +367,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
370
367
|
}
|
|
371
368
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, text));
|
|
372
369
|
});
|
|
373
|
-
_defineProperty(
|
|
370
|
+
_defineProperty(_this, "getColumns", function (cols, items) {
|
|
374
371
|
var _context5, _context6;
|
|
375
372
|
var _this$props5 = _this.props,
|
|
376
373
|
sortInfo = _this$props5.sortInfo,
|
|
@@ -378,8 +375,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
378
375
|
var filterVisibleKey = _this.state.filterVisibleKey;
|
|
379
376
|
return _mapInstanceProperty(_context5 = _concatInstanceProperty(_context6 = _this.getIndexInfo(items)).call(_context6, _filterInstanceProperty(cols).call(cols, function (col) {
|
|
380
377
|
return !col.hide;
|
|
381
|
-
}))).call(_context5, function (
|
|
382
|
-
var col = _extends({}, (_objectDestructuringEmpty(
|
|
378
|
+
}))).call(_context5, function (_ref1) {
|
|
379
|
+
var col = _extends({}, (_objectDestructuringEmpty(_ref1), _ref1));
|
|
383
380
|
col.dataIndex = col.key;
|
|
384
381
|
col.className = col.key === 'index' ? 'ant-table-selection-column' : col.align ? variables('SuperTable')[col.align] : '';
|
|
385
382
|
col.noWrap && (col.className = variables('SuperTable').noWrap);
|
|
@@ -409,7 +406,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
409
406
|
return col;
|
|
410
407
|
});
|
|
411
408
|
});
|
|
412
|
-
_defineProperty(
|
|
409
|
+
_defineProperty(_this, "getText", function (value, options) {
|
|
413
410
|
if (_Array$isArray(value)) {
|
|
414
411
|
return _mapInstanceProperty(value).call(value, function (v) {
|
|
415
412
|
return getTitle(v, options);
|
|
@@ -418,7 +415,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
418
415
|
return getTitle(value, options);
|
|
419
416
|
}
|
|
420
417
|
});
|
|
421
|
-
_defineProperty(
|
|
418
|
+
_defineProperty(_this, "link", function (key, index, item, text) {
|
|
422
419
|
var _context7;
|
|
423
420
|
var onClick = _bindInstanceProperty(_context7 = _this.onLink).call(_context7, null, key, index, item);
|
|
424
421
|
return /*#__PURE__*/React.createElement("a", {
|
|
@@ -426,16 +423,16 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
426
423
|
onDoubleClick: _this.onLinkDouble
|
|
427
424
|
}, text);
|
|
428
425
|
});
|
|
429
|
-
_defineProperty(
|
|
430
|
-
var tipLen =
|
|
431
|
-
options =
|
|
426
|
+
_defineProperty(_this, "tooltip", function (key, index, item, _ref10) {
|
|
427
|
+
var tipLen = _ref10.tooltip,
|
|
428
|
+
options = _ref10.options;
|
|
432
429
|
var text = _this.getText(item[key], options);
|
|
433
430
|
var needTip = tipLen > 1 && text && typeof text === 'string' && text.length > tipLen;
|
|
434
431
|
return needTip ? /*#__PURE__*/React.createElement(_Tooltip, {
|
|
435
432
|
title: text
|
|
436
433
|
}, /*#__PURE__*/React.createElement("span", null, _sliceInstanceProperty(text).call(text, 0, tipLen) + '...')) : /*#__PURE__*/React.createElement("span", null, _Array$isArray(text) ? text.join(',') : text);
|
|
437
434
|
});
|
|
438
|
-
_defineProperty(
|
|
435
|
+
_defineProperty(_this, "getImgSrc", function (value, options) {
|
|
439
436
|
var index = _findIndexInstanceProperty(options).call(options, function (obj) {
|
|
440
437
|
return obj.value == value;
|
|
441
438
|
});
|
|
@@ -448,7 +445,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
448
445
|
* @param options{array}:字段options
|
|
449
446
|
* @param dataSource{string,array}:数据源,如果列数据有多层则用此决定
|
|
450
447
|
*/
|
|
451
|
-
_defineProperty(
|
|
448
|
+
_defineProperty(_this, "getSourceText", function (item, key, options, dataSource) {
|
|
452
449
|
var value = {};
|
|
453
450
|
if (typeof dataSource === 'string') {
|
|
454
451
|
value = item[dataSource] || {};
|
|
@@ -468,14 +465,14 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
468
465
|
}
|
|
469
466
|
return _this.getText(value, options);
|
|
470
467
|
});
|
|
471
|
-
_defineProperty(
|
|
468
|
+
_defineProperty(_this, "getDataSource", function (items, cols) {
|
|
472
469
|
return _mapInstanceProperty(items).call(items, function (item, index) {
|
|
473
|
-
return _reduceInstanceProperty(cols).call(cols, function (result,
|
|
474
|
-
var key =
|
|
475
|
-
options =
|
|
476
|
-
link =
|
|
477
|
-
icon =
|
|
478
|
-
dataSource =
|
|
470
|
+
return _reduceInstanceProperty(cols).call(cols, function (result, _ref11) {
|
|
471
|
+
var key = _ref11.key,
|
|
472
|
+
options = _ref11.options,
|
|
473
|
+
link = _ref11.link,
|
|
474
|
+
icon = _ref11.icon,
|
|
475
|
+
dataSource = _ref11.dataSource;
|
|
479
476
|
if (link) {
|
|
480
477
|
if (typeof link === 'boolean') {
|
|
481
478
|
result[key] = _this.link(key, index, item, _this.getText(item[key], options));
|
|
@@ -501,7 +498,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
501
498
|
});
|
|
502
499
|
});
|
|
503
500
|
});
|
|
504
|
-
_defineProperty(
|
|
501
|
+
_defineProperty(_this, "getPropsByCheckbox", function (items) {
|
|
505
502
|
var _this$props6 = _this.props,
|
|
506
503
|
_this$props6$checkbox = _this$props6.checkbox,
|
|
507
504
|
checkbox = _this$props6$checkbox === void 0 ? true : _this$props6$checkbox,
|
|
@@ -586,7 +583,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
586
583
|
};
|
|
587
584
|
}
|
|
588
585
|
});
|
|
589
|
-
_defineProperty(
|
|
586
|
+
_defineProperty(_this, "getRowProps", function (onRowClick) {
|
|
590
587
|
return function (record) {
|
|
591
588
|
return {
|
|
592
589
|
onClick: function onClick() {
|
|
@@ -598,7 +595,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
598
595
|
};
|
|
599
596
|
};
|
|
600
597
|
});
|
|
601
|
-
_defineProperty(
|
|
598
|
+
_defineProperty(_this, "getRowPropsForDrag", function () {
|
|
602
599
|
return function (record, index) {
|
|
603
600
|
return {
|
|
604
601
|
index: index,
|
|
@@ -606,7 +603,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
606
603
|
};
|
|
607
604
|
};
|
|
608
605
|
});
|
|
609
|
-
_defineProperty(
|
|
606
|
+
_defineProperty(_this, "getItems", function () {
|
|
610
607
|
var _this$props7 = _this.props,
|
|
611
608
|
items = _this$props7.items,
|
|
612
609
|
cols = _this$props7.cols,
|
|
@@ -618,10 +615,10 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
618
615
|
var resItems = items;
|
|
619
616
|
if (!dragSort && items.length > 1) {
|
|
620
617
|
if (pageTotal || searchTotal) {
|
|
621
|
-
var totalItem = _reduceInstanceProperty(cols).call(cols, function (result,
|
|
622
|
-
var key =
|
|
623
|
-
|
|
624
|
-
total =
|
|
618
|
+
var totalItem = _reduceInstanceProperty(cols).call(cols, function (result, _ref12) {
|
|
619
|
+
var key = _ref12.key,
|
|
620
|
+
_ref12$total = _ref12.total,
|
|
621
|
+
total = _ref12$total === void 0 ? false : _ref12$total;
|
|
625
622
|
if (total) {
|
|
626
623
|
result[key] = _parseFloat(Number(_reduceInstanceProperty(items).call(items, function (result, item) {
|
|
627
624
|
return _parseFloat(String(item[key] || 0)) + result;
|
|
@@ -643,7 +640,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
643
640
|
}
|
|
644
641
|
return resItems;
|
|
645
642
|
});
|
|
646
|
-
_defineProperty(
|
|
643
|
+
_defineProperty(_this, "toTotalFooter", function () {
|
|
647
644
|
var _this$props8 = _this.props,
|
|
648
645
|
cols = _this$props8.cols,
|
|
649
646
|
items = _this$props8.items,
|
|
@@ -659,11 +656,11 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
659
656
|
return item.checked;
|
|
660
657
|
});
|
|
661
658
|
var countItems = checkedItems.length ? checkedItems : items;
|
|
662
|
-
var totalItems = _mapInstanceProperty(totalCols).call(totalCols, function (
|
|
663
|
-
var title =
|
|
664
|
-
key =
|
|
665
|
-
|
|
666
|
-
props =
|
|
659
|
+
var totalItems = _mapInstanceProperty(totalCols).call(totalCols, function (_ref13) {
|
|
660
|
+
var title = _ref13.title,
|
|
661
|
+
key = _ref13.key,
|
|
662
|
+
_ref13$props = _ref13.props,
|
|
663
|
+
props = _ref13$props === void 0 ? {} : _ref13$props;
|
|
667
664
|
var value = _reduceInstanceProperty(countItems).call(countItems, function (result, item) {
|
|
668
665
|
return _parseFloat((result + Number(item[key] || 0)).toFixed(props.precision || 6));
|
|
669
666
|
}, 0);
|
|
@@ -681,9 +678,9 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
681
678
|
style: {
|
|
682
679
|
marginRight: "15px"
|
|
683
680
|
}
|
|
684
|
-
}, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), _mapInstanceProperty(totalItems).call(totalItems, function (
|
|
685
|
-
var title =
|
|
686
|
-
value =
|
|
681
|
+
}, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), _mapInstanceProperty(totalItems).call(totalItems, function (_ref14, index) {
|
|
682
|
+
var title = _ref14.title,
|
|
683
|
+
value = _ref14.value;
|
|
687
684
|
return /*#__PURE__*/React.createElement("span", {
|
|
688
685
|
key: index,
|
|
689
686
|
style: {
|
|
@@ -699,7 +696,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
699
696
|
return null;
|
|
700
697
|
}
|
|
701
698
|
});
|
|
702
|
-
_defineProperty(
|
|
699
|
+
_defineProperty(_this, "getProps", function () {
|
|
703
700
|
var _this$props9 = _this.props,
|
|
704
701
|
cols = _this$props9.cols,
|
|
705
702
|
_this$props9$isPaging = _this$props9.isPaging,
|
|
@@ -735,13 +732,13 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
735
732
|
}, extraProps);
|
|
736
733
|
return renderProps;
|
|
737
734
|
});
|
|
738
|
-
_defineProperty(
|
|
739
|
-
var _this$
|
|
740
|
-
maxHeight = _this$
|
|
741
|
-
pageTotal = _this$
|
|
742
|
-
searchTotal = _this$
|
|
735
|
+
_defineProperty(_this, "setScroll", function () {
|
|
736
|
+
var _this$props0 = _this.props,
|
|
737
|
+
maxHeight = _this$props0.maxHeight,
|
|
738
|
+
pageTotal = _this$props0.pageTotal,
|
|
739
|
+
searchTotal = _this$props0.searchTotal;
|
|
743
740
|
if (maxHeight && _this.getItems().length) {
|
|
744
|
-
var root = ReactDOM.findDOMNode(
|
|
741
|
+
var root = ReactDOM.findDOMNode(_this);
|
|
745
742
|
var container = root.getElementsByClassName('ant-table-body')[0];
|
|
746
743
|
var header = root.getElementsByClassName('ant-table-thead')[0];
|
|
747
744
|
var tbody = root.getElementsByClassName('ant-table-tbody')[0];
|
|
@@ -756,7 +753,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
756
753
|
});
|
|
757
754
|
return _this;
|
|
758
755
|
}
|
|
759
|
-
|
|
756
|
+
_inherits(SuperTable, _React$Component);
|
|
757
|
+
return _createClass(SuperTable, [{
|
|
760
758
|
key: "shouldComponentUpdate",
|
|
761
759
|
value: function shouldComponentUpdate(props, state) {
|
|
762
760
|
var _this2 = this;
|
|
@@ -783,7 +781,6 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
783
781
|
}));
|
|
784
782
|
}
|
|
785
783
|
}]);
|
|
786
|
-
return SuperTable;
|
|
787
784
|
}(React.Component);
|
|
788
785
|
_defineProperty(SuperTable, "propTypes", {
|
|
789
786
|
cols: PropTypes.arrayOf(PropTypes.shape(ColType)).isRequired,
|