opus-toolkit-components 1.7.2 → 1.7.4
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.
|
@@ -1750,7 +1750,8 @@ const ForwardRef = /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(C
|
|
|
1750
1750
|
|
|
1751
1751
|
__webpack_require__.r(__webpack_exports__);
|
|
1752
1752
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1753
|
-
/* harmony export */ isCtrlKeyPressed: () => (/* binding */ $21f1aa98acb08317$export$16792effe837dba3)
|
|
1753
|
+
/* harmony export */ isCtrlKeyPressed: () => (/* binding */ $21f1aa98acb08317$export$16792effe837dba3),
|
|
1754
|
+
/* harmony export */ willOpenKeyboard: () => (/* binding */ $21f1aa98acb08317$export$c57958e35f31ed73)
|
|
1754
1755
|
/* harmony export */ });
|
|
1755
1756
|
/* harmony import */ var _platform_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69202);
|
|
1756
1757
|
|
|
@@ -1770,6 +1771,21 @@ function $21f1aa98acb08317$export$16792effe837dba3(e) {
|
|
|
1770
1771
|
if ((0, _platform_mjs__WEBPACK_IMPORTED_MODULE_0__.isMac)()) return e.metaKey;
|
|
1771
1772
|
return e.ctrlKey;
|
|
1772
1773
|
}
|
|
1774
|
+
// HTML input types that do not cause the software keyboard to appear.
|
|
1775
|
+
const $21f1aa98acb08317$var$nonTextInputTypes = new Set([
|
|
1776
|
+
'checkbox',
|
|
1777
|
+
'radio',
|
|
1778
|
+
'range',
|
|
1779
|
+
'color',
|
|
1780
|
+
'file',
|
|
1781
|
+
'image',
|
|
1782
|
+
'button',
|
|
1783
|
+
'submit',
|
|
1784
|
+
'reset'
|
|
1785
|
+
]);
|
|
1786
|
+
function $21f1aa98acb08317$export$c57958e35f31ed73(target) {
|
|
1787
|
+
return target instanceof HTMLInputElement && !$21f1aa98acb08317$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
|
|
1788
|
+
}
|
|
1773
1789
|
|
|
1774
1790
|
|
|
1775
1791
|
|
|
@@ -7986,7 +8002,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7986
8002
|
/* harmony export */ useUpdateEffect: () => (/* reexport safe */ _useUpdateEffect_mjs__WEBPACK_IMPORTED_MODULE_16__.useUpdateEffect),
|
|
7987
8003
|
/* harmony export */ useUpdateLayoutEffect: () => (/* reexport safe */ _useUpdateLayoutEffect_mjs__WEBPACK_IMPORTED_MODULE_17__.useUpdateLayoutEffect),
|
|
7988
8004
|
/* harmony export */ useValueEffect: () => (/* reexport safe */ _useValueEffect_mjs__WEBPACK_IMPORTED_MODULE_28__.useValueEffect),
|
|
7989
|
-
/* harmony export */ useViewportSize: () => (/* reexport safe */ _useViewportSize_mjs__WEBPACK_IMPORTED_MODULE_24__.useViewportSize)
|
|
8005
|
+
/* harmony export */ useViewportSize: () => (/* reexport safe */ _useViewportSize_mjs__WEBPACK_IMPORTED_MODULE_24__.useViewportSize),
|
|
8006
|
+
/* harmony export */ willOpenKeyboard: () => (/* reexport safe */ _keyboard_mjs__WEBPACK_IMPORTED_MODULE_38__.willOpenKeyboard)
|
|
7990
8007
|
/* harmony export */ });
|
|
7991
8008
|
/* harmony import */ var _useId_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(43051);
|
|
7992
8009
|
/* harmony import */ var _chain_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(72166);
|
|
@@ -10394,8 +10411,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10394
10411
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10395
10412
|
/* harmony export */ useViewportSize: () => (/* binding */ $5df64b3807dc15ee$export$d699905dd57c73ca)
|
|
10396
10413
|
/* harmony export */ });
|
|
10397
|
-
/* harmony import */ var
|
|
10398
|
-
/* harmony import */ var
|
|
10414
|
+
/* harmony import */ var _keyboard_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3704);
|
|
10415
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9206);
|
|
10416
|
+
/* harmony import */ var _react_aria_ssr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3059);
|
|
10417
|
+
|
|
10399
10418
|
|
|
10400
10419
|
|
|
10401
10420
|
|
|
@@ -10411,25 +10430,48 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10411
10430
|
* governing permissions and limitations under the License.
|
|
10412
10431
|
*/
|
|
10413
10432
|
|
|
10433
|
+
|
|
10414
10434
|
let $5df64b3807dc15ee$var$visualViewport = typeof document !== 'undefined' && window.visualViewport;
|
|
10415
10435
|
function $5df64b3807dc15ee$export$d699905dd57c73ca() {
|
|
10416
|
-
let isSSR = (0,
|
|
10417
|
-
let [size, setSize] = (0,
|
|
10436
|
+
let isSSR = (0, _react_aria_ssr__WEBPACK_IMPORTED_MODULE_2__.useIsSSR)();
|
|
10437
|
+
let [size, setSize] = (0, react__WEBPACK_IMPORTED_MODULE_1__.useState)(()=>isSSR ? {
|
|
10418
10438
|
width: 0,
|
|
10419
10439
|
height: 0
|
|
10420
10440
|
} : $5df64b3807dc15ee$var$getViewportSize());
|
|
10421
|
-
(0,
|
|
10441
|
+
(0, react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
|
|
10422
10442
|
// Use visualViewport api to track available height even on iOS virtual keyboard opening
|
|
10423
10443
|
let onResize = ()=>{
|
|
10444
|
+
// Ignore updates when zoomed.
|
|
10445
|
+
if ($5df64b3807dc15ee$var$visualViewport && $5df64b3807dc15ee$var$visualViewport.scale > 1) return;
|
|
10424
10446
|
setSize((size)=>{
|
|
10425
10447
|
let newSize = $5df64b3807dc15ee$var$getViewportSize();
|
|
10426
10448
|
if (newSize.width === size.width && newSize.height === size.height) return size;
|
|
10427
10449
|
return newSize;
|
|
10428
10450
|
});
|
|
10429
10451
|
};
|
|
10452
|
+
// When closing the keyboard, iOS does not fire the visual viewport resize event until the animation is complete.
|
|
10453
|
+
// We can anticipate this and resize early by handling the blur event and using the layout size.
|
|
10454
|
+
let frame;
|
|
10455
|
+
let onBlur = (e)=>{
|
|
10456
|
+
if ($5df64b3807dc15ee$var$visualViewport && $5df64b3807dc15ee$var$visualViewport.scale > 1) return;
|
|
10457
|
+
if ((0, _keyboard_mjs__WEBPACK_IMPORTED_MODULE_0__.willOpenKeyboard)(e.target)) // Wait one frame to see if a new element gets focused.
|
|
10458
|
+
frame = requestAnimationFrame(()=>{
|
|
10459
|
+
if (!document.activeElement || !(0, _keyboard_mjs__WEBPACK_IMPORTED_MODULE_0__.willOpenKeyboard)(document.activeElement)) setSize((size)=>{
|
|
10460
|
+
let newSize = {
|
|
10461
|
+
width: window.innerWidth,
|
|
10462
|
+
height: window.innerHeight
|
|
10463
|
+
};
|
|
10464
|
+
if (newSize.width === size.width && newSize.height === size.height) return size;
|
|
10465
|
+
return newSize;
|
|
10466
|
+
});
|
|
10467
|
+
});
|
|
10468
|
+
};
|
|
10469
|
+
window.addEventListener('blur', onBlur, true);
|
|
10430
10470
|
if (!$5df64b3807dc15ee$var$visualViewport) window.addEventListener('resize', onResize);
|
|
10431
10471
|
else $5df64b3807dc15ee$var$visualViewport.addEventListener('resize', onResize);
|
|
10432
10472
|
return ()=>{
|
|
10473
|
+
cancelAnimationFrame(frame);
|
|
10474
|
+
window.removeEventListener('blur', onBlur, true);
|
|
10433
10475
|
if (!$5df64b3807dc15ee$var$visualViewport) window.removeEventListener('resize', onResize);
|
|
10434
10476
|
else $5df64b3807dc15ee$var$visualViewport.removeEventListener('resize', onResize);
|
|
10435
10477
|
};
|
|
@@ -10438,8 +10480,9 @@ function $5df64b3807dc15ee$export$d699905dd57c73ca() {
|
|
|
10438
10480
|
}
|
|
10439
10481
|
function $5df64b3807dc15ee$var$getViewportSize() {
|
|
10440
10482
|
return {
|
|
10441
|
-
|
|
10442
|
-
|
|
10483
|
+
// Multiply by the visualViewport scale to get the "natural" size, unaffected by pinch zooming.
|
|
10484
|
+
width: $5df64b3807dc15ee$var$visualViewport ? $5df64b3807dc15ee$var$visualViewport.width * $5df64b3807dc15ee$var$visualViewport.scale : window.innerWidth,
|
|
10485
|
+
height: $5df64b3807dc15ee$var$visualViewport ? $5df64b3807dc15ee$var$visualViewport.height * $5df64b3807dc15ee$var$visualViewport.scale : window.innerHeight
|
|
10443
10486
|
};
|
|
10444
10487
|
}
|
|
10445
10488
|
|
|
@@ -19117,9 +19160,11 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
19117
19160
|
if (shouldCancelOnPointerExit) cancel(e);
|
|
19118
19161
|
});
|
|
19119
19162
|
let triggerClick = (0, _react_aria_utils__WEBPACK_IMPORTED_MODULE_6__.useEffectEvent)((e)=>{
|
|
19163
|
+
if (isDisabled) return;
|
|
19120
19164
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
19121
19165
|
});
|
|
19122
19166
|
let triggerSyntheticClick = (0, _react_aria_utils__WEBPACK_IMPORTED_MODULE_6__.useEffectEvent)((e, target)=>{
|
|
19167
|
+
if (isDisabled) return;
|
|
19123
19168
|
// Some third-party libraries pass in onClick instead of onPress.
|
|
19124
19169
|
// Create a fake mouse event and trigger onClick as well.
|
|
19125
19170
|
// This matches the browser's native activation behavior for certain elements (e.g. button).
|
|
@@ -26258,7 +26303,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
26258
26303
|
/* harmony export */ tabbable: () => (/* binding */ tabbable)
|
|
26259
26304
|
/* harmony export */ });
|
|
26260
26305
|
/*!
|
|
26261
|
-
* tabbable 6.
|
|
26306
|
+
* tabbable 6.3.0
|
|
26262
26307
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
26263
26308
|
*/
|
|
26264
26309
|
// NOTE: separate `:not()` selectors has broader browser support than the newer
|
|
@@ -26285,7 +26330,7 @@ var getRootNode = !NoElement && Element.prototype.getRootNode ? function (elemen
|
|
|
26285
26330
|
* @returns {boolean} True if inert itself or by way of being in an inert ancestor.
|
|
26286
26331
|
* False if `node` is falsy.
|
|
26287
26332
|
*/
|
|
26288
|
-
var
|
|
26333
|
+
var _isInert = function isInert(node, lookUp) {
|
|
26289
26334
|
var _node$getAttribute;
|
|
26290
26335
|
if (lookUp === void 0) {
|
|
26291
26336
|
lookUp = true;
|
|
@@ -26301,7 +26346,7 @@ var isInert = function isInert(node, lookUp) {
|
|
|
26301
26346
|
// code works for any kind of node
|
|
26302
26347
|
// CAREFUL: JSDom does not appear to support certain selectors like `:not([inert] *)`
|
|
26303
26348
|
// so it likely would not support `:is([inert] *)` either...
|
|
26304
|
-
var result = inert || lookUp && node &&
|
|
26349
|
+
var result = inert || lookUp && node && _isInert(node.parentNode); // recursive
|
|
26305
26350
|
|
|
26306
26351
|
return result;
|
|
26307
26352
|
};
|
|
@@ -26329,7 +26374,7 @@ var isContentEditable = function isContentEditable(node) {
|
|
|
26329
26374
|
var getCandidates = function getCandidates(el, includeContainer, filter) {
|
|
26330
26375
|
// even if `includeContainer=false`, we still have to check it for inertness because
|
|
26331
26376
|
// if it's inert, all its children are inert
|
|
26332
|
-
if (
|
|
26377
|
+
if (_isInert(el)) {
|
|
26333
26378
|
return [];
|
|
26334
26379
|
}
|
|
26335
26380
|
var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
|
|
@@ -26374,12 +26419,12 @@ var getCandidates = function getCandidates(el, includeContainer, filter) {
|
|
|
26374
26419
|
* @param {IterativeOptions} options
|
|
26375
26420
|
* @returns {Array.<Element|CandidateScope>}
|
|
26376
26421
|
*/
|
|
26377
|
-
var
|
|
26422
|
+
var _getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {
|
|
26378
26423
|
var candidates = [];
|
|
26379
26424
|
var elementsToCheck = Array.from(elements);
|
|
26380
26425
|
while (elementsToCheck.length) {
|
|
26381
26426
|
var element = elementsToCheck.shift();
|
|
26382
|
-
if (
|
|
26427
|
+
if (_isInert(element, false)) {
|
|
26383
26428
|
// no need to look up since we're drilling down
|
|
26384
26429
|
// anything inside this container will also be inert
|
|
26385
26430
|
continue;
|
|
@@ -26388,7 +26433,7 @@ var getCandidatesIteratively = function getCandidatesIteratively(elements, inclu
|
|
|
26388
26433
|
// add shadow dom slot scope (slot itself cannot be focusable)
|
|
26389
26434
|
var assigned = element.assignedElements();
|
|
26390
26435
|
var content = assigned.length ? assigned : element.children;
|
|
26391
|
-
var nestedCandidates =
|
|
26436
|
+
var nestedCandidates = _getCandidatesIteratively(content, true, options);
|
|
26392
26437
|
if (options.flatten) {
|
|
26393
26438
|
candidates.push.apply(candidates, nestedCandidates);
|
|
26394
26439
|
} else {
|
|
@@ -26412,7 +26457,7 @@ var getCandidatesIteratively = function getCandidatesIteratively(elements, inclu
|
|
|
26412
26457
|
// no inert look up because we're already drilling down and checking for inertness
|
|
26413
26458
|
// on the way down, so all containers to this root node should have already been
|
|
26414
26459
|
// vetted as non-inert
|
|
26415
|
-
var validShadowRoot = !
|
|
26460
|
+
var validShadowRoot = !_isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element));
|
|
26416
26461
|
if (shadowRoot && validShadowRoot) {
|
|
26417
26462
|
// add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed
|
|
26418
26463
|
// shadow exists, so look at light dom children as fallback BUT create a scope for any
|
|
@@ -26420,7 +26465,7 @@ var getCandidatesIteratively = function getCandidatesIteratively(elements, inclu
|
|
|
26420
26465
|
// children of the web component element (which has the shadow), in the light dom, but
|
|
26421
26466
|
// slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,
|
|
26422
26467
|
// _after_ we return from this recursive call
|
|
26423
|
-
var _nestedCandidates =
|
|
26468
|
+
var _nestedCandidates = _getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);
|
|
26424
26469
|
if (options.flatten) {
|
|
26425
26470
|
candidates.push.apply(candidates, _nestedCandidates);
|
|
26426
26471
|
} else {
|
|
@@ -26597,6 +26642,28 @@ var isZeroArea = function isZeroArea(node) {
|
|
|
26597
26642
|
var isHidden = function isHidden(node, _ref) {
|
|
26598
26643
|
var displayCheck = _ref.displayCheck,
|
|
26599
26644
|
getShadowRoot = _ref.getShadowRoot;
|
|
26645
|
+
if (displayCheck === 'full-native') {
|
|
26646
|
+
if ('checkVisibility' in node) {
|
|
26647
|
+
// Chrome >= 105, Edge >= 105, Firefox >= 106, Safari >= 17.4
|
|
26648
|
+
// @see https://developer.mozilla.org/en-US/docs/Web/API/Element/checkVisibility#browser_compatibility
|
|
26649
|
+
var visible = node.checkVisibility({
|
|
26650
|
+
// Checking opacity might be desirable for some use cases, but natively,
|
|
26651
|
+
// opacity zero elements _are_ focusable and tabbable.
|
|
26652
|
+
checkOpacity: false,
|
|
26653
|
+
opacityProperty: false,
|
|
26654
|
+
contentVisibilityAuto: true,
|
|
26655
|
+
visibilityProperty: true,
|
|
26656
|
+
// This is an alias for `visibilityProperty`. Contemporary browsers
|
|
26657
|
+
// support both. However, this alias has wider browser support (Chrome
|
|
26658
|
+
// >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so
|
|
26659
|
+
// we include it anyway.
|
|
26660
|
+
checkVisibilityCSS: true
|
|
26661
|
+
});
|
|
26662
|
+
return !visible;
|
|
26663
|
+
}
|
|
26664
|
+
// Fall through to manual visibility checks
|
|
26665
|
+
}
|
|
26666
|
+
|
|
26600
26667
|
// NOTE: visibility will be `undefined` if node is detached from the document
|
|
26601
26668
|
// (see notes about this further down), which means we will consider it visible
|
|
26602
26669
|
// (this is legacy behavior from a very long way back)
|
|
@@ -26610,7 +26677,10 @@ var isHidden = function isHidden(node, _ref) {
|
|
|
26610
26677
|
if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {
|
|
26611
26678
|
return true;
|
|
26612
26679
|
}
|
|
26613
|
-
if (!displayCheck || displayCheck === 'full' ||
|
|
26680
|
+
if (!displayCheck || displayCheck === 'full' ||
|
|
26681
|
+
// full-native can run this branch when it falls through in case
|
|
26682
|
+
// Element#checkVisibility is unsupported
|
|
26683
|
+
displayCheck === 'full-native' || displayCheck === 'legacy-full') {
|
|
26614
26684
|
if (typeof getShadowRoot === 'function') {
|
|
26615
26685
|
// figure out if we should consider the node to be in an undisclosed shadow and use the
|
|
26616
26686
|
// 'non-zero-area' fallback
|
|
@@ -26723,7 +26793,7 @@ var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(o
|
|
|
26723
26793
|
// we must do an inert look up to filter out any elements inside an inert ancestor
|
|
26724
26794
|
// because we're limited in the type of selectors we can use in JSDom (see related
|
|
26725
26795
|
// note related to `candidateSelectors`)
|
|
26726
|
-
|
|
26796
|
+
_isInert(node) || isHiddenInput(node) || isHidden(node, options) ||
|
|
26727
26797
|
// For a details element with a summary, the summary element gets the focus
|
|
26728
26798
|
isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
|
|
26729
26799
|
return false;
|
|
@@ -26736,7 +26806,7 @@ var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(opt
|
|
|
26736
26806
|
}
|
|
26737
26807
|
return true;
|
|
26738
26808
|
};
|
|
26739
|
-
var
|
|
26809
|
+
var isShadowRootTabbable = function isShadowRootTabbable(shadowHostNode) {
|
|
26740
26810
|
var tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);
|
|
26741
26811
|
if (isNaN(tabIndex) || tabIndex >= 0) {
|
|
26742
26812
|
return true;
|
|
@@ -26750,14 +26820,14 @@ var isValidShadowRootTabbable = function isValidShadowRootTabbable(shadowHostNod
|
|
|
26750
26820
|
* @param {Array.<Element|CandidateScope>} candidates
|
|
26751
26821
|
* @returns Element[]
|
|
26752
26822
|
*/
|
|
26753
|
-
var
|
|
26823
|
+
var _sortByOrder = function sortByOrder(candidates) {
|
|
26754
26824
|
var regularTabbables = [];
|
|
26755
26825
|
var orderedTabbables = [];
|
|
26756
26826
|
candidates.forEach(function (item, i) {
|
|
26757
26827
|
var isScope = !!item.scopeParent;
|
|
26758
26828
|
var element = isScope ? item.scopeParent : item;
|
|
26759
26829
|
var candidateTabindex = getSortOrderTabIndex(element, isScope);
|
|
26760
|
-
var elements = isScope ?
|
|
26830
|
+
var elements = isScope ? _sortByOrder(item.candidates) : element;
|
|
26761
26831
|
if (candidateTabindex === 0) {
|
|
26762
26832
|
isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
|
|
26763
26833
|
} else {
|
|
@@ -26779,22 +26849,22 @@ var tabbable = function tabbable(container, options) {
|
|
|
26779
26849
|
options = options || {};
|
|
26780
26850
|
var candidates;
|
|
26781
26851
|
if (options.getShadowRoot) {
|
|
26782
|
-
candidates =
|
|
26852
|
+
candidates = _getCandidatesIteratively([container], options.includeContainer, {
|
|
26783
26853
|
filter: isNodeMatchingSelectorTabbable.bind(null, options),
|
|
26784
26854
|
flatten: false,
|
|
26785
26855
|
getShadowRoot: options.getShadowRoot,
|
|
26786
|
-
shadowRootFilter:
|
|
26856
|
+
shadowRootFilter: isShadowRootTabbable
|
|
26787
26857
|
});
|
|
26788
26858
|
} else {
|
|
26789
26859
|
candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
|
|
26790
26860
|
}
|
|
26791
|
-
return
|
|
26861
|
+
return _sortByOrder(candidates);
|
|
26792
26862
|
};
|
|
26793
26863
|
var focusable = function focusable(container, options) {
|
|
26794
26864
|
options = options || {};
|
|
26795
26865
|
var candidates;
|
|
26796
26866
|
if (options.getShadowRoot) {
|
|
26797
|
-
candidates =
|
|
26867
|
+
candidates = _getCandidatesIteratively([container], options.includeContainer, {
|
|
26798
26868
|
filter: isNodeMatchingSelectorFocusable.bind(null, options),
|
|
26799
26869
|
flatten: true,
|
|
26800
26870
|
getShadowRoot: options.getShadowRoot
|
|
@@ -30115,6 +30185,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
30115
30185
|
/* harmony export */ scrollIntoViewport: () => (/* binding */ $2f04cbc44ee30ce0$export$c826860796309d1b)
|
|
30116
30186
|
/* harmony export */ });
|
|
30117
30187
|
/* harmony import */ var _getScrollParents_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(91577);
|
|
30188
|
+
/* harmony import */ var _platform_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(69202);
|
|
30189
|
+
|
|
30118
30190
|
|
|
30119
30191
|
|
|
30120
30192
|
/*
|
|
@@ -30128,6 +30200,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
30128
30200
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
30129
30201
|
* governing permissions and limitations under the License.
|
|
30130
30202
|
*/
|
|
30203
|
+
|
|
30131
30204
|
function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
|
|
30132
30205
|
let offsetX = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, 'left');
|
|
30133
30206
|
let offsetY = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, 'top');
|
|
@@ -30137,23 +30210,45 @@ function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
|
|
|
30137
30210
|
let y = scrollView.scrollTop;
|
|
30138
30211
|
// Account for top/left border offsetting the scroll top/Left + scroll padding
|
|
30139
30212
|
let { borderTopWidth: borderTopWidth, borderLeftWidth: borderLeftWidth, scrollPaddingTop: scrollPaddingTop, scrollPaddingRight: scrollPaddingRight, scrollPaddingBottom: scrollPaddingBottom, scrollPaddingLeft: scrollPaddingLeft } = getComputedStyle(scrollView);
|
|
30213
|
+
// Account for scroll margin of the element
|
|
30214
|
+
let { scrollMarginTop: scrollMarginTop, scrollMarginRight: scrollMarginRight, scrollMarginBottom: scrollMarginBottom, scrollMarginLeft: scrollMarginLeft } = getComputedStyle(element);
|
|
30140
30215
|
let borderAdjustedX = x + parseInt(borderLeftWidth, 10);
|
|
30141
30216
|
let borderAdjustedY = y + parseInt(borderTopWidth, 10);
|
|
30142
30217
|
// Ignore end/bottom border via clientHeight/Width instead of offsetHeight/Width
|
|
30143
30218
|
let maxX = borderAdjustedX + scrollView.clientWidth;
|
|
30144
30219
|
let maxY = borderAdjustedY + scrollView.clientHeight;
|
|
30145
|
-
// Get scroll padding values as pixels - defaults to 0 if no scroll padding
|
|
30220
|
+
// Get scroll padding / margin values as pixels - defaults to 0 if no scroll padding / margin
|
|
30146
30221
|
// is used.
|
|
30147
30222
|
let scrollPaddingTopNumber = parseInt(scrollPaddingTop, 10) || 0;
|
|
30148
30223
|
let scrollPaddingBottomNumber = parseInt(scrollPaddingBottom, 10) || 0;
|
|
30149
30224
|
let scrollPaddingRightNumber = parseInt(scrollPaddingRight, 10) || 0;
|
|
30150
30225
|
let scrollPaddingLeftNumber = parseInt(scrollPaddingLeft, 10) || 0;
|
|
30151
|
-
|
|
30152
|
-
|
|
30153
|
-
|
|
30154
|
-
|
|
30155
|
-
|
|
30156
|
-
|
|
30226
|
+
let scrollMarginTopNumber = parseInt(scrollMarginTop, 10) || 0;
|
|
30227
|
+
let scrollMarginBottomNumber = parseInt(scrollMarginBottom, 10) || 0;
|
|
30228
|
+
let scrollMarginRightNumber = parseInt(scrollMarginRight, 10) || 0;
|
|
30229
|
+
let scrollMarginLeftNumber = parseInt(scrollMarginLeft, 10) || 0;
|
|
30230
|
+
let targetLeft = offsetX - scrollMarginLeftNumber;
|
|
30231
|
+
let targetRight = offsetX + width + scrollMarginRightNumber;
|
|
30232
|
+
let targetTop = offsetY - scrollMarginTopNumber;
|
|
30233
|
+
let targetBottom = offsetY + height + scrollMarginBottomNumber;
|
|
30234
|
+
let scrollPortLeft = x + parseInt(borderLeftWidth, 10) + scrollPaddingLeftNumber;
|
|
30235
|
+
let scrollPortRight = maxX - scrollPaddingRightNumber;
|
|
30236
|
+
let scrollPortTop = y + parseInt(borderTopWidth, 10) + scrollPaddingTopNumber;
|
|
30237
|
+
let scrollPortBottom = maxY - scrollPaddingBottomNumber;
|
|
30238
|
+
if (targetLeft > scrollPortLeft || targetRight < scrollPortRight) {
|
|
30239
|
+
if (targetLeft <= x + scrollPaddingLeftNumber) x = targetLeft - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber;
|
|
30240
|
+
else if (targetRight > maxX - scrollPaddingRightNumber) x += targetRight - maxX + scrollPaddingRightNumber;
|
|
30241
|
+
}
|
|
30242
|
+
if (targetTop > scrollPortTop || targetBottom < scrollPortBottom) {
|
|
30243
|
+
if (targetTop <= borderAdjustedY + scrollPaddingTopNumber) y = targetTop - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber;
|
|
30244
|
+
else if (targetBottom > maxY - scrollPaddingBottomNumber) y += targetBottom - maxY + scrollPaddingBottomNumber;
|
|
30245
|
+
}
|
|
30246
|
+
if (false) // removed by dead control flow
|
|
30247
|
+
{}
|
|
30248
|
+
scrollView.scrollTo({
|
|
30249
|
+
left: x,
|
|
30250
|
+
top: y
|
|
30251
|
+
});
|
|
30157
30252
|
}
|
|
30158
30253
|
/**
|
|
30159
30254
|
* Computes the offset left or top from child to ancestor by accumulating
|
|
@@ -30179,8 +30274,9 @@ function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
|
|
|
30179
30274
|
if (targetElement && document.contains(targetElement)) {
|
|
30180
30275
|
let root = document.scrollingElement || document.documentElement;
|
|
30181
30276
|
let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';
|
|
30182
|
-
// If scrolling is not currently prevented then we aren
|
|
30183
|
-
|
|
30277
|
+
// If scrolling is not currently prevented then we aren't in a overlay nor is a overlay open, just use element.scrollIntoView to bring the element into view
|
|
30278
|
+
// Also ignore in chrome because of this bug: https://issues.chromium.org/issues/40074749
|
|
30279
|
+
if (!isScrollPrevented && !(0, _platform_mjs__WEBPACK_IMPORTED_MODULE_1__.isChrome)()) {
|
|
30184
30280
|
var // use scrollIntoView({block: 'nearest'}) instead of .focus to check if the element is fully in view or not since .focus()
|
|
30185
30281
|
// won't cause a scroll if the element is already focused and doesn't behave consistently when an element is partially out of view horizontally vs vertically
|
|
30186
30282
|
_targetElement_scrollIntoView;
|
|
@@ -31217,7 +31313,9 @@ function $7d2416ea0959daaa$var$isAttributeVisible(element, childElement) {
|
|
|
31217
31313
|
!element.hasAttribute('data-react-aria-prevent-focus') && (element.nodeName === 'DETAILS' && childElement && childElement.nodeName !== 'SUMMARY' ? element.hasAttribute('open') : true);
|
|
31218
31314
|
}
|
|
31219
31315
|
function $7d2416ea0959daaa$export$e989c0fffaa6b27a(element, childElement) {
|
|
31220
|
-
if ($7d2416ea0959daaa$var$supportsCheckVisibility) return element.checkVisibility(
|
|
31316
|
+
if ($7d2416ea0959daaa$var$supportsCheckVisibility) return element.checkVisibility({
|
|
31317
|
+
visibilityProperty: true
|
|
31318
|
+
}) && !element.closest('[data-react-aria-prevent-focus]');
|
|
31221
31319
|
return element.nodeName !== '#comment' && $7d2416ea0959daaa$var$isStyleVisible(element) && $7d2416ea0959daaa$var$isAttributeVisible(element, childElement) && (!element.parentElement || $7d2416ea0959daaa$export$e989c0fffaa6b27a(element.parentElement, element));
|
|
31222
31320
|
}
|
|
31223
31321
|
|