cloud-b2b 1.1.62 → 1.1.63
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 +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/Search2/Search.js +85 -88
- 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 +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 +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 +107 -91
- 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 +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/Search2/Search.js +86 -90
- 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 +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 +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 +96 -81
- 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 === 'customType') {
|
|
443
439
|
var _this$props$items$rec = _this.props.items[record.key].__customType,
|
|
@@ -562,7 +558,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
562
558
|
case 'uploadImg':
|
|
563
559
|
var commonProps = _this.props.callback.buildSuperUploadProps ? _this.props.callback.buildSuperUploadProps() : {};
|
|
564
560
|
var uploadProps = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
565
|
-
onFileChange: _this.props.callback.onTableFileChange ? (0, _bind["default"])(
|
|
561
|
+
onFileChange: _this.props.callback.onTableFileChange ? (0, _bind["default"])(_context0 = _this.props.callback.onTableFileChange).call(_context0, null, col.key, index) : undefined,
|
|
566
562
|
type: col.type
|
|
567
563
|
}, col.props), _this.props), commonProps), {}, {
|
|
568
564
|
value: _this.props.items[index][col.key]
|
|
@@ -579,7 +575,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
579
575
|
}
|
|
580
576
|
};
|
|
581
577
|
});
|
|
582
|
-
(0, _defineProperty2["default"])(
|
|
578
|
+
(0, _defineProperty2["default"])(_this, "getCheckedStatus", function (key) {
|
|
583
579
|
var has = false,
|
|
584
580
|
not = false;
|
|
585
581
|
var items = _this.props.items;
|
|
@@ -600,7 +596,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
600
596
|
indeterminate: has && not
|
|
601
597
|
};
|
|
602
598
|
});
|
|
603
|
-
(0, _defineProperty2["default"])(
|
|
599
|
+
(0, _defineProperty2["default"])(_this, "toAdd", function (key, showAdd) {
|
|
604
600
|
if (showAdd) {
|
|
605
601
|
var onClick = _this.onAdd(key);
|
|
606
602
|
return /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
@@ -612,12 +608,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
612
608
|
return null;
|
|
613
609
|
}
|
|
614
610
|
});
|
|
615
|
-
(0, _defineProperty2["default"])(
|
|
616
|
-
var required =
|
|
617
|
-
title =
|
|
618
|
-
type =
|
|
619
|
-
key =
|
|
620
|
-
showAdd =
|
|
611
|
+
(0, _defineProperty2["default"])(_this, "getColumnTitle", function (_ref14) {
|
|
612
|
+
var required = _ref14.required,
|
|
613
|
+
title = _ref14.title,
|
|
614
|
+
type = _ref14.type,
|
|
615
|
+
key = _ref14.key,
|
|
616
|
+
showAdd = _ref14.showAdd;
|
|
621
617
|
if (type === 'checkbox') {
|
|
622
618
|
var status = _this.getCheckedStatus(key);
|
|
623
619
|
return /*#__PURE__*/_react["default"].createElement(_checkbox["default"], (0, _extends2["default"])({
|
|
@@ -630,31 +626,31 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
630
626
|
}, title, _this.toAdd(key, showAdd));
|
|
631
627
|
}
|
|
632
628
|
});
|
|
633
|
-
(0, _defineProperty2["default"])(
|
|
634
|
-
var type =
|
|
635
|
-
align =
|
|
629
|
+
(0, _defineProperty2["default"])(_this, "getColumnClassName", function (_ref15) {
|
|
630
|
+
var type = _ref15.type,
|
|
631
|
+
align = _ref15.align;
|
|
636
632
|
if (type === 'index' || type === 'checkbox') {
|
|
637
633
|
return 'ant-table-selection-column';
|
|
638
634
|
} else {
|
|
639
635
|
return align ? (0, _variables["default"])('SuperTable2')[align] : '';
|
|
640
636
|
}
|
|
641
637
|
});
|
|
642
|
-
(0, _defineProperty2["default"])(
|
|
643
|
-
var
|
|
644
|
-
return !(0, _includes["default"])(
|
|
638
|
+
(0, _defineProperty2["default"])(_this, "canReadonly", function (type) {
|
|
639
|
+
var _context1;
|
|
640
|
+
return !(0, _includes["default"])(_context1 = ['index', 'checkbox', 'link', 'button', 'switch', 'custom', 'img', 'toolbar', 'uploadImg', 'double']).call(_context1, type);
|
|
645
641
|
});
|
|
646
|
-
(0, _defineProperty2["default"])(
|
|
647
|
-
var
|
|
642
|
+
(0, _defineProperty2["default"])(_this, "getColumns", function (cols) {
|
|
643
|
+
var _context10;
|
|
648
644
|
var readonly = _this.props.readonly;
|
|
649
|
-
return (0, _map["default"])(
|
|
645
|
+
return (0, _map["default"])(_context10 = (0, _filter["default"])(cols).call(cols, function (col) {
|
|
650
646
|
return !col.hide;
|
|
651
|
-
})).call(
|
|
652
|
-
var
|
|
653
|
-
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(
|
|
647
|
+
})).call(_context10, function (_ref16, index) {
|
|
648
|
+
var _context11;
|
|
649
|
+
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref16), _ref16));
|
|
654
650
|
col.className = _this.getColumnClassName(col);
|
|
655
651
|
col.title = _this.getColumnTitle(col);
|
|
656
652
|
col.dataIndex = col.key;
|
|
657
|
-
col.width = col.width ? col.width : (0, _includes["default"])(
|
|
653
|
+
col.width = col.width ? col.width : (0, _includes["default"])(_context11 = ['index', 'checked']).call(_context11, col.key) ? 70 : col.type === 'img' ? 200 : 120;
|
|
658
654
|
// const {props = {}} =
|
|
659
655
|
// const {edit = false} = props
|
|
660
656
|
// if (!(readonly || col.type === 'readonly') || !this.canReadonly(col.type)) {
|
|
@@ -680,7 +676,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
680
676
|
return col;
|
|
681
677
|
});
|
|
682
678
|
});
|
|
683
|
-
(0, _defineProperty2["default"])(
|
|
679
|
+
(0, _defineProperty2["default"])(_this, "getText", function (value, options) {
|
|
684
680
|
if ((0, _isArray["default"])(value)) {
|
|
685
681
|
return (0, _map["default"])(value).call(value, function (v) {
|
|
686
682
|
return (0, _Control.getTitle)(v, options);
|
|
@@ -689,14 +685,14 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
689
685
|
return (0, _Control.getTitle)(value, options);
|
|
690
686
|
}
|
|
691
687
|
});
|
|
692
|
-
(0, _defineProperty2["default"])(
|
|
688
|
+
(0, _defineProperty2["default"])(_this, "getDataSource", function (items, cols) {
|
|
693
689
|
return (0, _map["default"])(items).call(items, function (item, index) {
|
|
694
|
-
return (0, _reduce["default"])(cols).call(cols, function (result,
|
|
695
|
-
var
|
|
696
|
-
var key =
|
|
697
|
-
type =
|
|
698
|
-
options =
|
|
699
|
-
if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || (0, _isArray["default"])(item.isReadonly) && !(0, _includes["default"])(
|
|
690
|
+
return (0, _reduce["default"])(cols).call(cols, function (result, _ref17) {
|
|
691
|
+
var _context12, _context13;
|
|
692
|
+
var key = _ref17.key,
|
|
693
|
+
type = _ref17.type,
|
|
694
|
+
options = _ref17.options;
|
|
695
|
+
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)) {
|
|
700
696
|
result[key] = item[key];
|
|
701
697
|
} else {
|
|
702
698
|
result[key] = _this.getText(item[key], options);
|
|
@@ -708,7 +704,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
708
704
|
}));
|
|
709
705
|
});
|
|
710
706
|
});
|
|
711
|
-
(0, _defineProperty2["default"])(
|
|
707
|
+
(0, _defineProperty2["default"])(_this, "getPropsByCheckbox", function () {
|
|
712
708
|
var _this$props2 = _this.props,
|
|
713
709
|
items = _this$props2.items,
|
|
714
710
|
_this$props2$isEmphas = _this$props2.isEmphasized,
|
|
@@ -723,13 +719,13 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
723
719
|
rowClassName: rowClassName
|
|
724
720
|
};
|
|
725
721
|
});
|
|
726
|
-
(0, _defineProperty2["default"])(
|
|
722
|
+
(0, _defineProperty2["default"])(_this, "getSelectedRowKeys", function (items) {
|
|
727
723
|
return (0, _reduce["default"])(items).call(items, function (result, item, index) {
|
|
728
724
|
item.checked && result.push(index);
|
|
729
725
|
return result;
|
|
730
726
|
}, []);
|
|
731
727
|
});
|
|
732
|
-
(0, _defineProperty2["default"])(
|
|
728
|
+
(0, _defineProperty2["default"])(_this, "getPropsByCheckbox2", function (items) {
|
|
733
729
|
var _this$props3 = _this.props,
|
|
734
730
|
_this$props3$checkbox = _this$props3.checkbox,
|
|
735
731
|
checkbox = _this$props3$checkbox === void 0 ? true : _this$props3$checkbox,
|
|
@@ -814,7 +810,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
814
810
|
};
|
|
815
811
|
}
|
|
816
812
|
});
|
|
817
|
-
(0, _defineProperty2["default"])(
|
|
813
|
+
(0, _defineProperty2["default"])(_this, "getRowPropsForDrag", function () {
|
|
818
814
|
return function (record, index) {
|
|
819
815
|
return {
|
|
820
816
|
index: index,
|
|
@@ -822,7 +818,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
822
818
|
};
|
|
823
819
|
};
|
|
824
820
|
});
|
|
825
|
-
(0, _defineProperty2["default"])(
|
|
821
|
+
(0, _defineProperty2["default"])(_this, "getRowProps", function (onRowClick) {
|
|
826
822
|
return function (record) {
|
|
827
823
|
return {
|
|
828
824
|
onClick: function onClick() {
|
|
@@ -834,8 +830,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
834
830
|
};
|
|
835
831
|
};
|
|
836
832
|
});
|
|
837
|
-
(0, _defineProperty2["default"])(
|
|
838
|
-
var
|
|
833
|
+
(0, _defineProperty2["default"])(_this, "getProps", function () {
|
|
834
|
+
var _context14;
|
|
839
835
|
var _this$props4 = _this.props,
|
|
840
836
|
cols = _this$props4.cols,
|
|
841
837
|
items = _this$props4.items,
|
|
@@ -853,11 +849,11 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
853
849
|
expandedRowRender = _this$props4$expanded === void 0 ? undefined : _this$props4$expanded,
|
|
854
850
|
_this$props4$onExpand = _this$props4.onExpand,
|
|
855
851
|
onExpand = _this$props4$onExpand === void 0 ? undefined : _this$props4$onExpand;
|
|
856
|
-
var widthX = (0, _reduce["default"])(
|
|
852
|
+
var widthX = (0, _reduce["default"])(_context14 = (0, _filter["default"])(cols).call(cols, function (col) {
|
|
857
853
|
return !col.hide;
|
|
858
|
-
})).call(
|
|
859
|
-
var
|
|
860
|
-
return width += item.width ? item.width : (0, _includes["default"])(
|
|
854
|
+
})).call(_context14, function (width, item) {
|
|
855
|
+
var _context15;
|
|
856
|
+
return width += item.width ? item.width : (0, _includes["default"])(_context15 = ['index', 'checked']).call(_context15, item.key) ? 70 : item.type === 'img' ? 200 : 120;
|
|
861
857
|
}, 0);
|
|
862
858
|
var scrollProps = !_helper["default"].isEmpty2(expandedRowRender) ? {
|
|
863
859
|
expandedRowRender: expandedRowRender
|
|
@@ -895,9 +891,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
895
891
|
onExpand: onExpand
|
|
896
892
|
}, scrollProps);
|
|
897
893
|
});
|
|
898
|
-
(0, _defineProperty2["default"])(
|
|
894
|
+
(0, _defineProperty2["default"])(_this, "setScroll", function () {
|
|
899
895
|
if (_this.props.maxHeight && _this.props.items.length) {
|
|
900
|
-
var root = _reactDom["default"].findDOMNode(
|
|
896
|
+
var root = _reactDom["default"].findDOMNode(_this);
|
|
901
897
|
var container = root.getElementsByClassName('ant-table-body')[0];
|
|
902
898
|
var header = root.getElementsByClassName('ant-table-thead')[0];
|
|
903
899
|
(0, _fixed["default"])(container, header, _this.props.maxHeight);
|
|
@@ -905,7 +901,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
905
901
|
});
|
|
906
902
|
return _this;
|
|
907
903
|
}
|
|
908
|
-
(0,
|
|
904
|
+
(0, _inherits2["default"])(SuperTable2, _React$Component);
|
|
905
|
+
return (0, _createClass2["default"])(SuperTable2, [{
|
|
909
906
|
key: "componentDidMount",
|
|
910
907
|
value: function componentDidMount() {
|
|
911
908
|
this.setScroll();
|
|
@@ -924,7 +921,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
924
921
|
}));
|
|
925
922
|
}
|
|
926
923
|
}]);
|
|
927
|
-
return SuperTable2;
|
|
928
924
|
}(_react["default"].Component);
|
|
929
925
|
(0, _defineProperty2["default"])(SuperTable2, "propTypes", {
|
|
930
926
|
cols: _propTypes["default"].arrayOf(_propTypes["default"].shape(ColType)).isRequired,
|