cloud-b2b 1.1.27 → 1.1.29
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 +16 -45
- package/es/Card/Card.js +3 -4
- package/es/CodeInput/CodeInput.js +30 -59
- package/es/Control/Control.js +47 -94
- package/es/Control/event.js +0 -14
- package/es/Enhance/Dialogs.js +0 -15
- package/es/Enhance/Loading.js +16 -36
- package/es/Enhance/index.js +0 -2
- package/es/Header/Header.js +3 -35
- package/es/Header/Vertical.js +1 -24
- package/es/ImageView/ImageView.js +5 -22
- package/es/Indent/Indent.js +3 -7
- package/es/InpurCascader/InputCascader.js +10 -36
- package/es/InputEditor/InputEditor.js +55 -55
- package/es/InputSearch/InputSearch.js +26 -71
- package/es/InputSelect/InputSelect.js +17 -48
- package/es/InputWriting/InputWriting.js +6 -28
- package/es/Layout/Layout.js +28 -59
- package/es/LayoutLink/LayoutLink.js +11 -20
- package/es/Link/Link.js +4 -27
- package/es/Loading/Loading.js +1 -3
- package/es/Loading2/Loading2.js +0 -2
- package/es/ModalWithDrag/ModalWithDrag.js +3 -8
- package/es/ModalWithDrag/drag.js +12 -29
- package/es/NumberInput/NumberInput.js +24 -63
- package/es/Search/Search.js +53 -149
- package/es/Sidebar/Sidebar.js +13 -34
- package/es/Sidebar2/Sidebar.js +3 -30
- package/es/SuperForm/SuperForm.js +27 -150
- package/es/SuperForm2/SuperForm.js +31 -165
- package/es/SuperIcon/SuperIcon.js +3 -6
- package/es/SuperPagination/SuperPagination.js +15 -32
- package/es/SuperTab/SuperTab.js +4 -27
- package/es/SuperTab2/SuperTab2.js +11 -33
- package/es/SuperTable/DragSortRow.js +6 -34
- package/es/SuperTable/FilterDropDown.js +10 -34
- package/es/SuperTable/SuperTable.js +91 -216
- package/es/SuperTable/fixed.js +1 -9
- package/es/SuperTable2/SuperTable2.js +96 -206
- package/es/SuperTable2/SuperTableCell.js +16 -55
- package/es/SuperTable3/FilterDropDown.js +10 -34
- package/es/SuperTable3/SuperTable.js +57 -175
- package/es/SuperTable3/fixed.js +1 -9
- package/es/SuperToolbar/SuperToolbar.js +21 -49
- package/es/SuperUpload/SuperUpload.js +73 -110
- package/es/Title/Title.js +12 -15
- package/es/Viewer/ImageViews.js +7 -60
- package/es/Viewer/Viewer.js +7 -34
- package/es/WingBlank/WingBlank.js +2 -6
- package/es/helper.js +7 -27
- package/es/history.js +3 -2
- package/lib/Area/Area.js +16 -64
- package/lib/Card/Card.js +3 -13
- package/lib/CodeInput/CodeInput.js +30 -77
- package/lib/Control/Control.js +47 -135
- package/lib/Control/event.js +0 -16
- package/lib/Enhance/Dialogs.js +0 -26
- package/lib/Enhance/Loading.js +16 -52
- package/lib/Enhance/index.js +0 -9
- package/lib/Header/Header.js +3 -48
- package/lib/Header/Vertical.js +1 -36
- package/lib/ImageView/ImageView.js +5 -30
- package/lib/Indent/Indent.js +3 -13
- package/lib/InpurCascader/InputCascader.js +11 -50
- package/lib/InputEditor/InputEditor.js +55 -64
- package/lib/InputSearch/InputSearch.js +26 -78
- package/lib/InputSelect/InputSelect.js +17 -62
- package/lib/InputWriting/InputWriting.js +6 -35
- package/lib/Layout/Layout.js +28 -76
- package/lib/LayoutLink/LayoutLink.js +11 -38
- package/lib/Link/Link.js +4 -40
- package/lib/Loading/Loading.js +1 -9
- package/lib/Loading2/Loading2.js +0 -8
- package/lib/ModalWithDrag/ModalWithDrag.js +3 -18
- package/lib/ModalWithDrag/drag.js +12 -34
- package/lib/NumberInput/NumberInput.js +24 -76
- package/lib/Search/Search.js +53 -157
- package/lib/Sidebar/Sidebar.js +13 -46
- package/lib/Sidebar2/Sidebar.js +3 -42
- package/lib/SuperForm/SuperForm.js +27 -149
- package/lib/SuperForm2/SuperForm.js +31 -160
- package/lib/SuperIcon/SuperIcon.js +3 -14
- package/lib/SuperPagination/SuperPagination.js +15 -42
- package/lib/SuperTab/SuperTab.js +4 -34
- package/lib/SuperTab2/SuperTab2.js +11 -48
- package/lib/SuperTable/DragSortRow.js +6 -42
- package/lib/SuperTable/FilterDropDown.js +10 -42
- package/lib/SuperTable/SuperTable.js +90 -210
- package/lib/SuperTable/fixed.js +1 -13
- package/lib/SuperTable2/SuperTable2.js +96 -222
- package/lib/SuperTable2/SuperTableCell.js +13 -62
- package/lib/SuperTable3/FilterDropDown.js +10 -42
- package/lib/SuperTable3/SuperTable.js +56 -169
- package/lib/SuperTable3/fixed.js +1 -13
- package/lib/SuperToolbar/SuperToolbar.js +20 -64
- package/lib/SuperUpload/SuperUpload.js +73 -140
- package/lib/Title/Title.js +12 -24
- package/lib/Viewer/ImageViews.js +7 -63
- package/lib/Viewer/Viewer.js +7 -43
- package/lib/WingBlank/WingBlank.js +2 -14
- package/lib/helper.js +6 -44
- package/lib/history.js +0 -5
- package/lib/index.js +0 -76
- package/lib/variables.js +0 -4
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
|
12
12
|
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
13
13
|
import _Table from "antd/es/table";
|
|
14
14
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWithoutProperties";
|
|
15
|
+
import _objectDestructuringEmpty from "@babel/runtime-corejs3/helpers/objectDestructuringEmpty";
|
|
15
16
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
16
17
|
import _Switch from "antd/es/switch";
|
|
17
18
|
import _Button from "antd/es/button";
|
|
@@ -25,17 +26,11 @@ import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleC
|
|
|
25
26
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
26
27
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
27
28
|
var _excluded = ["onRowClick"];
|
|
28
|
-
|
|
29
29
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (_Array$isArray(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; } } }; }
|
|
30
|
-
|
|
31
30
|
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); }
|
|
32
|
-
|
|
33
|
-
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; }
|
|
34
|
-
|
|
31
|
+
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; }
|
|
35
32
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
36
|
-
|
|
37
33
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context18, _context19; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context18 = ownKeys(Object(source), !0)).call(_context18, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context19 = ownKeys(Object(source))).call(_context19, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
38
|
-
|
|
39
34
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
40
35
|
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
|
41
36
|
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
@@ -45,11 +40,8 @@ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/insta
|
|
|
45
40
|
import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
|
|
46
41
|
import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
|
|
47
42
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
48
|
-
|
|
49
43
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
50
|
-
|
|
51
44
|
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; } }
|
|
52
|
-
|
|
53
45
|
import React from 'react';
|
|
54
46
|
import PropTypes from 'prop-types';
|
|
55
47
|
import ReactDOM from 'react-dom';
|
|
@@ -60,12 +52,18 @@ import SuperToolbar from '../SuperToolbar';
|
|
|
60
52
|
import variables from '../variables';
|
|
61
53
|
import helper, { getObjectExclude } from '../helper';
|
|
62
54
|
import DragSortRow from "../SuperTable/DragSortRow";
|
|
63
|
-
var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select',
|
|
64
|
-
|
|
65
|
-
'
|
|
66
|
-
|
|
67
|
-
'
|
|
55
|
+
var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select',
|
|
56
|
+
//存储value
|
|
57
|
+
'selectText',
|
|
58
|
+
//存储title
|
|
59
|
+
'search', 'searchText', 'selectSearch',
|
|
60
|
+
//多选下拉搜索
|
|
61
|
+
'date', 'button', 'custom', 'switch', 'textArea', 'link', 'toolbar',
|
|
62
|
+
//按钮组
|
|
63
|
+
'img',
|
|
64
|
+
//图片标题组 value为{src,title}时显示图片标题 为字符串时 只显示图片
|
|
68
65
|
'uploadImg'];
|
|
66
|
+
|
|
69
67
|
/**
|
|
70
68
|
* key:标识所在列,在一个表格中必须唯一
|
|
71
69
|
* title:列的标题,type为checkbox时,title为空字符串时,表头才会显示为复选框
|
|
@@ -78,7 +76,6 @@ var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select', //
|
|
|
78
76
|
* showAdd: 表头是否显示+号,默认为false,加号会触发onAdd事件
|
|
79
77
|
* hide: 为true时隐藏该列
|
|
80
78
|
*/
|
|
81
|
-
|
|
82
79
|
var ColType = {
|
|
83
80
|
key: PropTypes.string.isRequired,
|
|
84
81
|
title: PropTypes.string.isRequired,
|
|
@@ -91,6 +88,7 @@ var ColType = {
|
|
|
91
88
|
hide: PropTypes.bool,
|
|
92
89
|
props: PropTypes.any
|
|
93
90
|
};
|
|
91
|
+
|
|
94
92
|
/**
|
|
95
93
|
* onCheck:点击复选框时触发,原型func(rowIndex, keyName, checked)
|
|
96
94
|
* onContentChange: 输入框内容改变时触发,原型为function(rowIndex, keyName, value)
|
|
@@ -102,7 +100,6 @@ var ColType = {
|
|
|
102
100
|
* onToolbar:点击表格列按钮组时触发,原型为function(按钮组列的key,rowIndex,该行数据的值,按钮key);
|
|
103
101
|
* onDoubleClick: 双击单元格触发(只针对于type类型为空的情况下)
|
|
104
102
|
*/
|
|
105
|
-
|
|
106
103
|
var CallbackType = {
|
|
107
104
|
onExitValid: PropTypes.func,
|
|
108
105
|
onCheck: PropTypes.func,
|
|
@@ -121,133 +118,102 @@ var CallbackType = {
|
|
|
121
118
|
//点击img类型标题触发事件
|
|
122
119
|
onMoveRow: PropTypes.func
|
|
123
120
|
};
|
|
121
|
+
|
|
124
122
|
/**
|
|
125
123
|
* base[可选]:序号的开始数字,所有回调函数中的序号值都会加上这个值,默认值为0
|
|
126
124
|
* isEmphasized: [可选],是否强调,行字体加粗显示, 除了isEmphasized设置为true之外,加粗行数据里要设置__isEmphasized为true
|
|
127
125
|
*/
|
|
128
|
-
|
|
129
126
|
var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
130
127
|
_inherits(SuperTable2, _React$Component);
|
|
131
|
-
|
|
132
128
|
var _super = _createSuper(SuperTable2);
|
|
133
|
-
|
|
134
129
|
function SuperTable2() {
|
|
135
130
|
var _context;
|
|
136
|
-
|
|
137
131
|
var _this;
|
|
138
|
-
|
|
139
132
|
_classCallCheck(this, SuperTable2);
|
|
140
|
-
|
|
141
133
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
142
134
|
args[_key] = arguments[_key];
|
|
143
135
|
}
|
|
144
|
-
|
|
145
136
|
_this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
|
|
146
|
-
|
|
147
137
|
_defineProperty(_assertThisInitialized(_this), "onSwitch", function (key, rowIndex) {
|
|
148
138
|
return function (value) {
|
|
149
139
|
var _ref = _this.props.callback || {},
|
|
150
|
-
|
|
151
|
-
|
|
140
|
+
onContentChange = _ref.onContentChange;
|
|
152
141
|
onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
|
|
153
142
|
};
|
|
154
143
|
});
|
|
155
|
-
|
|
156
144
|
_defineProperty(_assertThisInitialized(_this), "onCheck", function (key, rowIndex) {
|
|
157
145
|
return function (e) {
|
|
158
146
|
var _ref2 = _this.props.callback || {},
|
|
159
|
-
|
|
160
|
-
|
|
147
|
+
onCheck = _ref2.onCheck;
|
|
161
148
|
onCheck && onCheck(_this.getIndex(rowIndex), key, e.target.checked);
|
|
162
149
|
};
|
|
163
150
|
});
|
|
164
|
-
|
|
165
151
|
_defineProperty(_assertThisInitialized(_this), "onChange", function (key, rowIndex) {
|
|
166
152
|
return function (value) {
|
|
167
153
|
var _ref3 = _this.props.callback || {},
|
|
168
|
-
|
|
169
|
-
|
|
154
|
+
onContentChange = _ref3.onContentChange;
|
|
170
155
|
_this.closeValid();
|
|
171
|
-
|
|
172
156
|
onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
|
|
173
157
|
};
|
|
174
158
|
});
|
|
175
|
-
|
|
176
159
|
_defineProperty(_assertThisInitialized(_this), "onSearch", function (key, rowIndex, config) {
|
|
177
160
|
return function (value) {
|
|
178
161
|
var _ref4 = _this.props.callback || {},
|
|
179
|
-
|
|
180
|
-
|
|
162
|
+
onSearch = _ref4.onSearch;
|
|
181
163
|
onSearch && onSearch(_this.getIndex(rowIndex), key, value, config);
|
|
182
164
|
};
|
|
183
165
|
});
|
|
184
|
-
|
|
185
166
|
_defineProperty(_assertThisInitialized(_this), "onAdd", function (key) {
|
|
186
167
|
return function () {
|
|
187
168
|
var _ref5 = _this.props.callback || {},
|
|
188
|
-
|
|
189
|
-
|
|
169
|
+
onAdd = _ref5.onAdd;
|
|
190
170
|
onAdd && onAdd(key);
|
|
191
171
|
};
|
|
192
172
|
});
|
|
193
|
-
|
|
194
173
|
_defineProperty(_assertThisInitialized(_this), "onRowAdd", function (key, index) {
|
|
195
174
|
return function () {
|
|
196
175
|
var _ref6 = _this.props.callback || {},
|
|
197
|
-
|
|
198
|
-
|
|
176
|
+
onLink = _ref6.onLink;
|
|
199
177
|
onLink && onLink(key, index, _this.props.items[index]);
|
|
200
178
|
};
|
|
201
179
|
});
|
|
202
|
-
|
|
203
180
|
_defineProperty(_assertThisInitialized(_this), "onBlur", function (key, rowIndex) {
|
|
204
181
|
return function (value) {
|
|
205
182
|
var _ref7 = _this.props.callback || {},
|
|
206
|
-
|
|
207
|
-
|
|
183
|
+
onBlur = _ref7.onBlur;
|
|
208
184
|
_this.closeValid();
|
|
209
|
-
|
|
210
185
|
onBlur && onBlur(_this.getIndex(rowIndex), key, value);
|
|
211
186
|
};
|
|
212
187
|
});
|
|
213
|
-
|
|
214
188
|
_defineProperty(_assertThisInitialized(_this), "onDoubleClick", function (key, value) {
|
|
215
189
|
return function () {
|
|
216
190
|
var _ref8 = _this.props.callback || {},
|
|
217
|
-
|
|
218
|
-
|
|
191
|
+
onDoubleClick = _ref8.onDoubleClick;
|
|
219
192
|
onDoubleClick && onDoubleClick(key, value);
|
|
220
193
|
};
|
|
221
194
|
});
|
|
222
|
-
|
|
223
195
|
_defineProperty(_assertThisInitialized(_this), "onImgTileClick", function (col, value, rowIndex) {
|
|
224
196
|
return function () {
|
|
225
197
|
var _ref9 = _this.props.callback || {},
|
|
226
|
-
|
|
227
|
-
|
|
198
|
+
onImgTileClick = _ref9.onImgTileClick;
|
|
228
199
|
onImgTileClick && onImgTileClick(col, value, rowIndex);
|
|
229
200
|
};
|
|
230
201
|
});
|
|
231
|
-
|
|
232
202
|
_defineProperty(_assertThisInitialized(_this), "onMoveRow", function (dragIndex, targetIndex) {
|
|
233
203
|
var _ref10 = _this.props.callback || {},
|
|
234
|
-
|
|
235
|
-
|
|
204
|
+
onMoveRow = _ref10.onMoveRow;
|
|
236
205
|
onMoveRow && onMoveRow(dragIndex, targetIndex);
|
|
237
206
|
});
|
|
238
|
-
|
|
239
207
|
_defineProperty(_assertThisInitialized(_this), "closeValid", function () {
|
|
240
208
|
var _this$props = _this.props,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
209
|
+
valid = _this$props.valid,
|
|
210
|
+
_this$props$callback = _this$props.callback,
|
|
211
|
+
callback = _this$props$callback === void 0 ? {} : _this$props$callback;
|
|
244
212
|
valid && callback.onExitValid();
|
|
245
213
|
});
|
|
246
|
-
|
|
247
214
|
_defineProperty(_assertThisInitialized(_this), "getOptions", function (key, colOptions, index) {
|
|
248
215
|
var options = _this.props.items[index].options;
|
|
249
216
|
var options2 = _this.props.options;
|
|
250
|
-
|
|
251
217
|
if (options && _Array$isArray(options[key])) {
|
|
252
218
|
return options[key];
|
|
253
219
|
} else if (options2 && _Array$isArray(options2[key])) {
|
|
@@ -256,7 +222,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
256
222
|
return colOptions;
|
|
257
223
|
}
|
|
258
224
|
});
|
|
259
|
-
|
|
260
225
|
_defineProperty(_assertThisInitialized(_this), "validField", function (required, value) {
|
|
261
226
|
if (!_this.props.valid || _this.error || !required || value) {
|
|
262
227
|
return false;
|
|
@@ -267,25 +232,22 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
267
232
|
return true;
|
|
268
233
|
}
|
|
269
234
|
});
|
|
270
|
-
|
|
271
235
|
_defineProperty(_assertThisInitialized(_this), "renderEditableCell", function (config, value, index) {
|
|
272
236
|
var key = config.key,
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
237
|
+
type = config.type,
|
|
238
|
+
options = config.options,
|
|
239
|
+
props = config.props,
|
|
240
|
+
required = config.required,
|
|
241
|
+
width = config.width,
|
|
242
|
+
showRowAdd = config.showRowAdd;
|
|
280
243
|
var _this$props$items$ind = _this.props.items[index],
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
244
|
+
readonly = _this$props$items$ind.readonly,
|
|
245
|
+
_this$props$items$ind2 = _this$props$items$ind.isReadonly,
|
|
246
|
+
isReadonly = _this$props$items$ind2 === void 0 ? [] : _this$props$items$ind2,
|
|
247
|
+
_this$props$items$ind3 = _this$props$items$ind.isRequired,
|
|
248
|
+
isRequired = _this$props$items$ind3 === void 0 ? [] : _this$props$items$ind3,
|
|
249
|
+
_this$props$items$ind4 = _this$props$items$ind._extraProps,
|
|
250
|
+
_extraProps = _this$props$items$ind4 === void 0 ? {} : _this$props$items$ind4;
|
|
289
251
|
var cellProps = {
|
|
290
252
|
value: value,
|
|
291
253
|
width: width,
|
|
@@ -297,7 +259,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
297
259
|
onSearch: _this.onSearch(key, index, config),
|
|
298
260
|
onBlur: _this.onBlur(key, index)
|
|
299
261
|
};
|
|
300
|
-
|
|
301
262
|
if (showRowAdd && _Array$isArray(isRequired) && _includesInstanceProperty(isRequired).call(isRequired, key)) {
|
|
302
263
|
cellProps.error = _this.validField(true, value);
|
|
303
264
|
cellProps.props = _objectSpread(_objectSpread({}, cellProps.props), _extraProps);
|
|
@@ -323,7 +284,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
323
284
|
onClick: _this.onRowAdd(key, index)
|
|
324
285
|
})));
|
|
325
286
|
}
|
|
326
|
-
|
|
327
287
|
if (_Array$isArray(isRequired) && _includesInstanceProperty(isRequired).call(isRequired, key)) {
|
|
328
288
|
cellProps.error = _this.validField(true, value);
|
|
329
289
|
cellProps.props = _objectSpread(_objectSpread({}, cellProps.props), _extraProps);
|
|
@@ -340,7 +300,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
340
300
|
}
|
|
341
301
|
}, /*#__PURE__*/React.createElement(SuperTableCell, cellProps)));
|
|
342
302
|
}
|
|
343
|
-
|
|
344
303
|
if (showRowAdd) {
|
|
345
304
|
return /*#__PURE__*/React.createElement("div", {
|
|
346
305
|
style: {
|
|
@@ -362,25 +321,23 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
362
321
|
onClick: _this.onRowAdd(key, index)
|
|
363
322
|
})));
|
|
364
323
|
}
|
|
365
|
-
|
|
366
324
|
return /*#__PURE__*/React.createElement(SuperTableCell, cellProps);
|
|
367
325
|
});
|
|
368
|
-
|
|
369
326
|
_defineProperty(_assertThisInitialized(_this), "renderLinkCell", function (col, value, record, index) {
|
|
370
327
|
if (col.link === 'list') {
|
|
371
328
|
var list = value && _Array$isArray(value) ? value : [];
|
|
372
|
-
return /*#__PURE__*/React.createElement("div",
|
|
329
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
330
|
+
style: {
|
|
331
|
+
whiteSpace: 'pre-wrap'
|
|
332
|
+
}
|
|
333
|
+
}, _mapInstanceProperty(list).call(list, function (item2, index2) {
|
|
373
334
|
var _context2;
|
|
374
|
-
|
|
375
335
|
var split = index2 === list.length - 1 ? '' : ',';
|
|
376
|
-
|
|
377
336
|
var onClick = function onClick() {
|
|
378
337
|
var _ref11 = _this.props.callback || {},
|
|
379
|
-
|
|
380
|
-
|
|
338
|
+
onLink = _ref11.onLink;
|
|
381
339
|
onLink && onLink(col.key, index, item2);
|
|
382
340
|
};
|
|
383
|
-
|
|
384
341
|
return /*#__PURE__*/React.createElement("a", {
|
|
385
342
|
key: index2,
|
|
386
343
|
onClick: onClick
|
|
@@ -388,30 +345,27 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
388
345
|
}));
|
|
389
346
|
} else {
|
|
390
347
|
var title = typeof col.link === 'string' ? col.link : value;
|
|
391
|
-
|
|
392
348
|
var onClick = function onClick() {
|
|
393
349
|
var _ref12 = _this.props.callback || {},
|
|
394
|
-
|
|
395
|
-
|
|
350
|
+
onLink = _ref12.onLink;
|
|
396
351
|
onLink && onLink(col.key, index, record);
|
|
397
352
|
};
|
|
398
|
-
|
|
399
353
|
return /*#__PURE__*/React.createElement("a", {
|
|
354
|
+
style: {
|
|
355
|
+
whiteSpace: 'normal',
|
|
356
|
+
wordBreak: "break-all"
|
|
357
|
+
},
|
|
400
358
|
onClick: onClick
|
|
401
359
|
}, title);
|
|
402
360
|
}
|
|
403
361
|
});
|
|
404
|
-
|
|
405
362
|
_defineProperty(_assertThisInitialized(_this), "getIndex", function (index) {
|
|
406
363
|
return (_this.props.base || 0) + index;
|
|
407
364
|
});
|
|
408
|
-
|
|
409
365
|
_defineProperty(_assertThisInitialized(_this), "getCellRender", function (col) {
|
|
410
366
|
return function (value, record, index) {
|
|
411
367
|
var _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10;
|
|
412
|
-
|
|
413
368
|
var realType = record._isEdit === true && _this.canReadonly(col.type) ? col.editType : col.type;
|
|
414
|
-
|
|
415
369
|
if (!realType) {
|
|
416
370
|
return /*#__PURE__*/React.createElement("div", {
|
|
417
371
|
onDoubleClick: _this.onDoubleClick(col.key, record.key),
|
|
@@ -430,23 +384,18 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
430
384
|
title: value
|
|
431
385
|
}, value);
|
|
432
386
|
}
|
|
433
|
-
|
|
434
387
|
switch (realType) {
|
|
435
388
|
case 'checkbox':
|
|
436
389
|
return /*#__PURE__*/React.createElement(_Checkbox, {
|
|
437
390
|
onChange: _this.onCheck(col.key, record.key),
|
|
438
391
|
checked: value || false
|
|
439
392
|
});
|
|
440
|
-
|
|
441
393
|
case 'index':
|
|
442
394
|
return _this.getIndex(index) + 1;
|
|
443
|
-
|
|
444
395
|
case 'link':
|
|
445
396
|
return _this.renderLinkCell(col, value, record, record.key);
|
|
446
|
-
|
|
447
397
|
case 'button':
|
|
448
398
|
var onClick = _this.props.callback.onLink ? _bindInstanceProperty(_context3 = _this.props.callback.onLink).call(_context3, null, col.key, record.key, record) : undefined;
|
|
449
|
-
|
|
450
399
|
if (col.icon === 'add') {
|
|
451
400
|
return /*#__PURE__*/React.createElement(_Button, {
|
|
452
401
|
onClick: onClick,
|
|
@@ -464,7 +413,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
464
413
|
type: col.bsStyle
|
|
465
414
|
}, record[col.key] || col.typeRelated);
|
|
466
415
|
}
|
|
467
|
-
|
|
468
416
|
case 'switch':
|
|
469
417
|
return typeof value === 'string' ? /*#__PURE__*/React.createElement("div", null, value) : /*#__PURE__*/React.createElement(_Switch, {
|
|
470
418
|
checkedChildren: col.props.checkedChildren || '',
|
|
@@ -474,10 +422,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
474
422
|
checked: typeof value === 'number' ? Boolean(value) : value || false,
|
|
475
423
|
disabled: !(record._isEdit === true)
|
|
476
424
|
});
|
|
477
|
-
|
|
478
425
|
case 'custom':
|
|
479
426
|
return _this.props.callback.onRenderCustom(record.key, col.key, value, col.props, col);
|
|
480
|
-
|
|
481
427
|
case 'toolbar':
|
|
482
428
|
//showByKey为true时,每条数据中与按钮key相同的属性值决定按钮是否显示,建议key用下划线开始命名,避免与后台数据冲突
|
|
483
429
|
var props = {
|
|
@@ -489,7 +435,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
489
435
|
})
|
|
490
436
|
};
|
|
491
437
|
return /*#__PURE__*/React.createElement(SuperToolbar, props);
|
|
492
|
-
|
|
493
438
|
case 'img':
|
|
494
439
|
return value ? typeof value === 'string' ? /*#__PURE__*/React.createElement("img", {
|
|
495
440
|
src: _includesInstanceProperty(value).call(value, 'http') ? value : _concatInstanceProperty(_context7 = "".concat(window.location.origin, "/api/proxy/file-center-service/")).call(_context7, value),
|
|
@@ -529,19 +474,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
529
474
|
color: '#333'
|
|
530
475
|
}
|
|
531
476
|
}, value.remark))) : /*#__PURE__*/React.createElement("div", null);
|
|
532
|
-
|
|
533
477
|
case 'uploadImg':
|
|
534
478
|
var commonProps = _this.props.callback.buildSuperUploadProps ? _this.props.callback.buildSuperUploadProps() : {};
|
|
535
|
-
|
|
536
479
|
var uploadProps = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
537
480
|
onFileChange: _this.props.callback.onTableFileChange ? _bindInstanceProperty(_context10 = _this.props.callback.onTableFileChange).call(_context10, null, col.key, index) : undefined,
|
|
538
481
|
type: col.type
|
|
539
482
|
}, col.props), _this.props), commonProps), {}, {
|
|
540
483
|
value: _this.props.items[index][col.key]
|
|
541
484
|
});
|
|
542
|
-
|
|
543
485
|
return /*#__PURE__*/React.createElement(Control, uploadProps);
|
|
544
|
-
|
|
545
486
|
default:
|
|
546
487
|
return _this.renderEditableCell(_objectSpread(_objectSpread({}, col), {}, {
|
|
547
488
|
type: realType
|
|
@@ -549,15 +490,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
549
490
|
}
|
|
550
491
|
};
|
|
551
492
|
});
|
|
552
|
-
|
|
553
493
|
_defineProperty(_assertThisInitialized(_this), "getCheckedStatus", function (key) {
|
|
554
494
|
var has = false,
|
|
555
|
-
|
|
495
|
+
not = false;
|
|
556
496
|
var items = _this.props.items;
|
|
557
|
-
|
|
558
497
|
var _iterator = _createForOfIteratorHelper(items),
|
|
559
|
-
|
|
560
|
-
|
|
498
|
+
_step;
|
|
561
499
|
try {
|
|
562
500
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
563
501
|
var item = _step.value;
|
|
@@ -568,17 +506,14 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
568
506
|
} finally {
|
|
569
507
|
_iterator.f();
|
|
570
508
|
}
|
|
571
|
-
|
|
572
509
|
return {
|
|
573
510
|
checked: has && !not,
|
|
574
511
|
indeterminate: has && not
|
|
575
512
|
};
|
|
576
513
|
});
|
|
577
|
-
|
|
578
514
|
_defineProperty(_assertThisInitialized(_this), "toAdd", function (key, showAdd) {
|
|
579
515
|
if (showAdd) {
|
|
580
516
|
var onClick = _this.onAdd(key);
|
|
581
|
-
|
|
582
517
|
return /*#__PURE__*/React.createElement(_Icon, {
|
|
583
518
|
type: "plus-circle-o",
|
|
584
519
|
role: "add",
|
|
@@ -588,17 +523,14 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
588
523
|
return null;
|
|
589
524
|
}
|
|
590
525
|
});
|
|
591
|
-
|
|
592
526
|
_defineProperty(_assertThisInitialized(_this), "getColumnTitle", function (_ref13) {
|
|
593
527
|
var required = _ref13.required,
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
528
|
+
title = _ref13.title,
|
|
529
|
+
type = _ref13.type,
|
|
530
|
+
key = _ref13.key,
|
|
531
|
+
showAdd = _ref13.showAdd;
|
|
599
532
|
if (type === 'checkbox') {
|
|
600
533
|
var status = _this.getCheckedStatus(key);
|
|
601
|
-
|
|
602
534
|
return /*#__PURE__*/React.createElement(_Checkbox, _extends({
|
|
603
535
|
onChange: _this.onCheck(key, -1)
|
|
604
536
|
}, status));
|
|
@@ -609,49 +541,40 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
609
541
|
}, title, _this.toAdd(key, showAdd));
|
|
610
542
|
}
|
|
611
543
|
});
|
|
612
|
-
|
|
613
544
|
_defineProperty(_assertThisInitialized(_this), "getColumnClassName", function (_ref14) {
|
|
614
545
|
var type = _ref14.type,
|
|
615
|
-
|
|
616
|
-
|
|
546
|
+
align = _ref14.align;
|
|
617
547
|
if (type === 'index' || type === 'checkbox') {
|
|
618
548
|
return 'ant-table-selection-column';
|
|
619
549
|
} else {
|
|
620
550
|
return align ? variables('SuperTable2')[align] : '';
|
|
621
551
|
}
|
|
622
552
|
});
|
|
623
|
-
|
|
624
553
|
_defineProperty(_assertThisInitialized(_this), "canReadonly", function (type) {
|
|
625
554
|
var _context11;
|
|
626
|
-
|
|
627
555
|
return !_includesInstanceProperty(_context11 = ['index', 'checkbox', 'link', 'button', 'switch', 'custom', 'img', 'toolbar', 'uploadImg']).call(_context11, type);
|
|
628
556
|
});
|
|
629
|
-
|
|
630
557
|
_defineProperty(_assertThisInitialized(_this), "getColumns", function (cols) {
|
|
631
558
|
var _context12;
|
|
632
|
-
|
|
633
559
|
var readonly = _this.props.readonly;
|
|
634
560
|
return _mapInstanceProperty(_context12 = _filterInstanceProperty(cols).call(cols, function (col) {
|
|
635
561
|
return !col.hide;
|
|
636
562
|
})).call(_context12, function (_ref15, index) {
|
|
637
563
|
var _context13;
|
|
638
|
-
|
|
639
|
-
var col = _extends({}, _ref15);
|
|
640
|
-
|
|
564
|
+
var col = _extends({}, (_objectDestructuringEmpty(_ref15), _ref15));
|
|
641
565
|
col.className = _this.getColumnClassName(col);
|
|
642
566
|
col.title = _this.getColumnTitle(col);
|
|
643
567
|
col.dataIndex = col.key;
|
|
644
|
-
col.width = col.width ? col.width : _includesInstanceProperty(_context13 = ['index', 'checked']).call(_context13, col.key) ? 70 : col.type === 'img' ? 200 : 120;
|
|
568
|
+
col.width = col.width ? col.width : _includesInstanceProperty(_context13 = ['index', 'checked']).call(_context13, col.key) ? 70 : col.type === 'img' ? 200 : 120;
|
|
569
|
+
// const {props = {}} = col;
|
|
645
570
|
// const {edit = false} = props
|
|
646
571
|
// if (!(readonly || col.type === 'readonly') || !this.canReadonly(col.type)) {
|
|
647
572
|
// if ( !edit && ['text', 'number', 'select', 'date', 'search', 'readonly', 'textArea', 'selectSearch'].includes(col.type)){
|
|
648
573
|
// return col
|
|
649
574
|
// }
|
|
650
575
|
// }
|
|
651
|
-
|
|
652
576
|
col.readonly = readonly;
|
|
653
577
|
col.render = _this.getCellRender(col);
|
|
654
|
-
|
|
655
578
|
if (col.link) {
|
|
656
579
|
col.type = 'link';
|
|
657
580
|
col.render = _this.getCellRender(col);
|
|
@@ -665,26 +588,21 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
665
588
|
}
|
|
666
589
|
};
|
|
667
590
|
}
|
|
668
|
-
|
|
669
591
|
return col;
|
|
670
592
|
});
|
|
671
593
|
});
|
|
672
|
-
|
|
673
594
|
_defineProperty(_assertThisInitialized(_this), "getDataSource", function (items, cols) {
|
|
674
595
|
return _mapInstanceProperty(items).call(items, function (item, index) {
|
|
675
596
|
return _reduceInstanceProperty(cols).call(cols, function (result, _ref16) {
|
|
676
597
|
var _context14, _context15;
|
|
677
|
-
|
|
678
598
|
var key = _ref16.key,
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
599
|
+
type = _ref16.type,
|
|
600
|
+
options = _ref16.options;
|
|
682
601
|
if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || _Array$isArray(item.isReadonly) && !_includesInstanceProperty(_context14 = item.isReadonly).call(_context14, key)) || _includesInstanceProperty(_context15 = ['img', 'switch', 'custom', 'img', 'toolbar', 'uploadImg']).call(_context15, type)) {
|
|
683
602
|
result[key] = item[key];
|
|
684
603
|
} else {
|
|
685
604
|
result[key] = getTitle(item[key], options);
|
|
686
605
|
}
|
|
687
|
-
|
|
688
606
|
return result;
|
|
689
607
|
}, _objectSpread(_objectSpread({}, item), {}, {
|
|
690
608
|
key: index,
|
|
@@ -692,68 +610,56 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
692
610
|
}));
|
|
693
611
|
});
|
|
694
612
|
});
|
|
695
|
-
|
|
696
613
|
_defineProperty(_assertThisInitialized(_this), "getPropsByCheckbox", function () {
|
|
697
614
|
var _this$props2 = _this.props,
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
615
|
+
items = _this$props2.items,
|
|
616
|
+
_this$props2$isEmphas = _this$props2.isEmphasized,
|
|
617
|
+
isEmphasized = _this$props2$isEmphas === void 0 ? false : _this$props2$isEmphas;
|
|
702
618
|
var rowClassName = function rowClassName(record) {
|
|
703
619
|
if (isEmphasized && items[record.key].__isEmphasized) {
|
|
704
620
|
return items[record.key].checked ? variables('SuperTable2').emphasizedSelectRow : variables('SuperTable2').emphasizedUnselectRow;
|
|
705
621
|
}
|
|
706
|
-
|
|
707
622
|
return items[record.key].checked ? variables('SuperTable2').select : '';
|
|
708
623
|
};
|
|
709
|
-
|
|
710
624
|
return {
|
|
711
625
|
rowClassName: rowClassName
|
|
712
626
|
};
|
|
713
627
|
});
|
|
714
|
-
|
|
715
628
|
_defineProperty(_assertThisInitialized(_this), "getSelectedRowKeys", function (items) {
|
|
716
629
|
return _reduceInstanceProperty(items).call(items, function (result, item, index) {
|
|
717
630
|
item.checked && result.push(index);
|
|
718
631
|
return result;
|
|
719
632
|
}, []);
|
|
720
633
|
});
|
|
721
|
-
|
|
722
634
|
_defineProperty(_assertThisInitialized(_this), "getPropsByCheckbox2", function (items) {
|
|
723
635
|
var _this$props3 = _this.props,
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
636
|
+
_this$props3$checkbox = _this$props3.checkbox,
|
|
637
|
+
checkbox = _this$props3$checkbox === void 0 ? true : _this$props3$checkbox,
|
|
638
|
+
_this$props3$radio = _this$props3.radio,
|
|
639
|
+
radio = _this$props3$radio === void 0 ? false : _this$props3$radio,
|
|
640
|
+
isolation = _this$props3.isolation,
|
|
641
|
+
_this$props3$checkedR = _this$props3.checkedRows,
|
|
642
|
+
checkedRows = _this$props3$checkedR === void 0 ? [] : _this$props3$checkedR,
|
|
643
|
+
_this$props3$isEmphas = _this$props3.isEmphasized,
|
|
644
|
+
isEmphasized = _this$props3$isEmphas === void 0 ? false : _this$props3$isEmphas,
|
|
645
|
+
_this$props3$isWeaken = _this$props3.isWeaken,
|
|
646
|
+
isWeaken = _this$props3$isWeaken === void 0 ? true : _this$props3$isWeaken;
|
|
736
647
|
var rowClassName1 = function rowClassName1(record) {
|
|
737
648
|
if (items[record.key].__total) return variables('SuperTable').totalRow;
|
|
738
649
|
if (items[record.key].__warningRow) return variables('SuperTable').warningRow;
|
|
739
650
|
return _includesInstanceProperty(checkedRows).call(checkedRows, record.key) ? variables('SuperTable').select : '';
|
|
740
651
|
};
|
|
741
|
-
|
|
742
652
|
var rowClassName2 = function rowClassName2(record) {
|
|
743
653
|
if (items[record.key].__total) return variables('SuperTable').totalRow;
|
|
744
654
|
if (items[record.key].__warningRow) return variables('SuperTable').warningRow;
|
|
745
|
-
|
|
746
655
|
if (isEmphasized && items[record.key].__isEmphasized) {
|
|
747
656
|
return items[record.key].checked ? variables('SuperTable').emphasizedSelectRow : variables('SuperTable').emphasizedUnselectRow;
|
|
748
657
|
}
|
|
749
|
-
|
|
750
658
|
if (isWeaken && items[record.key].__isWeaken) {
|
|
751
659
|
return items[record.key].checked ? variables('SuperTable').weakenedSelectRow : variables('SuperTable').weakenedUnselectRow;
|
|
752
660
|
}
|
|
753
|
-
|
|
754
661
|
return items[record.key].checked ? variables('SuperTable').select : '';
|
|
755
662
|
};
|
|
756
|
-
|
|
757
663
|
if (checkbox) {
|
|
758
664
|
if (radio) {
|
|
759
665
|
return {
|
|
@@ -774,7 +680,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
774
680
|
onChange: _this.onCheckChange,
|
|
775
681
|
getCheckboxProps: function getCheckboxProps(record) {
|
|
776
682
|
var checked = _includesInstanceProperty(checkedRows).call(checkedRows, record.key);
|
|
777
|
-
|
|
778
683
|
return {
|
|
779
684
|
checked: checked,
|
|
780
685
|
disabled: items[record.key].__isWeaken,
|
|
@@ -811,7 +716,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
811
716
|
};
|
|
812
717
|
}
|
|
813
718
|
});
|
|
814
|
-
|
|
815
719
|
_defineProperty(_assertThisInitialized(_this), "getRowPropsForDrag", function () {
|
|
816
720
|
return function (record, index) {
|
|
817
721
|
return {
|
|
@@ -820,7 +724,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
820
724
|
};
|
|
821
725
|
};
|
|
822
726
|
});
|
|
823
|
-
|
|
824
727
|
_defineProperty(_assertThisInitialized(_this), "getRowProps", function (onRowClick) {
|
|
825
728
|
return function (record) {
|
|
826
729
|
return {
|
|
@@ -833,36 +736,31 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
833
736
|
};
|
|
834
737
|
};
|
|
835
738
|
});
|
|
836
|
-
|
|
837
739
|
_defineProperty(_assertThisInitialized(_this), "getProps", function () {
|
|
838
740
|
var _context16;
|
|
839
|
-
|
|
840
741
|
var _this$props4 = _this.props,
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
742
|
+
cols = _this$props4.cols,
|
|
743
|
+
items = _this$props4.items,
|
|
744
|
+
_this$props4$style = _this$props4.style,
|
|
745
|
+
style = _this$props4$style === void 0 ? {} : _this$props4$style,
|
|
746
|
+
_this$props4$footer = _this$props4.footer,
|
|
747
|
+
footer = _this$props4$footer === void 0 ? null : _this$props4$footer,
|
|
748
|
+
_this$props4$paginati = _this$props4.pagination,
|
|
749
|
+
pagination = _this$props4$paginati === void 0 ? false : _this$props4$paginati,
|
|
750
|
+
dragSort = _this$props4.dragSort,
|
|
751
|
+
_this$props4$isEmphas = _this$props4.isEmphasized,
|
|
752
|
+
isEmphasized = _this$props4$isEmphas === void 0 ? false : _this$props4$isEmphas,
|
|
753
|
+
maxHeight = _this$props4.maxHeight,
|
|
754
|
+
_this$props4$expanded = _this$props4.expandedRowRender,
|
|
755
|
+
expandedRowRender = _this$props4$expanded === void 0 ? undefined : _this$props4$expanded,
|
|
756
|
+
_this$props4$onExpand = _this$props4.onExpand,
|
|
757
|
+
onExpand = _this$props4$onExpand === void 0 ? undefined : _this$props4$onExpand;
|
|
858
758
|
var widthX = _reduceInstanceProperty(_context16 = _filterInstanceProperty(cols).call(cols, function (col) {
|
|
859
759
|
return !col.hide;
|
|
860
760
|
})).call(_context16, function (width, item) {
|
|
861
761
|
var _context17;
|
|
862
|
-
|
|
863
762
|
return width += item.width ? item.width : _includesInstanceProperty(_context17 = ['index', 'checked']).call(_context17, item.key) ? 70 : item.type === 'img' ? 200 : 120;
|
|
864
763
|
}, 0);
|
|
865
|
-
|
|
866
764
|
var scrollProps = !helper.isEmpty2(expandedRowRender) ? {
|
|
867
765
|
expandedRowRender: expandedRowRender
|
|
868
766
|
} : {
|
|
@@ -873,11 +771,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
873
771
|
y: maxHeight
|
|
874
772
|
}
|
|
875
773
|
};
|
|
876
|
-
|
|
877
774
|
var _this$getPropsByCheck = _this.getPropsByCheckbox2(items),
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
775
|
+
onRowClick = _this$getPropsByCheck.onRowClick,
|
|
776
|
+
extraProps = _objectWithoutProperties(_this$getPropsByCheck, _excluded);
|
|
881
777
|
return _objectSpread(_objectSpread({
|
|
882
778
|
className: !isEmphasized ? variables('SuperTable2') : variables('SuperTable2').noTransition,
|
|
883
779
|
columns: _this.getColumns(cols),
|
|
@@ -901,7 +797,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
901
797
|
onExpand: onExpand
|
|
902
798
|
}, scrollProps);
|
|
903
799
|
});
|
|
904
|
-
|
|
905
800
|
_defineProperty(_assertThisInitialized(_this), "setScroll", function () {
|
|
906
801
|
if (_this.props.maxHeight && _this.props.items.length) {
|
|
907
802
|
var root = ReactDOM.findDOMNode(_assertThisInitialized(_this));
|
|
@@ -910,10 +805,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
910
805
|
fixed(container, header, _this.props.maxHeight);
|
|
911
806
|
}
|
|
912
807
|
});
|
|
913
|
-
|
|
914
808
|
return _this;
|
|
915
809
|
}
|
|
916
|
-
|
|
917
810
|
_createClass(SuperTable2, [{
|
|
918
811
|
key: "componentDidMount",
|
|
919
812
|
value: function componentDidMount() {
|
|
@@ -933,10 +826,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
933
826
|
}));
|
|
934
827
|
}
|
|
935
828
|
}]);
|
|
936
|
-
|
|
937
829
|
return SuperTable2;
|
|
938
830
|
}(React.Component);
|
|
939
|
-
|
|
940
831
|
_defineProperty(SuperTable2, "propTypes", {
|
|
941
832
|
cols: PropTypes.arrayOf(PropTypes.shape(ColType)).isRequired,
|
|
942
833
|
items: PropTypes.array.isRequired,
|
|
@@ -952,5 +843,4 @@ _defineProperty(SuperTable2, "propTypes", {
|
|
|
952
843
|
isEmphasized: PropTypes.bool,
|
|
953
844
|
dragSort: PropTypes.bool
|
|
954
845
|
});
|
|
955
|
-
|
|
956
846
|
export default SuperTable2;
|