cloud-b2b 1.0.2 → 1.0.3

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.
Files changed (50) hide show
  1. package/es/Area/Area.js +166 -0
  2. package/es/Area/package.json +6 -0
  3. package/es/Control/Control.js +27 -1
  4. package/es/Header/Header.js +1 -1
  5. package/es/Header/Header.less +12 -11
  6. package/es/HomeHeader/Header.less +1 -1
  7. package/es/Sidebar/Sidebar.js +2 -2
  8. package/es/Sidebar/Sidebar.less +10 -9
  9. package/es/SuperForm/SuperForm.js +74 -27
  10. package/es/SuperTable/DragSortRow.js +125 -0
  11. package/es/SuperTable/DragSortRow.less +17 -0
  12. package/es/SuperTable/FilterDropDown.js +188 -0
  13. package/es/SuperTable/FilterDropDown.less +30 -0
  14. package/es/SuperTable/SuperTable.js +933 -0
  15. package/es/SuperTable/SuperTable.less +135 -0
  16. package/es/SuperTable/fixed.js +42 -0
  17. package/es/SuperTable/package.json +6 -0
  18. package/es/SuperTable2/SuperTable2.js +700 -0
  19. package/es/SuperTable2/SuperTable2.less +100 -0
  20. package/es/SuperTable2/SuperTableCell.js +215 -0
  21. package/es/SuperTable2/package.json +6 -0
  22. package/es/adjust.less +89 -0
  23. package/es/index.js +4 -1
  24. package/es/style.less +20 -1
  25. package/lib/Area/Area.js +194 -0
  26. package/lib/Area/package.json +6 -0
  27. package/lib/Control/Control.js +29 -1
  28. package/lib/Header/Header.js +1 -1
  29. package/lib/Header/Header.less +12 -11
  30. package/lib/HomeHeader/Header.less +1 -1
  31. package/lib/Sidebar/Sidebar.js +2 -2
  32. package/lib/Sidebar/Sidebar.less +10 -9
  33. package/lib/SuperForm/SuperForm.js +72 -27
  34. package/lib/SuperTable/DragSortRow.js +142 -0
  35. package/lib/SuperTable/DragSortRow.less +17 -0
  36. package/lib/SuperTable/FilterDropDown.js +205 -0
  37. package/lib/SuperTable/FilterDropDown.less +30 -0
  38. package/lib/SuperTable/SuperTable.js +937 -0
  39. package/lib/SuperTable/SuperTable.less +135 -0
  40. package/lib/SuperTable/fixed.js +55 -0
  41. package/lib/SuperTable/package.json +6 -0
  42. package/lib/SuperTable2/SuperTable2.js +725 -0
  43. package/lib/SuperTable2/SuperTable2.less +100 -0
  44. package/lib/SuperTable2/SuperTableCell.js +231 -0
  45. package/lib/SuperTable2/package.json +6 -0
  46. package/lib/adjust.less +89 -0
  47. package/lib/index.js +28 -1
  48. package/lib/index.less +5 -0
  49. package/lib/style.less +20 -1
  50. package/package.json +1 -1
