cloud-b2b 1.1.61 → 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 +90 -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 +91 -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,13 +428,18 @@ 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;
|
|
438
|
+
if (realType === 'customType') {
|
|
439
|
+
var _this$props$items$rec = _this.props.items[record.key].__customType,
|
|
440
|
+
__customType = _this$props$items$rec === void 0 ? (0, _defineProperty2["default"])({}, col.key, 'text') : _this$props$items$rec;
|
|
441
|
+
realType = __customType[col.key];
|
|
442
|
+
}
|
|
442
443
|
if (!realType) {
|
|
443
444
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
444
445
|
onDoubleClick: _this.onDoubleClick(col.key, record.key),
|
|
@@ -557,7 +558,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
557
558
|
case 'uploadImg':
|
|
558
559
|
var commonProps = _this.props.callback.buildSuperUploadProps ? _this.props.callback.buildSuperUploadProps() : {};
|
|
559
560
|
var uploadProps = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
560
|
-
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,
|
|
561
562
|
type: col.type
|
|
562
563
|
}, col.props), _this.props), commonProps), {}, {
|
|
563
564
|
value: _this.props.items[index][col.key]
|
|
@@ -574,7 +575,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
574
575
|
}
|
|
575
576
|
};
|
|
576
577
|
});
|
|
577
|
-
(0, _defineProperty2["default"])(
|
|
578
|
+
(0, _defineProperty2["default"])(_this, "getCheckedStatus", function (key) {
|
|
578
579
|
var has = false,
|
|
579
580
|
not = false;
|
|
580
581
|
var items = _this.props.items;
|
|
@@ -595,7 +596,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
595
596
|
indeterminate: has && not
|
|
596
597
|
};
|
|
597
598
|
});
|
|
598
|
-
(0, _defineProperty2["default"])(
|
|
599
|
+
(0, _defineProperty2["default"])(_this, "toAdd", function (key, showAdd) {
|
|
599
600
|
if (showAdd) {
|
|
600
601
|
var onClick = _this.onAdd(key);
|
|
601
602
|
return /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
@@ -607,12 +608,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
607
608
|
return null;
|
|
608
609
|
}
|
|
609
610
|
});
|
|
610
|
-
(0, _defineProperty2["default"])(
|
|
611
|
-
var required =
|
|
612
|
-
title =
|
|
613
|
-
type =
|
|
614
|
-
key =
|
|
615
|
-
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;
|
|
616
617
|
if (type === 'checkbox') {
|
|
617
618
|
var status = _this.getCheckedStatus(key);
|
|
618
619
|
return /*#__PURE__*/_react["default"].createElement(_checkbox["default"], (0, _extends2["default"])({
|
|
@@ -625,31 +626,31 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
625
626
|
}, title, _this.toAdd(key, showAdd));
|
|
626
627
|
}
|
|
627
628
|
});
|
|
628
|
-
(0, _defineProperty2["default"])(
|
|
629
|
-
var type =
|
|
630
|
-
align =
|
|
629
|
+
(0, _defineProperty2["default"])(_this, "getColumnClassName", function (_ref15) {
|
|
630
|
+
var type = _ref15.type,
|
|
631
|
+
align = _ref15.align;
|
|
631
632
|
if (type === 'index' || type === 'checkbox') {
|
|
632
633
|
return 'ant-table-selection-column';
|
|
633
634
|
} else {
|
|
634
635
|
return align ? (0, _variables["default"])('SuperTable2')[align] : '';
|
|
635
636
|
}
|
|
636
637
|
});
|
|
637
|
-
(0, _defineProperty2["default"])(
|
|
638
|
-
var
|
|
639
|
-
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);
|
|
640
641
|
});
|
|
641
|
-
(0, _defineProperty2["default"])(
|
|
642
|
-
var
|
|
642
|
+
(0, _defineProperty2["default"])(_this, "getColumns", function (cols) {
|
|
643
|
+
var _context10;
|
|
643
644
|
var readonly = _this.props.readonly;
|
|
644
|
-
return (0, _map["default"])(
|
|
645
|
+
return (0, _map["default"])(_context10 = (0, _filter["default"])(cols).call(cols, function (col) {
|
|
645
646
|
return !col.hide;
|
|
646
|
-
})).call(
|
|
647
|
-
var
|
|
648
|
-
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));
|
|
649
650
|
col.className = _this.getColumnClassName(col);
|
|
650
651
|
col.title = _this.getColumnTitle(col);
|
|
651
652
|
col.dataIndex = col.key;
|
|
652
|
-
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;
|
|
653
654
|
// const {props = {}} =
|
|
654
655
|
// const {edit = false} = props
|
|
655
656
|
// if (!(readonly || col.type === 'readonly') || !this.canReadonly(col.type)) {
|
|
@@ -675,7 +676,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
675
676
|
return col;
|
|
676
677
|
});
|
|
677
678
|
});
|
|
678
|
-
(0, _defineProperty2["default"])(
|
|
679
|
+
(0, _defineProperty2["default"])(_this, "getText", function (value, options) {
|
|
679
680
|
if ((0, _isArray["default"])(value)) {
|
|
680
681
|
return (0, _map["default"])(value).call(value, function (v) {
|
|
681
682
|
return (0, _Control.getTitle)(v, options);
|
|
@@ -684,14 +685,14 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
684
685
|
return (0, _Control.getTitle)(value, options);
|
|
685
686
|
}
|
|
686
687
|
});
|
|
687
|
-
(0, _defineProperty2["default"])(
|
|
688
|
+
(0, _defineProperty2["default"])(_this, "getDataSource", function (items, cols) {
|
|
688
689
|
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"])(
|
|
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)) {
|
|
695
696
|
result[key] = item[key];
|
|
696
697
|
} else {
|
|
697
698
|
result[key] = _this.getText(item[key], options);
|
|
@@ -703,7 +704,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
703
704
|
}));
|
|
704
705
|
});
|
|
705
706
|
});
|
|
706
|
-
(0, _defineProperty2["default"])(
|
|
707
|
+
(0, _defineProperty2["default"])(_this, "getPropsByCheckbox", function () {
|
|
707
708
|
var _this$props2 = _this.props,
|
|
708
709
|
items = _this$props2.items,
|
|
709
710
|
_this$props2$isEmphas = _this$props2.isEmphasized,
|
|
@@ -718,13 +719,13 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
718
719
|
rowClassName: rowClassName
|
|
719
720
|
};
|
|
720
721
|
});
|
|
721
|
-
(0, _defineProperty2["default"])(
|
|
722
|
+
(0, _defineProperty2["default"])(_this, "getSelectedRowKeys", function (items) {
|
|
722
723
|
return (0, _reduce["default"])(items).call(items, function (result, item, index) {
|
|
723
724
|
item.checked && result.push(index);
|
|
724
725
|
return result;
|
|
725
726
|
}, []);
|
|
726
727
|
});
|
|
727
|
-
(0, _defineProperty2["default"])(
|
|
728
|
+
(0, _defineProperty2["default"])(_this, "getPropsByCheckbox2", function (items) {
|
|
728
729
|
var _this$props3 = _this.props,
|
|
729
730
|
_this$props3$checkbox = _this$props3.checkbox,
|
|
730
731
|
checkbox = _this$props3$checkbox === void 0 ? true : _this$props3$checkbox,
|
|
@@ -809,7 +810,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
809
810
|
};
|
|
810
811
|
}
|
|
811
812
|
});
|
|
812
|
-
(0, _defineProperty2["default"])(
|
|
813
|
+
(0, _defineProperty2["default"])(_this, "getRowPropsForDrag", function () {
|
|
813
814
|
return function (record, index) {
|
|
814
815
|
return {
|
|
815
816
|
index: index,
|
|
@@ -817,7 +818,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
817
818
|
};
|
|
818
819
|
};
|
|
819
820
|
});
|
|
820
|
-
(0, _defineProperty2["default"])(
|
|
821
|
+
(0, _defineProperty2["default"])(_this, "getRowProps", function (onRowClick) {
|
|
821
822
|
return function (record) {
|
|
822
823
|
return {
|
|
823
824
|
onClick: function onClick() {
|
|
@@ -829,8 +830,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
829
830
|
};
|
|
830
831
|
};
|
|
831
832
|
});
|
|
832
|
-
(0, _defineProperty2["default"])(
|
|
833
|
-
var
|
|
833
|
+
(0, _defineProperty2["default"])(_this, "getProps", function () {
|
|
834
|
+
var _context14;
|
|
834
835
|
var _this$props4 = _this.props,
|
|
835
836
|
cols = _this$props4.cols,
|
|
836
837
|
items = _this$props4.items,
|
|
@@ -848,11 +849,11 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
848
849
|
expandedRowRender = _this$props4$expanded === void 0 ? undefined : _this$props4$expanded,
|
|
849
850
|
_this$props4$onExpand = _this$props4.onExpand,
|
|
850
851
|
onExpand = _this$props4$onExpand === void 0 ? undefined : _this$props4$onExpand;
|
|
851
|
-
var widthX = (0, _reduce["default"])(
|
|
852
|
+
var widthX = (0, _reduce["default"])(_context14 = (0, _filter["default"])(cols).call(cols, function (col) {
|
|
852
853
|
return !col.hide;
|
|
853
|
-
})).call(
|
|
854
|
-
var
|
|
855
|
-
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;
|
|
856
857
|
}, 0);
|
|
857
858
|
var scrollProps = !_helper["default"].isEmpty2(expandedRowRender) ? {
|
|
858
859
|
expandedRowRender: expandedRowRender
|
|
@@ -890,9 +891,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
890
891
|
onExpand: onExpand
|
|
891
892
|
}, scrollProps);
|
|
892
893
|
});
|
|
893
|
-
(0, _defineProperty2["default"])(
|
|
894
|
+
(0, _defineProperty2["default"])(_this, "setScroll", function () {
|
|
894
895
|
if (_this.props.maxHeight && _this.props.items.length) {
|
|
895
|
-
var root = _reactDom["default"].findDOMNode(
|
|
896
|
+
var root = _reactDom["default"].findDOMNode(_this);
|
|
896
897
|
var container = root.getElementsByClassName('ant-table-body')[0];
|
|
897
898
|
var header = root.getElementsByClassName('ant-table-thead')[0];
|
|
898
899
|
(0, _fixed["default"])(container, header, _this.props.maxHeight);
|
|
@@ -900,7 +901,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
900
901
|
});
|
|
901
902
|
return _this;
|
|
902
903
|
}
|
|
903
|
-
(0,
|
|
904
|
+
(0, _inherits2["default"])(SuperTable2, _React$Component);
|
|
905
|
+
return (0, _createClass2["default"])(SuperTable2, [{
|
|
904
906
|
key: "componentDidMount",
|
|
905
907
|
value: function componentDidMount() {
|
|
906
908
|
this.setScroll();
|
|
@@ -919,7 +921,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
919
921
|
}));
|
|
920
922
|
}
|
|
921
923
|
}]);
|
|
922
|
-
return SuperTable2;
|
|
923
924
|
}(_react["default"].Component);
|
|
924
925
|
(0, _defineProperty2["default"])(SuperTable2, "propTypes", {
|
|
925
926
|
cols: _propTypes["default"].arrayOf(_propTypes["default"].shape(ColType)).isRequired,
|