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
|
@@ -40,10 +40,9 @@ var _checkbox = _interopRequireDefault(require("antd/lib/checkbox"));
|
|
|
40
40
|
var _icon = _interopRequireDefault(require("antd/lib/icon"));
|
|
41
41
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
42
42
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
43
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
44
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
45
43
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
46
44
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
45
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
47
46
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
48
47
|
var _radio = _interopRequireDefault(require("antd/lib/radio"));
|
|
49
48
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -57,15 +56,14 @@ var _variables = _interopRequireDefault(require("../variables"));
|
|
|
57
56
|
var _helper = _interopRequireWildcard(require("../helper"));
|
|
58
57
|
var _DragSortRow = _interopRequireDefault(require("../SuperTable/DragSortRow"));
|
|
59
58
|
var _excluded = ["onRowClick"];
|
|
60
|
-
function
|
|
61
|
-
function
|
|
62
|
-
function
|
|
63
|
-
function
|
|
64
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
59
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
60
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && _getIteratorMethod(r) || r["@@iterator"]; if (!t) { if (_Array$isArray2(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; } } }; }
|
|
61
|
+
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; } }
|
|
62
|
+
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; }
|
|
65
63
|
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; }
|
|
66
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
67
|
-
function
|
|
68
|
-
function _isNativeReflectConstruct() {
|
|
64
|
+
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) { (0, _defineProperty2["default"])(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; }
|
|
65
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
66
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
69
67
|
var RadioGroup = _radio["default"].Group;
|
|
70
68
|
var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select',
|
|
71
69
|
//存储value
|
|
@@ -139,8 +137,6 @@ var CallbackType = {
|
|
|
139
137
|
* isEmphasized: [可选],是否强调,行字体加粗显示, 除了isEmphasized设置为true之外,加粗行数据里要设置__isEmphasized为true
|
|
140
138
|
*/
|
|
141
139
|
var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
142
|
-
(0, _inherits2["default"])(SuperTable2, _React$Component);
|
|
143
|
-
var _super = _createSuper(SuperTable2);
|
|
144
140
|
function SuperTable2() {
|
|
145
141
|
var _context;
|
|
146
142
|
var _this;
|
|
@@ -148,22 +144,22 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
148
144
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
149
145
|
args[_key] = arguments[_key];
|
|
150
146
|
}
|
|
151
|
-
_this =
|
|
152
|
-
(0, _defineProperty2["default"])(
|
|
147
|
+
_this = _callSuper(this, SuperTable2, (0, _concat["default"])(_context = []).call(_context, args));
|
|
148
|
+
(0, _defineProperty2["default"])(_this, "onSwitch", function (key, rowIndex) {
|
|
153
149
|
return function (value) {
|
|
154
150
|
var _ref = _this.props.callback || {},
|
|
155
151
|
onContentChange = _ref.onContentChange;
|
|
156
152
|
onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
|
|
157
153
|
};
|
|
158
154
|
});
|
|
159
|
-
(0, _defineProperty2["default"])(
|
|
155
|
+
(0, _defineProperty2["default"])(_this, "onCheck", function (key, rowIndex) {
|
|
160
156
|
return function (e) {
|
|
161
157
|
var _ref2 = _this.props.callback || {},
|
|
162
158
|
onCheck = _ref2.onCheck;
|
|
163
159
|
onCheck && onCheck(_this.getIndex(rowIndex), key, e.target.checked);
|
|
164
160
|
};
|
|
165
161
|
});
|
|
166
|
-
(0, _defineProperty2["default"])(
|
|
162
|
+
(0, _defineProperty2["default"])(_this, "onChange", function (key, rowIndex) {
|
|
167
163
|
return function (value) {
|
|
168
164
|
var _ref3 = _this.props.callback || {},
|
|
169
165
|
onContentChange = _ref3.onContentChange;
|
|
@@ -171,7 +167,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
171
167
|
onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
|
|
172
168
|
};
|
|
173
169
|
});
|
|
174
|
-
(0, _defineProperty2["default"])(
|
|
170
|
+
(0, _defineProperty2["default"])(_this, "onDoubleChange1", function (key, rowIndex) {
|
|
175
171
|
return function (doublekey, value) {
|
|
176
172
|
var _ref4 = _this.props.callback || {},
|
|
177
173
|
onContentChange = _ref4.onContentChange;
|
|
@@ -179,28 +175,28 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
179
175
|
onContentChange && onContentChange(_this.getIndex(rowIndex), doublekey, value);
|
|
180
176
|
};
|
|
181
177
|
});
|
|
182
|
-
(0, _defineProperty2["default"])(
|
|
178
|
+
(0, _defineProperty2["default"])(_this, "onSearch", function (key, rowIndex, config) {
|
|
183
179
|
return function (value) {
|
|
184
180
|
var _ref5 = _this.props.callback || {},
|
|
185
181
|
onSearch = _ref5.onSearch;
|
|
186
182
|
onSearch && onSearch(_this.getIndex(rowIndex), key, value, config);
|
|
187
183
|
};
|
|
188
184
|
});
|
|
189
|
-
(0, _defineProperty2["default"])(
|
|
185
|
+
(0, _defineProperty2["default"])(_this, "onAdd", function (key) {
|
|
190
186
|
return function () {
|
|
191
187
|
var _ref6 = _this.props.callback || {},
|
|
192
188
|
onAdd = _ref6.onAdd;
|
|
193
189
|
onAdd && onAdd(key);
|
|
194
190
|
};
|
|
195
191
|
});
|
|
196
|
-
(0, _defineProperty2["default"])(
|
|
192
|
+
(0, _defineProperty2["default"])(_this, "onRowAdd", function (key, index) {
|
|
197
193
|
return function () {
|
|
198
194
|
var _ref7 = _this.props.callback || {},
|
|
199
195
|
onLink = _ref7.onLink;
|
|
200
196
|
onLink && onLink(key, index, _this.props.items[index]);
|
|
201
197
|
};
|
|
202
198
|
});
|
|
203
|
-
(0, _defineProperty2["default"])(
|
|
199
|
+
(0, _defineProperty2["default"])(_this, "onBlur", function (key, rowIndex) {
|
|
204
200
|
return function (value) {
|
|
205
201
|
var _ref8 = _this.props.callback || {},
|
|
206
202
|
onBlur = _ref8.onBlur;
|
|
@@ -208,33 +204,33 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
208
204
|
onBlur && onBlur(_this.getIndex(rowIndex), key, value);
|
|
209
205
|
};
|
|
210
206
|
});
|
|
211
|
-
(0, _defineProperty2["default"])(
|
|
207
|
+
(0, _defineProperty2["default"])(_this, "onDoubleClick", function (key, value) {
|
|
212
208
|
return function () {
|
|
213
209
|
var _ref9 = _this.props.callback || {},
|
|
214
210
|
onDoubleClick = _ref9.onDoubleClick;
|
|
215
211
|
onDoubleClick && onDoubleClick(key, value);
|
|
216
212
|
};
|
|
217
213
|
});
|
|
218
|
-
(0, _defineProperty2["default"])(
|
|
214
|
+
(0, _defineProperty2["default"])(_this, "onImgTileClick", function (col, value, rowIndex) {
|
|
219
215
|
return function () {
|
|
220
|
-
var
|
|
221
|
-
onImgTileClick =
|
|
216
|
+
var _ref0 = _this.props.callback || {},
|
|
217
|
+
onImgTileClick = _ref0.onImgTileClick;
|
|
222
218
|
onImgTileClick && onImgTileClick(col, value, rowIndex);
|
|
223
219
|
};
|
|
224
220
|
});
|
|
225
|
-
(0, _defineProperty2["default"])(
|
|
226
|
-
var
|
|
227
|
-
onMoveRow =
|
|
221
|
+
(0, _defineProperty2["default"])(_this, "onMoveRow", function (dragIndex, targetIndex) {
|
|
222
|
+
var _ref1 = _this.props.callback || {},
|
|
223
|
+
onMoveRow = _ref1.onMoveRow;
|
|
228
224
|
onMoveRow && onMoveRow(dragIndex, targetIndex);
|
|
229
225
|
});
|
|
230
|
-
(0, _defineProperty2["default"])(
|
|
226
|
+
(0, _defineProperty2["default"])(_this, "closeValid", function () {
|
|
231
227
|
var _this$props = _this.props,
|
|
232
228
|
valid = _this$props.valid,
|
|
233
229
|
_this$props$callback = _this$props.callback,
|
|
234
230
|
callback = _this$props$callback === void 0 ? {} : _this$props$callback;
|
|
235
231
|
valid && callback.onExitValid();
|
|
236
232
|
});
|
|
237
|
-
(0, _defineProperty2["default"])(
|
|
233
|
+
(0, _defineProperty2["default"])(_this, "getOptions", function (key, colOptions, index) {
|
|
238
234
|
var options = _this.props.items[index].options;
|
|
239
235
|
var options2 = _this.props.options;
|
|
240
236
|
if (options && (0, _isArray["default"])(options[key])) {
|
|
@@ -245,7 +241,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
245
241
|
return colOptions;
|
|
246
242
|
}
|
|
247
243
|
});
|
|
248
|
-
(0, _defineProperty2["default"])(
|
|
244
|
+
(0, _defineProperty2["default"])(_this, "validField", function (required, value) {
|
|
249
245
|
if (!_this.props.valid || _this.error || !required || value) {
|
|
250
246
|
return false;
|
|
251
247
|
} else if (typeof value === 'number') {
|
|
@@ -255,15 +251,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
255
251
|
return true;
|
|
256
252
|
}
|
|
257
253
|
});
|
|
258
|
-
(0, _defineProperty2["default"])(
|
|
259
|
-
var value =
|
|
260
|
-
title =
|
|
254
|
+
(0, _defineProperty2["default"])(_this, "toRadio", function (_ref10, index) {
|
|
255
|
+
var value = _ref10.value,
|
|
256
|
+
title = _ref10.title;
|
|
261
257
|
return /*#__PURE__*/_react["default"].createElement(_radio["default"], {
|
|
262
258
|
key: index,
|
|
263
259
|
value: String(value)
|
|
264
260
|
}, title);
|
|
265
261
|
});
|
|
266
|
-
(0, _defineProperty2["default"])(
|
|
262
|
+
(0, _defineProperty2["default"])(_this, "renderRadioGroup", function (config, value, index) {
|
|
267
263
|
var key = config.key,
|
|
268
264
|
options = config.options;
|
|
269
265
|
var radioGroupProps = {
|
|
@@ -274,7 +270,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
274
270
|
};
|
|
275
271
|
return /*#__PURE__*/_react["default"].createElement(RadioGroup, radioGroupProps, (0, _map["default"])(options).call(options, _this.toRadio));
|
|
276
272
|
});
|
|
277
|
-
(0, _defineProperty2["default"])(
|
|
273
|
+
(0, _defineProperty2["default"])(_this, "renderEditableCell", function (config, value, index) {
|
|
278
274
|
var key = config.key,
|
|
279
275
|
type = config.type,
|
|
280
276
|
options = config.options,
|
|
@@ -366,7 +362,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
366
362
|
}
|
|
367
363
|
return /*#__PURE__*/_react["default"].createElement(_SuperTableCell["default"], cellProps);
|
|
368
364
|
});
|
|
369
|
-
(0, _defineProperty2["default"])(
|
|
365
|
+
(0, _defineProperty2["default"])(_this, "renderDoubleEditableCell", function (config, value, index) {
|
|
370
366
|
var key = config.key,
|
|
371
367
|
type = config.type,
|
|
372
368
|
options = config.options,
|
|
@@ -396,7 +392,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
396
392
|
};
|
|
397
393
|
return /*#__PURE__*/_react["default"].createElement(_SuperTableCell["default"], cellProps);
|
|
398
394
|
});
|
|
399
|
-
(0, _defineProperty2["default"])(
|
|
395
|
+
(0, _defineProperty2["default"])(_this, "renderLinkCell", function (col, value, record, index) {
|
|
400
396
|
if (col.link === 'list') {
|
|
401
397
|
var list = value && (0, _isArray["default"])(value) ? value : [];
|
|
402
398
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -407,8 +403,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
407
403
|
var _context2;
|
|
408
404
|
var split = index2 === list.length - 1 ? '' : ',';
|
|
409
405
|
var onClick = function onClick() {
|
|
410
|
-
var
|
|
411
|
-
onLink =
|
|
406
|
+
var _ref11 = _this.props.callback || {},
|
|
407
|
+
onLink = _ref11.onLink;
|
|
412
408
|
onLink && onLink(col.key, index, item2);
|
|
413
409
|
};
|
|
414
410
|
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
@@ -419,8 +415,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
419
415
|
} else {
|
|
420
416
|
var title = typeof col.link === 'string' ? col.link : value;
|
|
421
417
|
var onClick = function onClick() {
|
|
422
|
-
var
|
|
423
|
-
onLink =
|
|
418
|
+
var _ref12 = _this.props.callback || {},
|
|
419
|
+
onLink = _ref12.onLink;
|
|
424
420
|
onLink && onLink(col.key, index, record);
|
|
425
421
|
};
|
|
426
422
|
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
@@ -432,12 +428,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
432
428
|
}, title);
|
|
433
429
|
}
|
|
434
430
|
});
|
|
435
|
-
(0, _defineProperty2["default"])(
|
|
431
|
+
(0, _defineProperty2["default"])(_this, "getIndex", function (index) {
|
|
436
432
|
return (_this.props.base || 0) + index;
|
|
437
433
|
});
|
|
438
|
-
(0, _defineProperty2["default"])(
|
|
434
|
+
(0, _defineProperty2["default"])(_this, "getCellRender", function (col) {
|
|
439
435
|
return function (value, record, index) {
|
|
440
|
-
var _context3, _context4, _context5, _context6, _context7, _context8, _context9,
|
|
436
|
+
var _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context0;
|
|
441
437
|
var realType = record._isEdit === true && _this.canReadonly(col.type) ? col.editType : col.type;
|
|
442
438
|
if (!realType) {
|
|
443
439
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -557,7 +553,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
557
553
|
case 'uploadImg':
|
|
558
554
|
var commonProps = _this.props.callback.buildSuperUploadProps ? _this.props.callback.buildSuperUploadProps() : {};
|
|
559
555
|
var uploadProps = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
560
|
-
onFileChange: _this.props.callback.onTableFileChange ? (0, _bind["default"])(
|
|
556
|
+
onFileChange: _this.props.callback.onTableFileChange ? (0, _bind["default"])(_context0 = _this.props.callback.onTableFileChange).call(_context0, null, col.key, index) : undefined,
|
|
561
557
|
type: col.type
|
|
562
558
|
}, col.props), _this.props), commonProps), {}, {
|
|
563
559
|
value: _this.props.items[index][col.key]
|
|
@@ -574,7 +570,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
574
570
|
}
|
|
575
571
|
};
|
|
576
572
|
});
|
|
577
|
-
(0, _defineProperty2["default"])(
|
|
573
|
+
(0, _defineProperty2["default"])(_this, "getCheckedStatus", function (key) {
|
|
578
574
|
var has = false,
|
|
579
575
|
not = false;
|
|
580
576
|
var items = _this.props.items;
|
|
@@ -595,7 +591,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
595
591
|
indeterminate: has && not
|
|
596
592
|
};
|
|
597
593
|
});
|
|
598
|
-
(0, _defineProperty2["default"])(
|
|
594
|
+
(0, _defineProperty2["default"])(_this, "toAdd", function (key, showAdd) {
|
|
599
595
|
if (showAdd) {
|
|
600
596
|
var onClick = _this.onAdd(key);
|
|
601
597
|
return /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
@@ -607,12 +603,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
607
603
|
return null;
|
|
608
604
|
}
|
|
609
605
|
});
|
|
610
|
-
(0, _defineProperty2["default"])(
|
|
611
|
-
var required =
|
|
612
|
-
title =
|
|
613
|
-
type =
|
|
614
|
-
key =
|
|
615
|
-
showAdd =
|
|
606
|
+
(0, _defineProperty2["default"])(_this, "getColumnTitle", function (_ref13) {
|
|
607
|
+
var required = _ref13.required,
|
|
608
|
+
title = _ref13.title,
|
|
609
|
+
type = _ref13.type,
|
|
610
|
+
key = _ref13.key,
|
|
611
|
+
showAdd = _ref13.showAdd;
|
|
616
612
|
if (type === 'checkbox') {
|
|
617
613
|
var status = _this.getCheckedStatus(key);
|
|
618
614
|
return /*#__PURE__*/_react["default"].createElement(_checkbox["default"], (0, _extends2["default"])({
|
|
@@ -625,31 +621,31 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
625
621
|
}, title, _this.toAdd(key, showAdd));
|
|
626
622
|
}
|
|
627
623
|
});
|
|
628
|
-
(0, _defineProperty2["default"])(
|
|
629
|
-
var type =
|
|
630
|
-
align =
|
|
624
|
+
(0, _defineProperty2["default"])(_this, "getColumnClassName", function (_ref14) {
|
|
625
|
+
var type = _ref14.type,
|
|
626
|
+
align = _ref14.align;
|
|
631
627
|
if (type === 'index' || type === 'checkbox') {
|
|
632
628
|
return 'ant-table-selection-column';
|
|
633
629
|
} else {
|
|
634
630
|
return align ? (0, _variables["default"])('SuperTable2')[align] : '';
|
|
635
631
|
}
|
|
636
632
|
});
|
|
637
|
-
(0, _defineProperty2["default"])(
|
|
638
|
-
var
|
|
639
|
-
return !(0, _includes["default"])(
|
|
633
|
+
(0, _defineProperty2["default"])(_this, "canReadonly", function (type) {
|
|
634
|
+
var _context1;
|
|
635
|
+
return !(0, _includes["default"])(_context1 = ['index', 'checkbox', 'link', 'button', 'switch', 'custom', 'img', 'toolbar', 'uploadImg', 'double']).call(_context1, type);
|
|
640
636
|
});
|
|
641
|
-
(0, _defineProperty2["default"])(
|
|
642
|
-
var
|
|
637
|
+
(0, _defineProperty2["default"])(_this, "getColumns", function (cols) {
|
|
638
|
+
var _context10;
|
|
643
639
|
var readonly = _this.props.readonly;
|
|
644
|
-
return (0, _map["default"])(
|
|
640
|
+
return (0, _map["default"])(_context10 = (0, _filter["default"])(cols).call(cols, function (col) {
|
|
645
641
|
return !col.hide;
|
|
646
|
-
})).call(
|
|
647
|
-
var
|
|
648
|
-
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(
|
|
642
|
+
})).call(_context10, function (_ref15, index) {
|
|
643
|
+
var _context11;
|
|
644
|
+
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref15), _ref15));
|
|
649
645
|
col.className = _this.getColumnClassName(col);
|
|
650
646
|
col.title = _this.getColumnTitle(col);
|
|
651
647
|
col.dataIndex = col.key;
|
|
652
|
-
col.width = col.width ? col.width : (0, _includes["default"])(
|
|
648
|
+
col.width = col.width ? col.width : (0, _includes["default"])(_context11 = ['index', 'checked']).call(_context11, col.key) ? 70 : col.type === 'img' ? 200 : 120;
|
|
653
649
|
// const {props = {}} =
|
|
654
650
|
// const {edit = false} = props
|
|
655
651
|
// if (!(readonly || col.type === 'readonly') || !this.canReadonly(col.type)) {
|
|
@@ -675,7 +671,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
675
671
|
return col;
|
|
676
672
|
});
|
|
677
673
|
});
|
|
678
|
-
(0, _defineProperty2["default"])(
|
|
674
|
+
(0, _defineProperty2["default"])(_this, "getText", function (value, options) {
|
|
679
675
|
if ((0, _isArray["default"])(value)) {
|
|
680
676
|
return (0, _map["default"])(value).call(value, function (v) {
|
|
681
677
|
return (0, _Control.getTitle)(v, options);
|
|
@@ -684,14 +680,14 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
684
680
|
return (0, _Control.getTitle)(value, options);
|
|
685
681
|
}
|
|
686
682
|
});
|
|
687
|
-
(0, _defineProperty2["default"])(
|
|
683
|
+
(0, _defineProperty2["default"])(_this, "getDataSource", function (items, cols) {
|
|
688
684
|
return (0, _map["default"])(items).call(items, function (item, index) {
|
|
689
|
-
return (0, _reduce["default"])(cols).call(cols, function (result,
|
|
690
|
-
var
|
|
691
|
-
var key =
|
|
692
|
-
type =
|
|
693
|
-
options =
|
|
694
|
-
if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || (0, _isArray["default"])(item.isReadonly) && !(0, _includes["default"])(
|
|
685
|
+
return (0, _reduce["default"])(cols).call(cols, function (result, _ref16) {
|
|
686
|
+
var _context12, _context13;
|
|
687
|
+
var key = _ref16.key,
|
|
688
|
+
type = _ref16.type,
|
|
689
|
+
options = _ref16.options;
|
|
690
|
+
if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || (0, _isArray["default"])(item.isReadonly) && !(0, _includes["default"])(_context12 = item.isReadonly).call(_context12, key)) || (0, _includes["default"])(_context13 = ['img', 'switch', 'custom', 'img', 'toolbar', 'uploadImg']).call(_context13, type)) {
|
|
695
691
|
result[key] = item[key];
|
|
696
692
|
} else {
|
|
697
693
|
result[key] = _this.getText(item[key], options);
|
|
@@ -703,7 +699,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
703
699
|
}));
|
|
704
700
|
});
|
|
705
701
|
});
|
|
706
|
-
(0, _defineProperty2["default"])(
|
|
702
|
+
(0, _defineProperty2["default"])(_this, "getPropsByCheckbox", function () {
|
|
707
703
|
var _this$props2 = _this.props,
|
|
708
704
|
items = _this$props2.items,
|
|
709
705
|
_this$props2$isEmphas = _this$props2.isEmphasized,
|
|
@@ -718,13 +714,13 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
718
714
|
rowClassName: rowClassName
|
|
719
715
|
};
|
|
720
716
|
});
|
|
721
|
-
(0, _defineProperty2["default"])(
|
|
717
|
+
(0, _defineProperty2["default"])(_this, "getSelectedRowKeys", function (items) {
|
|
722
718
|
return (0, _reduce["default"])(items).call(items, function (result, item, index) {
|
|
723
719
|
item.checked && result.push(index);
|
|
724
720
|
return result;
|
|
725
721
|
}, []);
|
|
726
722
|
});
|
|
727
|
-
(0, _defineProperty2["default"])(
|
|
723
|
+
(0, _defineProperty2["default"])(_this, "getPropsByCheckbox2", function (items) {
|
|
728
724
|
var _this$props3 = _this.props,
|
|
729
725
|
_this$props3$checkbox = _this$props3.checkbox,
|
|
730
726
|
checkbox = _this$props3$checkbox === void 0 ? true : _this$props3$checkbox,
|
|
@@ -809,7 +805,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
809
805
|
};
|
|
810
806
|
}
|
|
811
807
|
});
|
|
812
|
-
(0, _defineProperty2["default"])(
|
|
808
|
+
(0, _defineProperty2["default"])(_this, "getRowPropsForDrag", function () {
|
|
813
809
|
return function (record, index) {
|
|
814
810
|
return {
|
|
815
811
|
index: index,
|
|
@@ -817,7 +813,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
817
813
|
};
|
|
818
814
|
};
|
|
819
815
|
});
|
|
820
|
-
(0, _defineProperty2["default"])(
|
|
816
|
+
(0, _defineProperty2["default"])(_this, "getRowProps", function (onRowClick) {
|
|
821
817
|
return function (record) {
|
|
822
818
|
return {
|
|
823
819
|
onClick: function onClick() {
|
|
@@ -829,8 +825,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
829
825
|
};
|
|
830
826
|
};
|
|
831
827
|
});
|
|
832
|
-
(0, _defineProperty2["default"])(
|
|
833
|
-
var
|
|
828
|
+
(0, _defineProperty2["default"])(_this, "getProps", function () {
|
|
829
|
+
var _context14;
|
|
834
830
|
var _this$props4 = _this.props,
|
|
835
831
|
cols = _this$props4.cols,
|
|
836
832
|
items = _this$props4.items,
|
|
@@ -848,11 +844,11 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
848
844
|
expandedRowRender = _this$props4$expanded === void 0 ? undefined : _this$props4$expanded,
|
|
849
845
|
_this$props4$onExpand = _this$props4.onExpand,
|
|
850
846
|
onExpand = _this$props4$onExpand === void 0 ? undefined : _this$props4$onExpand;
|
|
851
|
-
var widthX = (0, _reduce["default"])(
|
|
847
|
+
var widthX = (0, _reduce["default"])(_context14 = (0, _filter["default"])(cols).call(cols, function (col) {
|
|
852
848
|
return !col.hide;
|
|
853
|
-
})).call(
|
|
854
|
-
var
|
|
855
|
-
return width += item.width ? item.width : (0, _includes["default"])(
|
|
849
|
+
})).call(_context14, function (width, item) {
|
|
850
|
+
var _context15;
|
|
851
|
+
return width += item.width ? item.width : (0, _includes["default"])(_context15 = ['index', 'checked']).call(_context15, item.key) ? 70 : item.type === 'img' ? 200 : 120;
|
|
856
852
|
}, 0);
|
|
857
853
|
var scrollProps = !_helper["default"].isEmpty2(expandedRowRender) ? {
|
|
858
854
|
expandedRowRender: expandedRowRender
|
|
@@ -890,9 +886,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
890
886
|
onExpand: onExpand
|
|
891
887
|
}, scrollProps);
|
|
892
888
|
});
|
|
893
|
-
(0, _defineProperty2["default"])(
|
|
889
|
+
(0, _defineProperty2["default"])(_this, "setScroll", function () {
|
|
894
890
|
if (_this.props.maxHeight && _this.props.items.length) {
|
|
895
|
-
var root = _reactDom["default"].findDOMNode(
|
|
891
|
+
var root = _reactDom["default"].findDOMNode(_this);
|
|
896
892
|
var container = root.getElementsByClassName('ant-table-body')[0];
|
|
897
893
|
var header = root.getElementsByClassName('ant-table-thead')[0];
|
|
898
894
|
(0, _fixed["default"])(container, header, _this.props.maxHeight);
|
|
@@ -900,7 +896,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
900
896
|
});
|
|
901
897
|
return _this;
|
|
902
898
|
}
|
|
903
|
-
(0,
|
|
899
|
+
(0, _inherits2["default"])(SuperTable2, _React$Component);
|
|
900
|
+
return (0, _createClass2["default"])(SuperTable2, [{
|
|
904
901
|
key: "componentDidMount",
|
|
905
902
|
value: function componentDidMount() {
|
|
906
903
|
this.setScroll();
|
|
@@ -919,7 +916,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
919
916
|
}));
|
|
920
917
|
}
|
|
921
918
|
}]);
|
|
922
|
-
return SuperTable2;
|
|
923
919
|
}(_react["default"].Component);
|
|
924
920
|
(0, _defineProperty2["default"])(SuperTable2, "propTypes", {
|
|
925
921
|
cols: _propTypes["default"].arrayOf(_propTypes["default"].shape(ColType)).isRequired,
|