cloud-b2b 1.1.56 → 1.1.58
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/InpurCascader/InputCascader.js +16 -7
- package/es/SuperTable2/SuperTable2.js +1 -1
- package/es/SuperTable2/SuperTableCell.js +22 -2
- package/lib/InpurCascader/InputCascader.js +16 -7
- package/lib/SuperTable2/SuperTable2.js +1 -1
- package/lib/SuperTable2/SuperTableCell.js +22 -2
- package/package.json +1 -1
|
@@ -15,11 +15,13 @@ import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleC
|
|
|
15
15
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
16
16
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
17
17
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
18
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
19
|
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); }; }
|
|
20
20
|
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; } }
|
|
21
21
|
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
22
22
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
23
|
+
import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
|
|
24
|
+
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
|
|
23
25
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
24
26
|
//级联选择input
|
|
25
27
|
import React from 'react';
|
|
@@ -68,7 +70,12 @@ var InputCascader = /*#__PURE__*/function (_React$Component) {
|
|
|
68
70
|
return obj;
|
|
69
71
|
});
|
|
70
72
|
});
|
|
71
|
-
_defineProperty(_assertThisInitialized(_this), "showSearch", function (inputValue, path) {
|
|
73
|
+
_defineProperty(_assertThisInitialized(_this), "showSearch", function (inputValue, path) {
|
|
74
|
+
return _someInstanceProperty(path).call(path, function (option) {
|
|
75
|
+
var _context;
|
|
76
|
+
return _indexOfInstanceProperty(_context = option.label.toLowerCase()).call(_context, inputValue.toLowerCase()) > -1;
|
|
77
|
+
});
|
|
78
|
+
});
|
|
72
79
|
_defineProperty(_assertThisInitialized(_this), "getProps", function () {
|
|
73
80
|
var _this$props = _this.props,
|
|
74
81
|
_this$props$options = _this$props.options,
|
|
@@ -77,20 +84,22 @@ var InputCascader = /*#__PURE__*/function (_React$Component) {
|
|
|
77
84
|
size = _this$props.size,
|
|
78
85
|
value = _this$props.value,
|
|
79
86
|
loadData = _this$props.loadData,
|
|
80
|
-
showSearch = _this$props.showSearch
|
|
87
|
+
showSearch = _this$props.showSearch,
|
|
88
|
+
_this$props$changeOnS = _this$props.changeOnSelect,
|
|
89
|
+
changeOnSelect = _this$props$changeOnS === void 0 ? true : _this$props$changeOnS;
|
|
81
90
|
var props = _Object$assign(getObjectExclude({}, PROPS_KEYS), {
|
|
82
91
|
onChange: _this.onChange,
|
|
83
92
|
value: value,
|
|
84
93
|
options: _this.getOptions(options),
|
|
85
|
-
changeOnSelect:
|
|
94
|
+
changeOnSelect: changeOnSelect,
|
|
86
95
|
placeholder: placeholder,
|
|
87
96
|
size: size
|
|
88
97
|
});
|
|
89
98
|
//动态加载 ps:loadData 与 showSearch 无法一起使用
|
|
90
|
-
if (
|
|
99
|
+
if (showSearch) {
|
|
100
|
+
props.showSearch = true;
|
|
101
|
+
} else if (loadData) {
|
|
91
102
|
props.loadData = _this.loadData;
|
|
92
|
-
} else if (showSearch) {
|
|
93
|
-
props.showSearch = _this.showSearch;
|
|
94
103
|
}
|
|
95
104
|
return props;
|
|
96
105
|
});
|
|
@@ -64,7 +64,7 @@ var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select',
|
|
|
64
64
|
//按钮组
|
|
65
65
|
'img',
|
|
66
66
|
//图片标题组 value为{src,title}时显示图片标题 为字符串时 只显示图片
|
|
67
|
-
'uploadImg', 'double', 'radioGroup'];
|
|
67
|
+
'uploadImg', 'double', 'radioGroup', 'selectWriting'];
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
70
|
* key:标识所在列,在一个表格中必须唯一
|
|
@@ -121,8 +121,22 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
121
121
|
_defineProperty(_assertThisInitialized(_this), "toCascader", function (props) {
|
|
122
122
|
props.options = _this.options() || [];
|
|
123
123
|
props.onSearch = _this.props.onSearch;
|
|
124
|
+
props.loadData = _this.props.onSearch;
|
|
124
125
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
125
126
|
});
|
|
127
|
+
_defineProperty(_assertThisInitialized(_this), "toSelectWriting", function (props) {
|
|
128
|
+
return /*#__PURE__*/React.createElement(Control, props);
|
|
129
|
+
});
|
|
130
|
+
// 确保value的值为字符串(包含value和title的对象除外)
|
|
131
|
+
_defineProperty(_assertThisInitialized(_this), "makeString", function (value) {
|
|
132
|
+
if (value === null || typeof value === 'undefined') {
|
|
133
|
+
return '';
|
|
134
|
+
} else if (typeof value === 'number') {
|
|
135
|
+
return String(value);
|
|
136
|
+
} else {
|
|
137
|
+
return value;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
126
140
|
_defineProperty(_assertThisInitialized(_this), "controlProps", function (_ref2) {
|
|
127
141
|
var type = _ref2.type,
|
|
128
142
|
value = _ref2.value,
|
|
@@ -133,7 +147,7 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
133
147
|
type === 'readonly' && (props = {});
|
|
134
148
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
135
149
|
type: type,
|
|
136
|
-
value: value,
|
|
150
|
+
value: _this.makeString(value),
|
|
137
151
|
size: 'small',
|
|
138
152
|
autoFocus: _this.props.error,
|
|
139
153
|
style: {
|
|
@@ -180,7 +194,13 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
180
194
|
case 'readonly':
|
|
181
195
|
return this.toReadonlyComponent(props);
|
|
182
196
|
case 'cascader':
|
|
183
|
-
return
|
|
197
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
198
|
+
className: className
|
|
199
|
+
}, this.toCascader(props));
|
|
200
|
+
case 'selectWriting':
|
|
201
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
202
|
+
className: className
|
|
203
|
+
}, this.toSelectWriting(props));
|
|
184
204
|
case 'double':
|
|
185
205
|
return /*#__PURE__*/React.createElement("div", {
|
|
186
206
|
className: className
|
|
@@ -24,12 +24,14 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/he
|
|
|
24
24
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
25
25
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
26
26
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
27
|
+
var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
|
28
|
+
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
27
29
|
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
28
30
|
var _react = _interopRequireDefault(require("react"));
|
|
29
31
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
30
32
|
var _helper = require("../helper");
|
|
31
33
|
function ownKeys(e, r) { var t = _Object$keys2(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
32
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
34
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(t), !0)).call(_context2, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
33
35
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
34
36
|
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; } } //级联选择input
|
|
35
37
|
var optionsType = {
|
|
@@ -75,7 +77,12 @@ var InputCascader = /*#__PURE__*/function (_React$Component) {
|
|
|
75
77
|
return obj;
|
|
76
78
|
});
|
|
77
79
|
});
|
|
78
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "showSearch", function (inputValue, path) {
|
|
80
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "showSearch", function (inputValue, path) {
|
|
81
|
+
return (0, _some["default"])(path).call(path, function (option) {
|
|
82
|
+
var _context;
|
|
83
|
+
return (0, _indexOf["default"])(_context = option.label.toLowerCase()).call(_context, inputValue.toLowerCase()) > -1;
|
|
84
|
+
});
|
|
85
|
+
});
|
|
79
86
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getProps", function () {
|
|
80
87
|
var _this$props = _this.props,
|
|
81
88
|
_this$props$options = _this$props.options,
|
|
@@ -84,20 +91,22 @@ var InputCascader = /*#__PURE__*/function (_React$Component) {
|
|
|
84
91
|
size = _this$props.size,
|
|
85
92
|
value = _this$props.value,
|
|
86
93
|
loadData = _this$props.loadData,
|
|
87
|
-
showSearch = _this$props.showSearch
|
|
94
|
+
showSearch = _this$props.showSearch,
|
|
95
|
+
_this$props$changeOnS = _this$props.changeOnSelect,
|
|
96
|
+
changeOnSelect = _this$props$changeOnS === void 0 ? true : _this$props$changeOnS;
|
|
88
97
|
var props = (0, _assign["default"])((0, _helper.getObjectExclude)({}, PROPS_KEYS), {
|
|
89
98
|
onChange: _this.onChange,
|
|
90
99
|
value: value,
|
|
91
100
|
options: _this.getOptions(options),
|
|
92
|
-
changeOnSelect:
|
|
101
|
+
changeOnSelect: changeOnSelect,
|
|
93
102
|
placeholder: placeholder,
|
|
94
103
|
size: size
|
|
95
104
|
});
|
|
96
105
|
//动态加载 ps:loadData 与 showSearch 无法一起使用
|
|
97
|
-
if (
|
|
106
|
+
if (showSearch) {
|
|
107
|
+
props.showSearch = true;
|
|
108
|
+
} else if (loadData) {
|
|
98
109
|
props.loadData = _this.loadData;
|
|
99
|
-
} else if (showSearch) {
|
|
100
|
-
props.showSearch = _this.showSearch;
|
|
101
110
|
}
|
|
102
111
|
return props;
|
|
103
112
|
});
|
|
@@ -77,7 +77,7 @@ var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select',
|
|
|
77
77
|
//按钮组
|
|
78
78
|
'img',
|
|
79
79
|
//图片标题组 value为{src,title}时显示图片标题 为字符串时 只显示图片
|
|
80
|
-
'uploadImg', 'double', 'radioGroup'];
|
|
80
|
+
'uploadImg', 'double', 'radioGroup', 'selectWriting'];
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
83
|
* key:标识所在列,在一个表格中必须唯一
|
|
@@ -127,8 +127,22 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
127
127
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toCascader", function (props) {
|
|
128
128
|
props.options = _this.options() || [];
|
|
129
129
|
props.onSearch = _this.props.onSearch;
|
|
130
|
+
props.loadData = _this.props.onSearch;
|
|
130
131
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
131
132
|
});
|
|
133
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toSelectWriting", function (props) {
|
|
134
|
+
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
135
|
+
});
|
|
136
|
+
// 确保value的值为字符串(包含value和title的对象除外)
|
|
137
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "makeString", function (value) {
|
|
138
|
+
if (value === null || typeof value === 'undefined') {
|
|
139
|
+
return '';
|
|
140
|
+
} else if (typeof value === 'number') {
|
|
141
|
+
return String(value);
|
|
142
|
+
} else {
|
|
143
|
+
return value;
|
|
144
|
+
}
|
|
145
|
+
});
|
|
132
146
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "controlProps", function (_ref2) {
|
|
133
147
|
var type = _ref2.type,
|
|
134
148
|
value = _ref2.value,
|
|
@@ -139,7 +153,7 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
139
153
|
type === 'readonly' && (props = {});
|
|
140
154
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
141
155
|
type: type,
|
|
142
|
-
value: value,
|
|
156
|
+
value: _this.makeString(value),
|
|
143
157
|
size: 'small',
|
|
144
158
|
autoFocus: _this.props.error,
|
|
145
159
|
style: {
|
|
@@ -186,7 +200,13 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
186
200
|
case 'readonly':
|
|
187
201
|
return this.toReadonlyComponent(props);
|
|
188
202
|
case 'cascader':
|
|
189
|
-
return
|
|
203
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
204
|
+
className: className
|
|
205
|
+
}, this.toCascader(props));
|
|
206
|
+
case 'selectWriting':
|
|
207
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
208
|
+
className: className
|
|
209
|
+
}, this.toSelectWriting(props));
|
|
190
210
|
case 'double':
|
|
191
211
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
192
212
|
className: className
|