cloud-b2b 1.1.45 → 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 +227 -102
  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 +241 -102
  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
@@ -1,15 +1,20 @@
1
1
  import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
2
+
2
3
  var isFirefox = function isFirefox() {
3
4
  var _context;
5
+
4
6
  return _indexOfInstanceProperty(_context = navigator.userAgent).call(_context, 'Firefox') > 0;
5
7
  };
8
+
6
9
  var getComputedStyle = function getComputedStyle(element) {
7
10
  return window.getComputedStyle ? window.getComputedStyle(element, null) : element.currentStyle;
8
11
  };
12
+
9
13
  var fixed = function fixed(container, header, maxHeight) {
10
14
  var totalFooter = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
11
15
  container.style.overflowY = 'auto';
12
16
  container.style.maxHeight = maxHeight;
17
+
13
18
  if (isFirefox()) {
14
19
  container.style.position = 'relative';
15
20
  header.style.top = '0';
@@ -18,12 +23,14 @@ var fixed = function fixed(container, header, maxHeight) {
18
23
  } else {
19
24
  header.parentNode.appendChild(header);
20
25
  }
26
+
21
27
  var containerHeight = Number(getComputedStyle(container).height.replace('px', ''));
22
28
  var translateHeight = containerHeight - 10 - container.scrollHeight;
23
29
  var pageTotalElement = totalFooter.pageTotalElement,
24
- searchTotalElement = totalFooter.searchTotalElement;
30
+ searchTotalElement = totalFooter.searchTotalElement;
25
31
  pageTotalElement && (pageTotalElement.style.transform = "translateY(".concat(translateHeight + container.scrollTop, "px)"));
26
32
  searchTotalElement && (searchTotalElement.style.transform = "translateY(".concat(translateHeight + container.scrollTop, "px)"));
33
+
27
34
  container.onscroll = function () {
28
35
  if (container.scrollTop + containerHeight - 10 > container.scrollHeight) return;
29
36
  !isFirefox() && (header.style.transform = "translateY(".concat(container.scrollTop, "px)"));
@@ -31,4 +38,5 @@ var fixed = function fixed(container, header, maxHeight) {
31
38
  searchTotalElement && (searchTotalElement.style.transform = "translateY(".concat(translateHeight + container.scrollTop, "px)"));
32
39
  };
33
40
  };
41
+
34
42
  export default fixed;
@@ -1,3 +1,4 @@
1
+ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
1
2
  import _Popconfirm from "antd/es/popconfirm";
2
3
  import _Dropdown from "antd/es/dropdown";
3
4
  import _Icon from "antd/es/icon";
@@ -17,9 +18,11 @@ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/insta
17
18
  import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
18
19
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
19
20
  import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
20
- import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
21
+
21
22
  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); }; }
23
+
22
24
  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
+
23
26
  import React from 'react';
24
27
  import PropTypes from 'prop-types';
25
28
  import variables from '../variables';
@@ -32,12 +35,12 @@ var clicktag = 0; //被点击标识
32
35
  * title: 菜单项上的文字
33
36
  * subMenu: [可选],菜单项子列表,包含key和title的对象数组,此时点击菜单项不触发事件,只有点击子列表项才会触发onSubClick事件
34
37
  */
38
+
35
39
  var MenuType = {
36
40
  key: PropTypes.string.isRequired,
37
41
  title: PropTypes.string.isRequired,
38
42
  subMenu: PropTypes.array
39
43
  };
40
-
41
44
  /**
42
45
  * key: 用于标识按钮
43
46
  * title: 按钮上的文字
@@ -47,6 +50,7 @@ var MenuType = {
47
50
  * 菜单项如果是包含key、title、subMenu的对象,则点击此菜单项不触发事件,必须点击子列表项时才会触发onSubClick事件
48
51
  * loading: 是否正在加载,与antd中Button的loading取值一样
49
52
  */
