@charlesgomes/leafcode-shared-lib-react 1.0.71 → 1.0.72

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/index.js CHANGED
@@ -780,6 +780,14 @@ var InputBase3 = ({
780
780
  if (!defaultValue) return;
781
781
  setValue(defaultValue.label ?? defaultValue);
782
782
  }, [defaultValue]);
783
+ (0, import_react12.useEffect)(() => {
784
+ if (typeof rest.value === "string") {
785
+ setValue(rest.value);
786
+ }
787
+ if (rest.value === null || rest.value === void 0) {
788
+ setValue("");
789
+ }
790
+ }, [rest.value]);
783
791
  const handleScroll = () => {
784
792
  if (!listRef.current || !data) return;
785
793
  const { scrollTop, clientHeight, scrollHeight } = listRef.current;
@@ -814,7 +822,9 @@ var InputBase3 = ({
814
822
  className: "input-wrapper",
815
823
  style: styleVars,
816
824
  tabIndex: -1,
817
- onBlur: (e) => e.relatedTarget === null && setIsOpen(false),
825
+ onBlur: (e) => {
826
+ e.relatedTarget === null && setIsOpen(false);
827
+ },
818
828
  children: [
819
829
  label && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
820
830
  "label",
@@ -835,10 +845,11 @@ var InputBase3 = ({
835
845
  placeholder,
836
846
  autoComplete: "off",
837
847
  className: "input",
838
- value,
848
+ value: value ?? "",
839
849
  onChange: (e) => {
840
- setValue(e.target.value);
841
- onChange?.(e.target.value);
850
+ const val = e.target.value;
851
+ setValue(val);
852
+ onChange?.(val);
842
853
  setIsOpen(true);
843
854
  },
844
855
  onFocus: () => setIsOpen(true),
@@ -853,7 +864,7 @@ var InputBase3 = ({
853
864
  setValue("");
854
865
  setItems([]);
855
866
  setPageNumber(1);
856
- onChange?.(null);
867
+ onChange?.("");
857
868
  onSelect(null);
858
869
  },
859
870
  className: "dropdown-clear",
package/dist/index.mjs CHANGED
@@ -730,6 +730,14 @@ var InputBase3 = ({
730
730
  if (!defaultValue) return;
731
731
  setValue(defaultValue.label ?? defaultValue);
732
732
  }, [defaultValue]);
733
+ useEffect4(() => {
734
+ if (typeof rest.value === "string") {
735
+ setValue(rest.value);
736
+ }
737
+ if (rest.value === null || rest.value === void 0) {
738
+ setValue("");
739
+ }
740
+ }, [rest.value]);
733
741
  const handleScroll = () => {
734
742
  if (!listRef.current || !data) return;
735
743
  const { scrollTop, clientHeight, scrollHeight } = listRef.current;
@@ -764,7 +772,9 @@ var InputBase3 = ({
764
772
  className: "input-wrapper",
765
773
  style: styleVars,
766
774
  tabIndex: -1,
767
- onBlur: (e) => e.relatedTarget === null && setIsOpen(false),
775
+ onBlur: (e) => {
776
+ e.relatedTarget === null && setIsOpen(false);
777
+ },
768
778
  children: [
769
779
  label && /* @__PURE__ */ jsx10(
770
780
  "label",
@@ -785,10 +795,11 @@ var InputBase3 = ({
785
795
  placeholder,
786
796
  autoComplete: "off",
787
797
  className: "input",
788
- value,
798
+ value: value ?? "",
789
799
  onChange: (e) => {
790
- setValue(e.target.value);
791
- onChange?.(e.target.value);
800
+ const val = e.target.value;
801
+ setValue(val);
802
+ onChange?.(val);
792
803
  setIsOpen(true);
793
804
  },
794
805
  onFocus: () => setIsOpen(true),
@@ -803,7 +814,7 @@ var InputBase3 = ({
803
814
  setValue("");
804
815
  setItems([]);
805
816
  setPageNumber(1);
806
- onChange?.(null);
817
+ onChange?.("");
807
818
  onSelect(null);
808
819
  },
809
820
  className: "dropdown-clear",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@charlesgomes/leafcode-shared-lib-react",
3
- "version": "1.0.71",
3
+ "version": "1.0.72",
4
4
  "description": "Lib de componentes react",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",