cloud-b2b 1.1.46 → 1.1.50

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 (109) hide show
  1. package/es/Area/Area.js +45 -16
  2. package/es/Card/Card.js +4 -3
  3. package/es/CodeInput/CodeInput.js +59 -30
  4. package/es/Control/Control.js +117 -58
  5. package/es/Control/event.js +14 -0
  6. package/es/Enhance/Dialogs.js +21 -6
  7. package/es/Enhance/Loading.js +46 -26
  8. package/es/Enhance/index.js +2 -0
  9. package/es/Header/Header.js +35 -3
  10. package/es/Header/Vertical.js +24 -1
  11. package/es/ImageView/ImageView.js +22 -5
  12. package/es/Indent/Indent.js +7 -3
  13. package/es/InpurCascader/InputCascader.js +36 -10
  14. package/es/InputEditor/InputEditor.js +52 -53
  15. package/es/InputSearch/InputSearch.js +71 -26
  16. package/es/InputSelect/InputSelect.js +48 -17
  17. package/es/InputTreeSelect/InputTreeSelect.js +147 -0
  18. package/es/InputTreeSelect/package.json +6 -0
  19. package/es/InputWriting/InputWriting.js +28 -6
  20. package/es/Layout/Layout.js +59 -28
  21. package/es/LayoutLink/LayoutLink.js +20 -11
  22. package/es/Link/Link.js +27 -4
  23. package/es/Loading/Loading.js +3 -1
  24. package/es/Loading2/Loading2.js +2 -0
  25. package/es/ModalWithDrag/ModalWithDrag.js +8 -3
  26. package/es/ModalWithDrag/drag.js +29 -12
  27. package/es/NumberInput/NumberInput.js +64 -24
  28. package/es/Search/Search.js +164 -54
  29. package/es/Sidebar/Sidebar.js +34 -13
  30. package/es/Sidebar2/Sidebar.js +30 -3
  31. package/es/SuperForm/SuperForm.js +164 -27
  32. package/es/SuperForm2/SuperForm.js +182 -31
  33. package/es/SuperIcon/SuperIcon.js +6 -3
  34. package/es/SuperPagination/SuperPagination.js +32 -15
  35. package/es/SuperTab/SuperTab.js +27 -4
  36. package/es/SuperTab2/SuperTab2.js +33 -11
  37. package/es/SuperTable/DragSortRow.js +34 -6
  38. package/es/SuperTable/FilterDropDown.js +34 -10
  39. package/es/SuperTable/SuperTable.js +216 -84
  40. package/es/SuperTable/fixed.js +9 -1
  41. package/es/SuperTable2/SuperTable2.js +226 -101
  42. package/es/SuperTable2/SuperTableCell.js +60 -16
  43. package/es/SuperTable3/FilterDropDown.js +34 -10
  44. package/es/SuperTable3/SuperTable.js +175 -50
  45. package/es/SuperTable3/fixed.js +9 -1
  46. package/es/SuperToolbar/SuperToolbar.js +49 -21
  47. package/es/SuperUpload/SuperUpload.js +233 -156
  48. package/es/Title/Title.js +15 -12
  49. package/es/Viewer/ImageViews.js +60 -7
  50. package/es/Viewer/Viewer.js +32 -5
  51. package/es/WingBlank/WingBlank.js +6 -2
  52. package/es/helper.js +29 -7
  53. package/es/history.js +2 -3
  54. package/lib/Area/Area.js +64 -16
  55. package/lib/Card/Card.js +13 -3
  56. package/lib/CodeInput/CodeInput.js +77 -30
  57. package/lib/Control/Control.js +160 -58
  58. package/lib/Control/event.js +16 -0
  59. package/lib/Enhance/Dialogs.js +32 -6
  60. package/lib/Enhance/Loading.js +62 -26
  61. package/lib/Enhance/index.js +9 -0
  62. package/lib/Header/Header.js +48 -3
  63. package/lib/Header/Vertical.js +36 -1
  64. package/lib/ImageView/ImageView.js +30 -5
  65. package/lib/Indent/Indent.js +13 -3
  66. package/lib/InpurCascader/InputCascader.js +50 -11
  67. package/lib/InputEditor/InputEditor.js +61 -53
  68. package/lib/InputSearch/InputSearch.js +78 -26
  69. package/lib/InputSelect/InputSelect.js +62 -17
  70. package/lib/InputTreeSelect/InputTreeSelect.js +169 -0
  71. package/lib/InputTreeSelect/package.json +6 -0
  72. package/lib/InputWriting/InputWriting.js +35 -6
  73. package/lib/Layout/Layout.js +76 -28
  74. package/lib/LayoutLink/LayoutLink.js +38 -11
  75. package/lib/Link/Link.js +40 -4
  76. package/lib/Loading/Loading.js +9 -1
  77. package/lib/Loading2/Loading2.js +8 -0
  78. package/lib/ModalWithDrag/ModalWithDrag.js +18 -3
  79. package/lib/ModalWithDrag/drag.js +34 -12
  80. package/lib/NumberInput/NumberInput.js +77 -24
  81. package/lib/Search/Search.js +171 -54
  82. package/lib/Sidebar/Sidebar.js +46 -13
  83. package/lib/Sidebar2/Sidebar.js +42 -3
  84. package/lib/SuperForm/SuperForm.js +162 -27
  85. package/lib/SuperForm2/SuperForm.js +175 -31
  86. package/lib/SuperIcon/SuperIcon.js +14 -3
  87. package/lib/SuperPagination/SuperPagination.js +42 -15
  88. package/lib/SuperTab/SuperTab.js +34 -4
  89. package/lib/SuperTab2/SuperTab2.js +48 -11
  90. package/lib/SuperTable/DragSortRow.js +42 -6
  91. package/lib/SuperTable/FilterDropDown.js +42 -10
  92. package/lib/SuperTable/SuperTable.js +211 -83
  93. package/lib/SuperTable/fixed.js +13 -1
  94. package/lib/SuperTable2/SuperTable2.js +240 -101
  95. package/lib/SuperTable2/SuperTableCell.js +67 -13
  96. package/lib/SuperTable3/FilterDropDown.js +42 -10
  97. package/lib/SuperTable3/SuperTable.js +170 -49
  98. package/lib/SuperTable3/fixed.js +13 -1
  99. package/lib/SuperToolbar/SuperToolbar.js +64 -20
  100. package/lib/SuperUpload/SuperUpload.js +267 -156
  101. package/lib/Title/Title.js +24 -12
  102. package/lib/Viewer/ImageViews.js +63 -7
  103. package/lib/Viewer/Viewer.js +41 -5
  104. package/lib/WingBlank/WingBlank.js +14 -2
  105. package/lib/helper.js +47 -6
  106. package/lib/history.js +5 -0
  107. package/lib/index.js +76 -0
  108. package/lib/variables.js +4 -0
  109. package/package.json +2 -2
