ronds-metadata 1.2.13 → 1.2.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
3
  /*
4
4
  * @Author: wangxian
5
5
  * @Date: 2023-02-06 08:24:17
6
- * @LastEditTime: 2023-02-28 11:34:40
6
+ * @LastEditTime: 2023-02-28 14:13:40
7
7
  */
8
8
  import { RefRule, Rule } from './ruleConfig';
9
9
  export var inputSchema = [{
@@ -21,7 +21,8 @@ export var textareaSchema = [{
21
21
  export var dateSchema = [{
22
22
  id: 'dateSchema',
23
23
  type: 'object',
24
- properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.br, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props, RefRule.text.props],
24
+ properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, // Rule.common.defaultValue,
25
+ Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.br, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props, RefRule.text.props],
25
26
  types: [].concat(_toConsumableArray(RefRule.common.depend.types), _toConsumableArray(RefRule.text.types), _toConsumableArray(RefRule.common.rules.types))
26
27
  }];
27
28
  export var numberSchema = [{
@@ -33,7 +34,8 @@ export var numberSchema = [{
33
34
  export var switchSchema = [{
34
35
  id: 'switchSchema',
35
36
  type: 'object',
36
- properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.require, Rule.common.disabled, Rule.common.br, Rule.common.hidden, RefRule.common.depend.props],
37
+ properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, // Rule.common.defaultValue,
38
+ Rule.common.help, Rule.common.tooltip, Rule.common.require, Rule.common.disabled, Rule.common.br, Rule.common.hidden, RefRule.common.depend.props],
37
39
  types: _toConsumableArray(RefRule.common.depend.types)
38
40
  }];
39
41
  export var selectSchema = [{
@@ -121,6 +121,8 @@ export function withAddOnAfter(WrappedComponent) {
121
121
  notRequire: depend === null || depend === void 0 ? void 0 : depend.notRequire
122
122
  })), isShowTypeInfo && !field && type !== 'number' && type !== 'bool' && /*#__PURE__*/React.createElement("div", {
123
123
  className: "with-add-on-after-extra"
124
- }, help !== null && help !== void 0 ? help : type))), fields && ((_fields$5 = fields[0]) === null || _fields$5 === void 0 ? void 0 : (_fields$5$value = _fields$5.value) === null || _fields$5$value === void 0 ? void 0 : (_fields$5$value$commo = _fields$5$value.common) === null || _fields$5$value$commo === void 0 ? void 0 : _fields$5$value$commo.br) && /*#__PURE__*/React.createElement(_Col, null));
124
+ }, help !== null && help !== void 0 ? help : type))), fields && ((_fields$5 = fields[0]) === null || _fields$5 === void 0 ? void 0 : (_fields$5$value = _fields$5.value) === null || _fields$5$value === void 0 ? void 0 : (_fields$5$value$commo = _fields$5$value.common) === null || _fields$5$value$commo === void 0 ? void 0 : _fields$5$value$commo.br) && /*#__PURE__*/React.createElement(_Col, {
125
+ span: 24
126
+ }));
125
127
  };
126
128
  }
@@ -67,6 +67,7 @@ var MetadataForm = function MetadataForm(props) {
67
67
 
68
68
  var firstLoadRef = React.useRef(true);
69
69
  var firstLoadForm = React.useRef(true);
70
+ var firstLoadValue = React.useRef(true);
70
71
  var stream$ = useMemoSubject();
71
72
  var processStreamEvent = React.useCallback(function (p) {
72
73
  var _p$payload, _p$payload2;
@@ -111,6 +112,17 @@ var MetadataForm = function MetadataForm(props) {
111
112
  type: 'setFieldsValue',
112
113
  payload: vals
113
114
  });
115
+
116
+ if (firstLoadValue.current) {
117
+ firstLoadValue.current = false;
118
+ stream$.next({
119
+ type: 'onValuesChange',
120
+ payload: {
121
+ val: {},
122
+ allVals: vals
123
+ }
124
+ });
125
+ }
114
126
  };
115
127
 
116
128
  form.setFieldsValue = setFieldsValue;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "ronds-metadata",
4
- "version": "1.2.13",
4
+ "version": "1.2.14",
5
5
  "scripts": {
6
6
  "start": "dumi dev",
7
7
  "docs:build": "dumi build",