@gustavo-valsechi/client 1.4.113 → 1.4.114
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/types/select/index.js +3 -0
- package/dist/components/types/form/types/select/index.mjs +3 -0
- package/dist/components/types/form/types/select/options/index.js +1 -1
- package/dist/components/types/form/types/select/options/index.mjs +1 -1
- package/dist/contexts/target/index.js +2 -8
- package/dist/contexts/target/index.mjs +2 -8
- package/package.json +1 -1
|
@@ -81,6 +81,9 @@ function InputSelect(props) {
|
|
|
81
81
|
event.target.value = props.mask ? props.mask(value2) : value2;
|
|
82
82
|
setFilter(value2);
|
|
83
83
|
if (props.onFilter) props.onFilter(value2);
|
|
84
|
+
const optionsElement = document.getElementById("input-options");
|
|
85
|
+
if (!optionsElement) return;
|
|
86
|
+
optionsElement.setAttribute("value", value2);
|
|
84
87
|
};
|
|
85
88
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Container, { className: props.className, error: props.error, children: [
|
|
86
89
|
!!props.label && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_label.InputLabel, { children: [
|
|
@@ -48,6 +48,9 @@ function InputSelect(props) {
|
|
|
48
48
|
event.target.value = props.mask ? props.mask(value2) : value2;
|
|
49
49
|
setFilter(value2);
|
|
50
50
|
if (props.onFilter) props.onFilter(value2);
|
|
51
|
+
const optionsElement = document.getElementById("input-options");
|
|
52
|
+
if (!optionsElement) return;
|
|
53
|
+
optionsElement.setAttribute("value", value2);
|
|
51
54
|
};
|
|
52
55
|
return /* @__PURE__ */ jsxs(Container, { className: props.className, error: props.error, children: [
|
|
53
56
|
!!props.label && /* @__PURE__ */ jsxs(InputLabel, { children: [
|
|
@@ -57,7 +57,7 @@ function InputSelectOption(props) {
|
|
|
57
57
|
});
|
|
58
58
|
setOptions(filtredOptions);
|
|
59
59
|
}, [props.value]);
|
|
60
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.Container, { width: props.width, children: import_lodash.default.map(
|
|
60
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.Container, { id: "input-options", width: props.width, children: import_lodash.default.map(
|
|
61
61
|
options,
|
|
62
62
|
(data, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
63
63
|
"div",
|
|
@@ -24,7 +24,7 @@ function InputSelectOption(props) {
|
|
|
24
24
|
});
|
|
25
25
|
setOptions(filtredOptions);
|
|
26
26
|
}, [props.value]);
|
|
27
|
-
return /* @__PURE__ */ jsx(Container, { width: props.width, children: _.map(
|
|
27
|
+
return /* @__PURE__ */ jsx(Container, { id: "input-options", width: props.width, children: _.map(
|
|
28
28
|
options,
|
|
29
29
|
(data, index) => /* @__PURE__ */ jsx(
|
|
30
30
|
"div",
|
|
@@ -121,22 +121,16 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
121
121
|
import_lodash.default.forEach(containerRef.current, (elementRef) => close(elementRef, index));
|
|
122
122
|
});
|
|
123
123
|
focusable.addEventListener("blur", () => {
|
|
124
|
+
console.log("onBlur", insideMemory);
|
|
124
125
|
if (import_lodash.default.some(insideMemory, (i) => i === index)) return;
|
|
125
126
|
close(containerRef.current[index], index);
|
|
126
127
|
});
|
|
127
|
-
focusable.addEventListener("change", (e) => {
|
|
128
|
-
var _a2;
|
|
129
|
-
e.preventDefault();
|
|
130
|
-
const value = ((_a2 = e.target) == null ? void 0 : _a2.value) || "";
|
|
131
|
-
console.log("input target value", value);
|
|
132
|
-
target.component = import_react.default.cloneElement(target.component, { value });
|
|
133
|
-
});
|
|
134
128
|
});
|
|
135
129
|
}, [targets, inputRef, containerRef]);
|
|
136
130
|
const getCoords = (target) => {
|
|
137
131
|
const rect = target.getBoundingClientRect();
|
|
138
132
|
const targetTop = rect.top + window.scrollY;
|
|
139
|
-
const targetLeft = rect.left + window.scrollX;
|
|
133
|
+
const targetLeft = rect.left + window.scrollX + 1;
|
|
140
134
|
const coords = {
|
|
141
135
|
top: targetTop + (target.offsetHeight + 5),
|
|
142
136
|
left: targetLeft
|
|
@@ -87,22 +87,16 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
87
87
|
_.forEach(containerRef.current, (elementRef) => close(elementRef, index));
|
|
88
88
|
});
|
|
89
89
|
focusable.addEventListener("blur", () => {
|
|
90
|
+
console.log("onBlur", insideMemory);
|
|
90
91
|
if (_.some(insideMemory, (i) => i === index)) return;
|
|
91
92
|
close(containerRef.current[index], index);
|
|
92
93
|
});
|
|
93
|
-
focusable.addEventListener("change", (e) => {
|
|
94
|
-
var _a2;
|
|
95
|
-
e.preventDefault();
|
|
96
|
-
const value = ((_a2 = e.target) == null ? void 0 : _a2.value) || "";
|
|
97
|
-
console.log("input target value", value);
|
|
98
|
-
target.component = React.cloneElement(target.component, { value });
|
|
99
|
-
});
|
|
100
94
|
});
|
|
101
95
|
}, [targets, inputRef, containerRef]);
|
|
102
96
|
const getCoords = (target) => {
|
|
103
97
|
const rect = target.getBoundingClientRect();
|
|
104
98
|
const targetTop = rect.top + window.scrollY;
|
|
105
|
-
const targetLeft = rect.left + window.scrollX;
|
|
99
|
+
const targetLeft = rect.left + window.scrollX + 1;
|
|
106
100
|
const coords = {
|
|
107
101
|
top: targetTop + (target.offsetHeight + 5),
|
|
108
102
|
left: targetLeft
|