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