cloud-b2b 1.1.62 → 1.1.64
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 -101
- package/es/SuperPagination/SuperPagination.js +8 -11
- package/es/SuperTab/SuperTab.js +12 -15
- package/es/SuperTab2/SuperTab2.js +13 -16
- package/es/SuperTable/DragSortRow.js +12 -15
- package/es/SuperTable/FilterDropDown.js +11 -14
- package/es/SuperTable/SuperTable.js +68 -71
- package/es/SuperTable2/SuperTable2.js +85 -88
- package/es/SuperTable2/SuperTableCell.js +27 -30
- package/es/SuperTable3/FilterDropDown.js +11 -14
- package/es/SuperTable3/SuperTable.js +58 -61
- package/es/SuperToolbar/SuperToolbar.js +11 -14
- package/es/SuperUpload/SuperUpload.js +107 -91
- package/es/Viewer/ImageViews.js +16 -19
- package/es/Viewer/Viewer.js +11 -14
- package/es/helper.js +18 -17
- package/lib/Area/Area.js +8 -11
- package/lib/CodeInput/CodeInput.js +16 -19
- package/lib/Enhance/Dialogs.js +11 -14
- package/lib/Enhance/Loading.js +15 -18
- package/lib/Header/Header.js +17 -20
- package/lib/Header/Vertical.js +11 -14
- package/lib/ImageView/ImageView.js +10 -13
- package/lib/InpurCascader/InputCascader.js +11 -14
- package/lib/InputEditor/InputEditor.js +16 -18
- package/lib/InputSearch/InputSearch.js +19 -22
- package/lib/InputSelect/InputSelect.js +14 -17
- package/lib/InputTreeSelect/InputTreeSelect.js +10 -13
- package/lib/InputWriting/InputWriting.js +12 -15
- package/lib/Layout/Layout.js +14 -17
- package/lib/LayoutLink/LayoutLink.js +1 -2
- package/lib/Link/Link.js +7 -10
- package/lib/NumberInput/NumberInput.js +13 -16
- package/lib/Search/Search.js +53 -57
- package/lib/Search2/Search.js +86 -90
- package/lib/Search2/Search.less +64 -64
- package/lib/Search2/package.json +6 -6
- package/lib/Sidebar/Sidebar.js +11 -14
- package/lib/Sidebar2/Sidebar.js +13 -16
- package/lib/SuperForm/SuperForm.js +75 -81
- package/lib/SuperForm2/SuperForm.js +96 -103
- package/lib/SuperPagination/SuperPagination.js +8 -11
- package/lib/SuperTab/SuperTab.js +12 -15
- package/lib/SuperTab2/SuperTab2.js +13 -16
- package/lib/SuperTable/DragSortRow.js +12 -15
- package/lib/SuperTable/FilterDropDown.js +11 -14
- package/lib/SuperTable/SuperTable.js +68 -71
- package/lib/SuperTable2/SuperTable2.js +86 -90
- package/lib/SuperTable2/SuperTableCell.js +27 -30
- package/lib/SuperTable3/FilterDropDown.js +11 -14
- package/lib/SuperTable3/SuperTable.js +58 -61
- package/lib/SuperToolbar/SuperToolbar.js +11 -14
- package/lib/SuperUpload/SuperUpload.js +96 -81
- package/lib/Viewer/ImageViews.js +16 -19
- package/lib/Viewer/Viewer.js +11 -14
- package/lib/helper.js +18 -17
- package/package.json +1 -1
|
@@ -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,12 +416,12 @@ 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;
|
|
429
426
|
if (realType === 'customType') {
|
|
430
427
|
var _this$props$items$rec = _this.props.items[record.key].__customType,
|
|
@@ -549,7 +546,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
549
546
|
case 'uploadImg':
|
|
550
547
|
var commonProps = _this.props.callback.buildSuperUploadProps ? _this.props.callback.buildSuperUploadProps() : {};
|
|
551
548
|
var uploadProps = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
552
|
-
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,
|
|
553
550
|
type: col.type
|
|
554
551
|
}, col.props), _this.props), commonProps), {}, {
|
|
555
552
|
value: _this.props.items[index][col.key]
|
|
@@ -566,7 +563,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
566
563
|
}
|
|
567
564
|
};
|
|
568
565
|
});
|
|
569
|
-
_defineProperty(
|
|
566
|
+
_defineProperty(_this, "getCheckedStatus", function (key) {
|
|
570
567
|
var has = false,
|
|
571
568
|
not = false;
|
|
572
569
|
var items = _this.props.items;
|
|
@@ -587,7 +584,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
587
584
|
indeterminate: has && not
|
|
588
585
|
};
|
|
589
586
|
});
|
|
590
|
-
_defineProperty(
|
|
587
|
+
_defineProperty(_this, "toAdd", function (key, showAdd) {
|
|
591
588
|
if (showAdd) {
|
|
592
589
|
var onClick = _this.onAdd(key);
|
|
593
590
|
return /*#__PURE__*/React.createElement(_Icon, {
|
|
@@ -599,12 +596,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
599
596
|
return null;
|
|
600
597
|
}
|
|
601
598
|
});
|
|
602
|
-
_defineProperty(
|
|
603
|
-
var required =
|
|
604
|
-
title =
|
|
605
|
-
type =
|
|
606
|
-
key =
|
|
607
|
-
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;
|
|
608
605
|
if (type === 'checkbox') {
|
|
609
606
|
var status = _this.getCheckedStatus(key);
|
|
610
607
|
return /*#__PURE__*/React.createElement(_Checkbox, _extends({
|
|
@@ -617,31 +614,31 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
617
614
|
}, title, _this.toAdd(key, showAdd));
|
|
618
615
|
}
|
|
619
616
|
});
|
|
620
|
-
_defineProperty(
|
|
621
|
-
var type =
|
|
622
|
-
align =
|
|
617
|
+
_defineProperty(_this, "getColumnClassName", function (_ref15) {
|
|
618
|
+
var type = _ref15.type,
|
|
619
|
+
align = _ref15.align;
|
|
623
620
|
if (type === 'index' || type === 'checkbox') {
|
|
624
621
|
return 'ant-table-selection-column';
|
|
625
622
|
} else {
|
|
626
623
|
return align ? variables('SuperTable2')[align] : '';
|
|
627
624
|
}
|
|
628
625
|
});
|
|
629
|
-
_defineProperty(
|
|
630
|
-
var
|
|
631
|
-
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);
|
|
632
629
|
});
|
|
633
|
-
_defineProperty(
|
|
634
|
-
var
|
|
630
|
+
_defineProperty(_this, "getColumns", function (cols) {
|
|
631
|
+
var _context10;
|
|
635
632
|
var readonly = _this.props.readonly;
|
|
636
|
-
return _mapInstanceProperty(
|
|
633
|
+
return _mapInstanceProperty(_context10 = _filterInstanceProperty(cols).call(cols, function (col) {
|
|
637
634
|
return !col.hide;
|
|
638
|
-
})).call(
|
|
639
|
-
var
|
|
640
|
-
var col = _extends({}, (_objectDestructuringEmpty(
|
|
635
|
+
})).call(_context10, function (_ref16, index) {
|
|
636
|
+
var _context11;
|
|
637
|
+
var col = _extends({}, (_objectDestructuringEmpty(_ref16), _ref16));
|
|
641
638
|
col.className = _this.getColumnClassName(col);
|
|
642
639
|
col.title = _this.getColumnTitle(col);
|
|
643
640
|
col.dataIndex = col.key;
|
|
644
|
-
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;
|
|
645
642
|
// const {props = {}} =
|
|
646
643
|
// const {edit = false} = props
|
|
647
644
|
// if (!(readonly || col.type === 'readonly') || !this.canReadonly(col.type)) {
|
|
@@ -667,7 +664,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
667
664
|
return col;
|
|
668
665
|
});
|
|
669
666
|
});
|
|
670
|
-
_defineProperty(
|
|
667
|
+
_defineProperty(_this, "getText", function (value, options) {
|
|
671
668
|
if (_Array$isArray(value)) {
|
|
672
669
|
return _mapInstanceProperty(value).call(value, function (v) {
|
|
673
670
|
return getTitle(v, options);
|
|
@@ -676,14 +673,14 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
676
673
|
return getTitle(value, options);
|
|
677
674
|
}
|
|
678
675
|
});
|
|
679
|
-
_defineProperty(
|
|
676
|
+
_defineProperty(_this, "getDataSource", function (items, cols) {
|
|
680
677
|
return _mapInstanceProperty(items).call(items, function (item, index) {
|
|
681
|
-
return _reduceInstanceProperty(cols).call(cols, function (result,
|
|
682
|
-
var
|
|
683
|
-
var key =
|
|
684
|
-
type =
|
|
685
|
-
options =
|
|
686
|
-
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)) {
|
|
687
684
|
result[key] = item[key];
|
|
688
685
|
} else {
|
|
689
686
|
result[key] = _this.getText(item[key], options);
|
|
@@ -695,7 +692,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
695
692
|
}));
|
|
696
693
|
});
|
|
697
694
|
});
|
|
698
|
-
_defineProperty(
|
|
695
|
+
_defineProperty(_this, "getPropsByCheckbox", function () {
|
|
699
696
|
var _this$props2 = _this.props,
|
|
700
697
|
items = _this$props2.items,
|
|
701
698
|
_this$props2$isEmphas = _this$props2.isEmphasized,
|
|
@@ -710,13 +707,13 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
710
707
|
rowClassName: rowClassName
|
|
711
708
|
};
|
|
712
709
|
});
|
|
713
|
-
_defineProperty(
|
|
710
|
+
_defineProperty(_this, "getSelectedRowKeys", function (items) {
|
|
714
711
|
return _reduceInstanceProperty(items).call(items, function (result, item, index) {
|
|
715
712
|
item.checked && result.push(index);
|
|
716
713
|
return result;
|
|
717
714
|
}, []);
|
|
718
715
|
});
|
|
719
|
-
_defineProperty(
|
|
716
|
+
_defineProperty(_this, "getPropsByCheckbox2", function (items) {
|
|
720
717
|
var _this$props3 = _this.props,
|
|
721
718
|
_this$props3$checkbox = _this$props3.checkbox,
|
|
722
719
|
checkbox = _this$props3$checkbox === void 0 ? true : _this$props3$checkbox,
|
|
@@ -801,7 +798,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
801
798
|
};
|
|
802
799
|
}
|
|
803
800
|
});
|
|
804
|
-
_defineProperty(
|
|
801
|
+
_defineProperty(_this, "getRowPropsForDrag", function () {
|
|
805
802
|
return function (record, index) {
|
|
806
803
|
return {
|
|
807
804
|
index: index,
|
|
@@ -809,7 +806,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
809
806
|
};
|
|
810
807
|
};
|
|
811
808
|
});
|
|
812
|
-
_defineProperty(
|
|
809
|
+
_defineProperty(_this, "getRowProps", function (onRowClick) {
|
|
813
810
|
return function (record) {
|
|
814
811
|
return {
|
|
815
812
|
onClick: function onClick() {
|
|
@@ -821,8 +818,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
821
818
|
};
|
|
822
819
|
};
|
|
823
820
|
});
|
|
824
|
-
_defineProperty(
|
|
825
|
-
var
|
|
821
|
+
_defineProperty(_this, "getProps", function () {
|
|
822
|
+
var _context14;
|
|
826
823
|
var _this$props4 = _this.props,
|
|
827
824
|
cols = _this$props4.cols,
|
|
828
825
|
items = _this$props4.items,
|
|
@@ -840,11 +837,11 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
840
837
|
expandedRowRender = _this$props4$expanded === void 0 ? undefined : _this$props4$expanded,
|
|
841
838
|
_this$props4$onExpand = _this$props4.onExpand,
|
|
842
839
|
onExpand = _this$props4$onExpand === void 0 ? undefined : _this$props4$onExpand;
|
|
843
|
-
var widthX = _reduceInstanceProperty(
|
|
840
|
+
var widthX = _reduceInstanceProperty(_context14 = _filterInstanceProperty(cols).call(cols, function (col) {
|
|
844
841
|
return !col.hide;
|
|
845
|
-
})).call(
|
|
846
|
-
var
|
|
847
|
-
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;
|
|
848
845
|
}, 0);
|
|
849
846
|
var scrollProps = !helper.isEmpty2(expandedRowRender) ? {
|
|
850
847
|
expandedRowRender: expandedRowRender
|
|
@@ -882,9 +879,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
882
879
|
onExpand: onExpand
|
|
883
880
|
}, scrollProps);
|
|
884
881
|
});
|
|
885
|
-
_defineProperty(
|
|
882
|
+
_defineProperty(_this, "setScroll", function () {
|
|
886
883
|
if (_this.props.maxHeight && _this.props.items.length) {
|
|
887
|
-
var root = ReactDOM.findDOMNode(
|
|
884
|
+
var root = ReactDOM.findDOMNode(_this);
|
|
888
885
|
var container = root.getElementsByClassName('ant-table-body')[0];
|
|
889
886
|
var header = root.getElementsByClassName('ant-table-thead')[0];
|
|
890
887
|
fixed(container, header, _this.props.maxHeight);
|
|
@@ -892,7 +889,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
892
889
|
});
|
|
893
890
|
return _this;
|
|
894
891
|
}
|
|
895
|
-
|
|
892
|
+
_inherits(SuperTable2, _React$Component);
|
|
893
|
+
return _createClass(SuperTable2, [{
|
|
896
894
|
key: "componentDidMount",
|
|
897
895
|
value: function componentDidMount() {
|
|
898
896
|
this.setScroll();
|
|
@@ -911,7 +909,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
911
909
|
}));
|
|
912
910
|
}
|
|
913
911
|
}]);
|
|
914
|
-
return SuperTable2;
|
|
915
912
|
}(React.Component);
|
|
916
913
|
_defineProperty(SuperTable2, "propTypes", {
|
|
917
914
|
cols: PropTypes.arrayOf(PropTypes.shape(ColType)).isRequired,
|