@@ -14,83 +14,109 @@ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
14
14
  import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
15
15
  import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
16
16
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
17
+
17
18
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19
+
18
20
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
21
+
19
22
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
20
23
  import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
24
+
21
25
  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); }; }
26
+
22
27
  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; } }
28
+
23
29
  import React from 'react';
24
30
  import PropTypes from 'prop-types';
25
31
  import ReactDOM from 'react-dom';
26
32
  import Control from '../Control';
27
- import helper from "../helper";
28
-
29
- // 单元格的type只能取如下值:
33
+ import helper from "../helper"; // 单元格的type只能取如下值:
30
34
  // 'text', 'number', select', 'date', 'search', 'readonly', 'textArea', 'selectSearch'
31
35
 
32
36
  var isInRegion = function isInRegion(target, _ref) {
33
37
  var x = _ref.x,
34
- y = _ref.y;
38
+ y = _ref.y;
39
+
35
40
  var _target$getBoundingCl = target.getBoundingClientRect(),
36
- left = _target$getBoundingCl.left,
37
- right = _target$getBoundingCl.right,
38
- top = _target$getBoundingCl.top,
39
- bottom = _target$getBoundingCl.bottom;
41
+ left = _target$getBoundingCl.left,
42
+ right = _target$getBoundingCl.right,
43
+ top = _target$getBoundingCl.top,
44
+ bottom = _target$getBoundingCl.bottom;
45
+
40
46
  return !(x < left || x > right || y < top || y > bottom);
41
47
  };
