cloud-b2b 1.1.70 → 1.1.72
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 +8 -11
- package/es/CodeInput/CodeInput.js +16 -19
- package/es/Enhance/Dialogs.js +11 -14
- package/es/Enhance/Loading.js +15 -18
- package/es/Header/Header.js +17 -20
- package/es/Header/Vertical.js +11 -14
- package/es/ImageView/ImageView.js +10 -13
- package/es/InpurCascader/InputCascader.js +11 -14
- package/es/InputEditor/InputEditor.js +16 -18
- package/es/InputSearch/InputSearch.js +23 -23
- package/es/InputSelect/InputSelect.js +14 -17
- package/es/InputTreeSelect/InputTreeSelect.js +10 -13
- package/es/InputWriting/InputWriting.js +12 -15
- package/es/Layout/Layout.js +14 -17
- package/es/Link/Link.js +7 -10
- package/es/NumberInput/NumberInput.js +13 -16
- package/es/Search/Search.js +52 -55
- package/es/Search2/Search.js +83 -86
- package/es/Search2/Search.less +64 -64
- package/es/Search2/package.json +6 -6
- package/es/Sidebar/Sidebar.js +11 -14
- package/es/Sidebar2/Sidebar.js +13 -16
- package/es/SuperForm/SuperForm.js +74 -79
- package/es/SuperForm2/SuperForm.js +99 -103
- package/es/SuperPagination/SuperPagination.js +8 -11
- package/es/SuperTab/SuperTab.js +12 -15
- package/es/SuperTab2/SuperTab2.js +13 -16
- package/es/SuperTable/DragSortRow.js +12 -15
- package/es/SuperTable/FilterDropDown.js +11 -14
- package/es/SuperTable/SuperTable.js +70 -73
- package/es/SuperTable2/SuperTable2.js +89 -92
- package/es/SuperTable2/SuperTableCell.js +27 -30
- package/es/SuperTable3/FilterDropDown.js +11 -14
- package/es/SuperTable3/SuperTable.js +58 -61
- package/es/SuperToolbar/SuperToolbar.js +11 -14
- package/es/SuperUpload/SuperUpload.js +74 -74
- package/es/Viewer/ImageViews.js +16 -19
- package/es/Viewer/Viewer.js +11 -14
- package/es/helper.js +18 -17
- package/lib/Area/Area.js +8 -11
- package/lib/CodeInput/CodeInput.js +16 -19
- package/lib/Enhance/Dialogs.js +11 -14
- package/lib/Enhance/Loading.js +15 -18
- package/lib/Header/Header.js +17 -20
- package/lib/Header/Vertical.js +11 -14
- package/lib/ImageView/ImageView.js +10 -13
- package/lib/InpurCascader/InputCascader.js +11 -14
- package/lib/InputEditor/InputEditor.js +16 -18
- package/lib/InputSearch/InputSearch.js +23 -23
- package/lib/InputSelect/InputSelect.js +14 -17
- package/lib/InputTreeSelect/InputTreeSelect.js +10 -13
- package/lib/InputWriting/InputWriting.js +12 -15
- package/lib/Layout/Layout.js +14 -17
- package/lib/LayoutLink/LayoutLink.js +1 -2
- package/lib/Link/Link.js +7 -10
- package/lib/NumberInput/NumberInput.js +13 -16
- package/lib/Search/Search.js +53 -57
- package/lib/Search2/Search.js +84 -88
- package/lib/Search2/Search.less +64 -64
- package/lib/Search2/package.json +6 -6
- package/lib/Sidebar/Sidebar.js +11 -14
- package/lib/Sidebar2/Sidebar.js +13 -16
- package/lib/SuperForm/SuperForm.js +75 -81
- package/lib/SuperForm2/SuperForm.js +100 -105
- package/lib/SuperPagination/SuperPagination.js +8 -11
- package/lib/SuperTab/SuperTab.js +12 -15
- package/lib/SuperTab2/SuperTab2.js +13 -16
- package/lib/SuperTable/DragSortRow.js +12 -15
- package/lib/SuperTable/FilterDropDown.js +11 -14
- package/lib/SuperTable/SuperTable.js +70 -73
- package/lib/SuperTable2/SuperTable2.js +90 -94
- package/lib/SuperTable2/SuperTableCell.js +27 -30
- package/lib/SuperTable3/FilterDropDown.js +11 -14
- package/lib/SuperTable3/SuperTable.js +58 -61
- package/lib/SuperToolbar/SuperToolbar.js +11 -14
- package/lib/SuperUpload/SuperUpload.js +75 -76
- package/lib/Viewer/ImageViews.js +16 -19
- package/lib/Viewer/Viewer.js +11 -14
- package/lib/helper.js +18 -17
- package/package.json +1 -1
package/lib/Search/Search.js
CHANGED
|
@@ -34,10 +34,9 @@ var _button = _interopRequireDefault(require("antd/lib/button"));
|
|
|
34
34
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
35
35
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
36
36
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
37
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
38
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
39
37
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
40
38
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
39
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
41
40
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
42
41
|
var _form = _interopRequireDefault(require("antd/lib/form"));
|
|
43
42
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -46,12 +45,11 @@ var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
|
46
45
|
var _Control = _interopRequireWildcard(require("../Control"));
|
|
47
46
|
var _helper = require("../helper");
|
|
48
47
|
var _variables = _interopRequireDefault(require("../variables"));
|
|
49
|
-
function
|
|
50
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
48
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
51
49
|
function ownKeys(e, r) { var t = _Object$keys2(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty2(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
52
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
53
|
-
function
|
|
54
|
-
function _isNativeReflectConstruct() {
|
|
50
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context10, _context11; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context10 = ownKeys(Object(t), !0)).call(_context10, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context11 = ownKeys(Object(t))).call(_context11, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
51
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
52
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
55
53
|
var FormItem = _form["default"].Item;
|
|
56
54
|
var defaultSize = 'small';
|
|
57
55
|
var defaultColNum = 4;
|
|
@@ -97,8 +95,6 @@ var FilterType = {
|
|
|
97
95
|
* displayRow:折叠时需要展示的行数,整数,默认为1
|
|
98
96
|
*/
|
|
99
97
|
var Search = /*#__PURE__*/function (_React$Component) {
|
|
100
|
-
(0, _inherits2["default"])(Search, _React$Component);
|
|
101
|
-
var _super = _createSuper(Search);
|
|
102
98
|
function Search() {
|
|
103
99
|
var _context;
|
|
104
100
|
var _this;
|
|
@@ -106,22 +102,22 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
106
102
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
107
103
|
args[_key] = arguments[_key];
|
|
108
104
|
}
|
|
109
|
-
_this =
|
|
110
|
-
(0, _defineProperty2["default"])(
|
|
105
|
+
_this = _callSuper(this, Search, (0, _concat["default"])(_context = []).call(_context, args));
|
|
106
|
+
(0, _defineProperty2["default"])(_this, "state", {
|
|
111
107
|
more: false
|
|
112
108
|
});
|
|
113
|
-
(0, _defineProperty2["default"])(
|
|
109
|
+
(0, _defineProperty2["default"])(_this, "onClick", function (key) {
|
|
114
110
|
var onClick = _this.props.onClick;
|
|
115
111
|
onClick && onClick(key);
|
|
116
112
|
});
|
|
117
|
-
(0, _defineProperty2["default"])(
|
|
113
|
+
(0, _defineProperty2["default"])(_this, "onMore", function () {
|
|
118
114
|
var onHeightChange = _this.props.onHeightChange;
|
|
119
115
|
_this.setState({
|
|
120
116
|
more: !_this.state.more
|
|
121
117
|
});
|
|
122
118
|
onHeightChange && onHeightChange(_this.calHeight(!_this.state.more));
|
|
123
119
|
});
|
|
124
|
-
(0, _defineProperty2["default"])(
|
|
120
|
+
(0, _defineProperty2["default"])(_this, "onChange", function (dictionary, key, value) {
|
|
125
121
|
var _context2, _context3;
|
|
126
122
|
var onChange = _this.props.onChange;
|
|
127
123
|
if (value && key === 'queryGroup' && dictionary && global.dictionary && global.dictionary[dictionary] && !(0, _includes["default"])(_context2 = (0, _map["default"])(_context3 = global.dictionary[dictionary]).call(_context3, function (item) {
|
|
@@ -136,20 +132,20 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
136
132
|
}
|
|
137
133
|
onChange && onChange(key, value);
|
|
138
134
|
});
|
|
139
|
-
(0, _defineProperty2["default"])(
|
|
135
|
+
(0, _defineProperty2["default"])(_this, "onPressEnter", function () {
|
|
140
136
|
_reactDom["default"].findDOMNode(_this.refs.search).click();
|
|
141
137
|
});
|
|
142
|
-
(0, _defineProperty2["default"])(
|
|
138
|
+
(0, _defineProperty2["default"])(_this, "toButton", function (key) {
|
|
143
139
|
var _context5;
|
|
144
140
|
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
145
141
|
var config = _this.props.config;
|
|
146
|
-
var onClick = (0, _bind["default"])(_context5 = _this.onClick).call(_context5,
|
|
142
|
+
var onClick = (0, _bind["default"])(_context5 = _this.onClick).call(_context5, _this, key);
|
|
147
143
|
return /*#__PURE__*/_react["default"].createElement(_button["default"], (0, _extends2["default"])({
|
|
148
144
|
size: defaultSize,
|
|
149
145
|
onClick: onClick
|
|
150
146
|
}, props), config[key]);
|
|
151
147
|
});
|
|
152
|
-
(0, _defineProperty2["default"])(
|
|
148
|
+
(0, _defineProperty2["default"])(_this, "toMore", function () {
|
|
153
149
|
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
154
150
|
role: "more",
|
|
155
151
|
onClick: _this.onMore
|
|
@@ -158,7 +154,7 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
158
154
|
"data-status": !_this.state.more ? 'down' : 'up'
|
|
159
155
|
}));
|
|
160
156
|
});
|
|
161
|
-
(0, _defineProperty2["default"])(
|
|
157
|
+
(0, _defineProperty2["default"])(_this, "toButtons", function () {
|
|
162
158
|
var config = _this.props.config;
|
|
163
159
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
164
160
|
role: "buttons"
|
|
@@ -167,7 +163,7 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
167
163
|
type: 'primary'
|
|
168
164
|
}), config.reset ? _this.toButton('reset') : null, _this.isSort() ? _this.toButton('sort') : null, _this.isMore() ? _this.toMore() : null);
|
|
169
165
|
});
|
|
170
|
-
(0, _defineProperty2["default"])(
|
|
166
|
+
(0, _defineProperty2["default"])(_this, "isSort", function () {
|
|
171
167
|
var _this$props = _this.props,
|
|
172
168
|
config = _this$props.config,
|
|
173
169
|
_this$props$colNum = _this$props.colNum,
|
|
@@ -177,7 +173,7 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
177
173
|
isSort = _this$props$isSort === void 0 ? false : _this$props$isSort;
|
|
178
174
|
return isSort && (0, _sort["default"])(config) && filters.length > colNum;
|
|
179
175
|
});
|
|
180
|
-
(0, _defineProperty2["default"])(
|
|
176
|
+
(0, _defineProperty2["default"])(_this, "isMore", function () {
|
|
181
177
|
var _this$props2 = _this.props,
|
|
182
178
|
config = _this$props2.config,
|
|
183
179
|
_this$props2$colNum = _this$props2.colNum,
|
|
@@ -189,7 +185,7 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
189
185
|
return !item.hide;
|
|
190
186
|
}).length > colNum * displayRow;
|
|
191
187
|
});
|
|
192
|
-
(0, _defineProperty2["default"])(
|
|
188
|
+
(0, _defineProperty2["default"])(_this, "getOptions", function (filter) {
|
|
193
189
|
var options = _this.props.options;
|
|
194
190
|
if (options && (0, _isArray["default"])(options[filter.key])) {
|
|
195
191
|
return options[filter.key];
|
|
@@ -197,10 +193,10 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
197
193
|
return filter.options || filter.typeRelated || [];
|
|
198
194
|
}
|
|
199
195
|
});
|
|
200
|
-
(0, _defineProperty2["default"])(
|
|
196
|
+
(0, _defineProperty2["default"])(_this, "getContainer", function () {
|
|
201
197
|
return _this.props.getContainer;
|
|
202
198
|
});
|
|
203
|
-
(0, _defineProperty2["default"])(
|
|
199
|
+
(0, _defineProperty2["default"])(_this, "getControlProps", function (control) {
|
|
204
200
|
var _context6;
|
|
205
201
|
var _this$props$data = _this.props.data,
|
|
206
202
|
data = _this$props$data === void 0 ? {} : _this$props$data;
|
|
@@ -208,10 +204,10 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
208
204
|
size: defaultSize,
|
|
209
205
|
type: control.type,
|
|
210
206
|
value: (0, _Control.makeString)(data[control.key]),
|
|
211
|
-
onChange: (0, _bind["default"])(_context6 = _this.onChange).call(_context6,
|
|
207
|
+
onChange: (0, _bind["default"])(_context6 = _this.onChange).call(_context6, _this, control.dictionary, control.key)
|
|
212
208
|
});
|
|
213
209
|
});
|
|
214
|
-
(0, _defineProperty2["default"])(
|
|
210
|
+
(0, _defineProperty2["default"])(_this, "validDate", function (_ref) {
|
|
215
211
|
var key = _ref.key,
|
|
216
212
|
type = _ref.type;
|
|
217
213
|
return function (date) {
|
|
@@ -230,16 +226,16 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
230
226
|
}
|
|
231
227
|
};
|
|
232
228
|
});
|
|
233
|
-
(0, _defineProperty2["default"])(
|
|
229
|
+
(0, _defineProperty2["default"])(_this, "toText", function (props) {
|
|
234
230
|
props.onPressEnter = _this.onPressEnter;
|
|
235
231
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
236
232
|
});
|
|
237
|
-
(0, _defineProperty2["default"])(
|
|
233
|
+
(0, _defineProperty2["default"])(_this, "toNumber", function (props) {
|
|
238
234
|
props.defaultValue = props.value;
|
|
239
235
|
delete props.value;
|
|
240
236
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
241
237
|
});
|
|
242
|
-
(0, _defineProperty2["default"])(
|
|
238
|
+
(0, _defineProperty2["default"])(_this, "getQueryGroupOptions", function (_ref2) {
|
|
243
239
|
var dictionary = _ref2.dictionary,
|
|
244
240
|
_ref2$configCode = _ref2.configCode,
|
|
245
241
|
configCode = _ref2$configCode === void 0 ? 'unknown' : _ref2$configCode;
|
|
@@ -260,14 +256,14 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
260
256
|
};
|
|
261
257
|
}));
|
|
262
258
|
});
|
|
263
|
-
(0, _defineProperty2["default"])(
|
|
259
|
+
(0, _defineProperty2["default"])(_this, "toSelect", function (props, filter) {
|
|
264
260
|
var container = _this.getContainer();
|
|
265
261
|
container && (props.getPopupContainer = container);
|
|
266
262
|
props.options = filter.key === 'queryGroup' ? _this.getQueryGroupOptions(filter) : _this.getOptions(filter);
|
|
267
263
|
props.dropdownMatchSelectWidth = false;
|
|
268
264
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
269
265
|
});
|
|
270
|
-
(0, _defineProperty2["default"])(
|
|
266
|
+
(0, _defineProperty2["default"])(_this, "createSearchEvent", function (filter) {
|
|
271
267
|
if (_this.props.onSearch) {
|
|
272
268
|
return function (value) {
|
|
273
269
|
return _this.props.onSearch(filter.key, value, filter);
|
|
@@ -276,7 +272,7 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
276
272
|
return null;
|
|
277
273
|
}
|
|
278
274
|
});
|
|
279
|
-
(0, _defineProperty2["default"])(
|
|
275
|
+
(0, _defineProperty2["default"])(_this, "toSearch", function (props, filter) {
|
|
280
276
|
var container = _this.getContainer();
|
|
281
277
|
container && (props.getPopupContainer = container);
|
|
282
278
|
props.options = _this.getOptions(filter);
|
|
@@ -284,7 +280,7 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
284
280
|
props.dropdownMatchSelectWidth = false;
|
|
285
281
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
286
282
|
});
|
|
287
|
-
(0, _defineProperty2["default"])(
|
|
283
|
+
(0, _defineProperty2["default"])(_this, "selectSearch", function (props, filter) {
|
|
288
284
|
var container = _this.getContainer();
|
|
289
285
|
container && (props.getPopupContainer = container);
|
|
290
286
|
props.options = _this.getOptions(filter);
|
|
@@ -292,7 +288,7 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
292
288
|
props.dropdownMatchSelectWidth = false;
|
|
293
289
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
294
290
|
});
|
|
295
|
-
(0, _defineProperty2["default"])(
|
|
291
|
+
(0, _defineProperty2["default"])(_this, "toDate", function (props, _ref4) {
|
|
296
292
|
var rule = _ref4.rule;
|
|
297
293
|
var container = _this.getContainer();
|
|
298
294
|
container && (props.getCalendarContainer = container);
|
|
@@ -302,11 +298,11 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
302
298
|
};
|
|
303
299
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
304
300
|
});
|
|
305
|
-
(0, _defineProperty2["default"])(
|
|
301
|
+
(0, _defineProperty2["default"])(_this, "toReadonly", function (props, filter) {
|
|
306
302
|
props.value = (0, _Control.getTitle)(props.value, _this.getOptions(filter));
|
|
307
303
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
308
304
|
});
|
|
309
|
-
(0, _defineProperty2["default"])(
|
|
305
|
+
(0, _defineProperty2["default"])(_this, "toCascader", function (props, filter) {
|
|
310
306
|
var container = _this.getContainer();
|
|
311
307
|
container && (props.getPopupContainer = container);
|
|
312
308
|
props.options = _this.getOptions(filter);
|
|
@@ -314,7 +310,7 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
314
310
|
props.placeholder = filter.placeholder || '';
|
|
315
311
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
316
312
|
});
|
|
317
|
-
(0, _defineProperty2["default"])(
|
|
313
|
+
(0, _defineProperty2["default"])(_this, "toTreeSelect", function (props, filter) {
|
|
318
314
|
var container = _this.getContainer();
|
|
319
315
|
container && (props.getPopupContainer = container);
|
|
320
316
|
props.options = _this.getOptions(filter);
|
|
@@ -322,7 +318,7 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
322
318
|
props.placeholder = filter.placeholder || '';
|
|
323
319
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
324
320
|
});
|
|
325
|
-
(0, _defineProperty2["default"])(
|
|
321
|
+
(0, _defineProperty2["default"])(_this, "toControl", function (control) {
|
|
326
322
|
var props = _this.getControlProps(control);
|
|
327
323
|
switch (control.type) {
|
|
328
324
|
case 'text':
|
|
@@ -347,7 +343,7 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
347
343
|
return 'type error';
|
|
348
344
|
}
|
|
349
345
|
});
|
|
350
|
-
(0, _defineProperty2["default"])(
|
|
346
|
+
(0, _defineProperty2["default"])(_this, "toLabel", function (_ref5) {
|
|
351
347
|
var title = _ref5.title,
|
|
352
348
|
key = _ref5.key,
|
|
353
349
|
dictionary = _ref5.dictionary,
|
|
@@ -359,17 +355,17 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
359
355
|
return /*#__PURE__*/_react["default"].createElement("span", null, title, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
360
356
|
role: "icon",
|
|
361
357
|
type: "plus-circle-o",
|
|
362
|
-
onClick: (0, _bind["default"])(_context7 = _this.onAddQueryGroup).call(_context7,
|
|
358
|
+
onClick: (0, _bind["default"])(_context7 = _this.onAddQueryGroup).call(_context7, _this, configCode, _this.props.data, dictionary)
|
|
363
359
|
}), /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
364
360
|
role: "icon",
|
|
365
361
|
type: "minus-circle-o",
|
|
366
|
-
onClick: (0, _bind["default"])(_context8 = _this.onDelQueryGroup).call(_context8,
|
|
362
|
+
onClick: (0, _bind["default"])(_context8 = _this.onDelQueryGroup).call(_context8, _this, configCode, _this.props.data, dictionary)
|
|
367
363
|
}));
|
|
368
364
|
} else {
|
|
369
365
|
return title;
|
|
370
366
|
}
|
|
371
367
|
});
|
|
372
|
-
(0, _defineProperty2["default"])(
|
|
368
|
+
(0, _defineProperty2["default"])(_this, "toCol", function (span, control, more) {
|
|
373
369
|
var factor = control.span || 1;
|
|
374
370
|
return /*#__PURE__*/_react["default"].createElement(_col["default"], {
|
|
375
371
|
span: span * factor,
|
|
@@ -384,7 +380,7 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
384
380
|
required: control.required
|
|
385
381
|
}, _this.toControl(control)));
|
|
386
382
|
});
|
|
387
|
-
(0, _defineProperty2["default"])(
|
|
383
|
+
(0, _defineProperty2["default"])(_this, "toCols", function () {
|
|
388
384
|
var _context9;
|
|
389
385
|
var _this$props3 = _this.props,
|
|
390
386
|
_this$props3$colNum = _this$props3.colNum,
|
|
@@ -401,7 +397,7 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
401
397
|
return _this.toCol(span, control, index >= colNum * displayRow);
|
|
402
398
|
});
|
|
403
399
|
});
|
|
404
|
-
(0, _defineProperty2["default"])(
|
|
400
|
+
(0, _defineProperty2["default"])(_this, "calWidth", function () {
|
|
405
401
|
var _this$props4 = _this.props,
|
|
406
402
|
_this$props4$colNum = _this$props4.colNum,
|
|
407
403
|
colNum = _this$props4$colNum === void 0 ? defaultColNum : _this$props4$colNum,
|
|
@@ -415,7 +411,7 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
415
411
|
return "".concat(defaultColNum * 18, "%");
|
|
416
412
|
}
|
|
417
413
|
});
|
|
418
|
-
(0, _defineProperty2["default"])(
|
|
414
|
+
(0, _defineProperty2["default"])(_this, "calHeight", function (more) {
|
|
419
415
|
var _this$props5 = _this.props,
|
|
420
416
|
_this$props5$colNum = _this$props5.colNum,
|
|
421
417
|
colNum = _this$props5$colNum === void 0 ? defaultColNum : _this$props5$colNum,
|
|
@@ -433,19 +429,20 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
433
429
|
});
|
|
434
430
|
return _this;
|
|
435
431
|
}
|
|
436
|
-
(0,
|
|
432
|
+
(0, _inherits2["default"])(Search, _React$Component);
|
|
433
|
+
return (0, _createClass2["default"])(Search, [{
|
|
437
434
|
key: "onAddQueryGroup",
|
|
438
435
|
value: function () {
|
|
439
|
-
var _onAddQueryGroup = (0, _asyncToGenerator2["default"])(
|
|
436
|
+
var _onAddQueryGroup = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(configCode, searchData, dictionary) {
|
|
440
437
|
var onAddQueryGroup;
|
|
441
|
-
return _regenerator["default"].wrap(function
|
|
442
|
-
while (1) switch (
|
|
438
|
+
return _regenerator["default"].wrap(function (_context0) {
|
|
439
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
443
440
|
case 0:
|
|
444
441
|
onAddQueryGroup = this.props.onAddQueryGroup;
|
|
445
442
|
onAddQueryGroup && onAddQueryGroup(configCode, searchData, dictionary);
|
|
446
|
-
case
|
|
443
|
+
case 1:
|
|
447
444
|
case "end":
|
|
448
|
-
return
|
|
445
|
+
return _context0.stop();
|
|
449
446
|
}
|
|
450
447
|
}, _callee, this);
|
|
451
448
|
}));
|
|
@@ -457,16 +454,16 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
457
454
|
}, {
|
|
458
455
|
key: "onDelQueryGroup",
|
|
459
456
|
value: function () {
|
|
460
|
-
var _onDelQueryGroup = (0, _asyncToGenerator2["default"])(
|
|
457
|
+
var _onDelQueryGroup = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(configCode, searchData, dictionary) {
|
|
461
458
|
var onDelQueryGroup;
|
|
462
|
-
return _regenerator["default"].wrap(function
|
|
463
|
-
while (1) switch (
|
|
459
|
+
return _regenerator["default"].wrap(function (_context1) {
|
|
460
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
464
461
|
case 0:
|
|
465
462
|
onDelQueryGroup = this.props.onDelQueryGroup;
|
|
466
463
|
onDelQueryGroup && onDelQueryGroup(configCode, searchData, dictionary);
|
|
467
|
-
case
|
|
464
|
+
case 1:
|
|
468
465
|
case "end":
|
|
469
|
-
return
|
|
466
|
+
return _context1.stop();
|
|
470
467
|
}
|
|
471
468
|
}, _callee2, this);
|
|
472
469
|
}));
|
|
@@ -493,7 +490,6 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
493
490
|
}, this.toCols())), this.toButtons());
|
|
494
491
|
}
|
|
495
492
|
}]);
|
|
496
|
-
return Search;
|
|
497
493
|
}(_react["default"].Component);
|
|
498
494
|
(0, _defineProperty2["default"])(Search, "propTypes", {
|
|
499
495
|
config: _propTypes["default"].shape(ConfigType).isRequired,
|