cloud-b2b 1.1.62 → 1.1.63

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 (80) hide show
  1. package/es/Area/Area.js +8 -11
  2. package/es/CodeInput/CodeInput.js +16 -19
  3. package/es/Enhance/Dialogs.js +11 -14
  4. package/es/Enhance/Loading.js +15 -18
  5. package/es/Header/Header.js +17 -20
  6. package/es/Header/Vertical.js +11 -14
  7. package/es/ImageView/ImageView.js +10 -13
  8. package/es/InpurCascader/InputCascader.js +11 -14
  9. package/es/InputEditor/InputEditor.js +16 -18
  10. package/es/InputSearch/InputSearch.js +19 -22
  11. package/es/InputSelect/InputSelect.js +14 -17
  12. package/es/InputTreeSelect/InputTreeSelect.js +10 -13
  13. package/es/InputWriting/InputWriting.js +12 -15
  14. package/es/Layout/Layout.js +14 -17
  15. package/es/Link/Link.js +7 -10
  16. package/es/NumberInput/NumberInput.js +13 -16
  17. package/es/Search/Search.js +52 -55
  18. package/es/Search2/Search.js +85 -88
  19. package/es/Search2/Search.less +64 -64
  20. package/es/Search2/package.json +6 -6
  21. package/es/Sidebar/Sidebar.js +11 -14
  22. package/es/Sidebar2/Sidebar.js +13 -16
  23. package/es/SuperForm/SuperForm.js +74 -79
  24. package/es/SuperForm2/SuperForm.js +95 -100
  25. package/es/SuperPagination/SuperPagination.js +8 -11
  26. package/es/SuperTab/SuperTab.js +12 -15
  27. package/es/SuperTab2/SuperTab2.js +13 -16
  28. package/es/SuperTable/DragSortRow.js +12 -15
  29. package/es/SuperTable/FilterDropDown.js +11 -14
  30. package/es/SuperTable/SuperTable.js +68 -71
  31. package/es/SuperTable2/SuperTable2.js +85 -88
  32. package/es/SuperTable2/SuperTableCell.js +27 -30
  33. package/es/SuperTable3/FilterDropDown.js +11 -14
  34. package/es/SuperTable3/SuperTable.js +58 -61
  35. package/es/SuperToolbar/SuperToolbar.js +11 -14
  36. package/es/SuperUpload/SuperUpload.js +107 -91
  37. package/es/Viewer/ImageViews.js +16 -19
  38. package/es/Viewer/Viewer.js +11 -14
  39. package/es/helper.js +18 -17
  40. package/lib/Area/Area.js +8 -11
  41. package/lib/CodeInput/CodeInput.js +16 -19
  42. package/lib/Enhance/Dialogs.js +11 -14
  43. package/lib/Enhance/Loading.js +15 -18
  44. package/lib/Header/Header.js +17 -20
  45. package/lib/Header/Vertical.js +11 -14
  46. package/lib/ImageView/ImageView.js +10 -13
  47. package/lib/InpurCascader/InputCascader.js +11 -14
  48. package/lib/InputEditor/InputEditor.js +16 -18
  49. package/lib/InputSearch/InputSearch.js +19 -22
  50. package/lib/InputSelect/InputSelect.js +14 -17
  51. package/lib/InputTreeSelect/InputTreeSelect.js +10 -13
  52. package/lib/InputWriting/InputWriting.js +12 -15
  53. package/lib/Layout/Layout.js +14 -17
  54. package/lib/LayoutLink/LayoutLink.js +1 -2
  55. package/lib/Link/Link.js +7 -10
  56. package/lib/NumberInput/NumberInput.js +13 -16
  57. package/lib/Search/Search.js +53 -57
  58. package/lib/Search2/Search.js +86 -90
  59. package/lib/Search2/Search.less +64 -64
  60. package/lib/Search2/package.json +6 -6
  61. package/lib/Sidebar/Sidebar.js +11 -14
  62. package/lib/Sidebar2/Sidebar.js +13 -16
  63. package/lib/SuperForm/SuperForm.js +75 -81
  64. package/lib/SuperForm2/SuperForm.js +96 -102
  65. package/lib/SuperPagination/SuperPagination.js +8 -11
  66. package/lib/SuperTab/SuperTab.js +12 -15
  67. package/lib/SuperTab2/SuperTab2.js +13 -16
  68. package/lib/SuperTable/DragSortRow.js +12 -15
  69. package/lib/SuperTable/FilterDropDown.js +11 -14
  70. package/lib/SuperTable/SuperTable.js +68 -71
  71. package/lib/SuperTable2/SuperTable2.js +86 -90
  72. package/lib/SuperTable2/SuperTableCell.js +27 -30
  73. package/lib/SuperTable3/FilterDropDown.js +11 -14
  74. package/lib/SuperTable3/SuperTable.js +58 -61
  75. package/lib/SuperToolbar/SuperToolbar.js +11 -14
  76. package/lib/SuperUpload/SuperUpload.js +96 -81
  77. package/lib/Viewer/ImageViews.js +16 -19
  78. package/lib/Viewer/Viewer.js +11 -14
  79. package/lib/helper.js +18 -17
  80. package/package.json +1 -1
