cloud-b2b 1.1.27 → 1.1.28
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 +95 -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 +95 -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
|
@@ -1,137 +1,82 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
|
4
|
-
|
|
5
4
|
var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
|
|
6
|
-
|
|
7
5
|
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
8
|
-
|
|
9
6
|
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
|
10
|
-
|
|
11
7
|
var _filterInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
12
|
-
|
|
13
8
|
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
14
|
-
|
|
15
9
|
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
16
|
-
|
|
17
10
|
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
|
18
|
-
|
|
19
11
|
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
|
20
|
-
|
|
21
12
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
22
|
-
|
|
23
13
|
var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/slice");
|
|
24
|
-
|
|
25
14
|
var _Array$from = require("@babel/runtime-corejs3/core-js-stable/array/from");
|
|
26
|
-
|
|
27
15
|
var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol");
|
|
28
|
-
|
|
29
16
|
var _getIteratorMethod = require("@babel/runtime-corejs3/core-js/get-iterator-method");
|
|
30
|
-
|
|
31
17
|
var _Array$isArray2 = require("@babel/runtime-corejs3/core-js-stable/array/is-array");
|
|
32
|
-
|
|
33
18
|
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
|
34
|
-
|
|
35
19
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
36
|
-
|
|
37
20
|
_Object$defineProperty(exports, "__esModule", {
|
|
38
21
|
value: true
|
|
39
22
|
});
|
|
40
|
-
|
|
41
23
|
exports["default"] = void 0;
|
|
42
|
-
|
|
43
24
|
var _table = _interopRequireDefault(require("antd/lib/table"));
|
|
44
|
-
|
|
45
25
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
|
46
|
-
|
|
47
26
|
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
48
|
-
|
|
49
27
|
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
50
|
-
|
|
51
28
|
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
52
|
-
|
|
53
29
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
54
|
-
|
|
55
30
|
var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
|
|
56
|
-
|
|
57
31
|
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
58
|
-
|
|
59
32
|
var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
|
|
60
|
-
|
|
61
33
|
var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
|
62
|
-
|
|
63
34
|
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
64
|
-
|
|
35
|
+
var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectDestructuringEmpty"));
|
|
65
36
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
66
|
-
|
|
67
37
|
var _switch = _interopRequireDefault(require("antd/lib/switch"));
|
|
68
|
-
|
|
69
38
|
var _button = _interopRequireDefault(require("antd/lib/button"));
|
|
70
|
-
|
|
71
39
|
var _checkbox = _interopRequireDefault(require("antd/lib/checkbox"));
|
|
72
|
-
|
|
73
40
|
var _icon = _interopRequireDefault(require("antd/lib/icon"));
|
|
74
|
-
|
|
75
41
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
76
|
-
|
|
77
42
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
78
|
-
|
|
79
43
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
80
|
-
|
|
81
44
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
82
|
-
|
|
83
45
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
84
|
-
|
|
85
46
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
86
|
-
|
|
87
47
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
88
|
-
|
|
89
48
|
var _react = _interopRequireDefault(require("react"));
|
|
90
|
-
|
|
91
49
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
92
|
-
|
|
93
50
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
94
|
-
|
|
95
51
|
var _Control = _interopRequireWildcard(require("../Control"));
|
|
96
|
-
|
|
97
52
|
var _SuperTableCell = _interopRequireDefault(require("./SuperTableCell"));
|
|
98
|
-
|
|
99
53
|
var _fixed = _interopRequireDefault(require("../SuperTable/fixed"));
|
|
100
|
-
|
|
101
54
|
var _SuperToolbar = _interopRequireDefault(require("../SuperToolbar"));
|
|
102
|
-
|
|
103
55
|
var _variables = _interopRequireDefault(require("../variables"));
|
|
104
|
-
|
|
105
56
|
var _helper = _interopRequireWildcard(require("../helper"));
|
|
106
|
-
|
|
107
57
|
var _DragSortRow = _interopRequireDefault(require("../SuperTable/DragSortRow"));
|
|
108
|
-
|
|
109
58
|
var _excluded = ["onRowClick"];
|
|
110
|
-
|
|
111
59
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
112
|
-
|
|
113
60
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
114
|
-
|
|
115
61
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (_Array$isArray2(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
116
|
-
|
|
117
62
|
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); }
|
|
118
|
-
|
|
119
|
-
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; }
|
|
120
|
-
|
|
63
|
+
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; }
|
|
121
64
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty2(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
122
|
-
|
|
123
65
|
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) { (0, _defineProperty2["default"])(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; }
|
|
124
|
-
|
|
125
66
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
126
|
-
|
|
127
67
|
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; } }
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
'selectText',
|
|
131
|
-
|
|
132
|
-
'
|
|
133
|
-
|
|
68
|
+
var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select',
|
|
69
|
+
//存储value
|
|
70
|
+
'selectText',
|
|
71
|
+
//存储title
|
|
72
|
+
'search', 'searchText', 'selectSearch',
|
|
73
|
+
//多选下拉搜索
|
|
74
|
+
'date', 'button', 'custom', 'switch', 'textArea', 'link', 'toolbar',
|
|
75
|
+
//按钮组
|
|
76
|
+
'img',
|
|
77
|
+
//图片标题组 value为{src,title}时显示图片标题 为字符串时 只显示图片
|
|
134
78
|
'uploadImg'];
|
|
79
|
+
|
|
135
80
|
/**
|
|
136
81
|
* key:标识所在列,在一个表格中必须唯一
|
|
137
82
|
* title:列的标题,type为checkbox时,title为空字符串时,表头才会显示为复选框
|
|
@@ -144,7 +89,6 @@ var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select', //
|
|
|
144
89
|
* showAdd: 表头是否显示+号,默认为false,加号会触发onAdd事件
|
|
145
90
|
* hide: 为true时隐藏该列
|
|
146
91
|
*/
|
|
147
|
-
|
|
148
92
|
var ColType = {
|
|
149
93
|
key: _propTypes["default"].string.isRequired,
|
|
150
94
|
title: _propTypes["default"].string.isRequired,
|
|
@@ -157,6 +101,7 @@ var ColType = {
|
|
|
157
101
|
hide: _propTypes["default"].bool,
|
|
158
102
|
props: _propTypes["default"].any
|
|
159
103
|
};
|
|
104
|
+
|
|
160
105
|
/**
|
|
161
106
|
* onCheck:点击复选框时触发,原型func(rowIndex, keyName, checked)
|
|
162
107
|
* onContentChange: 输入框内容改变时触发,原型为function(rowIndex, keyName, value)
|
|
@@ -168,7 +113,6 @@ var ColType = {
|
|
|
168
113
|
* onToolbar:点击表格列按钮组时触发,原型为function(按钮组列的key,rowIndex,该行数据的值,按钮key);
|
|
169
114
|
* onDoubleClick: 双击单元格触发(只针对于type类型为空的情况下)
|
|
170
115
|
*/
|
|
171
|
-
|
|
172
116
|
var CallbackType = {
|
|
173
117
|
onExitValid: _propTypes["default"].func,
|
|
174
118
|
onCheck: _propTypes["default"].func,
|
|
@@ -187,121 +131,102 @@ var CallbackType = {
|
|
|
187
131
|
//点击img类型标题触发事件
|
|
188
132
|
onMoveRow: _propTypes["default"].func
|
|
189
133
|
};
|
|
134
|
+
|
|
190
135
|
/**
|
|
191
136
|
* base[可选]:序号的开始数字,所有回调函数中的序号值都会加上这个值,默认值为0
|
|
192
137
|
* isEmphasized: [可选],是否强调,行字体加粗显示, 除了isEmphasized设置为true之外,加粗行数据里要设置__isEmphasized为true
|
|
193
138
|
*/
|
|
194
|
-
|
|
195
139
|
var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
196
140
|
(0, _inherits2["default"])(SuperTable2, _React$Component);
|
|
197
|
-
|
|
198
141
|
var _super = _createSuper(SuperTable2);
|
|
199
|
-
|
|
200
142
|
function SuperTable2() {
|
|
201
143
|
var _context;
|
|
202
|
-
|
|
203
144
|
var _this;
|
|
204
|
-
|
|
205
145
|
(0, _classCallCheck2["default"])(this, SuperTable2);
|
|
206
|
-
|
|
207
146
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
208
147
|
args[_key] = arguments[_key];
|
|
209
148
|
}
|
|
210
|
-
|
|
211
149
|
_this = _super.call.apply(_super, (0, _concat["default"])(_context = [this]).call(_context, args));
|
|
212
150
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSwitch", function (key, rowIndex) {
|
|
213
151
|
return function (value) {
|
|
214
152
|
var _ref = _this.props.callback || {},
|
|
215
|
-
|
|
216
|
-
|
|
153
|
+
onContentChange = _ref.onContentChange;
|
|
217
154
|
onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
|
|
218
155
|
};
|
|
219
156
|
});
|
|
220
157
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onCheck", function (key, rowIndex) {
|
|
221
158
|
return function (e) {
|
|
222
159
|
var _ref2 = _this.props.callback || {},
|
|
223
|
-
|
|
224
|
-
|
|
160
|
+
onCheck = _ref2.onCheck;
|
|
225
161
|
onCheck && onCheck(_this.getIndex(rowIndex), key, e.target.checked);
|
|
226
162
|
};
|
|
227
163
|
});
|
|
228
164
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (key, rowIndex) {
|
|
229
165
|
return function (value) {
|
|
230
166
|
var _ref3 = _this.props.callback || {},
|
|
231
|
-
|
|
232
|
-
|
|
167
|
+
onContentChange = _ref3.onContentChange;
|
|
233
168
|
_this.closeValid();
|
|
234
|
-
|
|
235
169
|
onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
|
|
236
170
|
};
|
|
237
171
|
});
|
|
238
172
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSearch", function (key, rowIndex, config) {
|
|
239
173
|
return function (value) {
|
|
240
174
|
var _ref4 = _this.props.callback || {},
|
|
241
|
-
|
|
242
|
-
|
|
175
|
+
onSearch = _ref4.onSearch;
|
|
243
176
|
onSearch && onSearch(_this.getIndex(rowIndex), key, value, config);
|
|
244
177
|
};
|
|
245
178
|
});
|
|
246
179
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onAdd", function (key) {
|
|
247
180
|
return function () {
|
|
248
181
|
var _ref5 = _this.props.callback || {},
|
|
249
|
-
|
|
250
|
-
|
|
182
|
+
onAdd = _ref5.onAdd;
|
|
251
183
|
onAdd && onAdd(key);
|
|
252
184
|
};
|
|
253
185
|
});
|
|
254
186
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRowAdd", function (key, index) {
|
|
255
187
|
return function () {
|
|
256
188
|
var _ref6 = _this.props.callback || {},
|
|
257
|
-
|
|
258
|
-
|
|
189
|
+
onLink = _ref6.onLink;
|
|
259
190
|
onLink && onLink(key, index, _this.props.items[index]);
|
|
260
191
|
};
|
|
261
192
|
});
|
|
262
193
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onBlur", function (key, rowIndex) {
|
|
263
194
|
return function (value) {
|
|
264
195
|
var _ref7 = _this.props.callback || {},
|
|
265
|
-
|
|
266
|
-
|
|
196
|
+
onBlur = _ref7.onBlur;
|
|
267
197
|
_this.closeValid();
|
|
268
|
-
|
|
269
198
|
onBlur && onBlur(_this.getIndex(rowIndex), key, value);
|
|
270
199
|
};
|
|
271
200
|
});
|
|
272
201
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDoubleClick", function (key, value) {
|
|
273
202
|
return function () {
|
|
274
203
|
var _ref8 = _this.props.callback || {},
|
|
275
|
-
|
|
276
|
-
|
|
204
|
+
onDoubleClick = _ref8.onDoubleClick;
|
|
277
205
|
onDoubleClick && onDoubleClick(key, value);
|
|
278
206
|
};
|
|
279
207
|
});
|
|
280
208
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onImgTileClick", function (col, value, rowIndex) {
|
|
281
209
|
return function () {
|
|
282
210
|
var _ref9 = _this.props.callback || {},
|
|
283
|
-
|
|
284
|
-
|
|
211
|
+
onImgTileClick = _ref9.onImgTileClick;
|
|
285
212
|
onImgTileClick && onImgTileClick(col, value, rowIndex);
|
|
286
213
|
};
|
|
287
214
|
});
|
|
288
215
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onMoveRow", function (dragIndex, targetIndex) {
|
|
289
216
|
var _ref10 = _this.props.callback || {},
|
|
290
|
-
|
|
291
|
-
|
|
217
|
+
onMoveRow = _ref10.onMoveRow;
|
|
292
218
|
onMoveRow && onMoveRow(dragIndex, targetIndex);
|
|
293
219
|
});
|
|
294
220
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "closeValid", function () {
|
|
295
221
|
var _this$props = _this.props,
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
222
|
+
valid = _this$props.valid,
|
|
223
|
+
_this$props$callback = _this$props.callback,
|
|
224
|
+
callback = _this$props$callback === void 0 ? {} : _this$props$callback;
|
|
299
225
|
valid && callback.onExitValid();
|
|
300
226
|
});
|
|
301
227
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getOptions", function (key, colOptions, index) {
|
|
302
228
|
var options = _this.props.items[index].options;
|
|
303
229
|
var options2 = _this.props.options;
|
|
304
|
-
|
|
305
230
|
if (options && (0, _isArray["default"])(options[key])) {
|
|
306
231
|
return options[key];
|
|
307
232
|
} else if (options2 && (0, _isArray["default"])(options2[key])) {
|
|
@@ -322,22 +247,20 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
322
247
|
});
|
|
323
248
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderEditableCell", function (config, value, index) {
|
|
324
249
|
var key = config.key,
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
250
|
+
type = config.type,
|
|
251
|
+
options = config.options,
|
|
252
|
+
props = config.props,
|
|
253
|
+
required = config.required,
|
|
254
|
+
width = config.width,
|
|
255
|
+
showRowAdd = config.showRowAdd;
|
|
332
256
|
var _this$props$items$ind = _this.props.items[index],
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
257
|
+
readonly = _this$props$items$ind.readonly,
|
|
258
|
+
_this$props$items$ind2 = _this$props$items$ind.isReadonly,
|
|
259
|
+
isReadonly = _this$props$items$ind2 === void 0 ? [] : _this$props$items$ind2,
|
|
260
|
+
_this$props$items$ind3 = _this$props$items$ind.isRequired,
|
|
261
|
+
isRequired = _this$props$items$ind3 === void 0 ? [] : _this$props$items$ind3,
|
|
262
|
+
_this$props$items$ind4 = _this$props$items$ind._extraProps,
|
|
263
|
+
_extraProps = _this$props$items$ind4 === void 0 ? {} : _this$props$items$ind4;
|
|
341
264
|
var cellProps = {
|
|
342
265
|
value: value,
|
|
343
266
|
width: width,
|
|
@@ -349,7 +272,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
349
272
|
onSearch: _this.onSearch(key, index, config),
|
|
350
273
|
onBlur: _this.onBlur(key, index)
|
|
351
274
|
};
|
|
352
|
-
|
|
353
275
|
if (showRowAdd && (0, _isArray["default"])(isRequired) && (0, _includes["default"])(isRequired).call(isRequired, key)) {
|
|
354
276
|
cellProps.error = _this.validField(true, value);
|
|
355
277
|
cellProps.props = _objectSpread(_objectSpread({}, cellProps.props), _extraProps);
|
|
@@ -375,7 +297,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
375
297
|
onClick: _this.onRowAdd(key, index)
|
|
376
298
|
})));
|
|
377
299
|
}
|
|
378
|
-
|
|
379
300
|
if ((0, _isArray["default"])(isRequired) && (0, _includes["default"])(isRequired).call(isRequired, key)) {
|
|
380
301
|
cellProps.error = _this.validField(true, value);
|
|
381
302
|
cellProps.props = _objectSpread(_objectSpread({}, cellProps.props), _extraProps);
|
|
@@ -392,7 +313,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
392
313
|
}
|
|
393
314
|
}, /*#__PURE__*/_react["default"].createElement(_SuperTableCell["default"], cellProps)));
|
|
394
315
|
}
|
|
395
|
-
|
|
396
316
|
if (showRowAdd) {
|
|
397
317
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
398
318
|
style: {
|
|
@@ -414,24 +334,23 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
414
334
|
onClick: _this.onRowAdd(key, index)
|
|
415
335
|
})));
|
|
416
336
|
}
|
|
417
|
-
|
|
418
337
|
return /*#__PURE__*/_react["default"].createElement(_SuperTableCell["default"], cellProps);
|
|
419
338
|
});
|
|
420
339
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderLinkCell", function (col, value, record, index) {
|
|
421
340
|
if (col.link === 'list') {
|
|
422
341
|
var list = value && (0, _isArray["default"])(value) ? value : [];
|
|
423
|
-
return /*#__PURE__*/_react["default"].createElement("div",
|
|
342
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
343
|
+
style: {
|
|
344
|
+
whiteSpace: 'pre-wrap'
|
|
345
|
+
}
|
|
346
|
+
}, (0, _map["default"])(list).call(list, function (item2, index2) {
|
|
424
347
|
var _context2;
|
|
425
|
-
|
|
426
348
|
var split = index2 === list.length - 1 ? '' : ',';
|
|
427
|
-
|
|
428
349
|
var onClick = function onClick() {
|
|
429
350
|
var _ref11 = _this.props.callback || {},
|
|
430
|
-
|
|
431
|
-
|
|
351
|
+
onLink = _ref11.onLink;
|
|
432
352
|
onLink && onLink(col.key, index, item2);
|
|
433
353
|
};
|
|
434
|
-
|
|
435
354
|
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
436
355
|
key: index2,
|
|
437
356
|
onClick: onClick
|
|
@@ -439,15 +358,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
439
358
|
}));
|
|
440
359
|
} else {
|
|
441
360
|
var title = typeof col.link === 'string' ? col.link : value;
|
|
442
|
-
|
|
443
361
|
var onClick = function onClick() {
|
|
444
362
|
var _ref12 = _this.props.callback || {},
|
|
445
|
-
|
|
446
|
-
|
|
363
|
+
onLink = _ref12.onLink;
|
|
447
364
|
onLink && onLink(col.key, index, record);
|
|
448
365
|
};
|
|
449
|
-
|
|
450
366
|
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
367
|
+
style: {
|
|
368
|
+
whiteSpace: 'normal'
|
|
369
|
+
},
|
|
451
370
|
onClick: onClick
|
|
452
371
|
}, title);
|
|
453
372
|
}
|
|
@@ -458,9 +377,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
458
377
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getCellRender", function (col) {
|
|
459
378
|
return function (value, record, index) {
|
|
460
379
|
var _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10;
|
|
461
|
-
|
|
462
380
|
var realType = record._isEdit === true && _this.canReadonly(col.type) ? col.editType : col.type;
|
|
463
|
-
|
|
464
381
|
if (!realType) {
|
|
465
382
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
466
383
|
onDoubleClick: _this.onDoubleClick(col.key, record.key),
|
|
@@ -479,23 +396,18 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
479
396
|
title: value
|
|
480
397
|
}, value);
|
|
481
398
|
}
|
|
482
|
-
|
|
483
399
|
switch (realType) {
|
|
484
400
|
case 'checkbox':
|
|
485
401
|
return /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
|
|
486
402
|
onChange: _this.onCheck(col.key, record.key),
|
|
487
403
|
checked: value || false
|
|
488
404
|
});
|
|
489
|
-
|
|
490
405
|
case 'index':
|
|
491
406
|
return _this.getIndex(index) + 1;
|
|
492
|
-
|
|
493
407
|
case 'link':
|
|
494
408
|
return _this.renderLinkCell(col, value, record, record.key);
|
|
495
|
-
|
|
496
409
|
case 'button':
|
|
497
410
|
var onClick = _this.props.callback.onLink ? (0, _bind["default"])(_context3 = _this.props.callback.onLink).call(_context3, null, col.key, record.key, record) : undefined;
|
|
498
|
-
|
|
499
411
|
if (col.icon === 'add') {
|
|
500
412
|
return /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
|
501
413
|
onClick: onClick,
|
|
@@ -513,7 +425,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
513
425
|
type: col.bsStyle
|
|
514
426
|
}, record[col.key] || col.typeRelated);
|
|
515
427
|
}
|
|
516
|
-
|
|
517
428
|
case 'switch':
|
|
518
429
|
return typeof value === 'string' ? /*#__PURE__*/_react["default"].createElement("div", null, value) : /*#__PURE__*/_react["default"].createElement(_switch["default"], {
|
|
519
430
|
checkedChildren: col.props.checkedChildren || '',
|
|
@@ -523,10 +434,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
523
434
|
checked: typeof value === 'number' ? Boolean(value) : value || false,
|
|
524
435
|
disabled: !(record._isEdit === true)
|
|
525
436
|
});
|
|
526
|
-
|
|
527
437
|
case 'custom':
|
|
528
438
|
return _this.props.callback.onRenderCustom(record.key, col.key, value, col.props, col);
|
|
529
|
-
|
|
530
439
|
case 'toolbar':
|
|
531
440
|
//showByKey为true时,每条数据中与按钮key相同的属性值决定按钮是否显示,建议key用下划线开始命名,避免与后台数据冲突
|
|
532
441
|
var props = {
|
|
@@ -538,7 +447,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
538
447
|
})
|
|
539
448
|
};
|
|
540
449
|
return /*#__PURE__*/_react["default"].createElement(_SuperToolbar["default"], props);
|
|
541
|
-
|
|
542
450
|
case 'img':
|
|
543
451
|
return value ? typeof value === 'string' ? /*#__PURE__*/_react["default"].createElement("img", {
|
|
544
452
|
src: (0, _includes["default"])(value).call(value, 'http') ? value : (0, _concat["default"])(_context7 = "".concat(window.location.origin, "/api/proxy/file-center-service/")).call(_context7, value),
|
|
@@ -578,19 +486,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
578
486
|
color: '#333'
|
|
579
487
|
}
|
|
580
488
|
}, value.remark))) : /*#__PURE__*/_react["default"].createElement("div", null);
|
|
581
|
-
|
|
582
489
|
case 'uploadImg':
|
|
583
490
|
var commonProps = _this.props.callback.buildSuperUploadProps ? _this.props.callback.buildSuperUploadProps() : {};
|
|
584
|
-
|
|
585
491
|
var uploadProps = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
586
492
|
onFileChange: _this.props.callback.onTableFileChange ? (0, _bind["default"])(_context10 = _this.props.callback.onTableFileChange).call(_context10, null, col.key, index) : undefined,
|
|
587
493
|
type: col.type
|
|
588
494
|
}, col.props), _this.props), commonProps), {}, {
|
|
589
495
|
value: _this.props.items[index][col.key]
|
|
590
496
|
});
|
|
591
|
-
|
|
592
497
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], uploadProps);
|
|
593
|
-
|
|
594
498
|
default:
|
|
595
499
|
return _this.renderEditableCell(_objectSpread(_objectSpread({}, col), {}, {
|
|
596
500
|
type: realType
|
|
@@ -600,12 +504,10 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
600
504
|
});
|
|
601
505
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getCheckedStatus", function (key) {
|
|
602
506
|
var has = false,
|
|
603
|
-
|
|
507
|
+
not = false;
|
|
604
508
|
var items = _this.props.items;
|
|
605
|
-
|
|
606
509
|
var _iterator = _createForOfIteratorHelper(items),
|
|
607
|
-
|
|
608
|
-
|
|
510
|
+
_step;
|
|
609
511
|
try {
|
|
610
512
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
611
513
|
var item = _step.value;
|
|
@@ -616,7 +518,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
616
518
|
} finally {
|
|
617
519
|
_iterator.f();
|
|
618
520
|
}
|
|
619
|
-
|
|
620
521
|
return {
|
|
621
522
|
checked: has && !not,
|
|
622
523
|
indeterminate: has && not
|
|
@@ -625,7 +526,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
625
526
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toAdd", function (key, showAdd) {
|
|
626
527
|
if (showAdd) {
|
|
627
528
|
var onClick = _this.onAdd(key);
|
|
628
|
-
|
|
629
529
|
return /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
630
530
|
type: "plus-circle-o",
|
|
631
531
|
role: "add",
|
|
@@ -637,14 +537,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
637
537
|
});
|
|
638
538
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnTitle", function (_ref13) {
|
|
639
539
|
var required = _ref13.required,
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
540
|
+
title = _ref13.title,
|
|
541
|
+
type = _ref13.type,
|
|
542
|
+
key = _ref13.key,
|
|
543
|
+
showAdd = _ref13.showAdd;
|
|
645
544
|
if (type === 'checkbox') {
|
|
646
545
|
var status = _this.getCheckedStatus(key);
|
|
647
|
-
|
|
648
546
|
return /*#__PURE__*/_react["default"].createElement(_checkbox["default"], (0, _extends2["default"])({
|
|
649
547
|
onChange: _this.onCheck(key, -1)
|
|
650
548
|
}, status));
|
|
@@ -657,8 +555,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
657
555
|
});
|
|
658
556
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnClassName", function (_ref14) {
|
|
659
557
|
var type = _ref14.type,
|
|
660
|
-
|
|
661
|
-
|
|
558
|
+
align = _ref14.align;
|
|
662
559
|
if (type === 'index' || type === 'checkbox') {
|
|
663
560
|
return 'ant-table-selection-column';
|
|
664
561
|
} else {
|
|
@@ -667,33 +564,29 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
667
564
|
});
|
|
668
565
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "canReadonly", function (type) {
|
|
669
566
|
var _context11;
|
|
670
|
-
|
|
671
567
|
return !(0, _includes["default"])(_context11 = ['index', 'checkbox', 'link', 'button', 'switch', 'custom', 'img', 'toolbar', 'uploadImg']).call(_context11, type);
|
|
672
568
|
});
|
|
673
569
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumns", function (cols) {
|
|
674
570
|
var _context12;
|
|
675
|
-
|
|
676
571
|
var readonly = _this.props.readonly;
|
|
677
572
|
return (0, _map["default"])(_context12 = (0, _filter["default"])(cols).call(cols, function (col) {
|
|
678
573
|
return !col.hide;
|
|
679
574
|
})).call(_context12, function (_ref15, index) {
|
|
680
575
|
var _context13;
|
|
681
|
-
|
|
682
|
-
var col = (0, _extends2["default"])({}, _ref15);
|
|
576
|
+
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref15), _ref15));
|
|
683
577
|
col.className = _this.getColumnClassName(col);
|
|
684
578
|
col.title = _this.getColumnTitle(col);
|
|
685
579
|
col.dataIndex = col.key;
|
|
686
|
-
col.width = col.width ? col.width : (0, _includes["default"])(_context13 = ['index', 'checked']).call(_context13, col.key) ? 70 : col.type === 'img' ? 200 : 120;
|
|
580
|
+
col.width = col.width ? col.width : (0, _includes["default"])(_context13 = ['index', 'checked']).call(_context13, col.key) ? 70 : col.type === 'img' ? 200 : 120;
|
|
581
|
+
// const {props = {}} = col;
|
|
687
582
|
// const {edit = false} = props
|
|
688
583
|
// if (!(readonly || col.type === 'readonly') || !this.canReadonly(col.type)) {
|
|
689
584
|
// if ( !edit && ['text', 'number', 'select', 'date', 'search', 'readonly', 'textArea', 'selectSearch'].includes(col.type)){
|
|
690
585
|
// return col
|
|
691
586
|
// }
|
|
692
587
|
// }
|
|
693
|
-
|
|
694
588
|
col.readonly = readonly;
|
|
695
589
|
col.render = _this.getCellRender(col);
|
|
696
|
-
|
|
697
590
|
if (col.link) {
|
|
698
591
|
col.type = 'link';
|
|
699
592
|
col.render = _this.getCellRender(col);
|
|
@@ -707,7 +600,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
707
600
|
}
|
|
708
601
|
};
|
|
709
602
|
}
|
|
710
|
-
|
|
711
603
|
return col;
|
|
712
604
|
});
|
|
713
605
|
});
|
|
@@ -715,17 +607,14 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
715
607
|
return (0, _map["default"])(items).call(items, function (item, index) {
|
|
716
608
|
return (0, _reduce["default"])(cols).call(cols, function (result, _ref16) {
|
|
717
609
|
var _context14, _context15;
|
|
718
|
-
|
|
719
610
|
var key = _ref16.key,
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
611
|
+
type = _ref16.type,
|
|
612
|
+
options = _ref16.options;
|
|
723
613
|
if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || (0, _isArray["default"])(item.isReadonly) && !(0, _includes["default"])(_context14 = item.isReadonly).call(_context14, key)) || (0, _includes["default"])(_context15 = ['img', 'switch', 'custom', 'img', 'toolbar', 'uploadImg']).call(_context15, type)) {
|
|
724
614
|
result[key] = item[key];
|
|
725
615
|
} else {
|
|
726
616
|
result[key] = (0, _Control.getTitle)(item[key], options);
|
|
727
617
|
}
|
|
728
|
-
|
|
729
618
|
return result;
|
|
730
619
|
}, _objectSpread(_objectSpread({}, item), {}, {
|
|
731
620
|
key: index,
|
|
@@ -735,18 +624,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
735
624
|
});
|
|
736
625
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPropsByCheckbox", function () {
|
|
737
626
|
var _this$props2 = _this.props,
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
627
|
+
items = _this$props2.items,
|
|
628
|
+
_this$props2$isEmphas = _this$props2.isEmphasized,
|
|
629
|
+
isEmphasized = _this$props2$isEmphas === void 0 ? false : _this$props2$isEmphas;
|
|
742
630
|
var rowClassName = function rowClassName(record) {
|
|
743
631
|
if (isEmphasized && items[record.key].__isEmphasized) {
|
|
744
632
|
return items[record.key].checked ? (0, _variables["default"])('SuperTable2').emphasizedSelectRow : (0, _variables["default"])('SuperTable2').emphasizedUnselectRow;
|
|
745
633
|
}
|
|
746
|
-
|
|
747
634
|
return items[record.key].checked ? (0, _variables["default"])('SuperTable2').select : '';
|
|
748
635
|
};
|
|
749
|
-
|
|
750
636
|
return {
|
|
751
637
|
rowClassName: rowClassName
|
|
752
638
|
};
|
|
@@ -759,39 +645,33 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
759
645
|
});
|
|
760
646
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPropsByCheckbox2", function (items) {
|
|
761
647
|
var _this$props3 = _this.props,
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
648
|
+
_this$props3$checkbox = _this$props3.checkbox,
|
|
649
|
+
checkbox = _this$props3$checkbox === void 0 ? true : _this$props3$checkbox,
|
|
650
|
+
_this$props3$radio = _this$props3.radio,
|
|
651
|
+
radio = _this$props3$radio === void 0 ? false : _this$props3$radio,
|
|
652
|
+
isolation = _this$props3.isolation,
|
|
653
|
+
_this$props3$checkedR = _this$props3.checkedRows,
|
|
654
|
+
checkedRows = _this$props3$checkedR === void 0 ? [] : _this$props3$checkedR,
|
|
655
|
+
_this$props3$isEmphas = _this$props3.isEmphasized,
|
|
656
|
+
isEmphasized = _this$props3$isEmphas === void 0 ? false : _this$props3$isEmphas,
|
|
657
|
+
_this$props3$isWeaken = _this$props3.isWeaken,
|
|
658
|
+
isWeaken = _this$props3$isWeaken === void 0 ? true : _this$props3$isWeaken;
|
|
774
659
|
var rowClassName1 = function rowClassName1(record) {
|
|
775
660
|
if (items[record.key].__total) return (0, _variables["default"])('SuperTable').totalRow;
|
|
776
661
|
if (items[record.key].__warningRow) return (0, _variables["default"])('SuperTable').warningRow;
|
|
777
662
|
return (0, _includes["default"])(checkedRows).call(checkedRows, record.key) ? (0, _variables["default"])('SuperTable').select : '';
|
|
778
663
|
};
|
|
779
|
-
|
|
780
664
|
var rowClassName2 = function rowClassName2(record) {
|
|
781
665
|
if (items[record.key].__total) return (0, _variables["default"])('SuperTable').totalRow;
|
|
782
666
|
if (items[record.key].__warningRow) return (0, _variables["default"])('SuperTable').warningRow;
|
|
783
|
-
|
|
784
667
|
if (isEmphasized && items[record.key].__isEmphasized) {
|
|
785
668
|
return items[record.key].checked ? (0, _variables["default"])('SuperTable').emphasizedSelectRow : (0, _variables["default"])('SuperTable').emphasizedUnselectRow;
|
|
786
669
|
}
|
|
787
|
-
|
|
788
670
|
if (isWeaken && items[record.key].__isWeaken) {
|
|
789
671
|
return items[record.key].checked ? (0, _variables["default"])('SuperTable').weakenedSelectRow : (0, _variables["default"])('SuperTable').weakenedUnselectRow;
|
|
790
672
|
}
|
|
791
|
-
|
|
792
673
|
return items[record.key].checked ? (0, _variables["default"])('SuperTable').select : '';
|
|
793
674
|
};
|
|
794
|
-
|
|
795
675
|
if (checkbox) {
|
|
796
676
|
if (radio) {
|
|
797
677
|
return {
|
|
@@ -870,29 +750,27 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
870
750
|
});
|
|
871
751
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getProps", function () {
|
|
872
752
|
var _context16;
|
|
873
|
-
|
|
874
753
|
var _this$props4 = _this.props,
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
754
|
+
cols = _this$props4.cols,
|
|
755
|
+
items = _this$props4.items,
|
|
756
|
+
_this$props4$style = _this$props4.style,
|
|
757
|
+
style = _this$props4$style === void 0 ? {} : _this$props4$style,
|
|
758
|
+
_this$props4$footer = _this$props4.footer,
|
|
759
|
+
footer = _this$props4$footer === void 0 ? null : _this$props4$footer,
|
|
760
|
+
_this$props4$paginati = _this$props4.pagination,
|
|
761
|
+
pagination = _this$props4$paginati === void 0 ? false : _this$props4$paginati,
|
|
762
|
+
dragSort = _this$props4.dragSort,
|
|
763
|
+
_this$props4$isEmphas = _this$props4.isEmphasized,
|
|
764
|
+
isEmphasized = _this$props4$isEmphas === void 0 ? false : _this$props4$isEmphas,
|
|
765
|
+
maxHeight = _this$props4.maxHeight,
|
|
766
|
+
_this$props4$expanded = _this$props4.expandedRowRender,
|
|
767
|
+
expandedRowRender = _this$props4$expanded === void 0 ? undefined : _this$props4$expanded,
|
|
768
|
+
_this$props4$onExpand = _this$props4.onExpand,
|
|
769
|
+
onExpand = _this$props4$onExpand === void 0 ? undefined : _this$props4$onExpand;
|
|
891
770
|
var widthX = (0, _reduce["default"])(_context16 = (0, _filter["default"])(cols).call(cols, function (col) {
|
|
892
771
|
return !col.hide;
|
|
893
772
|
})).call(_context16, function (width, item) {
|
|
894
773
|
var _context17;
|
|
895
|
-
|
|
896
774
|
return width += item.width ? item.width : (0, _includes["default"])(_context17 = ['index', 'checked']).call(_context17, item.key) ? 70 : item.type === 'img' ? 200 : 120;
|
|
897
775
|
}, 0);
|
|
898
776
|
var scrollProps = !_helper["default"].isEmpty2(expandedRowRender) ? {
|
|
@@ -905,11 +783,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
905
783
|
y: maxHeight
|
|
906
784
|
}
|
|
907
785
|
};
|
|
908
|
-
|
|
909
786
|
var _this$getPropsByCheck = _this.getPropsByCheckbox2(items),
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
787
|
+
onRowClick = _this$getPropsByCheck.onRowClick,
|
|
788
|
+
extraProps = (0, _objectWithoutProperties2["default"])(_this$getPropsByCheck, _excluded);
|
|
913
789
|
return _objectSpread(_objectSpread({
|
|
914
790
|
className: !isEmphasized ? (0, _variables["default"])('SuperTable2') : (0, _variables["default"])('SuperTable2').noTransition,
|
|
915
791
|
columns: _this.getColumns(cols),
|
|
@@ -936,7 +812,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
936
812
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setScroll", function () {
|
|
937
813
|
if (_this.props.maxHeight && _this.props.items.length) {
|
|
938
814
|
var root = _reactDom["default"].findDOMNode((0, _assertThisInitialized2["default"])(_this));
|
|
939
|
-
|
|
940
815
|
var container = root.getElementsByClassName('ant-table-body')[0];
|
|
941
816
|
var header = root.getElementsByClassName('ant-table-thead')[0];
|
|
942
817
|
(0, _fixed["default"])(container, header, _this.props.maxHeight);
|
|
@@ -944,7 +819,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
944
819
|
});
|
|
945
820
|
return _this;
|
|
946
821
|
}
|
|
947
|
-
|
|
948
822
|
(0, _createClass2["default"])(SuperTable2, [{
|
|
949
823
|
key: "componentDidMount",
|
|
950
824
|
value: function componentDidMount() {
|
|
@@ -966,7 +840,6 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
966
840
|
}]);
|
|
967
841
|
return SuperTable2;
|
|
968
842
|
}(_react["default"].Component);
|
|
969
|
-
|
|
970
843
|
(0, _defineProperty2["default"])(SuperTable2, "propTypes", {
|
|
971
844
|
cols: _propTypes["default"].arrayOf(_propTypes["default"].shape(ColType)).isRequired,
|
|
972
845
|
items: _propTypes["default"].array.isRequired,
|