shineout 3.5.3-beta.5 → 3.5.3-beta.7

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.5'
503
+ version: '3.5.3-beta.7'
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.5');
12033
+ /* harmony default export */ var version = ('3.5.3-beta.7');
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
  }
@@ -43455,6 +43449,7 @@ var Day = function Day(props) {
43455
43449
  var weekDays = Array.from({
43456
43450
  length: 7
43457
43451
  }).map(function (_, index) {
43452
+ // weekStartsOn可能是字符串,需要转换为数字,否则得到星期顺序不正确
43458
43453
  var num = (props.options.weekStartsOn + index) % 7;
43459
43454
  return weeks[num];
43460
43455
  });
@@ -43610,6 +43605,9 @@ var Day = function Day(props) {
43610
43605
  length: len
43611
43606
  }).map(function (_, index) {
43612
43607
  var start = index * 7;
43608
+ // console.log('======================')
43609
+ // console.log('days, start, days[start + 3]: >>', days, start, days[start + 3])
43610
+ // console.log('======================')
43613
43611
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("tr", {
43614
43612
  className: classnames_default()(styles === null || styles === void 0 ? void 0 : styles.pickerRow, props.type === 'week' && (styles === null || styles === void 0 ? void 0 : styles.pickerRowWeek)),
43615
43613
  children: [renderWeek(days[start + 3]), days.slice(start, start + 7).map(function (item, index) {
@@ -47698,15 +47696,14 @@ var useForm = function useForm(props) {
47698
47696
  onChange(function (draft) {
47699
47697
  var values = Object.keys(vals);
47700
47698
  // 针对 name 为数组模式,如 datepicker 的 name={['startTime', 'endTime']} 时,前者校验可能需要依赖后者,因此需要提前将后者数据整合至 draft 用于多字段整合校验
47701
- var nextDraft = current(draft);
47702
47699
  values.forEach(function (key) {
47703
- deepSet(nextDraft, key, vals[key], deepSetOptions);
47700
+ deepSet(draft, key, vals[key], deepSetOptions);
47704
47701
  });
47705
47702
  values.forEach(function (key) {
47706
47703
  if (option.validate) {
47707
47704
  var _context$validateMap$;
47708
47705
  (_context$validateMap$ = context.validateMap[key]) === null || _context$validateMap$ === void 0 || _context$validateMap$.forEach(function (validate) {
47709
- validate(key, vals[key], nextDraft);
47706
+ validate(key, vals[key], current(draft));
47710
47707
  });
47711
47708
  }
47712
47709
  });
@@ -47719,6 +47716,17 @@ var useForm = function useForm(props) {
47719
47716
  });
47720
47717
  update(fullKeyPaths);
47721
47718
  });
47719
+ var updateDefaultValue = function updateDefaultValue() {
47720
+ if (!context.mounted) return;
47721
+ Object.keys(context.defaultValues).forEach(function (df) {
47722
+ var latestDefaultValue = getValue(df);
47723
+ if (latestDefaultValue === undefined) {
47724
+ setValue(defineProperty_default()({}, df, context.defaultValues[df]), {
47725
+ validate: false
47726
+ });
47727
+ }
47728
+ });
47729
+ };
47722
47730
  var getErrors = use_persist_fn(function () {
47723
47731
  return context.errors;
47724
47732
  });
@@ -47990,6 +47998,7 @@ var useForm = function useForm(props) {
47990
47998
  validateFields(keys).catch(function () {});
47991
47999
  }
47992
48000
  update();
48001
+ updateDefaultValue();
47993
48002
  context.resetTime = 0;
47994
48003
  }, [props.value]);
47995
48004
  external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
@@ -66959,7 +66968,7 @@ var upload_interface = __webpack_require__(8821);
66959
66968
 
66960
66969
 
66961
66970
  /* harmony default export */ var src_0 = ({
66962
- version: '3.5.3-beta.5'
66971
+ version: '3.5.3-beta.7'
66963
66972
  });
66964
66973
  }();
66965
66974
  /******/ return __webpack_exports__;