shineout 3.6.5-beta.8 → 3.6.5

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/cjs/index.js CHANGED
@@ -514,5 +514,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
514
514
  // 此文件由脚本自动生成,请勿直接修改。
515
515
  // This file was generated automatically by a script. Please do not modify it directly.
516
516
  var _default = exports.default = {
517
- version: '3.6.5-beta.8'
517
+ version: '3.6.5'
518
518
  };
package/dist/shineout.js CHANGED
@@ -12217,7 +12217,7 @@ var handleStyle = function handleStyle(style) {
12217
12217
  };
12218
12218
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12219
12219
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12220
- /* harmony default export */ var version = ('3.6.5-beta.8');
12220
+ /* harmony default export */ var version = ('3.6.5');
12221
12221
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12222
12222
 
12223
12223
 
@@ -33995,9 +33995,16 @@ var accordion_jssStyle = {
33995
33995
  var ModalSubmit = function ModalSubmit(props) {
33996
33996
  var modalFormContext = useFormFooter();
33997
33997
  var handleClick = usePersistFn(function (e) {
33998
- var _props$onClick;
33999
- (_props$onClick = props.onClick) === null || _props$onClick === void 0 || _props$onClick.call(props, e);
34000
- modalFormContext === null || modalFormContext === void 0 || modalFormContext.func.submit();
33998
+ var _modalFormContext$fun;
33999
+ if (modalFormContext !== null && modalFormContext !== void 0 && (_modalFormContext$fun = modalFormContext.func) !== null && _modalFormContext$fun !== void 0 && _modalFormContext$fun.hasSubmit) {
34000
+ modalFormContext === null || modalFormContext === void 0 || modalFormContext.func.submit(true, function () {
34001
+ var _props$onClick;
34002
+ return (_props$onClick = props.onClick) === null || _props$onClick === void 0 ? void 0 : _props$onClick.call(props, e);
34003
+ });
34004
+ } else {
34005
+ var _props$onClick2;
34006
+ (_props$onClick2 = props.onClick) === null || _props$onClick2 === void 0 || _props$onClick2.call(props, e);
34007
+ }
34001
34008
  });
34002
34009
  return /*#__PURE__*/(0,jsx_runtime.jsx)(base_src_button_button, objectSpread2_default()(objectSpread2_default()({
34003
34010
  htmlType: "button",
@@ -49704,13 +49711,16 @@ var useForm = function useForm(props) {
49704
49711
  var values = Object.keys(vals);
49705
49712
  // 针对 name 为数组模式,如 datepicker 的 name={['startTime', 'endTime']} 时,前者校验可能需要依赖后者,因此需要提前将后者数据整合至 draft 用于多字段整合校验
49706
49713
  values.forEach(function (key) {
49707
- deepSet(draft, key, vals[key], deepSetOptions);
49714
+ // upload组件返回的可能是函数: (prev) => [...prev, file]
49715
+ var valueOfKey = typeof vals[key] === 'function' ? vals[key](getValue(key)) : vals[key];
49716
+ deepSet(draft, key, valueOfKey, deepSetOptions);
49708
49717
  });
49709
49718
  values.forEach(function (key) {
49710
49719
  if (option.validate) {
49711
49720
  var _context$validateMap$;
49712
49721
  (_context$validateMap$ = context.validateMap[key]) === null || _context$validateMap$ === void 0 || _context$validateMap$.forEach(function (validate) {
49713
- validate(key, vals[key], current(draft));
49722
+ var valueOfKey = typeof vals[key] === 'function' ? vals[key](getValue(key)) : vals[key];
49723
+ validate(key, valueOfKey, current(draft));
49714
49724
  });
49715
49725
  }
49716
49726
  });
@@ -49766,6 +49776,7 @@ var useForm = function useForm(props) {
49766
49776
  });
49767
49777
  var submit = use_persist_fn(function () {
49768
49778
  var withValidate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
49779
+ var callback = arguments.length > 1 ? arguments[1] : undefined;
49769
49780
  if (disabled) return;
49770
49781
  if (context.submitLock) {
49771
49782
  return;
@@ -49783,32 +49794,29 @@ var useForm = function useForm(props) {
49783
49794
  while (1) switch (_context.prev = _context.next) {
49784
49795
  case 0:
49785
49796
  if (withValidate) {
49786
- _context.next = 3;
49797
+ _context.next = 4;
49787
49798
  break;
49788
49799
  }
49789
49800
  (_props$onSubmit = props.onSubmit) === null || _props$onSubmit === void 0 || _props$onSubmit.call(props, (_context$value = context.value) !== null && _context$value !== void 0 ? _context$value : {});
49801
+ callback === null || callback === void 0 || callback();
49790
49802
  return _context.abrupt("return");
49791
- case 3:
49792
- _context.next = 5;
49803
+ case 4:
49804
+ _context.next = 6;
49793
49805
  return validateFields(undefined, {
49794
49806
  ignoreBind: true
49795
49807
  }).catch(function (e) {
49796
49808
  return e;
49797
49809
  });
49798
- case 5:
49810
+ case 6:
49799
49811
  result = _context.sent;
49800
- if (!(result === true)) {
49801
- _context.next = 11;
49802
- break;
49812
+ if (result === true) {
49813
+ (_props$onSubmit2 = props.onSubmit) === null || _props$onSubmit2 === void 0 || _props$onSubmit2.call(props, (_context$value2 = context.value) !== null && _context$value2 !== void 0 ? _context$value2 : {});
49814
+ if (activeEl) activeEl.focus();
49815
+ } else {
49816
+ handleSubmitError(result);
49803
49817
  }
49804
- (_props$onSubmit2 = props.onSubmit) === null || _props$onSubmit2 === void 0 || _props$onSubmit2.call(props, (_context$value2 = context.value) !== null && _context$value2 !== void 0 ? _context$value2 : {});
49805
- if (activeEl) activeEl.focus();
49806
- _context.next = 13;
49807
- break;
49808
- case 11:
49809
- handleSubmitError(result);
49810
- return _context.abrupt("return");
49811
- case 13:
49818
+ callback === null || callback === void 0 || callback();
49819
+ case 9:
49812
49820
  case "end":
49813
49821
  return _context.stop();
49814
49822
  }
@@ -50009,7 +50017,7 @@ var useForm = function useForm(props) {
50009
50017
  context.removeLock = false;
50010
50018
  // 内部 onChange 改的 value, 不需要更新
50011
50019
  if (props.value === context.value) {
50012
- // if (!isControl) update();
50020
+ if (!isControl) update();
50013
50021
  return;
50014
50022
  }
50015
50023
  if (initValidate && !context.resetTime) {
@@ -65438,6 +65446,7 @@ var TransferOperate = function TransferOperate(props) {
65438
65446
 
65439
65447
 
65440
65448
 
65449
+
65441
65450
  var Transfer = function Transfer(props) {
65442
65451
  var _jssStyle$transfer;
65443
65452
  var jssStyle = props.jssStyle,
@@ -65512,7 +65521,7 @@ var Transfer = function Transfer(props) {
65512
65521
  sourceSelectedKeys = _useTransfer.sourceSelectedKeys,
65513
65522
  targetSelectedKeys = _useTransfer.targetSelectedKeys,
65514
65523
  onFilter = _useTransfer.onFilter,
65515
- onSelectChange = _useTransfer.onSelectChange;
65524
+ _onSelectChange = _useTransfer.onSelectChange;
65516
65525
  var styles = (jssStyle === null || jssStyle === void 0 || (_jssStyle$transfer = jssStyle.transfer) === null || _jssStyle$transfer === void 0 ? void 0 : _jssStyle$transfer.call(jssStyle)) || {};
65517
65526
  var rootClass = classnames_default()(styles.rootClass, styles.transfer, className, defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()({}, styles.simple, simple), styles.small, size === 'small'), styles.large, size === 'large'), styles.equalPanelWidth, equalPanelWidth));
65518
65527
  var renderOperations = function renderOperations() {
@@ -65586,7 +65595,15 @@ var Transfer = function Transfer(props) {
65586
65595
  searchPlaceholder: placeholder,
65587
65596
  renderFilter: renderFilter,
65588
65597
  onFilter: onFilterProp ? onFilter : undefined,
65589
- onSelectChange: onSelectChange
65598
+ onSelectChange: function onSelectChange(keys) {
65599
+ if (isSource) {
65600
+ var newAllKeys = Array.from(new Set([].concat(toConsumableArray_default()(keys), toConsumableArray_default()(targetSelectedKeys || []))));
65601
+ _onSelectChange(newAllKeys, keys, targetSelectedKeys);
65602
+ } else {
65603
+ var _newAllKeys = Array.from(new Set([].concat(toConsumableArray_default()(keys), toConsumableArray_default()(sourceSelectedKeys || []))));
65604
+ _onSelectChange(_newAllKeys, sourceSelectedKeys, keys);
65605
+ }
65606
+ }
65590
65607
  });
65591
65608
  };
65592
65609
  var renderSourceList = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
@@ -70056,7 +70073,7 @@ var upload_interface = __webpack_require__(8821);
70056
70073
 
70057
70074
 
70058
70075
  /* harmony default export */ var src_0 = ({
70059
- version: '3.6.5-beta.8'
70076
+ version: '3.6.5'
70060
70077
  });
70061
70078
  }();
70062
70079
  /******/ return __webpack_exports__;