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