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