53
+
50
54
  var ButtonType = {
51
55
  key: PropTypes.string.isRequired,
52
56
  title: PropTypes.string.isRequired,
@@ -55,41 +59,52 @@ var ButtonType = {
55
59
  menu: PropTypes.arrayOf(PropTypes.shape(MenuType)),
56
60
  loading: PropTypes.bool
57
61
  };
62
+
58
63
  var ButtonEx = function ButtonEx(_ref) {
59
64
  var type = _ref.type,
60
- children = _ref.children,
61
- props = _objectWithoutProperties(_ref, _excluded);
65
+ children = _ref.children,
66
+ props = _objectWithoutProperties(_ref, _excluded);
67
+
62
68
  props[type === 'primary-o' ? 'data-btn-type' : 'type'] = type;
63
69
  return /*#__PURE__*/React.createElement(_Button, props, children);
64
70
  };
65
-
66
71
  /**
67
72
  * onClick: 纯按钮点击时或按钮下拉项中无子菜单列表项点击触发,原型为function(key)
68
73
  * onSubClick: 按钮为下拉时下拉项子列表项点击时触发,原型为function(key, subKey)
69
74
  */
75
+
76
+
70
77
  var SuperToolbar = /*#__PURE__*/function (_React$Component) {
71
78
  _inherits(SuperToolbar, _React$Component);
79
+
72
80
  var _super = _createSuper(SuperToolbar);
81
+
73
82
  function SuperToolbar() {
74
83
  var _context;
84
+
75
85
  var _this;
86
+
76
87
  _classCallCheck(this, SuperToolbar);
88
+
77
89
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
78
90
  args[_key] = arguments[_key];
79
91
  }
92
+
80
93
  _this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
94
+
81
95
  _defineProperty(_assertThisInitialized(_this), "onClick", function (e) {
82
96
  var _this$props = _this.props,
83
- onClick = _this$props.onClick,
84
- onSubClick = _this$props.onSubClick;
97
+ onClick = _this$props.onClick,
98
+ onSubClick = _this$props.onSubClick;
85
99
  var key = _typeof(e) === 'object' ? e.key : e;
100
+
86
101
  if (_typeof(e) === 'object' && e.keyPath.length === 2 && onSubClick) {
87
102
  onSubClick(e.keyPath[1], e.keyPath[0]);
88
103
  } else if (onClick) {
89
104
  if (clicktag === 0) {
90
105
  clicktag = 1;
91
- onClick(key);
92
- //1秒过后可以再次点击
106
+ onClick(key); //1秒过后可以再次点击
107
+
93
108
  _setTimeout(function () {
94
109
  clicktag = 0;
95
110
  }, 1000);
@@ -98,29 +113,32 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
98
113
  }
99
114
  }
100
115
  });
116
+
101
117
  _defineProperty(_assertThisInitialized(_this), "toSubMenu", function (_ref2) {
102
118
  var key = _ref2.key,
103
- title = _ref2.title,
104
- _ref2$subMenu = _ref2.subMenu,
105
- subMenu = _ref2$subMenu === void 0 ? [] : _ref2$subMenu;
119
+ title = _ref2.title,
120
+ _ref2$subMenu = _ref2.subMenu,
121
+ subMenu = _ref2$subMenu === void 0 ? [] : _ref2$subMenu;
106
122
  return /*#__PURE__*/React.createElement(SubMenu, {
107
123
  key: key,
108
124
  title: title
109
125
  }, _mapInstanceProperty(subMenu).call(subMenu, function (_ref3) {
110
126
  var key = _ref3.key,
111
- title = _ref3.title;
127
+ title = _ref3.title;
112
128
  return /*#__PURE__*/React.createElement(MenuItem, {
113
129
  key: key
114
130
  }, title);
115
131
  }));
116
132
  });
133
+
117
134
  _defineProperty(_assertThisInitialized(_this), "toMenu", function (menu) {
118
135
  return /*#__PURE__*/React.createElement(_Menu, {
119
136
  onClick: _this.onClick
120
137
  }, _mapInstanceProperty(menu).call(menu, function (item) {
121
138
  var key = item.key,
122
- title = item.title,
123
- subMenu = item.subMenu;
139
+ title = item.title,
140
+ subMenu = item.subMenu;
141
+
124
142
  if (subMenu) {
125
143
  return _this.toSubMenu(item);
126
144
  } else {
@@ -130,17 +148,22 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
130
148
  }
131
149
  }));
132
150
  });
151
+
133
152
  _defineProperty(_assertThisInitialized(_this), "toButton", function (_ref4) {
134
153
  var _context2;
154
+
135
155
  var key = _ref4.key,
136
- title = _ref4.title,
137
- type = _ref4.bsStyle,
138
- confirm = _ref4.confirm,
139
- menu = _ref4.menu,
140
- loading = _ref4.loading;
156
+ title = _ref4.title,
157
+ type = _ref4.bsStyle,
158
+ confirm = _ref4.confirm,
159
+ menu = _ref4.menu,
160
+ loading = _ref4.loading;
161
+
141
162
  var onClick = _bindInstanceProperty(_context2 = _this.onClick).call(_context2, _assertThisInitialized(_this), key);
163
+
142
164
  var _this$props$size = _this.props.size,
143
- size = _this$props$size === void 0 ? 'small' : _this$props$size;
165
+ size = _this$props$size === void 0 ? 'small' : _this$props$size;
166
+
144
167
  if (menu && menu.length) {
145
168
  return /*#__PURE__*/React.createElement(_Dropdown, {
146
169
  key: key,
@@ -172,8 +195,10 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
172
195
  }, title));
173
196
  }
174
197
  });
198
+
175
199
  return _this;
176
200
  }
201
+
177
202
  _createClass(SuperToolbar, [{
178
203
  key: "render",
179
204
  value: function render() {
@@ -184,12 +209,15 @@ var SuperToolbar = /*#__PURE__*/function (_React$Component) {
184
209
  }, _mapInstanceProperty(buttons).call(buttons, this.toButton));
185
210
  }
186
211
  }]);
212
+
187
213
  return SuperToolbar;
188
214
  }(React.Component);
215
+
189
216
  _defineProperty(SuperToolbar, "propTypes", {
190
217
  buttons: PropTypes.arrayOf(PropTypes.shape(ButtonType)).isRequired,
191
218
  size: PropTypes.oneOf(['small', 'default', 'large']),
192
219
  onClick: PropTypes.func,
193
220
  onSubClick: PropTypes.func
194
221
  });
222
+
195
223
  export default SuperToolbar;