@beweco/aurora-ui 0.6.57 → 0.6.59
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.js +75 -10
- package/dist/index.esm.js +75 -11
- package/dist/types/components/currency/Currency.d.ts.map +1 -1
- package/dist/types/components/drawer-filters/_internal/DayMonthPicker.d.ts.map +1 -1
- package/dist/types/components/multi-step-wizard/MultiStepWizard.d.ts +1 -1
- package/dist/types/components/multi-step-wizard/MultiStepWizard.d.ts.map +1 -1
- package/dist/types/components/multi-step-wizard/MultiStepWizard.types.d.ts +6 -0
- package/dist/types/components/multi-step-wizard/MultiStepWizard.types.d.ts.map +1 -1
- package/dist/types/components/multi-step-wizard/_internal/MultiStepSidebar.d.ts.map +1 -1
- package/dist/types/components/multi-step-wizard/_internal/MultiStepSidebar.types.d.ts +2 -0
- package/dist/types/components/multi-step-wizard/_internal/MultiStepSidebar.types.d.ts.map +1 -1
- package/dist/types/components/phone/Phone.d.ts.map +1 -1
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/useCloseOnAncestorScroll.d.ts +25 -0
- package/dist/types/hooks/useCloseOnAncestorScroll.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1771,6 +1771,42 @@ var Chip = function (_a) {
|
|
|
1771
1771
|
return (jsxRuntime.jsx(react.Chip, __assign({}, props, { onClose: props.onClose, classNames: __assign({ base: colorClasses }, props.classNames) })));
|
|
1772
1772
|
};
|
|
1773
1773
|
|
|
1774
|
+
/**
|
|
1775
|
+
* Cierra un dropdown/popover porteado cuando un ancestro hace scroll.
|
|
1776
|
+
*
|
|
1777
|
+
* Los componentes que portean su contenido a `document.body` y lo posicionan
|
|
1778
|
+
* de forma absoluta con `getBoundingClientRect()` quedan "flotando" en la
|
|
1779
|
+
* posición original cuando un contenedor con scroll se desplaza, porque la
|
|
1780
|
+
* posición no se recalcula. En lugar de reposicionar en cada frame, se cierra
|
|
1781
|
+
* el dropdown ante el scroll de un ancestro (mismo comportamiento que los
|
|
1782
|
+
* overlays de React Aria/HeroUI).
|
|
1783
|
+
*/
|
|
1784
|
+
var useCloseOnAncestorScroll = function (_a) {
|
|
1785
|
+
var isOpen = _a.isOpen, onClose = _a.onClose, contentRef = _a.contentRef;
|
|
1786
|
+
React.useEffect(function () {
|
|
1787
|
+
if (!isOpen) {
|
|
1788
|
+
return;
|
|
1789
|
+
}
|
|
1790
|
+
var handleAncestorScroll = function (event) {
|
|
1791
|
+
var _a;
|
|
1792
|
+
var target = event.target;
|
|
1793
|
+
// Permitir el scroll interno del propio contenido (la lista).
|
|
1794
|
+
if (target && ((_a = contentRef === null || contentRef === void 0 ? void 0 : contentRef.current) === null || _a === void 0 ? void 0 : _a.contains(target))) {
|
|
1795
|
+
return;
|
|
1796
|
+
}
|
|
1797
|
+
onClose();
|
|
1798
|
+
};
|
|
1799
|
+
// `capture` para detectar el scroll de cualquier ancestro, no solo window.
|
|
1800
|
+
window.addEventListener("scroll", handleAncestorScroll, {
|
|
1801
|
+
capture: true,
|
|
1802
|
+
passive: true,
|
|
1803
|
+
});
|
|
1804
|
+
return function () {
|
|
1805
|
+
window.removeEventListener("scroll", handleAncestorScroll, true);
|
|
1806
|
+
};
|
|
1807
|
+
}, [isOpen, onClose, contentRef]);
|
|
1808
|
+
};
|
|
1809
|
+
|
|
1774
1810
|
// Lista de países con código telefónico y código ISO
|
|
1775
1811
|
var countries = [
|
|
1776
1812
|
{ code: "+57", name: "Colombia", country: "CO" },
|
|
@@ -2426,6 +2462,13 @@ var Currency = function (_a) {
|
|
|
2426
2462
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
2427
2463
|
};
|
|
2428
2464
|
}, [isDropdownOpen]);
|
|
2465
|
+
// El dropdown se portea a `body` con posición absoluta fija; cerrarlo cuando
|
|
2466
|
+
// un ancestro hace scroll para que no quede flotando fuera de lugar.
|
|
2467
|
+
useCloseOnAncestorScroll({
|
|
2468
|
+
isOpen: isDropdownOpen,
|
|
2469
|
+
onClose: function () { return setIsDropdownOpen(false); },
|
|
2470
|
+
contentRef: portalDropdownRef,
|
|
2471
|
+
});
|
|
2429
2472
|
var emitChange = function (opt, amount) {
|
|
2430
2473
|
if (showInput) {
|
|
2431
2474
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
@@ -3829,8 +3872,11 @@ var VerticalSteps = React.forwardRef(function (_a, ref) {
|
|
|
3829
3872
|
VerticalSteps.displayName = "VerticalSteps";
|
|
3830
3873
|
|
|
3831
3874
|
var MultiStepSidebar = React.forwardRef(function (_a, ref) {
|
|
3832
|
-
var children = _a.children, className = _a.className, currentPage = _a.currentPage; _a.onBack; _a.onNext; var onChangePage = _a.onChangePage, steps = _a.steps; _a.goBackTranslation; var onClose = _a.onClose, _b = _a.hideInactiveDescriptions, hideInactiveDescriptions = _b === void 0 ? false : _b, props = __rest(_a, ["children", "className", "currentPage", "onBack", "onNext", "onChangePage", "steps", "goBackTranslation", "onClose", "hideInactiveDescriptions"]);
|
|
3875
|
+
var children = _a.children, className = _a.className, currentPage = _a.currentPage; _a.onBack; _a.onNext; var onChangePage = _a.onChangePage, steps = _a.steps; _a.goBackTranslation; var onClose = _a.onClose, _b = _a.hideInactiveDescriptions, hideInactiveDescriptions = _b === void 0 ? false : _b, _c = _a.isDismissable, isDismissable = _c === void 0 ? true : _c, props = __rest(_a, ["children", "className", "currentPage", "onBack", "onNext", "onChangePage", "steps", "goBackTranslation", "onClose", "hideInactiveDescriptions", "isDismissable"]);
|
|
3833
3876
|
var handleOverlayClick = function (e) {
|
|
3877
|
+
if (!isDismissable) {
|
|
3878
|
+
return;
|
|
3879
|
+
}
|
|
3834
3880
|
if (e.target === e.currentTarget) {
|
|
3835
3881
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
3836
3882
|
}
|
|
@@ -3849,8 +3895,8 @@ var MultistepNavigationButtons = function (_a) {
|
|
|
3849
3895
|
};
|
|
3850
3896
|
|
|
3851
3897
|
var MultiStepWizard = function (_a) {
|
|
3852
|
-
var isOpen = _a.isOpen, steps = _a.steps, translations = _a.translations, onClose = _a.onClose, onComplete = _a.onComplete, completeButtonText = _a.completeButtonText, hideInactiveDescriptions = _a.hideInactiveDescriptions;
|
|
3853
|
-
var
|
|
3898
|
+
var isOpen = _a.isOpen, steps = _a.steps, translations = _a.translations, onClose = _a.onClose, onComplete = _a.onComplete, completeButtonText = _a.completeButtonText, hideInactiveDescriptions = _a.hideInactiveDescriptions, _b = _a.isDismissable, isDismissable = _b === void 0 ? true : _b;
|
|
3899
|
+
var _c = React.useState(0), page = _c[0], setPage = _c[1];
|
|
3854
3900
|
React.useEffect(function () {
|
|
3855
3901
|
if (isOpen) {
|
|
3856
3902
|
setPage(0);
|
|
@@ -3913,7 +3959,7 @@ var MultiStepWizard = function (_a) {
|
|
|
3913
3959
|
if (!isOpen) {
|
|
3914
3960
|
return null;
|
|
3915
3961
|
}
|
|
3916
|
-
return (jsxRuntime.jsxs(MultiStepSidebar, { currentPage: page, goBackTranslation: t.goBack, steps: steps, onBack: onBack, onChangePage: onChangePage, onClose: onClose, onNext: onNext, hideInactiveDescriptions: hideInactiveDescriptions, children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Button, { className: "w-fit text-default-600 mb-6", color: "default", variant: "light", onPress: onBack, isDisabled: page === 0, startContent: jsxRuntime.jsx(IconComponent, { className: "text-default-500", icon: "material-symbols:arrow-back-rounded", size: "sm" }), children: t.goBack || "Back" }), jsxRuntime.jsx("div", { className: "relative flex h-fit w-full flex-col text-center lg:justify-center lg:pt-0", children: content })] }), jsxRuntime.jsx(MultistepNavigationButtons, { backButtonProps: {
|
|
3962
|
+
return (jsxRuntime.jsxs(MultiStepSidebar, { currentPage: page, goBackTranslation: t.goBack, steps: steps, onBack: onBack, onChangePage: onChangePage, onClose: onClose, onNext: onNext, hideInactiveDescriptions: hideInactiveDescriptions, isDismissable: isDismissable, children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Button, { className: "w-fit text-default-600 mb-6", color: "default", variant: "light", onPress: onBack, isDisabled: page === 0, startContent: jsxRuntime.jsx(IconComponent, { className: "text-default-500", icon: "material-symbols:arrow-back-rounded", size: "sm" }), children: t.goBack || "Back" }), jsxRuntime.jsx("div", { className: "relative flex h-fit w-full flex-col text-center lg:justify-center lg:pt-0", children: content })] }), jsxRuntime.jsx(MultistepNavigationButtons, { backButtonProps: {
|
|
3917
3963
|
isDisabled: page === 0,
|
|
3918
3964
|
onPress: onBack,
|
|
3919
3965
|
children: t.goBack,
|
|
@@ -3948,7 +3994,7 @@ var Phone = function (_a) {
|
|
|
3948
3994
|
var finalLabel = label || t.label;
|
|
3949
3995
|
React.useEffect(function () {
|
|
3950
3996
|
if (value) {
|
|
3951
|
-
var found = uniqueCountries.find(function (c) { return c.code === value.code; });
|
|
3997
|
+
var found = uniqueCountries.find(function (c) { return c.code === value.code && (value.country ? c.country === value.country : true); });
|
|
3952
3998
|
if (found) {
|
|
3953
3999
|
setSelectedCountry(found);
|
|
3954
4000
|
}
|
|
@@ -3973,21 +4019,39 @@ var Phone = function (_a) {
|
|
|
3973
4019
|
}
|
|
3974
4020
|
}, [isDropdownOpen]);
|
|
3975
4021
|
React.useEffect(function () {
|
|
4022
|
+
if (!isDropdownOpen)
|
|
4023
|
+
return;
|
|
3976
4024
|
var handleClickOutside = function (event) {
|
|
4025
|
+
// Ignore synthetic events (e.g. dispatched by scroll-close hooks)
|
|
4026
|
+
if (!event.isTrusted)
|
|
4027
|
+
return;
|
|
4028
|
+
var target = event.target;
|
|
3977
4029
|
if (dropdownRef.current &&
|
|
3978
|
-
!dropdownRef.current.contains(
|
|
4030
|
+
!dropdownRef.current.contains(target) &&
|
|
3979
4031
|
portalDropdownRef.current &&
|
|
3980
|
-
!portalDropdownRef.current.contains(
|
|
4032
|
+
!portalDropdownRef.current.contains(target)) {
|
|
3981
4033
|
setIsDropdownOpen(false);
|
|
3982
4034
|
}
|
|
3983
4035
|
};
|
|
3984
|
-
|
|
4036
|
+
// Defer listener registration to the next frame so the same
|
|
4037
|
+
// tap/click that opened the dropdown cannot immediately close it.
|
|
4038
|
+
var rafId = requestAnimationFrame(function () {
|
|
4039
|
+
document.addEventListener("pointerdown", handleClickOutside);
|
|
3985
4040
|
document.addEventListener("mousedown", handleClickOutside);
|
|
3986
|
-
}
|
|
4041
|
+
});
|
|
3987
4042
|
return function () {
|
|
4043
|
+
cancelAnimationFrame(rafId);
|
|
4044
|
+
document.removeEventListener("pointerdown", handleClickOutside);
|
|
3988
4045
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
3989
4046
|
};
|
|
3990
4047
|
}, [isDropdownOpen]);
|
|
4048
|
+
// El dropdown se portea a `body` con posición absoluta fija; cerrarlo cuando
|
|
4049
|
+
// un ancestro hace scroll para que no quede flotando fuera de lugar.
|
|
4050
|
+
useCloseOnAncestorScroll({
|
|
4051
|
+
isOpen: isDropdownOpen,
|
|
4052
|
+
onClose: function () { return setIsDropdownOpen(false); },
|
|
4053
|
+
contentRef: portalDropdownRef,
|
|
4054
|
+
});
|
|
3991
4055
|
var handleCountrySelect = function (country) {
|
|
3992
4056
|
setSelectedCountry(country);
|
|
3993
4057
|
setIsDropdownOpen(false);
|
|
@@ -4019,7 +4083,7 @@ var Phone = function (_a) {
|
|
|
4019
4083
|
country.code.toLowerCase().includes(searchTerm);
|
|
4020
4084
|
});
|
|
4021
4085
|
setFilteredCountries(filtered);
|
|
4022
|
-
} }) }), jsxRuntime.jsx("div", { className: "max-h-60 overflow-y-auto", children: filteredCountries.length > 0 ? (filteredCountries.map(function (country) { return (jsxRuntime.jsxs("button", { type: "button", className: "flex items-center w-full px-4 py-2.5 text-sm hover:bg-default-200 ".concat(country.
|
|
4086
|
+
} }) }), jsxRuntime.jsx("div", { className: "max-h-60 overflow-y-auto", children: filteredCountries.length > 0 ? (filteredCountries.map(function (country) { return (jsxRuntime.jsxs("button", { type: "button", className: "flex items-center w-full px-4 py-2.5 text-sm hover:bg-default-200 ".concat(country.country === selectedCountry.country
|
|
4023
4087
|
? "bg-primary-50"
|
|
4024
4088
|
: ""), onClick: function () { return handleCountrySelect(country); }, children: [jsxRuntime.jsx("span", { className: "mr-3", children: jsxRuntime.jsx(FlagIcon, { countryCode: country.country, size: "md" }) }), jsxRuntime.jsx("span", { className: "flex-1 text-left text-default-500", children: getCountryName(country) }), jsxRuntime.jsx("span", { className: "text-xs text-default-500", children: country.code })] }, "".concat(country.code, "-").concat(country.country))); })) : (jsxRuntime.jsx("div", { className: "px-4 py-2 text-sm text-default-500", children: t.noCountriesFound })) })] }), document.body)] }));
|
|
4025
4089
|
};
|
|
@@ -9069,6 +9133,7 @@ exports.removeCustomPrimaryColor = removeCustomPrimaryColor;
|
|
|
9069
9133
|
exports.sizeMap = sizeMap;
|
|
9070
9134
|
exports.themeColors = themeColors;
|
|
9071
9135
|
exports.useAuraToast = useAuraToast;
|
|
9136
|
+
exports.useCloseOnAncestorScroll = useCloseOnAncestorScroll;
|
|
9072
9137
|
exports.useMediaQuery = useMediaQuery;
|
|
9073
9138
|
exports.useNavigationLoading = useNavigationLoading;
|
|
9074
9139
|
exports.useThemeContext = useThemeContext;
|
package/dist/index.esm.js
CHANGED
|
@@ -1772,6 +1772,42 @@ var Chip = function (_a) {
|
|
|
1772
1772
|
return (jsx(Chip$1, __assign({}, props, { onClose: props.onClose, classNames: __assign({ base: colorClasses }, props.classNames) })));
|
|
1773
1773
|
};
|
|
1774
1774
|
|
|
1775
|
+
/**
|
|
1776
|
+
* Cierra un dropdown/popover porteado cuando un ancestro hace scroll.
|
|
1777
|
+
*
|
|
1778
|
+
* Los componentes que portean su contenido a `document.body` y lo posicionan
|
|
1779
|
+
* de forma absoluta con `getBoundingClientRect()` quedan "flotando" en la
|
|
1780
|
+
* posición original cuando un contenedor con scroll se desplaza, porque la
|
|
1781
|
+
* posición no se recalcula. En lugar de reposicionar en cada frame, se cierra
|
|
1782
|
+
* el dropdown ante el scroll de un ancestro (mismo comportamiento que los
|
|
1783
|
+
* overlays de React Aria/HeroUI).
|
|
1784
|
+
*/
|
|
1785
|
+
var useCloseOnAncestorScroll = function (_a) {
|
|
1786
|
+
var isOpen = _a.isOpen, onClose = _a.onClose, contentRef = _a.contentRef;
|
|
1787
|
+
useEffect(function () {
|
|
1788
|
+
if (!isOpen) {
|
|
1789
|
+
return;
|
|
1790
|
+
}
|
|
1791
|
+
var handleAncestorScroll = function (event) {
|
|
1792
|
+
var _a;
|
|
1793
|
+
var target = event.target;
|
|
1794
|
+
// Permitir el scroll interno del propio contenido (la lista).
|
|
1795
|
+
if (target && ((_a = contentRef === null || contentRef === void 0 ? void 0 : contentRef.current) === null || _a === void 0 ? void 0 : _a.contains(target))) {
|
|
1796
|
+
return;
|
|
1797
|
+
}
|
|
1798
|
+
onClose();
|
|
1799
|
+
};
|
|
1800
|
+
// `capture` para detectar el scroll de cualquier ancestro, no solo window.
|
|
1801
|
+
window.addEventListener("scroll", handleAncestorScroll, {
|
|
1802
|
+
capture: true,
|
|
1803
|
+
passive: true,
|
|
1804
|
+
});
|
|
1805
|
+
return function () {
|
|
1806
|
+
window.removeEventListener("scroll", handleAncestorScroll, true);
|
|
1807
|
+
};
|
|
1808
|
+
}, [isOpen, onClose, contentRef]);
|
|
1809
|
+
};
|
|
1810
|
+
|
|
1775
1811
|
// Lista de países con código telefónico y código ISO
|
|
1776
1812
|
var countries = [
|
|
1777
1813
|
{ code: "+57", name: "Colombia", country: "CO" },
|
|
@@ -2427,6 +2463,13 @@ var Currency = function (_a) {
|
|
|
2427
2463
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
2428
2464
|
};
|
|
2429
2465
|
}, [isDropdownOpen]);
|
|
2466
|
+
// El dropdown se portea a `body` con posición absoluta fija; cerrarlo cuando
|
|
2467
|
+
// un ancestro hace scroll para que no quede flotando fuera de lugar.
|
|
2468
|
+
useCloseOnAncestorScroll({
|
|
2469
|
+
isOpen: isDropdownOpen,
|
|
2470
|
+
onClose: function () { return setIsDropdownOpen(false); },
|
|
2471
|
+
contentRef: portalDropdownRef,
|
|
2472
|
+
});
|
|
2430
2473
|
var emitChange = function (opt, amount) {
|
|
2431
2474
|
if (showInput) {
|
|
2432
2475
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
@@ -3830,8 +3873,11 @@ var VerticalSteps = React.forwardRef(function (_a, ref) {
|
|
|
3830
3873
|
VerticalSteps.displayName = "VerticalSteps";
|
|
3831
3874
|
|
|
3832
3875
|
var MultiStepSidebar = React.forwardRef(function (_a, ref) {
|
|
3833
|
-
var children = _a.children, className = _a.className, currentPage = _a.currentPage; _a.onBack; _a.onNext; var onChangePage = _a.onChangePage, steps = _a.steps; _a.goBackTranslation; var onClose = _a.onClose, _b = _a.hideInactiveDescriptions, hideInactiveDescriptions = _b === void 0 ? false : _b, props = __rest(_a, ["children", "className", "currentPage", "onBack", "onNext", "onChangePage", "steps", "goBackTranslation", "onClose", "hideInactiveDescriptions"]);
|
|
3876
|
+
var children = _a.children, className = _a.className, currentPage = _a.currentPage; _a.onBack; _a.onNext; var onChangePage = _a.onChangePage, steps = _a.steps; _a.goBackTranslation; var onClose = _a.onClose, _b = _a.hideInactiveDescriptions, hideInactiveDescriptions = _b === void 0 ? false : _b, _c = _a.isDismissable, isDismissable = _c === void 0 ? true : _c, props = __rest(_a, ["children", "className", "currentPage", "onBack", "onNext", "onChangePage", "steps", "goBackTranslation", "onClose", "hideInactiveDescriptions", "isDismissable"]);
|
|
3834
3877
|
var handleOverlayClick = function (e) {
|
|
3878
|
+
if (!isDismissable) {
|
|
3879
|
+
return;
|
|
3880
|
+
}
|
|
3835
3881
|
if (e.target === e.currentTarget) {
|
|
3836
3882
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
3837
3883
|
}
|
|
@@ -3850,8 +3896,8 @@ var MultistepNavigationButtons = function (_a) {
|
|
|
3850
3896
|
};
|
|
3851
3897
|
|
|
3852
3898
|
var MultiStepWizard = function (_a) {
|
|
3853
|
-
var isOpen = _a.isOpen, steps = _a.steps, translations = _a.translations, onClose = _a.onClose, onComplete = _a.onComplete, completeButtonText = _a.completeButtonText, hideInactiveDescriptions = _a.hideInactiveDescriptions;
|
|
3854
|
-
var
|
|
3899
|
+
var isOpen = _a.isOpen, steps = _a.steps, translations = _a.translations, onClose = _a.onClose, onComplete = _a.onComplete, completeButtonText = _a.completeButtonText, hideInactiveDescriptions = _a.hideInactiveDescriptions, _b = _a.isDismissable, isDismissable = _b === void 0 ? true : _b;
|
|
3900
|
+
var _c = React.useState(0), page = _c[0], setPage = _c[1];
|
|
3855
3901
|
React.useEffect(function () {
|
|
3856
3902
|
if (isOpen) {
|
|
3857
3903
|
setPage(0);
|
|
@@ -3914,7 +3960,7 @@ var MultiStepWizard = function (_a) {
|
|
|
3914
3960
|
if (!isOpen) {
|
|
3915
3961
|
return null;
|
|
3916
3962
|
}
|
|
3917
|
-
return (jsxs(MultiStepSidebar, { currentPage: page, goBackTranslation: t.goBack, steps: steps, onBack: onBack, onChangePage: onChangePage, onClose: onClose, onNext: onNext, hideInactiveDescriptions: hideInactiveDescriptions, children: [jsxs("div", { children: [jsx(Button, { className: "w-fit text-default-600 mb-6", color: "default", variant: "light", onPress: onBack, isDisabled: page === 0, startContent: jsx(IconComponent, { className: "text-default-500", icon: "material-symbols:arrow-back-rounded", size: "sm" }), children: t.goBack || "Back" }), jsx("div", { className: "relative flex h-fit w-full flex-col text-center lg:justify-center lg:pt-0", children: content })] }), jsx(MultistepNavigationButtons, { backButtonProps: {
|
|
3963
|
+
return (jsxs(MultiStepSidebar, { currentPage: page, goBackTranslation: t.goBack, steps: steps, onBack: onBack, onChangePage: onChangePage, onClose: onClose, onNext: onNext, hideInactiveDescriptions: hideInactiveDescriptions, isDismissable: isDismissable, children: [jsxs("div", { children: [jsx(Button, { className: "w-fit text-default-600 mb-6", color: "default", variant: "light", onPress: onBack, isDisabled: page === 0, startContent: jsx(IconComponent, { className: "text-default-500", icon: "material-symbols:arrow-back-rounded", size: "sm" }), children: t.goBack || "Back" }), jsx("div", { className: "relative flex h-fit w-full flex-col text-center lg:justify-center lg:pt-0", children: content })] }), jsx(MultistepNavigationButtons, { backButtonProps: {
|
|
3918
3964
|
isDisabled: page === 0,
|
|
3919
3965
|
onPress: onBack,
|
|
3920
3966
|
children: t.goBack,
|
|
@@ -3949,7 +3995,7 @@ var Phone = function (_a) {
|
|
|
3949
3995
|
var finalLabel = label || t.label;
|
|
3950
3996
|
useEffect(function () {
|
|
3951
3997
|
if (value) {
|
|
3952
|
-
var found = uniqueCountries.find(function (c) { return c.code === value.code; });
|
|
3998
|
+
var found = uniqueCountries.find(function (c) { return c.code === value.code && (value.country ? c.country === value.country : true); });
|
|
3953
3999
|
if (found) {
|
|
3954
4000
|
setSelectedCountry(found);
|
|
3955
4001
|
}
|
|
@@ -3974,21 +4020,39 @@ var Phone = function (_a) {
|
|
|
3974
4020
|
}
|
|
3975
4021
|
}, [isDropdownOpen]);
|
|
3976
4022
|
useEffect(function () {
|
|
4023
|
+
if (!isDropdownOpen)
|
|
4024
|
+
return;
|
|
3977
4025
|
var handleClickOutside = function (event) {
|
|
4026
|
+
// Ignore synthetic events (e.g. dispatched by scroll-close hooks)
|
|
4027
|
+
if (!event.isTrusted)
|
|
4028
|
+
return;
|
|
4029
|
+
var target = event.target;
|
|
3978
4030
|
if (dropdownRef.current &&
|
|
3979
|
-
!dropdownRef.current.contains(
|
|
4031
|
+
!dropdownRef.current.contains(target) &&
|
|
3980
4032
|
portalDropdownRef.current &&
|
|
3981
|
-
!portalDropdownRef.current.contains(
|
|
4033
|
+
!portalDropdownRef.current.contains(target)) {
|
|
3982
4034
|
setIsDropdownOpen(false);
|
|
3983
4035
|
}
|
|
3984
4036
|
};
|
|
3985
|
-
|
|
4037
|
+
// Defer listener registration to the next frame so the same
|
|
4038
|
+
// tap/click that opened the dropdown cannot immediately close it.
|
|
4039
|
+
var rafId = requestAnimationFrame(function () {
|
|
4040
|
+
document.addEventListener("pointerdown", handleClickOutside);
|
|
3986
4041
|
document.addEventListener("mousedown", handleClickOutside);
|
|
3987
|
-
}
|
|
4042
|
+
});
|
|
3988
4043
|
return function () {
|
|
4044
|
+
cancelAnimationFrame(rafId);
|
|
4045
|
+
document.removeEventListener("pointerdown", handleClickOutside);
|
|
3989
4046
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
3990
4047
|
};
|
|
3991
4048
|
}, [isDropdownOpen]);
|
|
4049
|
+
// El dropdown se portea a `body` con posición absoluta fija; cerrarlo cuando
|
|
4050
|
+
// un ancestro hace scroll para que no quede flotando fuera de lugar.
|
|
4051
|
+
useCloseOnAncestorScroll({
|
|
4052
|
+
isOpen: isDropdownOpen,
|
|
4053
|
+
onClose: function () { return setIsDropdownOpen(false); },
|
|
4054
|
+
contentRef: portalDropdownRef,
|
|
4055
|
+
});
|
|
3992
4056
|
var handleCountrySelect = function (country) {
|
|
3993
4057
|
setSelectedCountry(country);
|
|
3994
4058
|
setIsDropdownOpen(false);
|
|
@@ -4020,7 +4084,7 @@ var Phone = function (_a) {
|
|
|
4020
4084
|
country.code.toLowerCase().includes(searchTerm);
|
|
4021
4085
|
});
|
|
4022
4086
|
setFilteredCountries(filtered);
|
|
4023
|
-
} }) }), jsx("div", { className: "max-h-60 overflow-y-auto", children: filteredCountries.length > 0 ? (filteredCountries.map(function (country) { return (jsxs("button", { type: "button", className: "flex items-center w-full px-4 py-2.5 text-sm hover:bg-default-200 ".concat(country.
|
|
4087
|
+
} }) }), jsx("div", { className: "max-h-60 overflow-y-auto", children: filteredCountries.length > 0 ? (filteredCountries.map(function (country) { return (jsxs("button", { type: "button", className: "flex items-center w-full px-4 py-2.5 text-sm hover:bg-default-200 ".concat(country.country === selectedCountry.country
|
|
4024
4088
|
? "bg-primary-50"
|
|
4025
4089
|
: ""), onClick: function () { return handleCountrySelect(country); }, children: [jsx("span", { className: "mr-3", children: jsx(FlagIcon, { countryCode: country.country, size: "md" }) }), jsx("span", { className: "flex-1 text-left text-default-500", children: getCountryName(country) }), jsx("span", { className: "text-xs text-default-500", children: country.code })] }, "".concat(country.code, "-").concat(country.country))); })) : (jsx("div", { className: "px-4 py-2 text-sm text-default-500", children: t.noCountriesFound })) })] }), document.body)] }));
|
|
4026
4090
|
};
|
|
@@ -8958,4 +9022,4 @@ var NavigationLoadingProvider = function (_a) {
|
|
|
8958
9022
|
return (jsxs(NavigationLoadingContext.Provider, { value: value, children: [children, jsx(NavigationLoadingOverlay, { isVisible: isVisible })] }));
|
|
8959
9023
|
};
|
|
8960
9024
|
|
|
8961
|
-
export { ALL_THEMES, AURORA_THEME_FAMILIES, AURORA_THEME_REGISTRY, AccordionList, AddHolidayForm, AnalyticsCard, AreaLineChart, AuraAutocomplete, AuraTable, AuraToastProvider, BEWEOS_THEME_MODE_COOKIE_NAME, BreadcrumbsComponent, Button, Card, Chip, ColorPicker, ColorSelector, ContentCarousel, Currency, DEFAULT_PREDEFINED_COLORS, DatePicker, DateRangePicker, DateSelector, DrawerFilters, EmailPreview, EnumMenuNavListItem, GlobalToast, H1, H2, H3, H4, HeaderComponent, HolidayType, IconComponent, ImagePreview, Input, InputPassword, Kanban, KanbanCard, KanbanColumn, MenuComponent, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, MultiStepWizard, NavigationLoadingContext, NavigationLoadingOverlay, NavigationLoadingProvider, P, Pagination, Phone, PromotionalBanner, REGISTERED_THEME_COLORS, RangeFilter, RowSteps, DEFAULT_TRANSLATIONS$1 as SEGMENTATION_DEFAULT_TRANSLATIONS, ScheduleRow, SearchInput, SegmentationBuilder, Select, SimpleLineChart, SocialMediaBar, SocialMediaCarousel, SocialMediaPreview, StepIndicator, Switch as SwitchComponent, THEME_COLOR_HEX_MAP, TagsFilter, Textarea, ThemeContext, ThemePicker, ThemeProvider, TimeInput as TimeInputComponent, ToastContext, Tooltip, TwoColumnLayoutAgent, UploadFile, VerticalSteps, WhatsAppPreview, Wizard, WizardNavigation, WizardSidebar, applyCustomPrimaryColor, createCurrencyFormatter, uniqueCountries as defaultCountries, defaultCurrencyOptions, defaultTranslations$4 as defaultTranslations, forceLightOnlyThemeBeforeReact, formatAuroraThemeTooltip, generateThemeColorScale, getContrastForeground, getRegisteredThemeColorBases, getSelectedKeyFromPath, hexToThemeColor, hslToCssValue, isAuroraFullThemeId, isExactThemeColor, isGroupState, isHexColor, isSegmentationGroup, removeCustomPrimaryColor, sizeMap, themeColors, useAuraToast, useMediaQuery, useNavigationLoading, useThemeContext };
|
|
9025
|
+
export { ALL_THEMES, AURORA_THEME_FAMILIES, AURORA_THEME_REGISTRY, AccordionList, AddHolidayForm, AnalyticsCard, AreaLineChart, AuraAutocomplete, AuraTable, AuraToastProvider, BEWEOS_THEME_MODE_COOKIE_NAME, BreadcrumbsComponent, Button, Card, Chip, ColorPicker, ColorSelector, ContentCarousel, Currency, DEFAULT_PREDEFINED_COLORS, DatePicker, DateRangePicker, DateSelector, DrawerFilters, EmailPreview, EnumMenuNavListItem, GlobalToast, H1, H2, H3, H4, HeaderComponent, HolidayType, IconComponent, ImagePreview, Input, InputPassword, Kanban, KanbanCard, KanbanColumn, MenuComponent, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, MultiStepWizard, NavigationLoadingContext, NavigationLoadingOverlay, NavigationLoadingProvider, P, Pagination, Phone, PromotionalBanner, REGISTERED_THEME_COLORS, RangeFilter, RowSteps, DEFAULT_TRANSLATIONS$1 as SEGMENTATION_DEFAULT_TRANSLATIONS, ScheduleRow, SearchInput, SegmentationBuilder, Select, SimpleLineChart, SocialMediaBar, SocialMediaCarousel, SocialMediaPreview, StepIndicator, Switch as SwitchComponent, THEME_COLOR_HEX_MAP, TagsFilter, Textarea, ThemeContext, ThemePicker, ThemeProvider, TimeInput as TimeInputComponent, ToastContext, Tooltip, TwoColumnLayoutAgent, UploadFile, VerticalSteps, WhatsAppPreview, Wizard, WizardNavigation, WizardSidebar, applyCustomPrimaryColor, createCurrencyFormatter, uniqueCountries as defaultCountries, defaultCurrencyOptions, defaultTranslations$4 as defaultTranslations, forceLightOnlyThemeBeforeReact, formatAuroraThemeTooltip, generateThemeColorScale, getContrastForeground, getRegisteredThemeColorBases, getSelectedKeyFromPath, hexToThemeColor, hslToCssValue, isAuroraFullThemeId, isExactThemeColor, isGroupState, isHexColor, isSegmentationGroup, removeCustomPrimaryColor, sizeMap, themeColors, useAuraToast, useCloseOnAncestorScroll, useMediaQuery, useNavigationLoading, useThemeContext };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../../../src/components/currency/Currency.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../../../src/components/currency/Currency.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,kBAAkB,EAAiC,MAAM,kBAAkB,CAAC;AAkD1F,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA2SjD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DayMonthPicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/drawer-filters/_internal/DayMonthPicker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAgCxE,UAAU,mBAAmB;IAC5B,IAAI,EAAE,UAAU,GAAG,eAAe,CAAC;IACnC,QAAQ,EAAE,SAAS,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,UAAU,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;CAC5C;AAED,UAAU,mBAAmB;IAC5B,KAAK,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACnC,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC/C,YAAY,CAAC,EAAE,yBAAyB,CAAC;CACzC;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"DayMonthPicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/drawer-filters/_internal/DayMonthPicker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAgCxE,UAAU,mBAAmB;IAC5B,IAAI,EAAE,UAAU,GAAG,eAAe,CAAC;IACnC,QAAQ,EAAE,SAAS,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,UAAU,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;CAC5C;AAED,UAAU,mBAAmB;IAC5B,KAAK,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACnC,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC/C,YAAY,CAAC,EAAE,yBAAyB,CAAC;CACzC;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAoIxD,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { MultiStepWizardProps } from "./MultiStepWizard.types";
|
|
2
|
-
export declare const MultiStepWizard: ({ isOpen, steps, translations, onClose, onComplete, completeButtonText, hideInactiveDescriptions, }: MultiStepWizardProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
2
|
+
export declare const MultiStepWizard: ({ isOpen, steps, translations, onClose, onComplete, completeButtonText, hideInactiveDescriptions, isDismissable, }: MultiStepWizardProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
3
|
//# sourceMappingURL=MultiStepWizard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiStepWizard.d.ts","sourceRoot":"","sources":["../../../../src/components/multi-step-wizard/MultiStepWizard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAIpE,eAAO,MAAM,eAAe,GAAI,
|
|
1
|
+
{"version":3,"file":"MultiStepWizard.d.ts","sourceRoot":"","sources":["../../../../src/components/multi-step-wizard/MultiStepWizard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAIpE,eAAO,MAAM,eAAe,GAAI,oHAS7B,oBAAoB,mDA6ItB,CAAC"}
|
|
@@ -17,6 +17,12 @@ export interface MultiStepWizardProps {
|
|
|
17
17
|
completeButtonText?: string;
|
|
18
18
|
/** Oculta las descripciones de los pasos no activos en el sidebar */
|
|
19
19
|
hideInactiveDescriptions?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Permite cerrar el wizard al hacer clic en el fondo (backdrop).
|
|
22
|
+
* Por defecto `true`. Pásalo como `false` para evitar cierres
|
|
23
|
+
* accidentales que descarten los datos del formulario.
|
|
24
|
+
*/
|
|
25
|
+
isDismissable?: boolean;
|
|
20
26
|
}
|
|
21
27
|
export interface MultiStepWizardTranslations {
|
|
22
28
|
continue?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiStepWizard.types.d.ts","sourceRoot":"","sources":["../../../../src/components/multi-step-wizard/MultiStepWizard.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,IAAI;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,YAAY,CAAC,EAAE,2BAA2B,CAAC;IAC3C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,wCAAwC;IACxC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qEAAqE;IACrE,wBAAwB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MultiStepWizard.types.d.ts","sourceRoot":"","sources":["../../../../src/components/multi-step-wizard/MultiStepWizard.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,IAAI;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,YAAY,CAAC,EAAE,2BAA2B,CAAC;IAC3C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,wCAAwC;IACxC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qEAAqE;IACrE,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,2BAA2B;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiStepSidebar.d.ts","sourceRoot":"","sources":["../../../../../src/components/multi-step-wizard/_internal/MultiStepSidebar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"MultiStepSidebar.d.ts","sourceRoot":"","sources":["../../../../../src/components/multi-step-wizard/_internal/MultiStepSidebar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE,eAAO,MAAM,gBAAgB,8FA6F5B,CAAC"}
|
|
@@ -10,5 +10,7 @@ export interface MultiStepSidebarProps extends React.HTMLAttributes<HTMLDivEleme
|
|
|
10
10
|
steps: Step[];
|
|
11
11
|
goBackTranslation?: string;
|
|
12
12
|
hideInactiveDescriptions?: boolean;
|
|
13
|
+
/** Permite cerrar al hacer clic en el backdrop. Por defecto `true`. */
|
|
14
|
+
isDismissable?: boolean;
|
|
13
15
|
}
|
|
14
16
|
//# sourceMappingURL=MultiStepSidebar.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiStepSidebar.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/multi-step-wizard/_internal/MultiStepSidebar.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAErD,MAAM,WAAW,qBAChB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,wBAAwB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MultiStepSidebar.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/multi-step-wizard/_internal/MultiStepSidebar.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAErD,MAAM,WAAW,qBAChB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,uEAAuE;IACvE,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Phone.d.ts","sourceRoot":"","sources":["../../../../src/components/phone/Phone.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Phone.d.ts","sourceRoot":"","sources":["../../../../src/components/phone/Phone.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAOrD,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA2P3C,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
interface UseCloseOnAncestorScrollOptions {
|
|
3
|
+
/** Si el dropdown/popover está abierto. */
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
/** Callback para cerrar el dropdown/popover. */
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
/**
|
|
8
|
+
* Ref al contenido porteado (la lista). Si el scroll ocurre dentro de este
|
|
9
|
+
* elemento (p. ej. desplazar la lista de opciones) no se cierra.
|
|
10
|
+
*/
|
|
11
|
+
contentRef?: RefObject<HTMLElement | null>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Cierra un dropdown/popover porteado cuando un ancestro hace scroll.
|
|
15
|
+
*
|
|
16
|
+
* Los componentes que portean su contenido a `document.body` y lo posicionan
|
|
17
|
+
* de forma absoluta con `getBoundingClientRect()` quedan "flotando" en la
|
|
18
|
+
* posición original cuando un contenedor con scroll se desplaza, porque la
|
|
19
|
+
* posición no se recalcula. En lugar de reposicionar en cada frame, se cierra
|
|
20
|
+
* el dropdown ante el scroll de un ancestro (mismo comportamiento que los
|
|
21
|
+
* overlays de React Aria/HeroUI).
|
|
22
|
+
*/
|
|
23
|
+
export declare const useCloseOnAncestorScroll: ({ isOpen, onClose, contentRef, }: UseCloseOnAncestorScrollOptions) => void;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=useCloseOnAncestorScroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCloseOnAncestorScroll.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCloseOnAncestorScroll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,OAAO,CAAC;AAElD,UAAU,+BAA+B;IACxC,2CAA2C;IAC3C,MAAM,EAAE,OAAO,CAAC;IAChB,gDAAgD;IAChD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CAC3C;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,GAAI,kCAItC,+BAA+B,KAAG,IAwBpC,CAAC"}
|