cloud-b2b 1.1.4 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/Area/Area.js
CHANGED
|
@@ -58,7 +58,8 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
58
58
|
var _this$props = _this.props,
|
|
59
59
|
onParentChange = _this$props.onParentChange,
|
|
60
60
|
child = _this$props.child,
|
|
61
|
-
value = _this$props.value
|
|
61
|
+
_this$props$value = _this$props.value,
|
|
62
|
+
value = _this$props$value === void 0 ? {} : _this$props$value;
|
|
62
63
|
var newValue = {};
|
|
63
64
|
newValue[key] = keyValue;
|
|
64
65
|
var CheckValue, checkIndex;
|
|
@@ -83,7 +84,8 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
83
84
|
var _this$props2 = _this.props,
|
|
84
85
|
onAreaSearch = _this$props2.onAreaSearch,
|
|
85
86
|
child = _this$props2.child,
|
|
86
|
-
value = _this$props2.value
|
|
87
|
+
_this$props2$value = _this$props2.value,
|
|
88
|
+
value = _this$props2$value === void 0 ? {} : _this$props2$value;
|
|
87
89
|
var flag = true;
|
|
88
90
|
|
|
89
91
|
_mapInstanceProperty(child).call(child, function (item, index) {
|
|
@@ -113,7 +115,7 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
113
115
|
value: function componentWillReceiveProps(props) {
|
|
114
116
|
if (props.value !== this.props.value) {
|
|
115
117
|
this.setState({
|
|
116
|
-
value: props.value
|
|
118
|
+
value: props.value || {}
|
|
117
119
|
});
|
|
118
120
|
}
|
|
119
121
|
}
|
|
@@ -129,7 +131,8 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
129
131
|
options = _this$props3$options === void 0 ? {} : _this$props3$options,
|
|
130
132
|
_this$props3$readonly = _this$props3.readonly,
|
|
131
133
|
readonly = _this$props3$readonly === void 0 ? false : _this$props3$readonly,
|
|
132
|
-
value = _this$props3.value
|
|
134
|
+
_this$props3$value = _this$props3.value,
|
|
135
|
+
value = _this$props3$value === void 0 ? {} : _this$props3$value;
|
|
133
136
|
return /*#__PURE__*/React.createElement(_Row, null, _mapInstanceProperty(child).call(child, function (item, index) {
|
|
134
137
|
var _context, _context2, _context3;
|
|
135
138
|
|
|
@@ -148,7 +151,7 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
148
151
|
onSearch: _bindInstanceProperty(_context2 = _this2.onSearch).call(_context2, _this2, item.key, item, parentKey),
|
|
149
152
|
onChange: _bindInstanceProperty(_context3 = _this2.onChange).call(_context3, _this2, item.key),
|
|
150
153
|
options: childOptions,
|
|
151
|
-
value:
|
|
154
|
+
value: value[item.key] && value[item.key].title ? value[item.key].title : value[item.key],
|
|
152
155
|
type: readonly ? 'readonly' : item.type
|
|
153
156
|
});
|
|
154
157
|
|
|
@@ -43,7 +43,7 @@ import helper from '../helper';
|
|
|
43
43
|
import Control, { getTitle, makeString } from '../Control';
|
|
44
44
|
import variables from '../variables';
|
|
45
45
|
var FormItem = _Form.Item;
|
|
46
|
-
var defaultSize = '
|
|
46
|
+
var defaultSize = 'large';
|
|
47
47
|
var defaultColNum = 4;
|
|
48
48
|
var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'captcha', 'area', 'uploadImg', 'cascader'];
|
|
49
49
|
/**
|
|
@@ -55,6 +55,7 @@ import SuperTableCell from './SuperTableCell';
|
|
|
55
55
|
import fixed from '../SuperTable/fixed';
|
|
56
56
|
import SuperToolbar from '../SuperToolbar';
|
|
57
57
|
import variables from '../variables';
|
|
58
|
+
import helper from '../helper';
|
|
58
59
|
var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select', //存储value
|
|
59
60
|
'selectText', //存储title
|
|
60
61
|
'search', 'searchText', 'selectSearch', //多选下拉搜索
|
|
@@ -439,14 +440,16 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
439
440
|
return value ? typeof value === 'string' ? /*#__PURE__*/React.createElement("img", {
|
|
440
441
|
src: value,
|
|
441
442
|
style: {
|
|
442
|
-
|
|
443
|
+
width: '80px',
|
|
444
|
+
height: '80px'
|
|
443
445
|
}
|
|
444
446
|
}) : /*#__PURE__*/React.createElement("div", {
|
|
445
447
|
role: 'imgBox'
|
|
446
448
|
}, /*#__PURE__*/React.createElement("img", {
|
|
447
449
|
src: value.img,
|
|
448
450
|
style: {
|
|
449
|
-
|
|
451
|
+
width: '80px',
|
|
452
|
+
height: '80px'
|
|
450
453
|
}
|
|
451
454
|
}), /*#__PURE__*/React.createElement("span", null, value.title)) : /*#__PURE__*/React.createElement("div", null);
|
|
452
455
|
|
|
@@ -622,7 +625,11 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
622
625
|
pagination = _this$props3$paginati === void 0 ? false : _this$props3$paginati,
|
|
623
626
|
_this$props3$isEmphas = _this$props3.isEmphasized,
|
|
624
627
|
isEmphasized = _this$props3$isEmphas === void 0 ? false : _this$props3$isEmphas,
|
|
625
|
-
maxHeight = _this$props3.maxHeight
|
|
628
|
+
maxHeight = _this$props3.maxHeight,
|
|
629
|
+
_this$props3$expanded = _this$props3.expandedRowRender,
|
|
630
|
+
expandedRowRender = _this$props3$expanded === void 0 ? undefined : _this$props3$expanded,
|
|
631
|
+
_this$props3$onExpand = _this$props3.onExpand,
|
|
632
|
+
onExpand = _this$props3$onExpand === void 0 ? undefined : _this$props3$onExpand;
|
|
626
633
|
|
|
627
634
|
var widthX = _reduceInstanceProperty(_context10 = _filterInstanceProperty(cols).call(cols, function (col) {
|
|
628
635
|
return !col.hide;
|
|
@@ -630,7 +637,13 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
630
637
|
return width += item.width ? item.width : 120;
|
|
631
638
|
}, 0);
|
|
632
639
|
|
|
633
|
-
|
|
640
|
+
var scrollProps = !helper.isEmpty2(expandedRowRender) ? {} : {
|
|
641
|
+
scroll: {
|
|
642
|
+
x: widthX,
|
|
643
|
+
y: maxHeight
|
|
644
|
+
}
|
|
645
|
+
};
|
|
646
|
+
return _objectSpread(_objectSpread({
|
|
634
647
|
className: !isEmphasized ? variables('SuperTable2') : variables('SuperTable2').noTransition,
|
|
635
648
|
columns: _this.getColumns(cols),
|
|
636
649
|
dataSource: _this.getDataSource(items, cols),
|
|
@@ -638,16 +651,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
638
651
|
whiteSpace: 'nowrap'
|
|
639
652
|
}, style),
|
|
640
653
|
size: 'small',
|
|
641
|
-
scroll: {
|
|
642
|
-
x: widthX,
|
|
643
|
-
y: maxHeight
|
|
644
|
-
},
|
|
645
654
|
pagination: pagination,
|
|
646
655
|
footer: footer,
|
|
647
656
|
locale: _this.props.emptyText ? {
|
|
648
657
|
emptyText: _this.props.emptyText
|
|
649
658
|
} : null
|
|
650
|
-
}, _this.getPropsByCheckbox())
|
|
659
|
+
}, _this.getPropsByCheckbox()), {}, {
|
|
660
|
+
expandedRowRender: expandedRowRender,
|
|
661
|
+
onExpand: onExpand
|
|
662
|
+
}, scrollProps);
|
|
651
663
|
});
|
|
652
664
|
|
|
653
665
|
_defineProperty(_assertThisInitialized(_this), "setScroll", function () {
|
package/lib/Area/Area.js
CHANGED
|
@@ -91,7 +91,8 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
91
91
|
var _this$props = _this.props,
|
|
92
92
|
onParentChange = _this$props.onParentChange,
|
|
93
93
|
child = _this$props.child,
|
|
94
|
-
value = _this$props.value
|
|
94
|
+
_this$props$value = _this$props.value,
|
|
95
|
+
value = _this$props$value === void 0 ? {} : _this$props$value;
|
|
95
96
|
var newValue = {};
|
|
96
97
|
newValue[key] = keyValue;
|
|
97
98
|
var CheckValue, checkIndex;
|
|
@@ -114,7 +115,8 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
114
115
|
var _this$props2 = _this.props,
|
|
115
116
|
onAreaSearch = _this$props2.onAreaSearch,
|
|
116
117
|
child = _this$props2.child,
|
|
117
|
-
value = _this$props2.value
|
|
118
|
+
_this$props2$value = _this$props2.value,
|
|
119
|
+
value = _this$props2$value === void 0 ? {} : _this$props2$value;
|
|
118
120
|
var flag = true;
|
|
119
121
|
(0, _map["default"])(child).call(child, function (item, index) {
|
|
120
122
|
if (item.key === key && index !== 0) {
|
|
@@ -141,7 +143,7 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
141
143
|
value: function componentWillReceiveProps(props) {
|
|
142
144
|
if (props.value !== this.props.value) {
|
|
143
145
|
this.setState({
|
|
144
|
-
value: props.value
|
|
146
|
+
value: props.value || {}
|
|
145
147
|
});
|
|
146
148
|
}
|
|
147
149
|
}
|
|
@@ -157,7 +159,8 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
157
159
|
options = _this$props3$options === void 0 ? {} : _this$props3$options,
|
|
158
160
|
_this$props3$readonly = _this$props3.readonly,
|
|
159
161
|
readonly = _this$props3$readonly === void 0 ? false : _this$props3$readonly,
|
|
160
|
-
value = _this$props3.value
|
|
162
|
+
_this$props3$value = _this$props3.value,
|
|
163
|
+
value = _this$props3$value === void 0 ? {} : _this$props3$value;
|
|
161
164
|
return /*#__PURE__*/_react["default"].createElement(_row["default"], null, (0, _map["default"])(child).call(child, function (item, index) {
|
|
162
165
|
var _context, _context2, _context3;
|
|
163
166
|
|
|
@@ -176,7 +179,7 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
176
179
|
onSearch: (0, _bind["default"])(_context2 = _this2.onSearch).call(_context2, _this2, item.key, item, parentKey),
|
|
177
180
|
onChange: (0, _bind["default"])(_context3 = _this2.onChange).call(_context3, _this2, item.key),
|
|
178
181
|
options: childOptions,
|
|
179
|
-
value:
|
|
182
|
+
value: value[item.key] && value[item.key].title ? value[item.key].title : value[item.key],
|
|
180
183
|
type: readonly ? 'readonly' : item.type
|
|
181
184
|
});
|
|
182
185
|
|
|
@@ -97,7 +97,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
97
97
|
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; } }
|
|
98
98
|
|
|
99
99
|
var FormItem = _form["default"].Item;
|
|
100
|
-
var defaultSize = '
|
|
100
|
+
var defaultSize = 'large';
|
|
101
101
|
var defaultColNum = 4;
|
|
102
102
|
var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'captcha', 'area', 'uploadImg', 'cascader'];
|
|
103
103
|
/**
|
|
@@ -94,6 +94,8 @@ var _SuperToolbar = _interopRequireDefault(require("../SuperToolbar"));
|
|
|
94
94
|
|
|
95
95
|
var _variables = _interopRequireDefault(require("../variables"));
|
|
96
96
|
|
|
97
|
+
var _helper = _interopRequireDefault(require("../helper"));
|
|
98
|
+
|
|
97
99
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (_Array$isArray2(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
98
100
|
|
|
99
101
|
function _unsupportedIterableToArray(o, minLen) { var _context13; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context13 = Object.prototype.toString.call(o)).call(_context13, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -478,14 +480,16 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
478
480
|
return value ? typeof value === 'string' ? /*#__PURE__*/_react["default"].createElement("img", {
|
|
479
481
|
src: value,
|
|
480
482
|
style: {
|
|
481
|
-
|
|
483
|
+
width: '80px',
|
|
484
|
+
height: '80px'
|
|
482
485
|
}
|
|
483
486
|
}) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
484
487
|
role: 'imgBox'
|
|
485
488
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
486
489
|
src: value.img,
|
|
487
490
|
style: {
|
|
488
|
-
|
|
491
|
+
width: '80px',
|
|
492
|
+
height: '80px'
|
|
489
493
|
}
|
|
490
494
|
}), /*#__PURE__*/_react["default"].createElement("span", null, value.title)) : /*#__PURE__*/_react["default"].createElement("div", null);
|
|
491
495
|
|
|
@@ -651,13 +655,23 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
651
655
|
pagination = _this$props3$paginati === void 0 ? false : _this$props3$paginati,
|
|
652
656
|
_this$props3$isEmphas = _this$props3.isEmphasized,
|
|
653
657
|
isEmphasized = _this$props3$isEmphas === void 0 ? false : _this$props3$isEmphas,
|
|
654
|
-
maxHeight = _this$props3.maxHeight
|
|
658
|
+
maxHeight = _this$props3.maxHeight,
|
|
659
|
+
_this$props3$expanded = _this$props3.expandedRowRender,
|
|
660
|
+
expandedRowRender = _this$props3$expanded === void 0 ? undefined : _this$props3$expanded,
|
|
661
|
+
_this$props3$onExpand = _this$props3.onExpand,
|
|
662
|
+
onExpand = _this$props3$onExpand === void 0 ? undefined : _this$props3$onExpand;
|
|
655
663
|
var widthX = (0, _reduce["default"])(_context10 = (0, _filter["default"])(cols).call(cols, function (col) {
|
|
656
664
|
return !col.hide;
|
|
657
665
|
})).call(_context10, function (width, item) {
|
|
658
666
|
return width += item.width ? item.width : 120;
|
|
659
667
|
}, 0);
|
|
660
|
-
|
|
668
|
+
var scrollProps = !_helper["default"].isEmpty2(expandedRowRender) ? {} : {
|
|
669
|
+
scroll: {
|
|
670
|
+
x: widthX,
|
|
671
|
+
y: maxHeight
|
|
672
|
+
}
|
|
673
|
+
};
|
|
674
|
+
return _objectSpread(_objectSpread({
|
|
661
675
|
className: !isEmphasized ? (0, _variables["default"])('SuperTable2') : (0, _variables["default"])('SuperTable2').noTransition,
|
|
662
676
|
columns: _this.getColumns(cols),
|
|
663
677
|
dataSource: _this.getDataSource(items, cols),
|
|
@@ -665,16 +679,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
665
679
|
whiteSpace: 'nowrap'
|
|
666
680
|
}, style),
|
|
667
681
|
size: 'small',
|
|
668
|
-
scroll: {
|
|
669
|
-
x: widthX,
|
|
670
|
-
y: maxHeight
|
|
671
|
-
},
|
|
672
682
|
pagination: pagination,
|
|
673
683
|
footer: footer,
|
|
674
684
|
locale: _this.props.emptyText ? {
|
|
675
685
|
emptyText: _this.props.emptyText
|
|
676
686
|
} : null
|
|
677
|
-
}, _this.getPropsByCheckbox())
|
|
687
|
+
}, _this.getPropsByCheckbox()), {}, {
|
|
688
|
+
expandedRowRender: expandedRowRender,
|
|
689
|
+
onExpand: onExpand
|
|
690
|
+
}, scrollProps);
|
|
678
691
|
});
|
|
679
692
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setScroll", function () {
|
|
680
693
|
if (_this.props.maxHeight && _this.props.items.length) {
|