cloud-b2b 1.1.52 → 1.1.54
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 +141 -0
- package/es/Card/Card.js +19 -0
- package/es/CodeInput/CodeInput.js +123 -0
- package/es/Control/Control.js +444 -0
- package/es/Control/event.js +43 -0
- package/es/Enhance/Dialogs.js +52 -0
- package/es/Enhance/Loading.js +131 -0
- package/{src → es}/Enhance/index.js +6 -8
- package/es/Header/Header.js +162 -0
- package/es/Header/Vertical.js +106 -0
- package/es/ImageView/ImageView.js +100 -0
- package/es/Indent/Indent.js +19 -0
- package/es/InpurCascader/InputCascader.js +108 -0
- package/es/InputEditor/InputEditor.js +173 -0
- package/es/InputSearch/InputSearch.js +266 -0
- package/es/InputSelect/InputSelect.js +160 -0
- package/es/InputTreeSelect/InputTreeSelect.js +121 -0
- package/es/InputWriting/InputWriting.js +85 -0
- package/es/Layout/Layout.js +201 -0
- package/es/LayoutLink/LayoutLink.js +73 -0
- package/es/Link/Link.js +85 -0
- package/es/Loading/Loading.js +13 -0
- package/es/Loading2/Loading2.js +9 -0
- package/es/ModalWithDrag/ModalWithDrag.js +29 -0
- package/{src → es}/ModalWithDrag/drag.js +116 -128
- package/es/NumberInput/NumberInput.js +200 -0
- package/es/Search/Search.js +497 -0
- package/es/Sidebar/Sidebar.js +144 -0
- package/es/Sidebar2/Sidebar.js +165 -0
- package/es/SuperForm/SuperForm.js +598 -0
- package/es/SuperForm2/SuperForm.js +687 -0
- package/es/SuperIcon/SuperIcon.js +27 -0
- package/es/SuperPagination/SuperPagination.js +109 -0
- package/es/SuperTab/SuperTab.js +107 -0
- package/es/SuperTab2/SuperTab2.js +145 -0
- package/es/SuperTable/DragSortRow.js +97 -0
- package/es/SuperTable/FilterDropDown.js +164 -0
- package/es/SuperTable/SuperTable.js +808 -0
- package/es/SuperTable/fixed.js +34 -0
- package/es/SuperTable2/SuperTable2.js +894 -0
- package/es/SuperTable2/SuperTableCell.js +198 -0
- package/es/SuperTable3/FilterDropDown.js +164 -0
- package/es/SuperTable3/SuperTable.js +665 -0
- package/es/SuperTable3/fixed.js +34 -0
- package/es/SuperToolbar/SuperToolbar.js +195 -0
- package/es/SuperUpload/SuperUpload.js +356 -0
- package/es/Title/Title.js +33 -0
- package/es/Viewer/ImageViews.js +258 -0
- package/es/Viewer/Viewer.js +122 -0
- package/es/WingBlank/WingBlank.js +16 -0
- package/es/helper.js +240 -0
- package/{src → es}/history.js +6 -6
- package/es/index.js +37 -0
- package/es/variables.js +6 -0
- package/lib/Area/Area.js +149 -0
- package/lib/Area/package.json +6 -0
- package/lib/Card/Card.js +27 -0
- package/lib/Card/package.json +6 -0
- package/lib/CodeInput/CodeInput.js +131 -0
- package/lib/CodeInput/package.json +6 -0
- package/lib/Control/Control.js +450 -0
- package/lib/Control/event.js +51 -0
- package/lib/Control/package.json +6 -0
- package/lib/Enhance/Dialogs.js +60 -0
- package/lib/Enhance/Loading.js +138 -0
- package/lib/Enhance/index.js +25 -0
- package/lib/Enhance/package.json +6 -0
- package/lib/Header/Header.js +169 -0
- package/lib/Header/Header.less +95 -0
- package/lib/Header/Vertical.js +114 -0
- package/lib/Header/Vertical.less +60 -0
- package/lib/Header/package.json +6 -0
- package/lib/ImageView/ImageView.js +108 -0
- package/lib/ImageView/ImageView.less +14 -0
- package/lib/ImageView/package.json +6 -0
- package/lib/Indent/Indent.js +27 -0
- package/lib/Indent/package.json +6 -0
- package/lib/InpurCascader/InputCascader.js +115 -0
- package/lib/InpurCascader/package.json +6 -0
- package/lib/InputEditor/InputEditor.js +181 -0
- package/lib/InputEditor/inputEditor.less +8 -0
- package/lib/InputEditor/package.json +6 -0
- package/lib/InputSearch/InputSearch.js +274 -0
- package/lib/InputSearch/package.json +6 -0
- package/lib/InputSelect/InputSelect.js +168 -0
- package/lib/InputSelect/package.json +6 -0
- package/lib/InputTreeSelect/InputTreeSelect.js +128 -0
- package/lib/InputTreeSelect/package.json +6 -0
- package/lib/InputWriting/InputWriting.js +93 -0
- package/lib/InputWriting/package.json +6 -0
- package/lib/Layout/Layout.js +209 -0
- package/lib/Layout/Layout.less +28 -0
- package/lib/Layout/package.json +6 -0
- package/lib/LayoutLink/LayoutLink.js +86 -0
- package/lib/LayoutLink/LayoutLink.less +53 -0
- package/lib/LayoutLink/package.json +6 -0
- package/lib/Link/Link.js +93 -0
- package/lib/Link/package.json +6 -0
- package/lib/Loading/Loading.js +21 -0
- package/lib/Loading/Loading.less +13 -0
- package/lib/Loading/package.json +6 -0
- package/lib/Loading2/Loading2.js +17 -0
- package/lib/Loading2/Loading2.less +19 -0
- package/lib/Loading2/package.json +6 -0
- package/lib/ModalWithDrag/ModalWithDrag.js +37 -0
- package/lib/ModalWithDrag/ModalWithDrag.less +6 -0
- package/lib/ModalWithDrag/drag.js +124 -0
- package/lib/ModalWithDrag/package.json +6 -0
- package/lib/NumberInput/NumberInput.js +208 -0
- package/lib/NumberInput/package.json +6 -0
- package/lib/Search/Search.js +510 -0
- package/lib/Search/Search.less +63 -0
- package/lib/Search/package.json +6 -0
- package/lib/Sidebar/Sidebar.js +152 -0
- package/lib/Sidebar/Sidebar.less +78 -0
- package/lib/Sidebar/package.json +6 -0
- package/lib/Sidebar2/Sidebar.js +173 -0
- package/lib/Sidebar2/Sidebar.less +153 -0
- package/lib/Sidebar2/package.json +6 -0
- package/lib/SuperForm/SuperForm.js +610 -0
- package/lib/SuperForm/SuperForm.less +52 -0
- package/lib/SuperForm/package.json +6 -0
- package/lib/SuperForm2/SuperForm.js +699 -0
- package/lib/SuperForm2/SuperForm.less +52 -0
- package/lib/SuperForm2/package.json +6 -0
- package/lib/SuperIcon/SuperIcon.js +35 -0
- package/lib/SuperIcon/package.json +6 -0
- package/lib/SuperPagination/SuperPagination.js +117 -0
- package/lib/SuperPagination/package.json +6 -0
- package/lib/SuperTab/SuperTab.js +115 -0
- package/lib/SuperTab/SuperTab.less +43 -0
- package/lib/SuperTab/package.json +6 -0
- package/lib/SuperTab2/SuperTab2.js +153 -0
- package/lib/SuperTab2/SuperTab2.less +18 -0
- package/lib/SuperTab2/package.json +6 -0
- package/lib/SuperTable/DragSortRow.js +105 -0
- package/lib/SuperTable/DragSortRow.less +17 -0
- package/lib/SuperTable/FilterDropDown.js +172 -0
- package/lib/SuperTable/FilterDropDown.less +30 -0
- package/lib/SuperTable/SuperTable.js +816 -0
- package/lib/SuperTable/SuperTable.less +132 -0
- package/lib/SuperTable/fixed.js +42 -0
- package/lib/SuperTable/package.json +6 -0
- package/lib/SuperTable2/SuperTable2.js +907 -0
- package/lib/SuperTable2/SuperTable2.less +118 -0
- package/lib/SuperTable2/SuperTableCell.js +203 -0
- package/lib/SuperTable2/package.json +6 -0
- package/lib/SuperTable3/FilterDropDown.js +172 -0
- package/lib/SuperTable3/FilterDropDown.less +29 -0
- package/lib/SuperTable3/SuperTable.js +673 -0
- package/lib/SuperTable3/SuperTable.less +99 -0
- package/lib/SuperTable3/fixed.js +42 -0
- package/lib/SuperTable3/package.json +6 -0
- package/lib/SuperToolbar/SuperToolbar.js +203 -0
- package/lib/SuperToolbar/SuperToolbar.less +17 -0
- package/lib/SuperToolbar/package.json +6 -0
- package/lib/SuperUpload/SuperUpload.js +368 -0
- package/lib/SuperUpload/SuperUpload.less +28 -0
- package/lib/SuperUpload/package.json +6 -0
- package/lib/Title/Title.js +41 -0
- package/lib/Title/Title.less +35 -0
- package/lib/Title/package.json +6 -0
- package/lib/Viewer/ImageViews.js +266 -0
- package/lib/Viewer/Viewer.js +130 -0
- package/lib/Viewer/Viewer.less +67 -0
- package/lib/Viewer/imgView.less +59 -0
- package/lib/Viewer/package.json +7 -0
- package/lib/WingBlank/WingBlank.js +24 -0
- package/lib/WingBlank/WingBlank.less +12 -0
- package/lib/WingBlank/package.json +6 -0
- package/lib/adjust.less +89 -0
- package/lib/helper.js +246 -0
- package/lib/history.js +12 -0
- package/lib/index.js +271 -0
- package/lib/index.less +31 -0
- package/lib/style.less +30 -0
- package/lib/variables.js +14 -0
- package/lib/variables.less +73 -0
- package/package.json +22 -44
- package/src/Area/Area.js +0 -94
- package/src/Card/Card.js +0 -16
- package/src/CodeInput/CodeInput.js +0 -76
- package/src/Control/Control.js +0 -338
- package/src/Control/event.js +0 -45
- package/src/Enhance/Dialogs.js +0 -24
- package/src/Enhance/Loading.js +0 -83
- package/src/Header/Header.js +0 -149
- package/src/Header/Vertical.js +0 -74
- package/src/ImageView/ImageView.js +0 -62
- package/src/Indent/Indent.js +0 -12
- package/src/InpurCascader/InputCascader.js +0 -83
- package/src/InputEditor/InputEditor.js +0 -93
- package/src/InputSearch/InputSearch.js +0 -186
- package/src/InputSelect/InputSelect.js +0 -103
- package/src/InputTreeSelect/InputTreeSelect.js +0 -87
- package/src/InputWriting/InputWriting.js +0 -65
- package/src/Layout/Layout.js +0 -121
- package/src/LayoutLink/LayoutLink.js +0 -59
- package/src/Link/Link.js +0 -57
- package/src/Loading/Loading.js +0 -15
- package/src/Loading2/Loading2.js +0 -15
- package/src/ModalWithDrag/ModalWithDrag.js +0 -17
- package/src/NumberInput/NumberInput.js +0 -137
- package/src/Search/Search.js +0 -368
- package/src/Sidebar/Sidebar.js +0 -111
- package/src/Sidebar2/Sidebar.js +0 -143
- package/src/SuperForm/SuperForm.js +0 -516
- package/src/SuperForm2/SuperForm.js +0 -588
- package/src/SuperIcon/SuperIcon.js +0 -14
- package/src/SuperPagination/SuperPagination.js +0 -65
- package/src/SuperTab/SuperTab.js +0 -84
- package/src/SuperTab2/SuperTab2.js +0 -94
- package/src/SuperTable/DragSortRow.js +0 -62
- package/src/SuperTable/FilterDropDown.js +0 -111
- package/src/SuperTable/SuperTable.js +0 -590
- package/src/SuperTable/fixed.js +0 -34
- package/src/SuperTable2/SuperTable2.js +0 -600
- package/src/SuperTable2/SuperTableCell.js +0 -144
- package/src/SuperTable3/FilterDropDown.js +0 -111
- package/src/SuperTable3/SuperTable.js +0 -498
- package/src/SuperTable3/fixed.js +0 -34
- package/src/SuperToolbar/SuperToolbar.js +0 -128
- package/src/SuperUpload/SuperUpload.js +0 -137
- package/src/Title/Title.js +0 -18
- package/src/Viewer/ImageViews.js +0 -220
- package/src/Viewer/Viewer.js +0 -97
- package/src/WingBlank/WingBlank.js +0 -14
- package/src/helper.js +0 -185
- package/src/index.js +0 -38
- package/src/variables.js +0 -5
- package/test/index.html +0 -10
- package/test/test.js +0 -16
- package/test/test.less +0 -12
- package/test/webpack.config.js +0 -71
- package/tools/babel.config.js +0 -14
- package/tools/build.js +0 -70
- package/tools/publish.js +0 -9
- package/tools/util.js +0 -53
- /package/{src → es}/Area/package.json +0 -0
- /package/{src → es}/Card/package.json +0 -0
- /package/{src → es}/CodeInput/package.json +0 -0
- /package/{src → es}/Control/package.json +0 -0
- /package/{src → es}/Enhance/package.json +0 -0
- /package/{src → es}/Header/Header.less +0 -0
- /package/{src → es}/Header/Vertical.less +0 -0
- /package/{src → es}/Header/package.json +0 -0
- /package/{src → es}/ImageView/ImageView.less +0 -0
- /package/{src → es}/ImageView/package.json +0 -0
- /package/{src → es}/Indent/package.json +0 -0
- /package/{src → es}/InpurCascader/package.json +0 -0
- /package/{src → es}/InputEditor/inputEditor.less +0 -0
- /package/{src → es}/InputEditor/package.json +0 -0
- /package/{src → es}/InputSearch/package.json +0 -0
- /package/{src → es}/InputSelect/package.json +0 -0
- /package/{src → es}/InputTreeSelect/package.json +0 -0
- /package/{src → es}/InputWriting/package.json +0 -0
- /package/{src → es}/Layout/Layout.less +0 -0
- /package/{src → es}/Layout/package.json +0 -0
- /package/{src → es}/LayoutLink/LayoutLink.less +0 -0
- /package/{src → es}/LayoutLink/package.json +0 -0
- /package/{src → es}/Link/package.json +0 -0
- /package/{src → es}/Loading/Loading.less +0 -0
- /package/{src → es}/Loading/package.json +0 -0
- /package/{src → es}/Loading2/Loading2.less +0 -0
- /package/{src → es}/Loading2/package.json +0 -0
- /package/{src → es}/ModalWithDrag/ModalWithDrag.less +0 -0
- /package/{src → es}/ModalWithDrag/package.json +0 -0
- /package/{src → es}/NumberInput/package.json +0 -0
- /package/{src → es}/Search/Search.less +0 -0
- /package/{src → es}/Search/package.json +0 -0
- /package/{src → es}/Sidebar/Sidebar.less +0 -0
- /package/{src → es}/Sidebar/package.json +0 -0
- /package/{src → es}/Sidebar2/Sidebar.less +0 -0
- /package/{src → es}/Sidebar2/package.json +0 -0
- /package/{src → es}/SuperForm/SuperForm.less +0 -0
- /package/{src → es}/SuperForm/package.json +0 -0
- /package/{src → es}/SuperForm2/SuperForm.less +0 -0
- /package/{src → es}/SuperForm2/package.json +0 -0
- /package/{src → es}/SuperIcon/package.json +0 -0
- /package/{src → es}/SuperPagination/package.json +0 -0
- /package/{src → es}/SuperTab/SuperTab.less +0 -0
- /package/{src → es}/SuperTab/package.json +0 -0
- /package/{src → es}/SuperTab2/SuperTab2.less +0 -0
- /package/{src → es}/SuperTab2/package.json +0 -0
- /package/{src → es}/SuperTable/DragSortRow.less +0 -0
- /package/{src → es}/SuperTable/FilterDropDown.less +0 -0
- /package/{src → es}/SuperTable/SuperTable.less +0 -0
- /package/{src → es}/SuperTable/package.json +0 -0
- /package/{src → es}/SuperTable2/SuperTable2.less +0 -0
- /package/{src → es}/SuperTable2/package.json +0 -0
- /package/{src → es}/SuperTable3/FilterDropDown.less +0 -0
- /package/{src → es}/SuperTable3/SuperTable.less +0 -0
- /package/{src → es}/SuperTable3/package.json +0 -0
- /package/{src → es}/SuperToolbar/SuperToolbar.less +0 -0
- /package/{src → es}/SuperToolbar/package.json +0 -0
- /package/{src → es}/SuperUpload/SuperUpload.less +0 -0
- /package/{src → es}/SuperUpload/package.json +0 -0
- /package/{src → es}/Title/Title.less +0 -0
- /package/{src → es}/Title/package.json +0 -0
- /package/{src → es}/Viewer/Viewer.less +0 -0
- /package/{src → es}/Viewer/imgView.less +0 -0
- /package/{src → es}/Viewer/package.json +0 -0
- /package/{src → es}/WingBlank/WingBlank.less +0 -0
- /package/{src → es}/WingBlank/package.json +0 -0
- /package/{src → es}/adjust.less +0 -0
- /package/{src → es}/style.less +0 -0
- /package/{src → es}/variables.less +0 -0
|
@@ -0,0 +1,699 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _typeof3 = require("@babel/runtime-corejs3/helpers/typeof");
|
|
4
|
+
var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
|
|
5
|
+
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
6
|
+
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
|
7
|
+
var _filterInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
8
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
9
|
+
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
10
|
+
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
|
11
|
+
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
|
12
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
13
|
+
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
|
14
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
15
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
16
|
+
value: true
|
|
17
|
+
});
|
|
18
|
+
exports["default"] = void 0;
|
|
19
|
+
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
20
|
+
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
21
|
+
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
22
|
+
var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
|
23
|
+
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
24
|
+
var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
|
|
25
|
+
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
26
|
+
var _row = _interopRequireDefault(require("antd/lib/row"));
|
|
27
|
+
var _col = _interopRequireDefault(require("antd/lib/col"));
|
|
28
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
29
|
+
var _tooltip = _interopRequireDefault(require("antd/lib/tooltip"));
|
|
30
|
+
var _icon = _interopRequireDefault(require("antd/lib/icon"));
|
|
31
|
+
var _checkbox = _interopRequireDefault(require("antd/lib/checkbox"));
|
|
32
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
|
|
33
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
34
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
35
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
36
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
37
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
38
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
39
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
40
|
+
var _form = _interopRequireDefault(require("antd/lib/form"));
|
|
41
|
+
var _react = _interopRequireDefault(require("react"));
|
|
42
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
43
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
44
|
+
var _helper = _interopRequireDefault(require("../helper"));
|
|
45
|
+
var _Control = _interopRequireWildcard(require("../Control"));
|
|
46
|
+
var _variables = _interopRequireDefault(require("../variables"));
|
|
47
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
48
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
49
|
+
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty2(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
50
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context26, _context27; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context26 = ownKeys(Object(t), !0)).call(_context26, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context27 = ownKeys(Object(t))).call(_context27, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
51
|
+
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); }; }
|
|
52
|
+
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; } }
|
|
53
|
+
var FormItem = _form["default"].Item;
|
|
54
|
+
var defaultSize = 'large';
|
|
55
|
+
var defaultColNum = 4;
|
|
56
|
+
var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'captcha', 'area', 'uploadImg', 'cascader', 'checkbox', 'treeSelect'];
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* key:[必须],用于唯一标识该Form下的一个表单元素
|
|
60
|
+
* title:[必须],表单元素的标签
|
|
61
|
+
* type:[必须],表单元素类型
|
|
62
|
+
* required: [可选],是否为必填项
|
|
63
|
+
* options: [可选],对象数组(type为readonly,radio,search, searchText,select, selectText时有效)
|
|
64
|
+
* span: [可选],占据的列数,默认为1
|
|
65
|
+
* showAdd: [可选],是否显示+号,点击+号会触发onAdd事件,默认为false
|
|
66
|
+
* rule: [可选],用于设置校验规则
|
|
67
|
+
*/
|
|
68
|
+
var ControlType = {
|
|
69
|
+
key: _propTypes["default"].string.isRequired,
|
|
70
|
+
title: _propTypes["default"].string,
|
|
71
|
+
type: _propTypes["default"].oneOf(TYPE).isRequired,
|
|
72
|
+
required: _propTypes["default"].bool,
|
|
73
|
+
options: _propTypes["default"].array,
|
|
74
|
+
span: _propTypes["default"].number,
|
|
75
|
+
onCheckItem: _propTypes["default"].any,
|
|
76
|
+
showAdd: _propTypes["default"].any,
|
|
77
|
+
rule: _propTypes["default"].object,
|
|
78
|
+
props: _propTypes["default"].object
|
|
79
|
+
};
|
|
80
|
+
var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
81
|
+
(0, _inherits2["default"])(Controlled, _React$Component);
|
|
82
|
+
var _super = _createSuper(Controlled);
|
|
83
|
+
function Controlled(props) {
|
|
84
|
+
var _this;
|
|
85
|
+
(0, _classCallCheck2["default"])(this, Controlled);
|
|
86
|
+
_this = _super.call(this, props);
|
|
87
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (value) {
|
|
88
|
+
var onChange = _this.props.onChange;
|
|
89
|
+
_this.setState({
|
|
90
|
+
value: value
|
|
91
|
+
});
|
|
92
|
+
onChange && onChange(value);
|
|
93
|
+
});
|
|
94
|
+
_this.state = {
|
|
95
|
+
value: props.value
|
|
96
|
+
};
|
|
97
|
+
return _this;
|
|
98
|
+
}
|
|
99
|
+
(0, _createClass2["default"])(Controlled, [{
|
|
100
|
+
key: "componentWillReceiveProps",
|
|
101
|
+
value: function componentWillReceiveProps(nextProps) {
|
|
102
|
+
if (this.props.value !== nextProps.value) {
|
|
103
|
+
this.setState({
|
|
104
|
+
value: nextProps.value
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}, {
|
|
109
|
+
key: "render",
|
|
110
|
+
value: function render() {
|
|
111
|
+
var props = _objectSpread(_objectSpread({}, this.props), {}, {
|
|
112
|
+
size: 'large',
|
|
113
|
+
value: this.state.value,
|
|
114
|
+
onChange: this.onChange
|
|
115
|
+
});
|
|
116
|
+
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
117
|
+
}
|
|
118
|
+
}]);
|
|
119
|
+
return Controlled;
|
|
120
|
+
}(_react["default"].Component);
|
|
121
|
+
/**
|
|
122
|
+
* colNum:[可选],表单的列数,默认为4
|
|
123
|
+
* readonly: [可选],为true时,所有表单元素都是只读的; 为字符串数组时,用于指定key的表单元素是只读的
|
|
124
|
+
* hideControls: [可选],指定key的表单元素被隐藏
|
|
125
|
+
* options: [可选],键值对,值与ControlType中options作用相同,但优先级更高
|
|
126
|
+
* onChange:内容改变时触发,原型为func(key, value)
|
|
127
|
+
* onSearch:搜索框中用户输入时触发,原型为func(key, title, control)
|
|
128
|
+
* onAdd: 点击+号时触发,原型为func(key)
|
|
129
|
+
* checkable:是否显示checkbox选择框
|
|
130
|
+
* onOpenChange:控制日期框显示隐藏回调func(key, open)
|
|
131
|
+
* onAreaSearch:联级选择器触发,原型为func(key - 当前联级key, title - 输入值, parentKey - 主体联级key)
|
|
132
|
+
* onFileChange:上传组件触发,原型为func(key,{fileList, fileDeleteList})
|
|
133
|
+
*/
|
|
134
|
+
var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
135
|
+
(0, _inherits2["default"])(SuperForm2, _React$Component2);
|
|
136
|
+
var _super2 = _createSuper(SuperForm2);
|
|
137
|
+
function SuperForm2() {
|
|
138
|
+
var _context;
|
|
139
|
+
var _this2;
|
|
140
|
+
(0, _classCallCheck2["default"])(this, SuperForm2);
|
|
141
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
142
|
+
args[_key] = arguments[_key];
|
|
143
|
+
}
|
|
144
|
+
_this2 = _super2.call.apply(_super2, (0, _concat["default"])(_context = [this]).call(_context, args));
|
|
145
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onAdd", function (key, title) {
|
|
146
|
+
var onAdd = _this2.props.onAdd;
|
|
147
|
+
onAdd && onAdd(key, title);
|
|
148
|
+
});
|
|
149
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onFileChange", function (_ref, file) {
|
|
150
|
+
var key = _ref.key;
|
|
151
|
+
var onFileChange = _this2.props.onFileChange;
|
|
152
|
+
onFileChange && onFileChange(key, file);
|
|
153
|
+
});
|
|
154
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onChange", function (key, value) {
|
|
155
|
+
var onChange = _this2.props.onChange;
|
|
156
|
+
if (onChange) {
|
|
157
|
+
_this2.onExitValid(key);
|
|
158
|
+
onChange(key, value);
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onGetCode", function (key, value) {
|
|
162
|
+
var onGetCode = _this2.props.onGetCode;
|
|
163
|
+
onGetCode && onGetCode();
|
|
164
|
+
});
|
|
165
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onBlur", function (key, value) {
|
|
166
|
+
var onChange = _this2.props.onChange;
|
|
167
|
+
if (onChange) {
|
|
168
|
+
_this2.onExitValid(key);
|
|
169
|
+
onChange(key, value);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onExitValid", function (key, value) {
|
|
173
|
+
if (key === _this2.validKey) {
|
|
174
|
+
_this2.validKey = '';
|
|
175
|
+
_this2.props.onExitValid();
|
|
176
|
+
}
|
|
177
|
+
_this2.props.onChangeOperate && _this2.props.onChangeOperate(key, value);
|
|
178
|
+
});
|
|
179
|
+
// 动态生成getValidState方法
|
|
180
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "initValidState", function () {
|
|
181
|
+
var _this2$props = _this2.props,
|
|
182
|
+
value = _this2$props.value,
|
|
183
|
+
valid = _this2$props.valid;
|
|
184
|
+
var invalid = function invalid() {
|
|
185
|
+
return null;
|
|
186
|
+
};
|
|
187
|
+
var _valid = function _valid(_ref2) {
|
|
188
|
+
var key = _ref2.key,
|
|
189
|
+
required = _ref2.required;
|
|
190
|
+
if (required) {
|
|
191
|
+
if (!value || _helper["default"].isEmpty2(value[key]) || !(0, _isArray["default"])(value[key]) && (0, _typeof2["default"])(value[key]) === 'object' && _helper["default"].isEmpty(value[key].value)) {
|
|
192
|
+
_this2.getValidState = invalid;
|
|
193
|
+
_this2.validKey = key;
|
|
194
|
+
return 'error';
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return null;
|
|
198
|
+
};
|
|
199
|
+
_this2.getValidState = valid ? _valid : invalid;
|
|
200
|
+
});
|
|
201
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "validDate", function (_ref3) {
|
|
202
|
+
var key = _ref3.key,
|
|
203
|
+
type = _ref3.type;
|
|
204
|
+
return function (date) {
|
|
205
|
+
var _this2$props$value = _this2.props.value,
|
|
206
|
+
value = _this2$props$value === void 0 ? {} : _this2$props$value;
|
|
207
|
+
if (!date || !value[key]) {
|
|
208
|
+
return false;
|
|
209
|
+
} else {
|
|
210
|
+
if (type === '>') {
|
|
211
|
+
return date.format('YYYY-MM-DD') < value[key];
|
|
212
|
+
} else if (type === '<') {
|
|
213
|
+
return date.format('YYYY-MM-DD') > value[key];
|
|
214
|
+
} else {
|
|
215
|
+
return false;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
});
|
|
220
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getPopupContainer", function () {
|
|
221
|
+
var container = _this2.props.container;
|
|
222
|
+
if (typeof container === 'undefined') {
|
|
223
|
+
return _reactDom["default"].findDOMNode((0, _assertThisInitialized2["default"])(_this2));
|
|
224
|
+
} else if (typeof container === 'boolean') {
|
|
225
|
+
return document.body;
|
|
226
|
+
} else {
|
|
227
|
+
return _reactDom["default"].findDOMNode(container);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getMaxWidth", function () {
|
|
231
|
+
var _this2$props$colNum = _this2.props.colNum,
|
|
232
|
+
colNum = _this2$props$colNum === void 0 ? defaultColNum : _this2$props$colNum;
|
|
233
|
+
return colNum * 1200;
|
|
234
|
+
});
|
|
235
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getContainer", function () {
|
|
236
|
+
return _this2.props.getContainer;
|
|
237
|
+
});
|
|
238
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getControls", function () {
|
|
239
|
+
var _this2$props2 = _this2.props,
|
|
240
|
+
hideControls = _this2$props2.hideControls,
|
|
241
|
+
controls = _this2$props2.controls;
|
|
242
|
+
if (!hideControls) {
|
|
243
|
+
return controls;
|
|
244
|
+
} else {
|
|
245
|
+
return (0, _filter["default"])(controls).call(controls, function (control) {
|
|
246
|
+
return !(0, _some["default"])(hideControls).call(hideControls, function (key) {
|
|
247
|
+
return control.key === key;
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getType", function (_ref4) {
|
|
253
|
+
var _context2;
|
|
254
|
+
var key = _ref4.key,
|
|
255
|
+
type = _ref4.type;
|
|
256
|
+
var readonly = _this2.props.readonly;
|
|
257
|
+
if ((0, _includes["default"])(_context2 = ['area', 'uploadImg']).call(_context2, type)) {
|
|
258
|
+
return type;
|
|
259
|
+
} else if (!readonly) {
|
|
260
|
+
return type;
|
|
261
|
+
} else if (readonly === true) {
|
|
262
|
+
return 'readonly';
|
|
263
|
+
} else if ((0, _isArray["default"])(readonly) && (0, _some["default"])(readonly).call(readonly, function (readonlyKey) {
|
|
264
|
+
return readonlyKey === key;
|
|
265
|
+
})) {
|
|
266
|
+
return 'readonly';
|
|
267
|
+
} else {
|
|
268
|
+
return type;
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "specialProps", function (type, _ref5) {
|
|
272
|
+
var key = _ref5.key,
|
|
273
|
+
_ref5$props = _ref5.props,
|
|
274
|
+
props = _ref5$props === void 0 ? {} : _ref5$props,
|
|
275
|
+
originType = _ref5.type;
|
|
276
|
+
if (type === 'readonly') {
|
|
277
|
+
if (originType === 'textArea') {
|
|
278
|
+
var _context3;
|
|
279
|
+
return {
|
|
280
|
+
type: 'textArea',
|
|
281
|
+
readonly: true,
|
|
282
|
+
onBlur: (0, _bind["default"])(_context3 = _this2.onExitValid).call(_context3, (0, _assertThisInitialized2["default"])(_this2), key)
|
|
283
|
+
};
|
|
284
|
+
} else if (originType === 'uploadImg') {
|
|
285
|
+
var _context4;
|
|
286
|
+
var commonProps = _this2.props.buildSuperUploadProps ? _this2.props.buildSuperUploadProps() : {};
|
|
287
|
+
return _objectSpread(_objectSpread(_objectSpread({}, props), commonProps), {}, {
|
|
288
|
+
readonly: true,
|
|
289
|
+
onBlur: (0, _bind["default"])(_context4 = _this2.onExitValid).call(_context4, (0, _assertThisInitialized2["default"])(_this2), key)
|
|
290
|
+
});
|
|
291
|
+
} else {
|
|
292
|
+
var _context5;
|
|
293
|
+
return {
|
|
294
|
+
onBlur: (0, _bind["default"])(_context5 = _this2.onExitValid).call(_context5, (0, _assertThisInitialized2["default"])(_this2), key)
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
} else if (type === 'text' || type === 'textArea') {
|
|
298
|
+
var _context6, _context7;
|
|
299
|
+
return _objectSpread(_objectSpread({}, props), {}, {
|
|
300
|
+
onChange: (0, _bind["default"])(_context6 = _this2.onExitValid).call(_context6, (0, _assertThisInitialized2["default"])(_this2), key),
|
|
301
|
+
onBlur: (0, _bind["default"])(_context7 = _this2.onChange).call(_context7, (0, _assertThisInitialized2["default"])(_this2), key)
|
|
302
|
+
});
|
|
303
|
+
} else if (type === 'date') {
|
|
304
|
+
var _context8, _context9;
|
|
305
|
+
var propsObj = _objectSpread(_objectSpread({}, props), {}, {
|
|
306
|
+
onChange: (0, _bind["default"])(_context8 = _this2.onBlur).call(_context8, (0, _assertThisInitialized2["default"])(_this2), key),
|
|
307
|
+
onBlur: (0, _bind["default"])(_context9 = _this2.onExitValid).call(_context9, (0, _assertThisInitialized2["default"])(_this2), key)
|
|
308
|
+
});
|
|
309
|
+
if (_this2.props.onOpenChange && typeof _this2.props.onOpenChange === 'function') {
|
|
310
|
+
var _context10;
|
|
311
|
+
propsObj.onOpenChange = (0, _bind["default"])(_context10 = _this2.props.onOpenChange).call(_context10, (0, _assertThisInitialized2["default"])(_this2), key);
|
|
312
|
+
}
|
|
313
|
+
return propsObj;
|
|
314
|
+
} else if (type === 'captcha') {
|
|
315
|
+
var _context11, _context12, _context13;
|
|
316
|
+
return _objectSpread(_objectSpread({}, props), {}, {
|
|
317
|
+
onChange: (0, _bind["default"])(_context11 = _this2.onBlur).call(_context11, (0, _assertThisInitialized2["default"])(_this2), key),
|
|
318
|
+
onBlur: (0, _bind["default"])(_context12 = _this2.onExitValid).call(_context12, (0, _assertThisInitialized2["default"])(_this2), key),
|
|
319
|
+
onGetCode: (0, _bind["default"])(_context13 = _this2.onGetCode).call(_context13, (0, _assertThisInitialized2["default"])(_this2), key)
|
|
320
|
+
});
|
|
321
|
+
} else if (type === 'area') {
|
|
322
|
+
var _context14, _context15;
|
|
323
|
+
return _objectSpread(_objectSpread({}, props), {}, {
|
|
324
|
+
onChange: (0, _bind["default"])(_context14 = _this2.onBlur).call(_context14, (0, _assertThisInitialized2["default"])(_this2), key),
|
|
325
|
+
onBlur: (0, _bind["default"])(_context15 = _this2.onExitValid).call(_context15, (0, _assertThisInitialized2["default"])(_this2), key),
|
|
326
|
+
onAreaSearch: _this2.props.onAreaSearch
|
|
327
|
+
});
|
|
328
|
+
} else if (type === 'uploadImg') {
|
|
329
|
+
var _context16, _context17;
|
|
330
|
+
var _commonProps = _this2.props.buildSuperUploadProps ? _this2.props.buildSuperUploadProps() : {};
|
|
331
|
+
return _objectSpread(_objectSpread(_objectSpread({}, props), _commonProps), {}, {
|
|
332
|
+
onChange: (0, _bind["default"])(_context16 = _this2.onBlur).call(_context16, (0, _assertThisInitialized2["default"])(_this2), key),
|
|
333
|
+
onBlur: (0, _bind["default"])(_context17 = _this2.onExitValid).call(_context17, (0, _assertThisInitialized2["default"])(_this2), key)
|
|
334
|
+
});
|
|
335
|
+
} else if (type === 'double') {
|
|
336
|
+
return props;
|
|
337
|
+
} else {
|
|
338
|
+
var _context18, _context19;
|
|
339
|
+
return _objectSpread(_objectSpread({}, props), {}, {
|
|
340
|
+
onChange: (0, _bind["default"])(_context18 = _this2.onBlur).call(_context18, (0, _assertThisInitialized2["default"])(_this2), key),
|
|
341
|
+
onBlur: (0, _bind["default"])(_context19 = _this2.onExitValid).call(_context19, (0, _assertThisInitialized2["default"])(_this2), key)
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getControlProps", function (control, status) {
|
|
346
|
+
var _this2$props3 = _this2.props,
|
|
347
|
+
_this2$props3$value = _this2$props3.value,
|
|
348
|
+
value = _this2$props3$value === void 0 ? {} : _this2$props3$value,
|
|
349
|
+
readonly = _this2$props3.readonly;
|
|
350
|
+
var type = _this2.getType(control);
|
|
351
|
+
var props = _this2.specialProps(type, control);
|
|
352
|
+
return _objectSpread(_objectSpread({
|
|
353
|
+
autoFocus: !!status,
|
|
354
|
+
type: type
|
|
355
|
+
}, props), {}, {
|
|
356
|
+
size: defaultSize,
|
|
357
|
+
value: (0, _Control.makeString)(value[control.key])
|
|
358
|
+
});
|
|
359
|
+
});
|
|
360
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getOptions", function (key, options) {
|
|
361
|
+
var higher = _this2.props.options || {};
|
|
362
|
+
return higher[key] || options;
|
|
363
|
+
});
|
|
364
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toEmpty", function (props) {});
|
|
365
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toText", function (props) {
|
|
366
|
+
return /*#__PURE__*/_react["default"].createElement(Controlled, props);
|
|
367
|
+
});
|
|
368
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toPassword", function (props) {
|
|
369
|
+
return /*#__PURE__*/_react["default"].createElement(Controlled, props);
|
|
370
|
+
});
|
|
371
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toEditor", function (props, control) {
|
|
372
|
+
props.inputKey = control.key;
|
|
373
|
+
return /*#__PURE__*/_react["default"].createElement(Controlled, props);
|
|
374
|
+
});
|
|
375
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toSelectWriting", function (props, control) {
|
|
376
|
+
return /*#__PURE__*/_react["default"].createElement(Controlled, props);
|
|
377
|
+
});
|
|
378
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toTextArea", function (props, control) {
|
|
379
|
+
if (control.allFullFather) {
|
|
380
|
+
props.rows = control.rows;
|
|
381
|
+
props.maxLength = control.maxLength;
|
|
382
|
+
props.style = {
|
|
383
|
+
'resize': 'none'
|
|
384
|
+
};
|
|
385
|
+
} else {
|
|
386
|
+
props.autoSize = {
|
|
387
|
+
minRows: 1,
|
|
388
|
+
maxRows: 5
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
return /*#__PURE__*/_react["default"].createElement(Controlled, props);
|
|
392
|
+
});
|
|
393
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toNumber", function (props) {
|
|
394
|
+
props.defaultValue = props.value;
|
|
395
|
+
delete props.value;
|
|
396
|
+
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
397
|
+
});
|
|
398
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toDoubleInput", function (props, control, cc) {
|
|
399
|
+
var _context20, _context21;
|
|
400
|
+
props.defaultValue = props.value;
|
|
401
|
+
props.doubleKey = props.key;
|
|
402
|
+
props.doubleValue = _helper["default"].getObject(cc, props.key);
|
|
403
|
+
props.onChangeKey1 = (0, _bind["default"])(_context20 = _this2.onChange).call(_context20, (0, _assertThisInitialized2["default"])(_this2), props.key[0]);
|
|
404
|
+
props.onChangeKey2 = (0, _bind["default"])(_context21 = _this2.onChange).call(_context21, (0, _assertThisInitialized2["default"])(_this2), props.key[1]);
|
|
405
|
+
delete props.value;
|
|
406
|
+
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
407
|
+
});
|
|
408
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toSelect", function (props, _ref6) {
|
|
409
|
+
var options = _ref6.options,
|
|
410
|
+
key = _ref6.key;
|
|
411
|
+
props.getPopupContainer = _this2.getPopupContainer;
|
|
412
|
+
props.options = _this2.getOptions(key, options);
|
|
413
|
+
props.dropdownMatchSelectWidth = false;
|
|
414
|
+
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
415
|
+
});
|
|
416
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toTreeSelect", function (props, filter) {
|
|
417
|
+
var container = _this2.getContainer();
|
|
418
|
+
container && (props.getPopupContainer = container);
|
|
419
|
+
props.options = _this2.getOptions(filter);
|
|
420
|
+
props.onSearch = _this2.createSearchEvent(filter);
|
|
421
|
+
props.placeholder = filter.placeholder || '';
|
|
422
|
+
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
423
|
+
});
|
|
424
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "createSearchEvent", function (control) {
|
|
425
|
+
if (_this2.props.onSearch) {
|
|
426
|
+
return function (value) {
|
|
427
|
+
return _this2.props.onSearch(control.key, value, control);
|
|
428
|
+
};
|
|
429
|
+
} else {
|
|
430
|
+
return null;
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "createGetCodeEvent", function (control) {
|
|
434
|
+
if (_this2.props.onGetCode) {
|
|
435
|
+
return function (value) {
|
|
436
|
+
return _this2.props.onGetCode(control.key, value, control);
|
|
437
|
+
};
|
|
438
|
+
} else {
|
|
439
|
+
return null;
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toSearch", function (props, control) {
|
|
443
|
+
props.getPopupContainer = _this2.getPopupContainer;
|
|
444
|
+
props.options = _this2.getOptions(control.key, control.options);
|
|
445
|
+
props.onSearch = _this2.createSearchEvent(control);
|
|
446
|
+
props.dropdownMatchSelectWidth = false;
|
|
447
|
+
props.size = 'large';
|
|
448
|
+
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
449
|
+
});
|
|
450
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toDate", function (props, _ref7) {
|
|
451
|
+
var rule = _ref7.rule;
|
|
452
|
+
props.getCalendarContainer = _this2.getPopupContainer;
|
|
453
|
+
props.style = {
|
|
454
|
+
width: '100%'
|
|
455
|
+
};
|
|
456
|
+
rule && (props.disabledDate = _this2.validDate(rule));
|
|
457
|
+
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
458
|
+
});
|
|
459
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toRadioGroup", function (props, _ref8) {
|
|
460
|
+
var key = _ref8.key,
|
|
461
|
+
options = _ref8.options;
|
|
462
|
+
props.options = _this2.getOptions(key, options);
|
|
463
|
+
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
464
|
+
});
|
|
465
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "captcha", function (props, control) {
|
|
466
|
+
props.onGetCode = _this2.props.onGetCode;
|
|
467
|
+
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
468
|
+
});
|
|
469
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toReadonly", function (props, _ref9) {
|
|
470
|
+
var options = _ref9.options,
|
|
471
|
+
key = _ref9.key;
|
|
472
|
+
props.value = (0, _Control.getTitle)(props.value, _this2.getOptions(key, options));
|
|
473
|
+
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
474
|
+
});
|
|
475
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "selectSearch", function (props, control) {
|
|
476
|
+
props.getPopupContainer = _this2.getPopupContainer;
|
|
477
|
+
props.options = _this2.getOptions(control.key, control.options);
|
|
478
|
+
props.onSearch = _this2.createSearchEvent(control);
|
|
479
|
+
props.dropdownMatchSelectWidth = false;
|
|
480
|
+
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
481
|
+
});
|
|
482
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "area", function (props, _ref10) {
|
|
483
|
+
var key = _ref10.key,
|
|
484
|
+
options = _ref10.options;
|
|
485
|
+
var readonly = _this2.props.readonly;
|
|
486
|
+
props.parentKey = key;
|
|
487
|
+
props.options = _this2.getOptions(key, options);
|
|
488
|
+
props.dropdownMatchSelectWidth = false;
|
|
489
|
+
props.readonly = readonly === true || (0, _isArray["default"])(readonly) && (0, _some["default"])(readonly).call(readonly, function (readonlyKey) {
|
|
490
|
+
return readonlyKey === key;
|
|
491
|
+
}) ? true : false;
|
|
492
|
+
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
493
|
+
});
|
|
494
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "uploadImg", function (props, control) {
|
|
495
|
+
var _context22;
|
|
496
|
+
var readonly = _this2.props.readonly;
|
|
497
|
+
props.required = control.required || false;
|
|
498
|
+
props.onFileChange = (0, _bind["default"])(_context22 = _this2.onFileChange).call(_context22, (0, _assertThisInitialized2["default"])(_this2), control);
|
|
499
|
+
props.readonly = readonly === true || (0, _isArray["default"])(readonly) && (0, _some["default"])(readonly).call(readonly, function (readonlyKey) {
|
|
500
|
+
return readonlyKey === control.key;
|
|
501
|
+
}) ? true : false;
|
|
502
|
+
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
503
|
+
});
|
|
504
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCascader", function (props, control) {
|
|
505
|
+
var container = _this2.getContainer();
|
|
506
|
+
container && (props.getPopupContainer = container);
|
|
507
|
+
props.options = control.options || [];
|
|
508
|
+
props.onSearch = _this2.createSearchEvent(control);
|
|
509
|
+
props.placeholder = props.placeholder || '';
|
|
510
|
+
props.loadData = _this2.createSearchEvent(control);
|
|
511
|
+
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
512
|
+
});
|
|
513
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCheckbox", function (props, control) {
|
|
514
|
+
var _context23;
|
|
515
|
+
var options = control.options || [];
|
|
516
|
+
return /*#__PURE__*/_react["default"].createElement(_checkbox["default"].Group, {
|
|
517
|
+
options: options,
|
|
518
|
+
onChange: (0, _bind["default"])(_context23 = _this2.onBlur).call(_context23, (0, _assertThisInitialized2["default"])(_this2), control.key),
|
|
519
|
+
value: _this2.props.value[control.key]
|
|
520
|
+
});
|
|
521
|
+
});
|
|
522
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toControl", function (props, control) {
|
|
523
|
+
switch (props.type) {
|
|
524
|
+
case 'readonly':
|
|
525
|
+
return _this2.toReadonly(props, control);
|
|
526
|
+
case 'double':
|
|
527
|
+
return _this2.toDoubleInput(props, control, _this2.props.value);
|
|
528
|
+
case 'text':
|
|
529
|
+
return _this2.toText(props, control);
|
|
530
|
+
case 'number':
|
|
531
|
+
return _this2.toNumber(props, control);
|
|
532
|
+
case 'select':
|
|
533
|
+
case 'selectText':
|
|
534
|
+
return _this2.toSelect(props, control);
|
|
535
|
+
case 'search':
|
|
536
|
+
case 'searchText':
|
|
537
|
+
return _this2.toSearch(props, control);
|
|
538
|
+
case 'date':
|
|
539
|
+
return _this2.toDate(props, control);
|
|
540
|
+
case 'radioGroup':
|
|
541
|
+
return _this2.toRadioGroup(props, control);
|
|
542
|
+
case 'textArea':
|
|
543
|
+
return _this2.toTextArea(props, control);
|
|
544
|
+
case 'password':
|
|
545
|
+
return _this2.toPassword(props, control);
|
|
546
|
+
case 'editor':
|
|
547
|
+
return _this2.toEditor(props, control);
|
|
548
|
+
case 'selectWriting':
|
|
549
|
+
return _this2.toSelectWriting(props, control);
|
|
550
|
+
case 'selectSearch':
|
|
551
|
+
return _this2.selectSearch(props, control);
|
|
552
|
+
case 'empty':
|
|
553
|
+
return _this2.toEmpty(props, control);
|
|
554
|
+
case 'captcha':
|
|
555
|
+
return _this2.captcha(props, control);
|
|
556
|
+
case 'area':
|
|
557
|
+
return _this2.area(props, control);
|
|
558
|
+
case 'uploadImg':
|
|
559
|
+
return _this2.uploadImg(props, control);
|
|
560
|
+
case 'cascader':
|
|
561
|
+
return _this2.toCascader(props, control);
|
|
562
|
+
case 'treeSelect':
|
|
563
|
+
return _this2.toTreeSelect(props, control);
|
|
564
|
+
case 'checkbox':
|
|
565
|
+
return _this2.toCheckbox(props, control);
|
|
566
|
+
default:
|
|
567
|
+
return 'type error';
|
|
568
|
+
}
|
|
569
|
+
});
|
|
570
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toLabel", function (_ref11, type) {
|
|
571
|
+
var title = _ref11.title,
|
|
572
|
+
showAdd = _ref11.showAdd,
|
|
573
|
+
key = _ref11.key,
|
|
574
|
+
showInfo = _ref11.showInfo,
|
|
575
|
+
showInfoTitle = _ref11.showInfoTitle;
|
|
576
|
+
if (showAdd && type !== 'readonly') {
|
|
577
|
+
var _context24;
|
|
578
|
+
var onClick = (0, _bind["default"])(_context24 = _this2.onAdd).call(_context24, (0, _assertThisInitialized2["default"])(_this2), key, title);
|
|
579
|
+
return /*#__PURE__*/_react["default"].createElement("span", null, title, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
580
|
+
role: "add",
|
|
581
|
+
type: "plus-circle-o",
|
|
582
|
+
onClick: onClick
|
|
583
|
+
}));
|
|
584
|
+
} else if (showInfo) {
|
|
585
|
+
return /*#__PURE__*/_react["default"].createElement("span", null, title, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
586
|
+
title: showInfoTitle
|
|
587
|
+
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
588
|
+
type: "info-circle"
|
|
589
|
+
})));
|
|
590
|
+
} else {
|
|
591
|
+
return title;
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCol", function (span, control) {
|
|
595
|
+
var factor = control.span || 1;
|
|
596
|
+
var status = _this2.getValidState(control);
|
|
597
|
+
var controlProps = _this2.getControlProps(control, status);
|
|
598
|
+
var itemProps = {
|
|
599
|
+
label: _this2.toLabel(control, controlProps.type),
|
|
600
|
+
required: control.required,
|
|
601
|
+
validateStatus: status
|
|
602
|
+
};
|
|
603
|
+
var _this2$props4 = _this2.props,
|
|
604
|
+
checkable = _this2$props4.checkable,
|
|
605
|
+
onCheckItem = _this2$props4.onCheckItem;
|
|
606
|
+
return control.type !== 'empty' ? /*#__PURE__*/_react["default"].createElement(_col["default"], {
|
|
607
|
+
span: span * factor,
|
|
608
|
+
key: control.key
|
|
609
|
+
}, checkable && /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
|
|
610
|
+
className: (0, _variables["default"])('SuperForm2').checkbox,
|
|
611
|
+
onChange: (0, _bind["default"])(onCheckItem).call(onCheckItem, (0, _assertThisInitialized2["default"])(_this2), control),
|
|
612
|
+
checked: control.checked
|
|
613
|
+
}), /*#__PURE__*/_react["default"].createElement(FormItem, (0, _extends2["default"])({}, itemProps, {
|
|
614
|
+
className: checkable ? (0, _variables["default"])('SuperForm2').formItemWithCheckbox : '',
|
|
615
|
+
labelCol: {
|
|
616
|
+
xs: {
|
|
617
|
+
span: 24
|
|
618
|
+
},
|
|
619
|
+
sm: {
|
|
620
|
+
span: 8
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
wrapperCol: {
|
|
624
|
+
xs: {
|
|
625
|
+
span: 24
|
|
626
|
+
},
|
|
627
|
+
sm: {
|
|
628
|
+
span: 16
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}), _this2.toControl(controlProps, control))) : /*#__PURE__*/_react["default"].createElement(_col["default"], {
|
|
632
|
+
span: span * factor,
|
|
633
|
+
key: control.key,
|
|
634
|
+
style: {
|
|
635
|
+
height: '44px'
|
|
636
|
+
}
|
|
637
|
+
});
|
|
638
|
+
});
|
|
639
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCols", function () {
|
|
640
|
+
var _context25;
|
|
641
|
+
var _this2$props5 = _this2.props,
|
|
642
|
+
_this2$props5$colNum = _this2$props5.colNum,
|
|
643
|
+
colNum = _this2$props5$colNum === void 0 ? defaultColNum : _this2$props5$colNum,
|
|
644
|
+
allFullFather = _this2$props5.allFullFather;
|
|
645
|
+
if (allFullFather) {
|
|
646
|
+
colNum = 1;
|
|
647
|
+
}
|
|
648
|
+
var span = 24 / colNum;
|
|
649
|
+
return (0, _map["default"])(_context25 = _this2.getControls()).call(_context25, function (control) {
|
|
650
|
+
if (allFullFather) {
|
|
651
|
+
control.allFullFather = allFullFather;
|
|
652
|
+
}
|
|
653
|
+
return _this2.toCol(span, control);
|
|
654
|
+
});
|
|
655
|
+
});
|
|
656
|
+
return _this2;
|
|
657
|
+
}
|
|
658
|
+
(0, _createClass2["default"])(SuperForm2, [{
|
|
659
|
+
key: "render",
|
|
660
|
+
value: function render() {
|
|
661
|
+
this.initValidState();
|
|
662
|
+
var _this$props$layout = this.props.layout,
|
|
663
|
+
layout = _this$props$layout === void 0 ? 'horizontal' : _this$props$layout;
|
|
664
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
665
|
+
className: (0, _variables["default"])('SuperForm2')
|
|
666
|
+
}, /*#__PURE__*/_react["default"].createElement(_form["default"], {
|
|
667
|
+
layout: layout,
|
|
668
|
+
style: {
|
|
669
|
+
maxWidth: this.props.allFullFather ? '100%' : this.getMaxWidth()
|
|
670
|
+
}
|
|
671
|
+
}, /*#__PURE__*/_react["default"].createElement(_row["default"], {
|
|
672
|
+
gutter: 20
|
|
673
|
+
}, this.toCols())));
|
|
674
|
+
}
|
|
675
|
+
}]);
|
|
676
|
+
return SuperForm2;
|
|
677
|
+
}(_react["default"].Component);
|
|
678
|
+
(0, _defineProperty2["default"])(SuperForm2, "propTypes", {
|
|
679
|
+
controls: _propTypes["default"].arrayOf(_propTypes["default"].shape(ControlType)).isRequired,
|
|
680
|
+
value: _propTypes["default"].object,
|
|
681
|
+
colNum: _propTypes["default"].number,
|
|
682
|
+
valid: _propTypes["default"].bool,
|
|
683
|
+
readonly: _propTypes["default"].oneOfType([_propTypes["default"].bool, _propTypes["default"].array]),
|
|
684
|
+
hideControls: _propTypes["default"].array,
|
|
685
|
+
options: _propTypes["default"].object,
|
|
686
|
+
onChange: _propTypes["default"].func,
|
|
687
|
+
onSearch: _propTypes["default"].func,
|
|
688
|
+
onExitValid: _propTypes["default"].func,
|
|
689
|
+
onAdd: _propTypes["default"].func,
|
|
690
|
+
checkable: _propTypes["default"].bool,
|
|
691
|
+
onOpenChange: _propTypes["default"].func,
|
|
692
|
+
onGetCode: _propTypes["default"].func,
|
|
693
|
+
onFileChange: _propTypes["default"].func,
|
|
694
|
+
onAreaSearch: _propTypes["default"].func,
|
|
695
|
+
buildSuperUploadProps: _propTypes["default"].func,
|
|
696
|
+
//构建type===uploadImg时,SuperUpload组件需要的公共属性函数,已在项目公共文件state.js中提供,可直接引用
|
|
697
|
+
layout: _propTypes["default"].string
|
|
698
|
+
});
|
|
699
|
+
var _default = exports["default"] = SuperForm2;
|