cloud-b2b 1.1.80 → 1.1.82
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 +16 -11
- package/es/CodeInput/CodeInput.js +19 -16
- package/es/Control/Control.js +4 -1
- package/es/Enhance/Dialogs.js +14 -11
- package/es/Enhance/Loading.js +18 -15
- package/es/Header/Header.js +20 -17
- package/es/Header/Vertical.js +14 -11
- package/es/ImageView/ImageView.js +13 -10
- package/es/InpurCascader/InputCascader.js +14 -11
- package/es/InputEditor/InputEditor.js +18 -16
- package/es/InputSearch/InputSearch.js +23 -20
- package/es/InputSelect/InputSelect.js +17 -14
- package/es/InputTreeSelect/InputTreeSelect.js +13 -10
- package/es/InputWriting/InputWriting.js +15 -12
- package/es/Layout/Layout.js +17 -14
- package/es/Link/Link.js +10 -7
- package/es/NumberInput/NumberInput.js +16 -13
- package/es/Search/Search.js +55 -52
- package/es/Search2/Search.js +86 -83
- package/es/Search2/Search.less +64 -64
- package/es/Search2/package.json +6 -6
- package/es/Sidebar/Sidebar.js +14 -11
- package/es/Sidebar2/Sidebar.js +16 -13
- package/es/SuperForm/SuperForm.js +79 -74
- package/es/SuperForm2/SuperForm.js +114 -108
- package/es/SuperPagination/SuperPagination.js +11 -8
- package/es/SuperTab/SuperTab.js +15 -12
- package/es/SuperTab2/SuperTab2.js +16 -13
- package/es/SuperTable/DragSortRow.js +15 -12
- package/es/SuperTable/FilterDropDown.js +14 -11
- package/es/SuperTable/SuperTable.js +73 -70
- package/es/SuperTable2/SuperTable2.js +92 -89
- package/es/SuperTable2/SuperTableCell.js +30 -27
- package/es/SuperTable3/FilterDropDown.js +14 -11
- package/es/SuperTable3/SuperTable.js +61 -58
- package/es/SuperToolbar/SuperToolbar.js +15 -12
- package/es/SuperUpload/SuperUpload.js +38 -38
- package/es/Viewer/ImageViews.js +19 -16
- package/es/Viewer/Viewer.js +14 -11
- package/es/helper.js +17 -18
- package/lib/Area/Area.js +16 -11
- package/lib/CodeInput/CodeInput.js +19 -16
- package/lib/Control/Control.js +4 -1
- package/lib/Enhance/Dialogs.js +14 -11
- package/lib/Enhance/Loading.js +18 -15
- package/lib/Header/Header.js +20 -17
- package/lib/Header/Vertical.js +14 -11
- package/lib/ImageView/ImageView.js +13 -10
- package/lib/InpurCascader/InputCascader.js +14 -11
- package/lib/InputEditor/InputEditor.js +18 -16
- package/lib/InputSearch/InputSearch.js +23 -20
- package/lib/InputSelect/InputSelect.js +17 -14
- package/lib/InputTreeSelect/InputTreeSelect.js +13 -10
- package/lib/InputWriting/InputWriting.js +15 -12
- package/lib/Layout/Layout.js +17 -14
- package/lib/LayoutLink/LayoutLink.js +2 -1
- package/lib/Link/Link.js +10 -7
- package/lib/NumberInput/NumberInput.js +16 -13
- package/lib/Search/Search.js +57 -53
- package/lib/Search2/Search.js +88 -84
- package/lib/Search2/Search.less +64 -64
- package/lib/Search2/package.json +6 -6
- package/lib/Sidebar/Sidebar.js +14 -11
- package/lib/Sidebar2/Sidebar.js +16 -13
- package/lib/SuperForm/SuperForm.js +81 -75
- package/lib/SuperForm2/SuperForm.js +116 -109
- package/lib/SuperPagination/SuperPagination.js +11 -8
- package/lib/SuperTab/SuperTab.js +15 -12
- package/lib/SuperTab2/SuperTab2.js +16 -13
- package/lib/SuperTable/DragSortRow.js +15 -12
- package/lib/SuperTable/FilterDropDown.js +14 -11
- package/lib/SuperTable/SuperTable.js +73 -70
- package/lib/SuperTable2/SuperTable2.js +94 -90
- package/lib/SuperTable2/SuperTableCell.js +30 -27
- package/lib/SuperTable3/FilterDropDown.js +14 -11
- package/lib/SuperTable3/SuperTable.js +61 -58
- package/lib/SuperToolbar/SuperToolbar.js +15 -12
- package/lib/SuperUpload/SuperUpload.js +40 -39
- package/lib/Viewer/ImageViews.js +19 -16
- package/lib/Viewer/Viewer.js +14 -11
- package/lib/helper.js +17 -18
- package/package.json +1 -1
|
@@ -39,9 +39,10 @@ var _icon = _interopRequireDefault(require("antd/lib/icon"));
|
|
|
39
39
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
40
40
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
41
41
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
42
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
43
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
42
44
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
43
45
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
44
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
45
46
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
46
47
|
var _react = _interopRequireDefault(require("react"));
|
|
47
48
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -53,9 +54,9 @@ var _DragSortRow = _interopRequireDefault(require("./DragSortRow"));
|
|
|
53
54
|
var _variables = _interopRequireDefault(require("../variables"));
|
|
54
55
|
var _excluded = ["onRowClick"];
|
|
55
56
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty2(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
56
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
57
|
-
function
|
|
58
|
-
function _isNativeReflectConstruct() {
|
|
57
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context10, _context11; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty2(_context10 = ownKeys(Object(t), !0)).call(_context10, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty2(_context11 = ownKeys(Object(t))).call(_context11, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
58
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
59
|
+
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; } }
|
|
59
60
|
/**
|
|
60
61
|
* sorter: [可选],不传表示该列不支持排序;为string表示按字符串排序;为number表示按数字大小排序
|
|
61
62
|
* filter: [可选],是否支持过滤,默认为false
|
|
@@ -118,6 +119,8 @@ var CallbackType = {
|
|
|
118
119
|
* searchTotal: [可选], 表格汇总数据对象,该属性不为空时pageTotal默认开启,当dragSort为true时,该选项失效
|
|
119
120
|
*/
|
|
120
121
|
var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
122
|
+
(0, _inherits2["default"])(SuperTable, _React$Component);
|
|
123
|
+
var _super = _createSuper(SuperTable);
|
|
121
124
|
function SuperTable() {
|
|
122
125
|
var _context;
|
|
123
126
|
var _this;
|
|
@@ -125,18 +128,18 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
125
128
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
126
129
|
args[_key] = arguments[_key];
|
|
127
130
|
}
|
|
128
|
-
_this =
|
|
129
|
-
(0, _defineProperty2["default"])(_this, "state", {
|
|
131
|
+
_this = _super.call.apply(_super, (0, _concat["default"])(_context = [this]).call(_context, args));
|
|
132
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
|
|
130
133
|
filterVisibleKey: ''
|
|
131
134
|
});
|
|
132
|
-
(0, _defineProperty2["default"])(_this, "onTableChange", function (pagination, filters, sorter) {
|
|
135
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onTableChange", function (pagination, filters, sorter) {
|
|
133
136
|
var _ref = _this.props.callback || {},
|
|
134
137
|
onTableChange = _ref.onTableChange;
|
|
135
138
|
var _this$props$filterInf = _this.props.filterInfo,
|
|
136
139
|
filterInfo = _this$props$filterInf === void 0 ? null : _this$props$filterInf;
|
|
137
140
|
onTableChange && onTableChange(sorter, filterInfo);
|
|
138
141
|
});
|
|
139
|
-
(0, _defineProperty2["default"])(_this, "onChange", function () {
|
|
142
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function () {
|
|
140
143
|
var selectedKeyArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
141
144
|
var _ref2 = _this.props.callback || {},
|
|
142
145
|
onCheck = _ref2.onCheck;
|
|
@@ -183,22 +186,22 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
183
186
|
}
|
|
184
187
|
}
|
|
185
188
|
});
|
|
186
|
-
(0, _defineProperty2["default"])(_this, "onCheckChange", function (selectedKeys) {
|
|
189
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onCheckChange", function (selectedKeys) {
|
|
187
190
|
var _ref3 = _this.props.callback || {},
|
|
188
191
|
onCheck = _ref3.onCheck;
|
|
189
192
|
onCheck && onCheck(selectedKeys);
|
|
190
193
|
});
|
|
191
|
-
(0, _defineProperty2["default"])(_this, "onRadioChange", function (selectedKeys) {
|
|
194
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRadioChange", function (selectedKeys) {
|
|
192
195
|
var _ref4 = _this.props.callback || {},
|
|
193
196
|
onRadio = _ref4.onRadio;
|
|
194
197
|
onRadio && onRadio(selectedKeys);
|
|
195
198
|
});
|
|
196
|
-
(0, _defineProperty2["default"])(_this, "onRadioRowClick", function (record) {
|
|
199
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRadioRowClick", function (record) {
|
|
197
200
|
var _ref5 = _this.props.callback || {},
|
|
198
201
|
onRadio = _ref5.onRadio;
|
|
199
202
|
onRadio && onRadio([record.key]);
|
|
200
203
|
});
|
|
201
|
-
(0, _defineProperty2["default"])(_this, "onRowClick", function (record) {
|
|
204
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRowClick", function (record) {
|
|
202
205
|
var _this$props2 = _this.props,
|
|
203
206
|
_this$props2$isWeaken = _this$props2.isWeaken,
|
|
204
207
|
isWeaken = _this$props2$isWeaken === void 0 ? false : _this$props2$isWeaken,
|
|
@@ -228,33 +231,33 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
228
231
|
}
|
|
229
232
|
}, 250);
|
|
230
233
|
});
|
|
231
|
-
(0, _defineProperty2["default"])(_this, "onDoubleClick", function (record) {
|
|
234
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDoubleClick", function (record) {
|
|
232
235
|
clearTimeout(_this.timer);
|
|
233
236
|
var _ref7 = _this.props.callback || {},
|
|
234
237
|
onDoubleClick = _ref7.onDoubleClick;
|
|
235
238
|
onDoubleClick && onDoubleClick(record.key);
|
|
236
239
|
});
|
|
237
|
-
(0, _defineProperty2["default"])(_this, "onLink", function (key, index, item, e) {
|
|
240
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onLink", function (key, index, item, e) {
|
|
238
241
|
var _ref8 = _this.props.callback || {},
|
|
239
242
|
onLink = _ref8.onLink;
|
|
240
243
|
onLink && onLink(key, index, item);
|
|
241
244
|
e.stopPropagation();
|
|
242
245
|
});
|
|
243
|
-
(0, _defineProperty2["default"])(_this, "onLinkDouble", function (e) {
|
|
246
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onLinkDouble", function (e) {
|
|
244
247
|
e.stopPropagation();
|
|
245
248
|
});
|
|
246
|
-
(0, _defineProperty2["default"])(_this, "onMoveRow", function (dragIndex, targetIndex) {
|
|
249
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onMoveRow", function (dragIndex, targetIndex) {
|
|
247
250
|
var _ref9 = _this.props.callback || {},
|
|
248
251
|
onMoveRow = _ref9.onMoveRow;
|
|
249
252
|
onMoveRow && onMoveRow(dragIndex, targetIndex);
|
|
250
253
|
});
|
|
251
|
-
(0, _defineProperty2["default"])(_this, "getSelectedRowKeys", function (items) {
|
|
254
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getSelectedRowKeys", function (items) {
|
|
252
255
|
return (0, _reduce["default"])(items).call(items, function (result, item, index) {
|
|
253
256
|
item.checked && result.push(index);
|
|
254
257
|
return result;
|
|
255
258
|
}, []);
|
|
256
259
|
});
|
|
257
|
-
(0, _defineProperty2["default"])(_this, "getIndexInfo", function () {
|
|
260
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getIndexInfo", function () {
|
|
258
261
|
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
259
262
|
var _this$props4 = _this.props,
|
|
260
263
|
_this$props4$index = _this$props4.index,
|
|
@@ -269,7 +272,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
269
272
|
}
|
|
270
273
|
}] : [];
|
|
271
274
|
});
|
|
272
|
-
(0, _defineProperty2["default"])(_this, "setSortInfo", function (col, sortInfo) {
|
|
275
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setSortInfo", function (col, sortInfo) {
|
|
273
276
|
if (col.sorter === 'string') {
|
|
274
277
|
col.sortOrder = sortInfo.columnKey === col.key && sortInfo.order;
|
|
275
278
|
col.sorter = function (row1, row2) {
|
|
@@ -292,13 +295,13 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
292
295
|
delete col.sorter;
|
|
293
296
|
}
|
|
294
297
|
});
|
|
295
|
-
(0, _defineProperty2["default"])(_this, "setFilterInfo", function (col, filterInfo, visibleKey) {
|
|
298
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setFilterInfo", function (col, filterInfo, visibleKey) {
|
|
296
299
|
if ((0, _filter["default"])(col)) {
|
|
297
300
|
var _col$isDateFilterBySt = col.isDateFilterByStartAndEnd,
|
|
298
301
|
isDateFilterByStartAndEnd = _col$isDateFilterBySt === void 0 ? false : _col$isDateFilterBySt;
|
|
299
302
|
var onSearch = function onSearch(value) {
|
|
300
|
-
var
|
|
301
|
-
onTableChange =
|
|
303
|
+
var _ref10 = _this.props.callback || {},
|
|
304
|
+
onTableChange = _ref10.onTableChange;
|
|
302
305
|
var _this$props$sortInfo = _this.props.sortInfo,
|
|
303
306
|
sortInfo = _this$props$sortInfo === void 0 ? null : _this$props$sortInfo;
|
|
304
307
|
var newFilterInfo = (0, _assign["default"])({}, filterInfo, (0, _defineProperty2["default"])({}, col.key, value));
|
|
@@ -346,7 +349,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
346
349
|
}
|
|
347
350
|
delete col.filter;
|
|
348
351
|
});
|
|
349
|
-
(0, _defineProperty2["default"])(_this, "linkList", function (key, index, item) {
|
|
352
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "linkList", function (key, index, item) {
|
|
350
353
|
var linkTitleKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'fileName';
|
|
351
354
|
var list = item[key] || [];
|
|
352
355
|
return /*#__PURE__*/_react["default"].createElement("div", null, (0, _map["default"])(list).call(list, function (item2, index2) {
|
|
@@ -360,7 +363,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
360
363
|
}, (0, _concat["default"])(_context3 = "".concat(item2[linkTitleKey])).call(_context3, split));
|
|
361
364
|
}));
|
|
362
365
|
});
|
|
363
|
-
(0, _defineProperty2["default"])(_this, "waring", function (key, index, item, warningKey) {
|
|
366
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "waring", function (key, index, item, warningKey) {
|
|
364
367
|
var text = item[key] ? item[key] : '';
|
|
365
368
|
var color = item[warningKey] == 1 ? 'red' : 'rgba(0, 0, 0, 0.65)';
|
|
366
369
|
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", {
|
|
@@ -369,7 +372,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
369
372
|
}
|
|
370
373
|
}, text.title ? text.title : text));
|
|
371
374
|
});
|
|
372
|
-
(0, _defineProperty2["default"])(_this, "defaultList", function (key, index, item, text, link) {
|
|
375
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "defaultList", function (key, index, item, text, link) {
|
|
373
376
|
var _context4;
|
|
374
377
|
var onClick = (0, _bind["default"])(_context4 = _this.onLink).call(_context4, null, key, index, item);
|
|
375
378
|
if (link && typeof link === 'string') {
|
|
@@ -380,8 +383,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
380
383
|
}
|
|
381
384
|
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", null, text));
|
|
382
385
|
});
|
|
383
|
-
(0, _defineProperty2["default"])(_this, "tags", function (key, index, item,
|
|
384
|
-
var tags =
|
|
386
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "tags", function (key, index, item, _ref11) {
|
|
387
|
+
var tags = _ref11.tags;
|
|
385
388
|
var list = item[key] || [];
|
|
386
389
|
return /*#__PURE__*/_react["default"].createElement("div", null, (0, _map["default"])(list).call(list, function (item2, index2) {
|
|
387
390
|
var _context5;
|
|
@@ -416,7 +419,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
416
419
|
}, /*#__PURE__*/_react["default"].createElement(_tag["default"], tagProps, item2[tags])) : /*#__PURE__*/_react["default"].createElement(_tag["default"], tagProps, item2[tags]);
|
|
417
420
|
}));
|
|
418
421
|
});
|
|
419
|
-
(0, _defineProperty2["default"])(_this, "getColumns", function (cols, items) {
|
|
422
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumns", function (cols, items) {
|
|
420
423
|
var _context6, _context7;
|
|
421
424
|
var _this$props5 = _this.props,
|
|
422
425
|
sortInfo = _this$props5.sortInfo,
|
|
@@ -424,8 +427,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
424
427
|
var filterVisibleKey = _this.state.filterVisibleKey;
|
|
425
428
|
return (0, _map["default"])(_context6 = (0, _concat["default"])(_context7 = _this.getIndexInfo(items)).call(_context7, (0, _filter["default"])(cols).call(cols, function (col) {
|
|
426
429
|
return !col.hide;
|
|
427
|
-
}))).call(_context6, function (
|
|
428
|
-
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(
|
|
430
|
+
}))).call(_context6, function (_ref12) {
|
|
431
|
+
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref12), _ref12));
|
|
429
432
|
col.dataIndex = col.key;
|
|
430
433
|
col.className = col.key === 'index' ? 'ant-table-selection-column' : col.align ? (0, _variables["default"])('SuperTable')[col.align] : '';
|
|
431
434
|
col.noWrap && (col.className = (0, _variables["default"])('SuperTable').noWrap);
|
|
@@ -463,7 +466,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
463
466
|
return col;
|
|
464
467
|
});
|
|
465
468
|
});
|
|
466
|
-
(0, _defineProperty2["default"])(_this, "getText", function (value, options) {
|
|
469
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getText", function (value, options) {
|
|
467
470
|
if ((0, _isArray["default"])(value)) {
|
|
468
471
|
return (0, _map["default"])(value).call(value, function (v) {
|
|
469
472
|
return (0, _Control.getTitle)(v, options);
|
|
@@ -472,7 +475,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
472
475
|
return (0, _Control.getTitle)(value, options);
|
|
473
476
|
}
|
|
474
477
|
});
|
|
475
|
-
(0, _defineProperty2["default"])(_this, "link", function (key, index, item, text) {
|
|
478
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "link", function (key, index, item, text) {
|
|
476
479
|
var _context8;
|
|
477
480
|
var onClick = (0, _bind["default"])(_context8 = _this.onLink).call(_context8, null, key, index, item);
|
|
478
481
|
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
@@ -480,16 +483,16 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
480
483
|
onDoubleClick: _this.onLinkDouble
|
|
481
484
|
}, text);
|
|
482
485
|
});
|
|
483
|
-
(0, _defineProperty2["default"])(_this, "tooltip", function (key, index, item,
|
|
484
|
-
var tipLen =
|
|
485
|
-
options =
|
|
486
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "tooltip", function (key, index, item, _ref13) {
|
|
487
|
+
var tipLen = _ref13.tooltip,
|
|
488
|
+
options = _ref13.options;
|
|
486
489
|
var text = _this.getText(item[key], options);
|
|
487
490
|
var needTip = tipLen > 1 && text && typeof text === 'string' && text.length > tipLen;
|
|
488
491
|
return needTip ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
489
492
|
title: text
|
|
490
493
|
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _slice["default"])(text).call(text, 0, tipLen) + '...')) : /*#__PURE__*/_react["default"].createElement("span", null, (0, _isArray["default"])(text) ? text.join(',') : text);
|
|
491
494
|
});
|
|
492
|
-
(0, _defineProperty2["default"])(_this, "getImgSrc", function (value, options) {
|
|
495
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getImgSrc", function (value, options) {
|
|
493
496
|
var index = (0, _findIndex["default"])(options).call(options, function (obj) {
|
|
494
497
|
return obj.value == value;
|
|
495
498
|
});
|
|
@@ -502,7 +505,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
502
505
|
* @param options{array}:字段options
|
|
503
506
|
* @param dataSource{string,array}:数据源,如果列数据有多层则用此决定
|
|
504
507
|
*/
|
|
505
|
-
(0, _defineProperty2["default"])(_this, "getSourceText", function (item, key, options, dataSource) {
|
|
508
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getSourceText", function (item, key, options, dataSource) {
|
|
506
509
|
var value = {};
|
|
507
510
|
if (typeof dataSource === 'string') {
|
|
508
511
|
value = item[dataSource] || {};
|
|
@@ -522,14 +525,14 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
522
525
|
}
|
|
523
526
|
return _this.getText(value, options);
|
|
524
527
|
});
|
|
525
|
-
(0, _defineProperty2["default"])(_this, "getDataSource", function (items, cols) {
|
|
528
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getDataSource", function (items, cols) {
|
|
526
529
|
return (0, _map["default"])(items).call(items, function (item, index) {
|
|
527
|
-
return (0, _reduce["default"])(cols).call(cols, function (result,
|
|
528
|
-
var key =
|
|
529
|
-
options =
|
|
530
|
-
link =
|
|
531
|
-
icon =
|
|
532
|
-
dataSource =
|
|
530
|
+
return (0, _reduce["default"])(cols).call(cols, function (result, _ref14) {
|
|
531
|
+
var key = _ref14.key,
|
|
532
|
+
options = _ref14.options,
|
|
533
|
+
link = _ref14.link,
|
|
534
|
+
icon = _ref14.icon,
|
|
535
|
+
dataSource = _ref14.dataSource;
|
|
533
536
|
if (link) {
|
|
534
537
|
if (typeof link === 'boolean') {
|
|
535
538
|
result[key] = _this.link(key, index, item, _this.getText(item[key], options));
|
|
@@ -555,7 +558,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
555
558
|
});
|
|
556
559
|
});
|
|
557
560
|
});
|
|
558
|
-
(0, _defineProperty2["default"])(_this, "getPropsByCheckbox", function (items) {
|
|
561
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPropsByCheckbox", function (items) {
|
|
559
562
|
var _this$props6 = _this.props,
|
|
560
563
|
_this$props6$checkbox = _this$props6.checkbox,
|
|
561
564
|
checkbox = _this$props6$checkbox === void 0 ? true : _this$props6$checkbox,
|
|
@@ -640,7 +643,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
640
643
|
};
|
|
641
644
|
}
|
|
642
645
|
});
|
|
643
|
-
(0, _defineProperty2["default"])(_this, "getRowProps", function (onRowClick, items) {
|
|
646
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getRowProps", function (onRowClick, items) {
|
|
644
647
|
return function (record) {
|
|
645
648
|
var item = items[record.key];
|
|
646
649
|
var rowProps = {
|
|
@@ -657,7 +660,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
657
660
|
return rowProps;
|
|
658
661
|
};
|
|
659
662
|
});
|
|
660
|
-
(0, _defineProperty2["default"])(_this, "getRowPropsForDrag", function () {
|
|
663
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getRowPropsForDrag", function () {
|
|
661
664
|
return function (record, index) {
|
|
662
665
|
return {
|
|
663
666
|
index: index,
|
|
@@ -665,7 +668,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
665
668
|
};
|
|
666
669
|
};
|
|
667
670
|
});
|
|
668
|
-
(0, _defineProperty2["default"])(_this, "getItems", function () {
|
|
671
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getItems", function () {
|
|
669
672
|
var _this$props7 = _this.props,
|
|
670
673
|
items = _this$props7.items,
|
|
671
674
|
cols = _this$props7.cols,
|
|
@@ -677,10 +680,10 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
677
680
|
var resItems = items;
|
|
678
681
|
if (!dragSort && items.length > 1) {
|
|
679
682
|
if (pageTotal || searchTotal) {
|
|
680
|
-
var totalItem = (0, _reduce["default"])(cols).call(cols, function (result,
|
|
681
|
-
var key =
|
|
682
|
-
|
|
683
|
-
total =
|
|
683
|
+
var totalItem = (0, _reduce["default"])(cols).call(cols, function (result, _ref15) {
|
|
684
|
+
var key = _ref15.key,
|
|
685
|
+
_ref15$total = _ref15.total,
|
|
686
|
+
total = _ref15$total === void 0 ? false : _ref15$total;
|
|
684
687
|
if (total) {
|
|
685
688
|
result[key] = (0, _parseFloat2["default"])(Number((0, _reduce["default"])(items).call(items, function (result, item) {
|
|
686
689
|
return (0, _parseFloat2["default"])(String(item[key] || 0)) + result;
|
|
@@ -702,7 +705,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
702
705
|
}
|
|
703
706
|
return resItems;
|
|
704
707
|
});
|
|
705
|
-
(0, _defineProperty2["default"])(_this, "toTotalFooter", function () {
|
|
708
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toTotalFooter", function () {
|
|
706
709
|
var _this$props8 = _this.props,
|
|
707
710
|
cols = _this$props8.cols,
|
|
708
711
|
items = _this$props8.items,
|
|
@@ -718,11 +721,11 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
718
721
|
return item.checked;
|
|
719
722
|
});
|
|
720
723
|
var countItems = checkedItems.length ? checkedItems : items;
|
|
721
|
-
var totalItems = (0, _map["default"])(totalCols).call(totalCols, function (
|
|
722
|
-
var title =
|
|
723
|
-
key =
|
|
724
|
-
|
|
725
|
-
props =
|
|
724
|
+
var totalItems = (0, _map["default"])(totalCols).call(totalCols, function (_ref16) {
|
|
725
|
+
var title = _ref16.title,
|
|
726
|
+
key = _ref16.key,
|
|
727
|
+
_ref16$props = _ref16.props,
|
|
728
|
+
props = _ref16$props === void 0 ? {} : _ref16$props;
|
|
726
729
|
var value = (0, _reduce["default"])(countItems).call(countItems, function (result, item) {
|
|
727
730
|
return (0, _parseFloat2["default"])((result + Number(item[key] || 0)).toFixed(props.precision || 6));
|
|
728
731
|
}, 0);
|
|
@@ -740,9 +743,9 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
740
743
|
style: {
|
|
741
744
|
marginRight: "15px"
|
|
742
745
|
}
|
|
743
|
-
}, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), (0, _map["default"])(totalItems).call(totalItems, function (
|
|
744
|
-
var title =
|
|
745
|
-
value =
|
|
746
|
+
}, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), (0, _map["default"])(totalItems).call(totalItems, function (_ref17, index) {
|
|
747
|
+
var title = _ref17.title,
|
|
748
|
+
value = _ref17.value;
|
|
746
749
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
747
750
|
key: index,
|
|
748
751
|
style: {
|
|
@@ -758,7 +761,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
758
761
|
return null;
|
|
759
762
|
}
|
|
760
763
|
});
|
|
761
|
-
(0, _defineProperty2["default"])(_this, "getProps", function () {
|
|
764
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getProps", function () {
|
|
762
765
|
var _this$props9 = _this.props,
|
|
763
766
|
cols = _this$props9.cols,
|
|
764
767
|
_this$props9$isPaging = _this$props9.isPaging,
|
|
@@ -794,13 +797,13 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
794
797
|
}, extraProps);
|
|
795
798
|
return renderProps;
|
|
796
799
|
});
|
|
797
|
-
(0, _defineProperty2["default"])(_this, "setScroll", function () {
|
|
798
|
-
var _this$
|
|
799
|
-
maxHeight = _this$
|
|
800
|
-
pageTotal = _this$
|
|
801
|
-
searchTotal = _this$
|
|
800
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setScroll", function () {
|
|
801
|
+
var _this$props10 = _this.props,
|
|
802
|
+
maxHeight = _this$props10.maxHeight,
|
|
803
|
+
pageTotal = _this$props10.pageTotal,
|
|
804
|
+
searchTotal = _this$props10.searchTotal;
|
|
802
805
|
if (maxHeight && _this.getItems().length) {
|
|
803
|
-
var root = _reactDom["default"].findDOMNode(_this);
|
|
806
|
+
var root = _reactDom["default"].findDOMNode((0, _assertThisInitialized2["default"])(_this));
|
|
804
807
|
var container = root.getElementsByClassName('ant-table-body')[0];
|
|
805
808
|
var header = root.getElementsByClassName('ant-table-thead')[0];
|
|
806
809
|
var tbody = root.getElementsByClassName('ant-table-tbody')[0];
|
|
@@ -815,8 +818,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
815
818
|
});
|
|
816
819
|
return _this;
|
|
817
820
|
}
|
|
818
|
-
(0,
|
|
819
|
-
return (0, _createClass2["default"])(SuperTable, [{
|
|
821
|
+
(0, _createClass2["default"])(SuperTable, [{
|
|
820
822
|
key: "shouldComponentUpdate",
|
|
821
823
|
value: function shouldComponentUpdate(props, state) {
|
|
822
824
|
var _this2 = this;
|
|
@@ -843,6 +845,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
843
845
|
}));
|
|
844
846
|
}
|
|
845
847
|
}]);
|
|
848
|
+
return SuperTable;
|
|
846
849
|
}(_react["default"].Component);
|
|
847
850
|
(0, _defineProperty2["default"])(SuperTable, "propTypes", {
|
|
848
851
|
cols: _propTypes["default"].arrayOf(_propTypes["default"].shape(ColType)).isRequired,
|