cloud-b2b 1.1.62 → 1.1.63

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.
Files changed (80) hide show
  1. package/es/Area/Area.js +8 -11
  2. package/es/CodeInput/CodeInput.js +16 -19
  3. package/es/Enhance/Dialogs.js +11 -14
  4. package/es/Enhance/Loading.js +15 -18
  5. package/es/Header/Header.js +17 -20
  6. package/es/Header/Vertical.js +11 -14
  7. package/es/ImageView/ImageView.js +10 -13
  8. package/es/InpurCascader/InputCascader.js +11 -14
  9. package/es/InputEditor/InputEditor.js +16 -18
  10. package/es/InputSearch/InputSearch.js +19 -22
  11. package/es/InputSelect/InputSelect.js +14 -17
  12. package/es/InputTreeSelect/InputTreeSelect.js +10 -13
  13. package/es/InputWriting/InputWriting.js +12 -15
  14. package/es/Layout/Layout.js +14 -17
  15. package/es/Link/Link.js +7 -10
  16. package/es/NumberInput/NumberInput.js +13 -16
  17. package/es/Search/Search.js +52 -55
  18. package/es/Search2/Search.js +85 -88
  19. package/es/Search2/Search.less +64 -64
  20. package/es/Search2/package.json +6 -6
  21. package/es/Sidebar/Sidebar.js +11 -14
  22. package/es/Sidebar2/Sidebar.js +13 -16
  23. package/es/SuperForm/SuperForm.js +74 -79
  24. package/es/SuperForm2/SuperForm.js +95 -100
  25. package/es/SuperPagination/SuperPagination.js +8 -11
  26. package/es/SuperTab/SuperTab.js +12 -15
  27. package/es/SuperTab2/SuperTab2.js +13 -16
  28. package/es/SuperTable/DragSortRow.js +12 -15
  29. package/es/SuperTable/FilterDropDown.js +11 -14
  30. package/es/SuperTable/SuperTable.js +68 -71
  31. package/es/SuperTable2/SuperTable2.js +85 -88
  32. package/es/SuperTable2/SuperTableCell.js +27 -30
  33. package/es/SuperTable3/FilterDropDown.js +11 -14
  34. package/es/SuperTable3/SuperTable.js +58 -61
  35. package/es/SuperToolbar/SuperToolbar.js +11 -14
  36. package/es/SuperUpload/SuperUpload.js +107 -91
  37. package/es/Viewer/ImageViews.js +16 -19
  38. package/es/Viewer/Viewer.js +11 -14
  39. package/es/helper.js +18 -17
  40. package/lib/Area/Area.js +8 -11
  41. package/lib/CodeInput/CodeInput.js +16 -19
  42. package/lib/Enhance/Dialogs.js +11 -14
  43. package/lib/Enhance/Loading.js +15 -18
  44. package/lib/Header/Header.js +17 -20
  45. package/lib/Header/Vertical.js +11 -14
  46. package/lib/ImageView/ImageView.js +10 -13
  47. package/lib/InpurCascader/InputCascader.js +11 -14
  48. package/lib/InputEditor/InputEditor.js +16 -18
  49. package/lib/InputSearch/InputSearch.js +19 -22
  50. package/lib/InputSelect/InputSelect.js +14 -17
  51. package/lib/InputTreeSelect/InputTreeSelect.js +10 -13
  52. package/lib/InputWriting/InputWriting.js +12 -15
  53. package/lib/Layout/Layout.js +14 -17
  54. package/lib/LayoutLink/LayoutLink.js +1 -2
  55. package/lib/Link/Link.js +7 -10
  56. package/lib/NumberInput/NumberInput.js +13 -16
  57. package/lib/Search/Search.js +53 -57
  58. package/lib/Search2/Search.js +86 -90
  59. package/lib/Search2/Search.less +64 -64
  60. package/lib/Search2/package.json +6 -6
  61. package/lib/Sidebar/Sidebar.js +11 -14
  62. package/lib/Sidebar2/Sidebar.js +13 -16
  63. package/lib/SuperForm/SuperForm.js +75 -81
  64. package/lib/SuperForm2/SuperForm.js +96 -102
  65. package/lib/SuperPagination/SuperPagination.js +8 -11
  66. package/lib/SuperTab/SuperTab.js +12 -15
  67. package/lib/SuperTab2/SuperTab2.js +13 -16
  68. package/lib/SuperTable/DragSortRow.js +12 -15
  69. package/lib/SuperTable/FilterDropDown.js +11 -14
  70. package/lib/SuperTable/SuperTable.js +68 -71
  71. package/lib/SuperTable2/SuperTable2.js +86 -90
  72. package/lib/SuperTable2/SuperTableCell.js +27 -30
  73. package/lib/SuperTable3/FilterDropDown.js +11 -14
  74. package/lib/SuperTable3/SuperTable.js +58 -61
  75. package/lib/SuperToolbar/SuperToolbar.js +11 -14
  76. package/lib/SuperUpload/SuperUpload.js +96 -81
  77. package/lib/Viewer/ImageViews.js +16 -19
  78. package/lib/Viewer/Viewer.js +11 -14
  79. package/lib/helper.js +18 -17
  80. package/package.json +1 -1
