cloud-b2b 1.1.45 → 1.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +227 -102
- 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 +241 -102
- 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
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
|
|
2
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
3
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
4
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
|
5
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
6
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
|
7
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
|
8
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
9
|
+
import _TreeSelect from "antd/es/tree-select";
|
|
10
|
+
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
11
|
+
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
12
|
+
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
|
13
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
14
|
+
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
15
|
+
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
16
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
17
|
+
|
|
18
|
+
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
|
+
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
|
+
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
|
+
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
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
27
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
28
|
+
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
29
|
+
//级联选择input
|
|
30
|
+
import React from 'react';
|
|
31
|
+
import PropTypes from 'prop-types';
|
|
32
|
+
import { getObjectExclude } from '../helper';
|
|
33
|
+
var optionsType = {
|
|
34
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
35
|
+
key: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
36
|
+
disabled: PropTypes.bool,
|
|
37
|
+
children: PropTypes.array,
|
|
38
|
+
title: PropTypes.string,
|
|
39
|
+
isLeaf: PropTypes.bool //false 就会触发 loadData 方法,从而在loadData方法中请求下一级数据,
|
|
40
|
+
|
|
41
|
+
};
|
|
42
|
+
var PROPS = {
|
|
43
|
+
options: PropTypes.arrayOf(PropTypes.shape(optionsType)).isRequired,
|
|
44
|
+
value: PropTypes.array.isRequired,
|
|
45
|
+
placeholder: PropTypes.string,
|
|
46
|
+
onChange: PropTypes.func,
|
|
47
|
+
loadData: PropTypes.func,
|
|
48
|
+
//动态加载 ps:loadData 与 showSearch 无法一起使用
|
|
49
|
+
showSearch: PropTypes.bool,
|
|
50
|
+
onTreeExpand: PropTypes.func,
|
|
51
|
+
treeDefaultExpandAll: PropTypes.bool,
|
|
52
|
+
treeDataSimpleMode: PropTypes.bool,
|
|
53
|
+
multiple: PropTypes.bool
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
var PROPS_KEYS = _Object$keys(PROPS);
|
|
57
|
+
|
|
58
|
+
var InputTreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
59
|
+
_inherits(InputTreeSelect, _React$Component);
|
|
60
|
+
|
|
61
|
+
var _super = _createSuper(InputTreeSelect);
|
|
62
|
+
|
|
63
|
+
function InputTreeSelect(_props) {
|
|
64
|
+
var _this;
|
|
65
|
+
|
|
66
|
+
_classCallCheck(this, InputTreeSelect);
|
|
67
|
+
|
|
68
|
+
_this = _super.call(this, _props);
|
|
69
|
+
|
|
70
|
+
_defineProperty(_assertThisInitialized(_this), "onChange", function (value) {
|
|
71
|
+
var onChange = _this.props.onChange;
|
|
72
|
+
onChange && onChange(value);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
_defineProperty(_assertThisInitialized(_this), "loadData", function (selectedOptions) {
|
|
76
|
+
var onSearch = _this.props.onSearch;
|
|
77
|
+
onSearch && onSearch(selectedOptions[0]);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
_defineProperty(_assertThisInitialized(_this), "getOptions", function (options) {
|
|
81
|
+
return _mapInstanceProperty(options).call(options, function (option) {
|
|
82
|
+
var obj = _objectSpread(_objectSpread({}, option), {}, {
|
|
83
|
+
label: option.title
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
if (option.children && option.children.length > 0) {
|
|
87
|
+
obj.children = _this.getOptions(option.children);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return obj;
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
_defineProperty(_assertThisInitialized(_this), "getProps", function () {
|
|
95
|
+
var _this$props = _this.props,
|
|
96
|
+
_this$props$options = _this$props.options,
|
|
97
|
+
options = _this$props$options === void 0 ? [] : _this$props$options,
|
|
98
|
+
placeholder = _this$props.placeholder,
|
|
99
|
+
size = _this$props.size,
|
|
100
|
+
value = _this$props.value,
|
|
101
|
+
loadData = _this$props.loadData,
|
|
102
|
+
_this$props$treeDefau = _this$props.treeDefaultExpandAll,
|
|
103
|
+
treeDefaultExpandAll = _this$props$treeDefau === void 0 ? false : _this$props$treeDefau,
|
|
104
|
+
_this$props$showSearc = _this$props.showSearch,
|
|
105
|
+
showSearch = _this$props$showSearc === void 0 ? false : _this$props$showSearc,
|
|
106
|
+
_this$props$treeDataS = _this$props.treeDataSimpleMode,
|
|
107
|
+
treeDataSimpleMode = _this$props$treeDataS === void 0 ? false : _this$props$treeDataS,
|
|
108
|
+
_this$props$multiple = _this$props.multiple,
|
|
109
|
+
multiple = _this$props$multiple === void 0 ? false : _this$props$multiple;
|
|
110
|
+
|
|
111
|
+
var props = _Object$assign(getObjectExclude({}, PROPS_KEYS), {
|
|
112
|
+
onChange: _this.onChange,
|
|
113
|
+
value: value,
|
|
114
|
+
treeData: options,
|
|
115
|
+
treeDataSimpleMode: treeDataSimpleMode,
|
|
116
|
+
placeholder: placeholder,
|
|
117
|
+
treeDefaultExpandAll: treeDefaultExpandAll,
|
|
118
|
+
multiple: multiple,
|
|
119
|
+
size: size
|
|
120
|
+
}); //动态加载 ps:loadData 与 showSearch 无法一起使用
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
if (loadData) {
|
|
124
|
+
props.loadData = _this.loadData;
|
|
125
|
+
} else if (showSearch) {
|
|
126
|
+
props.showSearch = showSearch;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return props;
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
return _this;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
_createClass(InputTreeSelect, [{
|
|
136
|
+
key: "render",
|
|
137
|
+
value: function render() {
|
|
138
|
+
return /*#__PURE__*/React.createElement(_TreeSelect, this.getProps());
|
|
139
|
+
}
|
|
140
|
+
}]);
|
|
141
|
+
|
|
142
|
+
return InputTreeSelect;
|
|
143
|
+
}(React.Component);
|
|
144
|
+
|
|
145
|
+
_defineProperty(InputTreeSelect, "propTypes", PROPS);
|
|
146
|
+
|
|
147
|
+
export default InputTreeSelect;
|
|
@@ -9,58 +9,78 @@ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
|
9
9
|
import _Select from "antd/es/select";
|
|
10
10
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
11
11
|
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
|
|
12
|
+
|
|
12
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); }; }
|
|
14
|
+
|
|
13
15
|
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; } }
|
|
16
|
+
|
|
14
17
|
import React from 'react';
|
|
15
18
|
var Option = _Select.Option;
|
|
19
|
+
|
|
16
20
|
var InputWriting = /*#__PURE__*/function (_React$Component) {
|
|
17
21
|
_inherits(InputWriting, _React$Component);
|
|
22
|
+
|
|
18
23
|
var _super = _createSuper(InputWriting);
|
|
24
|
+
|
|
19
25
|
function InputWriting() {
|
|
20
26
|
var _context;
|
|
27
|
+
|
|
21
28
|
var _this;
|
|
29
|
+
|
|
22
30
|
_classCallCheck(this, InputWriting);
|
|
31
|
+
|
|
23
32
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
24
33
|
args[_key] = arguments[_key];
|
|
25
34
|
}
|
|
35
|
+
|
|
26
36
|
_this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
|
|
37
|
+
|
|
27
38
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
28
39
|
options: [],
|
|
29
40
|
value: [],
|
|
30
41
|
fetching: false
|
|
31
42
|
});
|
|
43
|
+
|
|
32
44
|
_defineProperty(_assertThisInitialized(_this), "onClick", function (e) {
|
|
33
45
|
var _this$props = _this.props,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
46
|
+
_this$props$options = _this$props.options,
|
|
47
|
+
options = _this$props$options === void 0 ? [] : _this$props$options,
|
|
48
|
+
onSearch = _this$props.onSearch,
|
|
49
|
+
value = _this$props.value;
|
|
50
|
+
|
|
38
51
|
if (onSearch && !options.length) {
|
|
39
52
|
onSearch(e.target.value);
|
|
40
53
|
}
|
|
41
54
|
});
|
|
55
|
+
|
|
42
56
|
_defineProperty(_assertThisInitialized(_this), "onSearch", function (value) {
|
|
43
57
|
var onSearch = _this.props.onSearch;
|
|
44
58
|
onSearch && onSearch(value);
|
|
45
59
|
});
|
|
60
|
+
|
|
46
61
|
_defineProperty(_assertThisInitialized(_this), "isMatch", function (inputValue, option) {
|
|
47
62
|
var _context2;
|
|
63
|
+
|
|
48
64
|
return _indexOfInstanceProperty(_context2 = option.props.children).call(_context2, inputValue) !== -1;
|
|
49
65
|
});
|
|
66
|
+
|
|
50
67
|
_defineProperty(_assertThisInitialized(_this), "toOption", function (option, index) {
|
|
51
68
|
return /*#__PURE__*/React.createElement(SelectOption, {
|
|
52
69
|
key: index,
|
|
53
70
|
value: String(option.value)
|
|
54
71
|
}, option.title);
|
|
55
72
|
});
|
|
73
|
+
|
|
56
74
|
_defineProperty(_assertThisInitialized(_this), "onChange", function (keyValue) {
|
|
57
75
|
var _this$props2 = _this.props,
|
|
58
|
-
|
|
59
|
-
|
|
76
|
+
onChange = _this$props2.onChange,
|
|
77
|
+
value = _this$props2.value;
|
|
60
78
|
onChange && onChange(keyValue);
|
|
61
79
|
});
|
|
80
|
+
|
|
62
81
|
return _this;
|
|
63
82
|
}
|
|
83
|
+
|
|
64
84
|
_createClass(InputWriting, [{
|
|
65
85
|
key: "render",
|
|
66
86
|
value: function render() {
|
|
@@ -80,6 +100,8 @@ var InputWriting = /*#__PURE__*/function (_React$Component) {
|
|
|
80
100
|
}, /*#__PURE__*/React.createElement(_Select, props));
|
|
81
101
|
}
|
|
82
102
|
}]);
|
|
103
|
+
|
|
83
104
|
return InputWriting;
|
|
84
105
|
}(React.Component);
|
|
106
|
+
|
|
85
107
|
export default InputWriting;
|
package/es/Layout/Layout.js
CHANGED
|
@@ -7,8 +7,11 @@ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
|
7
7
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
9
9
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
10
|
+
|
|
10
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); }; }
|
|
12
|
+
|
|
11
13
|
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; } }
|
|
14
|
+
|
|
12
15
|
import _Object$keys2 from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
13
16
|
import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
|
|
14
17
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
@@ -24,15 +27,20 @@ import Loading from '../Loading';
|
|
|
24
27
|
import { jump } from '../Link';
|
|
25
28
|
import variables from '../variables';
|
|
26
29
|
var HeaderV = Header.Vertical;
|
|
30
|
+
|
|
27
31
|
var getCurrentSideKey = function getCurrentSideKey() {
|
|
28
32
|
var sidebars = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
29
33
|
var href = arguments.length > 1 ? arguments[1] : undefined;
|
|
30
34
|
if (!href) return '';
|
|
35
|
+
|
|
31
36
|
for (var _i = 0, _Object$keys = _Object$keys2(sidebars); _i < _Object$keys.length; _i++) {
|
|
32
37
|
var _context;
|
|
38
|
+
|
|
33
39
|
var key = _Object$keys[_i];
|
|
40
|
+
|
|
34
41
|
if (_someInstanceProperty(_context = sidebars[key]).call(_context, function (item) {
|
|
35
42
|
var _context2;
|
|
43
|
+
|
|
36
44
|
return item.href === href || item.children && _someInstanceProperty(_context2 = item.children).call(_context2, function (o) {
|
|
37
45
|
return o.href === href;
|
|
38
46
|
});
|
|
@@ -41,27 +49,36 @@ var getCurrentSideKey = function getCurrentSideKey() {
|
|
|
41
49
|
}
|
|
42
50
|
}
|
|
43
51
|
};
|
|
52
|
+
|
|
44
53
|
var Layout = /*#__PURE__*/function (_React$Component) {
|
|
45
54
|
_inherits(Layout, _React$Component);
|
|
55
|
+
|
|
46
56
|
var _super = _createSuper(Layout);
|
|
57
|
+
|
|
47
58
|
function Layout(props) {
|
|
48
59
|
var _this;
|
|
60
|
+
|
|
49
61
|
_classCallCheck(this, Layout);
|
|
62
|
+
|
|
50
63
|
_this = _super.call(this, props);
|
|
64
|
+
|
|
51
65
|
_defineProperty(_assertThisInitialized(_this), "onOpenChange", function (sideKey, openKeys) {
|
|
52
66
|
var onOpenChange = _this.props.onOpenChange;
|
|
67
|
+
|
|
53
68
|
if (onOpenChange) {
|
|
54
69
|
onOpenChange(sideKey, openKeys);
|
|
55
70
|
}
|
|
56
71
|
});
|
|
72
|
+
|
|
57
73
|
_defineProperty(_assertThisInitialized(_this), "getSidebarProps", function (sideKey) {
|
|
58
74
|
var _context3;
|
|
75
|
+
|
|
59
76
|
var _this$props = _this.props,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
77
|
+
sidebars = _this$props.sidebars,
|
|
78
|
+
nav2 = _this$props.nav2,
|
|
79
|
+
_this$props$openKeys = _this$props.openKeys,
|
|
80
|
+
openKeys = _this$props$openKeys === void 0 ? {} : _this$props$openKeys,
|
|
81
|
+
navigation = _this$props.navigation;
|
|
65
82
|
var sides = sidebars[sideKey] || [];
|
|
66
83
|
return {
|
|
67
84
|
mode: _this.state.mode,
|
|
@@ -79,8 +96,10 @@ var Layout = /*#__PURE__*/function (_React$Component) {
|
|
|
79
96
|
}
|
|
80
97
|
};
|
|
81
98
|
});
|
|
99
|
+
|
|
82
100
|
_defineProperty(_assertThisInitialized(_this), "toSidebar", function (sideKey) {
|
|
83
101
|
var hasHeaderV = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
102
|
+
|
|
84
103
|
if (!sideKey) {
|
|
85
104
|
return null;
|
|
86
105
|
} else {
|
|
@@ -91,22 +110,24 @@ var Layout = /*#__PURE__*/function (_React$Component) {
|
|
|
91
110
|
}, /*#__PURE__*/React.createElement(Sidebar, _this.getSidebarProps(sideKey)));
|
|
92
111
|
}
|
|
93
112
|
});
|
|
113
|
+
|
|
94
114
|
_defineProperty(_assertThisInitialized(_this), "toHeader", function () {
|
|
95
115
|
var _context4, _context5;
|
|
116
|
+
|
|
96
117
|
var _this$props2 = _this.props,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
118
|
+
loading = _this$props2.loading,
|
|
119
|
+
sidebars = _this$props2.sidebars,
|
|
120
|
+
nav1 = _this$props2.nav1,
|
|
121
|
+
nav2 = _this$props2.nav2,
|
|
122
|
+
homeUrl = _this$props2.homeUrl,
|
|
123
|
+
settingUrl = _this$props2.settingUrl,
|
|
124
|
+
messageUrl = _this$props2.messageUrl,
|
|
125
|
+
messageCount = _this$props2.messageCount,
|
|
126
|
+
userName = _this$props2.userName,
|
|
127
|
+
userIcon = _this$props2.userIcon,
|
|
128
|
+
loginUrl = _this$props2.loginUrl,
|
|
129
|
+
onMenuClick = _this$props2.onMenuClick,
|
|
130
|
+
onLogout = _this$props2.onLogout;
|
|
110
131
|
var selectKey = loading ? '' : getCurrentSideKey(sidebars, _concatInstanceProperty(_context4 = "/".concat(nav1, "/")).call(_context4, nav2));
|
|
111
132
|
var selectUrl = loading ? '' : _concatInstanceProperty(_context5 = "/".concat(nav1, "/")).call(_context5, nav2);
|
|
112
133
|
return /*#__PURE__*/React.createElement(Header, {
|
|
@@ -123,8 +144,10 @@ var Layout = /*#__PURE__*/function (_React$Component) {
|
|
|
123
144
|
onLogout: onLogout
|
|
124
145
|
});
|
|
125
146
|
});
|
|
147
|
+
|
|
126
148
|
_defineProperty(_assertThisInitialized(_this), "headerVProps", function (selectKey) {
|
|
127
149
|
var _context6;
|
|
150
|
+
|
|
128
151
|
var keys = ['setting', 'message'];
|
|
129
152
|
return {
|
|
130
153
|
selectKey: selectKey,
|
|
@@ -134,17 +157,20 @@ var Layout = /*#__PURE__*/function (_React$Component) {
|
|
|
134
157
|
})
|
|
135
158
|
};
|
|
136
159
|
});
|
|
160
|
+
|
|
137
161
|
_this.state = {
|
|
138
162
|
mode: 'expand',
|
|
139
163
|
url: {}
|
|
140
164
|
};
|
|
141
165
|
return _this;
|
|
142
166
|
}
|
|
167
|
+
|
|
143
168
|
_createClass(Layout, [{
|
|
144
169
|
key: "componentWillReceiveProps",
|
|
145
170
|
value: function componentWillReceiveProps(props) {
|
|
146
171
|
if (!props.loading) {
|
|
147
172
|
var _context7, _context8;
|
|
173
|
+
|
|
148
174
|
this.setState({
|
|
149
175
|
url: _Object$assign({}, this.state.url, _defineProperty({}, getCurrentSideKey(props.sidebars, _concatInstanceProperty(_context7 = "/".concat(props.nav1, "/")).call(_context7, props.nav2)), _concatInstanceProperty(_context8 = "/".concat(props.nav1, "/")).call(_context8, props.nav2)))
|
|
150
176
|
});
|
|
@@ -154,19 +180,21 @@ var Layout = /*#__PURE__*/function (_React$Component) {
|
|
|
154
180
|
key: "render",
|
|
155
181
|
value: function render() {
|
|
156
182
|
var _context10;
|
|
183
|
+
|
|
157
184
|
var _this$props3 = this.props,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
185
|
+
loading = _this$props3.loading,
|
|
186
|
+
sidebars = _this$props3.sidebars,
|
|
187
|
+
_this$props3$nav = _this$props3.nav1,
|
|
188
|
+
nav1 = _this$props3$nav === void 0 ? '' : _this$props3$nav,
|
|
189
|
+
_this$props3$nav2 = _this$props3.nav2,
|
|
190
|
+
nav2 = _this$props3$nav2 === void 0 ? '' : _this$props3$nav2,
|
|
191
|
+
children = _this$props3.children,
|
|
192
|
+
_this$props3$noPrivil = _this$props3.noPrivilege,
|
|
193
|
+
noPrivilege = _this$props3$noPrivil === void 0 ? false : _this$props3$noPrivil,
|
|
194
|
+
navigation = _this$props3.navigation;
|
|
168
195
|
var hasV = _filterInstanceProperty(navigation).call(navigation, function (item) {
|
|
169
196
|
var _context9;
|
|
197
|
+
|
|
170
198
|
return !_includesInstanceProperty(_context9 = ['setting', 'message']).call(_context9, item.key);
|
|
171
199
|
}).length > 1;
|
|
172
200
|
var sideKey = loading || !nav2 ? '' : getCurrentSideKey(sidebars, _concatInstanceProperty(_context10 = "/".concat(nav1, "/")).call(_context10, nav2));
|
|
@@ -188,8 +216,10 @@ var Layout = /*#__PURE__*/function (_React$Component) {
|
|
|
188
216
|
}, this.toHeader(sideKey), loading ? /*#__PURE__*/React.createElement(Loading, null) : /*#__PURE__*/React.createElement("div", null, hasV ? /*#__PURE__*/React.createElement(HeaderV, this.headerVProps(sideKey)) : null, this.toSidebar(sideKey, hasV), /*#__PURE__*/React.createElement("section", null, children)));
|
|
189
217
|
}
|
|
190
218
|
}]);
|
|
219
|
+
|
|
191
220
|
return Layout;
|
|
192
221
|
}(React.Component);
|
|
222
|
+
|
|
193
223
|
_defineProperty(Layout, "propTypes", {
|
|
194
224
|
children: PropTypes.node.isRequired,
|
|
195
225
|
nav1: PropTypes.string,
|
|
@@ -198,4 +228,5 @@ _defineProperty(Layout, "propTypes", {
|
|
|
198
228
|
openKeys: PropTypes.object,
|
|
199
229
|
onOpenChange: PropTypes.func
|
|
200
230
|
});
|
|
231
|
+
|
|
201
232
|
export default Layout;
|
|
@@ -8,17 +8,21 @@ import WingBlank from '../WingBlank';
|
|
|
8
8
|
import Card from '../Card';
|
|
9
9
|
import variables from '../variables';
|
|
10
10
|
var FormItem = _Form.Item;
|
|
11
|
+
|
|
11
12
|
function Search(_ref) {
|
|
12
13
|
var placeholder = _ref.placeholder,
|
|
13
|
-
|
|
14
|
+
onSearch = _ref.onSearch;
|
|
15
|
+
|
|
14
16
|
var _useState = useState(''),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
18
|
+
value = _useState2[0],
|
|
19
|
+
setValue = _useState2[1];
|
|
20
|
+
|
|
18
21
|
var _useState3 = useState(''),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
23
|
+
status = _useState4[0],
|
|
24
|
+
setStatus = _useState4[1];
|
|
25
|
+
|
|
22
26
|
var onClick = function onClick() {
|
|
23
27
|
if (!value) {
|
|
24
28
|
setStatus('error');
|
|
@@ -26,10 +30,12 @@ function Search(_ref) {
|
|
|
26
30
|
onSearch(value);
|
|
27
31
|
}
|
|
28
32
|
};
|
|
33
|
+
|
|
29
34
|
var onChange = function onChange(e) {
|
|
30
35
|
setStatus('');
|
|
31
36
|
setValue(e.target.value);
|
|
32
37
|
};
|
|
38
|
+
|
|
33
39
|
return /*#__PURE__*/React.createElement(Card, {
|
|
34
40
|
className: variables('LayoutLink').search
|
|
35
41
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FormItem, {
|
|
@@ -42,18 +48,20 @@ function Search(_ref) {
|
|
|
42
48
|
onClick: onClick
|
|
43
49
|
}, "\u5F00\u59CB\u67E5\u8BE2")));
|
|
44
50
|
}
|
|
51
|
+
|
|
45
52
|
function Title(_ref2) {
|
|
46
53
|
var title = _ref2.title;
|
|
47
54
|
return /*#__PURE__*/React.createElement("div", {
|
|
48
55
|
className: variables('LayoutLink').title
|
|
49
56
|
}, /*#__PURE__*/React.createElement("div", null, title), /*#__PURE__*/React.createElement("div", null));
|
|
50
57
|
}
|
|
58
|
+
|
|
51
59
|
function LayoutLink(_ref3) {
|
|
52
60
|
var children = _ref3.children,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
61
|
+
img = _ref3.img,
|
|
62
|
+
title = _ref3.title,
|
|
63
|
+
placeholder = _ref3.placeholder,
|
|
64
|
+
onSearch = _ref3.onSearch;
|
|
57
65
|
return /*#__PURE__*/React.createElement("div", {
|
|
58
66
|
className: variables('LayoutLink')
|
|
59
67
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", {
|
|
@@ -70,4 +78,5 @@ function LayoutLink(_ref3) {
|
|
|
70
78
|
}
|
|
71
79
|
}))));
|
|
72
80
|
}
|
|
81
|
+
|
|
73
82
|
export default LayoutLink;
|
package/es/Link/Link.js
CHANGED
|
@@ -10,17 +10,23 @@ import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
|
10
10
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
11
11
|
var _excluded = ["to", "children", "disabled"];
|
|
12
12
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
13
|
+
|
|
13
14
|
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
|
+
|
|
14
16
|
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
|
+
|
|
15
18
|
import React from 'react';
|
|
16
19
|
import PropTypes from 'prop-types';
|
|
17
20
|
import history from '../history';
|
|
21
|
+
|
|
18
22
|
function isLeftClickEvent(event) {
|
|
19
23
|
return event.button === 0;
|
|
20
24
|
}
|
|
25
|
+
|
|
21
26
|
function isModifiedEvent(event) {
|
|
22
27
|
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
|
|
23
28
|
}
|
|
29
|
+
|
|
24
30
|
function jump(url) {
|
|
25
31
|
if (history.location.pathname != url) {
|
|
26
32
|
history.push(url);
|
|
@@ -28,40 +34,54 @@ function jump(url) {
|
|
|
28
34
|
history.replace(url);
|
|
29
35
|
}
|
|
30
36
|
}
|
|
37
|
+
|
|
31
38
|
var Link = /*#__PURE__*/function (_React$Component) {
|
|
32
39
|
_inherits(Link, _React$Component);
|
|
40
|
+
|
|
33
41
|
var _super = _createSuper(Link);
|
|
42
|
+
|
|
34
43
|
function Link() {
|
|
35
44
|
var _context;
|
|
45
|
+
|
|
36
46
|
var _this;
|
|
47
|
+
|
|
37
48
|
_classCallCheck(this, Link);
|
|
49
|
+
|
|
38
50
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
39
51
|
args[_key] = arguments[_key];
|
|
40
52
|
}
|
|
53
|
+
|
|
41
54
|
_this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
|
|
55
|
+
|
|
42
56
|
_defineProperty(_assertThisInitialized(_this), "handleClick", function (event) {
|
|
43
57
|
if (_this.props.onClick) {
|
|
44
58
|
_this.props.onClick(event);
|
|
45
59
|
}
|
|
60
|
+
|
|
46
61
|
if (isModifiedEvent(event) || !isLeftClickEvent(event)) {
|
|
47
62
|
return;
|
|
48
63
|
}
|
|
64
|
+
|
|
49
65
|
if (event.defaultPrevented === true) {
|
|
50
66
|
return;
|
|
51
67
|
}
|
|
68
|
+
|
|
52
69
|
event.preventDefault();
|
|
53
70
|
jump(_this.props.to);
|
|
54
71
|
});
|
|
72
|
+
|
|
55
73
|
return _this;
|
|
56
74
|
}
|
|
75
|
+
|
|
57
76
|
_createClass(Link, [{
|
|
58
77
|
key: "render",
|
|
59
78
|
value: function render() {
|
|
60
79
|
var _this$props = this.props,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
80
|
+
to = _this$props.to,
|
|
81
|
+
children = _this$props.children,
|
|
82
|
+
disabled = _this$props.disabled,
|
|
83
|
+
props = _objectWithoutProperties(_this$props, _excluded);
|
|
84
|
+
|
|
65
85
|
if (disabled) {
|
|
66
86
|
return /*#__PURE__*/React.createElement("a", props, children);
|
|
67
87
|
} else {
|
|
@@ -73,13 +93,16 @@ var Link = /*#__PURE__*/function (_React$Component) {
|
|
|
73
93
|
}
|
|
74
94
|
}
|
|
75
95
|
}]);
|
|
96
|
+
|
|
76
97
|
return Link;
|
|
77
98
|
}(React.Component);
|
|
99
|
+
|
|
78
100
|
_defineProperty(Link, "propTypes", {
|
|
79
101
|
to: PropTypes.string,
|
|
80
102
|
disabled: PropTypes.bool,
|
|
81
103
|
children: PropTypes.node,
|
|
82
104
|
onClick: PropTypes.func
|
|
83
105
|
});
|
|
106
|
+
|
|
84
107
|
export default Link;
|
|
85
108
|
export { jump };
|
package/es/Loading/Loading.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import _Spin from "antd/es/spin";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import variables from '../variables';
|
|
4
|
+
|
|
4
5
|
function Loading(_ref) {
|
|
5
6
|
var retry = _ref.retry,
|
|
6
|
-
|
|
7
|
+
onRetry = _ref.onRetry;
|
|
7
8
|
return /*#__PURE__*/React.createElement("div", {
|
|
8
9
|
className: variables('Loading')
|
|
9
10
|
}, /*#__PURE__*/React.createElement("div", null, !retry ? /*#__PURE__*/React.createElement(_Spin, null) : /*#__PURE__*/React.createElement("span", null, "\u52A0\u8F7D\u5931\u8D25\uFF0C\u70B9\u51FB", /*#__PURE__*/React.createElement("a", {
|
|
10
11
|
onClick: onRetry
|
|
11
12
|
}, "\u91CD\u8BD5"))));
|
|
12
13
|
}
|
|
14
|
+
|
|
13
15
|
export default Loading;
|
package/es/Loading2/Loading2.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import _Spin from "antd/es/spin";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import variables from '../variables';
|
|
4
|
+
|
|
4
5
|
function Loading() {
|
|
5
6
|
return /*#__PURE__*/React.createElement("div", {
|
|
6
7
|
className: variables('Loading2')
|
|
7
8
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Spin, null)));
|
|
8
9
|
}
|
|
10
|
+
|
|
9
11
|
export default Loading;
|