nexaas-ui-components 1.0.86 → 1.0.89
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 +19 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +19 -19
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
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,26 @@ var DatePickerInput = React5.forwardRef(
|
|
|
905
889
|
style: { height: "46px" }
|
|
906
890
|
},
|
|
907
891
|
popoverProps: {
|
|
908
|
-
placement: "bottom",
|
|
909
|
-
usePortal
|
|
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
|
+
// O .bp6-portal nasce com z-index 20, abaixo do overlay do ModalDialog
|
|
901
|
+
// (react-modal, zIndex 9999): dentro de modal o calendario ficava atras.
|
|
902
|
+
// O z-index vai no PORTAL, nao no popoverClassName — quem empilha e o
|
|
903
|
+
// wrapper posicionado no body, nao o conteudo do popover.
|
|
904
|
+
portalClassName: "date-picker-portal",
|
|
905
|
+
// Sem boundary o flip ignora o viewport quando o input esta dentro de um
|
|
906
|
+
// container com scroll.
|
|
907
|
+
modifiers: {
|
|
908
|
+
preventOverflow: { enabled: true, options: { padding: 8 } },
|
|
909
|
+
flip: { enabled: true },
|
|
910
|
+
...popoverOffset ? { offset: { enabled: true, options: { offset: popoverOffset } } } : {}
|
|
911
|
+
}
|
|
912
912
|
},
|
|
913
913
|
disabled,
|
|
914
914
|
onChange: (e, isUserChange) => {
|