cloud-b2b 1.1.52 → 1.1.53
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 +141 -0
- package/es/Card/Card.js +19 -0
- package/es/CodeInput/CodeInput.js +123 -0
- package/es/Control/Control.js +444 -0
- package/es/Control/event.js +43 -0
- package/es/Enhance/Dialogs.js +52 -0
- package/es/Enhance/Loading.js +131 -0
- package/{src → es}/Enhance/index.js +6 -8
- package/es/Header/Header.js +162 -0
- package/es/Header/Vertical.js +106 -0
- package/es/ImageView/ImageView.js +100 -0
- package/es/Indent/Indent.js +19 -0
- package/es/InpurCascader/InputCascader.js +108 -0
- package/es/InputEditor/InputEditor.js +173 -0
- package/es/InputSearch/InputSearch.js +266 -0
- package/es/InputSelect/InputSelect.js +160 -0
- package/es/InputTreeSelect/InputTreeSelect.js +121 -0
- package/es/InputWriting/InputWriting.js +85 -0
- package/es/Layout/Layout.js +201 -0
- package/es/LayoutLink/LayoutLink.js +73 -0
- package/es/Link/Link.js +85 -0
- package/es/Loading/Loading.js +13 -0
- package/es/Loading2/Loading2.js +9 -0
- package/es/ModalWithDrag/ModalWithDrag.js +29 -0
- package/{src → es}/ModalWithDrag/drag.js +116 -128
- package/es/NumberInput/NumberInput.js +200 -0
- package/es/Search/Search.js +497 -0
- package/es/Sidebar/Sidebar.js +144 -0
- package/es/Sidebar2/Sidebar.js +165 -0
- package/es/SuperForm/SuperForm.js +593 -0
- package/es/SuperForm2/SuperForm.js +687 -0
- package/es/SuperIcon/SuperIcon.js +27 -0
- package/es/SuperPagination/SuperPagination.js +109 -0
- package/es/SuperTab/SuperTab.js +107 -0
- package/es/SuperTab2/SuperTab2.js +145 -0
- package/es/SuperTable/DragSortRow.js +97 -0
- package/es/SuperTable/FilterDropDown.js +164 -0
- package/es/SuperTable/SuperTable.js +808 -0
- package/es/SuperTable/fixed.js +34 -0
- package/es/SuperTable2/SuperTable2.js +894 -0
- package/es/SuperTable2/SuperTableCell.js +198 -0
- package/es/SuperTable3/FilterDropDown.js +164 -0
- package/es/SuperTable3/SuperTable.js +665 -0
- package/es/SuperTable3/fixed.js +34 -0
- package/es/SuperToolbar/SuperToolbar.js +195 -0
- package/es/SuperUpload/SuperUpload.js +356 -0
- package/es/Title/Title.js +33 -0
- package/es/Viewer/ImageViews.js +258 -0
- package/es/Viewer/Viewer.js +122 -0
- package/es/WingBlank/WingBlank.js +16 -0
- package/es/helper.js +240 -0
- package/{src → es}/history.js +6 -6
- package/es/index.js +37 -0
- package/es/variables.js +6 -0
- package/lib/Area/Area.js +149 -0
- package/lib/Area/package.json +6 -0
- package/lib/Card/Card.js +27 -0
- package/lib/Card/package.json +6 -0
- package/lib/CodeInput/CodeInput.js +131 -0
- package/lib/CodeInput/package.json +6 -0
- package/lib/Control/Control.js +450 -0
- package/lib/Control/event.js +51 -0
- package/lib/Control/package.json +6 -0
- package/lib/Enhance/Dialogs.js +60 -0
- package/lib/Enhance/Loading.js +138 -0
- package/lib/Enhance/index.js +25 -0
- package/lib/Enhance/package.json +6 -0
- package/lib/Header/Header.js +169 -0
- package/lib/Header/Header.less +95 -0
- package/lib/Header/Vertical.js +114 -0
- package/lib/Header/Vertical.less +60 -0
- package/lib/Header/package.json +6 -0
- package/lib/ImageView/ImageView.js +108 -0
- package/lib/ImageView/ImageView.less +14 -0
- package/lib/ImageView/package.json +6 -0
- package/lib/Indent/Indent.js +27 -0
- package/lib/Indent/package.json +6 -0
- package/lib/InpurCascader/InputCascader.js +115 -0
- package/lib/InpurCascader/package.json +6 -0
- package/lib/InputEditor/InputEditor.js +181 -0
- package/lib/InputEditor/inputEditor.less +8 -0
- package/lib/InputEditor/package.json +6 -0
- package/lib/InputSearch/InputSearch.js +274 -0
- package/lib/InputSearch/package.json +6 -0
- package/lib/InputSelect/InputSelect.js +168 -0
- package/lib/InputSelect/package.json +6 -0
- package/lib/InputTreeSelect/InputTreeSelect.js +128 -0
- package/lib/InputTreeSelect/package.json +6 -0
- package/lib/InputWriting/InputWriting.js +93 -0
- package/lib/InputWriting/package.json +6 -0
- package/lib/Layout/Layout.js +209 -0
- package/lib/Layout/Layout.less +28 -0
- package/lib/Layout/package.json +6 -0
- package/lib/LayoutLink/LayoutLink.js +86 -0
- package/lib/LayoutLink/LayoutLink.less +53 -0
- package/lib/LayoutLink/package.json +6 -0
- package/lib/Link/Link.js +93 -0
- package/lib/Link/package.json +6 -0
- package/lib/Loading/Loading.js +21 -0
- package/lib/Loading/Loading.less +13 -0
- package/lib/Loading/package.json +6 -0
- package/lib/Loading2/Loading2.js +17 -0
- package/lib/Loading2/Loading2.less +19 -0
- package/lib/Loading2/package.json +6 -0
- package/lib/ModalWithDrag/ModalWithDrag.js +37 -0
- package/lib/ModalWithDrag/ModalWithDrag.less +6 -0
- package/lib/ModalWithDrag/drag.js +124 -0
- package/lib/ModalWithDrag/package.json +6 -0
- package/lib/NumberInput/NumberInput.js +208 -0
- package/lib/NumberInput/package.json +6 -0
- package/lib/Search/Search.js +510 -0
- package/lib/Search/Search.less +63 -0
- package/lib/Search/package.json +6 -0
- package/lib/Sidebar/Sidebar.js +152 -0
- package/lib/Sidebar/Sidebar.less +78 -0
- package/lib/Sidebar/package.json +6 -0
- package/lib/Sidebar2/Sidebar.js +173 -0
- package/lib/Sidebar2/Sidebar.less +153 -0
- package/lib/Sidebar2/package.json +6 -0
- package/lib/SuperForm/SuperForm.js +605 -0
- package/lib/SuperForm/SuperForm.less +52 -0
- package/lib/SuperForm/package.json +6 -0
- package/lib/SuperForm2/SuperForm.js +699 -0
- package/lib/SuperForm2/SuperForm.less +52 -0
- package/lib/SuperForm2/package.json +6 -0
- package/lib/SuperIcon/SuperIcon.js +35 -0
- package/lib/SuperIcon/package.json +6 -0
- package/lib/SuperPagination/SuperPagination.js +117 -0
- package/lib/SuperPagination/package.json +6 -0
- package/lib/SuperTab/SuperTab.js +115 -0
- package/lib/SuperTab/SuperTab.less +43 -0
- package/lib/SuperTab/package.json +6 -0
- package/lib/SuperTab2/SuperTab2.js +153 -0
- package/lib/SuperTab2/SuperTab2.less +18 -0
- package/lib/SuperTab2/package.json +6 -0
- package/lib/SuperTable/DragSortRow.js +105 -0
- package/lib/SuperTable/DragSortRow.less +17 -0
- package/lib/SuperTable/FilterDropDown.js +172 -0
- package/lib/SuperTable/FilterDropDown.less +30 -0
- package/lib/SuperTable/SuperTable.js +816 -0
- package/lib/SuperTable/SuperTable.less +132 -0
- package/lib/SuperTable/fixed.js +42 -0
- package/lib/SuperTable/package.json +6 -0
- package/lib/SuperTable2/SuperTable2.js +907 -0
- package/lib/SuperTable2/SuperTable2.less +118 -0
- package/lib/SuperTable2/SuperTableCell.js +203 -0
- package/lib/SuperTable2/package.json +6 -0
- package/lib/SuperTable3/FilterDropDown.js +172 -0
- package/lib/SuperTable3/FilterDropDown.less +29 -0
- package/lib/SuperTable3/SuperTable.js +673 -0
- package/lib/SuperTable3/SuperTable.less +99 -0
- package/lib/SuperTable3/fixed.js +42 -0
- package/lib/SuperTable3/package.json +6 -0
- package/lib/SuperToolbar/SuperToolbar.js +203 -0
- package/lib/SuperToolbar/SuperToolbar.less +17 -0
- package/lib/SuperToolbar/package.json +6 -0
- package/lib/SuperUpload/SuperUpload.js +368 -0
- package/lib/SuperUpload/SuperUpload.less +28 -0
- package/lib/SuperUpload/package.json +6 -0
- package/lib/Title/Title.js +41 -0
- package/lib/Title/Title.less +35 -0
- package/lib/Title/package.json +6 -0
- package/lib/Viewer/ImageViews.js +266 -0
- package/lib/Viewer/Viewer.js +130 -0
- package/lib/Viewer/Viewer.less +67 -0
- package/lib/Viewer/imgView.less +59 -0
- package/lib/Viewer/package.json +7 -0
- package/lib/WingBlank/WingBlank.js +24 -0
- package/lib/WingBlank/WingBlank.less +12 -0
- package/lib/WingBlank/package.json +6 -0
- package/lib/adjust.less +89 -0
- package/lib/helper.js +246 -0
- package/lib/history.js +12 -0
- package/lib/index.js +271 -0
- package/lib/index.less +31 -0
- package/lib/style.less +30 -0
- package/lib/variables.js +14 -0
- package/lib/variables.less +73 -0
- package/package.json +22 -44
- package/src/Area/Area.js +0 -94
- package/src/Card/Card.js +0 -16
- package/src/CodeInput/CodeInput.js +0 -76
- package/src/Control/Control.js +0 -338
- package/src/Control/event.js +0 -45
- package/src/Enhance/Dialogs.js +0 -24
- package/src/Enhance/Loading.js +0 -83
- package/src/Header/Header.js +0 -149
- package/src/Header/Vertical.js +0 -74
- package/src/ImageView/ImageView.js +0 -62
- package/src/Indent/Indent.js +0 -12
- package/src/InpurCascader/InputCascader.js +0 -83
- package/src/InputEditor/InputEditor.js +0 -93
- package/src/InputSearch/InputSearch.js +0 -186
- package/src/InputSelect/InputSelect.js +0 -103
- package/src/InputTreeSelect/InputTreeSelect.js +0 -87
- package/src/InputWriting/InputWriting.js +0 -65
- package/src/Layout/Layout.js +0 -121
- package/src/LayoutLink/LayoutLink.js +0 -59
- package/src/Link/Link.js +0 -57
- package/src/Loading/Loading.js +0 -15
- package/src/Loading2/Loading2.js +0 -15
- package/src/ModalWithDrag/ModalWithDrag.js +0 -17
- package/src/NumberInput/NumberInput.js +0 -137
- package/src/Search/Search.js +0 -368
- package/src/Sidebar/Sidebar.js +0 -111
- package/src/Sidebar2/Sidebar.js +0 -143
- package/src/SuperForm/SuperForm.js +0 -516
- package/src/SuperForm2/SuperForm.js +0 -588
- package/src/SuperIcon/SuperIcon.js +0 -14
- package/src/SuperPagination/SuperPagination.js +0 -65
- package/src/SuperTab/SuperTab.js +0 -84
- package/src/SuperTab2/SuperTab2.js +0 -94
- package/src/SuperTable/DragSortRow.js +0 -62
- package/src/SuperTable/FilterDropDown.js +0 -111
- package/src/SuperTable/SuperTable.js +0 -590
- package/src/SuperTable/fixed.js +0 -34
- package/src/SuperTable2/SuperTable2.js +0 -600
- package/src/SuperTable2/SuperTableCell.js +0 -144
- package/src/SuperTable3/FilterDropDown.js +0 -111
- package/src/SuperTable3/SuperTable.js +0 -498
- package/src/SuperTable3/fixed.js +0 -34
- package/src/SuperToolbar/SuperToolbar.js +0 -128
- package/src/SuperUpload/SuperUpload.js +0 -137
- package/src/Title/Title.js +0 -18
- package/src/Viewer/ImageViews.js +0 -220
- package/src/Viewer/Viewer.js +0 -97
- package/src/WingBlank/WingBlank.js +0 -14
- package/src/helper.js +0 -185
- package/src/index.js +0 -38
- package/src/variables.js +0 -5
- package/test/index.html +0 -10
- package/test/test.js +0 -16
- package/test/test.less +0 -12
- package/test/webpack.config.js +0 -71
- package/tools/babel.config.js +0 -14
- package/tools/build.js +0 -70
- package/tools/publish.js +0 -9
- package/tools/util.js +0 -53
- /package/{src → es}/Area/package.json +0 -0
- /package/{src → es}/Card/package.json +0 -0
- /package/{src → es}/CodeInput/package.json +0 -0
- /package/{src → es}/Control/package.json +0 -0
- /package/{src → es}/Enhance/package.json +0 -0
- /package/{src → es}/Header/Header.less +0 -0
- /package/{src → es}/Header/Vertical.less +0 -0
- /package/{src → es}/Header/package.json +0 -0
- /package/{src → es}/ImageView/ImageView.less +0 -0
- /package/{src → es}/ImageView/package.json +0 -0
- /package/{src → es}/Indent/package.json +0 -0
- /package/{src → es}/InpurCascader/package.json +0 -0
- /package/{src → es}/InputEditor/inputEditor.less +0 -0
- /package/{src → es}/InputEditor/package.json +0 -0
- /package/{src → es}/InputSearch/package.json +0 -0
- /package/{src → es}/InputSelect/package.json +0 -0
- /package/{src → es}/InputTreeSelect/package.json +0 -0
- /package/{src → es}/InputWriting/package.json +0 -0
- /package/{src → es}/Layout/Layout.less +0 -0
- /package/{src → es}/Layout/package.json +0 -0
- /package/{src → es}/LayoutLink/LayoutLink.less +0 -0
- /package/{src → es}/LayoutLink/package.json +0 -0
- /package/{src → es}/Link/package.json +0 -0
- /package/{src → es}/Loading/Loading.less +0 -0
- /package/{src → es}/Loading/package.json +0 -0
- /package/{src → es}/Loading2/Loading2.less +0 -0
- /package/{src → es}/Loading2/package.json +0 -0
- /package/{src → es}/ModalWithDrag/ModalWithDrag.less +0 -0
- /package/{src → es}/ModalWithDrag/package.json +0 -0
- /package/{src → es}/NumberInput/package.json +0 -0
- /package/{src → es}/Search/Search.less +0 -0
- /package/{src → es}/Search/package.json +0 -0
- /package/{src → es}/Sidebar/Sidebar.less +0 -0
- /package/{src → es}/Sidebar/package.json +0 -0
- /package/{src → es}/Sidebar2/Sidebar.less +0 -0
- /package/{src → es}/Sidebar2/package.json +0 -0
- /package/{src → es}/SuperForm/SuperForm.less +0 -0
- /package/{src → es}/SuperForm/package.json +0 -0
- /package/{src → es}/SuperForm2/SuperForm.less +0 -0
- /package/{src → es}/SuperForm2/package.json +0 -0
- /package/{src → es}/SuperIcon/package.json +0 -0
- /package/{src → es}/SuperPagination/package.json +0 -0
- /package/{src → es}/SuperTab/SuperTab.less +0 -0
- /package/{src → es}/SuperTab/package.json +0 -0
- /package/{src → es}/SuperTab2/SuperTab2.less +0 -0
- /package/{src → es}/SuperTab2/package.json +0 -0
- /package/{src → es}/SuperTable/DragSortRow.less +0 -0
- /package/{src → es}/SuperTable/FilterDropDown.less +0 -0
- /package/{src → es}/SuperTable/SuperTable.less +0 -0
- /package/{src → es}/SuperTable/package.json +0 -0
- /package/{src → es}/SuperTable2/SuperTable2.less +0 -0
- /package/{src → es}/SuperTable2/package.json +0 -0
- /package/{src → es}/SuperTable3/FilterDropDown.less +0 -0
- /package/{src → es}/SuperTable3/SuperTable.less +0 -0
- /package/{src → es}/SuperTable3/package.json +0 -0
- /package/{src → es}/SuperToolbar/SuperToolbar.less +0 -0
- /package/{src → es}/SuperToolbar/package.json +0 -0
- /package/{src → es}/SuperUpload/SuperUpload.less +0 -0
- /package/{src → es}/SuperUpload/package.json +0 -0
- /package/{src → es}/Title/Title.less +0 -0
- /package/{src → es}/Title/package.json +0 -0
- /package/{src → es}/Viewer/Viewer.less +0 -0
- /package/{src → es}/Viewer/imgView.less +0 -0
- /package/{src → es}/Viewer/package.json +0 -0
- /package/{src → es}/WingBlank/WingBlank.less +0 -0
- /package/{src → es}/WingBlank/package.json +0 -0
- /package/{src → es}/adjust.less +0 -0
- /package/{src → es}/style.less +0 -0
- /package/{src → es}/variables.less +0 -0
|
@@ -0,0 +1,907 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
|
4
|
+
var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
|
|
5
|
+
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
6
|
+
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
|
7
|
+
var _filterInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
8
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
9
|
+
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
10
|
+
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
|
11
|
+
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
|
12
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
13
|
+
var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/slice");
|
|
14
|
+
var _Array$from = require("@babel/runtime-corejs3/core-js-stable/array/from");
|
|
15
|
+
var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol");
|
|
16
|
+
var _getIteratorMethod = require("@babel/runtime-corejs3/core-js/get-iterator-method");
|
|
17
|
+
var _Array$isArray2 = require("@babel/runtime-corejs3/core-js-stable/array/is-array");
|
|
18
|
+
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
|
19
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
20
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
exports["default"] = void 0;
|
|
24
|
+
var _table = _interopRequireDefault(require("antd/lib/table"));
|
|
25
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
|
26
|
+
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
27
|
+
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
28
|
+
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
29
|
+
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
30
|
+
var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
|
|
31
|
+
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
32
|
+
var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
|
|
33
|
+
var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
|
34
|
+
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
35
|
+
var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectDestructuringEmpty"));
|
|
36
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
37
|
+
var _switch = _interopRequireDefault(require("antd/lib/switch"));
|
|
38
|
+
var _button = _interopRequireDefault(require("antd/lib/button"));
|
|
39
|
+
var _checkbox = _interopRequireDefault(require("antd/lib/checkbox"));
|
|
40
|
+
var _icon = _interopRequireDefault(require("antd/lib/icon"));
|
|
41
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
42
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
43
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
44
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
45
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
46
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
47
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
48
|
+
var _react = _interopRequireDefault(require("react"));
|
|
49
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
50
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
51
|
+
var _Control = _interopRequireWildcard(require("../Control"));
|
|
52
|
+
var _SuperTableCell = _interopRequireDefault(require("./SuperTableCell"));
|
|
53
|
+
var _fixed = _interopRequireDefault(require("../SuperTable/fixed"));
|
|
54
|
+
var _SuperToolbar = _interopRequireDefault(require("../SuperToolbar"));
|
|
55
|
+
var _variables = _interopRequireDefault(require("../variables"));
|
|
56
|
+
var _helper = _interopRequireWildcard(require("../helper"));
|
|
57
|
+
var _DragSortRow = _interopRequireDefault(require("../SuperTable/DragSortRow"));
|
|
58
|
+
var _excluded = ["onRowClick"];
|
|
59
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
60
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
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; } } }; }
|
|
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); }
|
|
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; }
|
|
64
|
+
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty2(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
65
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context18, _context19; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context18 = ownKeys(Object(t), !0)).call(_context18, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context19 = ownKeys(Object(t))).call(_context19, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
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); }; }
|
|
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; } }
|
|
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}时显示图片标题 为字符串时 只显示图片
|
|
78
|
+
'uploadImg', 'double'];
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* key:标识所在列,在一个表格中必须唯一
|
|
82
|
+
* title:列的标题,type为checkbox时,title为空字符串时,表头才会显示为复选框
|
|
83
|
+
* type:嵌入的表单元素类型
|
|
84
|
+
* link: 是否为超链接,type未设置时,该属性才生效。为true表示内容来至items,为字符串表示超链接内容就是该字符串
|
|
85
|
+
* options: 对象(包含value和title)数组
|
|
86
|
+
* props:传递参数给被嵌入的组件
|
|
87
|
+
* width: 嵌入的组件的宽度,默认值为100
|
|
88
|
+
* align:对齐方式,index默认center,其他类型默认为left
|
|
89
|
+
* showAdd: 表头是否显示+号,默认为false,加号会触发onAdd事件
|
|
90
|
+
* hide: 为true时隐藏该列
|
|
91
|
+
*/
|
|
92
|
+
var ColType = {
|
|
93
|
+
key: _propTypes["default"].string.isRequired,
|
|
94
|
+
title: _propTypes["default"].string.isRequired,
|
|
95
|
+
type: _propTypes["default"].oneOf(TypeEnum),
|
|
96
|
+
link: _propTypes["default"].oneOfType([_propTypes["default"].bool, _propTypes["default"].string]),
|
|
97
|
+
align: _propTypes["default"].oneOf(['left', 'center', 'right']),
|
|
98
|
+
width: _propTypes["default"].number,
|
|
99
|
+
options: _propTypes["default"].array,
|
|
100
|
+
showAdd: _propTypes["default"].any,
|
|
101
|
+
hide: _propTypes["default"].bool,
|
|
102
|
+
props: _propTypes["default"].any
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* onCheck:点击复选框时触发,原型func(rowIndex, keyName, checked)
|
|
107
|
+
* onContentChange: 输入框内容改变时触发,原型为function(rowIndex, keyName, value)
|
|
108
|
+
* onBlur: 输入框失去焦点时触发,原型为function(rowIndex, keyName, value)
|
|
109
|
+
* onSearch:search组件输入内容时触发,原型为function(rowIndex, keyName, value, col)
|
|
110
|
+
* onLink: 点击超链接时触发,原型为function(keyName, rowIndex, item)
|
|
111
|
+
* onAdd:点击+号时触发,原型为function(keyName)
|
|
112
|
+
* onRenderCustom:(废弃)用于渲染type为custom类型的单元格,原型为function(rowIndex, keyName, value,props)
|
|
113
|
+
* onToolbar:点击表格列按钮组时触发,原型为function(按钮组列的key,rowIndex,该行数据的值,按钮key);
|
|
114
|
+
* onDoubleClick: 双击单元格触发(只针对于type类型为空的情况下)
|
|
115
|
+
*/
|
|
116
|
+
var CallbackType = {
|
|
117
|
+
onExitValid: _propTypes["default"].func,
|
|
118
|
+
onCheck: _propTypes["default"].func,
|
|
119
|
+
onContentChange: _propTypes["default"].func,
|
|
120
|
+
onBlur: _propTypes["default"].func,
|
|
121
|
+
onSearch: _propTypes["default"].func,
|
|
122
|
+
onLink: _propTypes["default"].func,
|
|
123
|
+
onAdd: _propTypes["default"].func,
|
|
124
|
+
onRenderCustom: _propTypes["default"].func,
|
|
125
|
+
onToolbar: _propTypes["default"].func,
|
|
126
|
+
onDoubleClick: _propTypes["default"].func,
|
|
127
|
+
onTableFileChange: _propTypes["default"].func,
|
|
128
|
+
buildSuperUploadProps: _propTypes["default"].func,
|
|
129
|
+
//构建type===uploadImg时,SuperUpload组件需要的公共属性函数,已在项目公共文件state.js中提供,可直接引用
|
|
130
|
+
onImgTileClick: _propTypes["default"].func,
|
|
131
|
+
//点击img类型标题触发事件
|
|
132
|
+
onMoveRow: _propTypes["default"].func
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* base[可选]:序号的开始数字,所有回调函数中的序号值都会加上这个值,默认值为0
|
|
137
|
+
* isEmphasized: [可选],是否强调,行字体加粗显示, 除了isEmphasized设置为true之外,加粗行数据里要设置__isEmphasized为true
|
|
138
|
+
*/
|
|
139
|
+
var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
140
|
+
(0, _inherits2["default"])(SuperTable2, _React$Component);
|
|
141
|
+
var _super = _createSuper(SuperTable2);
|
|
142
|
+
function SuperTable2() {
|
|
143
|
+
var _context;
|
|
144
|
+
var _this;
|
|
145
|
+
(0, _classCallCheck2["default"])(this, SuperTable2);
|
|
146
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
147
|
+
args[_key] = arguments[_key];
|
|
148
|
+
}
|
|
149
|
+
_this = _super.call.apply(_super, (0, _concat["default"])(_context = [this]).call(_context, args));
|
|
150
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSwitch", function (key, rowIndex) {
|
|
151
|
+
return function (value) {
|
|
152
|
+
var _ref = _this.props.callback || {},
|
|
153
|
+
onContentChange = _ref.onContentChange;
|
|
154
|
+
onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
|
|
155
|
+
};
|
|
156
|
+
});
|
|
157
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onCheck", function (key, rowIndex) {
|
|
158
|
+
return function (e) {
|
|
159
|
+
var _ref2 = _this.props.callback || {},
|
|
160
|
+
onCheck = _ref2.onCheck;
|
|
161
|
+
onCheck && onCheck(_this.getIndex(rowIndex), key, e.target.checked);
|
|
162
|
+
};
|
|
163
|
+
});
|
|
164
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (key, rowIndex) {
|
|
165
|
+
return function (value) {
|
|
166
|
+
var _ref3 = _this.props.callback || {},
|
|
167
|
+
onContentChange = _ref3.onContentChange;
|
|
168
|
+
_this.closeValid();
|
|
169
|
+
onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
|
|
170
|
+
};
|
|
171
|
+
});
|
|
172
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDoubleChange1", function (key, rowIndex) {
|
|
173
|
+
return function (doublekey, value) {
|
|
174
|
+
var _ref4 = _this.props.callback || {},
|
|
175
|
+
onContentChange = _ref4.onContentChange;
|
|
176
|
+
_this.closeValid();
|
|
177
|
+
onContentChange && onContentChange(_this.getIndex(rowIndex), doublekey, value);
|
|
178
|
+
};
|
|
179
|
+
});
|
|
180
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSearch", function (key, rowIndex, config) {
|
|
181
|
+
return function (value) {
|
|
182
|
+
var _ref5 = _this.props.callback || {},
|
|
183
|
+
onSearch = _ref5.onSearch;
|
|
184
|
+
onSearch && onSearch(_this.getIndex(rowIndex), key, value, config);
|
|
185
|
+
};
|
|
186
|
+
});
|
|
187
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onAdd", function (key) {
|
|
188
|
+
return function () {
|
|
189
|
+
var _ref6 = _this.props.callback || {},
|
|
190
|
+
onAdd = _ref6.onAdd;
|
|
191
|
+
onAdd && onAdd(key);
|
|
192
|
+
};
|
|
193
|
+
});
|
|
194
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRowAdd", function (key, index) {
|
|
195
|
+
return function () {
|
|
196
|
+
var _ref7 = _this.props.callback || {},
|
|
197
|
+
onLink = _ref7.onLink;
|
|
198
|
+
onLink && onLink(key, index, _this.props.items[index]);
|
|
199
|
+
};
|
|
200
|
+
});
|
|
201
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onBlur", function (key, rowIndex) {
|
|
202
|
+
return function (value) {
|
|
203
|
+
var _ref8 = _this.props.callback || {},
|
|
204
|
+
onBlur = _ref8.onBlur;
|
|
205
|
+
_this.closeValid();
|
|
206
|
+
onBlur && onBlur(_this.getIndex(rowIndex), key, value);
|
|
207
|
+
};
|
|
208
|
+
});
|
|
209
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDoubleClick", function (key, value) {
|
|
210
|
+
return function () {
|
|
211
|
+
var _ref9 = _this.props.callback || {},
|
|
212
|
+
onDoubleClick = _ref9.onDoubleClick;
|
|
213
|
+
onDoubleClick && onDoubleClick(key, value);
|
|
214
|
+
};
|
|
215
|
+
});
|
|
216
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onImgTileClick", function (col, value, rowIndex) {
|
|
217
|
+
return function () {
|
|
218
|
+
var _ref10 = _this.props.callback || {},
|
|
219
|
+
onImgTileClick = _ref10.onImgTileClick;
|
|
220
|
+
onImgTileClick && onImgTileClick(col, value, rowIndex);
|
|
221
|
+
};
|
|
222
|
+
});
|
|
223
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onMoveRow", function (dragIndex, targetIndex) {
|
|
224
|
+
var _ref11 = _this.props.callback || {},
|
|
225
|
+
onMoveRow = _ref11.onMoveRow;
|
|
226
|
+
onMoveRow && onMoveRow(dragIndex, targetIndex);
|
|
227
|
+
});
|
|
228
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "closeValid", function () {
|
|
229
|
+
var _this$props = _this.props,
|
|
230
|
+
valid = _this$props.valid,
|
|
231
|
+
_this$props$callback = _this$props.callback,
|
|
232
|
+
callback = _this$props$callback === void 0 ? {} : _this$props$callback;
|
|
233
|
+
valid && callback.onExitValid();
|
|
234
|
+
});
|
|
235
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getOptions", function (key, colOptions, index) {
|
|
236
|
+
var options = _this.props.items[index].options;
|
|
237
|
+
var options2 = _this.props.options;
|
|
238
|
+
if (options && (0, _isArray["default"])(options[key])) {
|
|
239
|
+
return options[key];
|
|
240
|
+
} else if (options2 && (0, _isArray["default"])(options2[key])) {
|
|
241
|
+
return options2[key];
|
|
242
|
+
} else {
|
|
243
|
+
return colOptions;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "validField", function (required, value) {
|
|
247
|
+
if (!_this.props.valid || _this.error || !required || value) {
|
|
248
|
+
return false;
|
|
249
|
+
} else if (typeof value === 'number') {
|
|
250
|
+
return false;
|
|
251
|
+
} else {
|
|
252
|
+
_this.error = true;
|
|
253
|
+
return true;
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderEditableCell", function (config, value, index) {
|
|
257
|
+
var key = config.key,
|
|
258
|
+
type = config.type,
|
|
259
|
+
options = config.options,
|
|
260
|
+
props = config.props,
|
|
261
|
+
required = config.required,
|
|
262
|
+
width = config.width,
|
|
263
|
+
showRowAdd = config.showRowAdd;
|
|
264
|
+
var _this$props$items$ind = _this.props.items[index],
|
|
265
|
+
readonly = _this$props$items$ind.readonly,
|
|
266
|
+
_this$props$items$ind2 = _this$props$items$ind.isReadonly,
|
|
267
|
+
isReadonly = _this$props$items$ind2 === void 0 ? [] : _this$props$items$ind2,
|
|
268
|
+
_this$props$items$ind3 = _this$props$items$ind.isRequired,
|
|
269
|
+
isRequired = _this$props$items$ind3 === void 0 ? [] : _this$props$items$ind3,
|
|
270
|
+
_this$props$items$ind4 = _this$props$items$ind._extraProps,
|
|
271
|
+
_extraProps = _this$props$items$ind4 === void 0 ? {} : _this$props$items$ind4;
|
|
272
|
+
var cellProps = {
|
|
273
|
+
value: value,
|
|
274
|
+
width: width,
|
|
275
|
+
items: _this.props.items[index],
|
|
276
|
+
type: readonly || (0, _isArray["default"])(isReadonly) && (0, _includes["default"])(isReadonly).call(isReadonly, key) || _this.props.readonly ? 'readonly' : type,
|
|
277
|
+
props: readonly ? {} : props,
|
|
278
|
+
error: _this.validField(required, value),
|
|
279
|
+
options: _this.getOptions(key, options, index),
|
|
280
|
+
onChange: _this.onChange(key, index),
|
|
281
|
+
onSearch: _this.onSearch(key, index, config),
|
|
282
|
+
onBlur: _this.onBlur(key, index)
|
|
283
|
+
};
|
|
284
|
+
if (showRowAdd && (0, _isArray["default"])(isRequired) && (0, _includes["default"])(isRequired).call(isRequired, key)) {
|
|
285
|
+
cellProps.error = _this.validField(true, value);
|
|
286
|
+
cellProps.props = _objectSpread(_objectSpread({}, cellProps.props), _extraProps);
|
|
287
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
288
|
+
style: {
|
|
289
|
+
color: 'red',
|
|
290
|
+
display: 'inline-block'
|
|
291
|
+
}
|
|
292
|
+
}, "*"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
293
|
+
style: {
|
|
294
|
+
marginLeft: '5px',
|
|
295
|
+
display: 'inline-block',
|
|
296
|
+
width: 'calc(100% - 12px)'
|
|
297
|
+
}
|
|
298
|
+
}, /*#__PURE__*/_react["default"].createElement(_SuperTableCell["default"], cellProps)), /*#__PURE__*/_react["default"].createElement("span", {
|
|
299
|
+
style: {
|
|
300
|
+
color: '#2196f3',
|
|
301
|
+
verticalAlign: 'super'
|
|
302
|
+
}
|
|
303
|
+
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
304
|
+
type: "plus-circle-o",
|
|
305
|
+
role: "add",
|
|
306
|
+
onClick: _this.onRowAdd(key, index)
|
|
307
|
+
})));
|
|
308
|
+
}
|
|
309
|
+
if ((0, _isArray["default"])(isRequired) && (0, _includes["default"])(isRequired).call(isRequired, key)) {
|
|
310
|
+
cellProps.error = _this.validField(true, value);
|
|
311
|
+
cellProps.props = _objectSpread(_objectSpread({}, cellProps.props), _extraProps);
|
|
312
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
313
|
+
style: {
|
|
314
|
+
color: 'red',
|
|
315
|
+
display: 'inline-block'
|
|
316
|
+
}
|
|
317
|
+
}, "*"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
318
|
+
style: {
|
|
319
|
+
marginLeft: '5px',
|
|
320
|
+
display: 'inline-block',
|
|
321
|
+
width: 'calc(100% - 12px)'
|
|
322
|
+
}
|
|
323
|
+
}, /*#__PURE__*/_react["default"].createElement(_SuperTableCell["default"], cellProps)));
|
|
324
|
+
}
|
|
325
|
+
if (showRowAdd) {
|
|
326
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
327
|
+
style: {
|
|
328
|
+
clear: 'both'
|
|
329
|
+
}
|
|
330
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
331
|
+
style: {
|
|
332
|
+
marginRight: '5px',
|
|
333
|
+
"float": 'left'
|
|
334
|
+
}
|
|
335
|
+
}, /*#__PURE__*/_react["default"].createElement(_SuperTableCell["default"], cellProps)), /*#__PURE__*/_react["default"].createElement("span", {
|
|
336
|
+
style: {
|
|
337
|
+
color: '#2196f3',
|
|
338
|
+
verticalAlign: 'middle'
|
|
339
|
+
}
|
|
340
|
+
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
341
|
+
type: "plus-circle-o",
|
|
342
|
+
role: "add",
|
|
343
|
+
onClick: _this.onRowAdd(key, index)
|
|
344
|
+
})));
|
|
345
|
+
}
|
|
346
|
+
return /*#__PURE__*/_react["default"].createElement(_SuperTableCell["default"], cellProps);
|
|
347
|
+
});
|
|
348
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderDoubleEditableCell", function (config, value, index) {
|
|
349
|
+
var key = config.key,
|
|
350
|
+
type = config.type,
|
|
351
|
+
options = config.options,
|
|
352
|
+
props = config.props,
|
|
353
|
+
required = config.required,
|
|
354
|
+
width = config.width,
|
|
355
|
+
showRowAdd = config.showRowAdd;
|
|
356
|
+
var _this$props$items$ind5 = _this.props.items[index],
|
|
357
|
+
readonly = _this$props$items$ind5.readonly,
|
|
358
|
+
_this$props$items$ind6 = _this$props$items$ind5.isReadonly,
|
|
359
|
+
isReadonly = _this$props$items$ind6 === void 0 ? [] : _this$props$items$ind6,
|
|
360
|
+
_this$props$items$ind7 = _this$props$items$ind5.isRequired,
|
|
361
|
+
isRequired = _this$props$items$ind7 === void 0 ? [] : _this$props$items$ind7,
|
|
362
|
+
_this$props$items$ind8 = _this$props$items$ind5._extraProps,
|
|
363
|
+
_extraProps = _this$props$items$ind8 === void 0 ? {} : _this$props$items$ind8;
|
|
364
|
+
var cellProps = {
|
|
365
|
+
value: value,
|
|
366
|
+
width: width,
|
|
367
|
+
items: _this.props.items[index],
|
|
368
|
+
type: readonly || (0, _isArray["default"])(isReadonly) && (0, _includes["default"])(isReadonly).call(isReadonly, key) || _this.props.readonly ? 'readonly' : type,
|
|
369
|
+
props: readonly ? {} : props,
|
|
370
|
+
error: _this.validField(required, value),
|
|
371
|
+
options: _this.getOptions(key, options, index),
|
|
372
|
+
onChange: _this.onDoubleChange1(key, index),
|
|
373
|
+
onSearch: _this.onSearch(key, index, config),
|
|
374
|
+
onBlur: _this.onBlur(key, index)
|
|
375
|
+
};
|
|
376
|
+
return /*#__PURE__*/_react["default"].createElement(_SuperTableCell["default"], cellProps);
|
|
377
|
+
});
|
|
378
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderLinkCell", function (col, value, record, index) {
|
|
379
|
+
if (col.link === 'list') {
|
|
380
|
+
var list = value && (0, _isArray["default"])(value) ? value : [];
|
|
381
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
382
|
+
style: {
|
|
383
|
+
whiteSpace: 'pre-wrap'
|
|
384
|
+
}
|
|
385
|
+
}, (0, _map["default"])(list).call(list, function (item2, index2) {
|
|
386
|
+
var _context2;
|
|
387
|
+
var split = index2 === list.length - 1 ? '' : ',';
|
|
388
|
+
var onClick = function onClick() {
|
|
389
|
+
var _ref12 = _this.props.callback || {},
|
|
390
|
+
onLink = _ref12.onLink;
|
|
391
|
+
onLink && onLink(col.key, index, item2);
|
|
392
|
+
};
|
|
393
|
+
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
394
|
+
key: index2,
|
|
395
|
+
onClick: onClick
|
|
396
|
+
}, (0, _concat["default"])(_context2 = "".concat(item2[col.linkTitleKey])).call(_context2, split));
|
|
397
|
+
}));
|
|
398
|
+
} else {
|
|
399
|
+
var title = typeof col.link === 'string' ? col.link : value;
|
|
400
|
+
var onClick = function onClick() {
|
|
401
|
+
var _ref13 = _this.props.callback || {},
|
|
402
|
+
onLink = _ref13.onLink;
|
|
403
|
+
onLink && onLink(col.key, index, record);
|
|
404
|
+
};
|
|
405
|
+
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
406
|
+
style: {
|
|
407
|
+
whiteSpace: 'normal',
|
|
408
|
+
wordBreak: "break-all"
|
|
409
|
+
},
|
|
410
|
+
onClick: onClick
|
|
411
|
+
}, title);
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getIndex", function (index) {
|
|
415
|
+
return (_this.props.base || 0) + index;
|
|
416
|
+
});
|
|
417
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getCellRender", function (col) {
|
|
418
|
+
return function (value, record, index) {
|
|
419
|
+
var _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10;
|
|
420
|
+
var realType = record._isEdit === true && _this.canReadonly(col.type) ? col.editType : col.type;
|
|
421
|
+
if (!realType) {
|
|
422
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
423
|
+
onDoubleClick: _this.onDoubleClick(col.key, record.key),
|
|
424
|
+
style: {
|
|
425
|
+
minHeight: '20px',
|
|
426
|
+
minWidth: '100px',
|
|
427
|
+
maxWidth: "".concat(col.width - 16, "px"),
|
|
428
|
+
color: col.isNeedShow ? '#1890ff' : '',
|
|
429
|
+
overflow: 'hidden',
|
|
430
|
+
textOverflow: 'ellipsis',
|
|
431
|
+
display: '-webkit-box',
|
|
432
|
+
WebkitLineClamp: 2,
|
|
433
|
+
WebkitBoxOrient: "vertical",
|
|
434
|
+
whiteSpace: 'break-spaces'
|
|
435
|
+
},
|
|
436
|
+
title: value
|
|
437
|
+
}, value);
|
|
438
|
+
}
|
|
439
|
+
switch (realType) {
|
|
440
|
+
case 'checkbox':
|
|
441
|
+
return /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
|
|
442
|
+
onChange: _this.onCheck(col.key, record.key),
|
|
443
|
+
checked: value || false
|
|
444
|
+
});
|
|
445
|
+
case 'index':
|
|
446
|
+
return _this.getIndex(index) + 1;
|
|
447
|
+
case 'link':
|
|
448
|
+
return _this.renderLinkCell(col, value, record, record.key);
|
|
449
|
+
case 'button':
|
|
450
|
+
var onClick = _this.props.callback.onLink ? (0, _bind["default"])(_context3 = _this.props.callback.onLink).call(_context3, null, col.key, record.key, record) : undefined;
|
|
451
|
+
if (col.icon === 'add') {
|
|
452
|
+
return /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
|
453
|
+
onClick: onClick,
|
|
454
|
+
type: "primary",
|
|
455
|
+
shape: "circle",
|
|
456
|
+
size: "small",
|
|
457
|
+
ghost: true,
|
|
458
|
+
icon: "plus"
|
|
459
|
+
});
|
|
460
|
+
} else {
|
|
461
|
+
return /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
|
462
|
+
onClick: onClick,
|
|
463
|
+
size: "small",
|
|
464
|
+
ghost: true,
|
|
465
|
+
type: col.bsStyle
|
|
466
|
+
}, record[col.key] || col.typeRelated);
|
|
467
|
+
}
|
|
468
|
+
case 'switch':
|
|
469
|
+
return typeof value === 'string' ? /*#__PURE__*/_react["default"].createElement("div", null, value) : /*#__PURE__*/_react["default"].createElement(_switch["default"], {
|
|
470
|
+
checkedChildren: col.props.checkedChildren || '',
|
|
471
|
+
unCheckedChildren: col.props.unCheckedChildren || '',
|
|
472
|
+
onChange: _this.onSwitch(col.key, record.key),
|
|
473
|
+
size: "default",
|
|
474
|
+
checked: typeof value === 'number' ? Boolean(value) : value || false,
|
|
475
|
+
disabled: !(record._isEdit === true)
|
|
476
|
+
});
|
|
477
|
+
case 'custom':
|
|
478
|
+
return _this.props.callback.onRenderCustom(record.key, col.key, value, col.props, col);
|
|
479
|
+
case 'toolbar':
|
|
480
|
+
//showByKey为true时,每条数据中与按钮key相同的属性值决定按钮是否显示,建议key用下划线开始命名,避免与后台数据冲突
|
|
481
|
+
var props = {
|
|
482
|
+
onClick: _this.props.callback.onToolbar ? (0, _bind["default"])(_context4 = _this.props.callback.onToolbar).call(_context4, null, col.key, record.key, record) : undefined,
|
|
483
|
+
buttons: col.props.showByKey ? (0, _filter["default"])(_context5 = col.props.buttons).call(_context5, function (item) {
|
|
484
|
+
return record[item.key] === true;
|
|
485
|
+
}) : (0, _filter["default"])(_context6 = col.props.buttons).call(_context6, function (item) {
|
|
486
|
+
return item.defaultShow === !record._isEdit;
|
|
487
|
+
})
|
|
488
|
+
};
|
|
489
|
+
return /*#__PURE__*/_react["default"].createElement(_SuperToolbar["default"], props);
|
|
490
|
+
case 'img':
|
|
491
|
+
return value ? typeof value === 'string' ? /*#__PURE__*/_react["default"].createElement("img", {
|
|
492
|
+
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),
|
|
493
|
+
style: {
|
|
494
|
+
width: '80px',
|
|
495
|
+
height: '80px'
|
|
496
|
+
}
|
|
497
|
+
}) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
498
|
+
role: 'imgBox',
|
|
499
|
+
style: {
|
|
500
|
+
maxWidth: "".concat(col.width, "px")
|
|
501
|
+
}
|
|
502
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
503
|
+
src: value.img === '' ? '/productDefault.png' : (0, _includes["default"])(_context8 = value.img).call(_context8, 'http') ? value.img : (0, _concat["default"])(_context9 = "".concat(window.location.origin, "/api/proxy/file-center-service/")).call(_context9, value.img),
|
|
504
|
+
onError: function onError(e) {
|
|
505
|
+
return e.target.src = '/productDefault.png';
|
|
506
|
+
},
|
|
507
|
+
style: {
|
|
508
|
+
width: '80px',
|
|
509
|
+
height: '80px'
|
|
510
|
+
}
|
|
511
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
512
|
+
style: {
|
|
513
|
+
display: 'inline-block'
|
|
514
|
+
}
|
|
515
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
516
|
+
style: {
|
|
517
|
+
display: 'block',
|
|
518
|
+
whiteSpace: 'nowrap',
|
|
519
|
+
overflow: 'hidden',
|
|
520
|
+
textOverflow: 'ellipsis',
|
|
521
|
+
width: '100px'
|
|
522
|
+
},
|
|
523
|
+
onClick: _this.onImgTileClick(col, record, index)
|
|
524
|
+
}, value.title), _helper["default"].isEmpty2(value.remark) ? null : /*#__PURE__*/_react["default"].createElement("span", {
|
|
525
|
+
style: {
|
|
526
|
+
display: 'block',
|
|
527
|
+
whiteSpace: 'nowrap',
|
|
528
|
+
overflow: 'hidden',
|
|
529
|
+
textOverflow: 'ellipsis',
|
|
530
|
+
width: '100px',
|
|
531
|
+
color: '#333'
|
|
532
|
+
}
|
|
533
|
+
}, value.remark))) : /*#__PURE__*/_react["default"].createElement("div", null);
|
|
534
|
+
case 'uploadImg':
|
|
535
|
+
var commonProps = _this.props.callback.buildSuperUploadProps ? _this.props.callback.buildSuperUploadProps() : {};
|
|
536
|
+
var uploadProps = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
537
|
+
onFileChange: _this.props.callback.onTableFileChange ? (0, _bind["default"])(_context10 = _this.props.callback.onTableFileChange).call(_context10, null, col.key, index) : undefined,
|
|
538
|
+
type: col.type
|
|
539
|
+
}, col.props), _this.props), commonProps), {}, {
|
|
540
|
+
value: _this.props.items[index][col.key]
|
|
541
|
+
});
|
|
542
|
+
return /*#__PURE__*/_react["default"].createElement(_Control["default"], uploadProps);
|
|
543
|
+
case 'double':
|
|
544
|
+
return _this.renderDoubleEditableCell(_objectSpread(_objectSpread({}, col), {}, {
|
|
545
|
+
type: realType
|
|
546
|
+
}), value, record.key);
|
|
547
|
+
default:
|
|
548
|
+
return _this.renderEditableCell(_objectSpread(_objectSpread({}, col), {}, {
|
|
549
|
+
type: realType
|
|
550
|
+
}), value, record.key);
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
});
|
|
554
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getCheckedStatus", function (key) {
|
|
555
|
+
var has = false,
|
|
556
|
+
not = false;
|
|
557
|
+
var items = _this.props.items;
|
|
558
|
+
var _iterator = _createForOfIteratorHelper(items),
|
|
559
|
+
_step;
|
|
560
|
+
try {
|
|
561
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
562
|
+
var item = _step.value;
|
|
563
|
+
item[key] ? has = true : not = true;
|
|
564
|
+
}
|
|
565
|
+
} catch (err) {
|
|
566
|
+
_iterator.e(err);
|
|
567
|
+
} finally {
|
|
568
|
+
_iterator.f();
|
|
569
|
+
}
|
|
570
|
+
return {
|
|
571
|
+
checked: has && !not,
|
|
572
|
+
indeterminate: has && not
|
|
573
|
+
};
|
|
574
|
+
});
|
|
575
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toAdd", function (key, showAdd) {
|
|
576
|
+
if (showAdd) {
|
|
577
|
+
var onClick = _this.onAdd(key);
|
|
578
|
+
return /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
579
|
+
type: "plus-circle-o",
|
|
580
|
+
role: "add",
|
|
581
|
+
onClick: onClick
|
|
582
|
+
});
|
|
583
|
+
} else {
|
|
584
|
+
return null;
|
|
585
|
+
}
|
|
586
|
+
});
|
|
587
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnTitle", function (_ref14) {
|
|
588
|
+
var required = _ref14.required,
|
|
589
|
+
title = _ref14.title,
|
|
590
|
+
type = _ref14.type,
|
|
591
|
+
key = _ref14.key,
|
|
592
|
+
showAdd = _ref14.showAdd;
|
|
593
|
+
if (type === 'checkbox') {
|
|
594
|
+
var status = _this.getCheckedStatus(key);
|
|
595
|
+
return /*#__PURE__*/_react["default"].createElement(_checkbox["default"], (0, _extends2["default"])({
|
|
596
|
+
onChange: _this.onCheck(key, -1)
|
|
597
|
+
}, status));
|
|
598
|
+
} else {
|
|
599
|
+
var className = required ? 'ant-form-item-required' : '';
|
|
600
|
+
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
601
|
+
className: className
|
|
602
|
+
}, title, _this.toAdd(key, showAdd));
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnClassName", function (_ref15) {
|
|
606
|
+
var type = _ref15.type,
|
|
607
|
+
align = _ref15.align;
|
|
608
|
+
if (type === 'index' || type === 'checkbox') {
|
|
609
|
+
return 'ant-table-selection-column';
|
|
610
|
+
} else {
|
|
611
|
+
return align ? (0, _variables["default"])('SuperTable2')[align] : '';
|
|
612
|
+
}
|
|
613
|
+
});
|
|
614
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "canReadonly", function (type) {
|
|
615
|
+
var _context11;
|
|
616
|
+
return !(0, _includes["default"])(_context11 = ['index', 'checkbox', 'link', 'button', 'switch', 'custom', 'img', 'toolbar', 'uploadImg', 'double']).call(_context11, type);
|
|
617
|
+
});
|
|
618
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumns", function (cols) {
|
|
619
|
+
var _context12;
|
|
620
|
+
var readonly = _this.props.readonly;
|
|
621
|
+
return (0, _map["default"])(_context12 = (0, _filter["default"])(cols).call(cols, function (col) {
|
|
622
|
+
return !col.hide;
|
|
623
|
+
})).call(_context12, function (_ref16, index) {
|
|
624
|
+
var _context13;
|
|
625
|
+
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref16), _ref16));
|
|
626
|
+
col.className = _this.getColumnClassName(col);
|
|
627
|
+
col.title = _this.getColumnTitle(col);
|
|
628
|
+
col.dataIndex = col.key;
|
|
629
|
+
col.width = col.width ? col.width : (0, _includes["default"])(_context13 = ['index', 'checked']).call(_context13, col.key) ? 70 : col.type === 'img' ? 200 : 120;
|
|
630
|
+
// const {props = {}} =
|
|
631
|
+
// const {edit = false} = props
|
|
632
|
+
// if (!(readonly || col.type === 'readonly') || !this.canReadonly(col.type)) {
|
|
633
|
+
// if ( !edit && ['text', 'number', 'select', 'date', 'search', 'readonly', 'textArea', 'selectSearch'].includes(col.type)){
|
|
634
|
+
// return col
|
|
635
|
+
// }
|
|
636
|
+
// }
|
|
637
|
+
col.readonly = readonly;
|
|
638
|
+
col.render = _this.getCellRender(col);
|
|
639
|
+
if (col.link) {
|
|
640
|
+
col.type = 'link';
|
|
641
|
+
col.render = _this.getCellRender(col);
|
|
642
|
+
} else if (col.showPrice || col.decimalPlaces) {
|
|
643
|
+
col.render = function (text, record, index) {
|
|
644
|
+
if (col.showPrice && text) {
|
|
645
|
+
text = _helper["default"].toThousands(text, col.decimalPlaces ? col.decimalPlaces : 2);
|
|
646
|
+
return "\uFFE5".concat(text);
|
|
647
|
+
} else {
|
|
648
|
+
return text ? "\uFFE5".concat(text.toFixed(2)) : text;
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
return col;
|
|
653
|
+
});
|
|
654
|
+
});
|
|
655
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getDataSource", function (items, cols) {
|
|
656
|
+
return (0, _map["default"])(items).call(items, function (item, index) {
|
|
657
|
+
return (0, _reduce["default"])(cols).call(cols, function (result, _ref17) {
|
|
658
|
+
var _context14, _context15;
|
|
659
|
+
var key = _ref17.key,
|
|
660
|
+
type = _ref17.type,
|
|
661
|
+
options = _ref17.options;
|
|
662
|
+
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)) {
|
|
663
|
+
result[key] = item[key];
|
|
664
|
+
} else {
|
|
665
|
+
result[key] = (0, _Control.getTitle)(item[key], options);
|
|
666
|
+
}
|
|
667
|
+
return result;
|
|
668
|
+
}, _objectSpread(_objectSpread({}, item), {}, {
|
|
669
|
+
key: index,
|
|
670
|
+
disabled: item.isCanConfigHide
|
|
671
|
+
}));
|
|
672
|
+
});
|
|
673
|
+
});
|
|
674
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPropsByCheckbox", function () {
|
|
675
|
+
var _this$props2 = _this.props,
|
|
676
|
+
items = _this$props2.items,
|
|
677
|
+
_this$props2$isEmphas = _this$props2.isEmphasized,
|
|
678
|
+
isEmphasized = _this$props2$isEmphas === void 0 ? false : _this$props2$isEmphas;
|
|
679
|
+
var rowClassName = function rowClassName(record) {
|
|
680
|
+
if (isEmphasized && items[record.key].__isEmphasized) {
|
|
681
|
+
return items[record.key].checked ? (0, _variables["default"])('SuperTable2').emphasizedSelectRow : (0, _variables["default"])('SuperTable2').emphasizedUnselectRow;
|
|
682
|
+
}
|
|
683
|
+
return items[record.key].checked ? (0, _variables["default"])('SuperTable2').select : '';
|
|
684
|
+
};
|
|
685
|
+
return {
|
|
686
|
+
rowClassName: rowClassName
|
|
687
|
+
};
|
|
688
|
+
});
|
|
689
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getSelectedRowKeys", function (items) {
|
|
690
|
+
return (0, _reduce["default"])(items).call(items, function (result, item, index) {
|
|
691
|
+
item.checked && result.push(index);
|
|
692
|
+
return result;
|
|
693
|
+
}, []);
|
|
694
|
+
});
|
|
695
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPropsByCheckbox2", function (items) {
|
|
696
|
+
var _this$props3 = _this.props,
|
|
697
|
+
_this$props3$checkbox = _this$props3.checkbox,
|
|
698
|
+
checkbox = _this$props3$checkbox === void 0 ? true : _this$props3$checkbox,
|
|
699
|
+
_this$props3$radio = _this$props3.radio,
|
|
700
|
+
radio = _this$props3$radio === void 0 ? false : _this$props3$radio,
|
|
701
|
+
isolation = _this$props3.isolation,
|
|
702
|
+
_this$props3$checkedR = _this$props3.checkedRows,
|
|
703
|
+
checkedRows = _this$props3$checkedR === void 0 ? [] : _this$props3$checkedR,
|
|
704
|
+
_this$props3$isEmphas = _this$props3.isEmphasized,
|
|
705
|
+
isEmphasized = _this$props3$isEmphas === void 0 ? false : _this$props3$isEmphas,
|
|
706
|
+
_this$props3$isWeaken = _this$props3.isWeaken,
|
|
707
|
+
isWeaken = _this$props3$isWeaken === void 0 ? true : _this$props3$isWeaken;
|
|
708
|
+
var rowClassName1 = function rowClassName1(record) {
|
|
709
|
+
if (items[record.key].__total) return (0, _variables["default"])('SuperTable').totalRow;
|
|
710
|
+
if (items[record.key].__warningRow) return (0, _variables["default"])('SuperTable').warningRow;
|
|
711
|
+
return (0, _includes["default"])(checkedRows).call(checkedRows, record.key) ? (0, _variables["default"])('SuperTable').select : '';
|
|
712
|
+
};
|
|
713
|
+
var rowClassName2 = function rowClassName2(record) {
|
|
714
|
+
if (items[record.key].__total) return (0, _variables["default"])('SuperTable').totalRow;
|
|
715
|
+
if (items[record.key].__warningRow) return (0, _variables["default"])('SuperTable').warningRow;
|
|
716
|
+
if (isEmphasized && items[record.key].__isEmphasized) {
|
|
717
|
+
return items[record.key].checked ? (0, _variables["default"])('SuperTable').emphasizedSelectRow : (0, _variables["default"])('SuperTable').emphasizedUnselectRow;
|
|
718
|
+
}
|
|
719
|
+
if (isWeaken && items[record.key].__isWeaken) {
|
|
720
|
+
return items[record.key].checked ? (0, _variables["default"])('SuperTable').weakenedSelectRow : (0, _variables["default"])('SuperTable').weakenedUnselectRow;
|
|
721
|
+
}
|
|
722
|
+
return items[record.key].checked ? (0, _variables["default"])('SuperTable').select : '';
|
|
723
|
+
};
|
|
724
|
+
if (checkbox) {
|
|
725
|
+
if (radio) {
|
|
726
|
+
return {
|
|
727
|
+
rowClassName: rowClassName1,
|
|
728
|
+
onRowClick: _this.onRadioRowClick,
|
|
729
|
+
rowSelection: {
|
|
730
|
+
type: 'radio',
|
|
731
|
+
selectedRowKeys: checkedRows,
|
|
732
|
+
onChange: _this.onRadioChange
|
|
733
|
+
}
|
|
734
|
+
};
|
|
735
|
+
} else if (isolation) {
|
|
736
|
+
return {
|
|
737
|
+
rowClassName: rowClassName1,
|
|
738
|
+
onRowClick: _this.onRowClick,
|
|
739
|
+
rowSelection: {
|
|
740
|
+
selectedRowKeys: checkedRows,
|
|
741
|
+
onChange: _this.onCheckChange,
|
|
742
|
+
getCheckboxProps: function getCheckboxProps(record) {
|
|
743
|
+
var checked = (0, _includes["default"])(checkedRows).call(checkedRows, record.key);
|
|
744
|
+
return {
|
|
745
|
+
checked: checked,
|
|
746
|
+
disabled: items[record.key].__isWeaken,
|
|
747
|
+
style: items[record.key].__total ? {
|
|
748
|
+
display: 'none'
|
|
749
|
+
} : {}
|
|
750
|
+
};
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
};
|
|
754
|
+
} else {
|
|
755
|
+
return {
|
|
756
|
+
rowClassName: rowClassName2,
|
|
757
|
+
onRowClick: _this.onRowClick,
|
|
758
|
+
rowSelection: {
|
|
759
|
+
selectedRowKeys: _this.getSelectedRowKeys(items),
|
|
760
|
+
onChange: _this.onChange,
|
|
761
|
+
getCheckboxProps: function getCheckboxProps(record) {
|
|
762
|
+
var checked = isWeaken && items[record.key].__isWeaken ? false : !!record.checked;
|
|
763
|
+
return {
|
|
764
|
+
checked: checked,
|
|
765
|
+
disabled: items[record.key].__isWeaken,
|
|
766
|
+
style: items[record.key].__total ? {
|
|
767
|
+
display: 'none'
|
|
768
|
+
} : {}
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
};
|
|
773
|
+
}
|
|
774
|
+
} else {
|
|
775
|
+
return {
|
|
776
|
+
rowClassName: rowClassName2
|
|
777
|
+
};
|
|
778
|
+
}
|
|
779
|
+
});
|
|
780
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getRowPropsForDrag", function () {
|
|
781
|
+
return function (record, index) {
|
|
782
|
+
return {
|
|
783
|
+
index: index,
|
|
784
|
+
onMoveRow: _this.onMoveRow
|
|
785
|
+
};
|
|
786
|
+
};
|
|
787
|
+
});
|
|
788
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getRowProps", function (onRowClick) {
|
|
789
|
+
return function (record) {
|
|
790
|
+
return {
|
|
791
|
+
onClick: function onClick() {
|
|
792
|
+
return onRowClick && onRowClick(record);
|
|
793
|
+
},
|
|
794
|
+
onDoubleClick: function onDoubleClick() {
|
|
795
|
+
return _this.onDoubleClick(record);
|
|
796
|
+
}
|
|
797
|
+
};
|
|
798
|
+
};
|
|
799
|
+
});
|
|
800
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getProps", function () {
|
|
801
|
+
var _context16;
|
|
802
|
+
var _this$props4 = _this.props,
|
|
803
|
+
cols = _this$props4.cols,
|
|
804
|
+
items = _this$props4.items,
|
|
805
|
+
_this$props4$style = _this$props4.style,
|
|
806
|
+
style = _this$props4$style === void 0 ? {} : _this$props4$style,
|
|
807
|
+
_this$props4$footer = _this$props4.footer,
|
|
808
|
+
footer = _this$props4$footer === void 0 ? null : _this$props4$footer,
|
|
809
|
+
_this$props4$paginati = _this$props4.pagination,
|
|
810
|
+
pagination = _this$props4$paginati === void 0 ? false : _this$props4$paginati,
|
|
811
|
+
dragSort = _this$props4.dragSort,
|
|
812
|
+
_this$props4$isEmphas = _this$props4.isEmphasized,
|
|
813
|
+
isEmphasized = _this$props4$isEmphas === void 0 ? false : _this$props4$isEmphas,
|
|
814
|
+
maxHeight = _this$props4.maxHeight,
|
|
815
|
+
_this$props4$expanded = _this$props4.expandedRowRender,
|
|
816
|
+
expandedRowRender = _this$props4$expanded === void 0 ? undefined : _this$props4$expanded,
|
|
817
|
+
_this$props4$onExpand = _this$props4.onExpand,
|
|
818
|
+
onExpand = _this$props4$onExpand === void 0 ? undefined : _this$props4$onExpand;
|
|
819
|
+
var widthX = (0, _reduce["default"])(_context16 = (0, _filter["default"])(cols).call(cols, function (col) {
|
|
820
|
+
return !col.hide;
|
|
821
|
+
})).call(_context16, function (width, item) {
|
|
822
|
+
var _context17;
|
|
823
|
+
return width += item.width ? item.width : (0, _includes["default"])(_context17 = ['index', 'checked']).call(_context17, item.key) ? 70 : item.type === 'img' ? 200 : 120;
|
|
824
|
+
}, 0);
|
|
825
|
+
var scrollProps = !_helper["default"].isEmpty2(expandedRowRender) ? {
|
|
826
|
+
expandedRowRender: expandedRowRender
|
|
827
|
+
} : {
|
|
828
|
+
scroll: {
|
|
829
|
+
x: (0, _some["default"])(cols).call(cols, function (item) {
|
|
830
|
+
return !_helper["default"].isEmpty2(item.fixed);
|
|
831
|
+
}) ? widthX : true,
|
|
832
|
+
y: maxHeight
|
|
833
|
+
}
|
|
834
|
+
};
|
|
835
|
+
var _this$getPropsByCheck = _this.getPropsByCheckbox2(items),
|
|
836
|
+
onRowClick = _this$getPropsByCheck.onRowClick,
|
|
837
|
+
extraProps = (0, _objectWithoutProperties2["default"])(_this$getPropsByCheck, _excluded);
|
|
838
|
+
return _objectSpread(_objectSpread({
|
|
839
|
+
className: !isEmphasized ? (0, _variables["default"])('SuperTable2') : (0, _variables["default"])('SuperTable2').noTransition,
|
|
840
|
+
columns: _this.getColumns(cols),
|
|
841
|
+
dataSource: _this.getDataSource(items, cols),
|
|
842
|
+
style: (0, _assign["default"])({}, {
|
|
843
|
+
whiteSpace: 'nowrap'
|
|
844
|
+
}, style),
|
|
845
|
+
size: 'small',
|
|
846
|
+
pagination: pagination,
|
|
847
|
+
footer: footer,
|
|
848
|
+
onRow: dragSort ? _this.getRowPropsForDrag() : _this.getRowProps(onRowClick),
|
|
849
|
+
components: dragSort ? {
|
|
850
|
+
body: {
|
|
851
|
+
row: _DragSortRow["default"]
|
|
852
|
+
}
|
|
853
|
+
} : {},
|
|
854
|
+
locale: _this.props.emptyText ? {
|
|
855
|
+
emptyText: _this.props.emptyText
|
|
856
|
+
} : null
|
|
857
|
+
}, _this.getPropsByCheckbox()), {}, {
|
|
858
|
+
onExpand: onExpand
|
|
859
|
+
}, scrollProps);
|
|
860
|
+
});
|
|
861
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setScroll", function () {
|
|
862
|
+
if (_this.props.maxHeight && _this.props.items.length) {
|
|
863
|
+
var root = _reactDom["default"].findDOMNode((0, _assertThisInitialized2["default"])(_this));
|
|
864
|
+
var container = root.getElementsByClassName('ant-table-body')[0];
|
|
865
|
+
var header = root.getElementsByClassName('ant-table-thead')[0];
|
|
866
|
+
(0, _fixed["default"])(container, header, _this.props.maxHeight);
|
|
867
|
+
}
|
|
868
|
+
});
|
|
869
|
+
return _this;
|
|
870
|
+
}
|
|
871
|
+
(0, _createClass2["default"])(SuperTable2, [{
|
|
872
|
+
key: "componentDidMount",
|
|
873
|
+
value: function componentDidMount() {
|
|
874
|
+
this.setScroll();
|
|
875
|
+
}
|
|
876
|
+
}, {
|
|
877
|
+
key: "componentDidUpdate",
|
|
878
|
+
value: function componentDidUpdate() {
|
|
879
|
+
this.setScroll();
|
|
880
|
+
}
|
|
881
|
+
}, {
|
|
882
|
+
key: "render",
|
|
883
|
+
value: function render() {
|
|
884
|
+
this.error = false;
|
|
885
|
+
return /*#__PURE__*/_react["default"].createElement(_table["default"], (0, _extends2["default"])({}, this.getProps(), {
|
|
886
|
+
key: this.props.items.length
|
|
887
|
+
}));
|
|
888
|
+
}
|
|
889
|
+
}]);
|
|
890
|
+
return SuperTable2;
|
|
891
|
+
}(_react["default"].Component);
|
|
892
|
+
(0, _defineProperty2["default"])(SuperTable2, "propTypes", {
|
|
893
|
+
cols: _propTypes["default"].arrayOf(_propTypes["default"].shape(ColType)).isRequired,
|
|
894
|
+
items: _propTypes["default"].array.isRequired,
|
|
895
|
+
base: _propTypes["default"].number,
|
|
896
|
+
options: _propTypes["default"].object,
|
|
897
|
+
valid: _propTypes["default"].bool,
|
|
898
|
+
readonly: _propTypes["default"].bool,
|
|
899
|
+
style: _propTypes["default"].object,
|
|
900
|
+
maxHeight: _propTypes["default"].string,
|
|
901
|
+
emptyText: _propTypes["default"].string,
|
|
902
|
+
footer: _propTypes["default"].func,
|
|
903
|
+
callback: _propTypes["default"].shape(CallbackType),
|
|
904
|
+
isEmphasized: _propTypes["default"].bool,
|
|
905
|
+
dragSort: _propTypes["default"].bool
|
|
906
|
+
});
|
|
907
|
+
var _default = exports["default"] = SuperTable2;
|