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.
- package/es/Area/Area.js +45 -16
- package/es/Card/Card.js +4 -3
- package/es/CodeInput/CodeInput.js +59 -30
- package/es/Control/Control.js +117 -58
- package/es/Control/event.js +14 -0
- package/es/Enhance/Dialogs.js +21 -6
- package/es/Enhance/Loading.js +46 -26
- package/es/Enhance/index.js +2 -0
- package/es/Header/Header.js +35 -3
- package/es/Header/Vertical.js +24 -1
- package/es/ImageView/ImageView.js +22 -5
- package/es/Indent/Indent.js +7 -3
- package/es/InpurCascader/InputCascader.js +36 -10
- package/es/InputEditor/InputEditor.js +52 -53
- package/es/InputSearch/InputSearch.js +71 -26
- package/es/InputSelect/InputSelect.js +48 -17
- package/es/InputTreeSelect/InputTreeSelect.js +147 -0
- package/es/InputTreeSelect/package.json +6 -0
- package/es/InputWriting/InputWriting.js +28 -6
- package/es/Layout/Layout.js +59 -28
- package/es/LayoutLink/LayoutLink.js +20 -11
- package/es/Link/Link.js +27 -4
- package/es/Loading/Loading.js +3 -1
- package/es/Loading2/Loading2.js +2 -0
- package/es/ModalWithDrag/ModalWithDrag.js +8 -3
- package/es/ModalWithDrag/drag.js +29 -12
- package/es/NumberInput/NumberInput.js +64 -24
- package/es/Search/Search.js +164 -54
- package/es/Sidebar/Sidebar.js +34 -13
- package/es/Sidebar2/Sidebar.js +30 -3
- package/es/SuperForm/SuperForm.js +164 -27
- package/es/SuperForm2/SuperForm.js +182 -31
- package/es/SuperIcon/SuperIcon.js +6 -3
- package/es/SuperPagination/SuperPagination.js +32 -15
- package/es/SuperTab/SuperTab.js +27 -4
- package/es/SuperTab2/SuperTab2.js +33 -11
- package/es/SuperTable/DragSortRow.js +34 -6
- package/es/SuperTable/FilterDropDown.js +34 -10
- package/es/SuperTable/SuperTable.js +216 -84
- package/es/SuperTable/fixed.js +9 -1
- package/es/SuperTable2/SuperTable2.js +226 -101
- package/es/SuperTable2/SuperTableCell.js +60 -16
- package/es/SuperTable3/FilterDropDown.js +34 -10
- package/es/SuperTable3/SuperTable.js +175 -50
- package/es/SuperTable3/fixed.js +9 -1
- package/es/SuperToolbar/SuperToolbar.js +49 -21
- package/es/SuperUpload/SuperUpload.js +233 -156
- package/es/Title/Title.js +15 -12
- package/es/Viewer/ImageViews.js +60 -7
- package/es/Viewer/Viewer.js +32 -5
- package/es/WingBlank/WingBlank.js +6 -2
- package/es/helper.js +29 -7
- package/es/history.js +2 -3
- package/lib/Area/Area.js +64 -16
- package/lib/Card/Card.js +13 -3
- package/lib/CodeInput/CodeInput.js +77 -30
- package/lib/Control/Control.js +160 -58
- package/lib/Control/event.js +16 -0
- package/lib/Enhance/Dialogs.js +32 -6
- package/lib/Enhance/Loading.js +62 -26
- package/lib/Enhance/index.js +9 -0
- package/lib/Header/Header.js +48 -3
- package/lib/Header/Vertical.js +36 -1
- package/lib/ImageView/ImageView.js +30 -5
- package/lib/Indent/Indent.js +13 -3
- package/lib/InpurCascader/InputCascader.js +50 -11
- package/lib/InputEditor/InputEditor.js +61 -53
- package/lib/InputSearch/InputSearch.js +78 -26
- package/lib/InputSelect/InputSelect.js +62 -17
- package/lib/InputTreeSelect/InputTreeSelect.js +169 -0
- package/lib/InputTreeSelect/package.json +6 -0
- package/lib/InputWriting/InputWriting.js +35 -6
- package/lib/Layout/Layout.js +76 -28
- package/lib/LayoutLink/LayoutLink.js +38 -11
- package/lib/Link/Link.js +40 -4
- package/lib/Loading/Loading.js +9 -1
- package/lib/Loading2/Loading2.js +8 -0
- package/lib/ModalWithDrag/ModalWithDrag.js +18 -3
- package/lib/ModalWithDrag/drag.js +34 -12
- package/lib/NumberInput/NumberInput.js +77 -24
- package/lib/Search/Search.js +171 -54
- package/lib/Sidebar/Sidebar.js +46 -13
- package/lib/Sidebar2/Sidebar.js +42 -3
- package/lib/SuperForm/SuperForm.js +162 -27
- package/lib/SuperForm2/SuperForm.js +175 -31
- package/lib/SuperIcon/SuperIcon.js +14 -3
- package/lib/SuperPagination/SuperPagination.js +42 -15
- package/lib/SuperTab/SuperTab.js +34 -4
- package/lib/SuperTab2/SuperTab2.js +48 -11
- package/lib/SuperTable/DragSortRow.js +42 -6
- package/lib/SuperTable/FilterDropDown.js +42 -10
- package/lib/SuperTable/SuperTable.js +211 -83
- package/lib/SuperTable/fixed.js +13 -1
- package/lib/SuperTable2/SuperTable2.js +240 -101
- package/lib/SuperTable2/SuperTableCell.js +67 -13
- package/lib/SuperTable3/FilterDropDown.js +42 -10
- package/lib/SuperTable3/SuperTable.js +170 -49
- package/lib/SuperTable3/fixed.js +13 -1
- package/lib/SuperToolbar/SuperToolbar.js +64 -20
- package/lib/SuperUpload/SuperUpload.js +267 -156
- package/lib/Title/Title.js +24 -12
- package/lib/Viewer/ImageViews.js +63 -7
- package/lib/Viewer/Viewer.js +41 -5
- package/lib/WingBlank/WingBlank.js +14 -2
- package/lib/helper.js +47 -6
- package/lib/history.js +5 -0
- package/lib/index.js +76 -0
- package/lib/variables.js +4 -0
- package/package.json +2 -2
package/lib/Indent/Indent.js
CHANGED
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
|
+
|
|
4
5
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
+
|
|
5
7
|
_Object$defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
10
|
+
|
|
8
11
|
exports["default"] = void 0;
|
|
12
|
+
|
|
9
13
|
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
14
|
+
|
|
10
15
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
16
|
+
|
|
11
17
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
|
18
|
+
|
|
12
19
|
var _react = _interopRequireDefault(require("react"));
|
|
20
|
+
|
|
13
21
|
var _excluded = ["children", "style"];
|
|
22
|
+
|
|
14
23
|
function Indent(_ref) {
|
|
15
24
|
var children = _ref.children,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
25
|
+
_ref$style = _ref.style,
|
|
26
|
+
style = _ref$style === void 0 ? {} : _ref$style,
|
|
27
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
19
28
|
(0, _assign["default"])(style, {
|
|
20
29
|
paddingLeft: 8,
|
|
21
30
|
paddingRight: 8
|
|
@@ -24,5 +33,6 @@ function Indent(_ref) {
|
|
|
24
33
|
style: style
|
|
25
34
|
}, props), children);
|
|
26
35
|
}
|
|
36
|
+
|
|
27
37
|
var _default = Indent;
|
|
28
38
|
exports["default"] = _default;
|
|
@@ -1,45 +1,75 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
|
|
4
|
+
|
|
4
5
|
var _Object$keys2 = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
6
|
+
|
|
5
7
|
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
|
8
|
+
|
|
6
9
|
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
10
|
+
|
|
7
11
|
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
12
|
+
|
|
8
13
|
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
14
|
+
|
|
9
15
|
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
|
16
|
+
|
|
10
17
|
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
|
18
|
+
|
|
11
19
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
20
|
+
|
|
12
21
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
22
|
+
|
|
13
23
|
_Object$defineProperty(exports, "__esModule", {
|
|
14
24
|
value: true
|
|
15
25
|
});
|
|
26
|
+
|
|
16
27
|
exports["default"] = void 0;
|
|
28
|
+
|
|
17
29
|
var _cascader = _interopRequireDefault(require("antd/lib/cascader"));
|
|
30
|
+
|
|
18
31
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
32
|
+
|
|
19
33
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
34
|
+
|
|
20
35
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
36
|
+
|
|
21
37
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
38
|
+
|
|
22
39
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
40
|
+
|
|
23
41
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
42
|
+
|
|
24
43
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
44
|
+
|
|
25
45
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
46
|
+
|
|
26
47
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
48
|
+
|
|
27
49
|
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
50
|
+
|
|
28
51
|
var _react = _interopRequireDefault(require("react"));
|
|
52
|
+
|
|
29
53
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
54
|
+
|
|
30
55
|
var _helper = require("../helper");
|
|
56
|
+
|
|
31
57
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys2(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; }
|
|
58
|
+
|
|
32
59
|
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) { (0, _defineProperty2["default"])(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; }
|
|
60
|
+
|
|
33
61
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
34
|
-
|
|
62
|
+
|
|
63
|
+
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; } }
|
|
64
|
+
|
|
35
65
|
var optionsType = {
|
|
36
66
|
value: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]).isRequired,
|
|
37
67
|
disabled: _propTypes["default"].bool,
|
|
38
68
|
children: _propTypes["default"].array,
|
|
39
69
|
title: _propTypes["default"].string,
|
|
40
70
|
isLeaf: _propTypes["default"].bool //false 就会触发 loadData 方法,从而在loadData方法中请求下一级数据,
|
|
41
|
-
};
|
|
42
71
|
|
|
72
|
+
};
|
|
43
73
|
var PROPS = {
|
|
44
74
|
options: _propTypes["default"].arrayOf(_propTypes["default"].shape(optionsType)).isRequired,
|
|
45
75
|
value: _propTypes["default"].array.isRequired,
|
|
@@ -50,11 +80,15 @@ var PROPS = {
|
|
|
50
80
|
showSearch: _propTypes["default"].func
|
|
51
81
|
};
|
|
52
82
|
var PROPS_KEYS = (0, _keys["default"])(PROPS);
|
|
83
|
+
|
|
53
84
|
var InputCascader = /*#__PURE__*/function (_React$Component) {
|
|
54
85
|
(0, _inherits2["default"])(InputCascader, _React$Component);
|
|
86
|
+
|
|
55
87
|
var _super = _createSuper(InputCascader);
|
|
88
|
+
|
|
56
89
|
function InputCascader(_props) {
|
|
57
90
|
var _this;
|
|
91
|
+
|
|
58
92
|
(0, _classCallCheck2["default"])(this, InputCascader);
|
|
59
93
|
_this = _super.call(this, _props);
|
|
60
94
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (value) {
|
|
@@ -70,22 +104,24 @@ var InputCascader = /*#__PURE__*/function (_React$Component) {
|
|
|
70
104
|
var obj = _objectSpread(_objectSpread({}, option), {}, {
|
|
71
105
|
label: option.title
|
|
72
106
|
});
|
|
107
|
+
|
|
73
108
|
if (option.children && option.children.length > 0) {
|
|
74
109
|
obj.children = _this.getOptions(option.children);
|
|
75
110
|
}
|
|
111
|
+
|
|
76
112
|
return obj;
|
|
77
113
|
});
|
|
78
114
|
});
|
|
79
115
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "showSearch", function (inputValue, path) {});
|
|
80
116
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getProps", function () {
|
|
81
117
|
var _this$props = _this.props,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
118
|
+
_this$props$options = _this$props.options,
|
|
119
|
+
options = _this$props$options === void 0 ? [] : _this$props$options,
|
|
120
|
+
placeholder = _this$props.placeholder,
|
|
121
|
+
size = _this$props.size,
|
|
122
|
+
value = _this$props.value,
|
|
123
|
+
loadData = _this$props.loadData,
|
|
124
|
+
showSearch = _this$props.showSearch;
|
|
89
125
|
var props = (0, _assign["default"])((0, _helper.getObjectExclude)({}, PROPS_KEYS), {
|
|
90
126
|
onChange: _this.onChange,
|
|
91
127
|
value: value,
|
|
@@ -93,17 +129,19 @@ var InputCascader = /*#__PURE__*/function (_React$Component) {
|
|
|
93
129
|
changeOnSelect: true,
|
|
94
130
|
placeholder: placeholder,
|
|
95
131
|
size: size
|
|
96
|
-
});
|
|
97
|
-
|
|
132
|
+
}); //动态加载 ps:loadData 与 showSearch 无法一起使用
|
|
133
|
+
|
|
98
134
|
if (loadData) {
|
|
99
135
|
props.loadData = _this.loadData;
|
|
100
136
|
} else if (showSearch) {
|
|
101
137
|
props.showSearch = _this.showSearch;
|
|
102
138
|
}
|
|
139
|
+
|
|
103
140
|
return props;
|
|
104
141
|
});
|
|
105
142
|
return _this;
|
|
106
143
|
}
|
|
144
|
+
|
|
107
145
|
(0, _createClass2["default"])(InputCascader, [{
|
|
108
146
|
key: "render",
|
|
109
147
|
value: function render() {
|
|
@@ -112,6 +150,7 @@ var InputCascader = /*#__PURE__*/function (_React$Component) {
|
|
|
112
150
|
}]);
|
|
113
151
|
return InputCascader;
|
|
114
152
|
}(_react["default"].Component);
|
|
153
|
+
|
|
115
154
|
(0, _defineProperty2["default"])(InputCascader, "propTypes", PROPS);
|
|
116
155
|
var _default = InputCascader;
|
|
117
156
|
exports["default"] = _default;
|
|
@@ -1,93 +1,101 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
|
|
4
|
+
|
|
4
5
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
6
|
+
|
|
5
7
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
8
|
+
|
|
6
9
|
_Object$defineProperty(exports, "__esModule", {
|
|
7
10
|
value: true
|
|
8
11
|
});
|
|
12
|
+
|
|
9
13
|
exports["default"] = void 0;
|
|
14
|
+
|
|
10
15
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
16
|
+
|
|
11
17
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
18
|
+
|
|
12
19
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
20
|
+
|
|
13
21
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
22
|
+
|
|
14
23
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
24
|
+
|
|
15
25
|
var _react = _interopRequireDefault(require("react"));
|
|
26
|
+
|
|
16
27
|
var _variables = _interopRequireDefault(require("../variables"));
|
|
28
|
+
|
|
17
29
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
30
|
+
|
|
18
31
|
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; } }
|
|
19
|
-
|
|
20
|
-
// 标题
|
|
21
|
-
'bold',
|
|
22
|
-
//
|
|
23
|
-
'
|
|
24
|
-
//
|
|
25
|
-
'
|
|
26
|
-
//
|
|
27
|
-
'
|
|
28
|
-
//
|
|
29
|
-
'
|
|
30
|
-
//
|
|
31
|
-
'
|
|
32
|
-
//
|
|
33
|
-
'
|
|
34
|
-
//
|
|
35
|
-
'backColor',
|
|
36
|
-
// 背景颜色
|
|
37
|
-
'link',
|
|
38
|
-
// 插入链接
|
|
39
|
-
'list',
|
|
40
|
-
// 列表
|
|
41
|
-
'justify',
|
|
42
|
-
// 对齐方式
|
|
43
|
-
'quote',
|
|
44
|
-
// 引用
|
|
45
|
-
'image',
|
|
46
|
-
// 插入图片
|
|
47
|
-
'table',
|
|
48
|
-
// 表格
|
|
32
|
+
|
|
33
|
+
var defaultMenus = ['head', // 标题
|
|
34
|
+
'bold', // 粗体
|
|
35
|
+
'fontSize', // 字号
|
|
36
|
+
'fontName', // 字体
|
|
37
|
+
'italic', // 斜体
|
|
38
|
+
'underline', // 下划线
|
|
39
|
+
'strikeThrough', // 删除线
|
|
40
|
+
'foreColor', // 文字颜色
|
|
41
|
+
'backColor', // 背景颜色
|
|
42
|
+
'link', // 插入链接
|
|
43
|
+
'list', // 列表
|
|
44
|
+
'justify', // 对齐方式
|
|
45
|
+
'quote', // 引用
|
|
46
|
+
'image', // 插入图片
|
|
47
|
+
'table', // 表格
|
|
49
48
|
'code' // 插入代码
|
|
50
49
|
];
|
|
50
|
+
|
|
51
51
|
var InputEditor = /*#__PURE__*/function (_React$Component) {
|
|
52
52
|
(0, _inherits2["default"])(InputEditor, _React$Component);
|
|
53
|
+
|
|
53
54
|
var _super = _createSuper(InputEditor);
|
|
55
|
+
|
|
54
56
|
function InputEditor() {
|
|
55
57
|
(0, _classCallCheck2["default"])(this, InputEditor);
|
|
56
58
|
return _super.apply(this, arguments);
|
|
57
59
|
}
|
|
60
|
+
|
|
58
61
|
(0, _createClass2["default"])(InputEditor, [{
|
|
59
62
|
key: "componentDidMount",
|
|
60
63
|
value: function componentDidMount() {
|
|
61
64
|
var _this$props = this.props,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
inputKey = _this$props.inputKey,
|
|
66
|
+
menus = _this$props.menus,
|
|
67
|
+
color = _this$props.color,
|
|
68
|
+
_this$props$showLinkI = _this$props.showLinkImg,
|
|
69
|
+
showLinkImg = _this$props$showLinkI === void 0 ? true : _this$props$showLinkI,
|
|
70
|
+
_this$props$uploadImg = _this$props.uploadImgShowBase64,
|
|
71
|
+
uploadImgShowBase64 = _this$props$uploadImg === void 0 ? true : _this$props$uploadImg,
|
|
72
|
+
onChange = _this$props.onChange,
|
|
73
|
+
value = _this$props.value,
|
|
74
|
+
readonly = _this$props.readonly;
|
|
75
|
+
|
|
72
76
|
if (!readonly) {
|
|
73
77
|
var elem = this.refs[inputKey];
|
|
74
|
-
this[inputKey] = new E(elem);
|
|
75
|
-
|
|
76
|
-
menus && (this[inputKey].config.menus = menus);
|
|
77
|
-
|
|
78
|
-
color && (this[inputKey].config.menus = color);
|
|
79
|
-
|
|
78
|
+
this[inputKey] = new E(elem); //配置菜单
|
|
79
|
+
|
|
80
|
+
menus && (this[inputKey].config.menus = menus); //配置颜色
|
|
81
|
+
|
|
82
|
+
color && (this[inputKey].config.menus = color); //配置菜单
|
|
83
|
+
|
|
80
84
|
this[inputKey].config.menus = defaultMenus;
|
|
85
|
+
|
|
81
86
|
if (menus) {
|
|
82
87
|
this[inputKey].config.menus = menus;
|
|
83
88
|
}
|
|
89
|
+
|
|
84
90
|
this[inputKey].config.uploadImgShowBase64 = uploadImgShowBase64; //是否可以上传图片
|
|
91
|
+
|
|
85
92
|
this[inputKey].config.showLinkImg = showLinkImg; //隐藏网络图片
|
|
86
93
|
|
|
87
94
|
this[inputKey].config.onchange = function (html) {
|
|
88
95
|
onChange && onChange(html);
|
|
89
|
-
};
|
|
90
|
-
|
|
96
|
+
}; //配置编辑区域的 z-index
|
|
97
|
+
|
|
98
|
+
|
|
91
99
|
this[inputKey].config.zIndex = 0;
|
|
92
100
|
this[inputKey].create();
|
|
93
101
|
this[inputKey].txt.html(value);
|
|
@@ -95,17 +103,16 @@ var InputEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
95
103
|
}
|
|
96
104
|
}, {
|
|
97
105
|
key: "componentDidUpdate",
|
|
98
|
-
value: function componentDidUpdate() {
|
|
99
|
-
// const {inputKey,value='', readonly} = this.props;
|
|
106
|
+
value: function componentDidUpdate() {// const {inputKey,value='', readonly} = this.props;
|
|
100
107
|
// !readonly && value && this[inputKey].txt.html(value); //支持清空操作
|
|
101
108
|
}
|
|
102
109
|
}, {
|
|
103
110
|
key: "render",
|
|
104
111
|
value: function render() {
|
|
105
112
|
var _this$props2 = this.props,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
113
|
+
inputKey = _this$props2.inputKey,
|
|
114
|
+
readonly = _this$props2.readonly,
|
|
115
|
+
value = _this$props2.value;
|
|
109
116
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
110
117
|
className: (0, _variables["default"])('InputEditor')
|
|
111
118
|
}, readonly ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -119,5 +126,6 @@ var InputEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
119
126
|
}]);
|
|
120
127
|
return InputEditor;
|
|
121
128
|
}(_react["default"].Component);
|
|
129
|
+
|
|
122
130
|
var _default = InputEditor;
|
|
123
131
|
exports["default"] = _default;
|
|
@@ -1,39 +1,67 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
|
|
4
|
+
|
|
4
5
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
6
|
+
|
|
5
7
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
8
|
+
|
|
6
9
|
_Object$defineProperty(exports, "__esModule", {
|
|
7
10
|
value: true
|
|
8
11
|
});
|
|
12
|
+
|
|
9
13
|
exports["default"] = void 0;
|
|
14
|
+
|
|
10
15
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
16
|
+
|
|
11
17
|
var _findIndex = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find-index"));
|
|
18
|
+
|
|
12
19
|
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
20
|
+
|
|
13
21
|
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
22
|
+
|
|
14
23
|
var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
|
|
24
|
+
|
|
15
25
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
26
|
+
|
|
16
27
|
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
28
|
+
|
|
17
29
|
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
30
|
+
|
|
18
31
|
var _input = _interopRequireDefault(require("antd/lib/input"));
|
|
32
|
+
|
|
19
33
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
|
|
34
|
+
|
|
20
35
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
36
|
+
|
|
21
37
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
38
|
+
|
|
22
39
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
40
|
+
|
|
23
41
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
42
|
+
|
|
24
43
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
44
|
+
|
|
25
45
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
46
|
+
|
|
26
47
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
48
|
+
|
|
27
49
|
var _icon = _interopRequireDefault(require("antd/lib/icon"));
|
|
50
|
+
|
|
28
51
|
var _autoComplete = _interopRequireDefault(require("antd/lib/auto-complete"));
|
|
52
|
+
|
|
29
53
|
var _react = _interopRequireDefault(require("react"));
|
|
54
|
+
|
|
30
55
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
56
|
+
|
|
31
57
|
var _helper = require("../helper");
|
|
58
|
+
|
|
32
59
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
60
|
+
|
|
33
61
|
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; } }
|
|
34
|
-
var SelectOption = _autoComplete["default"].Option;
|
|
35
62
|
|
|
36
|
-
// 如果写在局部,每次渲染时生成的suffix引用值不同,会使antd的Input认为suffix动态变化了,从而导致Input报出警告 (antd的BUG)
|
|
63
|
+
var SelectOption = _autoComplete["default"].Option; // 如果写在局部,每次渲染时生成的suffix引用值不同,会使antd的Input认为suffix动态变化了,从而导致Input报出警告 (antd的BUG)
|
|
64
|
+
|
|
37
65
|
var suffix = /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
38
66
|
type: "search",
|
|
39
67
|
style: {
|
|
@@ -42,6 +70,7 @@ var suffix = /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
|
42
70
|
marginRight: -4
|
|
43
71
|
}
|
|
44
72
|
});
|
|
73
|
+
|
|
45
74
|
var OPTION_STYLE = {
|
|
46
75
|
"float": 'right',
|
|
47
76
|
marginLeft: '1rem',
|
|
@@ -53,13 +82,13 @@ var OPTION_STYLE2 = {
|
|
|
53
82
|
color: '#aaa',
|
|
54
83
|
whiteSpace: 'pre-wrap'
|
|
55
84
|
};
|
|
56
|
-
|
|
57
85
|
/**
|
|
58
86
|
* filter: 为true表示下拉列表会依据输入的值进行前端过滤,默认为true; 如果不想过滤,则设为false
|
|
59
87
|
* remark: 为true表示options的option中含有remark字段,并需要用remark值进行过滤下拉,默认为false
|
|
60
88
|
* searchWhenClick: 每次点击时,触发onSearch事件,默认为false
|
|
61
89
|
* noSearchWhenTypo: 当输入时,不触发onSearch事件,默认为false
|
|
62
90
|
*/
|
|
91
|
+
|
|
63
92
|
var PROPS = {
|
|
64
93
|
filter: _propTypes["default"].bool,
|
|
65
94
|
remark: _propTypes["default"].bool,
|
|
@@ -74,35 +103,42 @@ var PROPS = {
|
|
|
74
103
|
onSearch: _propTypes["default"].func
|
|
75
104
|
};
|
|
76
105
|
var PROPS_KEYS = (0, _keys["default"])(PROPS);
|
|
106
|
+
|
|
77
107
|
var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
78
108
|
(0, _inherits2["default"])(InputSearch, _React$Component);
|
|
109
|
+
|
|
79
110
|
var _super = _createSuper(InputSearch);
|
|
111
|
+
|
|
80
112
|
function InputSearch(_props) {
|
|
81
113
|
var _this;
|
|
114
|
+
|
|
82
115
|
(0, _classCallCheck2["default"])(this, InputSearch);
|
|
83
116
|
_this = _super.call(this, _props);
|
|
84
117
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSearch", function (value) {
|
|
85
118
|
_this.setState({
|
|
86
119
|
value: value
|
|
87
120
|
});
|
|
121
|
+
|
|
88
122
|
var _this$props = _this.props,
|
|
89
|
-
|
|
90
|
-
|
|
123
|
+
onSearch = _this$props.onSearch,
|
|
124
|
+
noSearchWhenTypo = _this$props.noSearchWhenTypo;
|
|
91
125
|
!noSearchWhenTypo && onSearch && onSearch(value);
|
|
92
126
|
});
|
|
93
127
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onBlur", function () {
|
|
94
128
|
var _this$props2 = _this.props,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
129
|
+
_this$props2$autoAdd = _this$props2.autoAdd,
|
|
130
|
+
autoAdd = _this$props2$autoAdd === void 0 ? false : _this$props2$autoAdd,
|
|
131
|
+
_this$props2$options = _this$props2.options,
|
|
132
|
+
options = _this$props2$options === void 0 ? [] : _this$props2$options,
|
|
133
|
+
onChange = _this$props2.onChange,
|
|
134
|
+
onBlur = _this$props2.onBlur;
|
|
135
|
+
|
|
101
136
|
if (_this.props.value !== _this.state.value) {
|
|
102
137
|
var index = (0, _findIndex["default"])(options).call(options, function (option) {
|
|
103
138
|
return option.title === _this.state.value;
|
|
104
139
|
});
|
|
105
140
|
var value = '';
|
|
141
|
+
|
|
106
142
|
if (index === -1) {
|
|
107
143
|
if (autoAdd && _this.state.value) {
|
|
108
144
|
if (typeof _this.state.value === 'string') {
|
|
@@ -117,9 +153,11 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
117
153
|
} else {
|
|
118
154
|
value = options[index];
|
|
119
155
|
}
|
|
156
|
+
|
|
120
157
|
_this.setState({
|
|
121
158
|
value: value
|
|
122
159
|
});
|
|
160
|
+
|
|
123
161
|
onChange && onChange(value);
|
|
124
162
|
onBlur && onBlur(value);
|
|
125
163
|
} else {
|
|
@@ -128,32 +166,36 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
128
166
|
});
|
|
129
167
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSelect", function (value) {
|
|
130
168
|
var _this$props3 = _this.props,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
169
|
+
onChange = _this$props3.onChange,
|
|
170
|
+
_this$props3$options = _this$props3.options,
|
|
171
|
+
options = _this$props3$options === void 0 ? [] : _this$props3$options;
|
|
134
172
|
var index = (0, _findIndex["default"])(options).call(options, function (option) {
|
|
135
173
|
return String(option.value) === value;
|
|
136
174
|
});
|
|
175
|
+
|
|
137
176
|
if (index > -1) {
|
|
138
177
|
_this.setState({
|
|
139
178
|
value: options[index]
|
|
140
179
|
});
|
|
180
|
+
|
|
141
181
|
onChange && onChange(options[index]);
|
|
142
182
|
}
|
|
143
183
|
});
|
|
144
184
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onClick", function (e) {
|
|
145
185
|
var _this$props4 = _this.props,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
186
|
+
_this$props4$options = _this$props4.options,
|
|
187
|
+
options = _this$props4$options === void 0 ? [] : _this$props4$options,
|
|
188
|
+
onSearch = _this$props4.onSearch,
|
|
189
|
+
searchWhenClick = _this$props4.searchWhenClick,
|
|
190
|
+
value = _this$props4.value;
|
|
191
|
+
|
|
151
192
|
if (onSearch && (!options.length || !value && searchWhenClick)) {
|
|
152
193
|
onSearch(e.target.value);
|
|
153
194
|
}
|
|
154
195
|
});
|
|
155
196
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "makeValueValid", function (value) {
|
|
156
197
|
var _context;
|
|
198
|
+
|
|
157
199
|
return (0, _includes["default"])(_context = [NaN, undefined, null]).call(_context, value) ? '' : value;
|
|
158
200
|
});
|
|
159
201
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getValue", function () {
|
|
@@ -162,24 +204,27 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
162
204
|
});
|
|
163
205
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "isMatch", function (inputValue, option) {
|
|
164
206
|
var _context2;
|
|
207
|
+
|
|
165
208
|
return option.props.children && (0, _indexOf["default"])(_context2 = option.props.children).call(_context2, inputValue) !== -1;
|
|
166
209
|
});
|
|
167
210
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "isMatchRemark", function (inputValue, option) {
|
|
168
211
|
var _option$props = option.props,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
212
|
+
_option$props$text = _option$props.text,
|
|
213
|
+
text = _option$props$text === void 0 ? '' : _option$props$text,
|
|
214
|
+
_option$props$remark = _option$props.remark,
|
|
215
|
+
remark = _option$props$remark === void 0 ? '' : _option$props$remark;
|
|
173
216
|
return (0, _indexOf["default"])(text).call(text, inputValue) > -1 || (0, _indexOf["default"])(remark).call(remark, inputValue) > -1;
|
|
174
217
|
});
|
|
175
218
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "isValidValue", function (value) {
|
|
176
219
|
var _context3;
|
|
220
|
+
|
|
177
221
|
// value必须为对象,且有属性value的值不等''或undefined
|
|
178
222
|
return value && !(0, _includes["default"])(_context3 = ['', undefined]).call(_context3, value.value);
|
|
179
223
|
});
|
|
180
224
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getOptions", function () {
|
|
181
225
|
var value = _this.state.value;
|
|
182
226
|
var options = _this.props.options;
|
|
227
|
+
|
|
183
228
|
if (options && options.length) {
|
|
184
229
|
if (_this.isValidValue(value) && !(0, _find["default"])(options).call(options, function (option) {
|
|
185
230
|
return option.value === value.value;
|
|
@@ -196,6 +241,7 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
196
241
|
});
|
|
197
242
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getDataSource", function () {
|
|
198
243
|
var _context4;
|
|
244
|
+
|
|
199
245
|
return (0, _map["default"])(_context4 = _this.getOptions()).call(_context4, function (option) {
|
|
200
246
|
return {
|
|
201
247
|
value: String(option.value),
|
|
@@ -205,6 +251,7 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
205
251
|
});
|
|
206
252
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getDataSourceRemark", function () {
|
|
207
253
|
var _context5;
|
|
254
|
+
|
|
208
255
|
return (0, _map["default"])(_context5 = _this.getOptions()).call(_context5, function (option, index) {
|
|
209
256
|
return /*#__PURE__*/_react["default"].createElement(SelectOption, {
|
|
210
257
|
key: index,
|
|
@@ -220,9 +267,10 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
220
267
|
});
|
|
221
268
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getProps", function () {
|
|
222
269
|
var _this$props5 = _this.props,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
270
|
+
inputRef = _this$props5.inputRef,
|
|
271
|
+
_this$props5$filter = (0, _filter["default"])(_this$props5),
|
|
272
|
+
filter = _this$props5$filter === void 0 ? true : _this$props5$filter;
|
|
273
|
+
|
|
226
274
|
var props = (0, _assign["default"])((0, _helper.getObjectExclude)(_this.props, PROPS_KEYS), {
|
|
227
275
|
value: _this.getValue(),
|
|
228
276
|
allowClear: true,
|
|
@@ -234,6 +282,7 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
234
282
|
onSelect: _this.onSelect,
|
|
235
283
|
onBlur: _this.onBlur
|
|
236
284
|
});
|
|
285
|
+
|
|
237
286
|
if (_this.props.remark) {
|
|
238
287
|
props.dataSource = _this.getDataSourceRemark();
|
|
239
288
|
props.filterOption = filter ? _this.isMatchRemark : false;
|
|
@@ -242,6 +291,7 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
242
291
|
props.dataSource = _this.getDataSource();
|
|
243
292
|
props.filterOption = filter ? _this.isMatch : false;
|
|
244
293
|
}
|
|
294
|
+
|
|
245
295
|
return props;
|
|
246
296
|
});
|
|
247
297
|
_this.state = {
|
|
@@ -249,6 +299,7 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
249
299
|
};
|
|
250
300
|
return _this;
|
|
251
301
|
}
|
|
302
|
+
|
|
252
303
|
(0, _createClass2["default"])(InputSearch, [{
|
|
253
304
|
key: "componentWillReceiveProps",
|
|
254
305
|
value: function componentWillReceiveProps(props) {
|
|
@@ -270,6 +321,7 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
270
321
|
}]);
|
|
271
322
|
return InputSearch;
|
|
272
323
|
}(_react["default"].Component);
|
|
324
|
+
|
|
273
325
|
(0, _defineProperty2["default"])(InputSearch, "propTypes", PROPS);
|
|
274
326
|
var _default = InputSearch;
|
|
275
327
|
exports["default"] = _default;
|