@gustavo-valsechi/client 1.4.134 → 1.4.137

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,6 +50,12 @@ function InputSelect(props) {
50
50
  const register = (props.register || ((name) => ({})))(props.name || "");
51
51
  const inputValue = (_a = props.watch) == null ? void 0 : _a.call(props, props.name);
52
52
  const value = ((_b = import_lodash.default.find(props.options, (option) => Object.keys(option)[0] === inputValue)) == null ? void 0 : _b[inputValue || ""]) || "";
53
+ (0, import_react.useEffect)(() => {
54
+ if (focus) return;
55
+ const optionsElement = document.getElementById("input-options");
56
+ if (!optionsElement) return;
57
+ optionsElement.setAttribute("value", "");
58
+ }, [focus]);
53
59
  (0, import_react.useEffect)(() => {
54
60
  var _a2;
55
61
  if (!(inputRef == null ? void 0 : inputRef.current) || !(containerRef == null ? void 0 : containerRef.current)) return;
@@ -125,7 +131,11 @@ function InputSelect(props) {
125
131
  {
126
132
  className: "input-icon",
127
133
  "data-focus": focus,
128
- onClick: !focus && inputRef.current.click,
134
+ onClick: () => {
135
+ console.log(focus);
136
+ if (focus) return;
137
+ inputRef.current.focus();
138
+ },
129
139
  children: [
130
140
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { "aria-hidden": true, className: "fa-solid fa-chevron-up" }),
131
141
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { "aria-hidden": true, className: "fa-solid fa-chevron-down" })
@@ -17,6 +17,12 @@ function InputSelect(props) {
17
17
  const register = (props.register || ((name) => ({})))(props.name || "");
18
18
  const inputValue = (_a = props.watch) == null ? void 0 : _a.call(props, props.name);
19
19
  const value = ((_b = _.find(props.options, (option) => Object.keys(option)[0] === inputValue)) == null ? void 0 : _b[inputValue || ""]) || "";
20
+ useEffect(() => {
21
+ if (focus) return;
22
+ const optionsElement = document.getElementById("input-options");
23
+ if (!optionsElement) return;
24
+ optionsElement.setAttribute("value", "");
25
+ }, [focus]);
20
26
  useEffect(() => {
21
27
  var _a2;
22
28
  if (!(inputRef == null ? void 0 : inputRef.current) || !(containerRef == null ? void 0 : containerRef.current)) return;
@@ -92,7 +98,11 @@ function InputSelect(props) {
92
98
  {
93
99
  className: "input-icon",
94
100
  "data-focus": focus,
95
- onClick: !focus && inputRef.current.click,
101
+ onClick: () => {
102
+ console.log(focus);
103
+ if (focus) return;
104
+ inputRef.current.focus();
105
+ },
96
106
  children: [
97
107
  /* @__PURE__ */ jsx("i", { "aria-hidden": true, className: "fa-solid fa-chevron-up" }),
98
108
  /* @__PURE__ */ jsx("i", { "aria-hidden": true, className: "fa-solid fa-chevron-down" })
@@ -84,6 +84,7 @@ const Container = import_styled_components.default.div`
84
84
  padding: 0 1rem;
85
85
  display: flex;
86
86
  align-items: center;
87
+ user-select: none;
87
88
  }
88
89
 
89
90
  .input-icon {
@@ -51,6 +51,7 @@ const Container = styled.div`
51
51
  padding: 0 1rem;
52
52
  display: flex;
53
53
  align-items: center;
54
+ user-select: none;
54
55
  }
55
56
 
56
57
  .input-icon {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/client",
3
- "version": "1.4.134",
3
+ "version": "1.4.137",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",