@hw-component/form 1.10.31 → 1.10.33

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.
@@ -46,7 +46,8 @@ var mathRequired = function mathRequired(configItem, form, defaultComponents) {
46
46
  };
47
47
  };
48
48
  var matchDefaultPlaceholder = function matchDefaultPlaceholder(props, defaultComponents) {
49
- var label = props.label,
49
+ var _props$label = props.label,
50
+ label = _props$label === void 0 ? "" : _props$label,
50
51
  placeholder = props.placeholder,
51
52
  _props$type = props.type,
52
53
  type = _props$type === void 0 ? "input" : _props$type;
@@ -62,6 +62,9 @@ var Index = function Index(_ref, ref) {
62
62
  name = _item$name === void 0 ? "" : _item$name;
63
63
  var keyName = name;
64
64
  var itemVal = initValue[keyName];
65
+ if (valueType === "state") {
66
+ return _defineProperty({}, keyName, itemVal);
67
+ }
65
68
  var initVal = typeof itemVal === "string" ? BraftEditor.createEditorState(itemVal) : itemVal;
66
69
  return _defineProperty({}, keyName, initVal);
67
70
  },
@@ -70,6 +73,9 @@ var Index = function Index(_ref, ref) {
70
73
  name = _item$name2 === void 0 ? "" : _item$name2;
71
74
  var keyName = name;
72
75
  var itemVal = _outputValue[keyName];
76
+ if (valueType === "state") {
77
+ return _defineProperty({}, keyName, itemVal);
78
+ }
73
79
  var outputVal = typeof itemVal === "string" ? itemVal : itemVal === null || itemVal === void 0 ? void 0 : itemVal.toHTML();
74
80
  return _defineProperty({}, keyName, outputVal);
75
81
  }
@@ -49,7 +49,8 @@ var mathRequired = function mathRequired(configItem, form, defaultComponents) {
49
49
  };
50
50
  };
51
51
  var matchDefaultPlaceholder = function matchDefaultPlaceholder(props, defaultComponents) {
52
- var label = props.label,
52
+ var _props$label = props.label,
53
+ label = _props$label === void 0 ? "" : _props$label,
53
54
  placeholder = props.placeholder,
54
55
  _props$type = props.type,
55
56
  type = _props$type === void 0 ? "input" : _props$type;
@@ -65,6 +65,9 @@ var Index = function Index(_ref, ref) {
65
65
  name = _item$name === void 0 ? "" : _item$name;
66
66
  var keyName = name;
67
67
  var itemVal = initValue[keyName];
68
+ if (valueType === "state") {
69
+ return _defineProperty({}, keyName, itemVal);
70
+ }
68
71
  var initVal = typeof itemVal === "string" ? BraftEditor.createEditorState(itemVal) : itemVal;
69
72
  return _defineProperty({}, keyName, initVal);
70
73
  },
@@ -73,6 +76,9 @@ var Index = function Index(_ref, ref) {
73
76
  name = _item$name2 === void 0 ? "" : _item$name2;
74
77
  var keyName = name;
75
78
  var itemVal = _outputValue[keyName];
79
+ if (valueType === "state") {
80
+ return _defineProperty({}, keyName, itemVal);
81
+ }
76
82
  var outputVal = typeof itemVal === "string" ? itemVal : itemVal === null || itemVal === void 0 ? void 0 : itemVal.toHTML();
77
83
  return _defineProperty({}, keyName, outputVal);
78
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.10.31",
3
+ "version": "1.10.33",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -54,7 +54,7 @@ const matchDefaultPlaceholder = (
54
54
  props: HFormItemProps,
55
55
  defaultComponents: DefaultComponentModal
56
56
  ) => {
57
- const { label, placeholder, type = "input" } = props;
57
+ const { label="", placeholder, type = "input" } = props;
58
58
  const dom = defaultComponents[type];
59
59
  if (placeholder) {
60
60
  return placeholder;
@@ -49,7 +49,12 @@ const Index: React.ForwardRefRenderFunction<any, IHRichEditorProps> = (
49
49
  inputValue: (item, initValue) => {
50
50
  const { name = "" } = item;
51
51
  const keyName = name as string;
52
- const itemVal = initValue[keyName];
52
+ const itemVal = initValue[keyName];
53
+ if (valueType==="state"){
54
+ return {
55
+ [keyName]: itemVal,
56
+ };
57
+ }
53
58
  const initVal =
54
59
  typeof itemVal === "string"
55
60
  ? BraftEditor.createEditorState(itemVal)
@@ -62,6 +67,11 @@ const Index: React.ForwardRefRenderFunction<any, IHRichEditorProps> = (
62
67
  const { name = "" } = item;
63
68
  const keyName = name as string;
64
69
  const itemVal = outputValue[keyName];
70
+ if (valueType==="state"){
71
+ return {
72
+ [keyName]: itemVal,
73
+ };
74
+ }
65
75
  const outputVal =
66
76
  typeof itemVal === "string" ? itemVal : itemVal?.toHTML();
67
77
  return {