cloud-b2b 1.1.70 → 1.1.72
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 +23 -23
- 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 +83 -86
- 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 +99 -103
- 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 +70 -73
- package/es/SuperTable2/SuperTable2.js +89 -92
- 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 +74 -74
- 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 +23 -23
- 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 +84 -88
- 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 +100 -105
- 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 +70 -73
- package/lib/SuperTable2/SuperTable2.js +90 -94
- 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 +75 -76
- 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";
|
|
@@ -42,8 +41,8 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instan
|
|
|
42
41
|
import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
|
|
43
42
|
import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
|
|
44
43
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
45
|
-
function
|
|
46
|
-
function _isNativeReflectConstruct() {
|
|
44
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
45
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
47
46
|
import React from 'react';
|
|
48
47
|
import PropTypes from 'prop-types';
|
|
49
48
|
import ReactDOM from 'react-dom';
|
|
@@ -127,8 +126,6 @@ var CallbackType = {
|
|
|
127
126
|
* isEmphasized: [可选],是否强调,行字体加粗显示, 除了isEmphasized设置为true之外,加粗行数据里要设置__isEmphasized为true
|
|
128
127
|
*/
|
|
129
128
|
var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
130
|
-
_inherits(SuperTable2, _React$Component);
|
|
131
|
-
var _super = _createSuper(SuperTable2);
|
|
132
129
|
function SuperTable2() {
|
|
133
130
|
var _context;
|
|
134
131
|
var _this;
|
|
@@ -136,22 +133,22 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
136
133
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
137
134
|
args[_key] = arguments[_key];
|
|
138
135
|
}
|
|
139
|
-
_this =
|
|
140
|
-
_defineProperty(
|
|
136
|
+
_this = _callSuper(this, SuperTable2, _concatInstanceProperty(_context = []).call(_context, args));
|
|
137
|
+
_defineProperty(_this, "onSwitch", function (key, rowIndex) {
|
|
141
138
|
return function (value) {
|
|
142
139
|
var _ref = _this.props.callback || {},
|
|
143
140
|
onContentChange = _ref.onContentChange;
|
|
144
141
|
onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
|
|
145
142
|
};
|
|
146
143
|
});
|
|
147
|
-
_defineProperty(
|
|
144
|
+
_defineProperty(_this, "onCheck", function (key, rowIndex) {
|
|
148
145
|
return function (e) {
|
|
149
146
|
var _ref2 = _this.props.callback || {},
|
|
150
147
|
onCheck = _ref2.onCheck;
|
|
151
148
|
onCheck && onCheck(_this.getIndex(rowIndex), key, e.target.checked);
|
|
152
149
|
};
|
|
153
150
|
});
|
|
154
|
-
_defineProperty(
|
|
151
|
+
_defineProperty(_this, "onChange", function (key, rowIndex) {
|
|
155
152
|
return function (value) {
|
|
156
153
|
var _ref3 = _this.props.callback || {},
|
|
157
154
|
onContentChange = _ref3.onContentChange;
|
|
@@ -159,7 +156,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
159
156
|
onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
|
|
160
157
|
};
|
|
161
158
|
});
|
|
162
|
-
_defineProperty(
|
|
159
|
+
_defineProperty(_this, "onDoubleChange1", function (key, rowIndex) {
|
|
163
160
|
return function (doublekey, value) {
|
|
164
161
|
var _ref4 = _this.props.callback || {},
|
|
165
162
|
onContentChange = _ref4.onContentChange;
|
|
@@ -167,28 +164,28 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
167
164
|
onContentChange && onContentChange(_this.getIndex(rowIndex), doublekey, value);
|
|
168
165
|
};
|
|
169
166
|
});
|
|
170
|
-
_defineProperty(
|
|
167
|
+
_defineProperty(_this, "onSearch", function (key, rowIndex, config) {
|
|
171
168
|
return function (value) {
|
|
172
169
|
var _ref5 = _this.props.callback || {},
|
|
173
170
|
onSearch = _ref5.onSearch;
|
|
174
171
|
onSearch && onSearch(_this.getIndex(rowIndex), key, value, config);
|
|
175
172
|
};
|
|
176
173
|
});
|
|
177
|
-
_defineProperty(
|
|
174
|
+
_defineProperty(_this, "onAdd", function (key) {
|
|
178
175
|
return function () {
|
|
179
176
|
var _ref6 = _this.props.callback || {},
|
|
180
177
|
onAdd = _ref6.onAdd;
|
|
181
178
|
onAdd && onAdd(key);
|
|
182
179
|
};
|
|
183
180
|
});
|
|
184
|
-
_defineProperty(
|
|
181
|
+
_defineProperty(_this, "onRowAdd", function (key, index) {
|
|
185
182
|
return function () {
|
|
186
183
|
var _ref7 = _this.props.callback || {},
|
|
187
184
|
onLink = _ref7.onLink;
|
|
188
185
|
onLink && onLink(key, index, _this.props.items[index]);
|
|
189
186
|
};
|
|
190
187
|
});
|
|
191
|
-
_defineProperty(
|
|
188
|
+
_defineProperty(_this, "onBlur", function (key, rowIndex) {
|
|
192
189
|
return function (value) {
|
|
193
190
|
var _ref8 = _this.props.callback || {},
|
|
194
191
|
onBlur = _ref8.onBlur;
|
|
@@ -196,33 +193,33 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
196
193
|
onBlur && onBlur(_this.getIndex(rowIndex), key, value);
|
|
197
194
|
};
|
|
198
195
|
});
|
|
199
|
-
_defineProperty(
|
|
196
|
+
_defineProperty(_this, "onDoubleClick", function (key, value) {
|
|
200
197
|
return function () {
|
|
201
198
|
var _ref9 = _this.props.callback || {},
|
|
202
199
|
onDoubleClick = _ref9.onDoubleClick;
|
|
203
200
|
onDoubleClick && onDoubleClick(key, value);
|
|
204
201
|
};
|
|
205
202
|
});
|
|
206
|
-
_defineProperty(
|
|
203
|
+
_defineProperty(_this, "onImgTileClick", function (col, value, rowIndex) {
|
|
207
204
|
return function () {
|
|
208
|
-
var
|
|
209
|
-
onImgTileClick =
|
|
205
|
+
var _ref0 = _this.props.callback || {},
|
|
206
|
+
onImgTileClick = _ref0.onImgTileClick;
|
|
210
207
|
onImgTileClick && onImgTileClick(col, value, rowIndex);
|
|
211
208
|
};
|
|
212
209
|
});
|
|
213
|
-
_defineProperty(
|
|
214
|
-
var
|
|
215
|
-
onMoveRow =
|
|
210
|
+
_defineProperty(_this, "onMoveRow", function (dragIndex, targetIndex) {
|
|
211
|
+
var _ref1 = _this.props.callback || {},
|
|
212
|
+
onMoveRow = _ref1.onMoveRow;
|
|
216
213
|
onMoveRow && onMoveRow(dragIndex, targetIndex);
|
|
217
214
|
});
|
|
218
|
-
_defineProperty(
|
|
215
|
+
_defineProperty(_this, "closeValid", function () {
|
|
219
216
|
var _this$props = _this.props,
|
|
220
217
|
valid = _this$props.valid,
|
|
221
218
|
_this$props$callback = _this$props.callback,
|
|
222
219
|
callback = _this$props$callback === void 0 ? {} : _this$props$callback;
|
|
223
220
|
valid && callback.onExitValid();
|
|
224
221
|
});
|
|
225
|
-
_defineProperty(
|
|
222
|
+
_defineProperty(_this, "getOptions", function (key, colOptions, index) {
|
|
226
223
|
var options = _this.props.items[index].options;
|
|
227
224
|
var options2 = _this.props.options;
|
|
228
225
|
if (options && _Array$isArray(options[key])) {
|
|
@@ -233,7 +230,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
233
230
|
return colOptions;
|
|
234
231
|
}
|
|
235
232
|
});
|
|
236
|
-
_defineProperty(
|
|
233
|
+
_defineProperty(_this, "validField", function (required, value) {
|
|
237
234
|
if (!_this.props.valid || _this.error || !required || value) {
|
|
238
235
|
return false;
|
|
239
236
|
} else if (typeof value === 'number') {
|
|
@@ -243,15 +240,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
243
240
|
return true;
|
|
244
241
|
}
|
|
245
242
|
});
|
|
246
|
-
_defineProperty(
|
|
247
|
-
var value =
|
|
248
|
-
title =
|
|
243
|
+
_defineProperty(_this, "toRadio", function (_ref10, index) {
|
|
244
|
+
var value = _ref10.value,
|
|
245
|
+
title = _ref10.title;
|
|
249
246
|
return /*#__PURE__*/React.createElement(_Radio, {
|
|
250
247
|
key: index,
|
|
251
248
|
value: String(value)
|
|
252
249
|
}, title);
|
|
253
250
|
});
|
|
254
|
-
_defineProperty(
|
|
251
|
+
_defineProperty(_this, "renderRadioGroup", function (config, value, index) {
|
|
255
252
|
var key = config.key,
|
|
256
253
|
options = config.options;
|
|
257
254
|
var radioGroupProps = {
|
|
@@ -262,7 +259,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
262
259
|
};
|
|
263
260
|
return /*#__PURE__*/React.createElement(RadioGroup, radioGroupProps, _mapInstanceProperty(options).call(options, _this.toRadio));
|
|
264
261
|
});
|
|
265
|
-
_defineProperty(
|
|
262
|
+
_defineProperty(_this, "renderEditableCell", function (config, value, index) {
|
|
266
263
|
var key = config.key,
|
|
267
264
|
type = config.type,
|
|
268
265
|
options = config.options,
|
|
@@ -354,7 +351,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
354
351
|
}
|
|
355
352
|
return /*#__PURE__*/React.createElement(SuperTableCell, cellProps);
|
|
356
353
|
});
|
|
357
|
-
_defineProperty(
|
|
354
|
+
_defineProperty(_this, "renderDoubleEditableCell", function (config, value, index) {
|
|
358
355
|
var key = config.key,
|
|
359
356
|
type = config.type,
|
|
360
357
|
options = config.options,
|
|
@@ -384,7 +381,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
384
381
|
};
|
|
385
382
|
return /*#__PURE__*/React.createElement(SuperTableCell, cellProps);
|
|
386
383
|
});
|
|
387
|
-
_defineProperty(
|
|
384
|
+
_defineProperty(_this, "renderLinkCell", function (col, value, record, index) {
|
|
388
385
|
if (col.link === 'list') {
|
|
389
386
|
var list = value && _Array$isArray(value) ? value : [];
|
|
390
387
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -395,8 +392,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
395
392
|
var _context2;
|
|
396
393
|
var split = index2 === list.length - 1 ? '' : ',';
|
|
397
394
|
var onClick = function onClick() {
|
|
398
|
-
var
|
|
399
|
-
onLink =
|
|
395
|
+
var _ref11 = _this.props.callback || {},
|
|
396
|
+
onLink = _ref11.onLink;
|
|
400
397
|
onLink && onLink(col.key, index, item2);
|
|
401
398
|
};
|
|
402
399
|
return /*#__PURE__*/React.createElement("a", {
|
|
@@ -407,8 +404,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
407
404
|
} else {
|
|
408
405
|
var title = typeof col.link === 'string' ? col.link : value;
|
|
409
406
|
var onClick = function onClick() {
|
|
410
|
-
var
|
|
411
|
-
onLink =
|
|
407
|
+
var _ref12 = _this.props.callback || {},
|
|
408
|
+
onLink = _ref12.onLink;
|
|
412
409
|
onLink && onLink(col.key, index, record);
|
|
413
410
|
};
|
|
414
411
|
return /*#__PURE__*/React.createElement("a", {
|
|
@@ -420,12 +417,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
420
417
|
}, title);
|
|
421
418
|
}
|
|
422
419
|
});
|
|
423
|
-
_defineProperty(
|
|
420
|
+
_defineProperty(_this, "getIndex", function (index) {
|
|
424
421
|
return (_this.props.base || 0) + index;
|
|
425
422
|
});
|
|
426
|
-
_defineProperty(
|
|
423
|
+
_defineProperty(_this, "getCellRender", function (col) {
|
|
427
424
|
return function (value, record, index) {
|
|
428
|
-
var _context3, _context4, _context5, _context6, _context7, _context8, _context9,
|
|
425
|
+
var _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context0;
|
|
429
426
|
var realType = record._isEdit === true && _this.canReadonly(col.type) ? col.editType : col.type;
|
|
430
427
|
if (realType === 'customType') {
|
|
431
428
|
var _this$props$items$rec = _this.props.items[record.key].__customType,
|
|
@@ -550,7 +547,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
550
547
|
case 'uploadImg':
|
|
551
548
|
var commonProps = _this.props.callback.buildSuperUploadProps ? _this.props.callback.buildSuperUploadProps() : {};
|
|
552
549
|
var uploadProps = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
553
|
-
onFileChange: _this.props.callback.onTableFileChange ? _bindInstanceProperty(
|
|
550
|
+
onFileChange: _this.props.callback.onTableFileChange ? _bindInstanceProperty(_context0 = _this.props.callback.onTableFileChange).call(_context0, null, col.key, index) : undefined,
|
|
554
551
|
type: col.type
|
|
555
552
|
}, col.props), _this.props), commonProps), {}, {
|
|
556
553
|
value: _this.props.items[index][col.key]
|
|
@@ -567,7 +564,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
567
564
|
}
|
|
568
565
|
};
|
|
569
566
|
});
|
|
570
|
-
_defineProperty(
|
|
567
|
+
_defineProperty(_this, "getCheckedStatus", function (key) {
|
|
571
568
|
var has = false,
|
|
572
569
|
not = false;
|
|
573
570
|
var items = _this.props.items;
|
|
@@ -588,7 +585,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
588
585
|
indeterminate: has && not
|
|
589
586
|
};
|
|
590
587
|
});
|
|
591
|
-
_defineProperty(
|
|
588
|
+
_defineProperty(_this, "toAdd", function (key, showAdd) {
|
|
592
589
|
if (showAdd) {
|
|
593
590
|
var onClick = _this.onAdd(key);
|
|
594
591
|
return /*#__PURE__*/React.createElement(_Icon, {
|
|
@@ -600,12 +597,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
600
597
|
return null;
|
|
601
598
|
}
|
|
602
599
|
});
|
|
603
|
-
_defineProperty(
|
|
604
|
-
var required =
|
|
605
|
-
title =
|
|
606
|
-
type =
|
|
607
|
-
key =
|
|
608
|
-
showAdd =
|
|
600
|
+
_defineProperty(_this, "getColumnTitle", function (_ref14) {
|
|
601
|
+
var required = _ref14.required,
|
|
602
|
+
title = _ref14.title,
|
|
603
|
+
type = _ref14.type,
|
|
604
|
+
key = _ref14.key,
|
|
605
|
+
showAdd = _ref14.showAdd;
|
|
609
606
|
if (type === 'checkbox') {
|
|
610
607
|
var status = _this.getCheckedStatus(key);
|
|
611
608
|
return /*#__PURE__*/React.createElement(_Checkbox, _extends({
|
|
@@ -618,23 +615,23 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
618
615
|
}, title, _this.toAdd(key, showAdd));
|
|
619
616
|
}
|
|
620
617
|
});
|
|
621
|
-
_defineProperty(
|
|
622
|
-
var type =
|
|
623
|
-
align =
|
|
618
|
+
_defineProperty(_this, "getColumnClassName", function (_ref15) {
|
|
619
|
+
var type = _ref15.type,
|
|
620
|
+
align = _ref15.align;
|
|
624
621
|
if (type === 'index' || type === 'checkbox') {
|
|
625
622
|
return 'ant-table-selection-column';
|
|
626
623
|
} else {
|
|
627
624
|
return align ? variables('SuperTable2')[align] : '';
|
|
628
625
|
}
|
|
629
626
|
});
|
|
630
|
-
_defineProperty(
|
|
631
|
-
var
|
|
632
|
-
return !_includesInstanceProperty(
|
|
627
|
+
_defineProperty(_this, "canReadonly", function (type) {
|
|
628
|
+
var _context1;
|
|
629
|
+
return !_includesInstanceProperty(_context1 = ['index', 'checkbox', 'link', 'button', 'switch', 'custom', 'img', 'toolbar', 'uploadImg', 'double']).call(_context1, type);
|
|
633
630
|
});
|
|
634
|
-
_defineProperty(
|
|
635
|
-
var tipLen =
|
|
636
|
-
options =
|
|
637
|
-
width =
|
|
631
|
+
_defineProperty(_this, "tooltip", function (key, index, item, _ref16) {
|
|
632
|
+
var tipLen = _ref16.tooltip,
|
|
633
|
+
options = _ref16.options,
|
|
634
|
+
width = _ref16.width;
|
|
638
635
|
var text = _this.getText(item[key], options);
|
|
639
636
|
var needTip = tipLen > 1 && text && typeof text === 'string' && text.length > tipLen;
|
|
640
637
|
return needTip ? /*#__PURE__*/React.createElement(_Tooltip, {
|
|
@@ -667,18 +664,18 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
667
664
|
title: true
|
|
668
665
|
}, _Array$isArray(text) ? text.join(',') : text, " ");
|
|
669
666
|
});
|
|
670
|
-
_defineProperty(
|
|
671
|
-
var
|
|
667
|
+
_defineProperty(_this, "getColumns", function (cols, items) {
|
|
668
|
+
var _context10;
|
|
672
669
|
var readonly = _this.props.readonly;
|
|
673
|
-
return _mapInstanceProperty(
|
|
670
|
+
return _mapInstanceProperty(_context10 = _filterInstanceProperty(cols).call(cols, function (col) {
|
|
674
671
|
return !col.hide;
|
|
675
|
-
})).call(
|
|
676
|
-
var
|
|
677
|
-
var col = _extends({}, (_objectDestructuringEmpty(
|
|
672
|
+
})).call(_context10, function (_ref17, index) {
|
|
673
|
+
var _context11;
|
|
674
|
+
var col = _extends({}, (_objectDestructuringEmpty(_ref17), _ref17));
|
|
678
675
|
col.className = _this.getColumnClassName(col);
|
|
679
676
|
col.title = _this.getColumnTitle(col);
|
|
680
677
|
col.dataIndex = col.key;
|
|
681
|
-
!_this.props.autoAdjustingWidth && (col.width = col.width ? col.width : _includesInstanceProperty(
|
|
678
|
+
!_this.props.autoAdjustingWidth && (col.width = col.width ? col.width : _includesInstanceProperty(_context11 = ['index', 'checked']).call(_context11, col.key) ? 70 : col.type === 'img' ? 200 : 120);
|
|
682
679
|
// col.width = col.width ? col.width : (['index','checked'].includes(col.key) ? 70 : (col.type === 'img' ? 200 : 120));
|
|
683
680
|
|
|
684
681
|
// const {props = {}} =
|
|
@@ -710,7 +707,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
710
707
|
return col;
|
|
711
708
|
});
|
|
712
709
|
});
|
|
713
|
-
_defineProperty(
|
|
710
|
+
_defineProperty(_this, "getText", function (value, options) {
|
|
714
711
|
if (_Array$isArray(value)) {
|
|
715
712
|
return _mapInstanceProperty(value).call(value, function (v) {
|
|
716
713
|
return getTitle(v, options);
|
|
@@ -719,14 +716,14 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
719
716
|
return getTitle(value, options);
|
|
720
717
|
}
|
|
721
718
|
});
|
|
722
|
-
_defineProperty(
|
|
719
|
+
_defineProperty(_this, "getDataSource", function (items, cols) {
|
|
723
720
|
return _mapInstanceProperty(items).call(items, function (item, index) {
|
|
724
|
-
return _reduceInstanceProperty(cols).call(cols, function (result,
|
|
725
|
-
var
|
|
726
|
-
var key =
|
|
727
|
-
type =
|
|
728
|
-
options =
|
|
729
|
-
if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || _Array$isArray(item.isReadonly) && !_includesInstanceProperty(
|
|
721
|
+
return _reduceInstanceProperty(cols).call(cols, function (result, _ref18) {
|
|
722
|
+
var _context12, _context13;
|
|
723
|
+
var key = _ref18.key,
|
|
724
|
+
type = _ref18.type,
|
|
725
|
+
options = _ref18.options;
|
|
726
|
+
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)) {
|
|
730
727
|
result[key] = item[key];
|
|
731
728
|
} else {
|
|
732
729
|
result[key] = _this.getText(item[key], options);
|
|
@@ -738,7 +735,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
738
735
|
}));
|
|
739
736
|
});
|
|
740
737
|
});
|
|
741
|
-
_defineProperty(
|
|
738
|
+
_defineProperty(_this, "getPropsByCheckbox", function () {
|
|
742
739
|
var _this$props2 = _this.props,
|
|
743
740
|
items = _this$props2.items,
|
|
744
741
|
_this$props2$isEmphas = _this$props2.isEmphasized,
|
|
@@ -753,13 +750,13 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
753
750
|
rowClassName: rowClassName
|
|
754
751
|
};
|
|
755
752
|
});
|
|
756
|
-
_defineProperty(
|
|
753
|
+
_defineProperty(_this, "getSelectedRowKeys", function (items) {
|
|
757
754
|
return _reduceInstanceProperty(items).call(items, function (result, item, index) {
|
|
758
755
|
item.checked && result.push(index);
|
|
759
756
|
return result;
|
|
760
757
|
}, []);
|
|
761
758
|
});
|
|
762
|
-
_defineProperty(
|
|
759
|
+
_defineProperty(_this, "getPropsByCheckbox2", function (items) {
|
|
763
760
|
var _this$props3 = _this.props,
|
|
764
761
|
_this$props3$checkbox = _this$props3.checkbox,
|
|
765
762
|
checkbox = _this$props3$checkbox === void 0 ? true : _this$props3$checkbox,
|
|
@@ -844,7 +841,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
844
841
|
};
|
|
845
842
|
}
|
|
846
843
|
});
|
|
847
|
-
_defineProperty(
|
|
844
|
+
_defineProperty(_this, "getRowPropsForDrag", function () {
|
|
848
845
|
return function (record, index) {
|
|
849
846
|
return {
|
|
850
847
|
index: index,
|
|
@@ -852,7 +849,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
852
849
|
};
|
|
853
850
|
};
|
|
854
851
|
});
|
|
855
|
-
_defineProperty(
|
|
852
|
+
_defineProperty(_this, "getRowProps", function (onRowClick) {
|
|
856
853
|
return function (record) {
|
|
857
854
|
return {
|
|
858
855
|
onClick: function onClick() {
|
|
@@ -864,8 +861,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
864
861
|
};
|
|
865
862
|
};
|
|
866
863
|
});
|
|
867
|
-
_defineProperty(
|
|
868
|
-
var
|
|
864
|
+
_defineProperty(_this, "getProps", function () {
|
|
865
|
+
var _context14;
|
|
869
866
|
var _this$props4 = _this.props,
|
|
870
867
|
cols = _this$props4.cols,
|
|
871
868
|
items = _this$props4.items,
|
|
@@ -887,11 +884,11 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
887
884
|
expandedRowRenderKeepScroll = _this$props4$expanded2 === void 0 ? false : _this$props4$expanded2,
|
|
888
885
|
_this$props4$autoAdju = _this$props4.autoAdjustingWidth,
|
|
889
886
|
autoAdjustingWidth = _this$props4$autoAdju === void 0 ? false : _this$props4$autoAdju;
|
|
890
|
-
var widthX = _reduceInstanceProperty(
|
|
887
|
+
var widthX = _reduceInstanceProperty(_context14 = _filterInstanceProperty(cols).call(cols, function (col) {
|
|
891
888
|
return !col.hide;
|
|
892
|
-
})).call(
|
|
893
|
-
var
|
|
894
|
-
return width += item.width ? item.width : _includesInstanceProperty(
|
|
889
|
+
})).call(_context14, function (width, item) {
|
|
890
|
+
var _context15;
|
|
891
|
+
return width += item.width ? item.width : _includesInstanceProperty(_context15 = ['index', 'checked']).call(_context15, item.key) ? 70 : item.type === 'img' ? 200 : 120;
|
|
895
892
|
}, 0);
|
|
896
893
|
var scrollProps = {};
|
|
897
894
|
if (expandedRowRenderKeepScroll) {
|
|
@@ -947,9 +944,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
947
944
|
});
|
|
948
945
|
return props;
|
|
949
946
|
});
|
|
950
|
-
_defineProperty(
|
|
947
|
+
_defineProperty(_this, "setScroll", function () {
|
|
951
948
|
if (_this.props.maxHeight && _this.props.items.length) {
|
|
952
|
-
var root = ReactDOM.findDOMNode(
|
|
949
|
+
var root = ReactDOM.findDOMNode(_this);
|
|
953
950
|
var container = root.getElementsByClassName('ant-table-body')[0];
|
|
954
951
|
var header = root.getElementsByClassName('ant-table-thead')[0];
|
|
955
952
|
fixed(container, header, _this.props.maxHeight);
|
|
@@ -957,7 +954,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
957
954
|
});
|
|
958
955
|
return _this;
|
|
959
956
|
}
|
|
960
|
-
|
|
957
|
+
_inherits(SuperTable2, _React$Component);
|
|
958
|
+
return _createClass(SuperTable2, [{
|
|
961
959
|
key: "componentDidMount",
|
|
962
960
|
value: function componentDidMount() {
|
|
963
961
|
this.setScroll();
|
|
@@ -976,7 +974,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
976
974
|
}));
|
|
977
975
|
}
|
|
978
976
|
}]);
|
|
979
|
-
return SuperTable2;
|
|
980
977
|
}(React.Component);
|
|
981
978
|
_defineProperty(SuperTable2, "propTypes", {
|
|
982
979
|
cols: PropTypes.arrayOf(PropTypes.shape(ColType)).isRequired,
|