@gustavo-valsechi/client 1.4.89 → 1.4.91

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.
@@ -77,8 +77,7 @@ function InputSelect(props) {
77
77
  ...register,
78
78
  onChange,
79
79
  onFocus,
80
- onBlur,
81
- focus
80
+ onBlur
82
81
  }
83
82
  ),
84
83
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "input-icon", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { "aria-hidden": true, className: focus ? "fa-solid fa-chevron-up" : "fa-solid fa-chevron-down" }) })
@@ -44,8 +44,7 @@ function InputSelect(props) {
44
44
  ...register,
45
45
  onChange,
46
46
  onFocus,
47
- onBlur,
48
- focus
47
+ onBlur
49
48
  }
50
49
  ),
51
50
  /* @__PURE__ */ jsx("div", { className: "input-icon", children: /* @__PURE__ */ jsx("i", { "aria-hidden": true, className: focus ? "fa-solid fa-chevron-up" : "fa-solid fa-chevron-down" }) })
@@ -53,8 +53,12 @@ const Container = import_styled_components.default.div`
53
53
  font-size: .8rem;
54
54
  background-color: ${({ theme }) => theme.primary};
55
55
  color: ${({ theme }) => theme.t6};
56
- cursor: ${({ focus }) => focus ? "vertical-text" : "pointer"};
56
+ cursor: pointer;
57
57
 
58
+ &:focus {
59
+ cursor: vertical-text;
60
+ }
61
+
58
62
  &:disabled {
59
63
  background-color: ${({ theme }) => theme.t2};
60
64
  color: ${({ theme }) => theme.t6};
@@ -20,8 +20,12 @@ const Container = styled.div`
20
20
  font-size: .8rem;
21
21
  background-color: ${({ theme }) => theme.primary};
22
22
  color: ${({ theme }) => theme.t6};
23
- cursor: ${({ focus }) => focus ? "vertical-text" : "pointer"};
23
+ cursor: pointer;
24
24
 
25
+ &:focus {
26
+ cursor: vertical-text;
27
+ }
28
+
25
29
  &:disabled {
26
30
  background-color: ${({ theme }) => theme.t2};
27
31
  color: ${({ theme }) => theme.t6};
@@ -44,19 +44,14 @@ const TargetProviderContainer = ({ children }) => {
44
44
  const containerRef = (0, import_react.useRef)([]);
45
45
  const [targets, setTargets] = (0, import_react.useState)([]);
46
46
  const [inside, setInside] = (0, import_react.useState)(false);
47
- const [show, setShow] = (0, import_react.useState)([]);
48
47
  const elementFocusable = (target, index) => {
49
- const focusableSelectors = [
50
- "input",
51
- "select",
52
- "textarea",
53
- "button",
54
- "a[href]",
55
- "[tabindex]",
56
- "[contenteditable]"
57
- ];
58
- const focusable = import_lodash.default.some(focusableSelectors, (sel) => target.ref.current.matches(sel));
59
- if (focusable) return target.ref.current;
48
+ const focusableTags = ["input", "select", "textarea", "button"];
49
+ const isFocusable = import_lodash.default.some(focusableTags, (tag) => target.ref.current.tagName.toLowerCase() === tag);
50
+ console.log("tagName", target.ref.current.tagName.toLowerCase());
51
+ console.log("isFocusable", isFocusable);
52
+ console.log("target.ref.current", target.ref.current);
53
+ console.log("inputRef.current[index]", inputRef.current[index]);
54
+ if (isFocusable) return target.ref.current;
60
55
  return inputRef.current[index];
61
56
  };
62
57
  const close = (element) => {
@@ -10,19 +10,14 @@ const TargetProviderContainer = ({ children }) => {
10
10
  const containerRef = useRef([]);
11
11
  const [targets, setTargets] = useState([]);
12
12
  const [inside, setInside] = useState(false);
13
- const [show, setShow] = useState([]);
14
13
  const elementFocusable = (target, index) => {
15
- const focusableSelectors = [
16
- "input",
17
- "select",
18
- "textarea",
19
- "button",
20
- "a[href]",
21
- "[tabindex]",
22
- "[contenteditable]"
23
- ];
24
- const focusable = _.some(focusableSelectors, (sel) => target.ref.current.matches(sel));
25
- if (focusable) return target.ref.current;
14
+ const focusableTags = ["input", "select", "textarea", "button"];
15
+ const isFocusable = _.some(focusableTags, (tag) => target.ref.current.tagName.toLowerCase() === tag);
16
+ console.log("tagName", target.ref.current.tagName.toLowerCase());
17
+ console.log("isFocusable", isFocusable);
18
+ console.log("target.ref.current", target.ref.current);
19
+ console.log("inputRef.current[index]", inputRef.current[index]);
20
+ if (isFocusable) return target.ref.current;
26
21
  return inputRef.current[index];
27
22
  };
28
23
  const close = (element) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/client",
3
- "version": "1.4.89",
3
+ "version": "1.4.91",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",