@@ -0,0 +1,166 @@
1
+ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
2
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
3
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
4
+ import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
5
+ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
6
+ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
7
+ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
8
+ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
9
+ import _Row from "antd/es/row";
10
+ import _Col from "antd/es/col";
11
+ import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
12
+ import _createClass from "@babel/runtime-corejs3/helpers/createClass";
13
+ import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
14
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
15
+ import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
16
+ import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
17
+ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
18
+
19
+ 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; }
20
+
21
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
22
+
23
+ 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); }; }
24
+
25
+ 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; } }
26
+
27
+ import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
28
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
29
+ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
30
+ import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
31
+ import React from 'react';
32
+ import PropTypes from 'prop-types';
33
+ import helper from '../helper';
34
+ import Control from '../Control';
35
+ var PROPS = {
36
+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]),
37
+ onChange: PropTypes.func,
38
+ onBlur: PropTypes.func,
39
+ onParentChange: PropTypes.func,
40
+ child: PropTypes.Array
41
+ };
42
+
43
+ var PROPS_KEYS = _Object$keys(PROPS);
44
+
45
+ var Area = /*#__PURE__*/function (_React$Component) {
46
+ _inherits(Area, _React$Component);
47
+
48
+ var _super = _createSuper(Area);
49
+
50
+ function Area(props) {
51
+ var _this;
52
+
53
+ _classCallCheck(this, Area);
54
+
55
+ _this = _super.call(this, props);
56
+
57
+ _defineProperty(_assertThisInitialized(_this), "onChange", function (key, keyValue) {
58
+ var _this$props = _this.props,
59
+ onParentChange = _this$props.onParentChange,
60
+ child = _this$props.child,
61
+ value = _this$props.value;
62
+ var newValue = {};
63
+ newValue[key] = keyValue;
64
+ var CheckValue, checkIndex;
65
+
66
+ _mapInstanceProperty(child).call(child, function (item, index) {
67
+ if (item.key === key) {
68
+ checkIndex = index;
69
+ }
70
+
71
+ CheckValue = index > checkIndex ? '' : value[item.key];
72
+ newValue[item.key] = item.key === key ? keyValue : CheckValue;
73
+ });
74
+
75
+ _this.setState({
76
+ value: _objectSpread(_objectSpread({}, _this.state.value), newValue)
77
+ }, function () {
78
+ return onParentChange && onParentChange(_this.state.value);
79
+ });
80
+ });
81
+
82
+ _defineProperty(_assertThisInitialized(_this), "onSearch", function (key, control, parentKey, KeyValue) {
83
+ var _this$props2 = _this.props,
84
+ onAreaSearch = _this$props2.onAreaSearch,
85
+ child = _this$props2.child,
86
+ value = _this$props2.value;
87
+ var flag = true;
88
+
89
+ _mapInstanceProperty(child).call(child, function (item, index) {
90
+ if (item.key === key && index !== 0) {
91
+ var upKey = child[index - 1].key;
92
+
93
+ if (index !== 0 && (helper.isEmpty2(value[upKey]) || _Object$keys(value[upKey]).length === 0)) {
94
+ flag = false;
95
+ }
96
+
97
+ ;
98
+ }
99
+ });
100
+
101
+ return flag ? onAreaSearch && onAreaSearch(key, KeyValue, parentKey) : helper.showError('请输入上级选择器');
102
+ });
103
+
104
+ _this.state = {
105
+ value: props.value || {},
106
+ options: props.options || {}
107
+ };
108
+ return _this;
109
+ }
110
+
111
+ _createClass(Area, [{
112
+ key: "componentWillReceiveProps",
113
+ value: function componentWillReceiveProps(props) {
114
+ if (props.value !== this.props.value) {
115
+ this.setState({
116
+ value: props.value
117
+ });
118
+ }
119
+ }
120
+ }, {
121
+ key: "render",
122
+ value: function render() {
123
+ var _this2 = this;
124
+
125
+ var _this$props3 = this.props,
126
+ child = _this$props3.child,
127
+ parentKey = _this$props3.parentKey,
128
+ _this$props3$options = _this$props3.options,
129
+ options = _this$props3$options === void 0 ? {} : _this$props3$options,
130
+ _this$props3$readonly = _this$props3.readonly,
131
+ readonly = _this$props3$readonly === void 0 ? false : _this$props3$readonly,
132
+ value = _this$props3.value;
133
+ return /*#__PURE__*/React.createElement(_Row, null, _mapInstanceProperty(child).call(child, function (item, index) {
134
+ var _context, _context2, _context3;
135
+
136
+ var childOptions = [];
137
+
138
+ if (_includesInstanceProperty(_context = _Object$keys(options)).call(_context, item.key)) {
139
+ if (index === 0) {
140
+ childOptions = options[item.key];
141
+ } else {
142
+ var upKey = child[index - 1].key;
143
+ childOptions = helper.isEmpty2(value[upKey]) || _Object$keys(value[upKey]).length === 0 ? [] : options[item.key];
144
+ }
145
+ }
146
+
147
+ var props = _objectSpread(_objectSpread({}, item), {}, {
148
+ onSearch: _bindInstanceProperty(_context2 = _this2.onSearch).call(_context2, _this2, item.key, item, parentKey),
149
+ onChange: _bindInstanceProperty(_context3 = _this2.onChange).call(_context3, _this2, item.key),
150
+ options: childOptions,
151
+ value: _this2.props.value[item.key].title ? _this2.props.value[item.key].title : _this2.props.value[item.key],
152
+ type: readonly ? 'readonly' : item.type
153
+ });
154
+
155
+ return /*#__PURE__*/React.createElement(_Col, {
156
+ span: 24 / child.length,
157
+ key: item.key
158
+ }, /*#__PURE__*/React.createElement(Control, props));
159
+ }));
160
+ }
161
+ }]);
162
+
163
+ return Area;
164
+ }(React.Component);
165
+
166
+ export default Area;
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "Area",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./Area.js"
6
+ }
@@ -39,6 +39,8 @@ import InputEditor from '../InputEditor';
39
39
  import InputSelect from '../InputSelect';
