@ssplib/react-components 0.0.93 → 0.0.95

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.
@@ -51,7 +51,7 @@ function DatePicker(_a) {
51
51
  var _b;
52
52
  var { name, required = false, title, xs = 12, sm, md, minDt, defaultValue = '', maxDt } = _a, props = __rest(_a, ["name", "required", "title", "xs", "sm", "md", "minDt", "defaultValue", "maxDt"]);
53
53
  const context = (0, react_1.useContext)(form_1.FormContext);
54
- const [value, setValue] = (0, react_1.useState)((0, dayjs_1.default)(defaultValue, 'DD/MM/YYYY'));
54
+ const [value, setValue] = (0, react_1.useState)(defaultValue ? (0, dayjs_1.default)(defaultValue, 'DD/MM/YYYY') : null);
55
55
  const handleChange = (newValue) => {
56
56
  console.log('mudou');
57
57
  setValue(newValue);
@@ -38,7 +38,7 @@ const lodash_hasin_1 = __importDefault(require("lodash.hasin"));
38
38
  function TimePicker({ name, required = false, title, defaultValue = '', xs = 12, sm, md, }) {
39
39
  var _a;
40
40
  const context = (0, react_1.useContext)(form_1.FormContext);
41
- const [value, setValue] = (0, react_1.useState)((0, dayjs_1.default)(defaultValue, 'HH:mm'));
41
+ const [value, setValue] = (0, react_1.useState)(defaultValue ? (0, dayjs_1.default)(defaultValue, 'HH:mm') : null);
42
42
  const handleChange = (newValue) => {
43
43
  setValue(newValue);
44
44
  context === null || context === void 0 ? void 0 : context.formSetValue(name, newValue === null || newValue === void 0 ? void 0 : newValue.format('HH:mm'));
@@ -59,7 +59,7 @@ function FetchAutoComplete({ name, url, title, customLoadingText, shouldRefetch
59
59
  }
60
60
  }, []);
61
61
  function onFocus() {
62
- if (!defaultValue && !shouldRefetch && list.length > 0)
62
+ if ((defaultValue || !shouldRefetch) && list.length > 0)
63
63
  return;
64
64
  setLoading(true);
65
65
  setList([]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.93",
3
+ "version": "0.0.95",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",