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