cloud-b2b 1.1.70 → 1.1.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Area/Area.js +8 -11
- package/es/CodeInput/CodeInput.js +16 -19
- package/es/Enhance/Dialogs.js +11 -14
- package/es/Enhance/Loading.js +15 -18
- package/es/Header/Header.js +17 -20
- package/es/Header/Vertical.js +11 -14
- package/es/ImageView/ImageView.js +10 -13
- package/es/InpurCascader/InputCascader.js +11 -14
- package/es/InputEditor/InputEditor.js +16 -18
- package/es/InputSearch/InputSearch.js +20 -23
- package/es/InputSelect/InputSelect.js +14 -17
- package/es/InputTreeSelect/InputTreeSelect.js +10 -13
- package/es/InputWriting/InputWriting.js +12 -15
- package/es/Layout/Layout.js +14 -17
- package/es/Link/Link.js +7 -10
- package/es/NumberInput/NumberInput.js +13 -16
- package/es/Search/Search.js +52 -55
- package/es/Search2/Search.js +83 -86
- package/es/Search2/Search.less +64 -64
- package/es/Search2/package.json +6 -6
- package/es/Sidebar/Sidebar.js +11 -14
- package/es/Sidebar2/Sidebar.js +13 -16
- package/es/SuperForm/SuperForm.js +74 -79
- package/es/SuperForm2/SuperForm.js +101 -103
- 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 +70 -73
- package/es/SuperTable2/SuperTable2.js +89 -92
- package/es/SuperTable2/SuperTableCell.js +27 -30
- package/es/SuperTable3/FilterDropDown.js +11 -14
- package/es/SuperTable3/SuperTable.js +58 -61
- package/es/SuperToolbar/SuperToolbar.js +11 -14
- package/es/SuperUpload/SuperUpload.js +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 +11 -14
- package/lib/InputEditor/InputEditor.js +16 -18
- package/lib/InputSearch/InputSearch.js +20 -23
- package/lib/InputSelect/InputSelect.js +14 -17
- package/lib/InputTreeSelect/InputTreeSelect.js +10 -13
- package/lib/InputWriting/InputWriting.js +12 -15
- package/lib/Layout/Layout.js +14 -17
- package/lib/LayoutLink/LayoutLink.js +1 -2
- package/lib/Link/Link.js +7 -10
- package/lib/NumberInput/NumberInput.js +13 -16
- package/lib/Search/Search.js +53 -57
- package/lib/Search2/Search.js +84 -88
- package/lib/Search2/Search.less +64 -64
- package/lib/Search2/package.json +6 -6
- package/lib/Sidebar/Sidebar.js +11 -14
- package/lib/Sidebar2/Sidebar.js +13 -16
- package/lib/SuperForm/SuperForm.js +75 -81
- package/lib/SuperForm2/SuperForm.js +102 -105
- 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 +70 -73
- package/lib/SuperTable2/SuperTable2.js +90 -94
- package/lib/SuperTable2/SuperTableCell.js +27 -30
- package/lib/SuperTable3/FilterDropDown.js +11 -14
- package/lib/SuperTable3/SuperTable.js +58 -61
- package/lib/SuperToolbar/SuperToolbar.js +11 -14
- package/lib/SuperUpload/SuperUpload.js +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
|
@@ -42,10 +42,9 @@ var _checkbox = _interopRequireDefault(require("antd/lib/checkbox"));
|
|
|
42
42
|
var _icon = _interopRequireDefault(require("antd/lib/icon"));
|
|
43
43
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
44
44
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
45
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
46
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
47
45
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
48
46
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
47
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
49
48
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
50
49
|
var _radio = _interopRequireDefault(require("antd/lib/radio"));
|
|
51
50
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -59,15 +58,14 @@ var _variables = _interopRequireDefault(require("../variables"));
|
|
|
59
58
|
var _helper = _interopRequireWildcard(require("../helper"));
|
|
60
59
|
var _DragSortRow = _interopRequireDefault(require("../SuperTable/DragSortRow"));
|
|
61
60
|
var _excluded = ["onRowClick"];
|
|
62
|
-
function
|
|
63
|
-
function
|
|
64
|
-
function
|
|
65
|
-
function
|
|
66
|
-
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; }
|
|
61
|
+
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); }
|
|
62
|
+
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; } } }; }
|
|
63
|
+
function _unsupportedIterableToArray(r, a) { if (r) { var _context18; if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = _sliceInstanceProperty2(_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; } }
|
|
64
|
+
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; }
|
|
67
65
|
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; }
|
|
68
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
69
|
-
function
|
|
70
|
-
function _isNativeReflectConstruct() {
|
|
66
|
+
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; }
|
|
67
|
+
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)); }
|
|
68
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
71
69
|
var RadioGroup = _radio["default"].Group;
|
|
72
70
|
var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select',
|
|
73
71
|
//存储value
|
|
@@ -141,8 +139,6 @@ var CallbackType = {
|
|
|
141
139
|
* isEmphasized: [可选],是否强调,行字体加粗显示, 除了isEmphasized设置为true之外,加粗行数据里要设置__isEmphasized为true
|
|
142
140
|
*/
|
|
143
141
|
var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
144
|
-
(0, _inherits2["default"])(SuperTable2, _React$Component);
|
|
145
|
-
var _super = _createSuper(SuperTable2);
|
|
146
142
|
function SuperTable2() {
|
|
147
143
|
var _context;
|
|
148
144
|
var _this;
|
|
@@ -150,22 +146,22 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
150
146
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
151
147
|
args[_key] = arguments[_key];
|
|
152
148
|
}
|
|
153
|
-
_this =
|
|
154
|
-
(0, _defineProperty2["default"])(
|
|
149
|
+
_this = _callSuper(this, SuperTable2, (0, _concat["default"])(_context = []).call(_context, args));
|
|
150
|
+
(0, _defineProperty2["default"])(_this, "onSwitch", function (key, rowIndex) {
|
|
155
151
|
return function (value) {
|
|
156
152
|
var _ref = _this.props.callback || {},
|
|
157
153
|
onContentChange = _ref.onContentChange;
|
|
158
154
|
onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
|
|
159
155
|
};
|
|
160
156
|
});
|
|
161
|
-
(0, _defineProperty2["default"])(
|
|
157
|
+
(0, _defineProperty2["default"])(_this, "onCheck", function (key, rowIndex) {
|
|
162
158
|
return function (e) {
|
|
163
159
|
var _ref2 = _this.props.callback || {},
|
|
164
160
|
onCheck = _ref2.onCheck;
|
|
165
161
|
onCheck && onCheck(_this.getIndex(rowIndex), key, e.target.checked);
|
|
166
162
|
};
|
|
167
163
|
});
|
|
168
|
-
(0, _defineProperty2["default"])(
|
|
164
|
+
(0, _defineProperty2["default"])(_this, "onChange", function (key, rowIndex) {
|
|
169
165
|
return function (value) {
|
|
170
166
|
var _ref3 = _this.props.callback || {},
|
|
171
167
|
onContentChange = _ref3.onContentChange;
|
|
@@ -173,7 +169,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
173
169
|
onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
|
|
174
170
|
};
|
|
175
171
|
});
|
|
176
|
-
(0, _defineProperty2["default"])(
|
|
172
|
+
(0, _defineProperty2["default"])(_this, "onDoubleChange1", function (key, rowIndex) {
|
|
177
173
|
return function (doublekey, value) {
|
|
178
174
|
var _ref4 = _this.props.callback || {},
|
|
179
175
|
onContentChange = _ref4.onContentChange;
|
|
@@ -181,28 +177,28 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
181
177
|
onContentChange && onContentChange(_this.getIndex(rowIndex), doublekey, value);
|
|
182
178
|
};
|
|
183
179
|
});
|
|
184
|
-
(0, _defineProperty2["default"])(
|
|
180
|
+
(0, _defineProperty2["default"])(_this, "onSearch", function (key, rowIndex, config) {
|
|
185
181
|
return function (value) {
|
|
186
182
|
var _ref5 = _this.props.callback || {},
|
|
187
183
|
onSearch = _ref5.onSearch;
|
|
188
184
|
onSearch && onSearch(_this.getIndex(rowIndex), key, value, config);
|
|
189
185
|
};
|
|
190
186
|
});
|
|
191
|
-
(0, _defineProperty2["default"])(
|
|
187
|
+
(0, _defineProperty2["default"])(_this, "onAdd", function (key) {
|
|
192
188
|
return function () {
|
|
193
189
|
var _ref6 = _this.props.callback || {},
|
|
194
190
|
onAdd = _ref6.onAdd;
|
|
195
191
|
onAdd && onAdd(key);
|
|
196
192
|
};
|
|
197
193
|
});
|
|
198
|
-
(0, _defineProperty2["default"])(
|
|
194
|
+
(0, _defineProperty2["default"])(_this, "onRowAdd", function (key, index) {
|
|
199
195
|
return function () {
|
|
200
196
|
var _ref7 = _this.props.callback || {},
|
|
201
197
|
onLink = _ref7.onLink;
|
|
202
198
|
onLink && onLink(key, index, _this.props.items[index]);
|
|
203
199
|
};
|
|
204
200
|
});
|
|
205
|
-
(0, _defineProperty2["default"])(
|
|
201
|
+
(0, _defineProperty2["default"])(_this, "onBlur", function (key, rowIndex) {
|
|
206
202
|
return function (value) {
|
|
207
203
|
var _ref8 = _this.props.callback || {},
|
|
208
204
|
onBlur = _ref8.onBlur;
|
|
@@ -210,33 +206,33 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
210
206
|
onBlur && onBlur(_this.getIndex(rowIndex), key, value);
|
|
211
207
|
};
|
|
212
208
|
});
|
|
213
|
-
(0, _defineProperty2["default"])(
|
|
209
|
+
(0, _defineProperty2["default"])(_this, "onDoubleClick", function (key, value) {
|
|
214
210
|
return function () {
|
|
215
211
|
var _ref9 = _this.props.callback || {},
|
|
216
212
|
onDoubleClick = _ref9.onDoubleClick;
|
|
217
213
|
onDoubleClick && onDoubleClick(key, value);
|
|
218
214
|
};
|
|
219
215
|
});
|
|
220
|
-
(0, _defineProperty2["default"])(
|
|
216
|
+
(0, _defineProperty2["default"])(_this, "onImgTileClick", function (col, value, rowIndex) {
|
|
221
217
|
return function () {
|
|
222
|
-
var
|
|
223
|
-
onImgTileClick =
|
|
218
|
+
var _ref0 = _this.props.callback || {},
|
|
219
|
+
onImgTileClick = _ref0.onImgTileClick;
|
|
224
220
|
onImgTileClick && onImgTileClick(col, value, rowIndex);
|
|
225
221
|
};
|
|
226
222
|
});
|
|
227
|
-
(0, _defineProperty2["default"])(
|
|
228
|
-
var
|
|
229
|
-
onMoveRow =
|
|
223
|
+
(0, _defineProperty2["default"])(_this, "onMoveRow", function (dragIndex, targetIndex) {
|
|
224
|
+
var _ref1 = _this.props.callback || {},
|
|
225
|
+
onMoveRow = _ref1.onMoveRow;
|
|
230
226
|
onMoveRow && onMoveRow(dragIndex, targetIndex);
|
|
231
227
|
});
|
|
232
|
-
(0, _defineProperty2["default"])(
|
|
228
|
+
(0, _defineProperty2["default"])(_this, "closeValid", function () {
|
|
233
229
|
var _this$props = _this.props,
|
|
234
230
|
valid = _this$props.valid,
|
|
235
231
|
_this$props$callback = _this$props.callback,
|
|
236
232
|
callback = _this$props$callback === void 0 ? {} : _this$props$callback;
|
|
237
233
|
valid && callback.onExitValid();
|
|
238
234
|
});
|
|
239
|
-
(0, _defineProperty2["default"])(
|
|
235
|
+
(0, _defineProperty2["default"])(_this, "getOptions", function (key, colOptions, index) {
|
|
240
236
|
var options = _this.props.items[index].options;
|
|
241
237
|
var options2 = _this.props.options;
|
|
242
238
|
if (options && (0, _isArray["default"])(options[key])) {
|
|
@@ -247,7 +243,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
247
243
|
return colOptions;
|
|
248
244
|
}
|
|
249
245
|
});
|
|
250
|
-
(0, _defineProperty2["default"])(
|
|
246
|
+
(0, _defineProperty2["default"])(_this, "validField", function (required, value) {
|
|
251
247
|
if (!_this.props.valid || _this.error || !required || value) {
|
|
252
248
|
return false;
|
|
253
249
|
} else if (typeof value === 'number') {
|
|
@@ -257,15 +253,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
257
253
|
return true;
|
|
258
254
|
}
|
|
259
255
|
});
|
|
260
|
-
(0, _defineProperty2["default"])(
|
|
261
|
-
var value =
|
|
262
|
-
title =
|
|
256
|
+
(0, _defineProperty2["default"])(_this, "toRadio", function (_ref10, index) {
|
|
257
|
+
var value = _ref10.value,
|
|
258
|
+
title = _ref10.title;
|
|
263
259
|
return /*#__PURE__*/_react["default"].createElement(_radio["default"], {
|
|
264
260
|
key: index,
|
|
265
261
|
value: String(value)
|
|
266
262
|
}, title);
|
|
267
263
|
});
|
|
268
|
-
(0, _defineProperty2["default"])(
|
|
264
|
+
(0, _defineProperty2["default"])(_this, "renderRadioGroup", function (config, value, index) {
|
|
269
265
|
var key = config.key,
|
|
270
266
|
options = config.options;
|
|
271
267
|
var radioGroupProps = {
|
|
@@ -276,7 +272,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
276
272
|
};
|
|
277
273
|
return /*#__PURE__*/_react["default"].createElement(RadioGroup, radioGroupProps, (0, _map["default"])(options).call(options, _this.toRadio));
|
|
278
274
|
});
|
|
279
|
-
(0, _defineProperty2["default"])(
|
|
275
|
+
(0, _defineProperty2["default"])(_this, "renderEditableCell", function (config, value, index) {
|
|
280
276
|
var key = config.key,
|
|
281
277
|
type = config.type,
|
|
282
278
|
options = config.options,
|
|
@@ -368,7 +364,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
368
364
|
}
|
|
369
365
|
return /*#__PURE__*/_react["default"].createElement(_SuperTableCell["default"], cellProps);
|
|
370
366
|
});
|
|
371
|
-
(0, _defineProperty2["default"])(
|
|
367
|
+
(0, _defineProperty2["default"])(_this, "renderDoubleEditableCell", function (config, value, index) {
|
|
372
368
|
var key = config.key,
|
|
373
369
|
type = config.type,
|
|
374
370
|
options = config.options,
|
|
@@ -398,7 +394,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
398
394
|
};
|
|
399
395
|
return /*#__PURE__*/_react["default"].createElement(_SuperTableCell["default"], cellProps);
|
|
400
396
|
});
|
|
401
|
-
(0, _defineProperty2["default"])(
|
|
397
|
+
(0, _defineProperty2["default"])(_this, "renderLinkCell", function (col, value, record, index) {
|
|
402
398
|
if (col.link === 'list') {
|
|
403
399
|
var list = value && (0, _isArray["default"])(value) ? value : [];
|
|
404
400
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -409,8 +405,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
409
405
|
var _context2;
|
|
410
406
|
var split = index2 === list.length - 1 ? '' : ',';
|
|
411
407
|
var onClick = function onClick() {
|
|
412
|
-
var
|
|
413
|
-
onLink =
|
|
408
|
+
var _ref11 = _this.props.callback || {},
|
|
409
|
+
onLink = _ref11.onLink;
|
|
414
410
|
onLink && onLink(col.key, index, item2);
|
|
415
411
|
};
|
|
416
412
|
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
@@ -421,8 +417,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
421
417
|
} else {
|
|
422
418
|
var title = typeof col.link === 'string' ? col.link : value;
|
|
423
419
|
var onClick = function onClick() {
|
|
424
|
-
var
|
|
425
|
-
onLink =
|
|
420
|
+
var _ref12 = _this.props.callback || {},
|
|
421
|
+
onLink = _ref12.onLink;
|
|
426
422
|
onLink && onLink(col.key, index, record);
|
|
427
423
|
};
|
|
428
424
|
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
@@ -434,12 +430,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
434
430
|
}, title);
|
|
435
431
|
}
|
|
436
432
|
});
|
|
437
|
-
(0, _defineProperty2["default"])(
|
|
433
|
+
(0, _defineProperty2["default"])(_this, "getIndex", function (index) {
|
|
438
434
|
return (_this.props.base || 0) + index;
|
|
439
435
|
});
|
|
440
|
-
(0, _defineProperty2["default"])(
|
|
436
|
+
(0, _defineProperty2["default"])(_this, "getCellRender", function (col) {
|
|
441
437
|
return function (value, record, index) {
|
|
442
|
-
var _context3, _context4, _context5, _context6, _context7, _context8, _context9,
|
|
438
|
+
var _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context0;
|
|
443
439
|
var realType = record._isEdit === true && _this.canReadonly(col.type) ? col.editType : col.type;
|
|
444
440
|
if (realType === 'customType') {
|
|
445
441
|
var _this$props$items$rec = _this.props.items[record.key].__customType,
|
|
@@ -564,7 +560,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
564
560
|
case 'uploadImg':
|
|
565
561
|
var commonProps = _this.props.callback.buildSuperUploadProps ? _this.props.callback.buildSuperUploadProps() : {};
|
|
566
562
|
var uploadProps = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
567
|
-
onFileChange: _this.props.callback.onTableFileChange ? (0, _bind["default"])(
|
|
563
|
+
onFileChange: _this.props.callback.onTableFileChange ? (0, _bind["default"])(_context0 = _this.props.callback.onTableFileChange).call(_context0, null, col.key, index) : undefined,
|
|
568
564
|
type: col.type
|
|
569
565
|
}, col.props), _this.props), commonProps), {}, {
|
|
570
566
|
value: _this.props.items[index][col.key]
|
|
@@ -581,7 +577,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
581
577
|
}
|
|
582
578
|
};
|
|
583
579
|
});
|
|
584
|
-
(0, _defineProperty2["default"])(
|
|
580
|
+
(0, _defineProperty2["default"])(_this, "getCheckedStatus", function (key) {
|
|
585
581
|
var has = false,
|
|
586
582
|
not = false;
|
|
587
583
|
var items = _this.props.items;
|
|
@@ -602,7 +598,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
602
598
|
indeterminate: has && not
|
|
603
599
|
};
|
|
604
600
|
});
|
|
605
|
-
(0, _defineProperty2["default"])(
|
|
601
|
+
(0, _defineProperty2["default"])(_this, "toAdd", function (key, showAdd) {
|
|
606
602
|
if (showAdd) {
|
|
607
603
|
var onClick = _this.onAdd(key);
|
|
608
604
|
return /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
@@ -614,12 +610,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
614
610
|
return null;
|
|
615
611
|
}
|
|
616
612
|
});
|
|
617
|
-
(0, _defineProperty2["default"])(
|
|
618
|
-
var required =
|
|
619
|
-
title =
|
|
620
|
-
type =
|
|
621
|
-
key =
|
|
622
|
-
showAdd =
|
|
613
|
+
(0, _defineProperty2["default"])(_this, "getColumnTitle", function (_ref14) {
|
|
614
|
+
var required = _ref14.required,
|
|
615
|
+
title = _ref14.title,
|
|
616
|
+
type = _ref14.type,
|
|
617
|
+
key = _ref14.key,
|
|
618
|
+
showAdd = _ref14.showAdd;
|
|
623
619
|
if (type === 'checkbox') {
|
|
624
620
|
var status = _this.getCheckedStatus(key);
|
|
625
621
|
return /*#__PURE__*/_react["default"].createElement(_checkbox["default"], (0, _extends2["default"])({
|
|
@@ -632,23 +628,23 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
632
628
|
}, title, _this.toAdd(key, showAdd));
|
|
633
629
|
}
|
|
634
630
|
});
|
|
635
|
-
(0, _defineProperty2["default"])(
|
|
636
|
-
var type =
|
|
637
|
-
align =
|
|
631
|
+
(0, _defineProperty2["default"])(_this, "getColumnClassName", function (_ref15) {
|
|
632
|
+
var type = _ref15.type,
|
|
633
|
+
align = _ref15.align;
|
|
638
634
|
if (type === 'index' || type === 'checkbox') {
|
|
639
635
|
return 'ant-table-selection-column';
|
|
640
636
|
} else {
|
|
641
637
|
return align ? (0, _variables["default"])('SuperTable2')[align] : '';
|
|
642
638
|
}
|
|
643
639
|
});
|
|
644
|
-
(0, _defineProperty2["default"])(
|
|
645
|
-
var
|
|
646
|
-
return !(0, _includes["default"])(
|
|
640
|
+
(0, _defineProperty2["default"])(_this, "canReadonly", function (type) {
|
|
641
|
+
var _context1;
|
|
642
|
+
return !(0, _includes["default"])(_context1 = ['index', 'checkbox', 'link', 'button', 'switch', 'custom', 'img', 'toolbar', 'uploadImg', 'double']).call(_context1, type);
|
|
647
643
|
});
|
|
648
|
-
(0, _defineProperty2["default"])(
|
|
649
|
-
var tipLen =
|
|
650
|
-
options =
|
|
651
|
-
width =
|
|
644
|
+
(0, _defineProperty2["default"])(_this, "tooltip", function (key, index, item, _ref16) {
|
|
645
|
+
var tipLen = _ref16.tooltip,
|
|
646
|
+
options = _ref16.options,
|
|
647
|
+
width = _ref16.width;
|
|
652
648
|
var text = _this.getText(item[key], options);
|
|
653
649
|
var needTip = tipLen > 1 && text && typeof text === 'string' && text.length > tipLen;
|
|
654
650
|
return needTip ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
@@ -681,18 +677,18 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
681
677
|
title: true
|
|
682
678
|
}, (0, _isArray["default"])(text) ? text.join(',') : text, " ");
|
|
683
679
|
});
|
|
684
|
-
(0, _defineProperty2["default"])(
|
|
685
|
-
var
|
|
680
|
+
(0, _defineProperty2["default"])(_this, "getColumns", function (cols, items) {
|
|
681
|
+
var _context10;
|
|
686
682
|
var readonly = _this.props.readonly;
|
|
687
|
-
return (0, _map["default"])(
|
|
683
|
+
return (0, _map["default"])(_context10 = (0, _filter["default"])(cols).call(cols, function (col) {
|
|
688
684
|
return !col.hide;
|
|
689
|
-
})).call(
|
|
690
|
-
var
|
|
691
|
-
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(
|
|
685
|
+
})).call(_context10, function (_ref17, index) {
|
|
686
|
+
var _context11;
|
|
687
|
+
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref17), _ref17));
|
|
692
688
|
col.className = _this.getColumnClassName(col);
|
|
693
689
|
col.title = _this.getColumnTitle(col);
|
|
694
690
|
col.dataIndex = col.key;
|
|
695
|
-
!_this.props.autoAdjustingWidth && (col.width = col.width ? col.width : (0, _includes["default"])(
|
|
691
|
+
!_this.props.autoAdjustingWidth && (col.width = col.width ? col.width : (0, _includes["default"])(_context11 = ['index', 'checked']).call(_context11, col.key) ? 70 : col.type === 'img' ? 200 : 120);
|
|
696
692
|
// col.width = col.width ? col.width : (['index','checked'].includes(col.key) ? 70 : (col.type === 'img' ? 200 : 120));
|
|
697
693
|
|
|
698
694
|
// const {props = {}} =
|
|
@@ -724,7 +720,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
724
720
|
return col;
|
|
725
721
|
});
|
|
726
722
|
});
|
|
727
|
-
(0, _defineProperty2["default"])(
|
|
723
|
+
(0, _defineProperty2["default"])(_this, "getText", function (value, options) {
|
|
728
724
|
if ((0, _isArray["default"])(value)) {
|
|
729
725
|
return (0, _map["default"])(value).call(value, function (v) {
|
|
730
726
|
return (0, _Control.getTitle)(v, options);
|
|
@@ -733,14 +729,14 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
733
729
|
return (0, _Control.getTitle)(value, options);
|
|
734
730
|
}
|
|
735
731
|
});
|
|
736
|
-
(0, _defineProperty2["default"])(
|
|
732
|
+
(0, _defineProperty2["default"])(_this, "getDataSource", function (items, cols) {
|
|
737
733
|
return (0, _map["default"])(items).call(items, function (item, index) {
|
|
738
|
-
return (0, _reduce["default"])(cols).call(cols, function (result,
|
|
739
|
-
var
|
|
740
|
-
var key =
|
|
741
|
-
type =
|
|
742
|
-
options =
|
|
743
|
-
if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || (0, _isArray["default"])(item.isReadonly) && !(0, _includes["default"])(
|
|
734
|
+
return (0, _reduce["default"])(cols).call(cols, function (result, _ref18) {
|
|
735
|
+
var _context12, _context13;
|
|
736
|
+
var key = _ref18.key,
|
|
737
|
+
type = _ref18.type,
|
|
738
|
+
options = _ref18.options;
|
|
739
|
+
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)) {
|
|
744
740
|
result[key] = item[key];
|
|
745
741
|
} else {
|
|
746
742
|
result[key] = _this.getText(item[key], options);
|
|
@@ -752,7 +748,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
752
748
|
}));
|
|
753
749
|
});
|
|
754
750
|
});
|
|
755
|
-
(0, _defineProperty2["default"])(
|
|
751
|
+
(0, _defineProperty2["default"])(_this, "getPropsByCheckbox", function () {
|
|
756
752
|
var _this$props2 = _this.props,
|
|
757
753
|
items = _this$props2.items,
|
|
758
754
|
_this$props2$isEmphas = _this$props2.isEmphasized,
|
|
@@ -767,13 +763,13 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
767
763
|
rowClassName: rowClassName
|
|
768
764
|
};
|
|
769
765
|
});
|
|
770
|
-
(0, _defineProperty2["default"])(
|
|
766
|
+
(0, _defineProperty2["default"])(_this, "getSelectedRowKeys", function (items) {
|
|
771
767
|
return (0, _reduce["default"])(items).call(items, function (result, item, index) {
|
|
772
768
|
item.checked && result.push(index);
|
|
773
769
|
return result;
|
|
774
770
|
}, []);
|
|
775
771
|
});
|
|
776
|
-
(0, _defineProperty2["default"])(
|
|
772
|
+
(0, _defineProperty2["default"])(_this, "getPropsByCheckbox2", function (items) {
|
|
777
773
|
var _this$props3 = _this.props,
|
|
778
774
|
_this$props3$checkbox = _this$props3.checkbox,
|
|
779
775
|
checkbox = _this$props3$checkbox === void 0 ? true : _this$props3$checkbox,
|
|
@@ -858,7 +854,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
858
854
|
};
|
|
859
855
|
}
|
|
860
856
|
});
|
|
861
|
-
(0, _defineProperty2["default"])(
|
|
857
|
+
(0, _defineProperty2["default"])(_this, "getRowPropsForDrag", function () {
|
|
862
858
|
return function (record, index) {
|
|
863
859
|
return {
|
|
864
860
|
index: index,
|
|
@@ -866,7 +862,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
866
862
|
};
|
|
867
863
|
};
|
|
868
864
|
});
|
|
869
|
-
(0, _defineProperty2["default"])(
|
|
865
|
+
(0, _defineProperty2["default"])(_this, "getRowProps", function (onRowClick) {
|
|
870
866
|
return function (record) {
|
|
871
867
|
return {
|
|
872
868
|
onClick: function onClick() {
|
|
@@ -878,8 +874,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
878
874
|
};
|
|
879
875
|
};
|
|
880
876
|
});
|
|
881
|
-
(0, _defineProperty2["default"])(
|
|
882
|
-
var
|
|
877
|
+
(0, _defineProperty2["default"])(_this, "getProps", function () {
|
|
878
|
+
var _context14;
|
|
883
879
|
var _this$props4 = _this.props,
|
|
884
880
|
cols = _this$props4.cols,
|
|
885
881
|
items = _this$props4.items,
|
|
@@ -901,11 +897,11 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
901
897
|
expandedRowRenderKeepScroll = _this$props4$expanded2 === void 0 ? false : _this$props4$expanded2,
|
|
902
898
|
_this$props4$autoAdju = _this$props4.autoAdjustingWidth,
|
|
903
899
|
autoAdjustingWidth = _this$props4$autoAdju === void 0 ? false : _this$props4$autoAdju;
|
|
904
|
-
var widthX = (0, _reduce["default"])(
|
|
900
|
+
var widthX = (0, _reduce["default"])(_context14 = (0, _filter["default"])(cols).call(cols, function (col) {
|
|
905
901
|
return !col.hide;
|
|
906
|
-
})).call(
|
|
907
|
-
var
|
|
908
|
-
return width += item.width ? item.width : (0, _includes["default"])(
|
|
902
|
+
})).call(_context14, function (width, item) {
|
|
903
|
+
var _context15;
|
|
904
|
+
return width += item.width ? item.width : (0, _includes["default"])(_context15 = ['index', 'checked']).call(_context15, item.key) ? 70 : item.type === 'img' ? 200 : 120;
|
|
909
905
|
}, 0);
|
|
910
906
|
var scrollProps = {};
|
|
911
907
|
if (expandedRowRenderKeepScroll) {
|
|
@@ -961,9 +957,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
961
957
|
});
|
|
962
958
|
return props;
|
|
963
959
|
});
|
|
964
|
-
(0, _defineProperty2["default"])(
|
|
960
|
+
(0, _defineProperty2["default"])(_this, "setScroll", function () {
|
|
965
961
|
if (_this.props.maxHeight && _this.props.items.length) {
|
|
966
|
-
var root = _reactDom["default"].findDOMNode(
|
|
962
|
+
var root = _reactDom["default"].findDOMNode(_this);
|
|
967
963
|
var container = root.getElementsByClassName('ant-table-body')[0];
|
|
968
964
|
var header = root.getElementsByClassName('ant-table-thead')[0];
|
|
969
965
|
(0, _fixed["default"])(container, header, _this.props.maxHeight);
|
|
@@ -971,7 +967,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
971
967
|
});
|
|
972
968
|
return _this;
|
|
973
969
|
}
|
|
974
|
-
(0,
|
|
970
|
+
(0, _inherits2["default"])(SuperTable2, _React$Component);
|
|
971
|
+
return (0, _createClass2["default"])(SuperTable2, [{
|
|
975
972
|
key: "componentDidMount",
|
|
976
973
|
value: function componentDidMount() {
|
|
977
974
|
this.setScroll();
|
|
@@ -990,7 +987,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
990
987
|
}));
|
|
991
988
|
}
|
|
992
989
|
}]);
|
|
993
|
-
return SuperTable2;
|
|
994
990
|
}(_react["default"].Component);
|
|
995
991
|
(0, _defineProperty2["default"])(SuperTable2, "propTypes", {
|
|
996
992
|
cols: _propTypes["default"].arrayOf(_propTypes["default"].shape(ColType)).isRequired,
|