@gustavo-valsechi/client 1.4.114 → 1.4.115
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.
|
@@ -46,17 +46,27 @@ function InputSelectOption(props) {
|
|
|
46
46
|
props.inputRef.current.blur();
|
|
47
47
|
}, [value, props.inputRef]);
|
|
48
48
|
(0, import_react.useEffect)(() => {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
const optionsElement = document.getElementById("input-options");
|
|
50
|
+
if (!optionsElement) return;
|
|
51
|
+
const observer = new MutationObserver((mutations) => {
|
|
52
|
+
for (const mutation of mutations) {
|
|
53
|
+
if (mutation.type === "attributes" && mutation.attributeName === "value") {
|
|
54
|
+
const filter = optionsElement.getAttribute("value") || "";
|
|
55
|
+
console.log("filter", filter);
|
|
56
|
+
if (!filter) return setOptions(props.options);
|
|
57
|
+
const filtredOptions = import_lodash.default.filter(props.options, (data) => {
|
|
58
|
+
var _a;
|
|
59
|
+
const value2 = ((_a = Object.values(data || {})) == null ? void 0 : _a[0]) || "";
|
|
60
|
+
if (import_lodash.default.isString(value2)) return import_lodash.default.includes(value2, filter);
|
|
61
|
+
return import_lodash.default.includes(value2 == null ? void 0 : value2.textContent, filter);
|
|
62
|
+
});
|
|
63
|
+
setOptions(filtredOptions);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
57
66
|
});
|
|
58
|
-
|
|
59
|
-
|
|
67
|
+
observer.observe(optionsElement, { attributes: true });
|
|
68
|
+
return () => observer.disconnect();
|
|
69
|
+
}, [props.options]);
|
|
60
70
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.Container, { id: "input-options", width: props.width, children: import_lodash.default.map(
|
|
61
71
|
options,
|
|
62
72
|
(data, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -13,17 +13,27 @@ function InputSelectOption(props) {
|
|
|
13
13
|
props.inputRef.current.blur();
|
|
14
14
|
}, [value, props.inputRef]);
|
|
15
15
|
useEffect(() => {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
const optionsElement = document.getElementById("input-options");
|
|
17
|
+
if (!optionsElement) return;
|
|
18
|
+
const observer = new MutationObserver((mutations) => {
|
|
19
|
+
for (const mutation of mutations) {
|
|
20
|
+
if (mutation.type === "attributes" && mutation.attributeName === "value") {
|
|
21
|
+
const filter = optionsElement.getAttribute("value") || "";
|
|
22
|
+
console.log("filter", filter);
|
|
23
|
+
if (!filter) return setOptions(props.options);
|
|
24
|
+
const filtredOptions = _.filter(props.options, (data) => {
|
|
25
|
+
var _a;
|
|
26
|
+
const value2 = ((_a = Object.values(data || {})) == null ? void 0 : _a[0]) || "";
|
|
27
|
+
if (_.isString(value2)) return _.includes(value2, filter);
|
|
28
|
+
return _.includes(value2 == null ? void 0 : value2.textContent, filter);
|
|
29
|
+
});
|
|
30
|
+
setOptions(filtredOptions);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
24
33
|
});
|
|
25
|
-
|
|
26
|
-
|
|
34
|
+
observer.observe(optionsElement, { attributes: true });
|
|
35
|
+
return () => observer.disconnect();
|
|
36
|
+
}, [props.options]);
|
|
27
37
|
return /* @__PURE__ */ jsx(Container, { id: "input-options", width: props.width, children: _.map(
|
|
28
38
|
options,
|
|
29
39
|
(data, index) => /* @__PURE__ */ jsx(
|
|
@@ -171,9 +171,12 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
171
171
|
insideMemory.push(index);
|
|
172
172
|
elementFocusable(target, index).focus();
|
|
173
173
|
},
|
|
174
|
+
onClick: () => {
|
|
175
|
+
insideMemory.push(index);
|
|
176
|
+
elementFocusable(target, index).focus();
|
|
177
|
+
},
|
|
174
178
|
onMouseLeave: () => {
|
|
175
179
|
insideMemory.splice(import_lodash.default.findIndex(insideMemory, (i) => i === index), 1);
|
|
176
|
-
elementFocusable(target, index).focus();
|
|
177
180
|
},
|
|
178
181
|
children: target.component
|
|
179
182
|
}
|
|
@@ -137,9 +137,12 @@ const TargetProviderContainer = ({ children }) => {
|
|
|
137
137
|
insideMemory.push(index);
|
|
138
138
|
elementFocusable(target, index).focus();
|
|
139
139
|
},
|
|
140
|
+
onClick: () => {
|
|
141
|
+
insideMemory.push(index);
|
|
142
|
+
elementFocusable(target, index).focus();
|
|
143
|
+
},
|
|
140
144
|
onMouseLeave: () => {
|
|
141
145
|
insideMemory.splice(_.findIndex(insideMemory, (i) => i === index), 1);
|
|
142
|
-
elementFocusable(target, index).focus();
|
|
143
146
|
},
|
|
144
147
|
children: target.component
|
|
145
148
|
}
|