@ssplib/react-components 0.0.216 → 0.0.217

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.
@@ -103,7 +103,11 @@ function FetchAutoComplete({ name, url, title, customLoadingText, shouldRefetch
103
103
  setValue(value);
104
104
  context.formSetValue(name, value.id);
105
105
  onChange(value.id);
106
+ return;
106
107
  }
108
+ setValue(null);
109
+ context.formSetValue(name, '');
110
+ onChange(undefined);
107
111
  }
108
112
  if (defaultValue && list.length <= 0 && !dValue)
109
113
  return (react_1.default.createElement(material_1.Grid, Object.assign({ item: true }, { xs, sm, md }),
@@ -50,7 +50,11 @@ function FixedAutoComplete({ name, title, required = false, list, defaultValue,
50
50
  setValue(value);
51
51
  context.formSetValue(name, value.id);
52
52
  onChange(value.id);
53
+ return;
53
54
  }
55
+ setValue(null);
56
+ context.formSetValue(name, '');
57
+ onChange(undefined);
54
58
  }
55
59
  return (react_1.default.createElement(material_1.Grid, Object.assign({ item: true }, { xs, sm, md }),
56
60
  title && react_1.default.createElement(material_1.InputLabel, { required: required }, title),
@@ -46,23 +46,13 @@ const TextMaskCustom = react_1.default.forwardRef(function TextMaskCustom(props,
46
46
  const [myValue, setMyValue] = (0, react_1.useState)('');
47
47
  const context = (0, react_1.useContext)(form_1.FormContext);
48
48
  (0, react_1.useEffect)(() => {
49
- console.log(watchValue);
50
49
  if (watchValue) {
51
50
  setMyValue(watchValue);
52
51
  }
53
52
  }, [watchValue]);
54
- // useEffect(() => {
55
- // // const value = context.formGetValues(prop.name)
56
- // // console.log('VA::', value)
57
- // // if (value) {
58
- // // setMyValue(value)
59
- // // }
60
- // }, [context.formGetValues(prop.name)])
61
53
  (0, react_1.useEffect)(() => {
62
- console.log('ddd');
63
54
  context.formSetValue(prop.name, myRef.current.element.value);
64
55
  }, [myValue]);
65
- console.log(props);
66
56
  delete prop.watchValue;
67
57
  return (react_1.default.createElement(react_imask_1.IMaskInput, Object.assign({}, prop, maskProps, { mask: mask, value: myValue, ref: myRef, inputRef: ref, onChange: (e) => { }, onAccept: (value, mask) => {
68
58
  setMyValue(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.216",
3
+ "version": "0.0.217",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",