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
package/es/Area/Area.js CHANGED
@@ -15,10 +15,15 @@ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
15
15
  import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
16
16
  import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
17
17
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
18
+
18
19
  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; }
20
+
19
21
  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; }
22
+
20
23
  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); }; }
24
+
21
25
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
26
+
22
27
  import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
23
28
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
24
29
  import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
@@ -34,60 +39,77 @@ var PROPS = {
34
39
  onParentChange: PropTypes.func,
35
40
  child: PropTypes.Array
36
41
  };
42
+
37
43
  var PROPS_KEYS = _Object$keys(PROPS);
44
+
38
45
  var Area = /*#__PURE__*/function (_React$Component) {
39
46
  _inherits(Area, _React$Component);
47
+
40
48
  var _super = _createSuper(Area);
49
+
41
50
  function Area(props) {
42
51
  var _this;
52
+
43
53
  _classCallCheck(this, Area);
54
+
44
55
  _this = _super.call(this, props);
56
+
45
57
  _defineProperty(_assertThisInitialized(_this), "onChange", function (key, keyValue) {
46
58
  var _this$props = _this.props,
47
- onParentChange = _this$props.onParentChange,
48
- child = _this$props.child,
49
- _this$props$value = _this$props.value,
50
- value = _this$props$value === void 0 ? {} : _this$props$value;
59
+ onParentChange = _this$props.onParentChange,
60
+ child = _this$props.child,
61
+ _this$props$value = _this$props.value,
62
+ value = _this$props$value === void 0 ? {} : _this$props$value;
51
63
  var newValue = {};
52
64
  newValue[key] = keyValue;
53
65
  var CheckValue, checkIndex;
66
+
54
67
  _mapInstanceProperty(child).call(child, function (item, index) {
55
68
  if (item.key === key) {
56
69
  checkIndex = index;
57
70
  }
71
+
58
72
  CheckValue = index > checkIndex ? '' : value[item.key];
59
73
  newValue[item.key] = item.key === key ? keyValue : CheckValue;
60
74
  });
75
+
61
76
  _this.setState({
62
77
  value: _objectSpread(_objectSpread({}, _this.state.value), newValue)
63
78
  }, function () {
64
79
  return onParentChange && onParentChange(_this.state.value);
65
80
  });
66
81
  });
82
+
67
83
  _defineProperty(_assertThisInitialized(_this), "onSearch", function (key, control, parentKey, KeyValue) {
68
84
  var _this$props2 = _this.props,
69
- onAreaSearch = _this$props2.onAreaSearch,
70
- child = _this$props2.child,
71
- _this$props2$value = _this$props2.value,
72
- value = _this$props2$value === void 0 ? {} : _this$props2$value;
85
+ onAreaSearch = _this$props2.onAreaSearch,
86
+ child = _this$props2.child,
87
+ _this$props2$value = _this$props2.value,
88
+ value = _this$props2$value === void 0 ? {} : _this$props2$value;
73
89
  var flag = true;
90
+
74
91
  _mapInstanceProperty(child).call(child, function (item, index) {
75
92
  if (item.key === key && index !== 0) {
76
93
  var upKey = child[index - 1].key;
94
+
77
95
  if (index !== 0 && (helper.isEmpty2(value[upKey]) || _Object$keys(value[upKey]).length === 0)) {
78
96
  flag = false;
79
97
  }
98
+
80
99
  ;
81
100
  }
82
101
  });
102
+
83
103
  return flag ? onAreaSearch && onAreaSearch(key, KeyValue, parentKey) : helper.showError('请输入上级选择器');
84
104
  });
105
+
85
106
  _this.state = {
86
107
  value: props.value || {},
87
108
  options: props.options || {}
88
109
  };
89
110
  return _this;
90
111
  }
112
+
91
113
  _createClass(Area, [{
92
114
  key: "componentWillReceiveProps",
93
115
  value: function componentWillReceiveProps(props) {
@@ -101,18 +123,21 @@ var Area = /*#__PURE__*/function (_React$Component) {
101
123
  key: "render",
102
124
  value: function render() {
103
125
  var _this2 = this;
126
+
104
127
  var _this$props3 = this.props,
105
- child = _this$props3.child,
106
- parentKey = _this$props3.parentKey,
107
- _this$props3$options = _this$props3.options,
108
- options = _this$props3$options === void 0 ? {} : _this$props3$options,
109
- _this$props3$readonly = _this$props3.readonly,
110
- readonly = _this$props3$readonly === void 0 ? false : _this$props3$readonly,
111
- _this$props3$value = _this$props3.value,
112
- value = _this$props3$value === void 0 ? {} : _this$props3$value;
128
+ child = _this$props3.child,
129
+ parentKey = _this$props3.parentKey,
130
+ _this$props3$options = _this$props3.options,
131
+ options = _this$props3$options === void 0 ? {} : _this$props3$options,
132
+ _this$props3$readonly = _this$props3.readonly,
133
+ readonly = _this$props3$readonly === void 0 ? false : _this$props3$readonly,
134
+ _this$props3$value = _this$props3.value,
135
+ value = _this$props3$value === void 0 ? {} : _this$props3$value;
113
136
  return /*#__PURE__*/React.createElement(_Row, null, _mapInstanceProperty(child).call(child, function (item, index) {
114
137
  var _context, _context2, _context3;
138
+
115
139
  var childOptions = [];
140
+
116
141
  if (_includesInstanceProperty(_context = _Object$keys(options)).call(_context, item.key)) {
117
142
  if (index === 0) {
118
143
  childOptions = options[item.key];
@@ -121,6 +146,7 @@ var Area = /*#__PURE__*/function (_React$Component) {
121
146
  childOptions = helper.isEmpty2(value[upKey]) || _Object$keys(value[upKey]).length === 0 ? [] : options[item.key];
122
147
  }
123
148
  }
149
+
124
150
  var props = _objectSpread(_objectSpread({}, item), {}, {
125
151
  onSearch: _bindInstanceProperty(_context2 = _this2.onSearch).call(_context2, _this2, item.key, item, parentKey),
126
152
  onChange: _bindInstanceProperty(_context3 = _this2.onChange).call(_context3, _this2, item.key),
@@ -129,6 +155,7 @@ var Area = /*#__PURE__*/function (_React$Component) {
129
155
  type: readonly ? 'readonly' : item.type,
130
156
  searchWhenClick: true
131
157
  });
158
+
132
159
  return /*#__PURE__*/React.createElement(_Col, {
133
160
  span: 24 / child.length,
134
161
  key: item.key
@@ -136,6 +163,8 @@ var Area = /*#__PURE__*/function (_React$Component) {
136
163
  }));
137
164
  }
138
165
  }]);
166
+
139
167
  return Area;
140
168
  }(React.Component);
169
+
141
170
  export default Area;
package/es/Card/Card.js CHANGED
@@ -5,9 +5,10 @@ import React from 'react';
5
5
  import classNames from 'classnames';
6
6
  var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
7
7
  var children = _ref.children,
8
- className = _ref.className,
9
- noPadding = _ref.noPadding,
10
- other = _objectWithoutProperties(_ref, _excluded);
8
+ className = _ref.className,
9
+ noPadding = _ref.noPadding,
10
+ other = _objectWithoutProperties(_ref, _excluded);
11
+
11
12
  var padding = !noPadding ? true : null;
12
13
  return /*#__PURE__*/React.createElement("div", _extends({
13
14
  className: classNames('pld-card', className),
@@ -16,11 +16,17 @@ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
16
16
  import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
17
17
  import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
18
18
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
19
+
19
20
  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; }
21
+
20
22
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
23
+
21
24
  import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
25
+
22
26
  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); }; }
27
+
23
28
  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; } }
29
+
24
30
  import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
25
31
  import _setInterval from "@babel/runtime-corejs3/core-js-stable/set-interval";
26
32
  import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
@@ -40,76 +46,97 @@ var PROPS = {
40
46
  onSelect: PropTypes.func,
41
47
  onSearch: PropTypes.func
42
48
  };
49
+
43
50
  var PROPS_KEYS = _Object$keys(PROPS);
51
+
44
52
  var CodeInput = /*#__PURE__*/function (_React$Component) {
45
53
  _inherits(CodeInput, _React$Component);
54
+
46
55
  var _super = _createSuper(CodeInput);
56
+
47
57
  function CodeInput(_props) {
48
58
  var _this;
59
+
49
60
  _classCallCheck(this, CodeInput);
61
+
50
62
  _this = _super.call(this, _props);
63
+
51
64
  _defineProperty(_assertThisInitialized(_this), "onGetCode", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
52
65
  var onGetCode, that, s;
53
66
  return _regeneratorRuntime.wrap(function _callee$(_context) {
54
- while (1) switch (_context.prev = _context.next) {
55
- case 0:
56
- // const url = await helper.fetchJson();
57
- onGetCode = _this.props.onGetCode;
58
- _context.next = 3;
59
- return onGetCode && onGetCode();
60
- case 3:
61
- if (!_context.sent) {
62
- _context.next = 7;
63
- break;
64
- }
65
- _this.setState({
66
- time: _this.props.time || 60
67
- });
68
- that = _assertThisInitialized(_this);
69
- s = _setInterval(function () {
70
- that.setState({
71
- time: that.state.time -= 1
72
- });
73
- if (that.state.time === 0) {
74
- clearInterval(s);
67
+ while (1) {
68
+ switch (_context.prev = _context.next) {
69
+ case 0:
70
+ // const url = await helper.fetchJson();
71
+ onGetCode = _this.props.onGetCode;
72
+ _context.next = 3;
73
+ return onGetCode && onGetCode();
74
+
75
+ case 3:
76
+ if (!_context.sent) {
77
+ _context.next = 7;
78
+ break;
75
79
  }
76
- }, 1000);
77
- case 7:
78
- ;
79
- case 8:
80
- case "end":
81
- return _context.stop();
80
+
81
+ _this.setState({
82
+ time: _this.props.time || 60
83
+ });
84
+
85
+ that = _assertThisInitialized(_this);
86
+ s = _setInterval(function () {
87
+ that.setState({
88
+ time: that.state.time -= 1
89
+ });
90
+
91
+ if (that.state.time === 0) {
92
+ clearInterval(s);
93
+ }
94
+ }, 1000);
95
+
96
+ case 7:
97
+ ;
98
+
99
+ case 8:
100
+ case "end":
101
+ return _context.stop();
102
+ }
82
103
  }
83
104
  }, _callee);
84
105
  })));
106
+
85
107
  _defineProperty(_assertThisInitialized(_this), "btnProps", function (props) {
86
108
  var btnProps = _Object$assign(helper.getObjectExclude(props, ['onGetCode']));
109
+
87
110
  return _objectSpread(_objectSpread({}, btnProps), {}, {
88
111
  size: 'large',
89
112
  disabled: _this.state.time !== 0,
90
113
  onClick: _this.onGetCode
91
114
  });
92
115
  });
116
+
93
117
  _defineProperty(_assertThisInitialized(_this), "inputProps", function (props) {
94
118
  var inpPros = _Object$assign(helper.getObjectExclude(props, ['onGetCode', 'value']));
119
+
95
120
  return _objectSpread(_objectSpread({}, inpPros), {}, {
96
121
  size: 'large',
97
122
  defaultValue: props.value || ''
98
123
  });
99
124
  });
125
+
100
126
  _this.state = {
101
127
  value: _props.value,
102
128
  time: 0
103
129
  };
104
130
  return _this;
105
131
  }
132
+
106
133
  _createClass(CodeInput, [{
107
134
  key: "render",
108
135
  value: function render() {
109
136
  var _this$props = this.props,
110
- inputKey = _this$props.inputKey,
111
- readonly = _this$props.readonly,
112
- value = _this$props.value;
137
+ inputKey = _this$props.inputKey,
138
+ readonly = _this$props.readonly,
139
+ value = _this$props.value;
113
140
  var time = this.state.time;
114
141
  return /*#__PURE__*/React.createElement("div", {
115
142
  style: {
@@ -118,6 +145,8 @@ var CodeInput = /*#__PURE__*/function (_React$Component) {
118
145
  }, /*#__PURE__*/React.createElement(_Input, this.inputProps(this.props)), /*#__PURE__*/React.createElement(_Button, this.btnProps(this.props), time === 0 ? "\u83B7\u53D6\u9A8C\u8BC1\u7801" : "".concat(time, "s\u83B7\u53D6\u9A8C\u8BC1\u7801")));
119
146
  }
120
147
  }]);
148
+
121
149
  return CodeInput;
122
150
  }(React.Component);
151
+
123
152
  export default CodeInput;