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
@@ -17,15 +17,10 @@ import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleC
17
17
  import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
18
18
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
19
19
  import _Menu from "antd/es/menu";
20
-
21
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; }
22
-
23
21
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
24
-
25
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); }; }
26
-
27
23
  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
-
29
24
  import React from 'react';
30
25
  import Link from '../Link';
31
26
  import SuperIcon from '../SuperIcon';
@@ -33,32 +28,23 @@ import helper from '../helper';
33
28
  import Vertical from './Vertical';
34
29
  import variables from '../variables';
35
30
  var MenuItem = _Menu.Item;
36
-
37
31
  var Header = /*#__PURE__*/function (_React$Component) {
38
32
  _inherits(Header, _React$Component);
39
-
40
33
  var _super = _createSuper(Header);
41
-
42
34
  function Header(_props) {
43
35
  var _this;
44
-
45
36
  _classCallCheck(this, Header);
46
-
47
37
  _this = _super.call(this, _props);
48
-
49
38
  _defineProperty(_assertThisInitialized(_this), "toLogo", function () {
50
39
  var img = _this.props.logoImg || '/logo.png';
51
-
52
40
  var props = _this.getLinkProps('home', _this.state['main'] || _this.props.homeUrl || '/', {
53
41
  role: 'logo'
54
42
  });
55
-
56
43
  return /*#__PURE__*/React.createElement(Link, props, /*#__PURE__*/React.createElement("img", {
57
44
  src: img,
58
45
  alt: "logo"
59
46
  }));
60
47
  });
61
-
62
48
  _defineProperty(_assertThisInitialized(_this), "toIcon", function (type) {
63
49
  var style = {
64
50
  fontSize: 18,
@@ -69,7 +55,6 @@ var Header = /*#__PURE__*/function (_React$Component) {
69
55
  style: style
70
56
  });
71
57
  });
72
-
73
58
  _defineProperty(_assertThisInitialized(_this), "getLinkProps", function (key, url) {
74
59
  var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
75
60
  return _objectSpread(_objectSpread({}, props), {}, {
@@ -78,23 +63,18 @@ var Header = /*#__PURE__*/function (_React$Component) {
78
63
  'data-active': _this.props.selectKey === key ? 'true' : null
79
64
  });
80
65
  });
81
-
82
66
  _defineProperty(_assertThisInitialized(_this), "toSetting", function (settingUrl) {
83
67
  if (settingUrl) {
84
68
  var props = _this.getLinkProps('setting', _this.state['setting'] || settingUrl);
85
-
86
69
  return /*#__PURE__*/React.createElement(Link, props, _this.toIcon('pld-setting'));
87
70
  } else {
88
71
  return null;
89
72
  }
90
73
  });
91
-
92
74
  _defineProperty(_assertThisInitialized(_this), "toMessage", function (messageUrl) {
93
75
  var count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
94
-
95
76
  if (messageUrl) {
96
77
  var props = _this.getLinkProps('message', _this.state['message'] || messageUrl);
97
-
98
78
  var msgProps = {
99
79
  overflowCount: 99,
100
80
  title: "\u60A8\u6709".concat(count, "\u6761\u672A\u8BFB\u6D88\u606F"),
@@ -107,13 +87,11 @@ var Header = /*#__PURE__*/function (_React$Component) {
107
87
  return null;
108
88
  }
109
89
  });
110
-
111
90
  _defineProperty(_assertThisInitialized(_this), "onMenuItemClick", function (_ref) {
112
91
  var key = _ref.key;
113
92
  var onMenuClick = _this.props.onMenuClick;
114
93
  onMenuClick && onMenuClick(key);
115
94
  });
116
-
117
95
  _defineProperty(_assertThisInitialized(_this), "menu", function (hasImport) {
118
96
  return /*#__PURE__*/React.createElement(_Menu, {
119
97
  className: variables('Header').menu,
@@ -126,7 +104,6 @@ var Header = /*#__PURE__*/function (_React$Component) {
126
104
  key: "modify"
127
105
  }, "\u4FEE\u6539\u5BC6\u7801"));
128
106
  });
129
-
130
107
  _defineProperty(_assertThisInitialized(_this), "avatar", function (hasImport) {
131
108
  return /*#__PURE__*/React.createElement(_Dropdown, {
132
109
  placement: "bottomRight",
@@ -138,14 +115,12 @@ var Header = /*#__PURE__*/function (_React$Component) {
138
115
  }
139
116
  }, _this.toIcon(_this.props.userIcon)));
140
117
  });
141
-
142
118
  _defineProperty(_assertThisInitialized(_this), "toPerson", function () {
143
119
  var hasImport = _this.props.hasImport || true;
144
120
  return /*#__PURE__*/React.createElement("div", {
145
121
  role: "person"
146
122
  }, /*#__PURE__*/React.createElement("div", null), _this.avatar(hasImport), /*#__PURE__*/React.createElement("span", null, _this.props.userName));
147
123
  });
148
-
149
124
  _defineProperty(_assertThisInitialized(_this), "toLogout", function () {
150
125
  var props = {
151
126
  to: _this.props.loginUrl,
@@ -154,22 +129,18 @@ var Header = /*#__PURE__*/function (_React$Component) {
154
129
  };
155
130
  return /*#__PURE__*/React.createElement(Link, props, _this.toIcon('logout'), /*#__PURE__*/React.createElement("span", null, "\u9000\u51FA"));
156
131
  });
157
-
158
132
  _defineProperty(_assertThisInitialized(_this), "toTail", function () {
159
133
  var _this$props = _this.props,
160
- settingUrl = _this$props.settingUrl,
161
- messageUrl = _this$props.messageUrl,
162
- messageCount = _this$props.messageCount;
134
+ settingUrl = _this$props.settingUrl,
135
+ messageUrl = _this$props.messageUrl,
136
+ messageCount = _this$props.messageCount;
163
137
  return /*#__PURE__*/React.createElement("span", null, _this.toSetting(settingUrl), _this.toMessage(messageUrl, messageCount), _this.toPerson(), _this.toLogout());
164
138
  });
165
-
166
139
  if (_props.selectUrl) {
167
140
  _this.state = _defineProperty({}, _props.selectKey, _props.selectUrl);
168
141
  }
169
-
170
142
  return _this;
171
143
  }
172
-
173
144
  _createClass(Header, [{
174
145
  key: "componentWillReceiveProps",
175
146
  value: function componentWillReceiveProps(props) {
@@ -185,10 +156,7 @@ var Header = /*#__PURE__*/function (_React$Component) {
185
156
  }, this.toLogo(), this.toTail());
186
157
  }
187
158
  }]);
188
-
189
159
  return Header;
190
160
  }(React.Component);
191
-
192
161
  _defineProperty(Header, "Vertical", Vertical);
193
-
194
162
  export default Header;
@@ -10,11 +10,8 @@ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/insta
10
10
  import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
11
11
  import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
12
12
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
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 Link from '../Link';
@@ -26,48 +23,36 @@ var ITEM_TYPE = {
26
23
  title: PropTypes.string.isRequired,
27
24
  icon: PropTypes.string.isRequired
28
25
  };
26
+
29
27
  /**
30
28
  * selectKey: 选中的key
31
29
  * url:url优先级高于item中的href
32
30
  */
33
-
34
31
  var Vertical = /*#__PURE__*/function (_React$Component) {
35
32
  _inherits(Vertical, _React$Component);
36
-
37
33
  var _super = _createSuper(Vertical);
38
-
39
34
  function Vertical() {
40
35
  var _context;
41
-
42
36
  var _this;
43
-
44
37
  _classCallCheck(this, Vertical);
45
-
46
38
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
47
39
  args[_key] = arguments[_key];
48
40
  }
49
-
50
41
  _this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
51
-
52
42
  _defineProperty(_assertThisInitialized(_this), "state", {
53
43
  id: ''
54
44
  });
55
-
56
45
  _defineProperty(_assertThisInitialized(_this), "isSelect", function (item) {
57
46
  return item.key === _this.props.selectKey;
58
47
  });
59
-
60
48
  _defineProperty(_assertThisInitialized(_this), "getUrl", function (item) {
61
49
  return _this.props.url[item.key] || item.href;
62
50
  });
63
-
64
51
  _defineProperty(_assertThisInitialized(_this), "onClick", function (selectKey) {
65
52
  _this.props.onSelectKey && _this.props.onSelectKey(selectKey);
66
-
67
53
  if (_this.state.id) {
68
54
  clearTimeout(_this.state.id);
69
55
  }
70
-
71
56
  _this.setState({
72
57
  id: _setTimeout(function () {
73
58
  _this.setState({
@@ -76,11 +61,9 @@ var Vertical = /*#__PURE__*/function (_React$Component) {
76
61
  }, 500)
77
62
  });
78
63
  });
79
-
80
64
  _defineProperty(_assertThisInitialized(_this), "toItem", function (item) {
81
65
  if (!item.jumpOut) {
82
66
  var _context2;
83
-
84
67
  return /*#__PURE__*/React.createElement(Link, {
85
68
  key: item.key,
86
69
  to: _this.getUrl(item),
@@ -100,30 +83,24 @@ var Vertical = /*#__PURE__*/function (_React$Component) {
100
83
  })), /*#__PURE__*/React.createElement("span", null, item.title));
101
84
  }
102
85
  });
103
-
104
86
  return _this;
105
87
  }
106
-
107
88
  _createClass(Vertical, [{
108
89
  key: "render",
109
90
  value: function render() {
110
91
  var _context3;
111
-
112
92
  return /*#__PURE__*/React.createElement("header", {
113
93
  className: variables('Vertical'),
114
94
  "data-click": !!this.state.id
115
95
  }, _mapInstanceProperty(_context3 = this.props.items).call(_context3, this.toItem));
116
96
  }
117
97
  }]);
118
-
119
98
  return Vertical;
120
99
  }(React.Component);
121
-
122
100
  _defineProperty(Vertical, "propTypes", {
123
101
  selectKey: PropTypes.string,
124
102
  url: PropTypes.object,
125
103
  items: PropTypes.arrayOf(PropTypes.shape(ITEM_TYPE)),
126
104
  onSelectKey: PropTypes.func
127
105
  });
128
-
129
106
  export default Vertical;
@@ -8,38 +8,28 @@ import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleC
8
8
  import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
9
9
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
10
10
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
11
-
12
11
  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
-
14
12
  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; } }
15
-
16
13
  import React from 'react';
17
14
  import { ModalWithDrag, Title } from '../index';
18
15
  import variables from '../variables';
19
-
20
16
  var ImageView = /*#__PURE__*/function (_React$Component) {
21
17
  _inherits(ImageView, _React$Component);
22
-
23
18
  var _super = _createSuper(ImageView);
24
-
25
19
  function ImageView(_props) {
26
20
  var _this;
27
-
28
21
  _classCallCheck(this, ImageView);
29
-
30
22
  _this = _super.call(this, _props);
31
-
32
23
  _defineProperty(_assertThisInitialized(_this), "ClosePreview", function () {
33
24
  _this.setState({
34
25
  previewVisible: false
35
26
  });
36
27
  });
37
-
38
28
  _defineProperty(_assertThisInitialized(_this), "showBigImg", function () {
39
29
  var imgList = _this.props.imgList;
40
30
  var _this$state = _this.state,
41
- previewVisible = _this$state.previewVisible,
42
- index = _this$state.index;
31
+ previewVisible = _this$state.previewVisible,
32
+ index = _this$state.index;
43
33
  var props = {
44
34
  width: 900,
45
35
  title: imgList[index].fileName,
@@ -56,7 +46,6 @@ var ImageView = /*#__PURE__*/function (_React$Component) {
56
46
  src: imgList[index].fileUrl
57
47
  }));
58
48
  });
59
-
60
49
  _defineProperty(_assertThisInitialized(_this), "toSeeImg", function (e) {
61
50
  if (_this.props.toSeeImg) {
62
51
  _this.props.toSeeImg(e);
@@ -64,30 +53,26 @@ var ImageView = /*#__PURE__*/function (_React$Component) {
64
53
  _this.myClick(e.index);
65
54
  }
66
55
  });
67
-
68
56
  _defineProperty(_assertThisInitialized(_this), "myClick", function (index) {
69
57
  _this.setState({
70
58
  previewVisible: true,
71
59
  index: index
72
60
  });
73
61
  });
74
-
75
62
  _this.state = {
76
63
  previewVisible: false,
77
64
  index: 0
78
65
  };
79
66
  return _this;
80
67
  }
81
-
82
68
  _createClass(ImageView, [{
83
69
  key: "render",
84
70
  value: function render() {
85
71
  var _this2 = this;
86
-
87
72
  var _this$props = this.props,
88
- imgList = _this$props.imgList,
89
- title = _this$props.title,
90
- toSeeImg = _this$props.toSeeImg;
73
+ imgList = _this$props.imgList,
74
+ title = _this$props.title,
75
+ toSeeImg = _this$props.toSeeImg;
91
76
  return /*#__PURE__*/React.createElement("div", {
92
77
  className: variables('ImageView')
93
78
  }, title ? /*#__PURE__*/React.createElement(Title, {
@@ -110,8 +95,6 @@ var ImageView = /*#__PURE__*/function (_React$Component) {
110
95
  }), toSeeImg ? null : this.showBigImg());
111
96
  }
112
97
  }]);
113
-
114
98
  return ImageView;
115
99
  }(React.Component);
116
-
117
100
  export default ImageView;
@@ -3,21 +3,17 @@ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWitho
3
3
  var _excluded = ["children", "style"];
4
4
  import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
5
5
  import React from 'react';
6
-
7
6
  function Indent(_ref) {
8
7
  var children = _ref.children,
9
- _ref$style = _ref.style,
10
- style = _ref$style === void 0 ? {} : _ref$style,
11
- props = _objectWithoutProperties(_ref, _excluded);
12
-
8
+ _ref$style = _ref.style,
9
+ style = _ref$style === void 0 ? {} : _ref$style,
10
+ props = _objectWithoutProperties(_ref, _excluded);
13
11
  _Object$assign(style, {
14
12
  paddingLeft: 8,
15
13
  paddingRight: 8
16
14
  });
17
-
18
15
  return /*#__PURE__*/React.createElement("div", _extends({
19
16
  style: style
20
17
  }, props), children);
21
18
  }
22
-
23
19
  export default Indent;
@@ -14,15 +14,10 @@ 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
-
18
17
  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
-
20
18
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
21
-
22
19
  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
-
24
20
  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
-
26
21
  import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
27
22
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
28
23
  import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
@@ -36,8 +31,8 @@ var optionsType = {
36
31
  children: PropTypes.array,
37
32
  title: PropTypes.string,
38
33
  isLeaf: PropTypes.bool //false 就会触发 loadData 方法,从而在loadData方法中请求下一级数据,
39
-
40
34
  };
35
+
41
36
  var PROPS = {
42
37
  options: PropTypes.arrayOf(PropTypes.shape(optionsType)).isRequired,
43
38
  value: PropTypes.array.isRequired,
@@ -47,57 +42,43 @@ var PROPS = {
47
42
  //动态加载 ps:loadData 与 showSearch 无法一起使用
48
43
  showSearch: PropTypes.func
49
44
  };
50
-
51
45
  var PROPS_KEYS = _Object$keys(PROPS);
52
-
53
46
  var InputCascader = /*#__PURE__*/function (_React$Component) {
54
47
  _inherits(InputCascader, _React$Component);
55
-
56
48
  var _super = _createSuper(InputCascader);
57
-
58
49
  function InputCascader(_props) {
59
50
  var _this;
60
-
61
51
  _classCallCheck(this, InputCascader);
62
-
63
52
  _this = _super.call(this, _props);
64
-
65
53
  _defineProperty(_assertThisInitialized(_this), "onChange", function (value) {
66
54
  var onChange = _this.props.onChange;
67
55
  onChange && onChange(value);
68
56
  });
69
-
70
57
  _defineProperty(_assertThisInitialized(_this), "loadData", function (selectedOptions) {
71
58
  var onSearch = _this.props.onSearch;
72
59
  onSearch && onSearch(selectedOptions[0]);
73
60
  });
74
-
75
61
  _defineProperty(_assertThisInitialized(_this), "getOptions", function (options) {
76
62
  return _mapInstanceProperty(options).call(options, function (option) {
77
63
  var obj = _objectSpread(_objectSpread({}, option), {}, {
78
64
  label: option.title
79
65
  });
80
-
81
66
  if (option.children && option.children.length > 0) {
82
67
  obj.children = _this.getOptions(option.children);
83
68
  }
84
-
85
69
  return obj;
86
70
  });
87
71
  });
88
-
89
72
  _defineProperty(_assertThisInitialized(_this), "showSearch", function (inputValue, path) {});
90
-
91
73
  _defineProperty(_assertThisInitialized(_this), "getProps", function () {
92
74
  var _this$props = _this.props,
93
- _this$props$options = _this$props.options,
94
- options = _this$props$options === void 0 ? [] : _this$props$options,
95
- placeholder = _this$props.placeholder,
96
- size = _this$props.size,
97
- value = _this$props.value,
98
- loadData = _this$props.loadData,
99
- showSearch = _this$props.showSearch;
100
-
75
+ _this$props$options = _this$props.options,
76
+ options = _this$props$options === void 0 ? [] : _this$props$options,
77
+ placeholder = _this$props.placeholder,
78
+ size = _this$props.size,
79
+ value = _this$props.value,
80
+ loadData = _this$props.loadData,
81
+ showSearch = _this$props.showSearch;
101
82
  var props = _Object$assign(getObjectExclude({}, PROPS_KEYS), {
102
83
  onChange: _this.onChange,
103
84
  value: value,
@@ -105,31 +86,24 @@ var InputCascader = /*#__PURE__*/function (_React$Component) {
105
86
  changeOnSelect: true,
106
87
  placeholder: placeholder,
107
88
  size: size
108
- }); //动态加载 ps:loadData 与 showSearch 无法一起使用
109
-
110
-
89
+ });
90
+ //动态加载 ps:loadData 与 showSearch 无法一起使用
111
91
  if (loadData) {
112
92
  props.loadData = _this.loadData;
113
93
  } else if (showSearch) {
114
94
  props.showSearch = _this.showSearch;
115
95
  }
116
-
117
96
  return props;
118
97
  });
119
-
120
98
  return _this;
121
99
  }
122
-
123
100
  _createClass(InputCascader, [{
124
101
  key: "render",
125
102
  value: function render() {
126
103
  return /*#__PURE__*/React.createElement(_Cascader, this.getProps());
127
104
  }
128
105
  }]);
129
-
130
106
  return InputCascader;
131
107
  }(React.Component);
132
-
133
108
  _defineProperty(InputCascader, "propTypes", PROPS);
134
-
135
109
  export default InputCascader;
@@ -4,80 +4,82 @@ import _createClass from "@babel/runtime-corejs3/helpers/createClass";
4
4
  import _inherits from "@babel/runtime-corejs3/helpers/inherits";
5
5
  import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
6
6
  import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
7
-
8
7
  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); }; }