48
+
42
49
  var SuperTableCell = /*#__PURE__*/function (_React$Component) {
43
50
  _inherits(SuperTableCell, _React$Component);
51
+
44
52
  var _super = _createSuper(SuperTableCell);
53
+
45
54
  function SuperTableCell() {
46
55
  var _context;
56
+
47
57
  var _this;
58
+
48
59
  _classCallCheck(this, SuperTableCell);
60
+
49
61
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
50
62
  args[_key] = arguments[_key];
51
63
  }
64
+
52
65
  _this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
66
+
53
67
  _defineProperty(_assertThisInitialized(_this), "onDateBlur", function (value, event) {
54
68
  if (!isInRegion(event.target, global.mousePos)) {
55
69
  _this.props.onBlur();
56
70
  }
57
71
  });
72
+
58
73
  _defineProperty(_assertThisInitialized(_this), "onChange", function (key, value) {
59
74
  var onChange = _this.props.onChange;
75
+
60
76
  if (onChange) {
61
77
  onChange(key, value);
62
78
  }
63
79
  });
80
+
64
81
  _defineProperty(_assertThisInitialized(_this), "onOpenChange", function (open) {
65
82
  if (!open) {
66
83
  var targets = document.getElementsByClassName('ant-calendar-picker-container');
84
+
67
85
  if (!isInRegion(targets[0], global.mousePos)) {
68
86
  _this.props.onBlur();
69
87
  }
70
88
  }
71
89
  });
90
+
72
91
  _defineProperty(_assertThisInitialized(_this), "options", function () {
73
92
  return _this.props.options || _this.props.typeRelated || [];
74
93
  });
94
+
75
95
  _defineProperty(_assertThisInitialized(_this), "getPopupContainer", function () {
76
96
  return ReactDOM.findDOMNode(_assertThisInitialized(_this));
77
97
  });
98
+
78
99
  _defineProperty(_assertThisInitialized(_this), "toTextComponent", function (props) {
79
100
  return /*#__PURE__*/React.createElement(Control, props);
80
101
  });
102
+
81
103
  _defineProperty(_assertThisInitialized(_this), "toTextAreaComponent", function (props) {
82
104
  return /*#__PURE__*/React.createElement(Control, props);
83
105
  });
106
+
84
107
  _defineProperty(_assertThisInitialized(_this), "toReadonlyComponent", function (props) {
85
108
  return /*#__PURE__*/React.createElement(Control, props);
86
109
  });
110
+
87
111
  _defineProperty(_assertThisInitialized(_this), "toNumberComponent", function (props) {
88
112
  props.defaultValue = props.value;
89
113
  delete props.value;
90
114
  return /*#__PURE__*/React.createElement(Control, props);
91
115
  });
116
+
92
117
  _defineProperty(_assertThisInitialized(_this), "toDoubleNumberComponent", function (props, cc) {
93
118
  var _context2, _context3;
119
+
94
120
  props.defaultValue = props.value;
95
121
  props.doubleKey = props.key;
96
122
  props.doubleValue = helper.getObject(cc, props.key);
@@ -99,32 +125,36 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
99
125
  delete props.value;
100
126
  return /*#__PURE__*/React.createElement(Control, props);
101
127
  });
128
+
102
129
  _defineProperty(_assertThisInitialized(_this), "toDateComponent", function (props) {
103
130
  //props.getCalendarContainer = this.getPopupContainer;
104
131
  props.onBlur = _this.onDateBlur;
105
132
  props.onOpenChange = _this.onOpenChange;
106
133
  return /*#__PURE__*/React.createElement(Control, props);
107
134
  });
135
+
108
136
  _defineProperty(_assertThisInitialized(_this), "toSelectComponent", function (props) {
109
137
  props.options = _this.options();
110
- props.dropdownMatchSelectWidth = false;
111
- //props.getPopupContainer = this.getPopupContainer;
138
+ props.dropdownMatchSelectWidth = false; //props.getPopupContainer = this.getPopupContainer;
139
+
112
140
  return /*#__PURE__*/React.createElement(Control, props);
113
141
  });
142
+
114
143
  _defineProperty(_assertThisInitialized(_this), "toSearchComponent", function (props) {
115
- props.options = _this.options();
116
- //props.getPopupContainer = this.getPopupContainer;
144
+ props.options = _this.options(); //props.getPopupContainer = this.getPopupContainer;
145
+
117
146
  props.onSearch = _this.props.onSearch;
118
147
  props.dropdownMatchSelectWidth = false;
119
148
  return /*#__PURE__*/React.createElement(Control, props);
120
149
  });
150
+
121
151
  _defineProperty(_assertThisInitialized(_this), "controlProps", function (_ref2) {
122
152
  var type = _ref2.type,
123
- value = _ref2.value,
124
- _ref2$props = _ref2.props,
125
- props = _ref2$props === void 0 ? {} : _ref2$props;
153
+ value = _ref2.value,
154
+ _ref2$props = _ref2.props,
155
+ props = _ref2$props === void 0 ? {} : _ref2$props;
126
156
  var _this$props$width = _this.props.width,
127
- width = _this$props$width === void 0 ? 100 : _this$props$width;
157
+ width = _this$props$width === void 0 ? 100 : _this$props$width;
128
158
  type === 'readonly' && (props = {});
129
159
  return _objectSpread(_objectSpread({}, props), {}, {
130
160
  type: type,
@@ -139,52 +169,65 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
139
169
  onChange: _this.props.onChange
140
170
  });
141
171
  });
172
+
142
173
  return _this;
143
174
  }
