@gustavo-valsechi/client 1.4.39 → 1.4.41

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.
@@ -47,7 +47,7 @@ function InputSelect(props) {
47
47
  const [focus, setFocus] = (0, import_react.useState)(false);
48
48
  const register = (props.register || ((name) => ({})))(props.name || "");
49
49
  (0, import_react.useEffect)(() => {
50
- target.add({ ref: inputRef, component: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_options.default, { option: true, ...props }) });
50
+ target.add({ ref: inputRef, component: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_options.default, { option, ...props }) });
51
51
  return () => target.remove(inputRef);
52
52
  }, []);
53
53
  const onBlur = (event) => {
@@ -14,7 +14,7 @@ function InputSelect(props) {
14
14
  const [focus, setFocus] = useState(false);
15
15
  const register = (props.register || ((name) => ({})))(props.name || "");
16
16
  useEffect(() => {
17
- target.add({ ref: inputRef, component: /* @__PURE__ */ jsx(InputSelectOption, { option: true, ...props }) });
17
+ target.add({ ref: inputRef, component: /* @__PURE__ */ jsx(InputSelectOption, { option, ...props }) });
18
18
  return () => target.remove(inputRef);
19
19
  }, []);
20
20
  const onBlur = (event) => {
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  "use client";
3
+ var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
6
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
9
  var __export = (target, all) => {
8
10
  for (var name in all)
@@ -16,6 +18,14 @@ var __copyProps = (to, from, except, desc) => {
16
18
  }
17
19
  return to;
18
20
  };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
19
29
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
30
  var options_exports = {};
21
31
  __export(options_exports, {
@@ -24,7 +34,18 @@ __export(options_exports, {
24
34
  module.exports = __toCommonJS(options_exports);
25
35
  var import_jsx_runtime = require("react/jsx-runtime");
26
36
  var import_styles = require("./styles");
37
+ var import_lodash = __toESM(require("lodash"));
27
38
  function InputSelectOption(props) {
28
39
  const [value, set] = props.option;
29
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.Container, {});
40
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.Container, { children: import_lodash.default.map(
41
+ props.options,
42
+ (data, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
43
+ "option",
44
+ {
45
+ value: Object.keys(data),
46
+ children: Object.values(data)
47
+ },
48
+ index
49
+ )
50
+ ) });
30
51
  }
@@ -1,9 +1,20 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { Container } from "./styles";
4
+ import _ from "lodash";
4
5
  function InputSelectOption(props) {
5
6
  const [value, set] = props.option;
6
- return /* @__PURE__ */ jsx(Container, {});
7
+ return /* @__PURE__ */ jsx(Container, { children: _.map(
8
+ props.options,
9
+ (data, index) => /* @__PURE__ */ jsx(
10
+ "option",
11
+ {
12
+ value: Object.keys(data),
13
+ children: Object.values(data)
14
+ },
15
+ index
16
+ )
17
+ ) });
7
18
  }
8
19
  export {
9
20
  InputSelectOption as default
@@ -88,14 +88,14 @@ const TargetProviderContainer = ({ children }) => {
88
88
  children: [
89
89
  import_lodash.default.map(
90
90
  targets,
91
- (target, index) => !!target.show && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
91
+ (target, index) => !!target.show ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
92
92
  import_styles.Container,
93
93
  {
94
94
  style: getCoords(target.ref.current),
95
95
  children: target.component
96
96
  },
97
97
  index
98
- )
98
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {})
99
99
  ),
100
100
  children
101
101
  ]
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { createContext, useContext, useEffect, useState } from "react";
4
4
  import { Container } from "./styles";
5
5
  import _ from "lodash";
@@ -54,14 +54,14 @@ const TargetProviderContainer = ({ children }) => {
54
54
  children: [
55
55
  _.map(
56
56
  targets,
57
- (target, index) => !!target.show && /* @__PURE__ */ jsx(
57
+ (target, index) => !!target.show ? /* @__PURE__ */ jsx(
58
58
  Container,
59
59
  {
60
60
  style: getCoords(target.ref.current),
61
61
  children: target.component
62
62
  },
63
63
  index
64
- )
64
+ ) : /* @__PURE__ */ jsx(Fragment, {})
65
65
  ),
66
66
  children
67
67
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/client",
3
- "version": "1.4.39",
3
+ "version": "1.4.41",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",