cloud-b2b 1.1.50 → 1.1.52
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/package.json +44 -22
- package/src/Area/Area.js +94 -0
- package/src/Card/Card.js +16 -0
- package/src/CodeInput/CodeInput.js +76 -0
- package/src/Control/Control.js +338 -0
- package/src/Control/event.js +45 -0
- package/src/Enhance/Dialogs.js +24 -0
- package/src/Enhance/Loading.js +83 -0
- package/{es → src}/Enhance/index.js +8 -8
- package/src/Header/Header.js +149 -0
- package/src/Header/Vertical.js +74 -0
- package/src/ImageView/ImageView.js +62 -0
- package/src/Indent/Indent.js +12 -0
- package/src/InpurCascader/InputCascader.js +83 -0
- package/src/InputEditor/InputEditor.js +93 -0
- package/src/InputSearch/InputSearch.js +186 -0
- package/src/InputSelect/InputSelect.js +103 -0
- package/src/InputTreeSelect/InputTreeSelect.js +87 -0
- package/src/InputWriting/InputWriting.js +65 -0
- package/src/Layout/Layout.js +121 -0
- package/src/LayoutLink/LayoutLink.js +59 -0
- package/src/Link/Link.js +57 -0
- package/src/Loading/Loading.js +15 -0
- package/src/Loading2/Loading2.js +15 -0
- package/src/ModalWithDrag/ModalWithDrag.js +17 -0
- package/src/ModalWithDrag/drag.js +128 -0
- package/src/NumberInput/NumberInput.js +137 -0
- package/src/Search/Search.js +368 -0
- package/src/Sidebar/Sidebar.js +111 -0
- package/src/Sidebar2/Sidebar.js +143 -0
- package/src/SuperForm/SuperForm.js +516 -0
- package/src/SuperForm2/SuperForm.js +588 -0
- package/src/SuperIcon/SuperIcon.js +14 -0
- package/src/SuperPagination/SuperPagination.js +65 -0
- package/src/SuperTab/SuperTab.js +84 -0
- package/src/SuperTab2/SuperTab2.js +94 -0
- package/src/SuperTable/DragSortRow.js +62 -0
- package/src/SuperTable/FilterDropDown.js +111 -0
- package/src/SuperTable/SuperTable.js +590 -0
- package/src/SuperTable/fixed.js +34 -0
- package/src/SuperTable2/SuperTable2.js +600 -0
- package/src/SuperTable2/SuperTableCell.js +144 -0
- package/src/SuperTable3/FilterDropDown.js +111 -0
- package/src/SuperTable3/SuperTable.js +498 -0
- package/src/SuperTable3/fixed.js +34 -0
- package/src/SuperToolbar/SuperToolbar.js +128 -0
- package/src/SuperUpload/SuperUpload.js +137 -0
- package/src/Title/Title.js +18 -0
- package/src/Viewer/ImageViews.js +220 -0
- package/src/Viewer/Viewer.js +97 -0
- package/src/WingBlank/WingBlank.js +14 -0
- package/src/helper.js +185 -0
- package/src/history.js +6 -0
- package/src/index.js +38 -0
- package/src/variables.js +5 -0
- package/test/index.html +10 -0
- package/test/test.js +16 -0
- package/test/test.less +12 -0
- package/test/webpack.config.js +71 -0
- package/tools/babel.config.js +14 -0
- package/tools/build.js +70 -0
- package/tools/publish.js +9 -0
- package/tools/util.js +53 -0
- package/es/Area/Area.js +0 -170
- package/es/Card/Card.js +0 -20
- package/es/CodeInput/CodeInput.js +0 -152
- package/es/Control/Control.js +0 -496
- package/es/Control/event.js +0 -57
- package/es/Enhance/Dialogs.js +0 -67
- package/es/Enhance/Loading.js +0 -151
- package/es/Header/Header.js +0 -194
- package/es/Header/Vertical.js +0 -129
- package/es/ImageView/ImageView.js +0 -117
- package/es/Indent/Indent.js +0 -23
- package/es/InpurCascader/InputCascader.js +0 -135
- package/es/InputEditor/InputEditor.js +0 -113
- package/es/InputSearch/InputSearch.js +0 -311
- package/es/InputSelect/InputSelect.js +0 -191
- package/es/InputTreeSelect/InputTreeSelect.js +0 -147
- package/es/InputWriting/InputWriting.js +0 -107
- package/es/Layout/Layout.js +0 -232
- package/es/LayoutLink/LayoutLink.js +0 -82
- package/es/Link/Link.js +0 -108
- package/es/Loading/Loading.js +0 -15
- package/es/Loading2/Loading2.js +0 -11
- package/es/ModalWithDrag/ModalWithDrag.js +0 -34
- package/es/ModalWithDrag/drag.js +0 -133
- package/es/NumberInput/NumberInput.js +0 -240
- package/es/Search/Search.js +0 -595
- package/es/Sidebar/Sidebar.js +0 -165
- package/es/Sidebar2/Sidebar.js +0 -192
- package/es/SuperForm/SuperForm.js +0 -720
- package/es/SuperForm2/SuperForm.js +0 -828
- package/es/SuperIcon/SuperIcon.js +0 -30
- package/es/SuperPagination/SuperPagination.js +0 -126
- package/es/SuperTab/SuperTab.js +0 -130
- package/es/SuperTab2/SuperTab2.js +0 -167
- package/es/SuperTable/DragSortRow.js +0 -125
- package/es/SuperTable/FilterDropDown.js +0 -188
- package/es/SuperTable/SuperTable.js +0 -940
- package/es/SuperTable/fixed.js +0 -42
- package/es/SuperTable2/SuperTable2.js +0 -1019
- package/es/SuperTable2/SuperTableCell.js +0 -242
- package/es/SuperTable3/FilterDropDown.js +0 -188
- package/es/SuperTable3/SuperTable.js +0 -790
- package/es/SuperTable3/fixed.js +0 -42
- package/es/SuperToolbar/SuperToolbar.js +0 -223
- package/es/SuperUpload/SuperUpload.js +0 -434
- package/es/Title/Title.js +0 -36
- package/es/Viewer/ImageViews.js +0 -311
- package/es/Viewer/Viewer.js +0 -149
- package/es/WingBlank/WingBlank.js +0 -20
- package/es/helper.js +0 -169
- package/es/history.js +0 -5
- package/es/index.js +0 -37
- package/es/variables.js +0 -4
- package/lib/Area/Area.js +0 -198
- package/lib/Area/package.json +0 -6
- package/lib/Card/Card.js +0 -38
- package/lib/Card/package.json +0 -6
- package/lib/CodeInput/CodeInput.js +0 -179
- package/lib/CodeInput/package.json +0 -6
- package/lib/Control/Control.js +0 -548
- package/lib/Control/event.js +0 -68
- package/lib/Control/package.json +0 -6
- package/lib/Enhance/Dialogs.js +0 -87
- package/lib/Enhance/Loading.js +0 -175
- package/lib/Enhance/index.js +0 -35
- package/lib/Enhance/package.json +0 -6
- package/lib/Header/Header.js +0 -215
- package/lib/Header/Header.less +0 -95
- package/lib/Header/Vertical.js +0 -150
- package/lib/Header/Vertical.less +0 -60
- package/lib/Header/package.json +0 -6
- package/lib/ImageView/ImageView.js +0 -134
- package/lib/ImageView/ImageView.less +0 -14
- package/lib/ImageView/package.json +0 -6
- package/lib/Indent/Indent.js +0 -38
- package/lib/Indent/package.json +0 -6
- package/lib/InpurCascader/InputCascader.js +0 -156
- package/lib/InpurCascader/package.json +0 -6
- package/lib/InputEditor/InputEditor.js +0 -131
- package/lib/InputEditor/inputEditor.less +0 -8
- package/lib/InputEditor/package.json +0 -6
- package/lib/InputSearch/InputSearch.js +0 -327
- package/lib/InputSearch/package.json +0 -6
- package/lib/InputSelect/InputSelect.js +0 -214
- package/lib/InputSelect/package.json +0 -6
- package/lib/InputTreeSelect/InputTreeSelect.js +0 -169
- package/lib/InputTreeSelect/package.json +0 -6
- package/lib/InputWriting/InputWriting.js +0 -123
- package/lib/InputWriting/package.json +0 -6
- package/lib/Layout/Layout.js +0 -258
- package/lib/Layout/Layout.less +0 -28
- package/lib/Layout/package.json +0 -6
- package/lib/LayoutLink/LayoutLink.js +0 -114
- package/lib/LayoutLink/LayoutLink.less +0 -53
- package/lib/LayoutLink/package.json +0 -6
- package/lib/Link/Link.js +0 -130
- package/lib/Link/package.json +0 -6
- package/lib/Loading/Loading.js +0 -30
- package/lib/Loading/Loading.less +0 -13
- package/lib/Loading/package.json +0 -6
- package/lib/Loading2/Loading2.js +0 -26
- package/lib/Loading2/Loading2.less +0 -19
- package/lib/Loading2/package.json +0 -6
- package/lib/ModalWithDrag/ModalWithDrag.js +0 -53
- package/lib/ModalWithDrag/ModalWithDrag.less +0 -6
- package/lib/ModalWithDrag/drag.js +0 -147
- package/lib/ModalWithDrag/package.json +0 -6
- package/lib/NumberInput/NumberInput.js +0 -262
- package/lib/NumberInput/package.json +0 -6
- package/lib/Search/Search.js +0 -616
- package/lib/Search/Search.less +0 -63
- package/lib/Search/package.json +0 -6
- package/lib/Sidebar/Sidebar.js +0 -186
- package/lib/Sidebar/Sidebar.less +0 -78
- package/lib/Sidebar/package.json +0 -6
- package/lib/Sidebar2/Sidebar.js +0 -213
- package/lib/Sidebar2/Sidebar.less +0 -153
- package/lib/Sidebar2/package.json +0 -6
- package/lib/SuperForm/SuperForm.js +0 -731
- package/lib/SuperForm/SuperForm.less +0 -52
- package/lib/SuperForm/package.json +0 -6
- package/lib/SuperForm2/SuperForm.js +0 -834
- package/lib/SuperForm2/SuperForm.less +0 -52
- package/lib/SuperForm2/package.json +0 -6
- package/lib/SuperIcon/SuperIcon.js +0 -47
- package/lib/SuperIcon/package.json +0 -6
- package/lib/SuperPagination/SuperPagination.js +0 -145
- package/lib/SuperPagination/package.json +0 -6
- package/lib/SuperTab/SuperTab.js +0 -146
- package/lib/SuperTab/SuperTab.less +0 -43
- package/lib/SuperTab/package.json +0 -6
- package/lib/SuperTab2/SuperTab2.js +0 -191
- package/lib/SuperTab2/SuperTab2.less +0 -18
- package/lib/SuperTab2/package.json +0 -6
- package/lib/SuperTable/DragSortRow.js +0 -142
- package/lib/SuperTable/DragSortRow.less +0 -17
- package/lib/SuperTable/FilterDropDown.js +0 -205
- package/lib/SuperTable/FilterDropDown.less +0 -30
- package/lib/SuperTable/SuperTable.js +0 -945
- package/lib/SuperTable/SuperTable.less +0 -132
- package/lib/SuperTable/fixed.js +0 -55
- package/lib/SuperTable/package.json +0 -6
- package/lib/SuperTable2/SuperTable2.js +0 -1047
- package/lib/SuperTable2/SuperTable2.less +0 -118
- package/lib/SuperTable2/SuperTableCell.js +0 -258
- package/lib/SuperTable2/package.json +0 -6
- package/lib/SuperTable3/FilterDropDown.js +0 -205
- package/lib/SuperTable3/FilterDropDown.less +0 -29
- package/lib/SuperTable3/SuperTable.js +0 -795
- package/lib/SuperTable3/SuperTable.less +0 -99
- package/lib/SuperTable3/fixed.js +0 -55
- package/lib/SuperTable3/package.json +0 -6
- package/lib/SuperToolbar/SuperToolbar.js +0 -248
- package/lib/SuperToolbar/SuperToolbar.less +0 -17
- package/lib/SuperToolbar/package.json +0 -6
- package/lib/SuperUpload/SuperUpload.js +0 -481
- package/lib/SuperUpload/SuperUpload.less +0 -28
- package/lib/SuperUpload/package.json +0 -6
- package/lib/Title/Title.js +0 -54
- package/lib/Title/Title.less +0 -35
- package/lib/Title/package.json +0 -6
- package/lib/Viewer/ImageViews.js +0 -323
- package/lib/Viewer/Viewer.js +0 -167
- package/lib/Viewer/Viewer.less +0 -67
- package/lib/Viewer/imgView.less +0 -59
- package/lib/Viewer/package.json +0 -7
- package/lib/WingBlank/WingBlank.js +0 -37
- package/lib/WingBlank/WingBlank.less +0 -12
- package/lib/WingBlank/package.json +0 -6
- package/lib/adjust.less +0 -89
- package/lib/helper.js +0 -204
- package/lib/history.js +0 -18
- package/lib/index.js +0 -347
- package/lib/index.less +0 -31
- package/lib/style.less +0 -30
- package/lib/variables.js +0 -16
- package/lib/variables.less +0 -73
- /package/{es → src}/Area/package.json +0 -0
- /package/{es → src}/Card/package.json +0 -0
- /package/{es → src}/CodeInput/package.json +0 -0
- /package/{es → src}/Control/package.json +0 -0
- /package/{es → src}/Enhance/package.json +0 -0
- /package/{es → src}/Header/Header.less +0 -0
- /package/{es → src}/Header/Vertical.less +0 -0
- /package/{es → src}/Header/package.json +0 -0
- /package/{es → src}/ImageView/ImageView.less +0 -0
- /package/{es → src}/ImageView/package.json +0 -0
- /package/{es → src}/Indent/package.json +0 -0
- /package/{es → src}/InpurCascader/package.json +0 -0
- /package/{es → src}/InputEditor/inputEditor.less +0 -0
- /package/{es → src}/InputEditor/package.json +0 -0
- /package/{es → src}/InputSearch/package.json +0 -0
- /package/{es → src}/InputSelect/package.json +0 -0
- /package/{es → src}/InputTreeSelect/package.json +0 -0
- /package/{es → src}/InputWriting/package.json +0 -0
- /package/{es → src}/Layout/Layout.less +0 -0
- /package/{es → src}/Layout/package.json +0 -0
- /package/{es → src}/LayoutLink/LayoutLink.less +0 -0
- /package/{es → src}/LayoutLink/package.json +0 -0
- /package/{es → src}/Link/package.json +0 -0
- /package/{es → src}/Loading/Loading.less +0 -0
- /package/{es → src}/Loading/package.json +0 -0
- /package/{es → src}/Loading2/Loading2.less +0 -0
- /package/{es → src}/Loading2/package.json +0 -0
- /package/{es → src}/ModalWithDrag/ModalWithDrag.less +0 -0
- /package/{es → src}/ModalWithDrag/package.json +0 -0
- /package/{es → src}/NumberInput/package.json +0 -0
- /package/{es → src}/Search/Search.less +0 -0
- /package/{es → src}/Search/package.json +0 -0
- /package/{es → src}/Sidebar/Sidebar.less +0 -0
- /package/{es → src}/Sidebar/package.json +0 -0
- /package/{es → src}/Sidebar2/Sidebar.less +0 -0
- /package/{es → src}/Sidebar2/package.json +0 -0
- /package/{es → src}/SuperForm/SuperForm.less +0 -0
- /package/{es → src}/SuperForm/package.json +0 -0
- /package/{es → src}/SuperForm2/SuperForm.less +0 -0
- /package/{es → src}/SuperForm2/package.json +0 -0
- /package/{es → src}/SuperIcon/package.json +0 -0
- /package/{es → src}/SuperPagination/package.json +0 -0
- /package/{es → src}/SuperTab/SuperTab.less +0 -0
- /package/{es → src}/SuperTab/package.json +0 -0
- /package/{es → src}/SuperTab2/SuperTab2.less +0 -0
- /package/{es → src}/SuperTab2/package.json +0 -0
- /package/{es → src}/SuperTable/DragSortRow.less +0 -0
- /package/{es → src}/SuperTable/FilterDropDown.less +0 -0
- /package/{es → src}/SuperTable/SuperTable.less +0 -0
- /package/{es → src}/SuperTable/package.json +0 -0
- /package/{es → src}/SuperTable2/SuperTable2.less +0 -0
- /package/{es → src}/SuperTable2/package.json +0 -0
- /package/{es → src}/SuperTable3/FilterDropDown.less +0 -0
- /package/{es → src}/SuperTable3/SuperTable.less +0 -0
- /package/{es → src}/SuperTable3/package.json +0 -0
- /package/{es → src}/SuperToolbar/SuperToolbar.less +0 -0
- /package/{es → src}/SuperToolbar/package.json +0 -0
- /package/{es → src}/SuperUpload/SuperUpload.less +0 -0
- /package/{es → src}/SuperUpload/package.json +0 -0
- /package/{es → src}/Title/Title.less +0 -0
- /package/{es → src}/Title/package.json +0 -0
- /package/{es → src}/Viewer/Viewer.less +0 -0
- /package/{es → src}/Viewer/imgView.less +0 -0
- /package/{es → src}/Viewer/package.json +0 -0
- /package/{es → src}/WingBlank/WingBlank.less +0 -0
- /package/{es → src}/WingBlank/package.json +0 -0
- /package/{es → src}/adjust.less +0 -0
- /package/{es → src}/style.less +0 -0
- /package/{es → src}/variables.less +0 -0
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import _Empty from "antd/es/empty";
|
|
2
|
-
import _Button from "antd/es/button";
|
|
3
|
-
import _Input from "antd/es/input";
|
|
4
|
-
import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
|
|
5
|
-
import _Form from "antd/es/form";
|
|
6
|
-
import React, { useState } from 'react';
|
|
7
|
-
import WingBlank from '../WingBlank';
|
|
8
|
-
import Card from '../Card';
|
|
9
|
-
import variables from '../variables';
|
|
10
|
-
var FormItem = _Form.Item;
|
|
11
|
-
|
|
12
|
-
function Search(_ref) {
|
|
13
|
-
var placeholder = _ref.placeholder,
|
|
14
|
-
onSearch = _ref.onSearch;
|
|
15
|
-
|
|
16
|
-
var _useState = useState(''),
|
|
17
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
18
|
-
value = _useState2[0],
|
|
19
|
-
setValue = _useState2[1];
|
|
20
|
-
|
|
21
|
-
var _useState3 = useState(''),
|
|
22
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
23
|
-
status = _useState4[0],
|
|
24
|
-
setStatus = _useState4[1];
|
|
25
|
-
|
|
26
|
-
var onClick = function onClick() {
|
|
27
|
-
if (!value) {
|
|
28
|
-
setStatus('error');
|
|
29
|
-
} else {
|
|
30
|
-
onSearch(value);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
var onChange = function onChange(e) {
|
|
35
|
-
setStatus('');
|
|
36
|
-
setValue(e.target.value);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return /*#__PURE__*/React.createElement(Card, {
|
|
40
|
-
className: variables('LayoutLink').search
|
|
41
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FormItem, {
|
|
42
|
-
validateStatus: status
|
|
43
|
-
}, /*#__PURE__*/React.createElement(_Input, {
|
|
44
|
-
placeholder: placeholder,
|
|
45
|
-
value: value,
|
|
46
|
-
onChange: onChange
|
|
47
|
-
})), /*#__PURE__*/React.createElement(_Button, {
|
|
48
|
-
onClick: onClick
|
|
49
|
-
}, "\u5F00\u59CB\u67E5\u8BE2")));
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function Title(_ref2) {
|
|
53
|
-
var title = _ref2.title;
|
|
54
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
55
|
-
className: variables('LayoutLink').title
|
|
56
|
-
}, /*#__PURE__*/React.createElement("div", null, title), /*#__PURE__*/React.createElement("div", null));
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function LayoutLink(_ref3) {
|
|
60
|
-
var children = _ref3.children,
|
|
61
|
-
img = _ref3.img,
|
|
62
|
-
title = _ref3.title,
|
|
63
|
-
placeholder = _ref3.placeholder,
|
|
64
|
-
onSearch = _ref3.onSearch;
|
|
65
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
66
|
-
className: variables('LayoutLink')
|
|
67
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", {
|
|
68
|
-
src: img,
|
|
69
|
-
alt: "banner"
|
|
70
|
-
})), /*#__PURE__*/React.createElement(WingBlank, null, /*#__PURE__*/React.createElement(Search, {
|
|
71
|
-
placeholder: placeholder,
|
|
72
|
-
onSearch: onSearch
|
|
73
|
-
}), /*#__PURE__*/React.createElement(Title, {
|
|
74
|
-
title: title
|
|
75
|
-
}), /*#__PURE__*/React.createElement(Card, null, children ? children : /*#__PURE__*/React.createElement(_Empty, {
|
|
76
|
-
style: {
|
|
77
|
-
padding: '30px'
|
|
78
|
-
}
|
|
79
|
-
}))));
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export default LayoutLink;
|
package/es/Link/Link.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
|
|
2
|
-
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWithoutProperties";
|
|
4
|
-
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
5
|
-
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
6
|
-
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
|
7
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
8
|
-
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
9
|
-
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
10
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
11
|
-
var _excluded = ["to", "children", "disabled"];
|
|
12
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
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
|
-
|
|
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
|
-
|
|
18
|
-
import React from 'react';
|
|
19
|
-
import PropTypes from 'prop-types';
|
|
20
|
-
import history from '../history';
|
|
21
|
-
|
|
22
|
-
function isLeftClickEvent(event) {
|
|
23
|
-
return event.button === 0;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function isModifiedEvent(event) {
|
|
27
|
-
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function jump(url) {
|
|
31
|
-
if (history.location.pathname != url) {
|
|
32
|
-
history.push(url);
|
|
33
|
-
} else {
|
|
34
|
-
history.replace(url);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
var Link = /*#__PURE__*/function (_React$Component) {
|
|
39
|
-
_inherits(Link, _React$Component);
|
|
40
|
-
|
|
41
|
-
var _super = _createSuper(Link);
|
|
42
|
-
|
|
43
|
-
function Link() {
|
|
44
|
-
var _context;
|
|
45
|
-
|
|
46
|
-
var _this;
|
|
47
|
-
|
|
48
|
-
_classCallCheck(this, Link);
|
|
49
|
-
|
|
50
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
51
|
-
args[_key] = arguments[_key];
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
_this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
|
|
55
|
-
|
|
56
|
-
_defineProperty(_assertThisInitialized(_this), "handleClick", function (event) {
|
|
57
|
-
if (_this.props.onClick) {
|
|
58
|
-
_this.props.onClick(event);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (isModifiedEvent(event) || !isLeftClickEvent(event)) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (event.defaultPrevented === true) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
event.preventDefault();
|
|
70
|
-
jump(_this.props.to);
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
return _this;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
_createClass(Link, [{
|
|
77
|
-
key: "render",
|
|
78
|
-
value: function render() {
|
|
79
|
-
var _this$props = this.props,
|
|
80
|
-
to = _this$props.to,
|
|
81
|
-
children = _this$props.children,
|
|
82
|
-
disabled = _this$props.disabled,
|
|
83
|
-
props = _objectWithoutProperties(_this$props, _excluded);
|
|
84
|
-
|
|
85
|
-
if (disabled) {
|
|
86
|
-
return /*#__PURE__*/React.createElement("a", props, children);
|
|
87
|
-
} else {
|
|
88
|
-
return /*#__PURE__*/React.createElement("a", _extends({
|
|
89
|
-
href: to
|
|
90
|
-
}, props, {
|
|
91
|
-
onClick: this.handleClick
|
|
92
|
-
}), children);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}]);
|
|
96
|
-
|
|
97
|
-
return Link;
|
|
98
|
-
}(React.Component);
|
|
99
|
-
|
|
100
|
-
_defineProperty(Link, "propTypes", {
|
|
101
|
-
to: PropTypes.string,
|
|
102
|
-
disabled: PropTypes.bool,
|
|
103
|
-
children: PropTypes.node,
|
|
104
|
-
onClick: PropTypes.func
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
export default Link;
|
|
108
|
-
export { jump };
|
package/es/Loading/Loading.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import _Spin from "antd/es/spin";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import variables from '../variables';
|
|
4
|
-
|
|
5
|
-
function Loading(_ref) {
|
|
6
|
-
var retry = _ref.retry,
|
|
7
|
-
onRetry = _ref.onRetry;
|
|
8
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
9
|
-
className: variables('Loading')
|
|
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", {
|
|
11
|
-
onClick: onRetry
|
|
12
|
-
}, "\u91CD\u8BD5"))));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default Loading;
|
package/es/Loading2/Loading2.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import _Spin from "antd/es/spin";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import variables from '../variables';
|
|
4
|
-
|
|
5
|
-
function Loading() {
|
|
6
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
-
className: variables('Loading2')
|
|
8
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Spin, null)));
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export default Loading;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import _Modal from "antd/es/modal";
|
|
2
|
-
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["className", "children", "title"];
|
|
5
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import drag from './drag';
|
|
8
|
-
import variables from '../variables';
|
|
9
|
-
|
|
10
|
-
var onLoad = function onLoad(e) {
|
|
11
|
-
var dragElement = e.parentNode.parentNode;
|
|
12
|
-
var targetElement = dragElement.parentNode.parentNode;
|
|
13
|
-
drag(dragElement, targetElement);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
var ModalWithDrag = function ModalWithDrag(_ref) {
|
|
17
|
-
var _context;
|
|
18
|
-
|
|
19
|
-
var className = _ref.className,
|
|
20
|
-
children = _ref.children,
|
|
21
|
-
title = _ref.title,
|
|
22
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
-
|
|
24
|
-
props.title = /*#__PURE__*/React.createElement("div", {
|
|
25
|
-
ref: function ref(e) {
|
|
26
|
-
return e && onLoad(e);
|
|
27
|
-
}
|
|
28
|
-
}, title);
|
|
29
|
-
return /*#__PURE__*/React.createElement(_Modal, _extends({
|
|
30
|
-
className: _concatInstanceProperty(_context = "".concat(className, " ")).call(_context, variables('ModalWithDrag'))
|
|
31
|
-
}, props), children);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export default ModalWithDrag;
|
package/es/ModalWithDrag/drag.js
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
2
|
-
import _parseInt from "@babel/runtime-corejs3/core-js-stable/parse-int";
|
|
3
|
-
|
|
4
|
-
// 依据CSS3的transform属性进行移动
|
|
5
|
-
var dragByTransform = function dragByTransform(dragElement, targetElement) {
|
|
6
|
-
var mouseMove = null;
|
|
7
|
-
var mouseUp = null;
|
|
8
|
-
var active = false;
|
|
9
|
-
var offsetX = 0;
|
|
10
|
-
var offsetY = 0;
|
|
11
|
-
var x = 0;
|
|
12
|
-
var y = 0;
|
|
13
|
-
dragElement.style.cursor = 'move';
|
|
14
|
-
|
|
15
|
-
dragElement.onmousedown = function (e) {
|
|
16
|
-
mouseMove = document.onmousemove;
|
|
17
|
-
mouseUp = document.onmouseup;
|
|
18
|
-
x = e.clientX;
|
|
19
|
-
y = e.clientY;
|
|
20
|
-
active = true; // 如果下拉框拥有焦点,通过使其失去焦点来关闭掉下拉框
|
|
21
|
-
|
|
22
|
-
if (document.activeElement && document.activeElement !== dragElement) {
|
|
23
|
-
document.activeElement.blur();
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
document.onmousemove = function (e) {
|
|
27
|
-
if (active) {
|
|
28
|
-
var _context;
|
|
29
|
-
|
|
30
|
-
var x2 = offsetX + e.clientX - x;
|
|
31
|
-
var y2 = offsetY + e.clientY - y;
|
|
32
|
-
targetElement.style.transform = _concatInstanceProperty(_context = "translate(".concat(x2, "px, ")).call(_context, y2, "px)");
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
mouseMove && mouseMove(e);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
document.onmouseup = function (e) {
|
|
39
|
-
if (active) {
|
|
40
|
-
document.onmousemove = mouseMove;
|
|
41
|
-
document.onmouseup = mouseUp;
|
|
42
|
-
offsetX += e.clientX - x;
|
|
43
|
-
offsetY += e.clientY - y;
|
|
44
|
-
active = false;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
mouseUp && mouseUp(e);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
return false;
|
|
51
|
-
};
|
|
52
|
-
}; // 获取相关CSS属性
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
var getCss = function getCss(o, key) {
|
|
56
|
-
return o.currentStyle ? o.currentStyle[key] : document.defaultView.getComputedStyle(o)[key];
|
|
57
|
-
}; // 依据position属性进行移动
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
var dragByPosition = function dragByPosition(dragElement, targetElement) {
|
|
61
|
-
var mouseMove = null;
|
|
62
|
-
var mouseUp = null;
|
|
63
|
-
var active = false;
|
|
64
|
-
var left = 0;
|
|
65
|
-
var top = 0;
|
|
66
|
-
var x = 0;
|
|
67
|
-
var y = 0;
|
|
68
|
-
dragElement.style.cursor = 'move';
|
|
69
|
-
|
|
70
|
-
dragElement.onmousedown = function (e) {
|
|
71
|
-
mouseMove = document.onmousemove;
|
|
72
|
-
mouseUp = document.onmouseup;
|
|
73
|
-
x = e.clientX;
|
|
74
|
-
y = e.clientY;
|
|
75
|
-
active = true;
|
|
76
|
-
|
|
77
|
-
if (getCss(targetElement, 'left') !== 'auto') {
|
|
78
|
-
left = _parseInt(getCss(targetElement, "left"));
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (getCss(targetElement, 'top') !== 'auto') {
|
|
82
|
-
top = _parseInt(getCss(targetElement, 'top'));
|
|
83
|
-
} // 如果下拉框拥有焦点,通过使其失去焦点来关闭掉下拉框
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (document.activeElement && document.activeElement !== dragElement) {
|
|
87
|
-
document.activeElement.blur();
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
document.onmousemove = function (e) {
|
|
91
|
-
if (active) {
|
|
92
|
-
var top2 = top + e.clientY - y;
|
|
93
|
-
targetElement.style.left = "".concat(left + e.clientX - x, "px");
|
|
94
|
-
targetElement.style.top = "".concat(top2 > 0 ? top2 : 0, "px");
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
mouseMove && mouseMove(e);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
document.onmouseup = function (e) {
|
|
101
|
-
if (active) {
|
|
102
|
-
document.onmousemove = mouseMove;
|
|
103
|
-
document.onmouseup = mouseUp;
|
|
104
|
-
active = false;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
mouseUp && mouseUp(e);
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
return false;
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
var drag = function drag(dragElement, targetElement) {
|
|
115
|
-
if (!dragElement || !targetElement) {
|
|
116
|
-
console.error('请传入有效的HTML元素对象');
|
|
117
|
-
return;
|
|
118
|
-
} // 已经绑定过,不需要再次绑定
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if (dragElement.onmousedown) {
|
|
122
|
-
return;
|
|
123
|
-
} // 如果目标元素是非定位元素采用transform属性进行移动
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
if (getCss(targetElement, 'position') === 'static') {
|
|
127
|
-
dragByTransform(dragElement, targetElement);
|
|
128
|
-
} else {
|
|
129
|
-
dragByPosition(dragElement, targetElement);
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
export default drag;
|
|
@@ -1,240 +0,0 @@
|
|
|
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 _Input from "antd/es/input";
|
|
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 _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys(Object(source))).call(_context4, 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 _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
27
|
-
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
28
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
29
|
-
import React from 'react';
|
|
30
|
-
import PropTypes from 'prop-types';
|
|
31
|
-
import { getObjectExclude } from '../helper';
|
|
32
|
-
|
|
33
|
-
var parseNumber = function parseNumber(value, _ref) {
|
|
34
|
-
var _context;
|
|
35
|
-
|
|
36
|
-
var real = _ref.real,
|
|
37
|
-
sign = _ref.sign,
|
|
38
|
-
zero = _ref.zero,
|
|
39
|
-
precision = _ref.precision,
|
|
40
|
-
fixed = _ref.fixed,
|
|
41
|
-
big = _ref.big;
|
|
42
|
-
var invalid = {
|
|
43
|
-
invalid: true,
|
|
44
|
-
value: ''
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
if (value === '') {
|
|
48
|
-
return {
|
|
49
|
-
value: value
|
|
50
|
-
};
|
|
51
|
-
} // 非数字
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
value = big ? value : Number(value);
|
|
55
|
-
|
|
56
|
-
if (isNaN(value)) {
|
|
57
|
-
return invalid;
|
|
58
|
-
} // 不能为实数,却包含小数点
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (!real && _includesInstanceProperty(_context = String(value)).call(_context, '.')) {
|
|
62
|
-
return invalid;
|
|
63
|
-
} // 不能为负数,却小于0
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if (!sign && value < 0) {
|
|
67
|
-
return invalid;
|
|
68
|
-
} // 不能为0,却为0
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (!zero && value === 0) {
|
|
72
|
-
return invalid;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (real) {
|
|
76
|
-
precision = Number(precision);
|
|
77
|
-
|
|
78
|
-
if (precision) {
|
|
79
|
-
value = value.toFixed(precision);
|
|
80
|
-
value = value.toString(); // 将数值转换为字符串
|
|
81
|
-
|
|
82
|
-
value = value.replace(/(\.\d*?[1-9])0+$|\.0*$/, "$1"); // 去除小数点后无意义的零
|
|
83
|
-
|
|
84
|
-
if (!fixed) {
|
|
85
|
-
value = Number(value);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return {
|
|
91
|
-
value: value
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
/**
|
|
95
|
-
* real: true表示带小数点,默认为false
|
|
96
|
-
* sign: true表示带正负号,默认为false
|
|
97
|
-
* precision: real为true时,小数的精度;否则无效
|
|
98
|
-
* zero:true表示可以输入0,默认为false
|
|
99
|
-
* fixed: real为true时生效; true表示固定显示指定精度的小数,精度由precision确定,默认值为false
|
|
100
|
-
* big: big为ture时生效; true标识为大数值,与上面所有属性互斥
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
var PROPS = {
|
|
105
|
-
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
106
|
-
real: PropTypes.bool,
|
|
107
|
-
sign: PropTypes.bool,
|
|
108
|
-
precision: PropTypes.any,
|
|
109
|
-
zero: PropTypes.bool,
|
|
110
|
-
fixed: PropTypes.bool,
|
|
111
|
-
big: PropTypes.bool,
|
|
112
|
-
inputRef: PropTypes.func,
|
|
113
|
-
onChange: PropTypes.func,
|
|
114
|
-
onBlur: PropTypes.func
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
var PROPS_KEYS = _Object$keys(PROPS);
|
|
118
|
-
|
|
119
|
-
var NumberInput = /*#__PURE__*/function (_React$Component) {
|
|
120
|
-
_inherits(NumberInput, _React$Component);
|
|
121
|
-
|
|
122
|
-
var _super = _createSuper(NumberInput);
|
|
123
|
-
|
|
124
|
-
function NumberInput() {
|
|
125
|
-
var _context2;
|
|
126
|
-
|
|
127
|
-
var _this;
|
|
128
|
-
|
|
129
|
-
_classCallCheck(this, NumberInput);
|
|
130
|
-
|
|
131
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
132
|
-
args[_key] = arguments[_key];
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
_this = _super.call.apply(_super, _concatInstanceProperty(_context2 = [this]).call(_context2, args));
|
|
136
|
-
|
|
137
|
-
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
138
|
-
typo: false,
|
|
139
|
-
value: ''
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
_defineProperty(_assertThisInitialized(_this), "onChange", function (event) {
|
|
143
|
-
var value = event.target.value;
|
|
144
|
-
|
|
145
|
-
if (!_this.hasSpecialChar(value)) {
|
|
146
|
-
_this.setState({
|
|
147
|
-
value: value,
|
|
148
|
-
typo: true
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
_defineProperty(_assertThisInitialized(_this), "onBlur", function (event) {
|
|
154
|
-
var _this$props = _this.props,
|
|
155
|
-
onBlur = _this$props.onBlur,
|
|
156
|
-
onChange = _this$props.onChange,
|
|
157
|
-
fixed = _this$props.fixed;
|
|
158
|
-
|
|
159
|
-
if (_this.state.typo) {
|
|
160
|
-
var _this$format = _this.format(_this.state.value, fixed),
|
|
161
|
-
invalid = _this$format.invalid,
|
|
162
|
-
value = _this$format.value;
|
|
163
|
-
|
|
164
|
-
_this.setState({
|
|
165
|
-
typo: false,
|
|
166
|
-
value: ''
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
if (!invalid) {
|
|
170
|
-
onChange && onChange(value);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
onBlur && onBlur(event); //有输入才触发外部失去焦点事件,避免非必要请求
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
_defineProperty(_assertThisInitialized(_this), "hasSpecialChar", function (value) {
|
|
178
|
-
if (_includesInstanceProperty(value).call(value, '+')) {
|
|
179
|
-
return true;
|
|
180
|
-
} else if (!_this.props.sign && _includesInstanceProperty(value).call(value, '-')) {
|
|
181
|
-
return true;
|
|
182
|
-
} else {
|
|
183
|
-
return !_this.props.real && _includesInstanceProperty(value).call(value, '.');
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
_defineProperty(_assertThisInitialized(_this), "format", function (value, fixed) {
|
|
188
|
-
var _this$props2 = _this.props,
|
|
189
|
-
real = _this$props2.real,
|
|
190
|
-
sign = _this$props2.sign,
|
|
191
|
-
zero = _this$props2.zero,
|
|
192
|
-
precision = _this$props2.precision,
|
|
193
|
-
big = _this$props2.big;
|
|
194
|
-
return parseNumber(value, {
|
|
195
|
-
real: real,
|
|
196
|
-
sign: sign,
|
|
197
|
-
zero: zero,
|
|
198
|
-
precision: precision,
|
|
199
|
-
fixed: fixed,
|
|
200
|
-
big: big
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
|
|
204
|
-
_defineProperty(_assertThisInitialized(_this), "getShowValue", function () {
|
|
205
|
-
if (_this.state.typo) {
|
|
206
|
-
// 处于输入状态从state中取值
|
|
207
|
-
return _this.state.value;
|
|
208
|
-
} else {
|
|
209
|
-
// 处于非输入状态从props中取值
|
|
210
|
-
return _this.format(_this.props.defaultValue, _this.props.fixed).value;
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
_defineProperty(_assertThisInitialized(_this), "getProps", function () {
|
|
215
|
-
var props = getObjectExclude(_this.props, PROPS_KEYS);
|
|
216
|
-
return _objectSpread(_objectSpread({}, props), {}, {
|
|
217
|
-
type: 'text',
|
|
218
|
-
ref: _this.props.inputRef || null,
|
|
219
|
-
value: _this.getShowValue(),
|
|
220
|
-
onChange: _this.onChange,
|
|
221
|
-
onBlur: _this.onBlur
|
|
222
|
-
});
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
return _this;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
_createClass(NumberInput, [{
|
|
229
|
-
key: "render",
|
|
230
|
-
value: function render() {
|
|
231
|
-
return /*#__PURE__*/React.createElement(_Input, this.getProps());
|
|
232
|
-
}
|
|
233
|
-
}]);
|
|
234
|
-
|
|
235
|
-
return NumberInput;
|
|
236
|
-
}(React.Component);
|
|
237
|
-
|
|
238
|
-
_defineProperty(NumberInput, "propTypes", PROPS);
|
|
239
|
-
|
|
240
|
-
export default NumberInput;
|