175
+
144
176
  _createClass(SuperTableCell, [{
145
177
  key: "render",
146
178
  value: function render() {
147
179
  var props = this.controlProps(this.props);
148
180
  var className = this.props.error ? 'has-error' : '';
181
+
149
182
  switch (this.props.type) {
150
183
  case "text":
151
184
  return /*#__PURE__*/React.createElement("div", {
152
185
  className: className
153
186
  }, this.toTextComponent(props));
187
+
154
188
  case "textArea":
155
189
  return /*#__PURE__*/React.createElement("div", {
156
190
  className: className
157
191
  }, this.toTextAreaComponent(props));
192
+
158
193
  case "number":
159
194
  return /*#__PURE__*/React.createElement("div", {
160
195
  className: className
161
196
  }, this.toNumberComponent(props));
197
+
162
198
  case "select":
163
199
  return /*#__PURE__*/React.createElement("div", {
164
200
  className: className
165
201
  }, this.toSelectComponent(props));
202
+
166
203
  case 'search':
167
204
  case 'selectSearch':
168
205
  return /*#__PURE__*/React.createElement("div", {
169
206
  className: className
170
207
  }, this.toSearchComponent(props));
208
+
171
209
  case "date":
172
210
  return /*#__PURE__*/React.createElement("div", {
173
211
  className: className
174
212
  }, this.toDateComponent(props));
213
+
175
214
  case 'readonly':
176
215
  return this.toReadonlyComponent(props);
216
+
177
217
  case 'double':
178
218
  return /*#__PURE__*/React.createElement("div", {
179
219
  className: className
180
220
  }, this.toDoubleNumberComponent(props, this.props.items));
221
+
181
222
  default:
182
223
  return /*#__PURE__*/React.createElement("div", null, "\"error type\"");
183
224
  }
184
225
  }
185
226
  }]);
227
+
186
228
  return SuperTableCell;
187
229
  }(React.Component);
230
+
188
231
  _defineProperty(SuperTableCell, "propTypes", {
189
232
  type: PropTypes.string.isRequired,
190
233
  value: PropTypes.any,
@@ -194,5 +237,6 @@ _defineProperty(SuperTableCell, "propTypes", {
194
237
  onSearch: PropTypes.func,
195
238
  onBlur: PropTypes.func
196
239
  });
240
+
197
241
  export default SuperTableCell;
198
242
  export { isInRegion };
@@ -9,39 +9,53 @@ import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleC
9
9
  import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
10
10
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
11
11
  import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
12
+
12
13
  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); }; }
14
+
13
15
  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; } }
16
+
14
17
  import React from 'react';
15
18
  import PropTypes from 'prop-types';
16
19
  import Control from "../Control/Control";
17
20
  import variables from '../variables';