9
-
10
8
  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
-
12
9
  import React from 'react';
13
10
  import variables from '../variables';
14
- var defaultMenus = ['head', // 标题
15
- 'bold', // 粗体
16
- 'fontSize', // 字号
17
- 'fontName', // 字体
18
- 'italic', // 斜体
19
- 'underline', // 下划线
20
- 'strikeThrough', // 删除线
21
- 'foreColor', // 文字颜色
22
- 'backColor', // 背景颜色
23
- 'link', // 插入链接
24
- 'list', // 列表
25
- 'justify', // 对齐方式
26
- 'quote', // 引用
27
- 'image', // 插入图片
28
- 'table', // 表格
11
+ var defaultMenus = ['head',
12
+ // 标题
13
+ 'bold',
14
+ // 粗体
15
+ 'fontSize',
16
+ // 字号
17
+ 'fontName',
18
+ // 字体
19
+ 'italic',
20
+ // 斜体
21
+ 'underline',
22
+ // 下划线
23
+ 'strikeThrough',
24
+ // 删除线
25
+ 'foreColor',
26
+ // 文字颜色
27
+ 'backColor',
28
+ // 背景颜色
29
+ 'link',
30
+ // 插入链接
31
+ 'list',
32
+ // 列表
33
+ 'justify',
34
+ // 对齐方式
35
+ 'quote',
36
+ // 引用
37
+ 'image',
38
+ // 插入图片
39
+ 'table',
40
+ // 表格
29
41
  'code' // 插入代码
30
42
  ];
31
-
32
43
  var InputEditor = /*#__PURE__*/function (_React$Component) {
33
44
  _inherits(InputEditor, _React$Component);
34
-
35
45
  var _super = _createSuper(InputEditor);
36
-
37
46
  function InputEditor() {
38
47
  _classCallCheck(this, InputEditor);
39
-
40
48
  return _super.apply(this, arguments);
41
49
  }
42
-
43
50
  _createClass(InputEditor, [{
44
51
  key: "componentDidMount",
45
52
  value: function componentDidMount() {
46
53
  var _this$props = this.props,
47
- inputKey = _this$props.inputKey,
48
- menus = _this$props.menus,
49
- color = _this$props.color,
50
- _this$props$showLinkI = _this$props.showLinkImg,
51
- showLinkImg = _this$props$showLinkI === void 0 ? true : _this$props$showLinkI,
52
- _this$props$uploadImg = _this$props.uploadImgShowBase64,
53
- uploadImgShowBase64 = _this$props$uploadImg === void 0 ? true : _this$props$uploadImg,
54
- onChange = _this$props.onChange,
55
- value = _this$props.value,
56
- readonly = _this$props.readonly;
57
-
54
+ inputKey = _this$props.inputKey,
55
+ menus = _this$props.menus,
56
+ color = _this$props.color,
57
+ _this$props$showLinkI = _this$props.showLinkImg,
58
+ showLinkImg = _this$props$showLinkI === void 0 ? true : _this$props$showLinkI,
59
+ _this$props$uploadImg = _this$props.uploadImgShowBase64,
60
+ uploadImgShowBase64 = _this$props$uploadImg === void 0 ? true : _this$props$uploadImg,
61
+ onChange = _this$props.onChange,
62
+ value = _this$props.value,
63
+ readonly = _this$props.readonly;
58
64
  if (!readonly) {
59
65
  var elem = this.refs[inputKey];
60
- this[inputKey] = new E(elem); //配置菜单
61
-
62
- menus && (this[inputKey].customConfig.menus = menus); //配置颜色
63
-
64
- color && (this[inputKey].customConfig.menus = color); //配置菜单
65
-
66
+ this[inputKey] = new E(elem);
67
+ //配置菜单
68
+ menus && (this[inputKey].customConfig.menus = menus);
69
+ //配置颜色
70
+ color && (this[inputKey].customConfig.menus = color);
71
+ //配置菜单
66
72
  this[inputKey].customConfig.menus = defaultMenus;
67
-
68
73
  if (menus) {
69
74
  this[inputKey].customConfig.menus = menus;
70
75
  }
71
-
72
76
  this[inputKey].customConfig.uploadImgShowBase64 = uploadImgShowBase64; //是否可以上传图片
73
-
74
77
  this[inputKey].customConfig.showLinkImg = showLinkImg; //隐藏网络图片
75
78
 
76
79
  this[inputKey].customConfig.onchange = function (html) {
77
80
  onChange && onChange(html);
78
- }; //配置编辑区域的 z-index
79
-
80
-
81
+ };
82
+ //配置编辑区域的 z-index
81
83
  this[inputKey].customConfig.zIndex = 0;
82
84
  this[inputKey].create();
83
85
  this[inputKey].txt.html(value);
@@ -87,19 +89,19 @@ var InputEditor = /*#__PURE__*/function (_React$Component) {
87
89
  key: "componentDidUpdate",
88
90
  value: function componentDidUpdate() {
89
91
  var _this$props2 = this.props,
90
- inputKey = _this$props2.inputKey,
91
- _this$props2$value = _this$props2.value,
92
- value = _this$props2$value === void 0 ? '' : _this$props2$value,
93
- readonly = _this$props2.readonly;
92
+ inputKey = _this$props2.inputKey,
93
+ _this$props2$value = _this$props2.value,
94
+ value = _this$props2$value === void 0 ? '' : _this$props2$value,
95
+ readonly = _this$props2.readonly;
94
96
  !readonly && !value && this[inputKey].txt.html(value); //支持清空操作
95
97
  }
96
98
  }, {
97
99
  key: "render",
98
100
  value: function render() {
99
101
  var _this$props3 = this.props,
100
- inputKey = _this$props3.inputKey,
101
- readonly = _this$props3.readonly,
102
- value = _this$props3.value;
102
+ inputKey = _this$props3.inputKey,
103
+ readonly = _this$props3.readonly,
104
+ value = _this$props3.value;
103
105
  return /*#__PURE__*/React.createElement("div", {
104
106
  className: variables('InputEditor')
105
107
  }, readonly ? /*#__PURE__*/React.createElement("div", {
@@ -111,8 +113,6 @@ var InputEditor = /*#__PURE__*/function (_React$Component) {
111
113
  }));
112
114
  }
113
115
  }]);
114
-
115
116
  return InputEditor;
116
117
  }(React.Component);
117
-
118
118
  export default InputEditor;