40
40
  import InputWriting from '../InputWriting';
41
41
  import InpurCascader from '../InpurCascader';
42
+ import SuperUpload from '../SuperUpload';
43
+ import Area from '../Area';
42
44
  import moment from 'moment';
43
45
  import eventWrapper from './event';
44
46
  var SelectOption = _Select.Option;
@@ -308,6 +310,28 @@ var editor = function editor(props) {
308
310
  var cascader = function cascader(props) {
309
311
  !props.value && typeof props.value !== 'undefined' && (props.value = []);
310
312
  return /*#__PURE__*/React.createElement(InpurCascader, props);
313
+ };
314
+
315
+ var area = function area(props) {
316
+ var areaProps = _objectSpread(_objectSpread({}, props), {}, {
317
+ onParentChange: props.onChange
318
+ });
319
+
320
+ return /*#__PURE__*/React.createElement(Area, areaProps);
321
+ };
322
+
323
+ var uploadImg = function uploadImg(props) {
324
+ var uploadProps = {
325
+ fileList: props.value || [],
326
+ required: props.require,
327
+ multiple: false,
328
+ limitNumber: props.limitNumber || 10,
329
+ onFileChange: props.onFileChange,
330
+ needText: props.needText,
331
+ remark: props.remark,
332
+ readonly: props.readonly || false
333
+ };
334
+ return /*#__PURE__*/React.createElement(SuperUpload, uploadProps);
311
335
  }; // 支持的控件类型
312
336
 
313
337
 
@@ -326,7 +350,9 @@ var controls = {
326
350
  editor: editor,
327
351
  selectSearch: selectSearch,
328
352
  selectWriting: selectWriting,
329
- cascader: cascader
353
+ cascader: cascader,
354
+ area: area,
355
+ uploadImg: uploadImg
330
356
  };
331
357
 
332
358
  var Control = function Control(_ref4) {
@@ -116,7 +116,7 @@ var Header = /*#__PURE__*/function (_React$Component) {
116
116
 
117
117
  _defineProperty(_assertThisInitialized(_this), "menu", function (hasImport) {
118
118
  return /*#__PURE__*/React.createElement(_Menu, {
119
- className: s.menu,
119
+ className: variables('Header').menu,
120
120
  onClick: _this.onMenuItemClick
121
121
  }, /*#__PURE__*/React.createElement(MenuItem, {
122
122
  key: "person"
@@ -78,17 +78,18 @@
78
78
  top: -2px;
79
79
  }
80
80
  }
81
- }
82
-
83
- .menu {
84
- :global {
85
- .ant-dropdown-menu-item {
86
- padding: 8px 20px;
87
- }
88
-
89
- .ant-dropdown-menu-item-group-title {
90
- padding: 6px 20px;
91
- color: #333;
81
+ .menu {
82
+ :global {
83
+ .ant-dropdown-menu-item {
84
+ padding: 8px 20px;
85
+ }
86
+
87
+ .ant-dropdown-menu-item-group-title {
88
+ padding: 6px 20px;
89
+ color: #333;
90
+ }
92
91
  }
93
92
  }
94
93
  }
94
+
95
+
@@ -8,7 +8,7 @@
8
8
  height: @header-height;
9
9
  line-height: @header-height - @one-pixel * 6;
10
10
  text-align: center;
11
- background: url('/platformHome/head_bg.png') no-repeat;
11
+ //background: url('/platformHome/head_bg.png') no-repeat;
12
12
  background-size: 100% 100%;
13
13
  color: #33EDFC;
14
14
  font-size: @one-pixel * 32;
@@ -116,9 +116,9 @@ var Sidebar = /*#__PURE__*/function (_React$Component) {
116
116
  }, /*#__PURE__*/React.createElement(Link, {
117
117
  to: href,
118
118
  title: title,
119
- className: s.unreadTotalLink
119
+ className: variables('Sidebar').unreadTotalLink
120
120
  }, _this.toIcon(icon), title, unreadTotal && unreadTotal > 0 && /*#__PURE__*/React.createElement("span", {
121
- className: s.unreadTotal
121
+ className: variables('Sidebar').unreadTotalLink.unreadTotal
122
122
  }, unreadTotal)));
123
123
  }
124
124
  });
@@ -62,16 +62,17 @@
62
62
  }
63
63
  }
64
64
  }