@@ -37,10 +37,9 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/e
37
37
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
38
38
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
39
39
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
40
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
41
- var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
42
40
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
43
41
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
42
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
44
43
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
45
44
  var _form = _interopRequireDefault(require("antd/lib/form"));
46
45
  var _react = _interopRequireDefault(require("react"));
@@ -50,12 +49,11 @@ var _withStyles = _interopRequireDefault(require("isomorphic-style-loader/withSt
50
49
  var _Control = _interopRequireWildcard(require("../Control"));
51
50
  var _helper = require("../helper");
52
51
  var _variables = _interopRequireDefault(require("../variables"));
53
- function _getRequireWildcardCache(e) { if ("function" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
54
- 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; }
52
+ 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); }
55
53
  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; }
56
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context21, _context22; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context21 = ownKeys(Object(t), !0)).call(_context21, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context22 = ownKeys(Object(t))).call(_context22, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
57
- 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); }; }
58
- 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; } } // import helper from '../../common/common';
54
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context19, _context20; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context19 = ownKeys(Object(t), !0)).call(_context19, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context20 = ownKeys(Object(t))).call(_context20, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
55
+ 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)); }
56
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } // import helper from '../../common/common';
59
57
  // import s from './Search.less';
60
58
  // import showAddDialog from './AddDialog';
61
59
  // import showDeleteDialog from './DeleteDialog';
