@hw-component/form 1.4.5 → 1.4.6

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.
@@ -69,7 +69,6 @@ var useHForm = (function () {
69
69
  if (!format) {
70
70
  return;
71
71
  }
72
- console.log(name, "nnnnnnnn");
73
72
  var inputValue = format.inputValue,
74
73
  outputValue = format.outputValue;
75
74
  formatSourceData[name] = {
@@ -180,10 +180,14 @@ var useValueChange = function useValueChange(params) {
180
180
  onChange(newChangeVal, subItemOps);
181
181
  };
182
182
  useEffect(function () {
183
- if (mode === "tags" || value === null || value === undefined) {
183
+ if (mode === "tags") {
184
184
  setVal(value);
185
185
  return;
186
186
  }
187
+ if (value === null || value === undefined) {
188
+ setVal(undefined);
189
+ return;
190
+ }
187
191
  if (options) {
188
192
  setVal(function (oldVale) {
189
193
  return matchNotFind(params, oldVale);
@@ -72,7 +72,6 @@ var useHForm = (function () {
72
72
  if (!format) {
73
73
  return;
74
74
  }
75
- console.log(name, "nnnnnnnn");
76
75
  var inputValue = format.inputValue,
77
76
  outputValue = format.outputValue;
78
77
  formatSourceData[name] = {
@@ -181,10 +181,14 @@ var useValueChange = function useValueChange(params) {
181
181
  onChange(newChangeVal, subItemOps);
182
182
  };
183
183
  React.useEffect(function () {
184
- if (mode === "tags" || value === null || value === undefined) {
184
+ if (mode === "tags") {
185
185
  setVal(value);
186
186
  return;
187
187
  }
188
+ if (value === null || value === undefined) {
189
+ setVal(undefined);
190
+ return;
191
+ }
188
192
  if (options) {
189
193
  setVal(function (oldVale) {
190
194
  return matchNotFind(params, oldVale);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.4.5",
3
+ "version": "1.4.6",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -55,7 +55,6 @@ export default () => {
55
55
  if (!format) {
56
56
  return;
57
57
  }
58
- console.log(name,"nnnnnnnn")
59
58
  const { inputValue, outputValue } = format;
60
59
  formatSourceData[name] = {
61
60
  inputValue,
@@ -142,10 +142,14 @@ export const useValueChange = (params: PartialHSelectProps) => {
142
142
  onChange(newChangeVal, subItemOps);
143
143
  };
144
144
  useEffect(() => {
145
- if (mode === "tags" || value === null || value === undefined) {
145
+ if (mode === "tags" ) {
146
146
  setVal(value);
147
147
  return;
148
148
  }
149
+ if (value===null||value===undefined){
150
+ setVal(undefined);
151
+ return;
152
+ }
149
153
  if (options) {
150
154
  setVal((oldVale) => {
151
155
  return matchNotFind(params, oldVale);
@@ -2,7 +2,7 @@ import { HSelect } from "../../components";
2
2
  import { Space } from "antd";
3
3
  import { useState } from "react";
4
4
  export default () => {
5
- const [selectVal, setSelectVal] = useState([]);
5
+ const [selectVal, setSelectVal] = useState(null);
6
6
  return (
7
7
  <Space size={"large"} direction={"vertical"} style={{ width: "100%" }}>
8
8
  <HSelect
@@ -20,7 +20,6 @@ export default () => {
20
20
  placeholder="多选"
21
21
  value={selectVal}
22
22
  onChange={(val, option) => {
23
- console.log(option,"optionoptionoption")
24
23
  setSelectVal(val);
25
24
  }}
26
25
  allSelect={true}