65
+ .unreadTotalLink {
66
+ position: relative;
67
+
68
+ .unreadTotal{
69
+ color: orangered;
70
+ float: right;
71
+ position: absolute;
72
+ right: 5px;
73
+ }
74
+ }
65
75
  }
66
76
 
67
77
 
68
- .unreadTotalLink {
69
- position: relative;
70
78
 
71
- .unreadTotal{
72
- color: orangered;
73
- float: right;
74
- position: absolute;
75
- right: 5px;
76
- }
77
- }
@@ -30,7 +30,7 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
30
30
 
31
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
32
 
33
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context13, _context14; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context13 = ownKeys(Object(source), !0)).call(_context13, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context14 = ownKeys(Object(source))).call(_context14, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
33
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context17, _context18; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context17 = ownKeys(Object(source), !0)).call(_context17, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context18 = ownKeys(Object(source))).call(_context18, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
34
34
 
35
35
  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); }; }
36
36
 
@@ -45,7 +45,7 @@ import variables from '../variables';
45
45
  var FormItem = _Form.Item;
46
46
  var defaultSize = 'small';
47
47
  var defaultColNum = 4;
48
- var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty'];
48
+ var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'area', 'uploadImg'];
49
49
  /**
50
50
  * key:[必须],用于唯一标识该Form下的一个表单元素
51
51
  * title:[必须],表单元素的标签
@@ -132,6 +132,8 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
132
132
  * onAdd: 点击+号时触发,原型为func(key)
133
133
  * checkable:是否显示checkbox选择框
134
134
  * onOpenChange:控制日期框显示隐藏回调func(key, open)
135
+ * onAreaSearch:联级选择器触发,原型为func(key - 当前联级key, title - 输入值, parentKey - 主体联级key)
136
+ * OnFileChange:上传组件触发,原型为func(key,{fileList, fileDeleteList})
135
137
  */
136
138
 
137
139
 
@@ -271,11 +273,15 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
271
273
  });
272
274
 
