cloud-b2b 1.1.56 → 1.1.57
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 +26 -20
- 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/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 -100
- 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 +39 -29
- 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 +74 -74
- 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 +26 -20
- 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/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 -102
- 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 +39 -29
- 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 +75 -76
- 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
|
@@ -20,18 +20,17 @@ import _Checkbox from "antd/es/checkbox";
|
|
|
20
20
|
import _Icon from "antd/es/icon";
|
|
21
21
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
22
22
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
23
|
-
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
|
24
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
25
23
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
26
24
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
25
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
27
26
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
28
27
|
import _Radio from "antd/es/radio";
|
|
29
28
|
var _excluded = ["onRowClick"];
|
|
30
|
-
function _createForOfIteratorHelper(
|
|
31
|
-
function _unsupportedIterableToArray(
|
|
32
|
-
function _arrayLikeToArray(
|
|
29
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && _getIteratorMethod(r) || r["@@iterator"]; if (!t) { if (_Array$isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
30
|
+
function _unsupportedIterableToArray(r, a) { if (r) { var _context18; if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = _sliceInstanceProperty(_context18 = {}.toString.call(r)).call(_context18, 8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? _Array$from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
31
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
33
32
|
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; }
|
|
34
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
33
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context16, _context17; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context16 = ownKeys(Object(t), !0)).call(_context16, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context17 = ownKeys(Object(t))).call(_context17, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
35
34
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
36
35
|
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
|
37
36
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
@@ -41,8 +40,8 @@ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/insta
|
|
|
41
40
|
import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
|
|
42
41
|
import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
|
|
43
42
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
44
|
-
function
|
|
45
|
-
function _isNativeReflectConstruct() {
|
|
43
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
44
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
46
45
|
import React from 'react';
|
|
47
46
|
import PropTypes from 'prop-types';
|
|
48
47
|
import ReactDOM from 'react-dom';
|
|
@@ -126,8 +125,6 @@ var CallbackType = {
|
|
|
126
125
|
* isEmphasized: [可选],是否强调,行字体加粗显示, 除了isEmphasized设置为true之外,加粗行数据里要设置__isEmphasized为true
|
|
127
126
|
*/
|
|
128
127
|
var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
129
|
-
_inherits(SuperTable2, _React$Component);
|
|
130
|
-
var _super = _createSuper(SuperTable2);
|
|
131
128
|
function SuperTable2() {
|
|
132
129
|
var _context;
|
|
133
130
|
var _this;
|
|
@@ -135,22 +132,22 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
135
132
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
136
133
|
args[_key] = arguments[_key];
|
|
137
134
|
}
|
|
138
|
-
_this =
|
|
139
|
-
_defineProperty(
|
|
135
|
+
_this = _callSuper(this, SuperTable2, _concatInstanceProperty(_context = []).call(_context, args));
|
|
136
|
+
_defineProperty(_this, "onSwitch", function (key, rowIndex) {
|
|
140
137
|
return function (value) {
|
|
141
138
|
var _ref = _this.props.callback || {},
|
|
142
139
|
onContentChange = _ref.onContentChange;
|
|
143
140
|
onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
|
|
144
141
|
};
|
|
145
142
|
});
|
|
146
|
-
_defineProperty(
|
|
143
|
+
_defineProperty(_this, "onCheck", function (key, rowIndex) {
|
|
147
144
|
return function (e) {
|
|
148
145
|
var _ref2 = _this.props.callback || {},
|
|
149
146
|
onCheck = _ref2.onCheck;
|
|
150
147
|
onCheck && onCheck(_this.getIndex(rowIndex), key, e.target.checked);
|
|
151
148
|
};
|
|
152
149
|
});
|
|
153
|
-
_defineProperty(
|
|
150
|
+
_defineProperty(_this, "onChange", function (key, rowIndex) {
|
|
154
151
|
return function (value) {
|
|
155
152
|
var _ref3 = _this.props.callback || {},
|
|
156
153
|
onContentChange = _ref3.onContentChange;
|
|
@@ -158,7 +155,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
158
155
|
onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
|
|
159
156
|
};
|
|
160
157
|
});
|
|
161
|
-
_defineProperty(
|
|
158
|
+
_defineProperty(_this, "onDoubleChange1", function (key, rowIndex) {
|
|
162
159
|
return function (doublekey, value) {
|
|
163
160
|
var _ref4 = _this.props.callback || {},
|
|
164
161
|
onContentChange = _ref4.onContentChange;
|
|
@@ -166,28 +163,28 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
166
163
|
onContentChange && onContentChange(_this.getIndex(rowIndex), doublekey, value);
|
|
167
164
|
};
|
|
168
165
|
});
|
|
169
|
-
_defineProperty(
|
|
166
|
+
_defineProperty(_this, "onSearch", function (key, rowIndex, config) {
|
|
170
167
|
return function (value) {
|
|
171
168
|
var _ref5 = _this.props.callback || {},
|
|
172
169
|
onSearch = _ref5.onSearch;
|
|
173
170
|
onSearch && onSearch(_this.getIndex(rowIndex), key, value, config);
|
|
174
171
|
};
|
|
175
172
|
});
|
|
176
|
-
_defineProperty(
|
|
173
|
+
_defineProperty(_this, "onAdd", function (key) {
|
|
177
174
|
return function () {
|
|
178
175
|
var _ref6 = _this.props.callback || {},
|
|
179
176
|
onAdd = _ref6.onAdd;
|
|
180
177
|
onAdd && onAdd(key);
|
|
181
178
|
};
|
|
182
179
|
});
|
|
183
|
-
_defineProperty(
|
|
180
|
+
_defineProperty(_this, "onRowAdd", function (key, index) {
|
|
184
181
|
return function () {
|
|
185
182
|
var _ref7 = _this.props.callback || {},
|
|
186
183
|
onLink = _ref7.onLink;
|
|
187
184
|
onLink && onLink(key, index, _this.props.items[index]);
|
|
188
185
|
};
|
|
189
186
|
});
|
|
190
|
-
_defineProperty(
|
|
187
|
+
_defineProperty(_this, "onBlur", function (key, rowIndex) {
|
|
191
188
|
return function (value) {
|
|
192
189
|
var _ref8 = _this.props.callback || {},
|
|
193
190
|
onBlur = _ref8.onBlur;
|
|
@@ -195,33 +192,33 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
195
192
|
onBlur && onBlur(_this.getIndex(rowIndex), key, value);
|
|
196
193
|
};
|
|
197
194
|
});
|
|
198
|
-
_defineProperty(
|
|
195
|
+
_defineProperty(_this, "onDoubleClick", function (key, value) {
|
|
199
196
|
return function () {
|
|
200
197
|
var _ref9 = _this.props.callback || {},
|
|
201
198
|
onDoubleClick = _ref9.onDoubleClick;
|
|
202
199
|
onDoubleClick && onDoubleClick(key, value);
|
|
203
200
|
};
|
|
204
201
|
});
|
|
205
|
-
_defineProperty(
|
|
202
|
+
_defineProperty(_this, "onImgTileClick", function (col, value, rowIndex) {
|
|
206
203
|
return function () {
|
|
207
|
-
var
|
|
208
|
-
onImgTileClick =
|
|
204
|
+
var _ref0 = _this.props.callback || {},
|
|
205
|
+
onImgTileClick = _ref0.onImgTileClick;
|
|
209
206
|
onImgTileClick && onImgTileClick(col, value, rowIndex);
|
|
210
207
|
};
|
|
211
208
|
});
|
|
212
|
-
_defineProperty(
|
|
213
|
-
var
|
|
214
|
-
onMoveRow =
|
|
209
|
+
_defineProperty(_this, "onMoveRow", function (dragIndex, targetIndex) {
|
|
210
|
+
var _ref1 = _this.props.callback || {},
|
|
211
|
+
onMoveRow = _ref1.onMoveRow;
|
|
215
212
|
onMoveRow && onMoveRow(dragIndex, targetIndex);
|
|
216
213
|
});
|
|
217
|
-
_defineProperty(
|
|
214
|
+
_defineProperty(_this, "closeValid", function () {
|
|
218
215
|
var _this$props = _this.props,
|
|
219
216
|
valid = _this$props.valid,
|
|
220
217
|
_this$props$callback = _this$props.callback,
|
|
221
218
|
callback = _this$props$callback === void 0 ? {} : _this$props$callback;
|
|
222
219
|
valid && callback.onExitValid();
|
|
223
220
|
});
|
|
224
|
-
_defineProperty(
|
|
221
|
+
_defineProperty(_this, "getOptions", function (key, colOptions, index) {
|
|
225
222
|
var options = _this.props.items[index].options;
|
|
226
223
|
var options2 = _this.props.options;
|
|
227
224
|
if (options && _Array$isArray(options[key])) {
|
|
@@ -232,7 +229,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
232
229
|
return colOptions;
|
|
233
230
|
}
|
|
234
231
|
});
|
|
235
|
-
_defineProperty(
|
|
232
|
+
_defineProperty(_this, "validField", function (required, value) {
|
|
236
233
|
if (!_this.props.valid || _this.error || !required || value) {
|
|
237
234
|
return false;
|
|
238
235
|
} else if (typeof value === 'number') {
|
|
@@ -242,15 +239,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
242
239
|
return true;
|
|
243
240
|
}
|
|
244
241
|
});
|
|
245
|
-
_defineProperty(
|
|
246
|
-
var value =
|
|
247
|
-
title =
|
|
242
|
+
_defineProperty(_this, "toRadio", function (_ref10, index) {
|
|
243
|
+
var value = _ref10.value,
|
|
244
|
+
title = _ref10.title;
|
|
248
245
|
return /*#__PURE__*/React.createElement(_Radio, {
|
|
249
246
|
key: index,
|
|
250
247
|
value: String(value)
|
|
251
248
|
}, title);
|
|
252
249
|
});
|
|
253
|
-
_defineProperty(
|
|
250
|
+
_defineProperty(_this, "renderRadioGroup", function (config, value, index) {
|
|
254
251
|
var key = config.key,
|
|
255
252
|
options = config.options;
|
|
256
253
|
var radioGroupProps = {
|
|
@@ -261,7 +258,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
261
258
|
};
|
|
262
259
|
return /*#__PURE__*/React.createElement(RadioGroup, radioGroupProps, _mapInstanceProperty(options).call(options, _this.toRadio));
|
|
263
260
|
});
|
|
264
|
-
_defineProperty(
|
|
261
|
+
_defineProperty(_this, "renderEditableCell", function (config, value, index) {
|
|
265
262
|
var key = config.key,
|
|
266
263
|
type = config.type,
|
|
267
264
|
options = config.options,
|
|
@@ -353,7 +350,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
353
350
|
}
|
|
354
351
|
return /*#__PURE__*/React.createElement(SuperTableCell, cellProps);
|
|
355
352
|
});
|
|
356
|
-
_defineProperty(
|
|
353
|
+
_defineProperty(_this, "renderDoubleEditableCell", function (config, value, index) {
|
|
357
354
|
var key = config.key,
|
|
358
355
|
type = config.type,
|
|
359
356
|
options = config.options,
|
|
@@ -383,7 +380,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
383
380
|
};
|
|
384
381
|
return /*#__PURE__*/React.createElement(SuperTableCell, cellProps);
|
|
385
382
|
});
|
|
386
|
-
_defineProperty(
|
|
383
|
+
_defineProperty(_this, "renderLinkCell", function (col, value, record, index) {
|
|
387
384
|
if (col.link === 'list') {
|
|
388
385
|
var list = value && _Array$isArray(value) ? value : [];
|
|
389
386
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -394,8 +391,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
394
391
|
var _context2;
|
|
395
392
|
var split = index2 === list.length - 1 ? '' : ',';
|
|
396
393
|
var onClick = function onClick() {
|
|
397
|
-
var
|
|
398
|
-
onLink =
|
|
394
|
+
var _ref11 = _this.props.callback || {},
|
|
395
|
+
onLink = _ref11.onLink;
|
|
399
396
|
onLink && onLink(col.key, index, item2);
|
|
400
397
|
};
|
|
401
398
|
return /*#__PURE__*/React.createElement("a", {
|
|
@@ -406,8 +403,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
406
403
|
} else {
|
|
407
404
|
var title = typeof col.link === 'string' ? col.link : value;
|
|
408
405
|
var onClick = function onClick() {
|
|
409
|
-
var
|
|
410
|
-
onLink =
|
|
406
|
+
var _ref12 = _this.props.callback || {},
|
|
407
|
+
onLink = _ref12.onLink;
|
|
411
408
|
onLink && onLink(col.key, index, record);
|
|
412
409
|
};
|
|
413
410
|
return /*#__PURE__*/React.createElement("a", {
|
|
@@ -419,12 +416,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
419
416
|
}, title);
|
|
420
417
|
}
|
|
421
418
|
});
|
|
422
|
-
_defineProperty(
|
|
419
|
+
_defineProperty(_this, "getIndex", function (index) {
|
|
423
420
|
return (_this.props.base || 0) + index;
|
|
424
421
|
});
|
|
425
|
-
_defineProperty(
|
|
422
|
+
_defineProperty(_this, "getCellRender", function (col) {
|
|
426
423
|
return function (value, record, index) {
|
|
427
|
-
var _context3, _context4, _context5, _context6, _context7, _context8, _context9,
|
|
424
|
+
var _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context0;
|
|
428
425
|
var realType = record._isEdit === true && _this.canReadonly(col.type) ? col.editType : col.type;
|
|
429
426
|
if (!realType) {
|
|
430
427
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -544,7 +541,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
544
541
|
case 'uploadImg':
|
|
545
542
|
var commonProps = _this.props.callback.buildSuperUploadProps ? _this.props.callback.buildSuperUploadProps() : {};
|
|
546
543
|
var uploadProps = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
547
|
-
onFileChange: _this.props.callback.onTableFileChange ? _bindInstanceProperty(
|
|
544
|
+
onFileChange: _this.props.callback.onTableFileChange ? _bindInstanceProperty(_context0 = _this.props.callback.onTableFileChange).call(_context0, null, col.key, index) : undefined,
|
|
548
545
|
type: col.type
|
|
549
546
|
}, col.props), _this.props), commonProps), {}, {
|
|
550
547
|
value: _this.props.items[index][col.key]
|
|
@@ -561,7 +558,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
561
558
|
}
|
|
562
559
|
};
|
|
563
560
|
});
|
|
564
|
-
_defineProperty(
|
|
561
|
+
_defineProperty(_this, "getCheckedStatus", function (key) {
|
|
565
562
|
var has = false,
|
|
566
563
|
not = false;
|
|
567
564
|
var items = _this.props.items;
|
|
@@ -582,7 +579,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
582
579
|
indeterminate: has && not
|
|
583
580
|
};
|
|
584
581
|
});
|
|
585
|
-
_defineProperty(
|
|
582
|
+
_defineProperty(_this, "toAdd", function (key, showAdd) {
|
|
586
583
|
if (showAdd) {
|
|
587
584
|
var onClick = _this.onAdd(key);
|
|
588
585
|
return /*#__PURE__*/React.createElement(_Icon, {
|
|
@@ -594,12 +591,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
594
591
|
return null;
|
|
595
592
|
}
|
|
596
593
|
});
|
|
597
|
-
_defineProperty(
|
|
598
|
-
var required =
|
|
599
|
-
title =
|
|
600
|
-
type =
|
|
601
|
-
key =
|
|
602
|
-
showAdd =
|
|
594
|
+
_defineProperty(_this, "getColumnTitle", function (_ref13) {
|
|
595
|
+
var required = _ref13.required,
|
|
596
|
+
title = _ref13.title,
|
|
597
|
+
type = _ref13.type,
|
|
598
|
+
key = _ref13.key,
|
|
599
|
+
showAdd = _ref13.showAdd;
|
|
603
600
|
if (type === 'checkbox') {
|
|
604
601
|
var status = _this.getCheckedStatus(key);
|
|
605
602
|
return /*#__PURE__*/React.createElement(_Checkbox, _extends({
|
|
@@ -612,31 +609,31 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
612
609
|
}, title, _this.toAdd(key, showAdd));
|
|
613
610
|
}
|
|
614
611
|
});
|
|
615
|
-
_defineProperty(
|
|
616
|
-
var type =
|
|
617
|
-
align =
|
|
612
|
+
_defineProperty(_this, "getColumnClassName", function (_ref14) {
|
|
613
|
+
var type = _ref14.type,
|
|
614
|
+
align = _ref14.align;
|
|
618
615
|
if (type === 'index' || type === 'checkbox') {
|
|
619
616
|
return 'ant-table-selection-column';
|
|
620
617
|
} else {
|
|
621
618
|
return align ? variables('SuperTable2')[align] : '';
|
|
622
619
|
}
|
|
623
620
|
});
|
|
624
|
-
_defineProperty(
|
|
625
|
-
var
|
|
626
|
-
return !_includesInstanceProperty(
|
|
621
|
+
_defineProperty(_this, "canReadonly", function (type) {
|
|
622
|
+
var _context1;
|
|
623
|
+
return !_includesInstanceProperty(_context1 = ['index', 'checkbox', 'link', 'button', 'switch', 'custom', 'img', 'toolbar', 'uploadImg', 'double']).call(_context1, type);
|
|
627
624
|
});
|
|
628
|
-
_defineProperty(
|
|
629
|
-
var
|
|
625
|
+
_defineProperty(_this, "getColumns", function (cols) {
|
|
626
|
+
var _context10;
|
|
630
627
|
var readonly = _this.props.readonly;
|
|
631
|
-
return _mapInstanceProperty(
|
|
628
|
+
return _mapInstanceProperty(_context10 = _filterInstanceProperty(cols).call(cols, function (col) {
|
|
632
629
|
return !col.hide;
|
|
633
|
-
})).call(
|
|
634
|
-
var
|
|
635
|
-
var col = _extends({}, (_objectDestructuringEmpty(
|
|
630
|
+
})).call(_context10, function (_ref15, index) {
|
|
631
|
+
var _context11;
|
|
632
|
+
var col = _extends({}, (_objectDestructuringEmpty(_ref15), _ref15));
|
|
636
633
|
col.className = _this.getColumnClassName(col);
|
|
637
634
|
col.title = _this.getColumnTitle(col);
|
|
638
635
|
col.dataIndex = col.key;
|
|
639
|
-
col.width = col.width ? col.width : _includesInstanceProperty(
|
|
636
|
+
col.width = col.width ? col.width : _includesInstanceProperty(_context11 = ['index', 'checked']).call(_context11, col.key) ? 70 : col.type === 'img' ? 200 : 120;
|
|
640
637
|
// const {props = {}} =
|
|
641
638
|
// const {edit = false} = props
|
|
642
639
|
// if (!(readonly || col.type === 'readonly') || !this.canReadonly(col.type)) {
|
|
@@ -662,7 +659,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
662
659
|
return col;
|
|
663
660
|
});
|
|
664
661
|
});
|
|
665
|
-
_defineProperty(
|
|
662
|
+
_defineProperty(_this, "getText", function (value, options) {
|
|
666
663
|
if (_Array$isArray(value)) {
|
|
667
664
|
return _mapInstanceProperty(value).call(value, function (v) {
|
|
668
665
|
return getTitle(v, options);
|
|
@@ -671,14 +668,14 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
671
668
|
return getTitle(value, options);
|
|
672
669
|
}
|
|
673
670
|
});
|
|
674
|
-
_defineProperty(
|
|
671
|
+
_defineProperty(_this, "getDataSource", function (items, cols) {
|
|
675
672
|
return _mapInstanceProperty(items).call(items, function (item, index) {
|
|
676
|
-
return _reduceInstanceProperty(cols).call(cols, function (result,
|
|
677
|
-
var
|
|
678
|
-
var key =
|
|
679
|
-
type =
|
|
680
|
-
options =
|
|
681
|
-
if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || _Array$isArray(item.isReadonly) && !_includesInstanceProperty(
|
|
673
|
+
return _reduceInstanceProperty(cols).call(cols, function (result, _ref16) {
|
|
674
|
+
var _context12, _context13;
|
|
675
|
+
var key = _ref16.key,
|
|
676
|
+
type = _ref16.type,
|
|
677
|
+
options = _ref16.options;
|
|
678
|
+
if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || _Array$isArray(item.isReadonly) && !_includesInstanceProperty(_context12 = item.isReadonly).call(_context12, key)) || _includesInstanceProperty(_context13 = ['img', 'switch', 'custom', 'img', 'toolbar', 'uploadImg']).call(_context13, type)) {
|
|
682
679
|
result[key] = item[key];
|
|
683
680
|
} else {
|
|
684
681
|
result[key] = _this.getText(item[key], options);
|
|
@@ -690,7 +687,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
690
687
|
}));
|
|
691
688
|
});
|
|
692
689
|
});
|
|
693
|
-
_defineProperty(
|
|
690
|
+
_defineProperty(_this, "getPropsByCheckbox", function () {
|
|
694
691
|
var _this$props2 = _this.props,
|
|
695
692
|
items = _this$props2.items,
|
|
696
693
|
_this$props2$isEmphas = _this$props2.isEmphasized,
|
|
@@ -705,13 +702,13 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
705
702
|
rowClassName: rowClassName
|
|
706
703
|
};
|
|
707
704
|
});
|
|
708
|
-
_defineProperty(
|
|
705
|
+
_defineProperty(_this, "getSelectedRowKeys", function (items) {
|
|
709
706
|
return _reduceInstanceProperty(items).call(items, function (result, item, index) {
|
|
710
707
|
item.checked && result.push(index);
|
|
711
708
|
return result;
|
|
712
709
|
}, []);
|
|
713
710
|
});
|
|
714
|
-
_defineProperty(
|
|
711
|
+
_defineProperty(_this, "getPropsByCheckbox2", function (items) {
|
|
715
712
|
var _this$props3 = _this.props,
|
|
716
713
|
_this$props3$checkbox = _this$props3.checkbox,
|
|
717
714
|
checkbox = _this$props3$checkbox === void 0 ? true : _this$props3$checkbox,
|
|
@@ -796,7 +793,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
796
793
|
};
|
|
797
794
|
}
|
|
798
795
|
});
|
|
799
|
-
_defineProperty(
|
|
796
|
+
_defineProperty(_this, "getRowPropsForDrag", function () {
|
|
800
797
|
return function (record, index) {
|
|
801
798
|
return {
|
|
802
799
|
index: index,
|
|
@@ -804,7 +801,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
804
801
|
};
|
|
805
802
|
};
|
|
806
803
|
});
|
|
807
|
-
_defineProperty(
|
|
804
|
+
_defineProperty(_this, "getRowProps", function (onRowClick) {
|
|
808
805
|
return function (record) {
|
|
809
806
|
return {
|
|
810
807
|
onClick: function onClick() {
|
|
@@ -816,8 +813,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
816
813
|
};
|
|
817
814
|
};
|
|
818
815
|
});
|
|
819
|
-
_defineProperty(
|
|
820
|
-
var
|
|
816
|
+
_defineProperty(_this, "getProps", function () {
|
|
817
|
+
var _context14;
|
|
821
818
|
var _this$props4 = _this.props,
|
|
822
819
|
cols = _this$props4.cols,
|
|
823
820
|
items = _this$props4.items,
|
|
@@ -835,11 +832,11 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
835
832
|
expandedRowRender = _this$props4$expanded === void 0 ? undefined : _this$props4$expanded,
|
|
836
833
|
_this$props4$onExpand = _this$props4.onExpand,
|
|
837
834
|
onExpand = _this$props4$onExpand === void 0 ? undefined : _this$props4$onExpand;
|
|
838
|
-
var widthX = _reduceInstanceProperty(
|
|
835
|
+
var widthX = _reduceInstanceProperty(_context14 = _filterInstanceProperty(cols).call(cols, function (col) {
|
|
839
836
|
return !col.hide;
|
|
840
|
-
})).call(
|
|
841
|
-
var
|
|
842
|
-
return width += item.width ? item.width : _includesInstanceProperty(
|
|
837
|
+
})).call(_context14, function (width, item) {
|
|
838
|
+
var _context15;
|
|
839
|
+
return width += item.width ? item.width : _includesInstanceProperty(_context15 = ['index', 'checked']).call(_context15, item.key) ? 70 : item.type === 'img' ? 200 : 120;
|
|
843
840
|
}, 0);
|
|
844
841
|
var scrollProps = !helper.isEmpty2(expandedRowRender) ? {
|
|
845
842
|
expandedRowRender: expandedRowRender
|
|
@@ -877,9 +874,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
877
874
|
onExpand: onExpand
|
|
878
875
|
}, scrollProps);
|
|
879
876
|
});
|
|
880
|
-
_defineProperty(
|
|
877
|
+
_defineProperty(_this, "setScroll", function () {
|
|
881
878
|
if (_this.props.maxHeight && _this.props.items.length) {
|
|
882
|
-
var root = ReactDOM.findDOMNode(
|
|
879
|
+
var root = ReactDOM.findDOMNode(_this);
|
|
883
880
|
var container = root.getElementsByClassName('ant-table-body')[0];
|
|
884
881
|
var header = root.getElementsByClassName('ant-table-thead')[0];
|
|
885
882
|
fixed(container, header, _this.props.maxHeight);
|
|
@@ -887,7 +884,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
887
884
|
});
|
|
888
885
|
return _this;
|
|
889
886
|
}
|
|
890
|
-
|
|
887
|
+
_inherits(SuperTable2, _React$Component);
|
|
888
|
+
return _createClass(SuperTable2, [{
|
|
891
889
|
key: "componentDidMount",
|
|
892
890
|
value: function componentDidMount() {
|
|
893
891
|
this.setScroll();
|
|
@@ -906,7 +904,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
906
904
|
}));
|
|
907
905
|
}
|
|
908
906
|
}]);
|
|
909
|
-
return SuperTable2;
|
|
910
907
|
}(React.Component);
|
|
911
908
|
_defineProperty(SuperTable2, "propTypes", {
|
|
912
909
|
cols: PropTypes.arrayOf(PropTypes.shape(ColType)).isRequired,
|