@ssplib/react-components 0.0.157 → 0.0.159

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.
@@ -89,10 +89,7 @@ function FetchAutoComplete({ name, url, title, customLoadingText, shouldRefetch
89
89
  }
90
90
  });
91
91
  }
92
- function handleAutoCompleteChange(element, value) {
93
- if (context) {
94
- context.formRA = element.textContent;
95
- }
92
+ function handleAutoCompleteChange(value) {
96
93
  context === null || context === void 0 ? void 0 : context.formSetValue(name, value ? value.id : '');
97
94
  onChange(value ? value.id : -1);
98
95
  }
@@ -107,7 +104,7 @@ function FetchAutoComplete({ name, url, title, customLoadingText, shouldRefetch
107
104
  return 'Este campo é obrigatório';
108
105
  },
109
106
  }), { hidden: true })),
110
- react_1.default.createElement(material_1.Autocomplete, { loading: loading, loadingText: loadingText, options: list, defaultValue: dValue, isOptionEqualToValue: (op, value) => op.id === value.id, onChange: (e, v) => handleAutoCompleteChange(e.currentTarget, v), renderInput: (params) => {
107
+ react_1.default.createElement(material_1.Autocomplete, { loading: loading, loadingText: loadingText, options: list, defaultValue: dValue, isOptionEqualToValue: (op, value) => op.id === value.id, onChange: (e, v) => handleAutoCompleteChange(v), renderInput: (params) => {
111
108
  var _a;
112
109
  return (react_1.default.createElement(material_1.TextField, Object.assign({}, params, { size: 'small', fullWidth: true, placeholder: title, onFocus: onFocus, required: true, error: (0, lodash_get_1.default)(context === null || context === void 0 ? void 0 : context.errors, name) ? true : false, helperText: (_a = (0, lodash_get_1.default)(context === null || context === void 0 ? void 0 : context.errors, name)) === null || _a === void 0 ? void 0 : _a.message })));
113
110
  }, size: 'small', fullWidth: true })));
@@ -114,7 +114,7 @@ function NavBar({ links, title, img, pos = 'fixed', next = true, el, menuItems,
114
114
  react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize' }, logoutMsg))))),
115
115
  react_1.default.createElement(material_1.Stack, { direction: 'row', spacing: 0.4, alignItems: 'center', onClick: (e) => setAvatarAnchor(e.currentTarget), sx: { userSelect: 'none' } },
116
116
  react_1.default.createElement(material_1.Typography, null, "Ol\u00E1,"),
117
- react_1.default.createElement(material_1.Typography, { fontWeight: 600 }, user.name),
117
+ react_1.default.createElement(material_1.Typography, { fontWeight: 600 }, user.given_name),
118
118
  react_1.default.createElement(KeyboardArrowDown_1.default, null)))) : type === 'govbr' ? (react_1.default.createElement(material_1.Button, { variant: 'contained', size: 'small', startIcon: react_1.default.createElement(Person_1.default, null), onClick: login, sx: { color: 'white', textTransform: 'inherit', borderRadius: 50, paddingX: 2 } },
119
119
  react_1.default.createElement(material_1.Typography, { fontWeight: 600, fontSize: 15, padding: 0.4 }, "Entrar com o gov.br"))) : (react_1.default.createElement(material_1.Button, { variant: 'contained', size: 'small', startIcon: react_1.default.createElement(Person_1.default, null), onClick: login, sx: { color: 'white', textTransform: 'inherit', borderRadius: 50, paddingX: 2 } },
120
120
  react_1.default.createElement(material_1.Typography, { fontWeight: 600, fontSize: 15, padding: 0.4 }, "Entrar"))))))),
@@ -42,7 +42,6 @@ function FormProvider({ children, onSubmit, formMethod = 'GET', submiting = fals
42
42
  setFilesUid: setFilesUid,
43
43
  errors: errors,
44
44
  submiting: submiting,
45
- formRA: '',
46
45
  } },
47
46
  react_1.default.createElement("form", { method: formMethod, onSubmit: handleSubmit((d) => onSubmit(d, filesUid)) }, children)));
48
47
  }
package/context/form.d.ts CHANGED
@@ -17,5 +17,4 @@ export declare const FormContext: import("react").Context<{
17
17
  }[]>>;
18
18
  errors: FieldErrors<FieldValues>;
19
19
  submiting: boolean;
20
- formRA: string;
21
20
  } | null>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.157",
3
+ "version": "0.0.159",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",