shineout 3.7.11-beta.2 → 3.7.11-beta.4

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
@@ -522,5 +522,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
522
522
  // 此文件由脚本自动生成,请勿直接修改。
523
523
  // This file was generated automatically by a script. Please do not modify it directly.
524
524
  var _default = exports.default = {
525
- version: '3.7.11-beta.2'
525
+ version: '3.7.11-beta.4'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12234,7 +12234,7 @@ var handleStyle = function handleStyle(style) {
12234
12234
  };
12235
12235
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12236
12236
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12237
- /* harmony default export */ var version = ('3.7.11-beta.2');
12237
+ /* harmony default export */ var version = ('3.7.11-beta.4');
12238
12238
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12239
12239
 
12240
12240
 
@@ -30370,26 +30370,11 @@ var usePopup = function usePopup(props) {
30370
30370
  }
30371
30371
  setOpenState(!!props.open);
30372
30372
  }, [props.open]);
30373
-
30374
- // const getPopUpHeight = () => {
30375
- // let height = 0;
30376
- // if (popupRef.current) {
30377
- // const el = popupRef.current;
30378
- // const parent = el?.parentElement;
30379
- // let clone = el.cloneNode(true) as HTMLElement;
30380
- // clone.style.opacity = '0';
30381
- // clone.style.display = '';
30382
- // clone.style.visibility = 'visible';
30383
- // clone.style.pointerEvents = 'none';
30384
- // parent?.appendChild(clone);
30385
- // height = clone.offsetHeight;
30386
- // parent?.removeChild(clone);
30387
- // //@ts-ignore
30388
- // clone = null;
30389
- // }
30390
- // return height;
30391
- // };
30392
-
30373
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
30374
+ if (defaultOpen) {
30375
+ setOpenState(true);
30376
+ }
30377
+ }, []);
30393
30378
  var handleFocus = function handleFocus(delay) {
30394
30379
  if (props.open === undefined) {
30395
30380
  updatePosition();
@@ -43323,8 +43308,27 @@ function useFormControl(props) {
43323
43308
  if (onChangePo) onChangePo.apply(void 0, [v].concat(other));
43324
43309
  if (validateFieldSet) validateFieldSet();
43325
43310
  });
43311
+ var initError = use_persist_fn(function () {
43312
+ var errors = formFunc === null || formFunc === void 0 ? void 0 : formFunc.getErrors();
43313
+ if (isArray(name)) {
43314
+ for (var i = 0; i < name.length; i++) {
43315
+ var n = name[i];
43316
+ var currentErrorInForm = errors === null || errors === void 0 ? void 0 : errors[n];
43317
+ if (currentErrorInForm) {
43318
+ setErrorState(currentErrorInForm);
43319
+ break;
43320
+ }
43321
+ }
43322
+ } else {
43323
+ var _currentErrorInForm = errors === null || errors === void 0 ? void 0 : errors[name];
43324
+ if (_currentErrorInForm) {
43325
+ setErrorState(_currentErrorInForm);
43326
+ }
43327
+ }
43328
+ });
43326
43329
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
43327
43330
  if (inForm && controlFunc) {
43331
+ initError();
43328
43332
  if (isArray(name)) {
43329
43333
  var dv = isArray(defaultValue) ? defaultValue : [];
43330
43334
  name.forEach(function (n, index) {
@@ -50950,6 +50954,9 @@ var useForm = function useForm(props) {
50950
50954
  context.removeArr.forEach(function (n) {
50951
50955
  deepRemove(v, n);
50952
50956
  context.removeArr.delete(n);
50957
+ if (context.errors[n]) {
50958
+ delete context.errors[n];
50959
+ }
50953
50960
  });
50954
50961
  });
50955
50962
  };
@@ -51182,9 +51189,6 @@ var useForm = function useForm(props) {
51182
51189
  context.names.delete(n);
51183
51190
  delete context.defaultValues[n];
51184
51191
  }
51185
- if (context.errors[n]) {
51186
- delete context.errors[n];
51187
- }
51188
51192
  var finalReserveAble = (_props$reserveAble = props.reserveAble) !== null && _props$reserveAble !== void 0 ? _props$reserveAble : reserveAble;
51189
51193
  if (!finalReserveAble && !context.removeLock) {
51190
51194
  addRemove(n);
@@ -71937,7 +71941,7 @@ var upload_interface = __webpack_require__(8821);
71937
71941
 
71938
71942
 
71939
71943
  /* harmony default export */ var src_0 = ({
71940
- version: '3.7.11-beta.2'
71944
+ version: '3.7.11-beta.4'
71941
71945
  });
71942
71946
  }();
71943
71947
  /******/ return __webpack_exports__;