@@ -69,11 +67,11 @@ var insertTimeKeyMap = {
69
67
  var TYPE = ['text', 'search', 'searchText', 'select', 'number', 'date', 'readonly', 'selectSearch', 'cascader' //级联选择下拉
70
68
  ];
71
69
 
72
- /**
73
- * search: 搜索按钮的标题
74
- * more:更多按钮的标题
75
- * reset:重置按钮的标题
76
- * sort:排序按钮的标题
70
+ /**
71
+ * search: 搜索按钮的标题
72
+ * more:更多按钮的标题
73
+ * reset:重置按钮的标题
74
+ * sort:排序按钮的标题
77
75
  */
78
76
  var ConfigType = {
79
77
  search: _propTypes["default"].string.isRequired,
@@ -82,11 +80,11 @@ var ConfigType = {
82
80
  more: _propTypes["default"].string
83
81
  };
84
82
 
85
- /**
86
- * key: 唯一标识一个表单元素
87
- * title:表单元素旁边的标题
88
- * type:表单元素的类型
89
- * props:传递给表单元素的额外属性
83
+ /**
84
+ * key: 唯一标识一个表单元素
85
+ * title:表单元素旁边的标题
86
+ * type:表单元素的类型
87
+ * props:传递给表单元素的额外属性
90
88
  */
91
89
  var FilterType = {
92
90
  key: _propTypes["default"].string.isRequired,
@@ -96,18 +94,16 @@ var FilterType = {
96
94
  props: _propTypes["default"].object
97
95
  };
98
96
 
99
- /**
100
- * data:传递给filters的默认值,为key:value的形式,此处的key为FilterType中的key
101
- * isSort:是否需要排序按钮,默认false,当设置为true时,onClick函数需要实现key为sort的响应函数
102
- * options: 作用同FilterType.options类似,但优先级高于它
103
- * onClick:按钮点击事件,原型为func(key)
104
- * onChange:表单控件内容改变时触发,原型为func(key, value)
105
- * onSearch:search控件发出的事件,原型为func(key, value)
106
- * displayRow:折叠时需要展示的行数,整数,默认为2
97
+ /**
98
+ * data:传递给filters的默认值,为key:value的形式,此处的key为FilterType中的key
99
+ * isSort:是否需要排序按钮,默认false,当设置为true时,onClick函数需要实现key为sort的响应函数
100
+ * options: 作用同FilterType.options类似,但优先级高于它
101
+ * onClick:按钮点击事件,原型为func(key)
102
+ * onChange:表单控件内容改变时触发,原型为func(key, value)
103
+ * onSearch:search控件发出的事件,原型为func(key, value)
104
+ * displayRow:折叠时需要展示的行数,整数,默认为2
107
105
  */
108
106
  var Search2 = /*#__PURE__*/function (_React$Component) {
109
- (0, _inherits2["default"])(Search2, _React$Component);
110
- var _super = _createSuper(Search2);
111
107
  function Search2() {
112
108
  var _context;
113
109
  var _this;
@@ -115,15 +111,15 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
115
111
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
116
112
  args[_key] = arguments[_key];
117
113
  }
118
- _this = _super.call.apply(_super, (0, _concat["default"])(_context = [this]).call(_context, args));
119
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
114
+ _this = _callSuper(this, Search2, (0, _concat["default"])(_context = []).call(_context, args));
115
+ (0, _defineProperty2["default"])(_this, "state", {
120
116
  more: false
121
117
  });
122
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPathFun", /*#__PURE__*/function () {
123
- var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(key) {
118
+ (0, _defineProperty2["default"])(_this, "getPathFun", /*#__PURE__*/function () {
119
+ var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(key) {
124
120
  var _context2, _context8;
125
121
  var pathArr, _global$store$getStat, sidebars, navigation, title, body, url;
126
- return _regenerator["default"].wrap(function _callee$(_context9) {
122
+ return _regenerator["default"].wrap(function (_context9) {
127
123
  while (1) switch (_context9.prev = _context9.next) {
128
124
  case 0:
129
125
  pathArr = global.location.pathname.split('/');
@@ -160,7 +156,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
160
156
  menuName: title
161
157
  };
162
158
  url = '/api/standard/log'; // await helper.fetchJson(url, helper.postOption(body))
163
- case 5:
159
+ case 1:
164
160
  case "end":
165
161
  return _context9.stop();
166
162
  }
@@ -170,49 +166,49 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
170
166
  return _ref.apply(this, arguments);
171
167
  };
172
168
  }());
173
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onClick", function (key) {
169
+ (0, _defineProperty2["default"])(_this, "onClick", function (key) {
174
170
  var onClick = _this.props.onClick;
175
171
  if (key === 'search') {
176
172
  // this.getPathFun(key);
177
173
  }
178
174
  onClick && onClick(key);
179
175
  });
180
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onMore", function () {
176
+ (0, _defineProperty2["default"])(_this, "onMore", function () {
181
177
  var onHeightChange = _this.props.onHeightChange;
182
178
  _this.setState({
183
179
  more: !_this.state.more
184
180
  });
185
181
  onHeightChange && onHeightChange(_this.calHeight(!_this.state.more));
186
182
  });
187
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (dictionary, key, value) {
188
- var _context10, _context11;
183
+ (0, _defineProperty2["default"])(_this, "onChange", function (dictionary, key, value) {
184
+ var _context0, _context1;
189
185
  var onChange = _this.props.onChange;
190
- if (value && key === 'queryGroup' && dictionary && global.dictionary && global.dictionary[dictionary] && !(0, _includes["default"])(_context10 = (0, _map["default"])(_context11 = global.dictionary[dictionary]).call(_context11, function (item) {
186
+ if (value && key === 'queryGroup' && dictionary && global.dictionary && global.dictionary[dictionary] && !(0, _includes["default"])(_context0 = (0, _map["default"])(_context1 = global.dictionary[dictionary]).call(_context1, function (item) {
191
187
  return item.value;
192
- })).call(_context10, value)) {
193
- var _context12;
188
+ })).call(_context0, value)) {
189
+ var _context10;
194
190
  var realValue = JSON.parse(value);
195
191
  _this.onClick('reset');
196
- (0, _map["default"])(_context12 = (0, _keys["default"])(realValue)).call(_context12, function (objectKey) {
192
+ (0, _map["default"])(_context10 = (0, _keys["default"])(realValue)).call(_context10, function (objectKey) {
197
193
  onChange && objectKey !== 'queryId' && onChange(objectKey, realValue[objectKey]);
198
194
  });
199
195
  }
200
196
  onChange && onChange(key, value);
201
197
  });
202
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onPressEnter", function () {
198
+ (0, _defineProperty2["default"])(_this, "onPressEnter", function () {
203
199
  _reactDom["default"].findDOMNode(_this.refs.search).click();
204
200
  });
205
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toButton", function (key) {
206
- var _context13;
201
+ (0, _defineProperty2["default"])(_this, "toButton", function (key) {
202
+ var _context11;
207
203
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
208
204
  var config = _this.props.config;
209
- var onClick = (0, _bind["default"])(_context13 = _this.onClick).call(_context13, (0, _assertThisInitialized2["default"])(_this), key);
205
+ var onClick = (0, _bind["default"])(_context11 = _this.onClick).call(_context11, _this, key);
210
206
  return /*#__PURE__*/_react["default"].createElement(_button["default"], (0, _extends2["default"])({
211
207
  size: defaultSize,
212
208
  onClick: onClick
213
209
  }, props), config[key]);
214
210
  });
215
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toMore", function () {
211
+ (0, _defineProperty2["default"])(_this, "toMore", function () {
216
212
  return /*#__PURE__*/_react["default"].createElement("a", {
217
213
  role: "more",
218
214
  onClick: _this.onMore
@@ -221,7 +217,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
221
217
  "data-status": !_this.state.more ? 'down' : 'up'
222
218
  }));
223
219
  });
224
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toButtons", function () {
220
+ (0, _defineProperty2["default"])(_this, "toButtons", function () {
225
221
  var config = _this.props.config;
226
222
  return /*#__PURE__*/_react["default"].createElement("div", {
227
223
  role: "buttons"
@@ -230,7 +226,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
230
226
  type: 'primary'
231
227
  }), config.reset ? _this.toButton('reset') : null, _this.isSort() ? _this.toButton('sort') : null, _this.isMore() ? _this.toMore() : null);
232
228
  });
233
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "isSort", function () {
229
+ (0, _defineProperty2["default"])(_this, "isSort", function () {
234
230
  var _this$props = _this.props,
235
231
  config = _this$props.config,
236
232
  _this$props$colNum = _this$props.colNum,
@@ -240,7 +236,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
240
236
  isSort = _this$props$isSort === void 0 ? false : _this$props$isSort;
241
237
  return isSort && (0, _sort["default"])(config) && filters.length > colNum;
242
238
  });
243
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "isMore", function () {
239
+ (0, _defineProperty2["default"])(_this, "isMore", function () {
244
240
  var _this$props2 = _this.props,
245
241
  config = _this$props2.config,
246
242
  _this$props2$colNum = _this$props2.colNum,
@@ -252,7 +248,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
252
248
  return !item.hide;
253
249
  }).length > colNum * displayRow;
254
250
  });
255
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getOptions", function (filter) {
251
+ (0, _defineProperty2["default"])(_this, "getOptions", function (filter) {
256
252
  var options = _this.props.options;
257
253
  if (options && (0, _isArray["default"])(options[filter.key])) {
258
254
  return options[filter.key];
@@ -260,21 +256,21 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
260
256
  return filter.options || filter.typeRelated || [];
261
257
  }
262
258
  });
263
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getContainer", function () {
259
+ (0, _defineProperty2["default"])(_this, "getContainer", function () {
264
260
  return _this.props.getContainer;
265
261
  });
266
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getControlProps", function (control) {
267
- var _context14;
262
+ (0, _defineProperty2["default"])(_this, "getControlProps", function (control) {
263
+ var _context12;
268
264
  var _this$props$data = _this.props.data,
269
265
  data = _this$props$data === void 0 ? {} : _this$props$data;
270
266
  return _objectSpread(_objectSpread({}, control.props || {}), {}, {
271
267
  size: defaultSize,
272
268
  type: control.type,
273
269
  value: (0, _Control.makeString)(data[control.key]),
274
- onChange: (0, _bind["default"])(_context14 = _this.onChange).call(_context14, (0, _assertThisInitialized2["default"])(_this), control.dictionary, control.key)
270
+ onChange: (0, _bind["default"])(_context12 = _this.onChange).call(_context12, _this, control.dictionary, control.key)
275
271
  });
276
272
  });
277
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "validDate", function (_ref2) {
273
+ (0, _defineProperty2["default"])(_this, "validDate", function (_ref2) {
278
274
  var key = _ref2.key,
279
275
  type = _ref2.type;
280
276
  return function (date) {
@@ -293,16 +289,16 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
293
289
  }
294
290
  };
295
291
  });
296
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toText", function (props) {
292
+ (0, _defineProperty2["default"])(_this, "toText", function (props) {
297
293
  props.onPressEnter = _this.onPressEnter;
298
294
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
299
295
  });
300
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toNumber", function (props) {
296
+ (0, _defineProperty2["default"])(_this, "toNumber", function (props) {
301
297
  props.defaultValue = props.value;
302
298
  delete props.value;
303
299
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
304
300
  });
305
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getQueryGroupOptions", function (_ref3) {
301
+ (0, _defineProperty2["default"])(_this, "getQueryGroupOptions", function (_ref3) {
306
302
  var dictionary = _ref3.dictionary,
307
303
  _ref3$configCode = _ref3.configCode,
308
304
  configCode = _ref3$configCode === void 0 ? 'unknown' : _ref3$configCode;
@@ -323,14 +319,14 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
323
319
  };
324
320
  }));
325
321
  });
326
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toSelect", function (props, filter) {
322
+ (0, _defineProperty2["default"])(_this, "toSelect", function (props, filter) {
327
323
  var container = _this.getContainer();
328
324
  container && (props.getPopupContainer = container);
329
325
  props.options = filter.key === 'queryGroup' ? _this.getQueryGroupOptions(filter) : _this.getOptions(filter);
330
326
  props.dropdownMatchSelectWidth = false;
331
327
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
332
328
  });
333
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "createSearchEvent", function (filter) {
329
+ (0, _defineProperty2["default"])(_this, "createSearchEvent", function (filter) {
334
330
  if (_this.props.onSearch) {
335
331
  return function (value) {
336
332
  return _this.props.onSearch(filter.key, value, filter);
@@ -339,7 +335,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
339
335
  return null;
340
336
  }
341
337
  });
342
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toSearch", function (props, filter) {
338
+ (0, _defineProperty2["default"])(_this, "toSearch", function (props, filter) {
343
339
  var container = _this.getContainer();
344
340
  container && (props.getPopupContainer = container);
345
341
  props.options = _this.getOptions(filter);
@@ -347,7 +343,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
347
343
  props.dropdownMatchSelectWidth = false;
348
344
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
349
345
  });
350
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "selectSearch", function (props, filter) {
346
+ (0, _defineProperty2["default"])(_this, "selectSearch", function (props, filter) {
351
347
  var container = _this.getContainer();
352
348
  container && (props.getPopupContainer = container);
353
349
  props.options = _this.getOptions(filter);
@@ -355,7 +351,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
355
351
  props.dropdownMatchSelectWidth = false;
356
352
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
357
353
  });
358
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toDate", function (props, _ref5) {
354
+ (0, _defineProperty2["default"])(_this, "toDate", function (props, _ref5) {
359
355
  var rule = _ref5.rule;
360
356
  var container = _this.getContainer();
361
357
  container && (props.getCalendarContainer = container);
@@ -365,11 +361,11 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
365
361
  };
366
362
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
367
363
  });
368
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toReadonly", function (props, filter) {
364
+ (0, _defineProperty2["default"])(_this, "toReadonly", function (props, filter) {
369
365
  props.value = (0, _Control.getTitle)(props.value, _this.getOptions(filter));
370
366
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
371
367
  });
372
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toCascader", function (props, filter) {
368
+ (0, _defineProperty2["default"])(_this, "toCascader", function (props, filter) {
373
369
  var container = _this.getContainer();
374
370
  container && (props.getPopupContainer = container);
375
371
  props.options = _this.getOptions(filter);
@@ -377,7 +373,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
377
373
  props.placeholder = filter.placeholder || '';
378
374
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
379
375
  });
380
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toControl", function (control) {
376
+ (0, _defineProperty2["default"])(_this, "toControl", function (control) {
381
377
  var props = _this.getControlProps(control);
382
378
  switch (control.type) {
383
379
  case 'text':
@@ -401,29 +397,29 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
401
397
  return 'type error';
402
398
  }
403
399
  });
404
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toLabel", function (_ref6) {
400
+ (0, _defineProperty2["default"])(_this, "toLabel", function (_ref6) {
405
401
  var title = _ref6.title,
406
402
  key = _ref6.key,
407
403
  dictionary = _ref6.dictionary,
408
404
  _ref6$configCode = _ref6.configCode,
409
405
  configCode = _ref6$configCode === void 0 ? 'unknown' : _ref6$configCode;
410
406
  if (key === 'queryGroup') {
411
- var _context15, _context16;
407
+ var _context13, _context14;
412
408
  //查询组合
413
409
  return /*#__PURE__*/_react["default"].createElement("span", null, title, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
414
410
  role: "icon",
415
411
  type: "plus-circle-o",
416
- onClick: (0, _bind["default"])(_context15 = _this.onAddQueryGroup).call(_context15, (0, _assertThisInitialized2["default"])(_this), configCode, _this.props.data, dictionary)
412
+ onClick: (0, _bind["default"])(_context13 = _this.onAddQueryGroup).call(_context13, _this, configCode, _this.props.data, dictionary)
417
413
  }), /*#__PURE__*/_react["default"].createElement(_icon["default"], {
418
414
  role: "icon",
419
415
  type: "minus-circle-o",
420
- onClick: (0, _bind["default"])(_context16 = _this.onDelQueryGroup).call(_context16, (0, _assertThisInitialized2["default"])(_this), configCode, _this.props.data, dictionary)
416
+ onClick: (0, _bind["default"])(_context14 = _this.onDelQueryGroup).call(_context14, _this, configCode, _this.props.data, dictionary)
421
417
  }));
422
418
  } else {
423
419
  return title;
424
420
  }
425
421
  });
426
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toCol", function (span, control, more) {
422
+ (0, _defineProperty2["default"])(_this, "toCol", function (span, control, more) {
427
423
  var factor = control.span || 1;
428
424
  return /*#__PURE__*/_react["default"].createElement(_col["default"], {
429
425
  span: span * factor,
@@ -438,7 +434,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
438
434
  required: control.required
439
435
  }, _this.toControl(control)));
440
436
  });
441
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toCols", function () {
437
+ (0, _defineProperty2["default"])(_this, "toCols", function () {
442
438
  var _this$props3 = _this.props,
443
439
  _this$props3$insertTi = _this$props3.insertTimeKey,
444
440
  insertTimeKey = _this$props3$insertTi === void 0 ? 'from' : _this$props3$insertTi,
@@ -462,8 +458,8 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
462
458
  });
463
459
  if (insertTimeCols.length > 0) {
464
460
  if (otherCols.length >= defaultColNum) {
465
- var _context17;
466
- (0, _splice["default"])(otherCols).apply(otherCols, (0, _concat["default"])(_context17 = [6, 0]).call(_context17, (0, _toConsumableArray2["default"])(insertTimeCols)));
461
+ var _context15;
462
+ (0, _splice["default"])(otherCols).apply(otherCols, (0, _concat["default"])(_context15 = [6, 0]).call(_context15, (0, _toConsumableArray2["default"])(insertTimeCols)));
467
463
  newFilters = otherCols;
468
464
  } else {
469
465
  newFilters = (0, _concat["default"])(otherCols).call(otherCols, insertTimeCols);
@@ -480,7 +476,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
480
476
  });
481
477
  }
482
478
  });
483
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "calWidth", function () {
479
+ (0, _defineProperty2["default"])(_this, "calWidth", function () {
484
480
  var _this$props4 = _this.props,
485
481
  _this$props4$colNum = _this$props4.colNum,
486
482
  colNum = _this$props4$colNum === void 0 ? defaultColNum : _this$props4$colNum,
@@ -494,7 +490,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
494
490
  return "".concat(defaultColNum * 13.6, "%");
495
491
  }
496
492
  });
497
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "calHeight", function (more) {
493
+ (0, _defineProperty2["default"])(_this, "calHeight", function (more) {
498
494
  var _this$props5 = _this.props,
499
495
  _this$props5$colNum = _this$props5.colNum,
500
496
  colNum = _this$props5$colNum === void 0 ? defaultColNum : _this$props5$colNum,
@@ -512,16 +508,17 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
512
508
  });
513
509
  return _this;
514
510
  }
515
- (0, _createClass2["default"])(Search2, [{
511
+ (0, _inherits2["default"])(Search2, _React$Component);
512
+ return (0, _createClass2["default"])(Search2, [{
516
513
  key: "onAddQueryGroup",
517
514
  value: function () {
518
- var _onAddQueryGroup = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(configCode, searchData, dictionary) {
519
- var _context18;
515
+ var _onAddQueryGroup = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(configCode, searchData, dictionary) {
516
+ var _context16;
520
517
  var filter, dicOptionNameArr, dicOptions;
521
- return _regenerator["default"].wrap(function _callee2$(_context19) {
522
- while (1) switch (_context19.prev = _context19.next) {
518
+ return _regenerator["default"].wrap(function (_context17) {
519
+ while (1) switch (_context17.prev = _context17.next) {
523
520
  case 0:
524
- filter = (0, _reduce["default"])(_context18 = (0, _keys["default"])(searchData)).call(_context18, function (state, key) {
521
+ filter = (0, _reduce["default"])(_context16 = (0, _keys["default"])(searchData)).call(_context16, function (state, key) {
525
522
  if (searchData[key] && key !== 'queryGroup') {
526
523
  state[key] = searchData[key];
527
524
  }
@@ -537,9 +534,9 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
537
534
  // if (true === await showAddDialog(configCode, filter, dicOptionNameArr)) {
538
535
  // this.onChange(undefined, 'queryGroup', '');
539
536
  // }
540
- case 3:
537
+ case 1:
541
538
  case "end":
542
- return _context19.stop();
539
+ return _context17.stop();
543
540
  }
544
541
  }, _callee2);
545
542
  }));
@@ -551,10 +548,10 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
551
548
  }, {
552
549
  key: "onDelQueryGroup",
553
550
  value: function () {
554
- var _onDelQueryGroup = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(configCode, searchData, dictionary) {
551
+ var _onDelQueryGroup = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(configCode, searchData, dictionary) {
555
552
  var queryGroup, dicOptions, _JSON$parse, queryId;
556
- return _regenerator["default"].wrap(function _callee3$(_context20) {
557
- while (1) switch (_context20.prev = _context20.next) {
553
+ return _regenerator["default"].wrap(function (_context18) {
554
+ while (1) switch (_context18.prev = _context18.next) {
558
555
  case 0:
559
556
  queryGroup = searchData.queryGroup; // if (!queryGroup) return helper.showError(`请先选择要删除的查询组合`);
560
557
  if (dictionary && global.dictionary) {
@@ -563,9 +560,9 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
563
560
  _JSON$parse = JSON.parse(queryGroup), queryId = _JSON$parse.queryId; // if(true === await showDeleteDialog(configCode, queryId)) {
564
561
  // this.onClick('reset');
565
562
  // }
566
- case 3:
563
+ case 1:
567
564
  case "end":
568
- return _context20.stop();
565
+ return _context18.stop();
569
566
  }
570
567
  }, _callee3);
571
568
  }));
@@ -592,7 +589,6 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
592
589
  }, this.toCols())), this.toButtons());
593
590
  }
594
591
  }]);
595
- return Search2;
596
592
  }(_react["default"].Component);
597
593
  (0, _defineProperty2["default"])(Search2, "propTypes", {
598
594
  config: _propTypes["default"].shape(ConfigType).isRequired,
@@ -1,64 +1,64 @@
1
- @import '../variables.less';
2
-
3
- .@{cloudlink-prefix}-Search2 {
4
- transition: all 0.3s;
5
- > *:first-child {
6
- display: inline-block;
7
- vertical-align: top;
8
- margin-bottom: -10px;
9
-
10
- :global(.ant-form-item) {
11
- margin-bottom: 10px;
12
-
13
- :global(.ant-select-selection--multiple) {
14
- border-top-width: 1px;
15
- height: 22px;
16
- overflow: auto;
17
- }
18
-
19
- [role='icon'] {
20
- cursor: pointer;
21
- margin-left: 10px;
22
- color: @primary-color;
23
- }
24
- }
25
- }
26
-
27
- > *:last-child {
28
- display: inline-block;
29
- vertical-align: top;
30
- padding-left: 20px;
31
- padding-top: 14px;
32
- width: 18%;
33
- }
34
-
35
- :global(.ant-form-item-control) input,
36
- :global(.ant-calendar-picker),
37
- :global(.ant-select) {
38
- display: block;
39
- }
40
- :global(.ant-calendar-picker-small) {
41
- min-width: 100px !important;
42
- }
43
- [role='buttons'] > * {
44
- margin-right: 5px;
45
- }
46
-
47
- [role='more'] {
48
- color: rgba(0, 0, 0, 0.65);
49
- user-select: none;
50
-
51
- &:hover {
52
- color: @brand-primary;
53
- }
54
-
55
- > i {
56
- transform: scale(0.75);
57
- transition: all 0.2s;
58
-
59
- &[data-status='up'] {
60
- transform: scale(0.75) rotate(-180deg);
61
- }
62
- }
63
- }
64
- }
1
+ @import '../variables.less';
2
+
3
+ .@{cloudlink-prefix}-Search2 {
4
+ transition: all 0.3s;
5
+ > *:first-child {
6
+ display: inline-block;
7
+ vertical-align: top;
8
+ margin-bottom: -10px;
9
+
10
+ :global(.ant-form-item) {
11
+ margin-bottom: 10px;
12
+
13
+ :global(.ant-select-selection--multiple) {
14
+ border-top-width: 1px;
15
+ height: 22px;
16
+ overflow: auto;
17
+ }
18
+
19
+ [role='icon'] {
20
+ cursor: pointer;
21
+ margin-left: 10px;
22
+ color: @primary-color;
23
+ }
24
+ }
25
+ }
26
+
27
+ > *:last-child {
28
+ display: inline-block;
29
+ vertical-align: top;
30
+ padding-left: 20px;
31
+ padding-top: 14px;
32
+ width: 18%;
33
+ }
34
+
35
+ :global(.ant-form-item-control) input,
36
+ :global(.ant-calendar-picker),
37
+ :global(.ant-select) {
38
+ display: block;
39
+ }
40
+ :global(.ant-calendar-picker-small) {
41
+ min-width: 100px !important;
42
+ }
43
+ [role='buttons'] > * {
44
+ margin-right: 5px;
45
+ }
46
+
47
+ [role='more'] {
48
+ color: rgba(0, 0, 0, 0.65);
49
+ user-select: none;
50
+
51
+ &:hover {
52
+ color: @brand-primary;
53
+ }
54
+
55
+ > i {
56
+ transform: scale(0.75);
57
+ transition: all 0.2s;
58
+
59
+ &[data-status='up'] {
60
+ transform: scale(0.75) rotate(-180deg);
61
+ }
62
+ }
63
+ }
64
+ }
@@ -1,6 +1,6 @@
1
- {
2
- "name": "Search",
3
- "version": "0.0.0",
4
- "private": true,
5
- "main": "./Search.js"
6
- }
1
+ {
2
+ "name": "Search",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./Search.js"
6
+ }