cloud-b2b 1.1.63 → 1.1.65
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 +11 -8
- 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 +22 -19
- 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 +110 -109
- 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 +100 -96
- 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 +71 -68
- package/es/SuperTable2/SuperTable2.js +88 -85
- 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 +14 -11
- package/es/SuperUpload/SuperUpload.js +74 -74
- 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 +11 -8
- 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 +22 -19
- 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 +112 -110
- 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 +102 -97
- 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 +71 -68
- package/lib/SuperTable2/SuperTable2.js +90 -86
- 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 +14 -11
- package/lib/SuperUpload/SuperUpload.js +76 -75
- 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
|
@@ -40,9 +40,10 @@ 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"));
|
|
43
45
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
44
46
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
45
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
46
47
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
47
48
|
var _radio = _interopRequireDefault(require("antd/lib/radio"));
|
|
48
49
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -56,14 +57,15 @@ var _variables = _interopRequireDefault(require("../variables"));
|
|
|
56
57
|
var _helper = _interopRequireWildcard(require("../helper"));
|
|
57
58
|
var _DragSortRow = _interopRequireDefault(require("../SuperTable/DragSortRow"));
|
|
58
59
|
var _excluded = ["onRowClick"];
|
|
59
|
-
function
|
|
60
|
-
function
|
|
61
|
-
function
|
|
62
|
-
function
|
|
60
|
+
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); }
|
|
61
|
+
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; }
|
|
62
|
+
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; } } }; }
|
|
63
|
+
function _unsupportedIterableToArray(o, minLen) { var _context20; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_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); }
|
|
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; }
|
|
63
65
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty2(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
64
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
65
|
-
function
|
|
66
|
-
function _isNativeReflectConstruct() {
|
|
66
|
+
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; }
|
|
67
|
+
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); }; }
|
|
68
|
+
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; } }
|
|
67
69
|
var RadioGroup = _radio["default"].Group;
|
|
68
70
|
var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select',
|
|
69
71
|
//存储value
|
|
@@ -137,6 +139,8 @@ var CallbackType = {
|
|
|
137
139
|
* isEmphasized: [可选],是否强调,行字体加粗显示, 除了isEmphasized设置为true之外,加粗行数据里要设置__isEmphasized为true
|
|
138
140
|
*/
|
|
139
141
|
var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
142
|
+
(0, _inherits2["default"])(SuperTable2, _React$Component);
|
|
143
|
+
var _super = _createSuper(SuperTable2);
|
|
140
144
|
function SuperTable2() {
|
|
141
145
|
var _context;
|
|
142
146
|
var _this;
|
|
@@ -144,22 +148,22 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
144
148
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
145
149
|
args[_key] = arguments[_key];
|
|
146
150
|
}
|
|
147
|
-
_this =
|
|
148
|
-
(0, _defineProperty2["default"])(_this, "onSwitch", function (key, rowIndex) {
|
|
151
|
+
_this = _super.call.apply(_super, (0, _concat["default"])(_context = [this]).call(_context, args));
|
|
152
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSwitch", function (key, rowIndex) {
|
|
149
153
|
return function (value) {
|
|
150
154
|
var _ref = _this.props.callback || {},
|
|
151
155
|
onContentChange = _ref.onContentChange;
|
|
152
156
|
onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
|
|
153
157
|
};
|
|
154
158
|
});
|
|
155
|
-
(0, _defineProperty2["default"])(_this, "onCheck", function (key, rowIndex) {
|
|
159
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onCheck", function (key, rowIndex) {
|
|
156
160
|
return function (e) {
|
|
157
161
|
var _ref2 = _this.props.callback || {},
|
|
158
162
|
onCheck = _ref2.onCheck;
|
|
159
163
|
onCheck && onCheck(_this.getIndex(rowIndex), key, e.target.checked);
|
|
160
164
|
};
|
|
161
165
|
});
|
|
162
|
-
(0, _defineProperty2["default"])(_this, "onChange", function (key, rowIndex) {
|
|
166
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (key, rowIndex) {
|
|
163
167
|
return function (value) {
|
|
164
168
|
var _ref3 = _this.props.callback || {},
|
|
165
169
|
onContentChange = _ref3.onContentChange;
|
|
@@ -167,7 +171,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
167
171
|
onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
|
|
168
172
|
};
|
|
169
173
|
});
|
|
170
|
-
(0, _defineProperty2["default"])(_this, "onDoubleChange1", function (key, rowIndex) {
|
|
174
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDoubleChange1", function (key, rowIndex) {
|
|
171
175
|
return function (doublekey, value) {
|
|
172
176
|
var _ref4 = _this.props.callback || {},
|
|
173
177
|
onContentChange = _ref4.onContentChange;
|
|
@@ -175,28 +179,28 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
175
179
|
onContentChange && onContentChange(_this.getIndex(rowIndex), doublekey, value);
|
|
176
180
|
};
|
|
177
181
|
});
|
|
178
|
-
(0, _defineProperty2["default"])(_this, "onSearch", function (key, rowIndex, config) {
|
|
182
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSearch", function (key, rowIndex, config) {
|
|
179
183
|
return function (value) {
|
|
180
184
|
var _ref5 = _this.props.callback || {},
|
|
181
185
|
onSearch = _ref5.onSearch;
|
|
182
186
|
onSearch && onSearch(_this.getIndex(rowIndex), key, value, config);
|
|
183
187
|
};
|
|
184
188
|
});
|
|
185
|
-
(0, _defineProperty2["default"])(_this, "onAdd", function (key) {
|
|
189
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onAdd", function (key) {
|
|
186
190
|
return function () {
|
|
187
191
|
var _ref6 = _this.props.callback || {},
|
|
188
192
|
onAdd = _ref6.onAdd;
|
|
189
193
|
onAdd && onAdd(key);
|
|
190
194
|
};
|
|
191
195
|
});
|
|
192
|
-
(0, _defineProperty2["default"])(_this, "onRowAdd", function (key, index) {
|
|
196
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRowAdd", function (key, index) {
|
|
193
197
|
return function () {
|
|
194
198
|
var _ref7 = _this.props.callback || {},
|
|
195
199
|
onLink = _ref7.onLink;
|
|
196
200
|
onLink && onLink(key, index, _this.props.items[index]);
|
|
197
201
|
};
|
|
198
202
|
});
|
|
199
|
-
(0, _defineProperty2["default"])(_this, "onBlur", function (key, rowIndex) {
|
|
203
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onBlur", function (key, rowIndex) {
|
|
200
204
|
return function (value) {
|
|
201
205
|
var _ref8 = _this.props.callback || {},
|
|
202
206
|
onBlur = _ref8.onBlur;
|
|
@@ -204,33 +208,33 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
204
208
|
onBlur && onBlur(_this.getIndex(rowIndex), key, value);
|
|
205
209
|
};
|
|
206
210
|
});
|
|
207
|
-
(0, _defineProperty2["default"])(_this, "onDoubleClick", function (key, value) {
|
|
211
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDoubleClick", function (key, value) {
|
|
208
212
|
return function () {
|
|
209
213
|
var _ref9 = _this.props.callback || {},
|
|
210
214
|
onDoubleClick = _ref9.onDoubleClick;
|
|
211
215
|
onDoubleClick && onDoubleClick(key, value);
|
|
212
216
|
};
|
|
213
217
|
});
|
|
214
|
-
(0, _defineProperty2["default"])(_this, "onImgTileClick", function (col, value, rowIndex) {
|
|
218
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onImgTileClick", function (col, value, rowIndex) {
|
|
215
219
|
return function () {
|
|
216
|
-
var
|
|
217
|
-
onImgTileClick =
|
|
220
|
+
var _ref10 = _this.props.callback || {},
|
|
221
|
+
onImgTileClick = _ref10.onImgTileClick;
|
|
218
222
|
onImgTileClick && onImgTileClick(col, value, rowIndex);
|
|
219
223
|
};
|
|
220
224
|
});
|
|
221
|
-
(0, _defineProperty2["default"])(_this, "onMoveRow", function (dragIndex, targetIndex) {
|
|
222
|
-
var
|
|
223
|
-
onMoveRow =
|
|
225
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onMoveRow", function (dragIndex, targetIndex) {
|
|
226
|
+
var _ref11 = _this.props.callback || {},
|
|
227
|
+
onMoveRow = _ref11.onMoveRow;
|
|
224
228
|
onMoveRow && onMoveRow(dragIndex, targetIndex);
|
|
225
229
|
});
|
|
226
|
-
(0, _defineProperty2["default"])(_this, "closeValid", function () {
|
|
230
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "closeValid", function () {
|
|
227
231
|
var _this$props = _this.props,
|
|
228
232
|
valid = _this$props.valid,
|
|
229
233
|
_this$props$callback = _this$props.callback,
|
|
230
234
|
callback = _this$props$callback === void 0 ? {} : _this$props$callback;
|
|
231
235
|
valid && callback.onExitValid();
|
|
232
236
|
});
|
|
233
|
-
(0, _defineProperty2["default"])(_this, "getOptions", function (key, colOptions, index) {
|
|
237
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getOptions", function (key, colOptions, index) {
|
|
234
238
|
var options = _this.props.items[index].options;
|
|
235
239
|
var options2 = _this.props.options;
|
|
236
240
|
if (options && (0, _isArray["default"])(options[key])) {
|
|
@@ -241,7 +245,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
241
245
|
return colOptions;
|
|
242
246
|
}
|
|
243
247
|
});
|
|
244
|
-
(0, _defineProperty2["default"])(_this, "validField", function (required, value) {
|
|
248
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "validField", function (required, value) {
|
|
245
249
|
if (!_this.props.valid || _this.error || !required || value) {
|
|
246
250
|
return false;
|
|
247
251
|
} else if (typeof value === 'number') {
|
|
@@ -251,15 +255,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
251
255
|
return true;
|
|
252
256
|
}
|
|
253
257
|
});
|
|
254
|
-
(0, _defineProperty2["default"])(_this, "toRadio", function (
|
|
255
|
-
var value =
|
|
256
|
-
title =
|
|
258
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toRadio", function (_ref12, index) {
|
|
259
|
+
var value = _ref12.value,
|
|
260
|
+
title = _ref12.title;
|
|
257
261
|
return /*#__PURE__*/_react["default"].createElement(_radio["default"], {
|
|
258
262
|
key: index,
|
|
259
263
|
value: String(value)
|
|
260
264
|
}, title);
|
|
261
265
|
});
|
|
262
|
-
(0, _defineProperty2["default"])(_this, "renderRadioGroup", function (config, value, index) {
|
|
266
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderRadioGroup", function (config, value, index) {
|
|
263
267
|
var key = config.key,
|
|
264
268
|
options = config.options;
|
|
265
269
|
var radioGroupProps = {
|
|
@@ -270,7 +274,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
270
274
|
};
|
|
271
275
|
return /*#__PURE__*/_react["default"].createElement(RadioGroup, radioGroupProps, (0, _map["default"])(options).call(options, _this.toRadio));
|
|
272
276
|
});
|
|
273
|
-
(0, _defineProperty2["default"])(_this, "renderEditableCell", function (config, value, index) {
|
|
277
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderEditableCell", function (config, value, index) {
|
|
274
278
|
var key = config.key,
|
|
275
279
|
type = config.type,
|
|
276
280
|
options = config.options,
|
|
@@ -362,7 +366,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
362
366
|
}
|
|
363
367
|
return /*#__PURE__*/_react["default"].createElement(_SuperTableCell["default"], cellProps);
|
|
364
368
|
});
|
|
365
|
-
(0, _defineProperty2["default"])(_this, "renderDoubleEditableCell", function (config, value, index) {
|
|
369
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderDoubleEditableCell", function (config, value, index) {
|
|
366
370
|
var key = config.key,
|
|
367
371
|
type = config.type,
|
|
368
372
|
options = config.options,
|
|
@@ -392,7 +396,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
392
396
|
};
|
|
393
397
|
return /*#__PURE__*/_react["default"].createElement(_SuperTableCell["default"], cellProps);
|
|
394
398
|
});
|
|
395
|
-
(0, _defineProperty2["default"])(_this, "renderLinkCell", function (col, value, record, index) {
|
|
399
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderLinkCell", function (col, value, record, index) {
|
|
396
400
|
if (col.link === 'list') {
|
|
397
401
|
var list = value && (0, _isArray["default"])(value) ? value : [];
|
|
398
402
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -403,8 +407,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
403
407
|
var _context2;
|
|
404
408
|
var split = index2 === list.length - 1 ? '' : ',';
|
|
405
409
|
var onClick = function onClick() {
|
|
406
|
-
var
|
|
407
|
-
onLink =
|
|
410
|
+
var _ref13 = _this.props.callback || {},
|
|
411
|
+
onLink = _ref13.onLink;
|
|
408
412
|
onLink && onLink(col.key, index, item2);
|
|
409
413
|
};
|
|
410
414
|
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
@@ -415,8 +419,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
415
419
|
} else {
|
|
416
420
|
var title = typeof col.link === 'string' ? col.link : value;
|
|
417
421
|
var onClick = function onClick() {
|
|
418
|
-
var
|
|
419
|
-
onLink =
|
|
422
|
+
var _ref14 = _this.props.callback || {},
|
|
423
|
+
onLink = _ref14.onLink;
|
|
420
424
|
onLink && onLink(col.key, index, record);
|
|
421
425
|
};
|
|
422
426
|
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
@@ -428,12 +432,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
428
432
|
}, title);
|
|
429
433
|
}
|
|
430
434
|
});
|
|
431
|
-
(0, _defineProperty2["default"])(_this, "getIndex", function (index) {
|
|
435
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getIndex", function (index) {
|
|
432
436
|
return (_this.props.base || 0) + index;
|
|
433
437
|
});
|
|
434
|
-
(0, _defineProperty2["default"])(_this, "getCellRender", function (col) {
|
|
438
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getCellRender", function (col) {
|
|
435
439
|
return function (value, record, index) {
|
|
436
|
-
var _context3, _context4, _context5, _context6, _context7, _context8, _context9,
|
|
440
|
+
var _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10;
|
|
437
441
|
var realType = record._isEdit === true && _this.canReadonly(col.type) ? col.editType : col.type;
|
|
438
442
|
if (realType === 'customType') {
|
|
439
443
|
var _this$props$items$rec = _this.props.items[record.key].__customType,
|
|
@@ -558,7 +562,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
558
562
|
case 'uploadImg':
|
|
559
563
|
var commonProps = _this.props.callback.buildSuperUploadProps ? _this.props.callback.buildSuperUploadProps() : {};
|
|
560
564
|
var uploadProps = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
561
|
-
onFileChange: _this.props.callback.onTableFileChange ? (0, _bind["default"])(
|
|
565
|
+
onFileChange: _this.props.callback.onTableFileChange ? (0, _bind["default"])(_context10 = _this.props.callback.onTableFileChange).call(_context10, null, col.key, index) : undefined,
|
|
562
566
|
type: col.type
|
|
563
567
|
}, col.props), _this.props), commonProps), {}, {
|
|
564
568
|
value: _this.props.items[index][col.key]
|
|
@@ -575,7 +579,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
575
579
|
}
|
|
576
580
|
};
|
|
577
581
|
});
|
|
578
|
-
(0, _defineProperty2["default"])(_this, "getCheckedStatus", function (key) {
|
|
582
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getCheckedStatus", function (key) {
|
|
579
583
|
var has = false,
|
|
580
584
|
not = false;
|
|
581
585
|
var items = _this.props.items;
|
|
@@ -596,7 +600,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
596
600
|
indeterminate: has && not
|
|
597
601
|
};
|
|
598
602
|
});
|
|
599
|
-
(0, _defineProperty2["default"])(_this, "toAdd", function (key, showAdd) {
|
|
603
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toAdd", function (key, showAdd) {
|
|
600
604
|
if (showAdd) {
|
|
601
605
|
var onClick = _this.onAdd(key);
|
|
602
606
|
return /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
@@ -608,12 +612,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
608
612
|
return null;
|
|
609
613
|
}
|
|
610
614
|
});
|
|
611
|
-
(0, _defineProperty2["default"])(_this, "getColumnTitle", function (
|
|
612
|
-
var required =
|
|
613
|
-
title =
|
|
614
|
-
type =
|
|
615
|
-
key =
|
|
616
|
-
showAdd =
|
|
615
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnTitle", function (_ref16) {
|
|
616
|
+
var required = _ref16.required,
|
|
617
|
+
title = _ref16.title,
|
|
618
|
+
type = _ref16.type,
|
|
619
|
+
key = _ref16.key,
|
|
620
|
+
showAdd = _ref16.showAdd;
|
|
617
621
|
if (type === 'checkbox') {
|
|
618
622
|
var status = _this.getCheckedStatus(key);
|
|
619
623
|
return /*#__PURE__*/_react["default"].createElement(_checkbox["default"], (0, _extends2["default"])({
|
|
@@ -626,31 +630,31 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
626
630
|
}, title, _this.toAdd(key, showAdd));
|
|
627
631
|
}
|
|
628
632
|
});
|
|
629
|
-
(0, _defineProperty2["default"])(_this, "getColumnClassName", function (
|
|
630
|
-
var type =
|
|
631
|
-
align =
|
|
633
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnClassName", function (_ref17) {
|
|
634
|
+
var type = _ref17.type,
|
|
635
|
+
align = _ref17.align;
|
|
632
636
|
if (type === 'index' || type === 'checkbox') {
|
|
633
637
|
return 'ant-table-selection-column';
|
|
634
638
|
} else {
|
|
635
639
|
return align ? (0, _variables["default"])('SuperTable2')[align] : '';
|
|
636
640
|
}
|
|
637
641
|
});
|
|
638
|
-
(0, _defineProperty2["default"])(_this, "canReadonly", function (type) {
|
|
639
|
-
var
|
|
640
|
-
return !(0, _includes["default"])(
|
|
642
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "canReadonly", function (type) {
|
|
643
|
+
var _context11;
|
|
644
|
+
return !(0, _includes["default"])(_context11 = ['index', 'checkbox', 'link', 'button', 'switch', 'custom', 'img', 'toolbar', 'uploadImg', 'double']).call(_context11, type);
|
|
641
645
|
});
|
|
642
|
-
(0, _defineProperty2["default"])(_this, "getColumns", function (cols) {
|
|
643
|
-
var
|
|
646
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumns", function (cols) {
|
|
647
|
+
var _context12;
|
|
644
648
|
var readonly = _this.props.readonly;
|
|
645
|
-
return (0, _map["default"])(
|
|
649
|
+
return (0, _map["default"])(_context12 = (0, _filter["default"])(cols).call(cols, function (col) {
|
|
646
650
|
return !col.hide;
|
|
647
|
-
})).call(
|
|
648
|
-
var
|
|
649
|
-
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(
|
|
651
|
+
})).call(_context12, function (_ref18, index) {
|
|
652
|
+
var _context13;
|
|
653
|
+
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref18), _ref18));
|
|
650
654
|
col.className = _this.getColumnClassName(col);
|
|
651
655
|
col.title = _this.getColumnTitle(col);
|
|
652
656
|
col.dataIndex = col.key;
|
|
653
|
-
col.width = col.width ? col.width : (0, _includes["default"])(
|
|
657
|
+
col.width = col.width ? col.width : (0, _includes["default"])(_context13 = ['index', 'checked']).call(_context13, col.key) ? 70 : col.type === 'img' ? 200 : 120;
|
|
654
658
|
// const {props = {}} =
|
|
655
659
|
// const {edit = false} = props
|
|
656
660
|
// if (!(readonly || col.type === 'readonly') || !this.canReadonly(col.type)) {
|
|
@@ -676,7 +680,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
676
680
|
return col;
|
|
677
681
|
});
|
|
678
682
|
});
|
|
679
|
-
(0, _defineProperty2["default"])(_this, "getText", function (value, options) {
|
|
683
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getText", function (value, options) {
|
|
680
684
|
if ((0, _isArray["default"])(value)) {
|
|
681
685
|
return (0, _map["default"])(value).call(value, function (v) {
|
|
682
686
|
return (0, _Control.getTitle)(v, options);
|
|
@@ -685,14 +689,14 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
685
689
|
return (0, _Control.getTitle)(value, options);
|
|
686
690
|
}
|
|
687
691
|
});
|
|
688
|
-
(0, _defineProperty2["default"])(_this, "getDataSource", function (items, cols) {
|
|
692
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getDataSource", function (items, cols) {
|
|
689
693
|
return (0, _map["default"])(items).call(items, function (item, index) {
|
|
690
|
-
return (0, _reduce["default"])(cols).call(cols, function (result,
|
|
691
|
-
var
|
|
692
|
-
var key =
|
|
693
|
-
type =
|
|
694
|
-
options =
|
|
695
|
-
if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || (0, _isArray["default"])(item.isReadonly) && !(0, _includes["default"])(
|
|
694
|
+
return (0, _reduce["default"])(cols).call(cols, function (result, _ref19) {
|
|
695
|
+
var _context14, _context15;
|
|
696
|
+
var key = _ref19.key,
|
|
697
|
+
type = _ref19.type,
|
|
698
|
+
options = _ref19.options;
|
|
699
|
+
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)) {
|
|
696
700
|
result[key] = item[key];
|
|
697
701
|
} else {
|
|
698
702
|
result[key] = _this.getText(item[key], options);
|
|
@@ -704,7 +708,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
704
708
|
}));
|
|
705
709
|
});
|
|
706
710
|
});
|
|
707
|
-
(0, _defineProperty2["default"])(_this, "getPropsByCheckbox", function () {
|
|
711
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPropsByCheckbox", function () {
|
|
708
712
|
var _this$props2 = _this.props,
|
|
709
713
|
items = _this$props2.items,
|
|
710
714
|
_this$props2$isEmphas = _this$props2.isEmphasized,
|
|
@@ -719,13 +723,13 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
719
723
|
rowClassName: rowClassName
|
|
720
724
|
};
|
|
721
725
|
});
|
|
722
|
-
(0, _defineProperty2["default"])(_this, "getSelectedRowKeys", function (items) {
|
|
726
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getSelectedRowKeys", function (items) {
|
|
723
727
|
return (0, _reduce["default"])(items).call(items, function (result, item, index) {
|
|
724
728
|
item.checked && result.push(index);
|
|
725
729
|
return result;
|
|
726
730
|
}, []);
|
|
727
731
|
});
|
|
728
|
-
(0, _defineProperty2["default"])(_this, "getPropsByCheckbox2", function (items) {
|
|
732
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPropsByCheckbox2", function (items) {
|
|
729
733
|
var _this$props3 = _this.props,
|
|
730
734
|
_this$props3$checkbox = _this$props3.checkbox,
|
|
731
735
|
checkbox = _this$props3$checkbox === void 0 ? true : _this$props3$checkbox,
|
|
@@ -810,7 +814,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
810
814
|
};
|
|
811
815
|
}
|
|
812
816
|
});
|
|
813
|
-
(0, _defineProperty2["default"])(_this, "getRowPropsForDrag", function () {
|
|
817
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getRowPropsForDrag", function () {
|
|
814
818
|
return function (record, index) {
|
|
815
819
|
return {
|
|
816
820
|
index: index,
|
|
@@ -818,7 +822,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
818
822
|
};
|
|
819
823
|
};
|
|
820
824
|
});
|
|
821
|
-
(0, _defineProperty2["default"])(_this, "getRowProps", function (onRowClick) {
|
|
825
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getRowProps", function (onRowClick) {
|
|
822
826
|
return function (record) {
|
|
823
827
|
return {
|
|
824
828
|
onClick: function onClick() {
|
|
@@ -830,8 +834,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
830
834
|
};
|
|
831
835
|
};
|
|
832
836
|
});
|
|
833
|
-
(0, _defineProperty2["default"])(_this, "getProps", function () {
|
|
834
|
-
var
|
|
837
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getProps", function () {
|
|
838
|
+
var _context16;
|
|
835
839
|
var _this$props4 = _this.props,
|
|
836
840
|
cols = _this$props4.cols,
|
|
837
841
|
items = _this$props4.items,
|
|
@@ -849,11 +853,11 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
849
853
|
expandedRowRender = _this$props4$expanded === void 0 ? undefined : _this$props4$expanded,
|
|
850
854
|
_this$props4$onExpand = _this$props4.onExpand,
|
|
851
855
|
onExpand = _this$props4$onExpand === void 0 ? undefined : _this$props4$onExpand;
|
|
852
|
-
var widthX = (0, _reduce["default"])(
|
|
856
|
+
var widthX = (0, _reduce["default"])(_context16 = (0, _filter["default"])(cols).call(cols, function (col) {
|
|
853
857
|
return !col.hide;
|
|
854
|
-
})).call(
|
|
855
|
-
var
|
|
856
|
-
return width += item.width ? item.width : (0, _includes["default"])(
|
|
858
|
+
})).call(_context16, function (width, item) {
|
|
859
|
+
var _context17;
|
|
860
|
+
return width += item.width ? item.width : (0, _includes["default"])(_context17 = ['index', 'checked']).call(_context17, item.key) ? 70 : item.type === 'img' ? 200 : 120;
|
|
857
861
|
}, 0);
|
|
858
862
|
var scrollProps = !_helper["default"].isEmpty2(expandedRowRender) ? {
|
|
859
863
|
expandedRowRender: expandedRowRender
|
|
@@ -891,9 +895,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
891
895
|
onExpand: onExpand
|
|
892
896
|
}, scrollProps);
|
|
893
897
|
});
|
|
894
|
-
(0, _defineProperty2["default"])(_this, "setScroll", function () {
|
|
898
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setScroll", function () {
|
|
895
899
|
if (_this.props.maxHeight && _this.props.items.length) {
|
|
896
|
-
var root = _reactDom["default"].findDOMNode(_this);
|
|
900
|
+
var root = _reactDom["default"].findDOMNode((0, _assertThisInitialized2["default"])(_this));
|
|
897
901
|
var container = root.getElementsByClassName('ant-table-body')[0];
|
|
898
902
|
var header = root.getElementsByClassName('ant-table-thead')[0];
|
|
899
903
|
(0, _fixed["default"])(container, header, _this.props.maxHeight);
|
|
@@ -901,8 +905,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
901
905
|
});
|
|
902
906
|
return _this;
|
|
903
907
|
}
|
|
904
|
-
(0,
|
|
905
|
-
return (0, _createClass2["default"])(SuperTable2, [{
|
|
908
|
+
(0, _createClass2["default"])(SuperTable2, [{
|
|
906
909
|
key: "componentDidMount",
|
|
907
910
|
value: function componentDidMount() {
|
|
908
911
|
this.setScroll();
|
|
@@ -921,6 +924,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
921
924
|
}));
|
|
922
925
|
}
|
|
923
926
|
}]);
|
|
927
|
+
return SuperTable2;
|
|
924
928
|
}(_react["default"].Component);
|
|
925
929
|
(0, _defineProperty2["default"])(SuperTable2, "propTypes", {
|
|
926
930
|
cols: _propTypes["default"].arrayOf(_propTypes["default"].shape(ColType)).isRequired,
|