cloud-b2b 1.1.26 → 1.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/es/Area/Area.js +16 -45
  2. package/es/Card/Card.js +3 -4
  3. package/es/CodeInput/CodeInput.js +30 -59
  4. package/es/Control/Control.js +47 -94
  5. package/es/Control/event.js +0 -14
  6. package/es/Enhance/Dialogs.js +0 -15
  7. package/es/Enhance/Loading.js +16 -36
  8. package/es/Enhance/index.js +0 -2
  9. package/es/Header/Header.js +3 -35
  10. package/es/Header/Vertical.js +1 -24
  11. package/es/ImageView/ImageView.js +5 -22
  12. package/es/Indent/Indent.js +3 -7
  13. package/es/InpurCascader/InputCascader.js +10 -36
  14. package/es/InputEditor/InputEditor.js +55 -55
  15. package/es/InputSearch/InputSearch.js +26 -71
  16. package/es/InputSelect/InputSelect.js +17 -48
  17. package/es/InputWriting/InputWriting.js +6 -28
  18. package/es/Layout/Layout.js +28 -59
  19. package/es/LayoutLink/LayoutLink.js +11 -20
  20. package/es/Link/Link.js +4 -27
  21. package/es/Loading/Loading.js +1 -3
  22. package/es/Loading2/Loading2.js +0 -2
  23. package/es/ModalWithDrag/ModalWithDrag.js +3 -8
  24. package/es/ModalWithDrag/drag.js +12 -29
  25. package/es/NumberInput/NumberInput.js +24 -63
  26. package/es/Search/Search.js +53 -149
  27. package/es/Sidebar/Sidebar.js +13 -34
  28. package/es/Sidebar2/Sidebar.js +3 -30
  29. package/es/SuperForm/SuperForm.js +27 -150
  30. package/es/SuperForm2/SuperForm.js +31 -165
  31. package/es/SuperIcon/SuperIcon.js +3 -6
  32. package/es/SuperPagination/SuperPagination.js +15 -32
  33. package/es/SuperTab/SuperTab.js +4 -27
  34. package/es/SuperTab2/SuperTab2.js +11 -33
  35. package/es/SuperTable/DragSortRow.js +6 -34
  36. package/es/SuperTable/FilterDropDown.js +10 -34
  37. package/es/SuperTable/SuperTable.js +91 -216
  38. package/es/SuperTable/fixed.js +1 -9
  39. package/es/SuperTable2/SuperTable2.js +104 -206
  40. package/es/SuperTable2/SuperTableCell.js +16 -55
  41. package/es/SuperTable3/FilterDropDown.js +10 -34
  42. package/es/SuperTable3/SuperTable.js +57 -175
  43. package/es/SuperTable3/fixed.js +1 -9
  44. package/es/SuperToolbar/SuperToolbar.js +21 -49
  45. package/es/SuperUpload/SuperUpload.js +73 -110
  46. package/es/Title/Title.js +12 -15
  47. package/es/Viewer/ImageViews.js +7 -60
  48. package/es/Viewer/Viewer.js +7 -34
  49. package/es/WingBlank/WingBlank.js +2 -6
  50. package/es/helper.js +36 -23
  51. package/es/history.js +3 -2
  52. package/lib/Area/Area.js +16 -64
  53. package/lib/Card/Card.js +3 -13
  54. package/lib/CodeInput/CodeInput.js +30 -77
  55. package/lib/Control/Control.js +47 -135
  56. package/lib/Control/event.js +0 -16
  57. package/lib/Enhance/Dialogs.js +0 -26
  58. package/lib/Enhance/Loading.js +16 -52
  59. package/lib/Enhance/index.js +0 -9
  60. package/lib/Header/Header.js +3 -48
  61. package/lib/Header/Vertical.js +1 -36
  62. package/lib/ImageView/ImageView.js +5 -30
  63. package/lib/Indent/Indent.js +3 -13
  64. package/lib/InpurCascader/InputCascader.js +11 -50
  65. package/lib/InputEditor/InputEditor.js +55 -64
  66. package/lib/InputSearch/InputSearch.js +26 -78
  67. package/lib/InputSelect/InputSelect.js +17 -62
  68. package/lib/InputWriting/InputWriting.js +6 -35
  69. package/lib/Layout/Layout.js +28 -76
  70. package/lib/LayoutLink/LayoutLink.js +11 -38
  71. package/lib/Link/Link.js +4 -40
  72. package/lib/Loading/Loading.js +1 -9
  73. package/lib/Loading2/Loading2.js +0 -8
  74. package/lib/ModalWithDrag/ModalWithDrag.js +3 -18
  75. package/lib/ModalWithDrag/drag.js +12 -34
  76. package/lib/NumberInput/NumberInput.js +24 -76
  77. package/lib/Search/Search.js +53 -157
  78. package/lib/Sidebar/Sidebar.js +13 -46
  79. package/lib/Sidebar2/Sidebar.js +3 -42
  80. package/lib/SuperForm/SuperForm.js +27 -149
  81. package/lib/SuperForm2/SuperForm.js +31 -160
  82. package/lib/SuperIcon/SuperIcon.js +3 -14
  83. package/lib/SuperPagination/SuperPagination.js +15 -42
  84. package/lib/SuperTab/SuperTab.js +4 -34
  85. package/lib/SuperTab2/SuperTab2.js +11 -48
  86. package/lib/SuperTable/DragSortRow.js +6 -42
  87. package/lib/SuperTable/FilterDropDown.js +10 -42
  88. package/lib/SuperTable/SuperTable.js +90 -210
  89. package/lib/SuperTable/fixed.js +1 -13
  90. package/lib/SuperTable2/SuperTable2.js +104 -222
  91. package/lib/SuperTable2/SuperTableCell.js +13 -62
  92. package/lib/SuperTable3/FilterDropDown.js +10 -42
  93. package/lib/SuperTable3/SuperTable.js +56 -169
  94. package/lib/SuperTable3/fixed.js +1 -13
  95. package/lib/SuperToolbar/SuperToolbar.js +20 -64
  96. package/lib/SuperUpload/SuperUpload.js +73 -140
  97. package/lib/Title/Title.js +12 -24
  98. package/lib/Viewer/ImageViews.js +7 -63
  99. package/lib/Viewer/Viewer.js +7 -43
  100. package/lib/WingBlank/WingBlank.js +2 -14
  101. package/lib/helper.js +36 -37
  102. package/lib/history.js +0 -5
  103. package/lib/index.js +0 -76
  104. package/lib/variables.js +0 -4
  105. package/package.json +1 -1
