cloud-b2b 1.1.50 → 1.1.51
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
package/lib/Loading2/Loading2.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
exports["default"] = void 0;
|
|
12
|
-
|
|
13
|
-
var _spin = _interopRequireDefault(require("antd/lib/spin"));
|
|
14
|
-
|
|
15
|
-
var _react = _interopRequireDefault(require("react"));
|
|
16
|
-
|
|
17
|
-
var _variables = _interopRequireDefault(require("../variables"));
|
|
18
|
-
|
|
19
|
-
function Loading() {
|
|
20
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
21
|
-
className: (0, _variables["default"])('Loading2')
|
|
22
|
-
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_spin["default"], null)));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
var _default = Loading;
|
|
26
|
-
exports["default"] = _default;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
@import '../variables.less';
|
|
2
|
-
|
|
3
|
-
.@{cloudlink-prefix}-Loading2 {
|
|
4
|
-
position: fixed;
|
|
5
|
-
left: 0;
|
|
6
|
-
right: 0;
|
|
7
|
-
top: 0;
|
|
8
|
-
bottom: 0;
|
|
9
|
-
z-index: 1001;
|
|
10
|
-
text-align: center;
|
|
11
|
-
|
|
12
|
-
> div {
|
|
13
|
-
display: inline-block;
|
|
14
|
-
width: 200px;
|
|
15
|
-
line-height: 100px;
|
|
16
|
-
border-radius: @border-radius-base;
|
|
17
|
-
margin-top: ~'calc(50vh - 50px)';
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
exports["default"] = void 0;
|
|
12
|
-
|
|
13
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
14
|
-
|
|
15
|
-
var _modal = _interopRequireDefault(require("antd/lib/modal"));
|
|
16
|
-
|
|
17
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
18
|
-
|
|
19
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
|
20
|
-
|
|
21
|
-
var _react = _interopRequireDefault(require("react"));
|
|
22
|
-
|
|
23
|
-
var _drag = _interopRequireDefault(require("./drag"));
|
|
24
|
-
|
|
25
|
-
var _variables = _interopRequireDefault(require("../variables"));
|
|
26
|
-
|
|
27
|
-
var _excluded = ["className", "children", "title"];
|
|
28
|
-
|
|
29
|
-
var onLoad = function onLoad(e) {
|
|
30
|
-
var dragElement = e.parentNode.parentNode;
|
|
31
|
-
var targetElement = dragElement.parentNode.parentNode;
|
|
32
|
-
(0, _drag["default"])(dragElement, targetElement);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
var ModalWithDrag = function ModalWithDrag(_ref) {
|
|
36
|
-
var _context;
|
|
37
|
-
|
|
38
|
-
var className = _ref.className,
|
|
39
|
-
children = _ref.children,
|
|
40
|
-
title = _ref.title,
|
|
41
|
-
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
42
|
-
props.title = /*#__PURE__*/_react["default"].createElement("div", {
|
|
43
|
-
ref: function ref(e) {
|
|
44
|
-
return e && onLoad(e);
|
|
45
|
-
}
|
|
46
|
-
}, title);
|
|
47
|
-
return /*#__PURE__*/_react["default"].createElement(_modal["default"], (0, _extends2["default"])({
|
|
48
|
-
className: (0, _concat["default"])(_context = "".concat(className, " ")).call(_context, (0, _variables["default"])('ModalWithDrag'))
|
|
49
|
-
}, props), children);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
var _default = ModalWithDrag;
|
|
53
|
-
exports["default"] = _default;
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
exports["default"] = void 0;
|
|
12
|
-
|
|
13
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
14
|
-
|
|
15
|
-
var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/parse-int"));
|
|
16
|
-
|
|
17
|
-
// 依据CSS3的transform属性进行移动
|
|
18
|
-
var dragByTransform = function dragByTransform(dragElement, targetElement) {
|
|
19
|
-
var mouseMove = null;
|
|
20
|
-
var mouseUp = null;
|
|
21
|
-
var active = false;
|
|
22
|
-
var offsetX = 0;
|
|
23
|
-
var offsetY = 0;
|
|
24
|
-
var x = 0;
|
|
25
|
-
var y = 0;
|
|
26
|
-
dragElement.style.cursor = 'move';
|
|
27
|
-
|
|
28
|
-
dragElement.onmousedown = function (e) {
|
|
29
|
-
mouseMove = document.onmousemove;
|
|
30
|
-
mouseUp = document.onmouseup;
|
|
31
|
-
x = e.clientX;
|
|
32
|
-
y = e.clientY;
|
|
33
|
-
active = true; // 如果下拉框拥有焦点,通过使其失去焦点来关闭掉下拉框
|
|
34
|
-
|
|
35
|
-
if (document.activeElement && document.activeElement !== dragElement) {
|
|
36
|
-
document.activeElement.blur();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
document.onmousemove = function (e) {
|
|
40
|
-
if (active) {
|
|
41
|
-
var _context;
|
|
42
|
-
|
|
43
|
-
var x2 = offsetX + e.clientX - x;
|
|
44
|
-
var y2 = offsetY + e.clientY - y;
|
|
45
|
-
targetElement.style.transform = (0, _concat["default"])(_context = "translate(".concat(x2, "px, ")).call(_context, y2, "px)");
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
mouseMove && mouseMove(e);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
document.onmouseup = function (e) {
|
|
52
|
-
if (active) {
|
|
53
|
-
document.onmousemove = mouseMove;
|
|
54
|
-
document.onmouseup = mouseUp;
|
|
55
|
-
offsetX += e.clientX - x;
|
|
56
|
-
offsetY += e.clientY - y;
|
|
57
|
-
active = false;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
mouseUp && mouseUp(e);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
return false;
|
|
64
|
-
};
|
|
65
|
-
}; // 获取相关CSS属性
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
var getCss = function getCss(o, key) {
|
|
69
|
-
return o.currentStyle ? o.currentStyle[key] : document.defaultView.getComputedStyle(o)[key];
|
|
70
|
-
}; // 依据position属性进行移动
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
var dragByPosition = function dragByPosition(dragElement, targetElement) {
|
|
74
|
-
var mouseMove = null;
|
|
75
|
-
var mouseUp = null;
|
|
76
|
-
var active = false;
|
|
77
|
-
var left = 0;
|
|
78
|
-
var top = 0;
|
|
79
|
-
var x = 0;
|
|
80
|
-
var y = 0;
|
|
81
|
-
dragElement.style.cursor = 'move';
|
|
82
|
-
|
|
83
|
-
dragElement.onmousedown = function (e) {
|
|
84
|
-
mouseMove = document.onmousemove;
|
|
85
|
-
mouseUp = document.onmouseup;
|
|
86
|
-
x = e.clientX;
|
|
87
|
-
y = e.clientY;
|
|
88
|
-
active = true;
|
|
89
|
-
|
|
90
|
-
if (getCss(targetElement, 'left') !== 'auto') {
|
|
91
|
-
left = (0, _parseInt2["default"])(getCss(targetElement, "left"));
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (getCss(targetElement, 'top') !== 'auto') {
|
|
95
|
-
top = (0, _parseInt2["default"])(getCss(targetElement, 'top'));
|
|
96
|
-
} // 如果下拉框拥有焦点,通过使其失去焦点来关闭掉下拉框
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if (document.activeElement && document.activeElement !== dragElement) {
|
|
100
|
-
document.activeElement.blur();
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
document.onmousemove = function (e) {
|
|
104
|
-
if (active) {
|
|
105
|
-
var top2 = top + e.clientY - y;
|
|
106
|
-
targetElement.style.left = "".concat(left + e.clientX - x, "px");
|
|
107
|
-
targetElement.style.top = "".concat(top2 > 0 ? top2 : 0, "px");
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
mouseMove && mouseMove(e);
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
document.onmouseup = function (e) {
|
|
114
|
-
if (active) {
|
|
115
|
-
document.onmousemove = mouseMove;
|
|
116
|
-
document.onmouseup = mouseUp;
|
|
117
|
-
active = false;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
mouseUp && mouseUp(e);
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
return false;
|
|
124
|
-
};
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
var drag = function drag(dragElement, targetElement) {
|
|
128
|
-
if (!dragElement || !targetElement) {
|
|
129
|
-
console.error('请传入有效的HTML元素对象');
|
|
130
|
-
return;
|
|
131
|
-
} // 已经绑定过,不需要再次绑定
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
if (dragElement.onmousedown) {
|
|
135
|
-
return;
|
|
136
|
-
} // 如果目标元素是非定位元素采用transform属性进行移动
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
if (getCss(targetElement, 'position') === 'static') {
|
|
140
|
-
dragByTransform(dragElement, targetElement);
|
|
141
|
-
} else {
|
|
142
|
-
dragByPosition(dragElement, targetElement);
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
var _default = drag;
|
|
147
|
-
exports["default"] = _default;
|
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
|
|
4
|
-
|
|
5
|
-
var _Object$keys2 = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
6
|
-
|
|
7
|
-
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
|
8
|
-
|
|
9
|
-
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
10
|
-
|
|
11
|
-
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
12
|
-
|
|
13
|
-
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
14
|
-
|
|
15
|
-
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
|
16
|
-
|
|
17
|
-
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
|
18
|
-
|
|
19
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
20
|
-
|
|
21
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
22
|
-
|
|
23
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
24
|
-
value: true
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
exports["default"] = void 0;
|
|
28
|
-
|
|
29
|
-
var _input = _interopRequireDefault(require("antd/lib/input"));
|
|
30
|
-
|
|
31
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
32
|
-
|
|
33
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
34
|
-
|
|
35
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
36
|
-
|
|
37
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
38
|
-
|
|
39
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
40
|
-
|
|
41
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
42
|
-
|
|
43
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
44
|
-
|
|
45
|
-
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
46
|
-
|
|
47
|
-
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
48
|
-
|
|
49
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
50
|
-
|
|
51
|
-
var _react = _interopRequireDefault(require("react"));
|
|
52
|
-
|
|
53
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
54
|
-
|
|
55
|
-
var _helper = require("../helper");
|
|
56
|
-
|
|
57
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys2(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
58
|
-
|
|
59
|
-
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) { (0, _defineProperty2["default"])(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; }
|
|
60
|
-
|
|
61
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
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
|
-
|
|
65
|
-
var parseNumber = function parseNumber(value, _ref) {
|
|
66
|
-
var _context;
|
|
67
|
-
|
|
68
|
-
var real = _ref.real,
|
|
69
|
-
sign = _ref.sign,
|
|
70
|
-
zero = _ref.zero,
|
|
71
|
-
precision = _ref.precision,
|
|
72
|
-
fixed = _ref.fixed,
|
|
73
|
-
big = _ref.big;
|
|
74
|
-
var invalid = {
|
|
75
|
-
invalid: true,
|
|
76
|
-
value: ''
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
if (value === '') {
|
|
80
|
-
return {
|
|
81
|
-
value: value
|
|
82
|
-
};
|
|
83
|
-
} // 非数字
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
value = big ? value : Number(value);
|
|
87
|
-
|
|
88
|
-
if (isNaN(value)) {
|
|
89
|
-
return invalid;
|
|
90
|
-
} // 不能为实数,却包含小数点
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if (!real && (0, _includes["default"])(_context = String(value)).call(_context, '.')) {
|
|
94
|
-
return invalid;
|
|
95
|
-
} // 不能为负数,却小于0
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if (!sign && value < 0) {
|
|
99
|
-
return invalid;
|
|
100
|
-
} // 不能为0,却为0
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if (!zero && value === 0) {
|
|
104
|
-
return invalid;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (real) {
|
|
108
|
-
precision = Number(precision);
|
|
109
|
-
|
|
110
|
-
if (precision) {
|
|
111
|
-
value = value.toFixed(precision);
|
|
112
|
-
value = value.toString(); // 将数值转换为字符串
|
|
113
|
-
|
|
114
|
-
value = value.replace(/(\.\d*?[1-9])0+$|\.0*$/, "$1"); // 去除小数点后无意义的零
|
|
115
|
-
|
|
116
|
-
if (!fixed) {
|
|
117
|
-
value = Number(value);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
return {
|
|
123
|
-
value: value
|
|
124
|
-
};
|
|
125
|
-
};
|
|
126
|
-
/**
|
|
127
|
-
* real: true表示带小数点,默认为false
|
|
128
|
-
* sign: true表示带正负号,默认为false
|
|
129
|
-
* precision: real为true时,小数的精度;否则无效
|
|
130
|
-
* zero:true表示可以输入0,默认为false
|
|
131
|
-
* fixed: real为true时生效; true表示固定显示指定精度的小数,精度由precision确定,默认值为false
|
|
132
|
-
* big: big为ture时生效; true标识为大数值,与上面所有属性互斥
|
|
133
|
-
*/
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
var PROPS = {
|
|
137
|
-
defaultValue: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
138
|
-
real: _propTypes["default"].bool,
|
|
139
|
-
sign: _propTypes["default"].bool,
|
|
140
|
-
precision: _propTypes["default"].any,
|
|
141
|
-
zero: _propTypes["default"].bool,
|
|
142
|
-
fixed: _propTypes["default"].bool,
|
|
143
|
-
big: _propTypes["default"].bool,
|
|
144
|
-
inputRef: _propTypes["default"].func,
|
|
145
|
-
onChange: _propTypes["default"].func,
|
|
146
|
-
onBlur: _propTypes["default"].func
|
|
147
|
-
};
|
|
148
|
-
var PROPS_KEYS = (0, _keys["default"])(PROPS);
|
|
149
|
-
|
|
150
|
-
var NumberInput = /*#__PURE__*/function (_React$Component) {
|
|
151
|
-
(0, _inherits2["default"])(NumberInput, _React$Component);
|
|
152
|
-
|
|
153
|
-
var _super = _createSuper(NumberInput);
|
|
154
|
-
|
|
155
|
-
function NumberInput() {
|
|
156
|
-
var _context2;
|
|
157
|
-
|
|
158
|
-
var _this;
|
|
159
|
-
|
|
160
|
-
(0, _classCallCheck2["default"])(this, NumberInput);
|
|
161
|
-
|
|
162
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
163
|
-
args[_key] = arguments[_key];
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
_this = _super.call.apply(_super, (0, _concat["default"])(_context2 = [this]).call(_context2, args));
|
|
167
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
|
|
168
|
-
typo: false,
|
|
169
|
-
value: ''
|
|
170
|
-
});
|
|
171
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (event) {
|
|
172
|
-
var value = event.target.value;
|
|
173
|
-
|
|
174
|
-
if (!_this.hasSpecialChar(value)) {
|
|
175
|
-
_this.setState({
|
|
176
|
-
value: value,
|
|
177
|
-
typo: true
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onBlur", function (event) {
|
|
182
|
-
var _this$props = _this.props,
|
|
183
|
-
onBlur = _this$props.onBlur,
|
|
184
|
-
onChange = _this$props.onChange,
|
|
185
|
-
fixed = _this$props.fixed;
|
|
186
|
-
|
|
187
|
-
if (_this.state.typo) {
|
|
188
|
-
var _this$format = _this.format(_this.state.value, fixed),
|
|
189
|
-
invalid = _this$format.invalid,
|
|
190
|
-
value = _this$format.value;
|
|
191
|
-
|
|
192
|
-
_this.setState({
|
|
193
|
-
typo: false,
|
|
194
|
-
value: ''
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
if (!invalid) {
|
|
198
|
-
onChange && onChange(value);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
onBlur && onBlur(event); //有输入才触发外部失去焦点事件,避免非必要请求
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "hasSpecialChar", function (value) {
|
|
205
|
-
if ((0, _includes["default"])(value).call(value, '+')) {
|
|
206
|
-
return true;
|
|
207
|
-
} else if (!_this.props.sign && (0, _includes["default"])(value).call(value, '-')) {
|
|
208
|
-
return true;
|
|
209
|
-
} else {
|
|
210
|
-
return !_this.props.real && (0, _includes["default"])(value).call(value, '.');
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "format", function (value, fixed) {
|
|
214
|
-
var _this$props2 = _this.props,
|
|
215
|
-
real = _this$props2.real,
|
|
216
|
-
sign = _this$props2.sign,
|
|
217
|
-
zero = _this$props2.zero,
|
|
218
|
-
precision = _this$props2.precision,
|
|
219
|
-
big = _this$props2.big;
|
|
220
|
-
return parseNumber(value, {
|
|
221
|
-
real: real,
|
|
222
|
-
sign: sign,
|
|
223
|
-
zero: zero,
|
|
224
|
-
precision: precision,
|
|
225
|
-
fixed: fixed,
|
|
226
|
-
big: big
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getShowValue", function () {
|
|
230
|
-
if (_this.state.typo) {
|
|
231
|
-
// 处于输入状态从state中取值
|
|
232
|
-
return _this.state.value;
|
|
233
|
-
} else {
|
|
234
|
-
// 处于非输入状态从props中取值
|
|
235
|
-
return _this.format(_this.props.defaultValue, _this.props.fixed).value;
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getProps", function () {
|
|
239
|
-
var props = (0, _helper.getObjectExclude)(_this.props, PROPS_KEYS);
|
|
240
|
-
return _objectSpread(_objectSpread({}, props), {}, {
|
|
241
|
-
type: 'text',
|
|
242
|
-
ref: _this.props.inputRef || null,
|
|
243
|
-
value: _this.getShowValue(),
|
|
244
|
-
onChange: _this.onChange,
|
|
245
|
-
onBlur: _this.onBlur
|
|
246
|
-
});
|
|
247
|
-
});
|
|
248
|
-
return _this;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
(0, _createClass2["default"])(NumberInput, [{
|
|
252
|
-
key: "render",
|
|
253
|
-
value: function render() {
|
|
254
|
-
return /*#__PURE__*/_react["default"].createElement(_input["default"], this.getProps());
|
|
255
|
-
}
|
|
256
|
-
}]);
|
|
257
|
-
return NumberInput;
|
|
258
|
-
}(_react["default"].Component);
|
|
259
|
-
|
|
260
|
-
(0, _defineProperty2["default"])(NumberInput, "propTypes", PROPS);
|
|
261
|
-
var _default = NumberInput;
|
|
262
|
-
exports["default"] = _default;
|