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