@@ -10,17 +10,12 @@ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
10
10
  import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
11
11
  import _JSON$stringify from "@babel/runtime-corejs3/core-js-stable/json/stringify";
12
12
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
13
-
14
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); }; }
15
-
16
14
  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; } }
17
-
18
15
  import React from "react";
19
16
  import variables from '../variables';
20
-
21
17
  var addEvent = function addEvent(el, event, handler) {
22
18
  if (!el) return;
23
-
24
19
  if (el.attachEvent) {
25
20
  el.attachEvent('on' + event, handler);
26
21
  } else if (el.addEventListener) {
@@ -29,10 +24,8 @@ var addEvent = function addEvent(el, event, handler) {
29
24
  el['on' + event] = handler;
30
25
  }
31
26
  };
32
-
33
27
  var removeEvent = function removeEvent(el, event, handler) {
34
28
  if (!el) return;
35
-
36
29
  if (el.detachEvent) {
37
30
  el.detachEvent('on' + event, handler);
38
31
  } else if (el.removeEventListener) {
@@ -41,63 +34,48 @@ var removeEvent = function removeEvent(el, event, handler) {
41
34
  el['on' + event] = null;
42
35
  }
43
36
  };
44
-
45
37
  var getCss = function getCss(o, key) {
46
38
  return o.currentStyle ? o.currentStyle[key] : document.defaultView.getComputedStyle(o)[key];
47
- }; // 获取元素旋转的角度
48
-
39
+ };
49
40
 
41
+ // 获取元素旋转的角度
50
42
  var getRotateDeg = function getRotateDeg(target) {
51
43
  var rotateMatrix = getCss(target, 'transform');
52
-
53
44
  var _rotateMatrix$split$ = rotateMatrix.split('(')[1].split(')')[0].split(','),
54
- _rotateMatrix$split$2 = _slicedToArray(_rotateMatrix$split$, 2),
55
- a = _rotateMatrix$split$2[0],
56
- b = _rotateMatrix$split$2[1];
57
-
45
+ _rotateMatrix$split$2 = _slicedToArray(_rotateMatrix$split$, 2),
46
+ a = _rotateMatrix$split$2[0],
47
+ b = _rotateMatrix$split$2[1];
58
48
  return Math.round(Math.atan2(b, a) * (180 / Math.PI));
59
49
  };
60
-
61
50
  var ImageViews = /*#__PURE__*/function (_React$Component) {
62
51
  _inherits(ImageViews, _React$Component);
63
-
64
52
  var _super = _createSuper(ImageViews);
65
-
66
53
  function ImageViews(props) {
67
54
  var _this;
68
-
69
55
  _classCallCheck(this, ImageViews);
70
-
71
56
  _this = _super.call(this, props);
72
-
73
57
  _defineProperty(_assertThisInitialized(_this), "_onwheel", function (e) {
74
58
  var zoom = _this.state.zoom;
75
59
  /*事件兼容*/
76
-
77
60
  var event = e || window.event;
78
61
  var imageDOM = _this.imgRef;
79
62
  var delta;
80
-
81
63
  if (event.nativeEvent.wheelDelta) {
82
64
  delta = event.nativeEvent.wheelDelta / 1200;
83
65
  } else if (event.nativeEvent.deltaY) {
84
66
  delta = -event.nativeEvent.deltaY / 1200;
85
67
  }
86
-
87
68
  var zoomVal = zoom + delta;
88
-
89
69
  if (zoomVal >= 0.2) {
90
70
  imageDOM.style.transform = "translate(-50%,-50%) scale(".concat(zoomVal, ")");
91
71
  } else {
92
72
  zoomVal = 0.2;
93
73
  imageDOM.style.transform = "translate(-50%,-50%) scale(".concat(zoomVal, ")");
94
74
  }
95
-
96
75
  _this.setState({
97
76
  zoom: zoomVal
98
77
  });
99
78
  });
100
-
101
79
  _defineProperty(_assertThisInitialized(_this), "_onMouseDown", function (e) {
102
80
  /*事件兼容*/
103
81
  var event = e || window.event;
@@ -106,94 +84,74 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
106
84
 
107
85
  var startTouch = {};
108
86
  startTouch.initiated = true; //initiated为true表示开始滑动
109
-
110
87
  /*获取鼠标按下的地方距离元素左侧和上侧的距离*/
111
-
112
88
  startTouch.startX = event.nativeEvent.clientX - imageDOM.offsetLeft;
113
89
  startTouch.startY = event.nativeEvent.clientY - imageDOM.offsetTop;
114
-
115
90
  _this.setState({
116
91
  startTouch: startTouch
117
92
  });
118
-
119
93
  addEvent(document, 'mousemove', _this._onMouseMove);
120
94
  addEvent(document, 'mouseup', _this._onMouseUp);
121
95
  });
122
-
123
96
  _defineProperty(_assertThisInitialized(_this), "_onMouseMove", function (e) {
124
97
  var event = e || window.event;
125
98
  var imageDOM = _this.imgRef;
126
99
  var startTouch = _this.state.startTouch;
127
- if (!startTouch.initiated) return; //滑动距离
128
-
100
+ if (!startTouch.initiated) return;
101
+ //滑动距离
129
102
  var deltaX = event.clientX - startTouch.startX;
130
103
  var deltaY = event.clientY - startTouch.startY;
131
104
  imageDOM.style.left = "".concat(deltaX, "px");
132
105
  imageDOM.style.top = "".concat(deltaY, "px");
133
106
  });
134
-
135
107
  _defineProperty(_assertThisInitialized(_this), "_onMouseUp", function () {
136
108
  var startTouch = _this.state.startTouch;
137
109
  if (!startTouch.initiated) return;
138
110
  var endTouch = JSON.parse(_JSON$stringify(startTouch));
139
111
  endTouch.initiated = false;
140
-
141
112
  _this.setState({
142
113
  startTouch: startTouch
143
114
  });
144
-
145
115
  removeEvent(document, 'mousemove', _this._onMouseMove);
146
116
  removeEvent(document, 'mouseup', _this._onMouseDown);
147
117
  });
148
-
149
118
  _defineProperty(_assertThisInitialized(_this), "_onPlus", function (event) {
150
119
  var zoom = _this.state.zoom;
151
120
  var imageDOM = _this.imgRef;
152
121
  var zoomVal = zoom + 0.1;
153
122
  var originDeg = getRotateDeg(imageDOM);
154
123
  event.stopPropagation();
155
-
156
124
  if (zoomVal >= 0.2) {
157
125
  var _context;
158
-
159
126
  imageDOM.style.transform = _concatInstanceProperty(_context = "translate(-50%,-50%) scale(".concat(zoomVal, ") rotate(")).call(_context, originDeg, "deg)");
160
127
  }
161
-
162
128
  _this.setState({
163
129
  zoom: zoomVal
164
130
  });
165
131
  });
166
-
167
132
  _defineProperty(_assertThisInitialized(_this), "_onMinus", function () {
168
133
  var _context2;
169
-
170
134
  var zoom = _this.state.zoom;
171
135
  var imageDOM = _this.imgRef;
172
136
  var zoomVal = zoom - 0.1;
173
137
  var originDeg = getRotateDeg(imageDOM);
174
-
175
138
  if (zoomVal < 0.2) {
176
139
  zoomVal = 0.2;
177
140
  }
178
-
179
141
  imageDOM.style.transform = _concatInstanceProperty(_context2 = "translate(-50%,-50%) scale(".concat(zoomVal, ") rotate(")).call(_context2, originDeg, "deg)");
180
-
181
142
  _this.setState({
182
143
  zoom: zoomVal
183
144
  });
184
145
  });
185
-
186
146
  _defineProperty(_assertThisInitialized(_this), "_reload", function () {
187
147
  var imageDOM = _this.imgRef;
188
148
  imageDOM.style.transform = "translate(-50%,-50%) scale(1) rotate(0deg)";
189
149
  imageDOM.style.left = "50%";
190
150
  imageDOM.style.top = "50%";
191
-
192
151
  _this.setState({
193
152
  zoom: 1
194
153
  });
195
154
  });
196
-
197
155
  _defineProperty(_assertThisInitialized(_this), "_arrowLeft", function () {
198
156
  var onLeft = _this.props.onLeft;
199
157
  onLeft && onLeft();
@@ -201,12 +159,10 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
201
159
  imageDOM.style.transform = "translate(-50%,-50%) scale(1) rotate(0deg)";
202
160
  imageDOM.style.left = "50%";
203
161
  imageDOM.style.top = "50%";
204
-
205
162
  _this.setState({
206
163
  zoom: 1
207
164
  });
208
165
  });
209
-
210
166
  _defineProperty(_assertThisInitialized(_this), "_arrowRight", function () {
211
167
  var onRight = _this.props.onRight;
212
168
  onRight && onRight();
@@ -214,16 +170,13 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
214
170
  imageDOM.style.transform = "translate(-50%,-50%) scale(1) rotate(0deg)";
215
171
  imageDOM.style.left = "50%";
216
172
  imageDOM.style.top = "50%";
217
-
218
173
  _this.setState({
219
174
  zoom: 1
220
175
  });
221
176
  });
222
-
223
177
  _defineProperty(_assertThisInitialized(_this), "rotate", function (isLeft) {
224
178
  return function () {
225
179
  var _context3;
226
-
227
180
  var imageDOM = _this.imgRef;
228
181
  var originDeg = getRotateDeg(imageDOM);
229
182
  var zoom = _this.state.zoom;
@@ -231,19 +184,16 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
231
184
  imageDOM.style.transform = _concatInstanceProperty(_context3 = "translate(-50%,-50%) rotate(".concat(rotateDeg, "deg) scale(")).call(_context3, zoom, ")");
232
185
  };
233
186
  });
234
-
235
187
  _this.state = {
236
188
  zoom: 1,
237
189
  startTouch: {}
238
190
  };
239
191
  return _this;
240
192
  }
241
-
242
193
  _createClass(ImageViews, [{
243
194
  key: "render",
244
195
  value: function render() {
245
196
  var _this2 = this;
246
-
247
197
  var image = this.props.image;
248
198
  return /*#__PURE__*/React.createElement("div", {
249
199
  className: variables('ImageViews')
@@ -258,7 +208,6 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
258
208
  onWheel: this._onwheel //缩放事件
259
209
  ,
260
210
  onMouseDown: this._onMouseDown //拖拽事件
261
-
262
211
  })), /*#__PURE__*/React.createElement("div", {
263
212
  className: variables('ImageViews').footer
264
213
  }, /*#__PURE__*/React.createElement("div", {
@@ -304,8 +253,6 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
304
253
  }))))));
305
254
  }
