cloud-b2b 1.1.53 → 1.1.55

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.
@@ -147,6 +147,11 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
147
147
  onChange(key, value);
148
148
  }
149
149
  });
150
+ _defineProperty(_assertThisInitialized(_this2), "onFileChange", function (_ref, file) {
151
+ var key = _ref.key;
152
+ var onFileChange = _this2.props.onFileChange;
153
+ onFileChange && onFileChange(key, file);
154
+ });
150
155
  _defineProperty(_assertThisInitialized(_this2), "onExitValid", function (key, value) {
151
156
  if (key === _this2.validKey) {
152
157
  _this2.validKey = '';
@@ -162,9 +167,9 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
162
167
  var invalid = function invalid() {
163
168
  return null;
164
169
  };
165
- var _valid = function _valid(_ref) {
166
- var key = _ref.key,
167
- required = _ref.required;
170
+ var _valid = function _valid(_ref2) {
171
+ var key = _ref2.key,
172
+ required = _ref2.required;
168
173
  if (required) {
169
174
  if (!value || helper.isEmpty2(value[key]) || !_Array$isArray(value[key]) && _typeof(value[key]) === 'object' && helper.isEmpty(value[key].value)) {
170
175
  _this2.getValidState = invalid;
@@ -176,9 +181,9 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
176
181
  };
177
182
  _this2.getValidState = valid ? _valid : invalid;
178
183
  });
179
- _defineProperty(_assertThisInitialized(_this2), "validDate", function (_ref2) {
180
- var key = _ref2.key,
181
- type = _ref2.type;
184
+ _defineProperty(_assertThisInitialized(_this2), "validDate", function (_ref3) {
185
+ var key = _ref3.key,
186
+ type = _ref3.type;
182
187
  return function (date) {
183
188
  var _this2$props$value = _this2.props.value,
184
189
  value = _this2$props$value === void 0 ? {} : _this2$props$value;
@@ -227,10 +232,10 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
227
232
  });
228
233
  }
229
234
  });
230
- _defineProperty(_assertThisInitialized(_this2), "getType", function (_ref3) {
235
+ _defineProperty(_assertThisInitialized(_this2), "getType", function (_ref4) {
231
236
  var _context2;
232
- var key = _ref3.key,
233
- type = _ref3.type;
237
+ var key = _ref4.key,
238
+ type = _ref4.type;
234
239
  var readonly = _this2.props.readonly;
235
240
  if (_includesInstanceProperty(_context2 = ['area', 'uploadImg']).call(_context2, type)) {
236
241
  return type;
@@ -246,11 +251,11 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
246
251
  return type;
247
252
  }
248
253
  });
249
- _defineProperty(_assertThisInitialized(_this2), "specialProps", function (type, _ref4) {
250
- var key = _ref4.key,
251
- _ref4$props = _ref4.props,
252
- props = _ref4$props === void 0 ? {} : _ref4$props,
253
- originType = _ref4.type;
254
+ _defineProperty(_assertThisInitialized(_this2), "specialProps", function (type, _ref5) {
255
+ var key = _ref5.key,
256
+ _ref5$props = _ref5.props,
257
+ props = _ref5$props === void 0 ? {} : _ref5$props,
258
+ originType = _ref5.type;
254
259
  if (type === 'readonly') {
255
260
  var _this2$props$highLigh = _this2.props.highLightKeys,
256
261
  highLightKeys = _this2$props$highLigh === void 0 ? [] : _this2$props$highLigh;
@@ -358,9 +363,9 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
358
363
  delete props.value;
359
364
  return /*#__PURE__*/React.createElement(Control, props);
360
365
  });
361
- _defineProperty(_assertThisInitialized(_this2), "toSelect", function (props, _ref5) {
362
- var options = _ref5.options,
363
- key = _ref5.key;
366
+ _defineProperty(_assertThisInitialized(_this2), "toSelect", function (props, _ref6) {
367
+ var options = _ref6.options,
368
+ key = _ref6.key;
364
369
  props.getPopupContainer = _this2.getPopupContainer;
365
370
  props.options = _this2.getOptions(key, options);
366
371
  props.dropdownMatchSelectWidth = false;
@@ -382,8 +387,8 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
382
387
  props.dropdownMatchSelectWidth = false;
383
388
  return /*#__PURE__*/React.createElement(Control, props);
384
389
  });
385
- _defineProperty(_assertThisInitialized(_this2), "toDate", function (props, _ref6) {
386
- var rule = _ref6.rule;
390
+ _defineProperty(_assertThisInitialized(_this2), "toDate", function (props, _ref7) {
391
+ var rule = _ref7.rule;
387
392
  props.getCalendarContainer = _this2.getPopupContainer;
388
393
  props.style = {
389
394
  width: '100%'
@@ -391,15 +396,15 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
391
396
  rule && (props.disabledDate = _this2.validDate(rule));
392
397
  return /*#__PURE__*/React.createElement(Control, props);
393
398
  });
394
- _defineProperty(_assertThisInitialized(_this2), "toRadioGroup", function (props, _ref7) {
395
- var key = _ref7.key,
396
- options = _ref7.options;
399
+ _defineProperty(_assertThisInitialized(_this2), "toRadioGroup", function (props, _ref8) {
400
+ var key = _ref8.key,
401
+ options = _ref8.options;
397
402
  props.options = _this2.getOptions(key, options);
398
403
  return /*#__PURE__*/React.createElement(Control, props);
399
404
  });
400
- _defineProperty(_assertThisInitialized(_this2), "toReadonly", function (props, _ref8) {
401
- var options = _ref8.options,
402
- key = _ref8.key;
405
+ _defineProperty(_assertThisInitialized(_this2), "toReadonly", function (props, _ref9) {
406
+ var options = _ref9.options,
407
+ key = _ref9.key;
403
408
  props.value = getTitle(props.value, _this2.getOptions(key, options));
404
409
  return /*#__PURE__*/React.createElement(Control, props);
405
410
  });
@@ -410,9 +415,9 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
410
415
  props.dropdownMatchSelectWidth = false;
411
416
  return /*#__PURE__*/React.createElement(Control, props);
412
417
  });
413
- _defineProperty(_assertThisInitialized(_this2), "area", function (props, _ref9) {
414
- var key = _ref9.key,
415
- options = _ref9.options;
418
+ _defineProperty(_assertThisInitialized(_this2), "area", function (props, _ref10) {
419
+ var key = _ref10.key,
420
+ options = _ref10.options;
416
421
  var readonly = _this2.props.readonly;
417
422
  props.parentKey = key;
418
423
  props.options = _this2.getOptions(key, options);
@@ -491,10 +496,10 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
491
496
  return 'type error';
492
497
  }
493
498
  });
494
- _defineProperty(_assertThisInitialized(_this2), "toLabel", function (_ref10, type) {
495
- var title = _ref10.title,
496
- showAdd = _ref10.showAdd,
497
- key = _ref10.key;
499
+ _defineProperty(_assertThisInitialized(_this2), "toLabel", function (_ref11, type) {
500
+ var title = _ref11.title,
501
+ showAdd = _ref11.showAdd,
502
+ key = _ref11.key;
498
503
  if (showAdd && type !== 'readonly') {
499
504
  var _context15;
500
505
  var onClick = _bindInstanceProperty(_context15 = _this2.onAdd).call(_context15, _assertThisInitialized(_this2), key, title);
@@ -25,6 +25,7 @@ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
25
25
  import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
26
26
  import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
27
27
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
28
+ import _Radio from "antd/es/radio";
28
29
  var _excluded = ["onRowClick"];
29
30
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (_Array$isArray(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; } } }; }
30
31
  function _unsupportedIterableToArray(o, minLen) { var _context20; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context20 = Object.prototype.toString.call(o)).call(_context20, 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); }
@@ -33,8 +34,8 @@ function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymb
33
34
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context18, _context19; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context18 = ownKeys(Object(t), !0)).call(_context18, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context19 = ownKeys(Object(t))).call(_context19, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
34
35
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
35
36
  import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
36
- import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
37
37
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
38
+ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
38
39
  import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
39
40
  import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
40
41
  import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
@@ -52,6 +53,7 @@ import SuperToolbar from '../SuperToolbar';
52
53
  import variables from '../variables';
53
54
  import helper, { getObjectExclude } from '../helper';
54
55
  import DragSortRow from "../SuperTable/DragSortRow";
56
+ var RadioGroup = _Radio.Group;
55
57
  var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select',
56
58
  //存储value
57
59
  'selectText',
@@ -62,7 +64,7 @@ var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select',
62
64
  //按钮组
63
65
  'img',
64
66
  //图片标题组 value为{src,title}时显示图片标题 为字符串时 只显示图片
65
- 'uploadImg', 'double'];
67
+ 'uploadImg', 'double', 'radioGroup'];
66
68
 
67
69
  /**
68
70
  * key:标识所在列,在一个表格中必须唯一
@@ -240,6 +242,25 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
240
242
  return true;
241
243
  }
242
244
  });
245
+ _defineProperty(_assertThisInitialized(_this), "toRadio", function (_ref12, index) {
246
+ var value = _ref12.value,
247
+ title = _ref12.title;
248
+ return /*#__PURE__*/React.createElement(_Radio, {
249
+ key: index,
250
+ value: String(value)
251
+ }, title);
252
+ });
253
+ _defineProperty(_assertThisInitialized(_this), "renderRadioGroup", function (config, value, index) {
254
+ var key = config.key,
255
+ options = config.options;
256
+ var radioGroupProps = {
257
+ onChange: function onChange(e) {
258
+ _this.onChange(key, index)(e.target.value);
259
+ },
260
+ value: value
261
+ };
262
+ return /*#__PURE__*/React.createElement(RadioGroup, radioGroupProps, _mapInstanceProperty(options).call(options, _this.toRadio));
263
+ });
243
264
  _defineProperty(_assertThisInitialized(_this), "renderEditableCell", function (config, value, index) {
244
265
  var key = config.key,
245
266
  type = config.type,
@@ -373,8 +394,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
373
394
  var _context2;
374
395
  var split = index2 === list.length - 1 ? '' : ',';
375
396
  var onClick = function onClick() {
376
- var _ref12 = _this.props.callback || {},
377
- onLink = _ref12.onLink;
397
+ var _ref13 = _this.props.callback || {},
398
+ onLink = _ref13.onLink;
378
399
  onLink && onLink(col.key, index, item2);
379
400
  };
380
401
  return /*#__PURE__*/React.createElement("a", {
@@ -385,8 +406,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
385
406
  } else {
386
407
  var title = typeof col.link === 'string' ? col.link : value;
387
408
  var onClick = function onClick() {
388
- var _ref13 = _this.props.callback || {},
389
- onLink = _ref13.onLink;
409
+ var _ref14 = _this.props.callback || {},
410
+ onLink = _ref14.onLink;
390
411
  onLink && onLink(col.key, index, record);
391
412
  };
392
413
  return /*#__PURE__*/React.createElement("a", {
@@ -452,6 +473,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
452
473
  type: col.bsStyle
453
474
  }, record[col.key] || col.typeRelated);
454
475
  }
476
+ case 'radioGroup':
477
+ return _this.renderRadioGroup(col, value, record.key);
455
478
  case 'switch':
456
479
  return typeof value === 'string' ? /*#__PURE__*/React.createElement("div", null, value) : /*#__PURE__*/React.createElement(_Switch, {
457
480
  checkedChildren: col.props.checkedChildren || '',
@@ -571,12 +594,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
571
594
  return null;
572
595
  }
573
596
  });
574
- _defineProperty(_assertThisInitialized(_this), "getColumnTitle", function (_ref14) {
575
- var required = _ref14.required,
576
- title = _ref14.title,
577
- type = _ref14.type,
578
- key = _ref14.key,
579
- showAdd = _ref14.showAdd;
597
+ _defineProperty(_assertThisInitialized(_this), "getColumnTitle", function (_ref15) {
598
+ var required = _ref15.required,
599
+ title = _ref15.title,
600
+ type = _ref15.type,
601
+ key = _ref15.key,
602
+ showAdd = _ref15.showAdd;
580
603
  if (type === 'checkbox') {
581
604
  var status = _this.getCheckedStatus(key);
582
605
  return /*#__PURE__*/React.createElement(_Checkbox, _extends({
@@ -589,9 +612,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
589
612
  }, title, _this.toAdd(key, showAdd));
590
613
  }
591
614
  });
592
- _defineProperty(_assertThisInitialized(_this), "getColumnClassName", function (_ref15) {
593
- var type = _ref15.type,
594
- align = _ref15.align;
615
+ _defineProperty(_assertThisInitialized(_this), "getColumnClassName", function (_ref16) {
616
+ var type = _ref16.type,
617
+ align = _ref16.align;
595
618
  if (type === 'index' || type === 'checkbox') {
596
619
  return 'ant-table-selection-column';
597
620
  } else {
@@ -607,9 +630,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
607
630
  var readonly = _this.props.readonly;
608
631
  return _mapInstanceProperty(_context12 = _filterInstanceProperty(cols).call(cols, function (col) {
609
632
  return !col.hide;
610
- })).call(_context12, function (_ref16, index) {
633
+ })).call(_context12, function (_ref17, index) {
611
634
  var _context13;
612
- var col = _extends({}, (_objectDestructuringEmpty(_ref16), _ref16));
635
+ var col = _extends({}, (_objectDestructuringEmpty(_ref17), _ref17));
613
636
  col.className = _this.getColumnClassName(col);
614
637
  col.title = _this.getColumnTitle(col);
615
638
  col.dataIndex = col.key;
@@ -641,11 +664,11 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
641
664
  });
642
665
  _defineProperty(_assertThisInitialized(_this), "getDataSource", function (items, cols) {
643
666
  return _mapInstanceProperty(items).call(items, function (item, index) {
644
- return _reduceInstanceProperty(cols).call(cols, function (result, _ref17) {
667
+ return _reduceInstanceProperty(cols).call(cols, function (result, _ref18) {
645
668
  var _context14, _context15;
646
- var key = _ref17.key,
647
- type = _ref17.type,
648
- options = _ref17.options;
669
+ var key = _ref18.key,
670
+ type = _ref18.type,
671
+ options = _ref18.options;
649
672
  if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || _Array$isArray(item.isReadonly) && !_includesInstanceProperty(_context14 = item.isReadonly).call(_context14, key)) || _includesInstanceProperty(_context15 = ['img', 'switch', 'custom', 'img', 'toolbar', 'uploadImg']).call(_context15, type)) {
650
673
  result[key] = item[key];
651
674
  } else {
@@ -159,6 +159,11 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
159
159
  onChange(key, value);
160
160
  }
161
161
  });
162
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onFileChange", function (_ref, file) {
163
+ var key = _ref.key;
164
+ var onFileChange = _this2.props.onFileChange;
165
+ onFileChange && onFileChange(key, file);
166
+ });
162
167
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onExitValid", function (key, value) {
163
168
  if (key === _this2.validKey) {
164
169
  _this2.validKey = '';
@@ -174,9 +179,9 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
174
179
  var invalid = function invalid() {
175
180
  return null;
176
181
  };
177
- var _valid = function _valid(_ref) {
178
- var key = _ref.key,
179
- required = _ref.required;
182
+ var _valid = function _valid(_ref2) {
183
+ var key = _ref2.key,
184
+ required = _ref2.required;
180
185
  if (required) {
181
186
  if (!value || _helper["default"].isEmpty2(value[key]) || !(0, _isArray["default"])(value[key]) && (0, _typeof2["default"])(value[key]) === 'object' && _helper["default"].isEmpty(value[key].value)) {
182
187
  _this2.getValidState = invalid;
@@ -188,9 +193,9 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
188
193
  };
189
194
  _this2.getValidState = valid ? _valid : invalid;
190
195
  });
191
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "validDate", function (_ref2) {
192
- var key = _ref2.key,
193
- type = _ref2.type;
196
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "validDate", function (_ref3) {
197
+ var key = _ref3.key,
198
+ type = _ref3.type;
194
199
  return function (date) {
195
200
  var _this2$props$value = _this2.props.value,
196
201
  value = _this2$props$value === void 0 ? {} : _this2$props$value;
@@ -239,10 +244,10 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
239
244
  });
240
245
  }
241
246
  });
242
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getType", function (_ref3) {
247
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getType", function (_ref4) {
243
248
  var _context2;
244
- var key = _ref3.key,
245
- type = _ref3.type;
249
+ var key = _ref4.key,
250
+ type = _ref4.type;
246
251
  var readonly = _this2.props.readonly;
247
252
  if ((0, _includes["default"])(_context2 = ['area', 'uploadImg']).call(_context2, type)) {
248
253
  return type;
@@ -258,11 +263,11 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
258
263
  return type;
259
264
  }
260
265
  });
261
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "specialProps", function (type, _ref4) {
262
- var key = _ref4.key,
263
- _ref4$props = _ref4.props,
264
- props = _ref4$props === void 0 ? {} : _ref4$props,
265
- originType = _ref4.type;
266
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "specialProps", function (type, _ref5) {
267
+ var key = _ref5.key,
268
+ _ref5$props = _ref5.props,
269
+ props = _ref5$props === void 0 ? {} : _ref5$props,
270
+ originType = _ref5.type;
266
271
  if (type === 'readonly') {
267
272
  var _this2$props$highLigh = _this2.props.highLightKeys,
268
273
  highLightKeys = _this2$props$highLigh === void 0 ? [] : _this2$props$highLigh;
@@ -370,9 +375,9 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
370
375
  delete props.value;
371
376
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
372
377
  });
373
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toSelect", function (props, _ref5) {
374
- var options = _ref5.options,
375
- key = _ref5.key;
378
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toSelect", function (props, _ref6) {
379
+ var options = _ref6.options,
380
+ key = _ref6.key;
376
381
  props.getPopupContainer = _this2.getPopupContainer;
377
382
  props.options = _this2.getOptions(key, options);
378
383
  props.dropdownMatchSelectWidth = false;
@@ -394,8 +399,8 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
394
399
  props.dropdownMatchSelectWidth = false;
395
400
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
396
401
  });
397
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toDate", function (props, _ref6) {
398
- var rule = _ref6.rule;
402
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toDate", function (props, _ref7) {
403
+ var rule = _ref7.rule;
399
404
  props.getCalendarContainer = _this2.getPopupContainer;
400
405
  props.style = {
401
406
  width: '100%'
@@ -403,15 +408,15 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
403
408
  rule && (props.disabledDate = _this2.validDate(rule));
404
409
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
405
410
  });
406
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toRadioGroup", function (props, _ref7) {
407
- var key = _ref7.key,
408
- options = _ref7.options;
411
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toRadioGroup", function (props, _ref8) {
412
+ var key = _ref8.key,
413
+ options = _ref8.options;
409
414
  props.options = _this2.getOptions(key, options);
410
415
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
411
416
  });
412
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toReadonly", function (props, _ref8) {
413
- var options = _ref8.options,
414
- key = _ref8.key;
417
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toReadonly", function (props, _ref9) {
418
+ var options = _ref9.options,
419
+ key = _ref9.key;
415
420
  props.value = (0, _Control.getTitle)(props.value, _this2.getOptions(key, options));
416
421
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
417
422
  });
@@ -422,9 +427,9 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
422
427
  props.dropdownMatchSelectWidth = false;
423
428
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
424
429
  });
425
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "area", function (props, _ref9) {
426
- var key = _ref9.key,
427
- options = _ref9.options;
430
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "area", function (props, _ref10) {
431
+ var key = _ref10.key,
432
+ options = _ref10.options;
428
433
  var readonly = _this2.props.readonly;
429
434
  props.parentKey = key;
430
435
  props.options = _this2.getOptions(key, options);
@@ -503,10 +508,10 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
503
508
  return 'type error';
504
509
  }
505
510
  });
506
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toLabel", function (_ref10, type) {
507
- var title = _ref10.title,
508
- showAdd = _ref10.showAdd,
509
- key = _ref10.key;
511
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toLabel", function (_ref11, type) {
512
+ var title = _ref11.title,
513
+ showAdd = _ref11.showAdd,
514
+ key = _ref11.key;
510
515
  if (showAdd && type !== 'readonly') {
511
516
  var _context15;
512
517
  var onClick = (0, _bind["default"])(_context15 = _this2.onAdd).call(_context15, (0, _assertThisInitialized2["default"])(_this2), key, title);
@@ -25,8 +25,8 @@ var _table = _interopRequireDefault(require("antd/lib/table"));
25
25
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
26
26
  var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
27
27
  var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
28
- var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
29
28
  var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
29
+ var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
30
30
  var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
31
31
  var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
32
32
  var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
@@ -45,6 +45,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/
45
45
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
46
46
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
47
47
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
48
+ var _radio = _interopRequireDefault(require("antd/lib/radio"));
48
49
  var _react = _interopRequireDefault(require("react"));
49
50
  var _propTypes = _interopRequireDefault(require("prop-types"));
50
51
  var _reactDom = _interopRequireDefault(require("react-dom"));
@@ -65,6 +66,7 @@ function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymb
65
66
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context18, _context19; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context18 = ownKeys(Object(t), !0)).call(_context18, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context19 = ownKeys(Object(t))).call(_context19, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
66
67
  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); }; }
67
68
  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; } }
69
+ var RadioGroup = _radio["default"].Group;
68
70
  var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select',
69
71
  //存储value
70
72
  'selectText',
@@ -75,7 +77,7 @@ var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select',
75
77
  //按钮组
76
78
  'img',
77
79
  //图片标题组 value为{src,title}时显示图片标题 为字符串时 只显示图片
78
- 'uploadImg', 'double'];
80
+ 'uploadImg', 'double', 'radioGroup'];
79
81
 
80
82
  /**
81
83
  * key:标识所在列,在一个表格中必须唯一
@@ -253,6 +255,25 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
253
255
  return true;
254
256
  }
255
257
  });
258
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toRadio", function (_ref12, index) {
259
+ var value = _ref12.value,
260
+ title = _ref12.title;
261
+ return /*#__PURE__*/_react["default"].createElement(_radio["default"], {
262
+ key: index,
263
+ value: String(value)
264
+ }, title);
265
+ });
266
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderRadioGroup", function (config, value, index) {
267
+ var key = config.key,
268
+ options = config.options;
269
+ var radioGroupProps = {
270
+ onChange: function onChange(e) {
271
+ _this.onChange(key, index)(e.target.value);
272
+ },
273
+ value: value
274
+ };
275
+ return /*#__PURE__*/_react["default"].createElement(RadioGroup, radioGroupProps, (0, _map["default"])(options).call(options, _this.toRadio));
276
+ });
256
277
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderEditableCell", function (config, value, index) {
257
278
  var key = config.key,
258
279
  type = config.type,
@@ -386,8 +407,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
386
407
  var _context2;
387
408
  var split = index2 === list.length - 1 ? '' : ',';
388
409
  var onClick = function onClick() {
389
- var _ref12 = _this.props.callback || {},
390
- onLink = _ref12.onLink;
410
+ var _ref13 = _this.props.callback || {},
411
+ onLink = _ref13.onLink;
391
412
  onLink && onLink(col.key, index, item2);
392
413
  };
393
414
  return /*#__PURE__*/_react["default"].createElement("a", {
@@ -398,8 +419,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
398
419
  } else {
399
420
  var title = typeof col.link === 'string' ? col.link : value;
400
421
  var onClick = function onClick() {
401
- var _ref13 = _this.props.callback || {},
402
- onLink = _ref13.onLink;
422
+ var _ref14 = _this.props.callback || {},
423
+ onLink = _ref14.onLink;
403
424
  onLink && onLink(col.key, index, record);
404
425
  };
405
426
  return /*#__PURE__*/_react["default"].createElement("a", {
@@ -465,6 +486,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
465
486
  type: col.bsStyle
466
487
  }, record[col.key] || col.typeRelated);
467
488
  }
489
+ case 'radioGroup':
490
+ return _this.renderRadioGroup(col, value, record.key);
468
491
  case 'switch':
469
492
  return typeof value === 'string' ? /*#__PURE__*/_react["default"].createElement("div", null, value) : /*#__PURE__*/_react["default"].createElement(_switch["default"], {
470
493
  checkedChildren: col.props.checkedChildren || '',
@@ -584,12 +607,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
584
607
  return null;
585
608
  }
586
609
  });
587
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnTitle", function (_ref14) {
588
- var required = _ref14.required,
589
- title = _ref14.title,
590
- type = _ref14.type,
591
- key = _ref14.key,
592
- showAdd = _ref14.showAdd;
610
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnTitle", function (_ref15) {
611
+ var required = _ref15.required,
612
+ title = _ref15.title,
613
+ type = _ref15.type,
614
+ key = _ref15.key,
615
+ showAdd = _ref15.showAdd;
593
616
  if (type === 'checkbox') {
594
617
  var status = _this.getCheckedStatus(key);
595
618
  return /*#__PURE__*/_react["default"].createElement(_checkbox["default"], (0, _extends2["default"])({
@@ -602,9 +625,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
602
625
  }, title, _this.toAdd(key, showAdd));
603
626
  }
604
627
  });
605
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnClassName", function (_ref15) {
606
- var type = _ref15.type,
607
- align = _ref15.align;
628
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnClassName", function (_ref16) {
629
+ var type = _ref16.type,
630
+ align = _ref16.align;
608
631
  if (type === 'index' || type === 'checkbox') {
609
632
  return 'ant-table-selection-column';
610
633
  } else {
@@ -620,9 +643,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
620
643
  var readonly = _this.props.readonly;
621
644
  return (0, _map["default"])(_context12 = (0, _filter["default"])(cols).call(cols, function (col) {
622
645
  return !col.hide;
623
- })).call(_context12, function (_ref16, index) {
646
+ })).call(_context12, function (_ref17, index) {
624
647
  var _context13;
625
- var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref16), _ref16));
648
+ var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref17), _ref17));
626
649
  col.className = _this.getColumnClassName(col);
627
650
  col.title = _this.getColumnTitle(col);
628
651
  col.dataIndex = col.key;
@@ -654,11 +677,11 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
654
677
  });
655
678
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getDataSource", function (items, cols) {
656
679
  return (0, _map["default"])(items).call(items, function (item, index) {
657
- return (0, _reduce["default"])(cols).call(cols, function (result, _ref17) {
680
+ return (0, _reduce["default"])(cols).call(cols, function (result, _ref18) {
658
681
  var _context14, _context15;
659
- var key = _ref17.key,
660
- type = _ref17.type,
661
- options = _ref17.options;
682
+ var key = _ref18.key,
683
+ type = _ref18.type,
684
+ options = _ref18.options;
662
685
  if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || (0, _isArray["default"])(item.isReadonly) && !(0, _includes["default"])(_context14 = item.isReadonly).call(_context14, key)) || (0, _includes["default"])(_context15 = ['img', 'switch', 'custom', 'img', 'toolbar', 'uploadImg']).call(_context15, type)) {
663
686
  result[key] = item[key];
664
687
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloud-b2b",
3
- "version": "1.1.53",
3
+ "version": "1.1.55",
4
4
  "description": "A react component library dependent antd",
5
5
  "keywords": [
6
6
  "react",