cloud-b2b 1.1.63 → 1.1.65
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 +11 -8
- package/es/CodeInput/CodeInput.js +19 -16
- 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 +22 -19
- 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 +110 -109
- 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 +100 -96
- 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 +71 -68
- package/es/SuperTable2/SuperTable2.js +88 -85
- 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 +14 -11
- package/es/SuperUpload/SuperUpload.js +74 -74
- 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 +11 -8
- package/lib/CodeInput/CodeInput.js +19 -16
- 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 +22 -19
- 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 +112 -110
- 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 +102 -97
- 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 +71 -68
- package/lib/SuperTable2/SuperTable2.js +90 -86
- 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 +14 -11
- package/lib/SuperUpload/SuperUpload.js +76 -75
- 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
|
@@ -36,9 +36,10 @@ var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime-
|
|
|
36
36
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
37
37
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
38
38
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
39
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
40
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
39
41
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
40
42
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
41
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
42
43
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
43
44
|
var _react = _interopRequireDefault(require("react"));
|
|
44
45
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -50,9 +51,9 @@ var _DragSortRow = _interopRequireDefault(require("./DragSortRow"));
|
|
|
50
51
|
var _variables = _interopRequireDefault(require("../variables"));
|
|
51
52
|
var _excluded = ["onRowClick"];
|
|
52
53
|
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; }
|
|
53
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context9,
|
|
54
|
-
function
|
|
55
|
-
function _isNativeReflectConstruct() {
|
|
54
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context9, _context10; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty2(_context9 = ownKeys(Object(t), !0)).call(_context9, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty2(_context10 = ownKeys(Object(t))).call(_context10, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
55
|
+
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); }; }
|
|
56
|
+
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; } }
|
|
56
57
|
/**
|
|
57
58
|
* sorter: [可选],不传表示该列不支持排序;为string表示按字符串排序;为number表示按数字大小排序
|
|
58
59
|
* filter: [可选],是否支持过滤,默认为false
|
|
@@ -113,6 +114,8 @@ var CallbackType = {
|
|
|
113
114
|
* searchTotal: [可选], 表格汇总数据对象,该属性不为空时pageTotal默认开启,当dragSort为true时,该选项失效
|
|
114
115
|
*/
|
|
115
116
|
var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
117
|
+
(0, _inherits2["default"])(SuperTable, _React$Component);
|
|
118
|
+
var _super = _createSuper(SuperTable);
|
|
116
119
|
function SuperTable() {
|
|
117
120
|
var _context;
|
|
118
121
|
var _this;
|
|
@@ -120,18 +123,18 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
120
123
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
121
124
|
args[_key] = arguments[_key];
|
|
122
125
|
}
|
|
123
|
-
_this =
|
|
124
|
-
(0, _defineProperty2["default"])(_this, "state", {
|
|
126
|
+
_this = _super.call.apply(_super, (0, _concat["default"])(_context = [this]).call(_context, args));
|
|
127
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
|
|
125
128
|
filterVisibleKey: ''
|
|
126
129
|
});
|
|
127
|
-
(0, _defineProperty2["default"])(_this, "onTableChange", function (pagination, filters, sorter) {
|
|
130
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onTableChange", function (pagination, filters, sorter) {
|
|
128
131
|
var _ref = _this.props.callback || {},
|
|
129
132
|
onTableChange = _ref.onTableChange;
|
|
130
133
|
var _this$props$filterInf = _this.props.filterInfo,
|
|
131
134
|
filterInfo = _this$props$filterInf === void 0 ? null : _this$props$filterInf;
|
|
132
135
|
onTableChange && onTableChange(sorter, filterInfo);
|
|
133
136
|
});
|
|
134
|
-
(0, _defineProperty2["default"])(_this, "onChange", function () {
|
|
137
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function () {
|
|
135
138
|
var selectedKeyArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
136
139
|
var _ref2 = _this.props.callback || {},
|
|
137
140
|
onCheck = _ref2.onCheck;
|
|
@@ -178,22 +181,22 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
178
181
|
}
|
|
179
182
|
}
|
|
180
183
|
});
|
|
181
|
-
(0, _defineProperty2["default"])(_this, "onCheckChange", function (selectedKeys) {
|
|
184
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onCheckChange", function (selectedKeys) {
|
|
182
185
|
var _ref3 = _this.props.callback || {},
|
|
183
186
|
onCheck = _ref3.onCheck;
|
|
184
187
|
onCheck && onCheck(selectedKeys);
|
|
185
188
|
});
|
|
186
|
-
(0, _defineProperty2["default"])(_this, "onRadioChange", function (selectedKeys) {
|
|
189
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRadioChange", function (selectedKeys) {
|
|
187
190
|
var _ref4 = _this.props.callback || {},
|
|
188
191
|
onRadio = _ref4.onRadio;
|
|
189
192
|
onRadio && onRadio(selectedKeys);
|
|
190
193
|
});
|
|
191
|
-
(0, _defineProperty2["default"])(_this, "onRadioRowClick", function (record) {
|
|
194
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRadioRowClick", function (record) {
|
|
192
195
|
var _ref5 = _this.props.callback || {},
|
|
193
196
|
onRadio = _ref5.onRadio;
|
|
194
197
|
onRadio && onRadio([record.key]);
|
|
195
198
|
});
|
|
196
|
-
(0, _defineProperty2["default"])(_this, "onRowClick", function (record) {
|
|
199
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRowClick", function (record) {
|
|
197
200
|
var _this$props2 = _this.props,
|
|
198
201
|
_this$props2$isWeaken = _this$props2.isWeaken,
|
|
199
202
|
isWeaken = _this$props2$isWeaken === void 0 ? false : _this$props2$isWeaken,
|
|
@@ -223,33 +226,33 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
223
226
|
}
|
|
224
227
|
}, 250);
|
|
225
228
|
});
|
|
226
|
-
(0, _defineProperty2["default"])(_this, "onDoubleClick", function (record) {
|
|
229
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDoubleClick", function (record) {
|
|
227
230
|
clearTimeout(_this.timer);
|
|
228
231
|
var _ref7 = _this.props.callback || {},
|
|
229
232
|
onDoubleClick = _ref7.onDoubleClick;
|
|
230
233
|
onDoubleClick && onDoubleClick(record.key);
|
|
231
234
|
});
|
|
232
|
-
(0, _defineProperty2["default"])(_this, "onLink", function (key, index, item, e) {
|
|
235
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onLink", function (key, index, item, e) {
|
|
233
236
|
var _ref8 = _this.props.callback || {},
|
|
234
237
|
onLink = _ref8.onLink;
|
|
235
238
|
onLink && onLink(key, index, item);
|
|
236
239
|
e.stopPropagation();
|
|
237
240
|
});
|
|
238
|
-
(0, _defineProperty2["default"])(_this, "onLinkDouble", function (e) {
|
|
241
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onLinkDouble", function (e) {
|
|
239
242
|
e.stopPropagation();
|
|
240
243
|
});
|
|
241
|
-
(0, _defineProperty2["default"])(_this, "onMoveRow", function (dragIndex, targetIndex) {
|
|
244
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onMoveRow", function (dragIndex, targetIndex) {
|
|
242
245
|
var _ref9 = _this.props.callback || {},
|
|
243
246
|
onMoveRow = _ref9.onMoveRow;
|
|
244
247
|
onMoveRow && onMoveRow(dragIndex, targetIndex);
|
|
245
248
|
});
|
|
246
|
-
(0, _defineProperty2["default"])(_this, "getSelectedRowKeys", function (items) {
|
|
249
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getSelectedRowKeys", function (items) {
|
|
247
250
|
return (0, _reduce["default"])(items).call(items, function (result, item, index) {
|
|
248
251
|
item.checked && result.push(index);
|
|
249
252
|
return result;
|
|
250
253
|
}, []);
|
|
251
254
|
});
|
|
252
|
-
(0, _defineProperty2["default"])(_this, "getIndexInfo", function () {
|
|
255
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getIndexInfo", function () {
|
|
253
256
|
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
254
257
|
var _this$props4 = _this.props,
|
|
255
258
|
_this$props4$index = _this$props4.index,
|
|
@@ -264,7 +267,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
264
267
|
}
|
|
265
268
|
}] : [];
|
|
266
269
|
});
|
|
267
|
-
(0, _defineProperty2["default"])(_this, "setSortInfo", function (col, sortInfo) {
|
|
270
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setSortInfo", function (col, sortInfo) {
|
|
268
271
|
if (col.sorter === 'string') {
|
|
269
272
|
col.sortOrder = sortInfo.columnKey === col.key && sortInfo.order;
|
|
270
273
|
col.sorter = function (row1, row2) {
|
|
@@ -287,13 +290,13 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
287
290
|
delete col.sorter;
|
|
288
291
|
}
|
|
289
292
|
});
|
|
290
|
-
(0, _defineProperty2["default"])(_this, "setFilterInfo", function (col, filterInfo, visibleKey) {
|
|
293
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setFilterInfo", function (col, filterInfo, visibleKey) {
|
|
291
294
|
if ((0, _filter["default"])(col)) {
|
|
292
295
|
var _col$isDateFilterBySt = col.isDateFilterByStartAndEnd,
|
|
293
296
|
isDateFilterByStartAndEnd = _col$isDateFilterBySt === void 0 ? false : _col$isDateFilterBySt;
|
|
294
297
|
var onSearch = function onSearch(value) {
|
|
295
|
-
var
|
|
296
|
-
onTableChange =
|
|
298
|
+
var _ref10 = _this.props.callback || {},
|
|
299
|
+
onTableChange = _ref10.onTableChange;
|
|
297
300
|
var _this$props$sortInfo = _this.props.sortInfo,
|
|
298
301
|
sortInfo = _this$props$sortInfo === void 0 ? null : _this$props$sortInfo;
|
|
299
302
|
var newFilterInfo = (0, _assign["default"])({}, filterInfo, (0, _defineProperty2["default"])({}, col.key, value));
|
|
@@ -341,7 +344,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
341
344
|
}
|
|
342
345
|
delete col.filter;
|
|
343
346
|
});
|
|
344
|
-
(0, _defineProperty2["default"])(_this, "linkList", function (key, index, item) {
|
|
347
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "linkList", function (key, index, item) {
|
|
345
348
|
var linkTitleKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'fileName';
|
|
346
349
|
var list = item[key] || [];
|
|
347
350
|
return /*#__PURE__*/_react["default"].createElement("div", null, (0, _map["default"])(list).call(list, function (item2, index2) {
|
|
@@ -355,7 +358,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
355
358
|
}, (0, _concat["default"])(_context3 = "".concat(item2[linkTitleKey])).call(_context3, split));
|
|
356
359
|
}));
|
|
357
360
|
});
|
|
358
|
-
(0, _defineProperty2["default"])(_this, "waring", function (key, index, item, warningKey) {
|
|
361
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "waring", function (key, index, item, warningKey) {
|
|
359
362
|
var text = item[key] ? item[key] : '';
|
|
360
363
|
var color = item[warningKey] == 1 ? 'red' : 'rgba(0, 0, 0, 0.65)';
|
|
361
364
|
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", {
|
|
@@ -364,7 +367,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
364
367
|
}
|
|
365
368
|
}, text.title ? text.title : text));
|
|
366
369
|
});
|
|
367
|
-
(0, _defineProperty2["default"])(_this, "defaultList", function (key, index, item, text, link) {
|
|
370
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "defaultList", function (key, index, item, text, link) {
|
|
368
371
|
var _context4;
|
|
369
372
|
var onClick = (0, _bind["default"])(_context4 = _this.onLink).call(_context4, null, key, index, item);
|
|
370
373
|
if (link && typeof link === 'string') {
|
|
@@ -375,7 +378,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
375
378
|
}
|
|
376
379
|
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", null, text));
|
|
377
380
|
});
|
|
378
|
-
(0, _defineProperty2["default"])(_this, "getColumns", function (cols, items) {
|
|
381
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumns", function (cols, items) {
|
|
379
382
|
var _context5, _context6;
|
|
380
383
|
var _this$props5 = _this.props,
|
|
381
384
|
sortInfo = _this$props5.sortInfo,
|
|
@@ -383,8 +386,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
383
386
|
var filterVisibleKey = _this.state.filterVisibleKey;
|
|
384
387
|
return (0, _map["default"])(_context5 = (0, _concat["default"])(_context6 = _this.getIndexInfo(items)).call(_context6, (0, _filter["default"])(cols).call(cols, function (col) {
|
|
385
388
|
return !col.hide;
|
|
386
|
-
}))).call(_context5, function (
|
|
387
|
-
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(
|
|
389
|
+
}))).call(_context5, function (_ref11) {
|
|
390
|
+
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref11), _ref11));
|
|
388
391
|
col.dataIndex = col.key;
|
|
389
392
|
col.className = col.key === 'index' ? 'ant-table-selection-column' : col.align ? (0, _variables["default"])('SuperTable')[col.align] : '';
|
|
390
393
|
col.noWrap && (col.className = (0, _variables["default"])('SuperTable').noWrap);
|
|
@@ -414,7 +417,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
414
417
|
return col;
|
|
415
418
|
});
|
|
416
419
|
});
|
|
417
|
-
(0, _defineProperty2["default"])(_this, "getText", function (value, options) {
|
|
420
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getText", function (value, options) {
|
|
418
421
|
if ((0, _isArray["default"])(value)) {
|
|
419
422
|
return (0, _map["default"])(value).call(value, function (v) {
|
|
420
423
|
return (0, _Control.getTitle)(v, options);
|
|
@@ -423,7 +426,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
423
426
|
return (0, _Control.getTitle)(value, options);
|
|
424
427
|
}
|
|
425
428
|
});
|
|
426
|
-
(0, _defineProperty2["default"])(_this, "link", function (key, index, item, text) {
|
|
429
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "link", function (key, index, item, text) {
|
|
427
430
|
var _context7;
|
|
428
431
|
var onClick = (0, _bind["default"])(_context7 = _this.onLink).call(_context7, null, key, index, item);
|
|
429
432
|
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
@@ -431,16 +434,16 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
431
434
|
onDoubleClick: _this.onLinkDouble
|
|
432
435
|
}, text);
|
|
433
436
|
});
|
|
434
|
-
(0, _defineProperty2["default"])(_this, "tooltip", function (key, index, item,
|
|
435
|
-
var tipLen =
|
|
436
|
-
options =
|
|
437
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "tooltip", function (key, index, item, _ref12) {
|
|
438
|
+
var tipLen = _ref12.tooltip,
|
|
439
|
+
options = _ref12.options;
|
|
437
440
|
var text = _this.getText(item[key], options);
|
|
438
441
|
var needTip = tipLen > 1 && text && typeof text === 'string' && text.length > tipLen;
|
|
439
442
|
return needTip ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
440
443
|
title: text
|
|
441
444
|
}, /*#__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);
|
|
442
445
|
});
|
|
443
|
-
(0, _defineProperty2["default"])(_this, "getImgSrc", function (value, options) {
|
|
446
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getImgSrc", function (value, options) {
|
|
444
447
|
var index = (0, _findIndex["default"])(options).call(options, function (obj) {
|
|
445
448
|
return obj.value == value;
|
|
446
449
|
});
|
|
@@ -453,7 +456,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
453
456
|
* @param options{array}:字段options
|
|
454
457
|
* @param dataSource{string,array}:数据源,如果列数据有多层则用此决定
|
|
455
458
|
*/
|
|
456
|
-
(0, _defineProperty2["default"])(_this, "getSourceText", function (item, key, options, dataSource) {
|
|
459
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getSourceText", function (item, key, options, dataSource) {
|
|
457
460
|
var value = {};
|
|
458
461
|
if (typeof dataSource === 'string') {
|
|
459
462
|
value = item[dataSource] || {};
|
|
@@ -473,14 +476,14 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
473
476
|
}
|
|
474
477
|
return _this.getText(value, options);
|
|
475
478
|
});
|
|
476
|
-
(0, _defineProperty2["default"])(_this, "getDataSource", function (items, cols) {
|
|
479
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getDataSource", function (items, cols) {
|
|
477
480
|
return (0, _map["default"])(items).call(items, function (item, index) {
|
|
478
|
-
return (0, _reduce["default"])(cols).call(cols, function (result,
|
|
479
|
-
var key =
|
|
480
|
-
options =
|
|
481
|
-
link =
|
|
482
|
-
icon =
|
|
483
|
-
dataSource =
|
|
481
|
+
return (0, _reduce["default"])(cols).call(cols, function (result, _ref13) {
|
|
482
|
+
var key = _ref13.key,
|
|
483
|
+
options = _ref13.options,
|
|
484
|
+
link = _ref13.link,
|
|
485
|
+
icon = _ref13.icon,
|
|
486
|
+
dataSource = _ref13.dataSource;
|
|
484
487
|
if (link) {
|
|
485
488
|
if (typeof link === 'boolean') {
|
|
486
489
|
result[key] = _this.link(key, index, item, _this.getText(item[key], options));
|
|
@@ -506,7 +509,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
506
509
|
});
|
|
507
510
|
});
|
|
508
511
|
});
|
|
509
|
-
(0, _defineProperty2["default"])(_this, "getPropsByCheckbox", function (items) {
|
|
512
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPropsByCheckbox", function (items) {
|
|
510
513
|
var _this$props6 = _this.props,
|
|
511
514
|
_this$props6$checkbox = _this$props6.checkbox,
|
|
512
515
|
checkbox = _this$props6$checkbox === void 0 ? true : _this$props6$checkbox,
|
|
@@ -591,7 +594,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
591
594
|
};
|
|
592
595
|
}
|
|
593
596
|
});
|
|
594
|
-
(0, _defineProperty2["default"])(_this, "getRowProps", function (onRowClick) {
|
|
597
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getRowProps", function (onRowClick) {
|
|
595
598
|
return function (record) {
|
|
596
599
|
return {
|
|
597
600
|
onClick: function onClick() {
|
|
@@ -603,7 +606,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
603
606
|
};
|
|
604
607
|
};
|
|
605
608
|
});
|
|
606
|
-
(0, _defineProperty2["default"])(_this, "getRowPropsForDrag", function () {
|
|
609
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getRowPropsForDrag", function () {
|
|
607
610
|
return function (record, index) {
|
|
608
611
|
return {
|
|
609
612
|
index: index,
|
|
@@ -611,7 +614,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
611
614
|
};
|
|
612
615
|
};
|
|
613
616
|
});
|
|
614
|
-
(0, _defineProperty2["default"])(_this, "getItems", function () {
|
|
617
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getItems", function () {
|
|
615
618
|
var _this$props7 = _this.props,
|
|
616
619
|
items = _this$props7.items,
|
|
617
620
|
cols = _this$props7.cols,
|
|
@@ -623,10 +626,10 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
623
626
|
var resItems = items;
|
|
624
627
|
if (!dragSort && items.length > 1) {
|
|
625
628
|
if (pageTotal || searchTotal) {
|
|
626
|
-
var totalItem = (0, _reduce["default"])(cols).call(cols, function (result,
|
|
627
|
-
var key =
|
|
628
|
-
|
|
629
|
-
total =
|
|
629
|
+
var totalItem = (0, _reduce["default"])(cols).call(cols, function (result, _ref14) {
|
|
630
|
+
var key = _ref14.key,
|
|
631
|
+
_ref14$total = _ref14.total,
|
|
632
|
+
total = _ref14$total === void 0 ? false : _ref14$total;
|
|
630
633
|
if (total) {
|
|
631
634
|
result[key] = (0, _parseFloat2["default"])(Number((0, _reduce["default"])(items).call(items, function (result, item) {
|
|
632
635
|
return (0, _parseFloat2["default"])(String(item[key] || 0)) + result;
|
|
@@ -648,7 +651,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
648
651
|
}
|
|
649
652
|
return resItems;
|
|
650
653
|
});
|
|
651
|
-
(0, _defineProperty2["default"])(_this, "toTotalFooter", function () {
|
|
654
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toTotalFooter", function () {
|
|
652
655
|
var _this$props8 = _this.props,
|
|
653
656
|
cols = _this$props8.cols,
|
|
654
657
|
items = _this$props8.items,
|
|
@@ -664,11 +667,11 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
664
667
|
return item.checked;
|
|
665
668
|
});
|
|
666
669
|
var countItems = checkedItems.length ? checkedItems : items;
|
|
667
|
-
var totalItems = (0, _map["default"])(totalCols).call(totalCols, function (
|
|
668
|
-
var title =
|
|
669
|
-
key =
|
|
670
|
-
|
|
671
|
-
props =
|
|
670
|
+
var totalItems = (0, _map["default"])(totalCols).call(totalCols, function (_ref15) {
|
|
671
|
+
var title = _ref15.title,
|
|
672
|
+
key = _ref15.key,
|
|
673
|
+
_ref15$props = _ref15.props,
|
|
674
|
+
props = _ref15$props === void 0 ? {} : _ref15$props;
|
|
672
675
|
var value = (0, _reduce["default"])(countItems).call(countItems, function (result, item) {
|
|
673
676
|
return (0, _parseFloat2["default"])((result + Number(item[key] || 0)).toFixed(props.precision || 6));
|
|
674
677
|
}, 0);
|
|
@@ -686,9 +689,9 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
686
689
|
style: {
|
|
687
690
|
marginRight: "15px"
|
|
688
691
|
}
|
|
689
|
-
}, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), (0, _map["default"])(totalItems).call(totalItems, function (
|
|
690
|
-
var title =
|
|
691
|
-
value =
|
|
692
|
+
}, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), (0, _map["default"])(totalItems).call(totalItems, function (_ref16, index) {
|
|
693
|
+
var title = _ref16.title,
|
|
694
|
+
value = _ref16.value;
|
|
692
695
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
693
696
|
key: index,
|
|
694
697
|
style: {
|
|
@@ -704,7 +707,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
704
707
|
return null;
|
|
705
708
|
}
|
|
706
709
|
});
|
|
707
|
-
(0, _defineProperty2["default"])(_this, "getProps", function () {
|
|
710
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getProps", function () {
|
|
708
711
|
var _this$props9 = _this.props,
|
|
709
712
|
cols = _this$props9.cols,
|
|
710
713
|
_this$props9$isPaging = _this$props9.isPaging,
|
|
@@ -740,13 +743,13 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
740
743
|
}, extraProps);
|
|
741
744
|
return renderProps;
|
|
742
745
|
});
|
|
743
|
-
(0, _defineProperty2["default"])(_this, "setScroll", function () {
|
|
744
|
-
var _this$
|
|
745
|
-
maxHeight = _this$
|
|
746
|
-
pageTotal = _this$
|
|
747
|
-
searchTotal = _this$
|
|
746
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setScroll", function () {
|
|
747
|
+
var _this$props10 = _this.props,
|
|
748
|
+
maxHeight = _this$props10.maxHeight,
|
|
749
|
+
pageTotal = _this$props10.pageTotal,
|
|
750
|
+
searchTotal = _this$props10.searchTotal;
|
|
748
751
|
if (maxHeight && _this.getItems().length) {
|
|
749
|
-
var root = _reactDom["default"].findDOMNode(_this);
|
|
752
|
+
var root = _reactDom["default"].findDOMNode((0, _assertThisInitialized2["default"])(_this));
|
|
750
753
|
var container = root.getElementsByClassName('ant-table-body')[0];
|
|
751
754
|
var header = root.getElementsByClassName('ant-table-thead')[0];
|
|
752
755
|
var tbody = root.getElementsByClassName('ant-table-tbody')[0];
|
|
@@ -761,8 +764,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
761
764
|
});
|
|
762
765
|
return _this;
|
|
763
766
|
}
|
|
764
|
-
(0,
|
|
765
|
-
return (0, _createClass2["default"])(SuperTable, [{
|
|
767
|
+
(0, _createClass2["default"])(SuperTable, [{
|
|
766
768
|
key: "shouldComponentUpdate",
|
|
767
769
|
value: function shouldComponentUpdate(props, state) {
|
|
768
770
|
var _this2 = this;
|
|
@@ -789,6 +791,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
789
791
|
}));
|
|
790
792
|
}
|
|
791
793
|
}]);
|
|
794
|
+
return SuperTable;
|
|
792
795
|
}(_react["default"].Component);
|
|
793
796
|
(0, _defineProperty2["default"])(SuperTable, "propTypes", {
|
|
794
797
|
cols: _propTypes["default"].arrayOf(_propTypes["default"].shape(ColType)).isRequired,
|