@gustavo-valsechi/client 1.4.79 → 1.4.81
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.
|
@@ -50,10 +50,8 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
50
50
|
const element = (_a = target.ref) == null ? void 0 : _a.current;
|
|
51
51
|
if (!element) return;
|
|
52
52
|
element.addEventListener("click", () => {
|
|
53
|
-
var _a2, _b;
|
|
54
53
|
const targetElement = import_lodash.default.find(containerRef.current, (data, i) => i === index);
|
|
55
54
|
if (!targetElement) return;
|
|
56
|
-
console.log(index, "onClick");
|
|
57
55
|
if (targetElement.style.opacity === "1") {
|
|
58
56
|
targetElement.style.opacity = "0";
|
|
59
57
|
targetElement.style.zIndex = "-1";
|
|
@@ -64,10 +62,10 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
64
62
|
targetElement.style.left = `${coords.left}px`;
|
|
65
63
|
targetElement.style.opacity = "1";
|
|
66
64
|
targetElement.style.zIndex = "10";
|
|
67
|
-
|
|
65
|
+
inputRef.current[index].focus();
|
|
68
66
|
});
|
|
69
67
|
});
|
|
70
|
-
}, [targets]);
|
|
68
|
+
}, [targets, inputRef, containerRef]);
|
|
71
69
|
const getCoords = (target) => {
|
|
72
70
|
const rect = target.getBoundingClientRect();
|
|
73
71
|
const targetTop = rect.top + window.scrollY;
|
|
@@ -124,16 +122,11 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
124
122
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
125
123
|
"input",
|
|
126
124
|
{
|
|
127
|
-
|
|
125
|
+
style: { zIndex: "-1", position: "fixed", opacity: "0" },
|
|
128
126
|
ref: (element) => inputRef.current[index] = element,
|
|
129
127
|
onBlur: () => {
|
|
130
|
-
var _a;
|
|
131
128
|
if (inside) return;
|
|
132
|
-
|
|
133
|
-
(_a = containerRef.current[index]) == null ? void 0 : _a.click();
|
|
134
|
-
},
|
|
135
|
-
onFocus: () => {
|
|
136
|
-
console.log(index, "onFocus");
|
|
129
|
+
target.ref.current[index].click();
|
|
137
130
|
}
|
|
138
131
|
}
|
|
139
132
|
)
|
|
@@ -16,10 +16,8 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
16
16
|
const element = (_a = target.ref) == null ? void 0 : _a.current;
|
|
17
17
|
if (!element) return;
|
|
18
18
|
element.addEventListener("click", () => {
|
|
19
|
-
var _a2, _b;
|
|
20
19
|
const targetElement = _.find(containerRef.current, (data, i) => i === index);
|
|
21
20
|
if (!targetElement) return;
|
|
22
|
-
console.log(index, "onClick");
|
|
23
21
|
if (targetElement.style.opacity === "1") {
|
|
24
22
|
targetElement.style.opacity = "0";
|
|
25
23
|
targetElement.style.zIndex = "-1";
|
|
@@ -30,10 +28,10 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
30
28
|
targetElement.style.left = `${coords.left}px`;
|
|
31
29
|
targetElement.style.opacity = "1";
|
|
32
30
|
targetElement.style.zIndex = "10";
|
|
33
|
-
|
|
31
|
+
inputRef.current[index].focus();
|
|
34
32
|
});
|
|
35
33
|
});
|
|
36
|
-
}, [targets]);
|
|
34
|
+
}, [targets, inputRef, containerRef]);
|
|
37
35
|
const getCoords = (target) => {
|
|
38
36
|
const rect = target.getBoundingClientRect();
|
|
39
37
|
const targetTop = rect.top + window.scrollY;
|
|
@@ -90,16 +88,11 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
90
88
|
/* @__PURE__ */ jsx(
|
|
91
89
|
"input",
|
|
92
90
|
{
|
|
93
|
-
|
|
91
|
+
style: { zIndex: "-1", position: "fixed", opacity: "0" },
|
|
94
92
|
ref: (element) => inputRef.current[index] = element,
|
|
95
93
|
onBlur: () => {
|
|
96
|
-
var _a;
|
|
97
94
|
if (inside) return;
|
|
98
|
-
|
|
99
|
-
(_a = containerRef.current[index]) == null ? void 0 : _a.click();
|
|
100
|
-
},
|
|
101
|
-
onFocus: () => {
|
|
102
|
-
console.log(index, "onFocus");
|
|
95
|
+
target.ref.current[index].click();
|
|
103
96
|
}
|
|
104
97
|
}
|
|
105
98
|
)
|