273
275
  _defineProperty(_assertThisInitialized(_this2), "getType", function (_ref3) {
276
+ var _context2;
277
+
274
278
  var key = _ref3.key,
275
279
  type = _ref3.type;
276
280
  var readonly = _this2.props.readonly;
277
281
 
278
- if (!readonly) {
282
+ if (_includesInstanceProperty(_context2 = ['area', 'uploadImg']).call(_context2, type)) {
283
+ return type;
284
+ } else if (!readonly) {
279
285
  return type;
280
286
  } else if (readonly === true) {
281
287
  return 'readonly';
@@ -305,50 +311,58 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
305
311
  };
306
312
 
307
313
  if (originType === 'textArea') {
308
- var _context2;
314
+ var _context3;
309
315
 
310
316
  return {
311
317
  type: 'textArea',
312
318
  readonly: true,
313
319
  style: style,
314
- onBlur: _bindInstanceProperty(_context2 = _this2.onExitValid).call(_context2, _assertThisInitialized(_this2), key)
320
+ onBlur: _bindInstanceProperty(_context3 = _this2.onExitValid).call(_context3, _assertThisInitialized(_this2), key)
315
321
  };
316
322
  } else {
317
- var _context3;
323
+ var _context4;
318
324
 
319
325
  return {
320
326
  style: style,
321
- onBlur: _bindInstanceProperty(_context3 = _this2.onExitValid).call(_context3, _assertThisInitialized(_this2), key)
327
+ onBlur: _bindInstanceProperty(_context4 = _this2.onExitValid).call(_context4, _assertThisInitialized(_this2), key)
322
328
  };
323
329
  }
324
330
  } else if (type === 'text' || type === 'textArea') {
325
- var _context4, _context5;
331
+ var _context5, _context6;
326
332
 
327
333
  return _objectSpread(_objectSpread({}, props), {}, {
328
- onChange: _bindInstanceProperty(_context4 = _this2.onExitValid).call(_context4, _assertThisInitialized(_this2), key),
329
- onBlur: _bindInstanceProperty(_context5 = _this2.onChange).call(_context5, _assertThisInitialized(_this2), key)
334
+ onChange: _bindInstanceProperty(_context5 = _this2.onExitValid).call(_context5, _assertThisInitialized(_this2), key),
335
+ onBlur: _bindInstanceProperty(_context6 = _this2.onChange).call(_context6, _assertThisInitialized(_this2), key)
330
336
  });
331
337
  } else if (type === 'date') {
332
- var _context6, _context7;
338
+ var _context7, _context8;
333
339
 
334
340
  var propsObj = _objectSpread(_objectSpread({}, props), {}, {
335
- onChange: _bindInstanceProperty(_context6 = _this2.onBlur).call(_context6, _assertThisInitialized(_this2), key),
336
- onBlur: _bindInstanceProperty(_context7 = _this2.onExitValid).call(_context7, _assertThisInitialized(_this2), key)
341
+ onChange: _bindInstanceProperty(_context7 = _this2.onBlur).call(_context7, _assertThisInitialized(_this2), key),
342
+ onBlur: _bindInstanceProperty(_context8 = _this2.onExitValid).call(_context8, _assertThisInitialized(_this2), key)
337
343
  });
338
344
 
339
345
  if (_this2.props.onOpenChange && typeof _this2.props.onOpenChange === 'function') {
340
- var _context8;
346
+ var _context9;
341
347
 
342
- propsObj.onOpenChange = _bindInstanceProperty(_context8 = _this2.props.onOpenChange).call(_context8, _assertThisInitialized(_this2), key);
348
+ propsObj.onOpenChange = _bindInstanceProperty(_context9 = _this2.props.onOpenChange).call(_context9, _assertThisInitialized(_this2), key);
343
349
  }
344
350
 
345
351
  return propsObj;
352
+ } else if (type === 'area') {
353
+ var _context10, _context11;
354
+
355
+ return _objectSpread(_objectSpread({}, props), {}, {
356
+ onChange: _bindInstanceProperty(_context10 = _this2.onBlur).call(_context10, _assertThisInitialized(_this2), key),
357
+ onBlur: _bindInstanceProperty(_context11 = _this2.onExitValid).call(_context11, _assertThisInitialized(_this2), key),
358
+ onAreaSearch: _this2.props.onAreaSearch
359
+ });
346
360
  } else {
347
- var _context9, _context10;
361
+ var _context12, _context13;
348
362
 
349
363
  return _objectSpread(_objectSpread({}, props), {}, {
350
- onChange: _bindInstanceProperty(_context9 = _this2.onBlur).call(_context9, _assertThisInitialized(_this2), key),
351
- onBlur: _bindInstanceProperty(_context10 = _this2.onExitValid).call(_context10, _assertThisInitialized(_this2), key)
364
+ onChange: _bindInstanceProperty(_context12 = _this2.onBlur).call(_context12, _assertThisInitialized(_this2), key),
365
+ onBlur: _bindInstanceProperty(_context13 = _this2.onExitValid).call(_context13, _assertThisInitialized(_this2), key)
352
366
  });
353
367
  }
354
368
  });
@@ -476,6 +490,31 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
476
490
  return /*#__PURE__*/React.createElement(Control, props);
477
491
  });
478
492
 
