cloud-b2b 1.1.63 → 1.1.65
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 +11 -8
- package/es/CodeInput/CodeInput.js +19 -16
- package/es/Enhance/Dialogs.js +14 -11
- package/es/Enhance/Loading.js +18 -15
- package/es/Header/Header.js +20 -17
- package/es/Header/Vertical.js +14 -11
- package/es/ImageView/ImageView.js +13 -10
- package/es/InpurCascader/InputCascader.js +14 -11
- package/es/InputEditor/InputEditor.js +18 -16
- package/es/InputSearch/InputSearch.js +22 -19
- package/es/InputSelect/InputSelect.js +17 -14
- package/es/InputTreeSelect/InputTreeSelect.js +13 -10
- package/es/InputWriting/InputWriting.js +15 -12
- package/es/Layout/Layout.js +17 -14
- package/es/Link/Link.js +10 -7
- package/es/NumberInput/NumberInput.js +16 -13
- package/es/Search/Search.js +55 -52
- package/es/Search2/Search.js +110 -109
- package/es/Search2/Search.less +64 -64
- package/es/Search2/package.json +6 -6
- package/es/Sidebar/Sidebar.js +14 -11
- package/es/Sidebar2/Sidebar.js +16 -13
- package/es/SuperForm/SuperForm.js +79 -74
- package/es/SuperForm2/SuperForm.js +100 -96
- package/es/SuperPagination/SuperPagination.js +11 -8
- package/es/SuperTab/SuperTab.js +15 -12
- package/es/SuperTab2/SuperTab2.js +16 -13
- package/es/SuperTable/DragSortRow.js +15 -12
- package/es/SuperTable/FilterDropDown.js +14 -11
- package/es/SuperTable/SuperTable.js +71 -68
- package/es/SuperTable2/SuperTable2.js +88 -85
- package/es/SuperTable2/SuperTableCell.js +30 -27
- package/es/SuperTable3/FilterDropDown.js +14 -11
- package/es/SuperTable3/SuperTable.js +61 -58
- package/es/SuperToolbar/SuperToolbar.js +14 -11
- package/es/SuperUpload/SuperUpload.js +74 -74
- package/es/Viewer/ImageViews.js +19 -16
- package/es/Viewer/Viewer.js +14 -11
- package/es/helper.js +17 -18
- package/lib/Area/Area.js +11 -8
- package/lib/CodeInput/CodeInput.js +19 -16
- package/lib/Enhance/Dialogs.js +14 -11
- package/lib/Enhance/Loading.js +18 -15
- package/lib/Header/Header.js +20 -17
- package/lib/Header/Vertical.js +14 -11
- package/lib/ImageView/ImageView.js +13 -10
- package/lib/InpurCascader/InputCascader.js +14 -11
- package/lib/InputEditor/InputEditor.js +18 -16
- package/lib/InputSearch/InputSearch.js +22 -19
- package/lib/InputSelect/InputSelect.js +17 -14
- package/lib/InputTreeSelect/InputTreeSelect.js +13 -10
- package/lib/InputWriting/InputWriting.js +15 -12
- package/lib/Layout/Layout.js +17 -14
- package/lib/LayoutLink/LayoutLink.js +2 -1
- package/lib/Link/Link.js +10 -7
- package/lib/NumberInput/NumberInput.js +16 -13
- package/lib/Search/Search.js +57 -53
- package/lib/Search2/Search.js +112 -110
- package/lib/Search2/Search.less +64 -64
- package/lib/Search2/package.json +6 -6
- package/lib/Sidebar/Sidebar.js +14 -11
- package/lib/Sidebar2/Sidebar.js +16 -13
- package/lib/SuperForm/SuperForm.js +81 -75
- package/lib/SuperForm2/SuperForm.js +102 -97
- package/lib/SuperPagination/SuperPagination.js +11 -8
- package/lib/SuperTab/SuperTab.js +15 -12
- package/lib/SuperTab2/SuperTab2.js +16 -13
- package/lib/SuperTable/DragSortRow.js +15 -12
- package/lib/SuperTable/FilterDropDown.js +14 -11
- package/lib/SuperTable/SuperTable.js +71 -68
- package/lib/SuperTable2/SuperTable2.js +90 -86
- package/lib/SuperTable2/SuperTableCell.js +30 -27
- package/lib/SuperTable3/FilterDropDown.js +14 -11
- package/lib/SuperTable3/SuperTable.js +61 -58
- package/lib/SuperToolbar/SuperToolbar.js +14 -11
- package/lib/SuperUpload/SuperUpload.js +76 -75
- package/lib/Viewer/ImageViews.js +19 -16
- package/lib/Viewer/Viewer.js +14 -11
- package/lib/helper.js +17 -18
- package/package.json +1 -1
|
@@ -18,9 +18,10 @@ var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-sta
|
|
|
18
18
|
var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
|
|
19
19
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
20
20
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
21
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
22
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
21
23
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
22
24
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
23
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
24
25
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
25
26
|
var _react = _interopRequireDefault(require("react"));
|
|
26
27
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -29,8 +30,8 @@ var _Control = _interopRequireDefault(require("../Control"));
|
|
|
29
30
|
var _helper = _interopRequireDefault(require("../helper"));
|
|
30
31
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
31
32
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context4 = ownKeys(Object(t), !0)).call(_context4, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context5 = ownKeys(Object(t))).call(_context5, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
32
|
-
function
|
|
33
|
-
function _isNativeReflectConstruct() {
|
|
33
|
+
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); }; }
|
|
34
|
+
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; } }
|
|
34
35
|
// 单元格的type只能取如下值:
|
|
35
36
|
// 'text', 'number', select', 'date', 'search', 'readonly', 'textArea', 'selectSearch'
|
|
36
37
|
|
|
@@ -45,6 +46,8 @@ var isInRegion = exports.isInRegion = function isInRegion(target, _ref) {
|
|
|
45
46
|
return !(x < left || x > right || y < top || y > bottom);
|
|
46
47
|
};
|
|
47
48
|
var SuperTableCell = /*#__PURE__*/function (_React$Component) {
|
|
49
|
+
(0, _inherits2["default"])(SuperTableCell, _React$Component);
|
|
50
|
+
var _super = _createSuper(SuperTableCell);
|
|
48
51
|
function SuperTableCell() {
|
|
49
52
|
var _context;
|
|
50
53
|
var _this;
|
|
@@ -52,19 +55,19 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
52
55
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
53
56
|
args[_key] = arguments[_key];
|
|
54
57
|
}
|
|
55
|
-
_this =
|
|
56
|
-
(0, _defineProperty2["default"])(_this, "onDateBlur", function (value, event) {
|
|
58
|
+
_this = _super.call.apply(_super, (0, _concat["default"])(_context = [this]).call(_context, args));
|
|
59
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDateBlur", function (value, event) {
|
|
57
60
|
if (!isInRegion(event.target, global.mousePos)) {
|
|
58
61
|
_this.props.onBlur();
|
|
59
62
|
}
|
|
60
63
|
});
|
|
61
|
-
(0, _defineProperty2["default"])(_this, "onChange", function (key, value) {
|
|
64
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (key, value) {
|
|
62
65
|
var onChange = _this.props.onChange;
|
|
63
66
|
if (onChange) {
|
|
64
67
|
onChange(key, value);
|
|
65
68
|
}
|
|
66
69
|
});
|
|
67
|
-
(0, _defineProperty2["default"])(_this, "onOpenChange", function (open) {
|
|
70
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onOpenChange", function (open) {
|
|
68
71
|
if (!open) {
|
|
69
72
|
var targets = document.getElementsByClassName('ant-calendar-picker-container');
|
|
70
73
|
if (!isInRegion(targets[0], global.mousePos)) {
|
|
@@ -72,71 +75,71 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
72
75
|
}
|
|
73
76
|
}
|
|
74
77
|
});
|
|
75
|
-
(0, _defineProperty2["default"])(_this, "options", function () {
|
|
78
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "options", function () {
|
|
76
79
|
return _this.props.options || _this.props.typeRelated || [];
|
|
77
80
|
});
|
|
78
|
-
(0, _defineProperty2["default"])(_this, "getPopupContainer", function () {
|
|
79
|
-
return _reactDom["default"].findDOMNode(_this);
|
|
81
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPopupContainer", function () {
|
|
82
|
+
return _reactDom["default"].findDOMNode((0, _assertThisInitialized2["default"])(_this));
|
|
80
83
|
});
|
|
81
|
-
(0, _defineProperty2["default"])(_this, "toTextComponent", function (props) {
|
|
84
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toTextComponent", function (props) {
|
|
82
85
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
83
86
|
});
|
|
84
|
-
(0, _defineProperty2["default"])(_this, "toTextAreaComponent", function (props) {
|
|
87
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toTextAreaComponent", function (props) {
|
|
85
88
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
86
89
|
});
|
|
87
|
-
(0, _defineProperty2["default"])(_this, "toReadonlyComponent", function (props) {
|
|
90
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toReadonlyComponent", function (props) {
|
|
88
91
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
89
92
|
});
|
|
90
|
-
(0, _defineProperty2["default"])(_this, "toNumberComponent", function (props) {
|
|
93
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toNumberComponent", function (props) {
|
|
91
94
|
props.defaultValue = props.value;
|
|
92
95
|
delete props.value;
|
|
93
96
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
94
97
|
});
|
|
95
|
-
(0, _defineProperty2["default"])(_this, "toDoubleNumberComponent", function (props, cc) {
|
|
98
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toDoubleNumberComponent", function (props, cc) {
|
|
96
99
|
var _context2, _context3;
|
|
97
100
|
props.defaultValue = props.value;
|
|
98
101
|
props.doubleKey = props.key;
|
|
99
102
|
props.doubleValue = _helper["default"].getObject(cc, props.key);
|
|
100
|
-
props.onChangeKey1 = (0, _bind["default"])(_context2 = _this.onChange).call(_context2, _this, props.key[0]);
|
|
101
|
-
props.onChangeKey2 = (0, _bind["default"])(_context3 = _this.onChange).call(_context3, _this, props.key[1]);
|
|
103
|
+
props.onChangeKey1 = (0, _bind["default"])(_context2 = _this.onChange).call(_context2, (0, _assertThisInitialized2["default"])(_this), props.key[0]);
|
|
104
|
+
props.onChangeKey2 = (0, _bind["default"])(_context3 = _this.onChange).call(_context3, (0, _assertThisInitialized2["default"])(_this), props.key[1]);
|
|
102
105
|
delete props.value;
|
|
103
106
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
104
107
|
});
|
|
105
|
-
(0, _defineProperty2["default"])(_this, "toDateComponent", function (props) {
|
|
108
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toDateComponent", function (props) {
|
|
106
109
|
//props.getCalendarContainer = this.getPopupContainer;
|
|
107
110
|
props.onBlur = _this.onDateBlur;
|
|
108
111
|
props.onOpenChange = _this.onOpenChange;
|
|
109
112
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
110
113
|
});
|
|
111
|
-
(0, _defineProperty2["default"])(_this, "toSelectComponent", function (props) {
|
|
114
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toSelectComponent", function (props) {
|
|
112
115
|
props.options = _this.options();
|
|
113
116
|
props.dropdownMatchSelectWidth = false;
|
|
114
117
|
//props.getPopupContainer = this.getPopupContainer;
|
|
115
118
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
116
119
|
});
|
|
117
|
-
(0, _defineProperty2["default"])(_this, "toSearchComponent", function (props) {
|
|
120
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toSearchComponent", function (props) {
|
|
118
121
|
props.options = _this.options();
|
|
119
122
|
//props.getPopupContainer = this.getPopupContainer;
|
|
120
123
|
props.onSearch = _this.props.onSearch;
|
|
121
124
|
props.dropdownMatchSelectWidth = false;
|
|
122
125
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
123
126
|
});
|
|
124
|
-
(0, _defineProperty2["default"])(_this, "toCascader", function (props) {
|
|
127
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toCascader", function (props) {
|
|
125
128
|
props.options = _this.options() || [];
|
|
126
129
|
props.onSearch = _this.props.onSearch;
|
|
127
130
|
props.loadData = _this.props.onSearch;
|
|
128
131
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
129
132
|
});
|
|
130
|
-
(0, _defineProperty2["default"])(_this, "toSelectWriting", function (props) {
|
|
133
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toSelectWriting", function (props) {
|
|
131
134
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
132
135
|
});
|
|
133
|
-
(0, _defineProperty2["default"])(_this, "toRadioGroup", function (props) {
|
|
136
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toRadioGroup", function (props) {
|
|
134
137
|
console.log(props);
|
|
135
138
|
props.options = _this.options();
|
|
136
139
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
137
140
|
});
|
|
138
141
|
// 确保value的值为字符串(包含value和title的对象除外)
|
|
139
|
-
(0, _defineProperty2["default"])(_this, "makeString", function (value) {
|
|
142
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "makeString", function (value) {
|
|
140
143
|
if (value === null || typeof value === 'undefined') {
|
|
141
144
|
return '';
|
|
142
145
|
} else if (typeof value === 'number') {
|
|
@@ -145,7 +148,7 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
145
148
|
return value;
|
|
146
149
|
}
|
|
147
150
|
});
|
|
148
|
-
(0, _defineProperty2["default"])(_this, "controlProps", function (_ref2) {
|
|
151
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "controlProps", function (_ref2) {
|
|
149
152
|
var type = _ref2.type,
|
|
150
153
|
value = _ref2.value,
|
|
151
154
|
_ref2$props = _ref2.props,
|
|
@@ -168,8 +171,7 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
168
171
|
});
|
|
169
172
|
return _this;
|
|
170
173
|
}
|
|
171
|
-
(0,
|
|
172
|
-
return (0, _createClass2["default"])(SuperTableCell, [{
|
|
174
|
+
(0, _createClass2["default"])(SuperTableCell, [{
|
|
173
175
|
key: "render",
|
|
174
176
|
value: function render() {
|
|
175
177
|
var props = this.controlProps(this.props);
|
|
@@ -223,6 +225,7 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
223
225
|
}
|
|
224
226
|
}
|
|
225
227
|
}]);
|
|
228
|
+
return SuperTableCell;
|
|
226
229
|
}(_react["default"].Component);
|
|
227
230
|
(0, _defineProperty2["default"])(SuperTableCell, "propTypes", {
|
|
228
231
|
type: _propTypes["default"].string.isRequired,
|
|
@@ -12,30 +12,33 @@ var _input = _interopRequireDefault(require("antd/lib/input"));
|
|
|
12
12
|
var _button = _interopRequireDefault(require("antd/lib/button"));
|
|
13
13
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
14
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
15
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
16
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
15
17
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
16
18
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
17
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
18
19
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
19
20
|
var _react = _interopRequireDefault(require("react"));
|
|
20
21
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
21
22
|
var _Control = _interopRequireDefault(require("../Control/Control"));
|
|
22
23
|
var _variables = _interopRequireDefault(require("../variables"));
|
|
23
|
-
function
|
|
24
|
-
function _isNativeReflectConstruct() {
|
|
24
|
+
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); }; }
|
|
25
|
+
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; } }
|
|
25
26
|
var FilterDropDown = /*#__PURE__*/function (_React$Component) {
|
|
27
|
+
(0, _inherits2["default"])(FilterDropDown, _React$Component);
|
|
28
|
+
var _super = _createSuper(FilterDropDown);
|
|
26
29
|
function FilterDropDown(_props) {
|
|
27
30
|
var _this;
|
|
28
31
|
(0, _classCallCheck2["default"])(this, FilterDropDown);
|
|
29
|
-
_this =
|
|
30
|
-
(0, _defineProperty2["default"])(_this, "onChange", function (e) {
|
|
32
|
+
_this = _super.call(this, _props);
|
|
33
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (e) {
|
|
31
34
|
_this.setState({
|
|
32
35
|
value: e.target.value
|
|
33
36
|
});
|
|
34
37
|
});
|
|
35
|
-
(0, _defineProperty2["default"])(_this, "onDateChange", function (key, value) {
|
|
38
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDateChange", function (key, value) {
|
|
36
39
|
_this.setState((0, _defineProperty2["default"])({}, key, value));
|
|
37
40
|
});
|
|
38
|
-
(0, _defineProperty2["default"])(_this, "onSearch", function () {
|
|
41
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSearch", function () {
|
|
39
42
|
var _this$props = _this.props,
|
|
40
43
|
onSearch = _this$props.onSearch,
|
|
41
44
|
isDateFilterByStartAndEnd = _this$props.isDateFilterByStartAndEnd;
|
|
@@ -45,7 +48,7 @@ var FilterDropDown = /*#__PURE__*/function (_React$Component) {
|
|
|
45
48
|
onSearch(val);
|
|
46
49
|
}
|
|
47
50
|
});
|
|
48
|
-
(0, _defineProperty2["default"])(_this, "DateInputCreator", function () {
|
|
51
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "DateInputCreator", function () {
|
|
49
52
|
var _context, _context2, _context3;
|
|
50
53
|
var props = _this.props.props;
|
|
51
54
|
var propsStart = {
|
|
@@ -82,7 +85,7 @@ var FilterDropDown = /*#__PURE__*/function (_React$Component) {
|
|
|
82
85
|
onClick: (0, _bind["default"])(_context3 = _this.onSearch).call(_context3, null, _this.props.type)
|
|
83
86
|
}, "\u641C\u7D22")));
|
|
84
87
|
});
|
|
85
|
-
(0, _defineProperty2["default"])(_this, "InputCreator", function () {
|
|
88
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "InputCreator", function () {
|
|
86
89
|
var props = {
|
|
87
90
|
size: 'small',
|
|
88
91
|
value: _this.state.value,
|
|
@@ -120,8 +123,7 @@ var FilterDropDown = /*#__PURE__*/function (_React$Component) {
|
|
|
120
123
|
}
|
|
121
124
|
return _this;
|
|
122
125
|
}
|
|
123
|
-
(0,
|
|
124
|
-
return (0, _createClass2["default"])(FilterDropDown, [{
|
|
126
|
+
(0, _createClass2["default"])(FilterDropDown, [{
|
|
125
127
|
key: "componentWillReceiveProps",
|
|
126
128
|
value: function componentWillReceiveProps(newProps) {
|
|
127
129
|
if (newProps.isDateFilterByStartAndEnd) {
|
|
@@ -160,6 +162,7 @@ var FilterDropDown = /*#__PURE__*/function (_React$Component) {
|
|
|
160
162
|
return this.props.isDateFilterByStartAndEnd ? this.DateInputCreator() : this.InputCreator();
|
|
161
163
|
}
|
|
162
164
|
}]);
|
|
165
|
+
return FilterDropDown;
|
|
163
166
|
}(_react["default"].Component);
|
|
164
167
|
(0, _defineProperty2["default"])(FilterDropDown, "propTypes", {
|
|
165
168
|
value: _propTypes["default"].any,
|
|
@@ -36,9 +36,10 @@ var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime-
|
|
|
36
36
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
37
37
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
38
38
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
39
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
40
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
39
41
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
40
42
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
41
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
42
43
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
43
44
|
var _react = _interopRequireDefault(require("react"));
|
|
44
45
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -49,9 +50,9 @@ var _fixed = _interopRequireDefault(require("./fixed"));
|
|
|
49
50
|
var _variables = _interopRequireDefault(require("../variables"));
|
|
50
51
|
var _excluded = ["onRowClick"];
|
|
51
52
|
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; }
|
|
52
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
53
|
-
function
|
|
54
|
-
function _isNativeReflectConstruct() {
|
|
53
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context11, _context12; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty2(_context11 = ownKeys(Object(t), !0)).call(_context11, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty2(_context12 = ownKeys(Object(t))).call(_context12, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
54
|
+
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); }; }
|
|
55
|
+
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; } }
|
|
55
56
|
/**
|
|
56
57
|
* sorter: [可选],不传表示该列不支持排序;为string表示按字符串排序;为number表示按数字大小排序
|
|
57
58
|
* filter: [可选],是否支持过滤,默认为false
|
|
@@ -105,6 +106,8 @@ var CallbackType = {
|
|
|
105
106
|
* childrenKey: [可选],设置子列表数据的key,默认children
|
|
106
107
|
*/
|
|
107
108
|
var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
109
|
+
(0, _inherits2["default"])(SuperTable, _React$Component);
|
|
110
|
+
var _super = _createSuper(SuperTable);
|
|
108
111
|
function SuperTable() {
|
|
109
112
|
var _context;
|
|
110
113
|
var _this;
|
|
@@ -112,18 +115,18 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
112
115
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
113
116
|
args[_key] = arguments[_key];
|
|
114
117
|
}
|
|
115
|
-
_this =
|
|
116
|
-
(0, _defineProperty2["default"])(_this, "state", {
|
|
118
|
+
_this = _super.call.apply(_super, (0, _concat["default"])(_context = [this]).call(_context, args));
|
|
119
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
|
|
117
120
|
filterVisibleKey: ''
|
|
118
121
|
});
|
|
119
|
-
(0, _defineProperty2["default"])(_this, "onTableChange", function (pagination, filters, sorter) {
|
|
122
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onTableChange", function (pagination, filters, sorter) {
|
|
120
123
|
var _ref = _this.props.callback || {},
|
|
121
124
|
onTableChange = _ref.onTableChange;
|
|
122
125
|
var _this$props$filterInf = _this.props.filterInfo,
|
|
123
126
|
filterInfo = _this$props$filterInf === void 0 ? null : _this$props$filterInf;
|
|
124
127
|
onTableChange && onTableChange(sorter, filterInfo);
|
|
125
128
|
});
|
|
126
|
-
(0, _defineProperty2["default"])(_this, "onChange", function () {
|
|
129
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function () {
|
|
127
130
|
var selectedKeyArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
128
131
|
var _ref2 = _this.props.callback || {},
|
|
129
132
|
onCheck = _ref2.onCheck;
|
|
@@ -159,22 +162,22 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
159
162
|
}
|
|
160
163
|
}
|
|
161
164
|
});
|
|
162
|
-
(0, _defineProperty2["default"])(_this, "onCheckChange", function (selectedKeys) {
|
|
165
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onCheckChange", function (selectedKeys) {
|
|
163
166
|
var _ref3 = _this.props.callback || {},
|
|
164
167
|
onCheck = _ref3.onCheck;
|
|
165
168
|
onCheck && onCheck(selectedKeys);
|
|
166
169
|
});
|
|
167
|
-
(0, _defineProperty2["default"])(_this, "onRadioChange", function (selectedKeys) {
|
|
170
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRadioChange", function (selectedKeys) {
|
|
168
171
|
var _ref4 = _this.props.callback || {},
|
|
169
172
|
onRadio = _ref4.onRadio;
|
|
170
173
|
onRadio && onRadio(selectedKeys);
|
|
171
174
|
});
|
|
172
|
-
(0, _defineProperty2["default"])(_this, "onRadioRowClick", function (record) {
|
|
175
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRadioRowClick", function (record) {
|
|
173
176
|
var _ref5 = _this.props.callback || {},
|
|
174
177
|
onRadio = _ref5.onRadio;
|
|
175
178
|
onRadio && onRadio([record.key]);
|
|
176
179
|
});
|
|
177
|
-
(0, _defineProperty2["default"])(_this, "onRowClick", function (record) {
|
|
180
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRowClick", function (record) {
|
|
178
181
|
var items = _this.props.items;
|
|
179
182
|
if (items.length <= record.key) return;
|
|
180
183
|
clearTimeout(_this.timer);
|
|
@@ -194,28 +197,28 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
194
197
|
}
|
|
195
198
|
}, 250);
|
|
196
199
|
});
|
|
197
|
-
(0, _defineProperty2["default"])(_this, "onDoubleClick", function (record) {
|
|
200
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDoubleClick", function (record) {
|
|
198
201
|
clearTimeout(_this.timer);
|
|
199
202
|
var _ref7 = _this.props.callback || {},
|
|
200
203
|
onDoubleClick = _ref7.onDoubleClick;
|
|
201
204
|
onDoubleClick && onDoubleClick(record.key);
|
|
202
205
|
});
|
|
203
|
-
(0, _defineProperty2["default"])(_this, "onLink", function (key, index, item, e) {
|
|
206
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onLink", function (key, index, item, e) {
|
|
204
207
|
var _ref8 = _this.props.callback || {},
|
|
205
208
|
onLink = _ref8.onLink;
|
|
206
209
|
onLink && onLink(key, index, item);
|
|
207
210
|
e.stopPropagation();
|
|
208
211
|
});
|
|
209
|
-
(0, _defineProperty2["default"])(_this, "onLinkDouble", function (e) {
|
|
212
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onLinkDouble", function (e) {
|
|
210
213
|
e.stopPropagation();
|
|
211
214
|
});
|
|
212
|
-
(0, _defineProperty2["default"])(_this, "getSelectedRowKeys", function (items) {
|
|
215
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getSelectedRowKeys", function (items) {
|
|
213
216
|
return (0, _reduce["default"])(items).call(items, function (result, item, index) {
|
|
214
217
|
item.checked && result.push(index);
|
|
215
218
|
return result;
|
|
216
219
|
}, []);
|
|
217
220
|
});
|
|
218
|
-
(0, _defineProperty2["default"])(_this, "getIndexInfo", function () {
|
|
221
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getIndexInfo", function () {
|
|
219
222
|
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
220
223
|
var _this$props = _this.props,
|
|
221
224
|
_this$props$index = _this$props.index,
|
|
@@ -230,7 +233,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
230
233
|
}
|
|
231
234
|
}] : [];
|
|
232
235
|
});
|
|
233
|
-
(0, _defineProperty2["default"])(_this, "setSortInfo", function (col, sortInfo) {
|
|
236
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setSortInfo", function (col, sortInfo) {
|
|
234
237
|
if (col.sorter === 'string') {
|
|
235
238
|
col.sortOrder = sortInfo.columnKey === col.key && sortInfo.order;
|
|
236
239
|
col.sorter = function (row1, row2) {
|
|
@@ -253,7 +256,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
253
256
|
delete col.sorter;
|
|
254
257
|
}
|
|
255
258
|
});
|
|
256
|
-
(0, _defineProperty2["default"])(_this, "setFilterInfo", function (col, filterInfo, visibleKey) {
|
|
259
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setFilterInfo", function (col, filterInfo, visibleKey) {
|
|
257
260
|
if ((0, _filter["default"])(col)) {
|
|
258
261
|
var _col$isDateFilterBySt = col.isDateFilterByStartAndEnd,
|
|
259
262
|
isDateFilterByStartAndEnd = _col$isDateFilterBySt === void 0 ? false : _col$isDateFilterBySt;
|
|
@@ -305,7 +308,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
305
308
|
}
|
|
306
309
|
delete col.filter;
|
|
307
310
|
});
|
|
308
|
-
(0, _defineProperty2["default"])(_this, "linkList", function (key, index, item) {
|
|
311
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "linkList", function (key, index, item) {
|
|
309
312
|
var linkTitleKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'fileName';
|
|
310
313
|
var list = item[key] || [];
|
|
311
314
|
return /*#__PURE__*/_react["default"].createElement("div", null, (0, _map["default"])(list).call(list, function (item2, index2) {
|
|
@@ -319,7 +322,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
319
322
|
}, (0, _concat["default"])(_context3 = "".concat(item2[linkTitleKey])).call(_context3, split));
|
|
320
323
|
}));
|
|
321
324
|
});
|
|
322
|
-
(0, _defineProperty2["default"])(_this, "waring", function (key, index, item, warningKey) {
|
|
325
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "waring", function (key, index, item, warningKey) {
|
|
323
326
|
var text = item[key] ? item[key] : '';
|
|
324
327
|
var color = item[warningKey] == 1 ? 'red' : 'rgba(0, 0, 0, 0.65)';
|
|
325
328
|
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", {
|
|
@@ -328,7 +331,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
328
331
|
}
|
|
329
332
|
}, text.title ? text.title : text));
|
|
330
333
|
});
|
|
331
|
-
(0, _defineProperty2["default"])(_this, "defaultList", function (key, index, item, text, link) {
|
|
334
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "defaultList", function (key, index, item, text, link) {
|
|
332
335
|
var _context4;
|
|
333
336
|
var onClick = (0, _bind["default"])(_context4 = _this.onLink).call(_context4, null, key, index, item);
|
|
334
337
|
if (link && typeof link === 'string') {
|
|
@@ -339,7 +342,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
339
342
|
}
|
|
340
343
|
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", null, text));
|
|
341
344
|
});
|
|
342
|
-
(0, _defineProperty2["default"])(_this, "getColumns", function (cols, items) {
|
|
345
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumns", function (cols, items) {
|
|
343
346
|
var _context5, _context6;
|
|
344
347
|
var _this$props2 = _this.props,
|
|
345
348
|
sortInfo = _this$props2.sortInfo,
|
|
@@ -347,8 +350,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
347
350
|
var filterVisibleKey = _this.state.filterVisibleKey;
|
|
348
351
|
return (0, _map["default"])(_context5 = (0, _concat["default"])(_context6 = _this.getIndexInfo(items)).call(_context6, (0, _filter["default"])(cols).call(cols, function (col) {
|
|
349
352
|
return !col.hide;
|
|
350
|
-
}))).call(_context5, function (
|
|
351
|
-
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(
|
|
353
|
+
}))).call(_context5, function (_ref10) {
|
|
354
|
+
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref10), _ref10));
|
|
352
355
|
col.dataIndex = col.key;
|
|
353
356
|
col.className = col.key === 'index' ? 'ant-table-selection-column' : col.align ? s[col.align] : '';
|
|
354
357
|
col.noWrap && (col.className = (0, _variables["default"])('SuperTable3').noWrap);
|
|
@@ -378,7 +381,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
378
381
|
return col;
|
|
379
382
|
});
|
|
380
383
|
});
|
|
381
|
-
(0, _defineProperty2["default"])(_this, "getText", function (value, options) {
|
|
384
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getText", function (value, options) {
|
|
382
385
|
if ((0, _isArray["default"])(value)) {
|
|
383
386
|
return (0, _map["default"])(value).call(value, function (v) {
|
|
384
387
|
return (0, _Control.getTitle)(v, options);
|
|
@@ -387,7 +390,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
387
390
|
return (0, _Control.getTitle)(value, options);
|
|
388
391
|
}
|
|
389
392
|
});
|
|
390
|
-
(0, _defineProperty2["default"])(_this, "link", function (key, index, item, text) {
|
|
393
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "link", function (key, index, item, text) {
|
|
391
394
|
var _context7;
|
|
392
395
|
var onClick = (0, _bind["default"])(_context7 = _this.onLink).call(_context7, null, key, index, item);
|
|
393
396
|
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
@@ -395,16 +398,16 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
395
398
|
onDoubleClick: _this.onLinkDouble
|
|
396
399
|
}, text);
|
|
397
400
|
});
|
|
398
|
-
(0, _defineProperty2["default"])(_this, "tooltip", function (key, index, item,
|
|
399
|
-
var tipLen =
|
|
400
|
-
options =
|
|
401
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "tooltip", function (key, index, item, _ref11) {
|
|
402
|
+
var tipLen = _ref11.tooltip,
|
|
403
|
+
options = _ref11.options;
|
|
401
404
|
var text = _this.getText(item[key], options);
|
|
402
405
|
var needTip = tipLen > 1 && text && typeof text === 'string' && text.length > tipLen;
|
|
403
406
|
return needTip ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
404
407
|
title: text
|
|
405
408
|
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _slice["default"])(text).call(text, 0, tipLen) + '...')) : /*#__PURE__*/_react["default"].createElement("span", null, (0, _isArray["default"])(text) ? text.join(',') : text);
|
|
406
409
|
});
|
|
407
|
-
(0, _defineProperty2["default"])(_this, "getImgSrc", function (value, options) {
|
|
410
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getImgSrc", function (value, options) {
|
|
408
411
|
var index = (0, _findIndex["default"])(options).call(options, function (obj) {
|
|
409
412
|
return obj.value == value;
|
|
410
413
|
});
|
|
@@ -417,7 +420,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
417
420
|
* @param options{array}:字段options
|
|
418
421
|
* @param dataSource{string,array}:数据源,如果列数据有多层则用此决定
|
|
419
422
|
*/
|
|
420
|
-
(0, _defineProperty2["default"])(_this, "getSourceText", function (item, key, options, dataSource) {
|
|
423
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getSourceText", function (item, key, options, dataSource) {
|
|
421
424
|
var value = {};
|
|
422
425
|
if (typeof dataSource === 'string') {
|
|
423
426
|
value = item[dataSource] || {};
|
|
@@ -437,14 +440,14 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
437
440
|
}
|
|
438
441
|
return _this.getText(value, options);
|
|
439
442
|
});
|
|
440
|
-
(0, _defineProperty2["default"])(_this, "getDataSource", function (items, cols) {
|
|
443
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getDataSource", function (items, cols) {
|
|
441
444
|
var getItemObj = function getItemObj(item, index) {
|
|
442
|
-
return (0, _reduce["default"])(cols).call(cols, function (result,
|
|
443
|
-
var key =
|
|
444
|
-
options =
|
|
445
|
-
link =
|
|
446
|
-
icon =
|
|
447
|
-
dataSource =
|
|
445
|
+
return (0, _reduce["default"])(cols).call(cols, function (result, _ref12) {
|
|
446
|
+
var key = _ref12.key,
|
|
447
|
+
options = _ref12.options,
|
|
448
|
+
link = _ref12.link,
|
|
449
|
+
icon = _ref12.icon,
|
|
450
|
+
dataSource = _ref12.dataSource;
|
|
448
451
|
if (link) {
|
|
449
452
|
if (typeof link === 'boolean') {
|
|
450
453
|
result[key] = _this.link(key, index, item, _this.getText(item[key], options));
|
|
@@ -473,14 +476,14 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
473
476
|
var _context9;
|
|
474
477
|
return _objectSpread(_objectSpread({}, getItemObj(item, index)), {}, {
|
|
475
478
|
children: item.children ? (0, _map["default"])(_context9 = item.children).call(_context9, function (item2, index2) {
|
|
476
|
-
var
|
|
477
|
-
return getItemObj(item2, (0, _concat["default"])(
|
|
479
|
+
var _context10;
|
|
480
|
+
return getItemObj(item2, (0, _concat["default"])(_context10 = "".concat(index, "-")).call(_context10, index2));
|
|
478
481
|
}) : null
|
|
479
482
|
});
|
|
480
483
|
});
|
|
481
484
|
return data;
|
|
482
485
|
});
|
|
483
|
-
(0, _defineProperty2["default"])(_this, "getPropsByCheckbox", function () {
|
|
486
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPropsByCheckbox", function () {
|
|
484
487
|
var _this$props3 = _this.props,
|
|
485
488
|
_this$props3$checkbox = _this$props3.checkbox,
|
|
486
489
|
checkbox = _this$props3$checkbox === void 0 ? true : _this$props3$checkbox,
|
|
@@ -506,7 +509,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
506
509
|
};
|
|
507
510
|
}
|
|
508
511
|
});
|
|
509
|
-
(0, _defineProperty2["default"])(_this, "getRowProps", function (onRowClick) {
|
|
512
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getRowProps", function (onRowClick) {
|
|
510
513
|
return function (record) {
|
|
511
514
|
return {
|
|
512
515
|
onClick: function onClick() {
|
|
@@ -518,7 +521,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
518
521
|
};
|
|
519
522
|
};
|
|
520
523
|
});
|
|
521
|
-
(0, _defineProperty2["default"])(_this, "getItems", function () {
|
|
524
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getItems", function () {
|
|
522
525
|
var _this$props4 = _this.props,
|
|
523
526
|
items = _this$props4.items,
|
|
524
527
|
childrenKey = _this$props4.childrenKey;
|
|
@@ -532,7 +535,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
532
535
|
}
|
|
533
536
|
return resItems;
|
|
534
537
|
});
|
|
535
|
-
(0, _defineProperty2["default"])(_this, "toTotalFooter", function () {
|
|
538
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toTotalFooter", function () {
|
|
536
539
|
var _this$props5 = _this.props,
|
|
537
540
|
cols = _this$props5.cols,
|
|
538
541
|
items = _this$props5.items,
|
|
@@ -545,11 +548,11 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
545
548
|
return (0, _includes["default"])(checkedRows).call(checkedRows, index);
|
|
546
549
|
});
|
|
547
550
|
var countItems = checkedItems.length ? checkedItems : items;
|
|
548
|
-
var totalItems = (0, _map["default"])(totalCols).call(totalCols, function (
|
|
549
|
-
var title =
|
|
550
|
-
key =
|
|
551
|
-
|
|
552
|
-
props =
|
|
551
|
+
var totalItems = (0, _map["default"])(totalCols).call(totalCols, function (_ref13) {
|
|
552
|
+
var title = _ref13.title,
|
|
553
|
+
key = _ref13.key,
|
|
554
|
+
_ref13$props = _ref13.props,
|
|
555
|
+
props = _ref13$props === void 0 ? {} : _ref13$props;
|
|
553
556
|
var value = (0, _reduce["default"])(countItems).call(countItems, function (result, item) {
|
|
554
557
|
return (0, _parseFloat2["default"])((result + Number(item[key] || 0)).toFixed(props.precision || 6));
|
|
555
558
|
}, 0);
|
|
@@ -567,9 +570,9 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
567
570
|
style: {
|
|
568
571
|
marginRight: "15px"
|
|
569
572
|
}
|
|
570
|
-
}, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), (0, _map["default"])(totalItems).call(totalItems, function (
|
|
571
|
-
var title =
|
|
572
|
-
value =
|
|
573
|
+
}, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), (0, _map["default"])(totalItems).call(totalItems, function (_ref14, index) {
|
|
574
|
+
var title = _ref14.title,
|
|
575
|
+
value = _ref14.value;
|
|
573
576
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
574
577
|
key: index,
|
|
575
578
|
style: {
|
|
@@ -585,7 +588,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
585
588
|
return null;
|
|
586
589
|
}
|
|
587
590
|
});
|
|
588
|
-
(0, _defineProperty2["default"])(_this, "getProps", function () {
|
|
591
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getProps", function () {
|
|
589
592
|
var _this$props6 = _this.props,
|
|
590
593
|
cols = _this$props6.cols,
|
|
591
594
|
_this$props6$isPaging = _this$props6.isPaging,
|
|
@@ -612,10 +615,10 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
612
615
|
}, extraProps);
|
|
613
616
|
return renderProps;
|
|
614
617
|
});
|
|
615
|
-
(0, _defineProperty2["default"])(_this, "setScroll", function () {
|
|
618
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setScroll", function () {
|
|
616
619
|
var maxHeight = _this.props.maxHeight;
|
|
617
620
|
if (maxHeight && _this.getItems().length) {
|
|
618
|
-
var root = _reactDom["default"].findDOMNode(_this);
|
|
621
|
+
var root = _reactDom["default"].findDOMNode((0, _assertThisInitialized2["default"])(_this));
|
|
619
622
|
var container = root.getElementsByClassName('ant-table-body')[0];
|
|
620
623
|
var header = root.getElementsByClassName('ant-table-thead')[0];
|
|
621
624
|
(0, _fixed["default"])(container, header, maxHeight);
|
|
@@ -623,8 +626,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
623
626
|
});
|
|
624
627
|
return _this;
|
|
625
628
|
}
|
|
626
|
-
(0,
|
|
627
|
-
return (0, _createClass2["default"])(SuperTable, [{
|
|
629
|
+
(0, _createClass2["default"])(SuperTable, [{
|
|
628
630
|
key: "shouldComponentUpdate",
|
|
629
631
|
value: function shouldComponentUpdate(props, state) {
|
|
630
632
|
var _this2 = this;
|
|
@@ -651,6 +653,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
651
653
|
}));
|
|
652
654
|
}
|
|
653
655
|
}]);
|
|
656
|
+
return SuperTable;
|
|
654
657
|
}(_react["default"].Component);
|
|
655
658
|
(0, _defineProperty2["default"])(SuperTable, "propTypes", {
|
|
656
659
|
cols: _propTypes["default"].arrayOf(_propTypes["default"].shape(ColType)).isRequired,
|