ronds-metadata 1.3.22 → 1.3.24

Sign up to get free protection for your applications and to get access to all the features.
@@ -37,7 +37,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
37
37
  /*
38
38
  * @Author:wangxian
39
39
  * @Date: 2021-09-18 14:15:04
40
- * @LastEditTime: 2023-08-21 09:28:47
40
+ * @LastEditTime: 2023-11-27 10:51:07
41
41
  */
42
42
  import React from 'react';
43
43
  import { MetadataFormContext, MetadataRefContext } from '../interface';
@@ -5,7 +5,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
5
  /*
6
6
  * @Author: wangxian
7
7
  * @Date: 2021-09-18 14:15:04
8
- * @LastEditTime: 2023-06-14 09:27:20
8
+ * @LastEditTime: 2023-11-27 11:19:01
9
9
  */
10
10
  import React from 'react';
11
11
  import { deepClone } from '../../../utils';
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
4
  /*
5
5
  * @Author: your name
6
6
  * @Date: 2021-09-18 14:15:04
7
- * @LastEditTime: 2023-11-01 15:56:30
7
+ * @LastEditTime: 2023-11-27 13:58:40
8
8
  */
9
9
  import { getLocale } from '../../../framework/locale';
10
10
  import moment from 'moment';
@@ -61,7 +61,7 @@ export var useWatchDepend = function useWatchDepend(_depends, stream$, name) {
61
61
  if ((p === null || p === void 0 ? void 0 : p.type) === STREAM_EVENT_TYPE.ON_VALUES_CHANGE) {
62
62
  if (_depends === null || _depends === void 0 ? void 0 : _depends.hidden) {
63
63
  var _p$payload;
64
- var _hidden = processDependHiddenOrShow(_depends === null || _depends === void 0 ? void 0 : _depends.hidden, p === null || p === void 0 ? void 0 : (_p$payload = p.payload) === null || _p$payload === void 0 ? void 0 : _p$payload.val, stream$, name);
64
+ var _hidden = processDependHiddenOrShow(_depends === null || _depends === void 0 ? void 0 : _depends.hidden, p === null || p === void 0 ? void 0 : (_p$payload = p.payload) === null || _p$payload === void 0 ? void 0 : _p$payload.allVals, stream$, name);
65
65
  var _dr = dependsRef.current;
66
66
  _dr.hidden = _hidden;
67
67
  setDepends(_objectSpread({}, _dr));
@@ -69,7 +69,7 @@ export var useWatchDepend = function useWatchDepend(_depends, stream$, name) {
69
69
  }
70
70
  if (_depends === null || _depends === void 0 ? void 0 : _depends.show) {
71
71
  var _p$payload2;
72
- var _show = processDependHiddenOrShow(_depends === null || _depends === void 0 ? void 0 : _depends.show, p === null || p === void 0 ? void 0 : (_p$payload2 = p.payload) === null || _p$payload2 === void 0 ? void 0 : _p$payload2.val, stream$, name);
72
+ var _show = processDependHiddenOrShow(_depends === null || _depends === void 0 ? void 0 : _depends.show, p === null || p === void 0 ? void 0 : (_p$payload2 = p.payload) === null || _p$payload2 === void 0 ? void 0 : _p$payload2.allVals, stream$, name);
73
73
  var _dr2 = dependsRef.current;
74
74
  _dr2.show = _show;
75
75
  setDepends(_objectSpread({}, _dr2));
@@ -77,7 +77,7 @@ export var useWatchDepend = function useWatchDepend(_depends, stream$, name) {
77
77
  }
78
78
  if (_depends === null || _depends === void 0 ? void 0 : _depends.notRequire) {
79
79
  var _p$payload3;
80
- var _notRequire = processDependHiddenOrShow(_depends === null || _depends === void 0 ? void 0 : _depends.notRequire, p === null || p === void 0 ? void 0 : (_p$payload3 = p.payload) === null || _p$payload3 === void 0 ? void 0 : _p$payload3.val, stream$, name);
80
+ var _notRequire = processDependHiddenOrShow(_depends === null || _depends === void 0 ? void 0 : _depends.notRequire, p === null || p === void 0 ? void 0 : (_p$payload3 = p.payload) === null || _p$payload3 === void 0 ? void 0 : _p$payload3.allVals, stream$, name);
81
81
  var _dr3 = dependsRef.current;
82
82
  _dr3.notRequire = _notRequire;
83
83
  setDepends(_objectSpread({}, _dr3));
@@ -85,7 +85,7 @@ export var useWatchDepend = function useWatchDepend(_depends, stream$, name) {
85
85
  }
86
86
  if (_depends === null || _depends === void 0 ? void 0 : _depends.disabled) {
87
87
  var _p$payload4;
88
- var _disabled = processDependHiddenOrShow(_depends === null || _depends === void 0 ? void 0 : _depends.disabled, p === null || p === void 0 ? void 0 : (_p$payload4 = p.payload) === null || _p$payload4 === void 0 ? void 0 : _p$payload4.val, stream$, name);
88
+ var _disabled = processDependHiddenOrShow(_depends === null || _depends === void 0 ? void 0 : _depends.disabled, p === null || p === void 0 ? void 0 : (_p$payload4 = p.payload) === null || _p$payload4 === void 0 ? void 0 : _p$payload4.allVals, stream$, name);
89
89
  var _dr4 = dependsRef.current;
90
90
  _dr4.disabled = _disabled;
91
91
  setDepends(_objectSpread({}, _dr4));
@@ -99,9 +99,6 @@ export var useWatchDepend = function useWatchDepend(_depends, stream$, name) {
99
99
  };
100
100
  var processDependHiddenOrShow = function processDependHiddenOrShow(depend, changeData, stream$, name) {
101
101
  try {
102
- if (depend === "choose.indexOf('1')>-1") {
103
- debugger;
104
- }
105
102
  // const regex = /\w+(\.\w+)?[=<>!]{1}/g;
106
103
  var regex = /\w+(\.\w+)?[=<>!]{1}|\w+(\.\w+)?(\.indexOf\('.+'\)[=<>!]{1})/g;
107
104
  var keys = depend.trim().replace(/\s/g, '').match(regex);
@@ -105,11 +105,12 @@ var MetadataForm = function MetadataForm(props) {
105
105
  });
106
106
  if (firstLoadValue.current) {
107
107
  firstLoadValue.current = false;
108
+ var allVals = form.getFieldsValue();
108
109
  stream$.next({
109
110
  type: STREAM_EVENT_TYPE.ON_VALUES_CHANGE,
110
111
  payload: {
111
112
  val: vals,
112
- allVals: vals,
113
+ allVals: allVals,
113
114
  trigger: 'firstLoad'
114
115
  }
115
116
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "ronds-metadata",
4
- "version": "1.3.22",
4
+ "version": "1.3.24",
5
5
  "scripts": {
6
6
  "start": "dumi dev",
7
7
  "docs:build": "dumi build",