493
+ _defineProperty(_assertThisInitialized(_this2), "area", function (props, _ref9) {
494
+ var key = _ref9.key,
495
+ options = _ref9.options;
496
+ var readonly = _this2.props.readonly;
497
+ props.parentKey = key;
498
+ props.options = _this2.getOptions(key, options);
499
+ props.dropdownMatchSelectWidth = false;
500
+ props.readonly = readonly === true || _Array$isArray(readonly) && _someInstanceProperty(readonly).call(readonly, function (readonlyKey) {
501
+ return readonlyKey === key;
502
+ }) ? true : false;
503
+ return /*#__PURE__*/React.createElement(Control, props);
504
+ });
505
+
506
+ _defineProperty(_assertThisInitialized(_this2), "uploadImg", function (props, control) {
507
+ var _context14;
508
+
509
+ var readonly = _this2.props.readonly;
510
+ props.required = control.required || false;
511
+ props.onFileChange = _bindInstanceProperty(_context14 = _this2.onFileChange).call(_context14, _assertThisInitialized(_this2), control);
512
+ props.readonly = readonly === true || _Array$isArray(readonly) && _someInstanceProperty(readonly).call(readonly, function (readonlyKey) {
513
+ return readonlyKey === control.key;
514
+ }) ? true : false;
515
+ return /*#__PURE__*/React.createElement(Control, props);
516
+ });
517
+
479
518
  _defineProperty(_assertThisInitialized(_this2), "toControl", function (props, control) {
480
519
  switch (props.type) {
481
520
  case 'readonly':
@@ -519,20 +558,26 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
519
558
  case 'empty':
520
559
  return _this2.toEmpty(props, control);
521
560
 
561
+ case 'area':
562
+ return _this2.area(props, control);
563
+
564
+ case 'uploadImg':
565
+ return _this2.uploadImg(props, control);
566
+
522
567
  default:
523
568
  return 'type error';
524
569
  }
525
570
  });
526
571
 
