@react-aria/utils
Advanced tools
Comparing version 3.0.0-nightly-fb28ab3b4-241024 to 3.0.0-nightly-fee532d6a-241217
@@ -33,2 +33,3 @@ var $8c61827343eed941$exports = require("./useId.main.js"); | ||
var $faa6ccd6fb62f877$exports = require("./useLoadMore.main.js"); | ||
var $a0850d0add29d276$exports = require("./constants.main.js"); | ||
var $1Yh1N$reactstatelyutils = require("@react-stately/utils"); | ||
@@ -94,2 +95,5 @@ | ||
$parcel$export(module.exports, "useLoadMore", () => $faa6ccd6fb62f877$exports.useLoadMore); | ||
$parcel$export(module.exports, "CLEAR_FOCUS_EVENT", () => $a0850d0add29d276$exports.CLEAR_FOCUS_EVENT); | ||
$parcel$export(module.exports, "FOCUS_EVENT", () => $a0850d0add29d276$exports.FOCUS_EVENT); | ||
$parcel$export(module.exports, "UPDATE_ACTIVEDESCENDANT", () => $a0850d0add29d276$exports.UPDATE_ACTIVEDESCENDANT); | ||
/* | ||
@@ -140,2 +144,3 @@ * Copyright 2020 Adobe. All rights reserved. | ||
//# sourceMappingURL=main.js.map |
@@ -33,2 +33,3 @@ import {mergeIds as $bdb11010cef70236$export$cd8c9cb68f842629, useId as $bdb11010cef70236$export$f680877a34711e37, useSlotId as $bdb11010cef70236$export$b4cc09c592e8fdb8} from "./useId.module.js"; | ||
import {useLoadMore as $26f7f3da73fcd9d6$export$7717c92ee915373e} from "./useLoadMore.module.js"; | ||
import {CLEAR_FOCUS_EVENT as $5671b20cf9b562b2$export$447a38995de2c711, FOCUS_EVENT as $5671b20cf9b562b2$export$831c820ad60f9d12, UPDATE_ACTIVEDESCENDANT as $5671b20cf9b562b2$export$9db568f6321ad9dc} from "./constants.module.js"; | ||
import {clamp as $4507461a1b870123$re_export$clamp, snapValueToStep as $4507461a1b870123$re_export$snapValueToStep} from "@react-stately/utils"; | ||
@@ -81,3 +82,4 @@ | ||
export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $3ef42575df84b30b$export$9d1611c77c2fe928 as mergeProps, $5dc95899b306f630$export$c9058316764c140e as mergeRefs, $65484d02dcb7eb3e$export$457c3d6518dd4c6f as filterDOMProps, $7215afc6de606d6b$export$de79e2c695e052f3 as focusWithoutScrolling, $ab71dadb03a6fb2e$export$622cea445a1c5b7d as getOffset, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$51437d503373d223 as getSyntheticLinkProps, $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6 as useSyntheticLinkProps, $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps, $bbed8b41f857bcc0$export$24490316f764c430 as runAfterTransition, $9cc09df9fd7676be$export$7bbed75feba39706 as useDrag1D, $03deb23ff14920c4$export$4eaf04e54aa8eed6 as useGlobalListeners, $313b98861ee5dd6c$export$d6875122194c7b44 as useLabels, $df56164dff5785e2$export$4338b53315abf666 as useObjectRef, $4f58c5f72bcf79f7$export$496315a1608d9602 as useUpdateEffect, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as useLayoutEffect, $9daab02d461809db$export$683480f191c0e3ea as useResizeObserver, $e7801be82b4b2a53$export$4debdb1a3f0fa79e as useSyncRef, $62d8ded9296f3872$export$cfa2225e87938781 as getScrollParent, $a40c673dc9f6d9c7$export$94ed1c92c7beeb22 as getScrollParents, $cc38e7bd3fc7b213$export$2bb74740c4e19def as isScrollable, $5df64b3807dc15ee$export$d699905dd57c73ca as useViewportSize, $ef06256079686ba0$export$f8aeda7b10753fa1 as useDescription, $c87311424ea30a05$export$9ac100e40613ea10 as isMac, $c87311424ea30a05$export$186c6964ca17d99 as isIPhone, $c87311424ea30a05$export$7bef049ce92e4224 as isIPad, $c87311424ea30a05$export$fedb369cb70207f1 as isIOS, $c87311424ea30a05$export$e1865c3bedcd822b as isAppleDevice, $c87311424ea30a05$export$78551043582a6a98 as isWebKit, $c87311424ea30a05$export$6446a186d09e379e as isChrome, $c87311424ea30a05$export$a11b0059900ceec8 as isAndroid, $c87311424ea30a05$export$b7d78993b74f766d as isFirefox, $e9faafb641e167db$export$90fc3a17d93f704c as useEvent, $1dbecbe27a04f9af$export$14d238f342723f25 as useValueEffect, $2f04cbc44ee30ce0$export$53a0910f038337bd as scrollIntoView, $2f04cbc44ee30ce0$export$c826860796309d1b as scrollIntoViewport, $4507461a1b870123$re_export$clamp as clamp, $4507461a1b870123$re_export$snapValueToStep as snapValueToStep, $6a7db85432448f7f$export$60278871457622de as isVirtualClick, $6a7db85432448f7f$export$29bf1b5f2c56cf63 as isVirtualPointerEvent, $8ae05eaa5c114e9c$export$7f54fc3180508a52 as useEffectEvent, $5a387cc49350e6db$export$722debc0e56fea39 as useDeepMemo, $99facab73266f662$export$5add1d006293d136 as useFormReset, $26f7f3da73fcd9d6$export$7717c92ee915373e as useLoadMore}; | ||
export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $3ef42575df84b30b$export$9d1611c77c2fe928 as mergeProps, $5dc95899b306f630$export$c9058316764c140e as mergeRefs, $65484d02dcb7eb3e$export$457c3d6518dd4c6f as filterDOMProps, $7215afc6de606d6b$export$de79e2c695e052f3 as focusWithoutScrolling, $ab71dadb03a6fb2e$export$622cea445a1c5b7d as getOffset, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$51437d503373d223 as getSyntheticLinkProps, $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6 as useSyntheticLinkProps, $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps, $bbed8b41f857bcc0$export$24490316f764c430 as runAfterTransition, $9cc09df9fd7676be$export$7bbed75feba39706 as useDrag1D, $03deb23ff14920c4$export$4eaf04e54aa8eed6 as useGlobalListeners, $313b98861ee5dd6c$export$d6875122194c7b44 as useLabels, $df56164dff5785e2$export$4338b53315abf666 as useObjectRef, $4f58c5f72bcf79f7$export$496315a1608d9602 as useUpdateEffect, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as useLayoutEffect, $9daab02d461809db$export$683480f191c0e3ea as useResizeObserver, $e7801be82b4b2a53$export$4debdb1a3f0fa79e as useSyncRef, $62d8ded9296f3872$export$cfa2225e87938781 as getScrollParent, $a40c673dc9f6d9c7$export$94ed1c92c7beeb22 as getScrollParents, $cc38e7bd3fc7b213$export$2bb74740c4e19def as isScrollable, $5df64b3807dc15ee$export$d699905dd57c73ca as useViewportSize, $ef06256079686ba0$export$f8aeda7b10753fa1 as useDescription, $c87311424ea30a05$export$9ac100e40613ea10 as isMac, $c87311424ea30a05$export$186c6964ca17d99 as isIPhone, $c87311424ea30a05$export$7bef049ce92e4224 as isIPad, $c87311424ea30a05$export$fedb369cb70207f1 as isIOS, $c87311424ea30a05$export$e1865c3bedcd822b as isAppleDevice, $c87311424ea30a05$export$78551043582a6a98 as isWebKit, $c87311424ea30a05$export$6446a186d09e379e as isChrome, $c87311424ea30a05$export$a11b0059900ceec8 as isAndroid, $c87311424ea30a05$export$b7d78993b74f766d as isFirefox, $e9faafb641e167db$export$90fc3a17d93f704c as useEvent, $1dbecbe27a04f9af$export$14d238f342723f25 as useValueEffect, $2f04cbc44ee30ce0$export$53a0910f038337bd as scrollIntoView, $2f04cbc44ee30ce0$export$c826860796309d1b as scrollIntoViewport, $4507461a1b870123$re_export$clamp as clamp, $4507461a1b870123$re_export$snapValueToStep as snapValueToStep, $6a7db85432448f7f$export$60278871457622de as isVirtualClick, $6a7db85432448f7f$export$29bf1b5f2c56cf63 as isVirtualPointerEvent, $8ae05eaa5c114e9c$export$7f54fc3180508a52 as useEffectEvent, $5a387cc49350e6db$export$722debc0e56fea39 as useDeepMemo, $99facab73266f662$export$5add1d006293d136 as useFormReset, $26f7f3da73fcd9d6$export$7717c92ee915373e as useLoadMore, $5671b20cf9b562b2$export$447a38995de2c711 as CLEAR_FOCUS_EVENT, $5671b20cf9b562b2$export$831c820ad60f9d12 as FOCUS_EVENT, $5671b20cf9b562b2$export$9db568f6321ad9dc as UPDATE_ACTIVEDESCENDANT}; | ||
//# sourceMappingURL=module.js.map |
@@ -28,13 +28,19 @@ var $49f0d9486c2408aa$exports = require("./getScrollParents.main.js"); | ||
let y = scrollView.scrollTop; | ||
// Account for top/left border offsetting the scroll top/Left | ||
let { borderTopWidth: borderTopWidth, borderLeftWidth: borderLeftWidth } = getComputedStyle(scrollView); | ||
let borderAdjustedX = scrollView.scrollLeft + parseInt(borderLeftWidth, 10); | ||
let borderAdjustedY = scrollView.scrollTop + parseInt(borderTopWidth, 10); | ||
// Account for top/left border offsetting the scroll top/Left + scroll padding | ||
let { borderTopWidth: borderTopWidth, borderLeftWidth: borderLeftWidth, scrollPaddingTop: scrollPaddingTop, scrollPaddingRight: scrollPaddingRight, scrollPaddingBottom: scrollPaddingBottom, scrollPaddingLeft: scrollPaddingLeft } = getComputedStyle(scrollView); | ||
let borderAdjustedX = x + parseInt(borderLeftWidth, 10); | ||
let borderAdjustedY = y + parseInt(borderTopWidth, 10); | ||
// Ignore end/bottom border via clientHeight/Width instead of offsetHeight/Width | ||
let maxX = borderAdjustedX + scrollView.clientWidth; | ||
let maxY = borderAdjustedY + scrollView.clientHeight; | ||
if (offsetX <= x) x = offsetX - parseInt(borderLeftWidth, 10); | ||
else if (offsetX + width > maxX) x += offsetX + width - maxX; | ||
if (offsetY <= borderAdjustedY) y = offsetY - parseInt(borderTopWidth, 10); | ||
else if (offsetY + height > maxY) y += offsetY + height - maxY; | ||
// Get scroll padding values as pixels - defaults to 0 if no scroll padding | ||
// is used. | ||
let scrollPaddingTopNumber = parseInt(scrollPaddingTop, 10) || 0; | ||
let scrollPaddingBottomNumber = parseInt(scrollPaddingBottom, 10) || 0; | ||
let scrollPaddingRightNumber = parseInt(scrollPaddingRight, 10) || 0; | ||
let scrollPaddingLeftNumber = parseInt(scrollPaddingLeft, 10) || 0; | ||
if (offsetX <= x + scrollPaddingLeftNumber) x = offsetX - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber; | ||
else if (offsetX + width > maxX - scrollPaddingRightNumber) x += offsetX + width - maxX + scrollPaddingRightNumber; | ||
if (offsetY <= borderAdjustedY + scrollPaddingTopNumber) y = offsetY - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber; | ||
else if (offsetY + height > maxY - scrollPaddingBottomNumber) y += offsetY + height - maxY + scrollPaddingBottomNumber; | ||
scrollView.scrollLeft = x; | ||
@@ -41,0 +47,0 @@ scrollView.scrollTop = y; |
@@ -21,13 +21,19 @@ import {getScrollParents as $a40c673dc9f6d9c7$export$94ed1c92c7beeb22} from "./getScrollParents.module.js"; | ||
let y = scrollView.scrollTop; | ||
// Account for top/left border offsetting the scroll top/Left | ||
let { borderTopWidth: borderTopWidth, borderLeftWidth: borderLeftWidth } = getComputedStyle(scrollView); | ||
let borderAdjustedX = scrollView.scrollLeft + parseInt(borderLeftWidth, 10); | ||
let borderAdjustedY = scrollView.scrollTop + parseInt(borderTopWidth, 10); | ||
// Account for top/left border offsetting the scroll top/Left + scroll padding | ||
let { borderTopWidth: borderTopWidth, borderLeftWidth: borderLeftWidth, scrollPaddingTop: scrollPaddingTop, scrollPaddingRight: scrollPaddingRight, scrollPaddingBottom: scrollPaddingBottom, scrollPaddingLeft: scrollPaddingLeft } = getComputedStyle(scrollView); | ||
let borderAdjustedX = x + parseInt(borderLeftWidth, 10); | ||
let borderAdjustedY = y + parseInt(borderTopWidth, 10); | ||
// Ignore end/bottom border via clientHeight/Width instead of offsetHeight/Width | ||
let maxX = borderAdjustedX + scrollView.clientWidth; | ||
let maxY = borderAdjustedY + scrollView.clientHeight; | ||
if (offsetX <= x) x = offsetX - parseInt(borderLeftWidth, 10); | ||
else if (offsetX + width > maxX) x += offsetX + width - maxX; | ||
if (offsetY <= borderAdjustedY) y = offsetY - parseInt(borderTopWidth, 10); | ||
else if (offsetY + height > maxY) y += offsetY + height - maxY; | ||
// Get scroll padding values as pixels - defaults to 0 if no scroll padding | ||
// is used. | ||
let scrollPaddingTopNumber = parseInt(scrollPaddingTop, 10) || 0; | ||
let scrollPaddingBottomNumber = parseInt(scrollPaddingBottom, 10) || 0; | ||
let scrollPaddingRightNumber = parseInt(scrollPaddingRight, 10) || 0; | ||
let scrollPaddingLeftNumber = parseInt(scrollPaddingLeft, 10) || 0; | ||
if (offsetX <= x + scrollPaddingLeftNumber) x = offsetX - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber; | ||
else if (offsetX + width > maxX - scrollPaddingRightNumber) x += offsetX + width - maxX + scrollPaddingRightNumber; | ||
if (offsetY <= borderAdjustedY + scrollPaddingTopNumber) y = offsetY - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber; | ||
else if (offsetY + height > maxY - scrollPaddingBottomNumber) y += offsetY + height - maxY + scrollPaddingBottomNumber; | ||
scrollView.scrollLeft = x; | ||
@@ -34,0 +40,0 @@ scrollView.scrollTop = y; |
@@ -103,25 +103,25 @@ import React, { ForwardedRef, MutableRefObject, ReactNode, HTMLAttributes, EffectCallback, Dispatch, RefObject as _RefObject1 } from "react"; | ||
export function useSyntheticLinkProps(props: LinkDOMProps): { | ||
'data-href': string; | ||
'data-target': React.HTMLAttributeAnchorTarget; | ||
'data-rel': string; | ||
'data-download': string | boolean; | ||
'data-ping': string; | ||
'data-referrer-policy': React.HTMLAttributeReferrerPolicy; | ||
'data-href': string | undefined; | ||
'data-target': React.HTMLAttributeAnchorTarget | undefined; | ||
'data-rel': string | undefined; | ||
'data-download': string | boolean | undefined; | ||
'data-ping': string | undefined; | ||
'data-referrer-policy': React.HTMLAttributeReferrerPolicy | undefined; | ||
}; | ||
/** @deprecated - For backward compatibility. */ | ||
export function getSyntheticLinkProps(props: LinkDOMProps): { | ||
'data-href': string; | ||
'data-target': React.HTMLAttributeAnchorTarget; | ||
'data-rel': string; | ||
'data-download': string | boolean; | ||
'data-ping': string; | ||
'data-referrer-policy': React.HTMLAttributeReferrerPolicy; | ||
'data-href': string | undefined; | ||
'data-target': React.HTMLAttributeAnchorTarget | undefined; | ||
'data-rel': string | undefined; | ||
'data-download': string | boolean | undefined; | ||
'data-ping': string | undefined; | ||
'data-referrer-policy': React.HTMLAttributeReferrerPolicy | undefined; | ||
}; | ||
export function useLinkProps(props: LinkDOMProps): { | ||
href: string; | ||
target: React.HTMLAttributeAnchorTarget; | ||
rel: string; | ||
download: string | boolean; | ||
ping: string; | ||
referrerPolicy: React.HTMLAttributeReferrerPolicy; | ||
export function useLinkProps(props?: LinkDOMProps): { | ||
href: string | undefined; | ||
target: React.HTMLAttributeAnchorTarget | undefined; | ||
rel: string | undefined; | ||
download: string | boolean | undefined; | ||
ping: string | undefined; | ||
referrerPolicy: React.HTMLAttributeReferrerPolicy | undefined; | ||
}; | ||
@@ -193,3 +193,3 @@ export function runAfterTransition(fn: () => void): void; | ||
/** The optional containing element of the target to be centered in the viewport. */ | ||
containingElement?: Element; | ||
containingElement?: Element | null; | ||
} | ||
@@ -229,4 +229,7 @@ /** | ||
export function useLoadMore(props: LoadMoreProps, ref: _RefObject1<HTMLElement | null>): void; | ||
export const CLEAR_FOCUS_EVENT = "react-aria-clear-focus"; | ||
export const FOCUS_EVENT = "react-aria-focus"; | ||
export const UPDATE_ACTIVEDESCENDANT = "react-aria-update-activedescendant"; | ||
export { clamp, snapValueToStep } from '@react-stately/utils'; | ||
//# sourceMappingURL=types.d.ts.map |
@@ -34,3 +34,3 @@ var $eHdSW$react = require("react"); | ||
}); | ||
eventTarget.addEventListener(type, listener, options); | ||
eventTarget.addEventListener(type, fn, options); | ||
}, []); | ||
@@ -37,0 +37,0 @@ let removeGlobalListener = (0, $eHdSW$react.useCallback)((eventTarget, type, listener, options)=>{ |
@@ -28,3 +28,3 @@ import {useRef as $lPAwt$useRef, useCallback as $lPAwt$useCallback, useEffect as $lPAwt$useEffect} from "react"; | ||
}); | ||
eventTarget.addEventListener(type, listener, options); | ||
eventTarget.addEventListener(type, fn, options); | ||
}, []); | ||
@@ -31,0 +31,0 @@ let removeGlobalListener = (0, $lPAwt$useCallback)((eventTarget, type, listener, options)=>{ |
@@ -22,3 +22,2 @@ var $4gIVO$react = require("react"); | ||
// @ts-ignore | ||
let $8b24bab62f5c65ad$var$visualViewport = typeof document !== 'undefined' && window.visualViewport; | ||
@@ -25,0 +24,0 @@ function $8b24bab62f5c65ad$export$d699905dd57c73ca() { |
@@ -16,3 +16,2 @@ import {useState as $fuDHA$useState, useEffect as $fuDHA$useEffect} from "react"; | ||
// @ts-ignore | ||
let $5df64b3807dc15ee$var$visualViewport = typeof document !== 'undefined' && window.visualViewport; | ||
@@ -19,0 +18,0 @@ function $5df64b3807dc15ee$export$d699905dd57c73ca() { |
{ | ||
"name": "@react-aria/utils", | ||
"version": "3.0.0-nightly-fb28ab3b4-241024", | ||
"version": "3.0.0-nightly-fee532d6a-241217", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,5 +25,5 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-aria/ssr": "^3.0.0-nightly-fb28ab3b4-241024", | ||
"@react-stately/utils": "^3.0.0-nightly-fb28ab3b4-241024", | ||
"@react-types/shared": "^3.0.0-nightly-fb28ab3b4-241024", | ||
"@react-aria/ssr": "3.0.0-nightly-fee532d6a-241217", | ||
"@react-stately/utils": "3.0.0-nightly-fee532d6a-241217", | ||
"@react-types/shared": "3.0.0-nightly-fee532d6a-241217", | ||
"@swc/helpers": "^0.5.0", | ||
@@ -33,8 +33,7 @@ "clsx": "^2.0.0" | ||
"peerDependencies": { | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0" | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"stableVersion": "3.25.3" | ||
} | ||
} |
@@ -45,1 +45,2 @@ /* | ||
export {useLoadMore} from './useLoadMore'; | ||
export {CLEAR_FOCUS_EVENT, FOCUS_EVENT, UPDATE_ACTIVEDESCENDANT} from './constants'; |
@@ -17,3 +17,3 @@ /* | ||
/** The optional containing element of the target to be centered in the viewport. */ | ||
containingElement?: Element | ||
containingElement?: Element | null | ||
} | ||
@@ -34,6 +34,14 @@ | ||
// Account for top/left border offsetting the scroll top/Left | ||
let {borderTopWidth, borderLeftWidth} = getComputedStyle(scrollView); | ||
let borderAdjustedX = scrollView.scrollLeft + parseInt(borderLeftWidth, 10); | ||
let borderAdjustedY = scrollView.scrollTop + parseInt(borderTopWidth, 10); | ||
// Account for top/left border offsetting the scroll top/Left + scroll padding | ||
let { | ||
borderTopWidth, | ||
borderLeftWidth, | ||
scrollPaddingTop, | ||
scrollPaddingRight, | ||
scrollPaddingBottom, | ||
scrollPaddingLeft | ||
} = getComputedStyle(scrollView); | ||
let borderAdjustedX = x + parseInt(borderLeftWidth, 10); | ||
let borderAdjustedY = y + parseInt(borderTopWidth, 10); | ||
// Ignore end/bottom border via clientHeight/Width instead of offsetHeight/Width | ||
@@ -43,12 +51,20 @@ let maxX = borderAdjustedX + scrollView.clientWidth; | ||
if (offsetX <= x) { | ||
x = offsetX - parseInt(borderLeftWidth, 10); | ||
} else if (offsetX + width > maxX) { | ||
x += offsetX + width - maxX; | ||
// Get scroll padding values as pixels - defaults to 0 if no scroll padding | ||
// is used. | ||
let scrollPaddingTopNumber = parseInt(scrollPaddingTop, 10) || 0; | ||
let scrollPaddingBottomNumber = parseInt(scrollPaddingBottom, 10) || 0; | ||
let scrollPaddingRightNumber = parseInt(scrollPaddingRight, 10) || 0; | ||
let scrollPaddingLeftNumber = parseInt(scrollPaddingLeft, 10) || 0; | ||
if (offsetX <= x + scrollPaddingLeftNumber) { | ||
x = offsetX - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber; | ||
} else if (offsetX + width > maxX - scrollPaddingRightNumber) { | ||
x += offsetX + width - maxX + scrollPaddingRightNumber; | ||
} | ||
if (offsetY <= borderAdjustedY) { | ||
y = offsetY - parseInt(borderTopWidth, 10); | ||
} else if (offsetY + height > maxY) { | ||
y += offsetY + height - maxY; | ||
if (offsetY <= borderAdjustedY + scrollPaddingTopNumber) { | ||
y = offsetY - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber; | ||
} else if (offsetY + height > maxY - scrollPaddingBottomNumber) { | ||
y += offsetY + height - maxY + scrollPaddingBottomNumber; | ||
} | ||
scrollView.scrollLeft = x; | ||
@@ -55,0 +71,0 @@ scrollView.scrollTop = y; |
@@ -32,3 +32,3 @@ /* | ||
globalListeners.current.set(listener, {type, eventTarget, fn, options}); | ||
eventTarget.addEventListener(type, listener, options); | ||
eventTarget.addEventListener(type, fn, options); | ||
}, []); | ||
@@ -35,0 +35,0 @@ let removeGlobalListener = useCallback((eventTarget, type, listener, options) => { |
@@ -21,3 +21,2 @@ /* | ||
// @ts-ignore | ||
let visualViewport = typeof document !== 'undefined' && window.visualViewport; | ||
@@ -24,0 +23,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
572964
208
6704
54
+ Added@react-aria/ssr@3.0.0-nightly-fee532d6a-241217(transitive)
+ Added@react-stately/utils@3.0.0-nightly-fee532d6a-241217(transitive)
+ Added@react-types/shared@3.0.0-nightly-fee532d6a-241217(transitive)
- Removed@react-aria/ssr@3.9.7(transitive)
- Removed@react-stately/utils@3.10.5(transitive)
- Removed@react-types/shared@3.26.0(transitive)