shineout 3.5.3-beta.4 → 3.5.3-beta.6

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
@@ -500,5 +500,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
500
500
  // 此文件由脚本自动生成,请勿直接修改。
501
501
  // This file was generated automatically by a script. Please do not modify it directly.
502
502
  var _default = exports.default = {
503
- version: '3.5.3-beta.4'
503
+ version: '3.5.3-beta.6'
504
504
  };
package/dist/shineout.js CHANGED
@@ -12030,7 +12030,7 @@ var handleStyle = function handleStyle(style) {
12030
12030
  };
12031
12031
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12032
12032
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12033
- /* harmony default export */ var version = ('3.5.3-beta.4');
12033
+ /* harmony default export */ var version = ('3.5.3-beta.6');
12034
12034
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12035
12035
 
12036
12036
 
@@ -40297,9 +40297,6 @@ function useFormControl(props) {
40297
40297
  }
40298
40298
  });
40299
40299
  setValueState(nextValue);
40300
- formFunc === null || formFunc === void 0 || formFunc.setValue(defineProperty_default()({}, name, nextValue), {
40301
- validate: false
40302
- });
40303
40300
  } else {
40304
40301
  var _value2 = getValue(name, formValue);
40305
40302
  var _error2 = getError(name, errors, severErrors);
@@ -40309,9 +40306,6 @@ function useFormControl(props) {
40309
40306
  if (!shallowEqual(_value2, latestInfo.valueState)) {
40310
40307
  if (_value2 === undefined && defaultValue !== undefined) {
40311
40308
  setValueState(defaultValue);
40312
- formFunc === null || formFunc === void 0 || formFunc.setValue(defineProperty_default()({}, name, defaultValue), {
40313
- validate: false
40314
- });
40315
40309
  } else {
40316
40310
  setValueState(_value2);
40317
40311
  }
@@ -47698,15 +47692,14 @@ var useForm = function useForm(props) {
47698
47692
  onChange(function (draft) {
47699
47693
  var values = Object.keys(vals);
47700
47694
  // 针对 name 为数组模式,如 datepicker 的 name={['startTime', 'endTime']} 时,前者校验可能需要依赖后者,因此需要提前将后者数据整合至 draft 用于多字段整合校验
47701
- var nextDraft = current(draft);
47702
47695
  values.forEach(function (key) {
47703
- deepSet(nextDraft, key, vals[key], deepSetOptions);
47696
+ deepSet(draft, key, vals[key], deepSetOptions);
47704
47697
  });
47705
47698
  values.forEach(function (key) {
47706
47699
  if (option.validate) {
47707
47700
  var _context$validateMap$;
47708
47701
  (_context$validateMap$ = context.validateMap[key]) === null || _context$validateMap$ === void 0 || _context$validateMap$.forEach(function (validate) {
47709
- validate(key, vals[key], nextDraft);
47702
+ validate(key, vals[key], current(draft));
47710
47703
  });
47711
47704
  }
47712
47705
  });
@@ -47719,6 +47712,17 @@ var useForm = function useForm(props) {
47719
47712
  });
47720
47713
  update(fullKeyPaths);
47721
47714
  });
47715
+ var updateDefaultValue = function updateDefaultValue() {
47716
+ if (!context.mounted) return;
47717
+ Object.keys(context.defaultValues).forEach(function (df) {
47718
+ var latestDefaultValue = getValue(df);
47719
+ if (latestDefaultValue === undefined) {
47720
+ setValue(defineProperty_default()({}, df, context.defaultValues[df]), {
47721
+ validate: false
47722
+ });
47723
+ }
47724
+ });
47725
+ };
47722
47726
  var getErrors = use_persist_fn(function () {
47723
47727
  return context.errors;
47724
47728
  });
@@ -47990,6 +47994,7 @@ var useForm = function useForm(props) {
47990
47994
  validateFields(keys).catch(function () {});
47991
47995
  }
47992
47996
  update();
47997
+ updateDefaultValue();
47993
47998
  context.resetTime = 0;
47994
47999
  }, [props.value]);
47995
48000
  external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
@@ -48619,7 +48624,7 @@ var FormFieldSet = function FormFieldSet(props) {
48619
48624
  // 更新 lastValues
48620
48625
  context.lastValues = valueArr;
48621
48626
  return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
48622
- children: "result"
48627
+ children: result
48623
48628
  });
48624
48629
  };
48625
48630
  /* harmony default export */ var form_fieldset = (FormFieldSet);
@@ -66959,7 +66964,7 @@ var upload_interface = __webpack_require__(8821);
66959
66964
 
66960
66965
 
66961
66966
  /* harmony default export */ var src_0 = ({
66962
- version: '3.5.3-beta.4'
66967
+ version: '3.5.3-beta.6'
66963
66968
  });
66964
66969
  }();
66965
66970
  /******/ return __webpack_exports__;