527
- _defineProperty(_assertThisInitialized(_this2), "toLabel", function (_ref9, type) {
528
- var title = _ref9.title,
529
- showAdd = _ref9.showAdd,
530
- key = _ref9.key;
572
+ _defineProperty(_assertThisInitialized(_this2), "toLabel", function (_ref10, type) {
573
+ var title = _ref10.title,
574
+ showAdd = _ref10.showAdd,
575
+ key = _ref10.key;
531
576
 
532
577
  if (showAdd && type !== 'readonly') {
533
- var _context11;
578
+ var _context15;
534
579
 
535
- var onClick = _bindInstanceProperty(_context11 = _this2.onAdd).call(_context11, _assertThisInitialized(_this2), key, title);
580
+ var onClick = _bindInstanceProperty(_context15 = _this2.onAdd).call(_context15, _assertThisInitialized(_this2), key, title);
536
581
 
537
582
  return /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(_Icon, {
538
583
  role: "add",
@@ -578,7 +623,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
578
623
  });
579
624
 
580
625
  _defineProperty(_assertThisInitialized(_this2), "toCols", function () {
581
- var _context12;
626
+ var _context16;
582
627
 
583
628
  var _this2$props4 = _this2.props,
584
629
  _this2$props4$colNum = _this2$props4.colNum,
@@ -590,7 +635,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
590
635
  }
591
636
 
592
637
  var span = 24 / colNum;
593
- return _mapInstanceProperty(_context12 = _this2.getControls()).call(_context12, function (control) {
638
+ return _mapInstanceProperty(_context16 = _this2.getControls()).call(_context16, function (control) {
594
639
  if (allFullFather) {
595
640
  control.allFullFather = allFullFather;
596
641
  }
@@ -635,7 +680,9 @@ _defineProperty(SuperForm, "propTypes", {
635
680
  onExitValid: PropTypes.func,
636
681
  onAdd: PropTypes.func,
637
682
  checkable: PropTypes.bool,
638
- onOpenChange: PropTypes.func
683
+ onOpenChange: PropTypes.func,
684
+ onAreaSearch: PropTypes.func,
685
+ OnFileChange: PropTypes.func
639
686
  });
640
687
 
641
688
  export default SuperForm;
@@ -0,0 +1,125 @@
1
+ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
2
+ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWithoutProperties";
3
+ import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
4
+ import _createClass from "@babel/runtime-corejs3/helpers/createClass";
5
+ import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
6
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
7
+ import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
8
+ import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
9
+ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
10
+ var _excluded = ["onMoveRow", "index", "className"];
11
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
12
+ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
13
+
14
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
15
+
16
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
17
+
18
+ import React from 'react';
19
+ import variables from '../variables';
20
+ var dragIndex = -1;
21
+
22
+ var DragSortRow = /*#__PURE__*/function (_React$Component) {
23
+ _inherits(DragSortRow, _React$Component);
24
+
25
+ var _super = _createSuper(DragSortRow);
26
+
27
+ function DragSortRow() {
28
+ var _context, _context2;
29
+
30
+ var _this;
31
+
32
+ _classCallCheck(this, DragSortRow);
33
+
34
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
35
+ args[_key] = arguments[_key];
36
+ }
37
+
38
+ _this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
39
+
40
+ _defineProperty(_assertThisInitialized(_this), "state", {
41
+ dragIndex: -1,
42
+ firefox: _includesInstanceProperty(_context2 = navigator.userAgent).call(_context2, 'Firefox')
43
+ });
44
+
45
+ _defineProperty(_assertThisInitialized(_this), "onDragStart", function (e) {
46
+ dragIndex = _this.props.index;
47
+
48
+ if (_this.state.firefox) {
49
+ // 火狐浏览器必须调用setData
50
+ e.dataTransfer.setData('text/plain', 'DragSortRow');
51
+ }
52
+ });
53
+
54
+ _defineProperty(_assertThisInitialized(_this), "onDragEnd", function () {
55
+ dragIndex = -1;
56
+ });
57
+
58
+ _defineProperty(_assertThisInitialized(_this), "onDragOver", function (e) {
59
+ if (dragIndex > -1 && dragIndex !== _this.props.index) {
60
+ e.preventDefault();
61
+
62
+ if (_this.state.dragIndex !== dragIndex) {
63
+ _this.setState({
64
+ dragIndex: dragIndex
65
+ });
66
+ }
67
+ }
68
+ });
69
+
70
+ _defineProperty(_assertThisInitialized(_this), "onDragLeave", function () {
71
+ _this.setState({
72
+ dragIndex: -1
73
+ });
74
+ });
75
+
76
+ _defineProperty(_assertThisInitialized(_this), "onDrop", function (e) {
77
+ var dragIndex = _this.state.dragIndex;
78
+
79
+ _this.setState({
80
+ dragIndex: -1
81
+ });
82
+
83
+ _this.props.onMoveRow(dragIndex, _this.props.index); // 火狐浏览器默认会打开一个新窗口,此处阻止其打开
84
+
85
+
86
+ if (_this.state.firefox) {
87
+ e.preventDefault();
88
+ }
89
+ });
90
+
91
+ return _this;
92
+ }
93
+
94
+ _createClass(DragSortRow, [{
95
+ key: "render",
96
+ value: function render() {
97
+ var _context3;
98
+
99
+ var _this$props = this.props,
100
+ onMoveRow = _this$props.onMoveRow,
101
+ index = _this$props.index,
102
+ className = _this$props.className,
103
+ restProps = _objectWithoutProperties(_this$props, _excluded);
104
+
105
+ var dragIndex = this.state.dragIndex;
106
+ restProps.className = _concatInstanceProperty(_context3 = "".concat(className, " ")).call(_context3, variables('DragSortRow'));
107
+ restProps.draggable = true;
108
+ restProps.onDragStart = this.onDragStart;
109
+ restProps.onDragEnd = this.onDragEnd;
110
+ restProps.onDragOver = this.onDragOver;
111
+ restProps.onDragLeave = this.onDragLeave;
112
+ restProps.onDrop = this.onDrop;
113
+
114
+ if (dragIndex > -1) {
115
+ restProps['data-drag-hover'] = dragIndex > index ? 'up' : 'down';
116
+ }
117
+
118
+ return /*#__PURE__*/React.createElement("tr", restProps);
119
+ }
120
+ }]);
121
+
122
+ return DragSortRow;
123
+ }(React.Component);
124
+
125
+ export default DragSortRow;
@@ -0,0 +1,17 @@
1
+ @import '../../components/variables';
2
+
3
+ .@{cloudlink-prefix}-DragSortRow {
4
+ cursor: move;
5
+
6
+ &[data-drag-hover='up'] {
7
+ td {
8
+ border-top: 2px dashed @primary-color !important;
9
+ }
10
+ }
11
+
12
+ &[data-drag-hover='down'] {
13
+ td {
14
+ border-bottom: 2px dashed @primary-color !important;
15
+ }
16
+ }
17
+ }