21
+
18
22
  var FilterDropDown = /*#__PURE__*/function (_React$Component) {
19
23
  _inherits(FilterDropDown, _React$Component);
24
+
20
25
  var _super = _createSuper(FilterDropDown);
26
+
21
27
  function FilterDropDown(_props) {
22
28
  var _this;
29
+
23
30
  _classCallCheck(this, FilterDropDown);
31
+
24
32
  _this = _super.call(this, _props);
33
+
25
34
  _defineProperty(_assertThisInitialized(_this), "onChange", function (e) {
26
35
  _this.setState({
27
36
  value: e.target.value
28
37
  });
29
38
  });
39
+
30
40
  _defineProperty(_assertThisInitialized(_this), "onDateChange", function (key, value) {
31
41
  _this.setState(_defineProperty({}, key, value));
32
42
  });
43
+
33
44
  _defineProperty(_assertThisInitialized(_this), "onSearch", function () {
34
45
  var _this$props = _this.props,
35
- onSearch = _this$props.onSearch,
36
- isDateFilterByStartAndEnd = _this$props.isDateFilterByStartAndEnd;
46
+ onSearch = _this$props.onSearch,
47
+ isDateFilterByStartAndEnd = _this$props.isDateFilterByStartAndEnd;
48
+
37
49
  if (onSearch) {
38
50
  var value = !_this.state.start && !_this.state.end ? "" : _this.state;
39
51
  var val = isDateFilterByStartAndEnd ? value : _this.state.value;
40
52
  onSearch(val);
41
53
  }
42
54
  });
55
+
43
56
  _defineProperty(_assertThisInitialized(_this), "DateInputCreator", function () {
44
57
  var _context, _context2, _context3;
58
+
45
59
  var props = _this.props.props;
46
60
  var propsStart = {
47
61
  type: "date",
@@ -77,6 +91,7 @@ var FilterDropDown = /*#__PURE__*/function (_React$Component) {
77
91
  onClick: _bindInstanceProperty(_context3 = _this.onSearch).call(_context3, null, _this.props.type)
78
92
  }, "\u641C\u7D22")));
79
93
  });
94
+
80
95
  _defineProperty(_assertThisInitialized(_this), "InputCreator", function () {
81
96
  var props = {
82
97
  size: 'small',
@@ -95,15 +110,18 @@ var FilterDropDown = /*#__PURE__*/function (_React$Component) {
95
110
  type: "primary"
96
111
  }, "\u641C\u7D22"));
97
112
  });
113
+
98
114
  _this.state = {
99
115
  value: _props.value || ''
100
116
  };
117
+
101
118
  if (_props.isDateFilterByStartAndEnd) {
102
119
  var _ref = _props.value || {},
103
- _ref$start = _ref.start,
104
- start = _ref$start === void 0 ? '' : _ref$start,
105
- _ref$end = _ref.end,
106
- end = _ref$end === void 0 ? '' : _ref$end;
120
+ _ref$start = _ref.start,
121
+ start = _ref$start === void 0 ? '' : _ref$start,
122
+ _ref$end = _ref.end,
123
+ end = _ref$end === void 0 ? '' : _ref$end;
124
+
107
125
  _this.state = {
108
126
  start: start,
109
127
  end: end
@@ -113,17 +131,20 @@ var FilterDropDown = /*#__PURE__*/function (_React$Component) {
113
131
  value: _props.value || ''
114
132
  };
115
133
  }
134
+
116
135
  return _this;
117
136
  }
137
+
118
138
  _createClass(FilterDropDown, [{
119
139
  key: "componentWillReceiveProps",
120
140
  value: function componentWillReceiveProps(newProps) {
121
141
  if (newProps.isDateFilterByStartAndEnd) {
122
142
  var _ref2 = newProps.value || {},
123
- _ref2$start = _ref2.start,
124
- start = _ref2$start === void 0 ? '' : _ref2$start,
125
- _ref2$end = _ref2.end,
126
- end = _ref2$end === void 0 ? '' : _ref2$end;
143
+ _ref2$start = _ref2.start,
144
+ start = _ref2$start === void 0 ? '' : _ref2$start,
145
+ _ref2$end = _ref2.end,
146
+ end = _ref2$end === void 0 ? '' : _ref2$end;
147
+
127
148
  this.setState({
128
149
  start: start,
129
150
  end: end
@@ -154,11 +175,14 @@ var FilterDropDown = /*#__PURE__*/function (_React$Component) {
154
175
  return this.props.isDateFilterByStartAndEnd ? this.DateInputCreator() : this.InputCreator();
155
176
  }
156
177
  }]);
178
+
157
179
  return FilterDropDown;
158
180
  }(React.Component);
181
+
159
182
  _defineProperty(FilterDropDown, "propTypes", {
160
183
  value: PropTypes.any,
161
184
  onSearch: PropTypes.func,
162
185
  onClose: PropTypes.func
163
186
  });
187
+
164
188
  export default FilterDropDown;