nexaas-ui-components 1.0.86 → 1.0.88

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.cjs CHANGED
@@ -818,20 +818,8 @@ var DatePickerInput = React5.forwardRef(
818
818
  var _a;
819
819
  const [invalidDate, setInvalidDate] = React5.useState(false);
820
820
  const [showCalendar, setShowCalendar] = React5.useState(false);
821
- const [inputWidth, setInputWidth] = React5.useState(0);
822
821
  const inputContainerRef = React5.useRef(null);
823
822
  const dateFnsFormat = "dd/MM/yyyy";
824
- React5.useEffect(() => {
825
- const updateWidth = () => {
826
- if (inputContainerRef.current) {
827
- setInputWidth(inputContainerRef.current.offsetWidth + 10);
828
- }
829
- };
830
- updateWidth();
831
- window.addEventListener("resize", updateWidth);
832
- return () => window.removeEventListener("resize", updateWidth);
833
- }, []);
834
- const finalOffset = popoverOffset || [inputWidth || 250, -46];
835
823
  const fieldValidation = useFieldErrorsStore((state) => state.field);
836
824
  const fieldValidationMessages = [
837
825
  (_a = fieldValidation[name ? name : registration == null ? void 0 : registration.name]) == null ? void 0 : _a.message,
@@ -877,10 +865,6 @@ var DatePickerInput = React5.forwardRef(
877
865
  ref.current = node;
878
866
  }
879
867
  },
880
- style: {
881
- ["--popover-offset-x"]: `${finalOffset[0]}px`,
882
- ["--popover-offset-y"]: `${ -100}px`
883
- },
884
868
  children: [
885
869
  icon && /* @__PURE__ */ jsxRuntime.jsx(
886
870
  "div",
@@ -905,10 +889,21 @@ var DatePickerInput = React5.forwardRef(
905
889
  style: { height: "46px" }
906
890
  },
907
891
  popoverProps: {
908
- placement: "bottom",
909
- usePortal: false,
892
+ placement: "bottom-start",
893
+ // usePortal false renderizava o calendario dentro do proprio input, entao
894
+ // qualquer ancestral com overflow auto/hidden (modal com scroll, painel
895
+ // lateral) o cortava e ele ficava inutilizavel. Com portal ele vai pro body e
896
+ // o Popper reposiciona sozinho quando nao ha espaco abaixo.
897
+ usePortal: true,
910
898
  minimal: true,
911
- popoverClassName: "date-picker-popover"
899
+ popoverClassName: "date-picker-popover",
900
+ // Sem boundary o flip ignora o viewport quando o input esta dentro de um
901
+ // container com scroll.
902
+ modifiers: {
903
+ preventOverflow: { enabled: true, options: { padding: 8 } },
904
+ flip: { enabled: true },
905
+ ...popoverOffset ? { offset: { enabled: true, options: { offset: popoverOffset } } } : {}
906
+ }
912
907
  },
913
908
  disabled,
914
909
  onChange: (e, isUserChange) => {