@gustavo-valsechi/client 1.4.59 → 1.4.61
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/index.js +0 -2
- package/dist/components/index.mjs +0 -2
- package/dist/components/types/form/index.js +1 -3
- package/dist/components/types/form/index.mjs +1 -3
- package/dist/components/types/form/types/custom/index.js +1 -1
- package/dist/components/types/form/types/custom/index.mjs +1 -1
- package/dist/components/types/form/types/datetime/index.js +1 -1
- package/dist/components/types/form/types/datetime/index.mjs +1 -1
- package/dist/components/types/form/types/select/index.js +1 -1
- package/dist/components/types/form/types/select/index.mjs +1 -1
- package/dist/components/types/form/types/text/index.js +1 -1
- package/dist/components/types/form/types/text/index.mjs +1 -1
- package/dist/components/types/form/types/textarea/index.js +1 -1
- package/dist/components/types/form/types/textarea/index.mjs +1 -1
- package/dist/contexts/target/index.js +4 -4
- package/dist/contexts/target/index.mjs +5 -5
- package/dist/interfaces/components/form/custom/index.d.ts +1 -1
- package/dist/interfaces/components/form/select/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -40,9 +40,7 @@ var import_lodash = __toESM(require("lodash"));
|
|
|
40
40
|
var Types = __toESM(require("./types"));
|
|
41
41
|
__reExport(components_exports, require("./types"), module.exports);
|
|
42
42
|
function Component(props) {
|
|
43
|
-
console.log("COMPONENTE RENDERIZADO");
|
|
44
43
|
const renderComponent = (config) => {
|
|
45
|
-
console.log(config);
|
|
46
44
|
const ComponentElement = Types[config.type];
|
|
47
45
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComponentElement, { ...config.props });
|
|
48
46
|
};
|
|
@@ -6,9 +6,7 @@ import _ from "lodash";
|
|
|
6
6
|
import * as Types from "./types";
|
|
7
7
|
export * from "./types";
|
|
8
8
|
function Component(props) {
|
|
9
|
-
console.log("COMPONENTE RENDERIZADO");
|
|
10
9
|
const renderComponent = (config) => {
|
|
11
|
-
console.log(config);
|
|
12
10
|
const ComponentElement = Types[config.type];
|
|
13
11
|
return /* @__PURE__ */ jsx(ComponentElement, { ...config.props });
|
|
14
12
|
};
|
|
@@ -91,7 +91,6 @@ function Form(props) {
|
|
|
91
91
|
inputType = import_lodash.default.includes(inputType, "Input") ? inputType : `Input${inputType}`;
|
|
92
92
|
const component2 = Types[inputType];
|
|
93
93
|
const ComponentType = component2 || Types.InputText;
|
|
94
|
-
console.log(data);
|
|
95
94
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
96
95
|
ComponentType,
|
|
97
96
|
{
|
|
@@ -100,7 +99,7 @@ function Form(props) {
|
|
|
100
99
|
type: component2 ? void 0 : data.type,
|
|
101
100
|
error: (_a = errors[data.name]) == null ? void 0 : _a.message,
|
|
102
101
|
register,
|
|
103
|
-
|
|
102
|
+
setValue
|
|
104
103
|
}
|
|
105
104
|
);
|
|
106
105
|
};
|
|
@@ -110,7 +109,6 @@ function Form(props) {
|
|
|
110
109
|
await props.onSubmit(data);
|
|
111
110
|
setSubmitting(false);
|
|
112
111
|
};
|
|
113
|
-
console.log("FORM RENDERIZADO");
|
|
114
112
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Container, { ref: formRef, onSubmit: handleSubmit(onSubmit), children: [
|
|
115
113
|
import_lodash.default.map(
|
|
116
114
|
props.inputs,
|
|
@@ -57,7 +57,6 @@ function Form(props) {
|
|
|
57
57
|
inputType = _.includes(inputType, "Input") ? inputType : `Input${inputType}`;
|
|
58
58
|
const component2 = Types[inputType];
|
|
59
59
|
const ComponentType = component2 || Types.InputText;
|
|
60
|
-
console.log(data);
|
|
61
60
|
return /* @__PURE__ */ jsx(
|
|
62
61
|
ComponentType,
|
|
63
62
|
{
|
|
@@ -66,7 +65,7 @@ function Form(props) {
|
|
|
66
65
|
type: component2 ? void 0 : data.type,
|
|
67
66
|
error: (_a = errors[data.name]) == null ? void 0 : _a.message,
|
|
68
67
|
register,
|
|
69
|
-
|
|
68
|
+
setValue
|
|
70
69
|
}
|
|
71
70
|
);
|
|
72
71
|
};
|
|
@@ -76,7 +75,6 @@ function Form(props) {
|
|
|
76
75
|
await props.onSubmit(data);
|
|
77
76
|
setSubmitting(false);
|
|
78
77
|
};
|
|
79
|
-
console.log("FORM RENDERIZADO");
|
|
80
78
|
return /* @__PURE__ */ jsxs(Container, { ref: formRef, onSubmit: handleSubmit(onSubmit), children: [
|
|
81
79
|
_.map(
|
|
82
80
|
props.inputs,
|
|
@@ -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: [
|
|
@@ -53,7 +53,7 @@ function InputDateTime(props) {
|
|
|
53
53
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "iz-input-content", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
54
|
"input",
|
|
55
55
|
{
|
|
56
|
-
...import_lodash.default.omit(props, ["className", "onChange", "mask", "type", "required", "register"]),
|
|
56
|
+
...import_lodash.default.omit(props, ["className", "onChange", "mask", "type", "required", "register", "setValue"]),
|
|
57
57
|
type: "datetime-local",
|
|
58
58
|
onFocus: () => {
|
|
59
59
|
if (props.onFocus) props.onFocus(props.name);
|
|
@@ -20,7 +20,7 @@ function InputDateTime(props) {
|
|
|
20
20
|
/* @__PURE__ */ jsx("div", { className: "iz-input-content", children: /* @__PURE__ */ jsx(
|
|
21
21
|
"input",
|
|
22
22
|
{
|
|
23
|
-
..._.omit(props, ["className", "onChange", "mask", "type", "required", "register"]),
|
|
23
|
+
..._.omit(props, ["className", "onChange", "mask", "type", "required", "register", "setValue"]),
|
|
24
24
|
type: "datetime-local",
|
|
25
25
|
onFocus: () => {
|
|
26
26
|
if (props.onFocus) props.onFocus(props.name);
|
|
@@ -72,7 +72,7 @@ function InputSelect(props) {
|
|
|
72
72
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
73
73
|
"input",
|
|
74
74
|
{
|
|
75
|
-
...import_lodash.default.omit(props, ["className", "register", "mask"]),
|
|
75
|
+
...import_lodash.default.omit(props, ["className", "register", "mask", "setvalue"]),
|
|
76
76
|
type: "text",
|
|
77
77
|
maxLength: props.maxLength || 255,
|
|
78
78
|
...register,
|
|
@@ -39,7 +39,7 @@ function InputSelect(props) {
|
|
|
39
39
|
/* @__PURE__ */ jsx(
|
|
40
40
|
"input",
|
|
41
41
|
{
|
|
42
|
-
..._.omit(props, ["className", "register", "mask"]),
|
|
42
|
+
..._.omit(props, ["className", "register", "mask", "setvalue"]),
|
|
43
43
|
type: "text",
|
|
44
44
|
maxLength: props.maxLength || 255,
|
|
45
45
|
...register,
|
|
@@ -56,7 +56,7 @@ function InputText(props) {
|
|
|
56
56
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
57
57
|
"input",
|
|
58
58
|
{
|
|
59
|
-
...import_lodash.default.omit(props, ["className", "register", "mask"]),
|
|
59
|
+
...import_lodash.default.omit(props, ["className", "register", "mask", "setValue"]),
|
|
60
60
|
type: props.type === "password" ? showPassword ? "text" : "password" : props.type,
|
|
61
61
|
maxLength: props.maxLength || 255,
|
|
62
62
|
onFocus: () => {
|
|
@@ -23,7 +23,7 @@ function InputText(props) {
|
|
|
23
23
|
/* @__PURE__ */ jsx(
|
|
24
24
|
"input",
|
|
25
25
|
{
|
|
26
|
-
..._.omit(props, ["className", "register", "mask"]),
|
|
26
|
+
..._.omit(props, ["className", "register", "mask", "setValue"]),
|
|
27
27
|
type: props.type === "password" ? showPassword ? "text" : "password" : props.type,
|
|
28
28
|
maxLength: props.maxLength || 255,
|
|
29
29
|
onFocus: () => {
|
|
@@ -53,7 +53,7 @@ function InputTextarea(props) {
|
|
|
53
53
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "iz-input-content", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
54
|
"textarea",
|
|
55
55
|
{
|
|
56
|
-
...import_lodash.default.omit(props, ["onFocus", "maxLength", "className", "onChange", "mask", "rows", "required", "register"]),
|
|
56
|
+
...import_lodash.default.omit(props, ["onFocus", "maxLength", "className", "onChange", "mask", "rows", "required", "register", "setValue"]),
|
|
57
57
|
maxLength: props.maxLength,
|
|
58
58
|
rows: props.rows || 5,
|
|
59
59
|
onFocus: () => {
|
|
@@ -20,7 +20,7 @@ function InputTextarea(props) {
|
|
|
20
20
|
/* @__PURE__ */ jsx("div", { className: "iz-input-content", children: /* @__PURE__ */ jsx(
|
|
21
21
|
"textarea",
|
|
22
22
|
{
|
|
23
|
-
..._.omit(props, ["onFocus", "maxLength", "className", "onChange", "mask", "rows", "required", "register"]),
|
|
23
|
+
..._.omit(props, ["onFocus", "maxLength", "className", "onChange", "mask", "rows", "required", "register", "setValue"]),
|
|
24
24
|
maxLength: props.maxLength,
|
|
25
25
|
rows: props.rows || 5,
|
|
26
26
|
onFocus: () => {
|
|
@@ -34,7 +34,7 @@ __export(target_exports, {
|
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(target_exports);
|
|
36
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
-
var import_react = require("react");
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
38
|
var import_styles = require("./styles");
|
|
39
39
|
var import_lodash = __toESM(require("lodash"));
|
|
40
40
|
const TargetContext = (0, import_react.createContext)({});
|
|
@@ -53,7 +53,8 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
53
53
|
const isShow = import_lodash.default.find(showMemory, (data) => data.index === index);
|
|
54
54
|
console.log("isShow", isShow);
|
|
55
55
|
if (isShow) {
|
|
56
|
-
|
|
56
|
+
const showIndex = import_lodash.default.findIndex(showMemory, (data) => data.index === index);
|
|
57
|
+
showMemory.splice(showIndex, 1);
|
|
57
58
|
setShow(showMemory);
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
@@ -62,7 +63,6 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
62
63
|
});
|
|
63
64
|
});
|
|
64
65
|
}, [targets]);
|
|
65
|
-
console.log("targets", targets);
|
|
66
66
|
const getCoords = (target) => {
|
|
67
67
|
const rect = target.getBoundingClientRect();
|
|
68
68
|
const targetTop = rect.top + window.scrollY;
|
|
@@ -107,7 +107,7 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
107
107
|
children: target.component
|
|
108
108
|
},
|
|
109
109
|
index
|
|
110
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.default.Fragment, {}, index);
|
|
111
111
|
}
|
|
112
112
|
),
|
|
113
113
|
children
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { createContext, useContext, useEffect, useState } from "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React, { createContext, useContext, useEffect, useState } from "react";
|
|
4
4
|
import { Container } from "./styles";
|
|
5
5
|
import _ from "lodash";
|
|
6
6
|
const TargetContext = createContext({});
|
|
@@ -19,7 +19,8 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
19
19
|
const isShow = _.find(showMemory, (data) => data.index === index);
|
|
20
20
|
console.log("isShow", isShow);
|
|
21
21
|
if (isShow) {
|
|
22
|
-
|
|
22
|
+
const showIndex = _.findIndex(showMemory, (data) => data.index === index);
|
|
23
|
+
showMemory.splice(showIndex, 1);
|
|
23
24
|
setShow(showMemory);
|
|
24
25
|
return;
|
|
25
26
|
}
|
|
@@ -28,7 +29,6 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
28
29
|
});
|
|
29
30
|
});
|
|
30
31
|
}, [targets]);
|
|
31
|
-
console.log("targets", targets);
|
|
32
32
|
const getCoords = (target) => {
|
|
33
33
|
const rect = target.getBoundingClientRect();
|
|
34
34
|
const targetTop = rect.top + window.scrollY;
|
|
@@ -73,7 +73,7 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
73
73
|
children: target.component
|
|
74
74
|
},
|
|
75
75
|
index
|
|
76
|
-
) : /* @__PURE__ */ jsx(Fragment, {});
|
|
76
|
+
) : /* @__PURE__ */ jsx(React.Fragment, {}, index);
|
|
77
77
|
}
|
|
78
78
|
),
|
|
79
79
|
children
|