306
255
  }]);
307
-
308
256
  return ImageViews;
309
257
  }(React.Component);
310
-
311
258
  export default ImageViews;
@@ -10,92 +10,72 @@ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
10
10
  import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
11
11
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
12
12
  import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
13
-
14
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); }; }
15
-
16
14
  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; } }
17
-
18
15
  import React from 'react';
19
16
  import PropTypes from 'prop-types';
20
17
  import ImageViews from "./ImageViews";
21
18
  import variables from '../variables';
22
-
23
19
  var Viewers = /*#__PURE__*/function (_React$Component) {
24
20
  _inherits(Viewers, _React$Component);
25
-
26
21
  var _super = _createSuper(Viewers);
27
-
28
22
  function Viewers(props) {
29
23
  var _this;
30
-
31
24
  _classCallCheck(this, Viewers);
32
-
33
25
  _this = _super.call(this, props);
34
-
26
+ //修复Warning报错
35
27
  _defineProperty(_assertThisInitialized(_this), "componentWillUnmount", function () {
36
28
  _this.timeout = null;
37
29
  });
38
-
39
30
  _defineProperty(_assertThisInitialized(_this), "closeViewers", function () {
40
31
  var _this$props = _this.props,
41
- onCancel = _this$props.onCancel,
42
- onClose = _this$props.onClose;
32
+ onCancel = _this$props.onCancel,
33
+ onClose = _this$props.onClose;
43
34
  _this.containerRef.style['opacity'] = 0;
44
35
  _this.timeout = _setTimeout(function () {
45
36
  onCancel && onCancel(onClose);
46
37
  }, 1000);
47
38
  });
48
-
49
39
  _defineProperty(_assertThisInitialized(_this), "_onLeft", function () {
50
40
  var imageIndex = _this.state.imageIndex;
51
41
  var images = _this.props.images;
52
42
  var index = imageIndex - 1;
53
-
54
43
  if (index < 0) {
55
44
  index = images.length - 1;
56
45
  }
57
-
58
46
  _this.setState({
59
47
  imageIndex: index
60
48
  });
61
49
  });
62
-
63
50
  _defineProperty(_assertThisInitialized(_this), "_onRight", function () {
64
51
  var imageIndex = _this.state.imageIndex;
65
52
  var images = _this.props.images;
66
53
  var index = imageIndex + 1;
67
-
68
54
  if (index > images.length - 1) {
69
55
  index = 0;
70
56
  }
71
-
72
57
  _this.setState({
73
58
  imageIndex: index
74
59
  });
75
60
  });
76
-
77
61
  _defineProperty(_assertThisInitialized(_this), "_onSelect", function (index) {
78
62
  _this.setState({
79
63
  imageIndex: index
80
64
  });
81
65
  });
82
-
83
66
  _this.state = {
84
67
  imageIndex: props.imageIndex
85
68
  };
86
69
  return _this;
87
- } //修复Warning报错
88
-
89
-
70
+ }
90
71
  _createClass(Viewers, [{
91
72
  key: "render",
92
73
  value: function render() {
93
74
  var _this2 = this;
94
-
95
75
  var _this$props2 = this.props,
96
- visible = _this$props2.visible,
97
- images = _this$props2.images,
98
- titles = _this$props2.titles;
76
+ visible = _this$props2.visible,
77
+ images = _this$props2.images,
78
+ titles = _this$props2.titles;
99
79
  var imageIndex = this.state.imageIndex;
100
80
  return /*#__PURE__*/React.createElement("div", null, visible ? /*#__PURE__*/React.createElement("div", {
101
81
  className: variables('Viewers'),
@@ -108,7 +88,6 @@ var Viewers = /*#__PURE__*/function (_React$Component) {
108
88
  className: variables('Viewers').title
109
89
  }, _mapInstanceProperty(titles).call(titles, function (item, index) {
110
90
  var _context;
111
-
112
91
  return /*#__PURE__*/React.createElement("div", {
113
92
  key: index,
114
93
  onClick: _bindInstanceProperty(_context = _this2._onSelect).call(_context, _this2, index),
@@ -128,22 +107,16 @@ var Viewers = /*#__PURE__*/function (_React$Component) {
128
107
  }))) : null);
129
108
  }
130
109
  }]);
131
-
132
110
  return Viewers;
133
111
  }(React.Component);
134
-
135
112
  _defineProperty(Viewers, "propTypes", {
136
113
  /** viewer是否可见 */
137
114
  visible: PropTypes.bool.isRequired,
138
-
139
115
  /** 点击关闭按钮的回调 */
140
116
  onCancel: PropTypes.func.isRequired,
141
-
142
117
  /** 需要进行浏览的图片地址集合 */
143
118
  images: PropTypes.array.isRequired,
144
-
145
119
  /** 需要进行浏览的图片名称集合 */
146
120
  titles: PropTypes.array.isRequired
147
121
  });
148
-
149
122
  export default Viewers;
@@ -4,17 +4,13 @@ var _excluded = ["className", "children"];
4
4
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
5
5
  import React from 'react';
6
6
  import variables from '../variables';
7
-
8
7
  function WingBlank(_ref) {
9
8
  var _context;
10
-
11
9
  var className = _ref.className,
12
- children = _ref.children,
13
- props = _objectWithoutProperties(_ref, _excluded);
14
-
10
+ children = _ref.children,
11
+ props = _objectWithoutProperties(_ref, _excluded);
15
12
  return /*#__PURE__*/React.createElement("div", _extends({
16
13
  className: _concatInstanceProperty(_context = "".concat(className, " ")).call(_context, variables('WingBlank'))
17
14
  }, props), /*#__PURE__*/React.createElement("div", null, children));
18
15
  }
19
-
20
16
  export default WingBlank;
package/es/helper.js CHANGED
@@ -4,41 +4,40 @@ import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/insta
4
4
  import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
5
5
  import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
6
6
  import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
7
+ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
8
+ import _parseFloat from "@babel/runtime-corejs3/core-js-stable/parse-float";
9
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
10
+ import _Number$isInteger from "@babel/runtime-corejs3/core-js-stable/number/is-integer";
7
11
  import message from 'antd/lib/message';
12
+
8
13
  /**
9
14
  * 功能:从obj中取出不包含keys指定的属性,并组成一个新的子对象
10
15
  */
11
-
12
16
  var getObjectExclude = function getObjectExclude(obj, keys) {
13
17
  var _context;
14
-
15
18
  var inKeys = function inKeys(key) {
16
19
  return _someInstanceProperty(keys).call(keys, function (k) {
17
20
  return k === key;
18
21
  });
19
22
  };
20
-
21
23
  return _reduceInstanceProperty(_context = _Object$keys(obj)).call(_context, function (newObj, key) {
22
24
  !inKeys(key) && (newObj[key] = obj[key]);
23
25
  return newObj;
24
26
  }, {});
25
- }; // 获取当前登录的用户名
26
-
27
+ };
27
28
 
29
+ // 获取当前登录的用户名
28
30
  var getUsername = function getUsername() {
29
31
  var username = 'username=';
30
32
  var cookie = document.cookie;
31
33
  var begin = _indexOfInstanceProperty(cookie).call(cookie, username) + username.length;
32
-
33
34
  var end = _indexOfInstanceProperty(cookie).call(cookie, ';', begin);
34
-
35
35
  return unescape(cookie.substring(begin, end < 0 ? cookie.length : end));
36
36
  };
37
+
37
38
  /**
38
39
  * 确保path为数组
39
40
  */
40
-
41
-
42
41
  var makeArray = function makeArray(path) {
43
42
  if (_Array$isArray(path)) {
44
43
  return path;
@@ -48,46 +47,40 @@ var makeArray = function makeArray(path) {
48
47
  return [path];
49
48
  }
50
49
  };
50
+
51
51
  /**
52
52
  * 功能:获取对象关键路径的值,不存在则返回undefined
53
53
  * obj:对象
54
54
  * path:字符串或字符串数组,指定关键路径
55
55
  */
56
-
57
-
58
56
  var getPathValue = function getPathValue(obj, path) {
59
57
  if (!path) {
60
58
  return undefined;
61
59
  } else {
62
60
  var _context2;
63
-
64
61
  return _reduceInstanceProperty(_context2 = makeArray(path)).call(_context2, function (value, key) {
65
62
  return _typeof(value) !== 'object' ? undefined : value[key];
66
63
  }, obj);
67
64
  }
68
65
  };
66
+
69
67
  /**
70
68
  * 功能:判断一个值是否为空(null,undefined和''属于空)
71
69
  */
72
-
73
-
74
70
  var isEmpty = function isEmpty(value) {
75
71
  var type = _typeof(value);
76
-
77
72
  if (type === 'number' || type === 'boolean') {
78
73
  return false;
79
74
  } else {
80
75
  return !value;
81
76
  }
82
77
  };
78
+
83
79
  /**
84
80
  * 功能:判断一个值是否为空(null,undefined,''和[]属于空)
85
81
  */
86
-
87
-
88
82
  var isEmpty2 = function isEmpty2(value) {
89
83
  var type = _typeof(value);
90
-
91
84
  if (type === 'number' || type === 'boolean') {
92
85
  return false;
93
86
  } else if (_Array$isArray(value)) {
@@ -96,15 +89,34 @@ var isEmpty2 = function isEmpty2(value) {
96
89
  return !value;
97
90
  }
98
91
  };
99
-
92
+ var toThousands = function toThousands(number, fractionDigits) {
93
+ if (typeof number === 'string' && _includesInstanceProperty(number).call(number, '~')) {
94
+ // 如果参数是形如 "1~5" 的字符串
95
+ var range = number.split('~');
96
+ var start = _parseFloat(range[0]);
97
+ var end = _parseFloat(range[1]);
98
+ if (!isNaN(start) && !isNaN(end)) {
99
+ var _context3;
100
+ var formattedStart = start.toFixed(fractionDigits).replace(/(\d)(?=(\d{3})+(\.\d+)?$)/g, '$1,');
101
+ var formattedEnd = end.toFixed(fractionDigits).replace(/(\d)(?=(\d{3})+(\.\d+)?$)/g, '$1,');
102
+ return _concatInstanceProperty(_context3 = "".concat(formattedStart, "~\uFFE5")).call(_context3, formattedEnd);
103
+ }
104
+ } else if (!isNaN(Number(number))) {
105
+ // 其他数字类型的参数处理,与原函数逻辑保持一致
106
+ if (!_Number$isInteger(_parseFloat(number)) && number.toString().split('.')[1].length > 2) {
107
+ return Number(number).toFixed(5).replace(/(^|\s)\d+/g, function (m) {
108
+ return m.replace(/(?=(?!\b)(\d{3})+$)/g, ',');
109
+ });
110
+ }
111
+ return Number(number).toFixed(fractionDigits).replace(/(\d)(?=(\d{3})+(\.\d+)?$)/g, '$1,');
112
+ }
113
+ };
100
114
  var showError = function showError(msg) {
101
115
  message.error(msg);
102
116
  };
103
-
104
117
  var showSuccessMsg = function showSuccessMsg(msg) {
105
118
  message.success(msg);
106
119
  };
107
-
108
120
  var helper = {
109
121
  getObjectExclude: getObjectExclude,
110
122
  getUsername: getUsername,
@@ -112,7 +124,8 @@ var helper = {
112
124
  isEmpty: isEmpty,
113
125
  isEmpty2: isEmpty2,
114
126
  showError: showError,
115
- showSuccessMsg: showSuccessMsg
127
+ showSuccessMsg: showSuccessMsg,
128
+ toThousands: toThousands
116
129
  };
117
- export { getObjectExclude, getUsername, getPathValue, isEmpty, isEmpty2, showError, showSuccessMsg };
130
+ export { getObjectExclude, getUsername, getPathValue, isEmpty, isEmpty2, showError, showSuccessMsg, toThousands };
118
131
  export default helper;
package/es/history.js CHANGED
@@ -1,5 +1,6 @@
1
1
  // import createBrowserHistory from 'history/createBrowserHistory';
2
- import { createBrowserHistory } from 'history'; // Navigation manager, e.g. history.push('/home')
3
- // https://github.com/mjackson/history
2
+ import { createBrowserHistory } from 'history';
4
3
 
4
+ // Navigation manager, e.g. history.push('/home')
5
+ // https://github.com/mjackson/history
5
6
  export default process.env.BROWSER && createBrowserHistory();