@gustavo-valsechi/client 1.4.26 → 1.4.28
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.
- package/dist/components/types/form/index.js +7 -6
- package/dist/components/types/form/index.mjs +7 -6
- package/dist/components/types/form/types/custom/index.js +1 -1
- package/dist/components/types/form/types/custom/index.mjs +1 -1
- package/dist/interfaces/components/form/custom/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -86,19 +86,20 @@ function Form(props) {
|
|
|
86
86
|
}, [props.defaultValues]);
|
|
87
87
|
const component = (data) => {
|
|
88
88
|
var _a;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const
|
|
89
|
+
let inputType = "";
|
|
90
|
+
inputType = import_lodash.default.upperFirst(import_lodash.default.camelCase(data.type));
|
|
91
|
+
inputType = import_lodash.default.includes(inputType, "Input") ? inputType : `Input${inputType}`;
|
|
92
|
+
const component2 = Types[inputType];
|
|
93
|
+
const ComponentType = component2 || Types.InputText;
|
|
93
94
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
94
|
-
|
|
95
|
+
ComponentType,
|
|
95
96
|
{
|
|
96
97
|
...import_lodash.default.omit(data, ["validation"]),
|
|
97
98
|
id: data.name,
|
|
98
99
|
type: component2 ? void 0 : data.type,
|
|
99
100
|
error: (_a = errors[data.name]) == null ? void 0 : _a.message,
|
|
100
101
|
register,
|
|
101
|
-
|
|
102
|
+
setvalue: inputType === "InputCustom" ? setValue : void 0
|
|
102
103
|
}
|
|
103
104
|
);
|
|
104
105
|
};
|
|
@@ -52,19 +52,20 @@ function Form(props) {
|
|
|
52
52
|
}, [props.defaultValues]);
|
|
53
53
|
const component = (data) => {
|
|
54
54
|
var _a;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const
|
|
55
|
+
let inputType = "";
|
|
56
|
+
inputType = _.upperFirst(_.camelCase(data.type));
|
|
57
|
+
inputType = _.includes(inputType, "Input") ? inputType : `Input${inputType}`;
|
|
58
|
+
const component2 = Types[inputType];
|
|
59
|
+
const ComponentType = component2 || Types.InputText;
|
|
59
60
|
return /* @__PURE__ */ jsx(
|
|
60
|
-
|
|
61
|
+
ComponentType,
|
|
61
62
|
{
|
|
62
63
|
..._.omit(data, ["validation"]),
|
|
63
64
|
id: data.name,
|
|
64
65
|
type: component2 ? void 0 : data.type,
|
|
65
66
|
error: (_a = errors[data.name]) == null ? void 0 : _a.message,
|
|
66
67
|
register,
|
|
67
|
-
|
|
68
|
+
setvalue: inputType === "InputCustom" ? setValue : void 0
|
|
68
69
|
}
|
|
69
70
|
);
|
|
70
71
|
};
|
|
@@ -31,7 +31,7 @@ function InputCustom(props) {
|
|
|
31
31
|
const register = (props.register || ((name) => ({})))(props.name || "");
|
|
32
32
|
(0, import_react.useEffect)(() => {
|
|
33
33
|
var _a;
|
|
34
|
-
(_a = props.
|
|
34
|
+
(_a = props.setvalue) == null ? void 0 : _a.call(props, props.name, props.value);
|
|
35
35
|
}, [props.name, props.value]);
|
|
36
36
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Container, { className: props.className, children: [
|
|
37
37
|
!!props.label && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_label.InputLabel, { children: [
|
|
@@ -8,7 +8,7 @@ function InputCustom(props) {
|
|
|
8
8
|
const register = (props.register || ((name) => ({})))(props.name || "");
|
|
9
9
|
useEffect(() => {
|
|
10
10
|
var _a;
|
|
11
|
-
(_a = props.
|
|
11
|
+
(_a = props.setvalue) == null ? void 0 : _a.call(props, props.name, props.value);
|
|
12
12
|
}, [props.name, props.value]);
|
|
13
13
|
return /* @__PURE__ */ jsxs(Container, { className: props.className, children: [
|
|
14
14
|
!!props.label && /* @__PURE__ */ jsxs(InputLabel, { children: [
|