@@ -9,17 +9,16 @@ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/obje
9
9
  import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
10
10
  import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
11
11
  import _createClass from "@babel/runtime-corejs3/helpers/createClass";
12
- import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
13
- import _inherits from "@babel/runtime-corejs3/helpers/inherits";
14
12
  import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
15
13
  import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
14
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
16
15
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
17
16
  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; }
18
17
  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) { _defineProperty(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; }
19
18
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
20
19
  import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
21
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
22
- 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; } }
20
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
21
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
23
22
  import React from 'react';
24
23
  import PropTypes from 'prop-types';
25
24
  import ReactDOM from 'react-dom';
@@ -40,8 +39,6 @@ var isInRegion = function isInRegion(target, _ref) {
40
39
  return !(x < left || x > right || y < top || y > bottom);
41
40
  };
42
41
  var SuperTableCell = /*#__PURE__*/function (_React$Component) {
43
- _inherits(SuperTableCell, _React$Component);
44
- var _super = _createSuper(SuperTableCell);
45
42
  function SuperTableCell() {
46
43
  var _context;
47
44
  var _this;
@@ -49,19 +46,19 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
49
46
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
50
47
  args[_key] = arguments[_key];
51
48
  }
52
- _this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
53
- _defineProperty(_assertThisInitialized(_this), "onDateBlur", function (value, event) {
49
+ _this = _callSuper(this, SuperTableCell, _concatInstanceProperty(_context = []).call(_context, args));
50
+ _defineProperty(_this, "onDateBlur", function (value, event) {
54
51
  if (!isInRegion(event.target, global.mousePos)) {
55
52
  _this.props.onBlur();
56
53
  }
57
54
  });
58
- _defineProperty(_assertThisInitialized(_this), "onChange", function (key, value) {
55
+ _defineProperty(_this, "onChange", function (key, value) {
59
56
  var onChange = _this.props.onChange;
60
57
  if (onChange) {
61
58
  onChange(key, value);
62
59
  }
63
60
  });
64
- _defineProperty(_assertThisInitialized(_this), "onOpenChange", function (open) {
61
+ _defineProperty(_this, "onOpenChange", function (open) {
65
62
  if (!open) {
66
63
  var targets = document.getElementsByClassName('ant-calendar-picker-container');
67
64
  if (!isInRegion(targets[0], global.mousePos)) {
@@ -69,71 +66,71 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
69
66
  }
70
67
  }
71
68
  });
72
- _defineProperty(_assertThisInitialized(_this), "options", function () {
69
+ _defineProperty(_this, "options", function () {
73
70
  return _this.props.options || _this.props.typeRelated || [];
74
71
  });
75
- _defineProperty(_assertThisInitialized(_this), "getPopupContainer", function () {
76
- return ReactDOM.findDOMNode(_assertThisInitialized(_this));
72
+ _defineProperty(_this, "getPopupContainer", function () {
73
+ return ReactDOM.findDOMNode(_this);
77
74
  });
78
- _defineProperty(_assertThisInitialized(_this), "toTextComponent", function (props) {
75
+ _defineProperty(_this, "toTextComponent", function (props) {
79
76
  return /*#__PURE__*/React.createElement(Control, props);
80
77
  });
81
- _defineProperty(_assertThisInitialized(_this), "toTextAreaComponent", function (props) {
78
+ _defineProperty(_this, "toTextAreaComponent", function (props) {
82
79
  return /*#__PURE__*/React.createElement(Control, props);
83
80
  });
84
- _defineProperty(_assertThisInitialized(_this), "toReadonlyComponent", function (props) {
81
+ _defineProperty(_this, "toReadonlyComponent", function (props) {
85
82
  return /*#__PURE__*/React.createElement(Control, props);
86
83
  });
87
- _defineProperty(_assertThisInitialized(_this), "toNumberComponent", function (props) {
84
+ _defineProperty(_this, "toNumberComponent", function (props) {
88
85
  props.defaultValue = props.value;
89
86
  delete props.value;
90
87
  return /*#__PURE__*/React.createElement(Control, props);
91
88
  });
92
- _defineProperty(_assertThisInitialized(_this), "toDoubleNumberComponent", function (props, cc) {
89
+ _defineProperty(_this, "toDoubleNumberComponent", function (props, cc) {
93
90
  var _context2, _context3;
94
91
  props.defaultValue = props.value;
95
92
  props.doubleKey = props.key;
96
93
  props.doubleValue = helper.getObject(cc, props.key);
97
- props.onChangeKey1 = _bindInstanceProperty(_context2 = _this.onChange).call(_context2, _assertThisInitialized(_this), props.key[0]);
98
- props.onChangeKey2 = _bindInstanceProperty(_context3 = _this.onChange).call(_context3, _assertThisInitialized(_this), props.key[1]);
94
+ props.onChangeKey1 = _bindInstanceProperty(_context2 = _this.onChange).call(_context2, _this, props.key[0]);
95
+ props.onChangeKey2 = _bindInstanceProperty(_context3 = _this.onChange).call(_context3, _this, props.key[1]);
99
96
  delete props.value;
100
97
  return /*#__PURE__*/React.createElement(Control, props);
101
98
  });
102
- _defineProperty(_assertThisInitialized(_this), "toDateComponent", function (props) {
99
+ _defineProperty(_this, "toDateComponent", function (props) {
103
100
  //props.getCalendarContainer = this.getPopupContainer;
104
101
  props.onBlur = _this.onDateBlur;
105
102
  props.onOpenChange = _this.onOpenChange;
106
103
  return /*#__PURE__*/React.createElement(Control, props);
107
104
  });
108
- _defineProperty(_assertThisInitialized(_this), "toSelectComponent", function (props) {
105
+ _defineProperty(_this, "toSelectComponent", function (props) {
109
106
  props.options = _this.options();
110
107
  props.dropdownMatchSelectWidth = false;
111
108
  //props.getPopupContainer = this.getPopupContainer;
112
109
  return /*#__PURE__*/React.createElement(Control, props);
113
110
  });
114
- _defineProperty(_assertThisInitialized(_this), "toSearchComponent", function (props) {
111
+ _defineProperty(_this, "toSearchComponent", function (props) {
115
112
  props.options = _this.options();
116
113
  //props.getPopupContainer = this.getPopupContainer;
117
114
  props.onSearch = _this.props.onSearch;
118
115
  props.dropdownMatchSelectWidth = false;
119
116
  return /*#__PURE__*/React.createElement(Control, props);
120
117
  });
121
- _defineProperty(_assertThisInitialized(_this), "toCascader", function (props) {
118
+ _defineProperty(_this, "toCascader", function (props) {
122
119
  props.options = _this.options() || [];
123
120
  props.onSearch = _this.props.onSearch;
124
121
  props.loadData = _this.props.onSearch;
125
122
  return /*#__PURE__*/React.createElement(Control, props);
126
123
  });
127
- _defineProperty(_assertThisInitialized(_this), "toSelectWriting", function (props) {
124
+ _defineProperty(_this, "toSelectWriting", function (props) {
128
125
  return /*#__PURE__*/React.createElement(Control, props);
129
126
  });
130
- _defineProperty(_assertThisInitialized(_this), "toRadioGroup", function (props) {
127
+ _defineProperty(_this, "toRadioGroup", function (props) {
131
128
  console.log(props);
132
129
  props.options = _this.options();
133
130
  return /*#__PURE__*/React.createElement(Control, props);
134
131
  });
135
132
  // 确保value的值为字符串(包含value和title的对象除外)
136
- _defineProperty(_assertThisInitialized(_this), "makeString", function (value) {
133
+ _defineProperty(_this, "makeString", function (value) {
137
134
  if (value === null || typeof value === 'undefined') {
138
135
  return '';
139
136
  } else if (typeof value === 'number') {
@@ -142,7 +139,7 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
142
139
  return value;
143
140
  }
144
141
  });
145
- _defineProperty(_assertThisInitialized(_this), "controlProps", function (_ref2) {
142
+ _defineProperty(_this, "controlProps", function (_ref2) {
146
143
  var type = _ref2.type,
147
144
  value = _ref2.value,
148
145
  _ref2$props = _ref2.props,
@@ -165,7 +162,8 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
165
162
  });
166
163
  return _this;
167
164
  }
168
- _createClass(SuperTableCell, [{
165
+ _inherits(SuperTableCell, _React$Component);
166
+ return _createClass(SuperTableCell, [{
169
167
  key: "render",
170
168
  value: function render() {
171
169
  var props = this.controlProps(this.props);
@@ -219,7 +217,6 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
219
217
  }
220
218
  }
221
219
  }]);
222
- return SuperTableCell;
223
220
  }(React.Component);
224
221
  _defineProperty(SuperTableCell, "propTypes", {
225
222
  type: PropTypes.string.isRequired,
@@ -3,34 +3,31 @@ import _Input from "antd/es/input";
3
3
  import _Button from "antd/es/button";
4
4
  import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
5
5
  import _createClass from "@babel/runtime-corejs3/helpers/createClass";
6
- import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
7
- import _inherits from "@babel/runtime-corejs3/helpers/inherits";
8
6
  import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
9
7
  import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
8
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
10
9
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
11
10
  import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
12
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
13
- 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; } }
11
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
12
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
14
13
  import React from 'react';
15
14
  import PropTypes from 'prop-types';
16
15
  import Control from "../Control/Control";
17
16
  import variables from '../variables';
18
17
  var FilterDropDown = /*#__PURE__*/function (_React$Component) {
19
- _inherits(FilterDropDown, _React$Component);
20
- var _super = _createSuper(FilterDropDown);
21
18
  function FilterDropDown(_props) {
22
19
  var _this;
23
20
  _classCallCheck(this, FilterDropDown);
24
- _this = _super.call(this, _props);
25
- _defineProperty(_assertThisInitialized(_this), "onChange", function (e) {
21
+ _this = _callSuper(this, FilterDropDown, [_props]);
22
+ _defineProperty(_this, "onChange", function (e) {
26
23
  _this.setState({
27
24
  value: e.target.value
28
25
  });
29
26
  });
30
- _defineProperty(_assertThisInitialized(_this), "onDateChange", function (key, value) {
27
+ _defineProperty(_this, "onDateChange", function (key, value) {
31
28
  _this.setState(_defineProperty({}, key, value));
32
29
  });
33
- _defineProperty(_assertThisInitialized(_this), "onSearch", function () {
30
+ _defineProperty(_this, "onSearch", function () {
34
31
  var _this$props = _this.props,
35
32
  onSearch = _this$props.onSearch,
36
33
  isDateFilterByStartAndEnd = _this$props.isDateFilterByStartAndEnd;
@@ -40,7 +37,7 @@ var FilterDropDown = /*#__PURE__*/function (_React$Component) {
40
37
  onSearch(val);
41
38
  }
42
39
  });
43
- _defineProperty(_assertThisInitialized(_this), "DateInputCreator", function () {
40
+ _defineProperty(_this, "DateInputCreator", function () {
44
41
  var _context, _context2, _context3;
45
42
  var props = _this.props.props;
46
43
  var propsStart = {
@@ -77,7 +74,7 @@ var FilterDropDown = /*#__PURE__*/function (_React$Component) {
77
74
  onClick: _bindInstanceProperty(_context3 = _this.onSearch).call(_context3, null, _this.props.type)
78
75
  }, "\u641C\u7D22")));
79
76
  });
80
- _defineProperty(_assertThisInitialized(_this), "InputCreator", function () {
77
+ _defineProperty(_this, "InputCreator", function () {
81
78
  var props = {
82
79
  size: 'small',
83
80
  value: _this.state.value,
@@ -115,7 +112,8 @@ var FilterDropDown = /*#__PURE__*/function (_React$Component) {
115
112
  }
116
113
  return _this;
117
114
  }
118
- _createClass(FilterDropDown, [{
115
+ _inherits(FilterDropDown, _React$Component);
116
+ return _createClass(FilterDropDown, [{
119
117
  key: "componentWillReceiveProps",
120
118
  value: function componentWillReceiveProps(newProps) {
121
119
  if (newProps.isDateFilterByStartAndEnd) {
@@ -154,7 +152,6 @@ var FilterDropDown = /*#__PURE__*/function (_React$Component) {
154
152
  return this.props.isDateFilterByStartAndEnd ? this.DateInputCreator() : this.InputCreator();
155
153
  }
156
154
  }]);
157
- return FilterDropDown;
158
155
  }(React.Component);
159
156
  _defineProperty(FilterDropDown, "propTypes", {
160
157
  value: PropTypes.any,
@@ -12,14 +12,13 @@ import _objectDestructuringEmpty from "@babel/runtime-corejs3/helpers/objectDest
12
12
  import _extends from "@babel/runtime-corejs3/helpers/extends";
13
13
  import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
14
14
  import _createClass from "@babel/runtime-corejs3/helpers/createClass";
15
- import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
16
- import _inherits from "@babel/runtime-corejs3/helpers/inherits";
17
15
  import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
18
16
  import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
17
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
19
18
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
20
19
  var _excluded = ["onRowClick"];
21
20
  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; }
22
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context11, _context12; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context11 = ownKeys(Object(t), !0)).call(_context11, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context12 = ownKeys(Object(t))).call(_context12, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
21
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context1, _context10; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context1 = ownKeys(Object(t), !0)).call(_context1, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context10 = ownKeys(Object(t))).call(_context10, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
23
22
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
24
23
  import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
25
24
  import _everyInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/every";
@@ -35,8 +34,8 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
35
34
  import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
36
35
  import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
37
36
  import _parseFloat from "@babel/runtime-corejs3/core-js-stable/parse-float";
38
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
39
- 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; } }
37
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
38
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
40
39
  import React from 'react';
41
40
  import PropTypes from 'prop-types';
42
41
  import ReactDOM from 'react-dom';
@@ -98,8 +97,6 @@ var CallbackType = {
98
97
  * childrenKey: [可选],设置子列表数据的key,默认children
99
98
  */
100
99
  var SuperTable = /*#__PURE__*/function (_React$Component) {
101
- _inherits(SuperTable, _React$Component);
102
- var _super = _createSuper(SuperTable);
103
100
  function SuperTable() {
104
101
  var _context;
105
102
  var _this;
@@ -107,18 +104,18 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
107
104
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
108
105
  args[_key] = arguments[_key];
109
106
  }
110
- _this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
111
- _defineProperty(_assertThisInitialized(_this), "state", {
107
+ _this = _callSuper(this, SuperTable, _concatInstanceProperty(_context = []).call(_context, args));
108
+ _defineProperty(_this, "state", {
112
109
  filterVisibleKey: ''
113
110
  });
114
- _defineProperty(_assertThisInitialized(_this), "onTableChange", function (pagination, filters, sorter) {
111
+ _defineProperty(_this, "onTableChange", function (pagination, filters, sorter) {
115
112
  var _ref = _this.props.callback || {},
116
113
  onTableChange = _ref.onTableChange;
117
114
  var _this$props$filterInf = _this.props.filterInfo,
118
115
  filterInfo = _this$props$filterInf === void 0 ? null : _this$props$filterInf;
119
116
  onTableChange && onTableChange(sorter, filterInfo);
120
117
  });
121
- _defineProperty(_assertThisInitialized(_this), "onChange", function () {
118
+ _defineProperty(_this, "onChange", function () {
122
119
  var selectedKeyArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
123
120
  var _ref2 = _this.props.callback || {},
124
121
  onCheck = _ref2.onCheck;
@@ -154,22 +151,22 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
154
151
  }
155
152
  }
156
153
  });
157
- _defineProperty(_assertThisInitialized(_this), "onCheckChange", function (selectedKeys) {
154
+ _defineProperty(_this, "onCheckChange", function (selectedKeys) {
158
155
  var _ref3 = _this.props.callback || {},
159
156
  onCheck = _ref3.onCheck;
160
157
  onCheck && onCheck(selectedKeys);
161
158
  });
162
- _defineProperty(_assertThisInitialized(_this), "onRadioChange", function (selectedKeys) {
159
+ _defineProperty(_this, "onRadioChange", function (selectedKeys) {
163
160
  var _ref4 = _this.props.callback || {},
164
161
  onRadio = _ref4.onRadio;
165
162
  onRadio && onRadio(selectedKeys);
166
163
  });
167
- _defineProperty(_assertThisInitialized(_this), "onRadioRowClick", function (record) {
164
+ _defineProperty(_this, "onRadioRowClick", function (record) {
168
165
  var _ref5 = _this.props.callback || {},
169
166
  onRadio = _ref5.onRadio;
170
167
  onRadio && onRadio([record.key]);
171
168
  });
172
- _defineProperty(_assertThisInitialized(_this), "onRowClick", function (record) {
169
+ _defineProperty(_this, "onRowClick", function (record) {
173
170
  var items = _this.props.items;
174
171
  if (items.length <= record.key) return;
175
172
  clearTimeout(_this.timer);
@@ -189,28 +186,28 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
189
186
  }
190
187
  }, 250);
191
188
  });
192
- _defineProperty(_assertThisInitialized(_this), "onDoubleClick", function (record) {
189
+ _defineProperty(_this, "onDoubleClick", function (record) {
193
190
  clearTimeout(_this.timer);
194
191
  var _ref7 = _this.props.callback || {},
195
192
  onDoubleClick = _ref7.onDoubleClick;
196
193
  onDoubleClick && onDoubleClick(record.key);
197
194
  });
198
- _defineProperty(_assertThisInitialized(_this), "onLink", function (key, index, item, e) {
195
+ _defineProperty(_this, "onLink", function (key, index, item, e) {
199
196
  var _ref8 = _this.props.callback || {},
200
197
  onLink = _ref8.onLink;
201
198
  onLink && onLink(key, index, item);
202
199
  e.stopPropagation();
203
200
  });
204
- _defineProperty(_assertThisInitialized(_this), "onLinkDouble", function (e) {
201
+ _defineProperty(_this, "onLinkDouble", function (e) {
205
202
  e.stopPropagation();
206
203
  });
207
- _defineProperty(_assertThisInitialized(_this), "getSelectedRowKeys", function (items) {
204
+ _defineProperty(_this, "getSelectedRowKeys", function (items) {
208
205
  return _reduceInstanceProperty(items).call(items, function (result, item, index) {
209
206
  item.checked && result.push(index);
210
207
  return result;
211
208
  }, []);
212
209
  });
213
- _defineProperty(_assertThisInitialized(_this), "getIndexInfo", function () {
210
+ _defineProperty(_this, "getIndexInfo", function () {
214
211
  var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
215
212
  var _this$props = _this.props,
216
213
  _this$props$index = _this$props.index,
@@ -225,7 +222,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
225
222
  }
226
223
  }] : [];
227
224
  });
228
- _defineProperty(_assertThisInitialized(_this), "setSortInfo", function (col, sortInfo) {
225
+ _defineProperty(_this, "setSortInfo", function (col, sortInfo) {
229
226
  if (col.sorter === 'string') {
230
227
  col.sortOrder = sortInfo.columnKey === col.key && sortInfo.order;
231
228
  col.sorter = function (row1, row2) {
@@ -248,7 +245,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
248
245
  delete col.sorter;
249
246
  }
250
247
  });
251
- _defineProperty(_assertThisInitialized(_this), "setFilterInfo", function (col, filterInfo, visibleKey) {
248
+ _defineProperty(_this, "setFilterInfo", function (col, filterInfo, visibleKey) {
252
249
  if (_filterInstanceProperty(col)) {
253
250
  var _col$isDateFilterBySt = col.isDateFilterByStartAndEnd,
254
251
  isDateFilterByStartAndEnd = _col$isDateFilterBySt === void 0 ? false : _col$isDateFilterBySt;
@@ -300,7 +297,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
300
297
  }
301
298
  delete col.filter;
302
299
  });
303
- _defineProperty(_assertThisInitialized(_this), "linkList", function (key, index, item) {
300
+ _defineProperty(_this, "linkList", function (key, index, item) {
304
301
  var linkTitleKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'fileName';
305
302
  var list = item[key] || [];
306
303
  return /*#__PURE__*/React.createElement("div", null, _mapInstanceProperty(list).call(list, function (item2, index2) {
@@ -314,7 +311,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
314
311
  }, _concatInstanceProperty(_context3 = "".concat(item2[linkTitleKey])).call(_context3, split));
315
312
  }));
316
313
  });
317
- _defineProperty(_assertThisInitialized(_this), "waring", function (key, index, item, warningKey) {
314
+ _defineProperty(_this, "waring", function (key, index, item, warningKey) {
318
315
  var text = item[key] ? item[key] : '';
319
316
  var color = item[warningKey] == 1 ? 'red' : 'rgba(0, 0, 0, 0.65)';
320
317
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", {
@@ -323,7 +320,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
323
320
  }
324
321
  }, text.title ? text.title : text));
325
322
  });
326
- _defineProperty(_assertThisInitialized(_this), "defaultList", function (key, index, item, text, link) {
323
+ _defineProperty(_this, "defaultList", function (key, index, item, text, link) {
327
324
  var _context4;
328
325
  var onClick = _bindInstanceProperty(_context4 = _this.onLink).call(_context4, null, key, index, item);
329
326
  if (link && typeof link === 'string') {
@@ -334,7 +331,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
334
331
  }
335
332
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, text));
336
333
  });
337
- _defineProperty(_assertThisInitialized(_this), "getColumns", function (cols, items) {
334
+ _defineProperty(_this, "getColumns", function (cols, items) {
338
335
  var _context5, _context6;
339
336
  var _this$props2 = _this.props,
340
337
  sortInfo = _this$props2.sortInfo,
@@ -342,8 +339,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
342
339
  var filterVisibleKey = _this.state.filterVisibleKey;
343
340
  return _mapInstanceProperty(_context5 = _concatInstanceProperty(_context6 = _this.getIndexInfo(items)).call(_context6, _filterInstanceProperty(cols).call(cols, function (col) {
344
341
  return !col.hide;
345
- }))).call(_context5, function (_ref10) {
346
- var col = _extends({}, (_objectDestructuringEmpty(_ref10), _ref10));
342
+ }))).call(_context5, function (_ref0) {
343
+ var col = _extends({}, (_objectDestructuringEmpty(_ref0), _ref0));
347
344
  col.dataIndex = col.key;
348
345
  col.className = col.key === 'index' ? 'ant-table-selection-column' : col.align ? s[col.align] : '';
349
346
  col.noWrap && (col.className = variables('SuperTable3').noWrap);
@@ -373,7 +370,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
373
370
  return col;
374
371
  });
375
372
  });
376
- _defineProperty(_assertThisInitialized(_this), "getText", function (value, options) {
373
+ _defineProperty(_this, "getText", function (value, options) {
377
374
  if (_Array$isArray(value)) {
378
375
  return _mapInstanceProperty(value).call(value, function (v) {
379
376
  return getTitle(v, options);
@@ -382,7 +379,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
382
379
  return getTitle(value, options);
383
380
  }
384
381
  });
385
- _defineProperty(_assertThisInitialized(_this), "link", function (key, index, item, text) {
382
+ _defineProperty(_this, "link", function (key, index, item, text) {
386
383
  var _context7;
387
384
  var onClick = _bindInstanceProperty(_context7 = _this.onLink).call(_context7, null, key, index, item);
388
385
  return /*#__PURE__*/React.createElement("a", {
@@ -390,16 +387,16 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
390
387
  onDoubleClick: _this.onLinkDouble
391
388
  }, text);
392
389
  });
393
- _defineProperty(_assertThisInitialized(_this), "tooltip", function (key, index, item, _ref11) {
394
- var tipLen = _ref11.tooltip,
395
- options = _ref11.options;
390
+ _defineProperty(_this, "tooltip", function (key, index, item, _ref1) {
391
+ var tipLen = _ref1.tooltip,
392
+ options = _ref1.options;
396
393
  var text = _this.getText(item[key], options);
397
394
  var needTip = tipLen > 1 && text && typeof text === 'string' && text.length > tipLen;
398
395
  return needTip ? /*#__PURE__*/React.createElement(_Tooltip, {
399
396
  title: text
400
397
  }, /*#__PURE__*/React.createElement("span", null, _sliceInstanceProperty(text).call(text, 0, tipLen) + '...')) : /*#__PURE__*/React.createElement("span", null, _Array$isArray(text) ? text.join(',') : text);
401
398
  });
402
- _defineProperty(_assertThisInitialized(_this), "getImgSrc", function (value, options) {
399
+ _defineProperty(_this, "getImgSrc", function (value, options) {
403
400
  var index = _findIndexInstanceProperty(options).call(options, function (obj) {
404
401
  return obj.value == value;
405
402
  });
@@ -412,7 +409,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
412
409
  * @param options{array}:字段options
413
410
  * @param dataSource{string,array}:数据源,如果列数据有多层则用此决定
414
411
  */
415
- _defineProperty(_assertThisInitialized(_this), "getSourceText", function (item, key, options, dataSource) {
412
+ _defineProperty(_this, "getSourceText", function (item, key, options, dataSource) {
416
413
  var value = {};
417
414
  if (typeof dataSource === 'string') {
418
415
  value = item[dataSource] || {};
@@ -432,14 +429,14 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
432
429
  }
433
430
  return _this.getText(value, options);
434
431
  });
435
- _defineProperty(_assertThisInitialized(_this), "getDataSource", function (items, cols) {
432
+ _defineProperty(_this, "getDataSource", function (items, cols) {
436
433
  var getItemObj = function getItemObj(item, index) {
437
- return _reduceInstanceProperty(cols).call(cols, function (result, _ref12) {
438
- var key = _ref12.key,
439
- options = _ref12.options,
440
- link = _ref12.link,
441
- icon = _ref12.icon,
442
- dataSource = _ref12.dataSource;
434
+ return _reduceInstanceProperty(cols).call(cols, function (result, _ref10) {
435
+ var key = _ref10.key,
436
+ options = _ref10.options,
437
+ link = _ref10.link,
438
+ icon = _ref10.icon,
439
+ dataSource = _ref10.dataSource;
443
440
  if (link) {
444
441
  if (typeof link === 'boolean') {
445
442
  result[key] = _this.link(key, index, item, _this.getText(item[key], options));
@@ -468,14 +465,14 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
468
465
  var _context9;
469
466
  return _objectSpread(_objectSpread({}, getItemObj(item, index)), {}, {
470
467
  children: item.children ? _mapInstanceProperty(_context9 = item.children).call(_context9, function (item2, index2) {
471
- var _context10;
472
- return getItemObj(item2, _concatInstanceProperty(_context10 = "".concat(index, "-")).call(_context10, index2));
468
+ var _context0;
469
+ return getItemObj(item2, _concatInstanceProperty(_context0 = "".concat(index, "-")).call(_context0, index2));
473
470
  }) : null
474
471
  });
475
472
  });
476
473
  return data;
477
474
  });
478
- _defineProperty(_assertThisInitialized(_this), "getPropsByCheckbox", function () {
475
+ _defineProperty(_this, "getPropsByCheckbox", function () {
479
476
  var _this$props3 = _this.props,
480
477
  _this$props3$checkbox = _this$props3.checkbox,
481
478
  checkbox = _this$props3$checkbox === void 0 ? true : _this$props3$checkbox,
@@ -501,7 +498,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
501
498
  };
502
499
  }
503
500
  });
504
- _defineProperty(_assertThisInitialized(_this), "getRowProps", function (onRowClick) {
501
+ _defineProperty(_this, "getRowProps", function (onRowClick) {
505
502
  return function (record) {
506
503
  return {
507
504
  onClick: function onClick() {
@@ -513,7 +510,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
513
510
  };
514
511
  };
515
512
  });
516
- _defineProperty(_assertThisInitialized(_this), "getItems", function () {
513
+ _defineProperty(_this, "getItems", function () {
517
514
  var _this$props4 = _this.props,
518
515
  items = _this$props4.items,
519
516
  childrenKey = _this$props4.childrenKey;
@@ -527,7 +524,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
527
524
  }
528
525
  return resItems;
529
526
  });
530
- _defineProperty(_assertThisInitialized(_this), "toTotalFooter", function () {
527
+ _defineProperty(_this, "toTotalFooter", function () {
531
528
  var _this$props5 = _this.props,
532
529
  cols = _this$props5.cols,
533
530
  items = _this$props5.items,
@@ -540,11 +537,11 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
540
537
  return _includesInstanceProperty(checkedRows).call(checkedRows, index);
541
538
  });
542
539
  var countItems = checkedItems.length ? checkedItems : items;
543
- var totalItems = _mapInstanceProperty(totalCols).call(totalCols, function (_ref13) {
544
- var title = _ref13.title,
545
- key = _ref13.key,
546
- _ref13$props = _ref13.props,
547
- props = _ref13$props === void 0 ? {} : _ref13$props;
540
+ var totalItems = _mapInstanceProperty(totalCols).call(totalCols, function (_ref11) {
541
+ var title = _ref11.title,
542
+ key = _ref11.key,
543
+ _ref11$props = _ref11.props,
544
+ props = _ref11$props === void 0 ? {} : _ref11$props;
548
545
  var value = _reduceInstanceProperty(countItems).call(countItems, function (result, item) {
549
546
  return _parseFloat((result + Number(item[key] || 0)).toFixed(props.precision || 6));
550
547
  }, 0);
@@ -562,9 +559,9 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
562
559
  style: {
563
560
  marginRight: "15px"
564
561
  }
565
- }, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), _mapInstanceProperty(totalItems).call(totalItems, function (_ref14, index) {
566
- var title = _ref14.title,
567
- value = _ref14.value;
562
+ }, checkedItems.length ? '【当页勾选汇总】' : '【当页汇总】'), _mapInstanceProperty(totalItems).call(totalItems, function (_ref12, index) {
563
+ var title = _ref12.title,
564
+ value = _ref12.value;
568
565
  return /*#__PURE__*/React.createElement("span", {
569
566
  key: index,
570
567
  style: {
@@ -580,7 +577,7 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
580
577
  return null;
581
578
  }
582
579
  });
583
- _defineProperty(_assertThisInitialized(_this), "getProps", function () {
580
+ _defineProperty(_this, "getProps", function () {
584
581
  var _this$props6 = _this.props,
585
582
  cols = _this$props6.cols,
586
583
  _this$props6$isPaging = _this$props6.isPaging,
@@ -607,10 +604,10 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
607
604
  }, extraProps);
608
605
  return renderProps;
609
606
  });
610
- _defineProperty(_assertThisInitialized(_this), "setScroll", function () {
607
+ _defineProperty(_this, "setScroll", function () {
611
608
  var maxHeight = _this.props.maxHeight;
612
609
  if (maxHeight && _this.getItems().length) {
613
- var root = ReactDOM.findDOMNode(_assertThisInitialized(_this));
610
+ var root = ReactDOM.findDOMNode(_this);
614
611
  var container = root.getElementsByClassName('ant-table-body')[0];
615
612
  var header = root.getElementsByClassName('ant-table-thead')[0];
616
613
  fixed(container, header, maxHeight);
@@ -618,7 +615,8 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
618
615
  });
619
616
  return _this;
620
617
  }
621
- _createClass(SuperTable, [{
618
+ _inherits(SuperTable, _React$Component);
619
+ return _createClass(SuperTable, [{
622
620
  key: "shouldComponentUpdate",
623
621
  value: function shouldComponentUpdate(props, state) {
624
622
  var _this2 = this;
@@ -645,7 +643,6 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
645
643
  }));
646
644
  }
647
645
  }]);
648
- return SuperTable;
649
646
  }(React.Component);
650
647
  _defineProperty(SuperTable, "propTypes", {
651
648
  cols: PropTypes.arrayOf(PropTypes.shape(ColType)).isRequired,