@darajs/core 1.10.2 → 1.10.3
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.
|
Binary file
|
|
@@ -17360,6 +17360,15 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
17360
17360
|
function isTableElement$1(element) {
|
|
17361
17361
|
return ["table", "td", "th"].includes(getNodeName$1(element));
|
|
17362
17362
|
}
|
|
17363
|
+
function isTopLayer(element) {
|
|
17364
|
+
return [":popover-open", ":modal"].some((selector2) => {
|
|
17365
|
+
try {
|
|
17366
|
+
return element.matches(selector2);
|
|
17367
|
+
} catch (e3) {
|
|
17368
|
+
return false;
|
|
17369
|
+
}
|
|
17370
|
+
});
|
|
17371
|
+
}
|
|
17363
17372
|
function isContainingBlock(element) {
|
|
17364
17373
|
const webkit = isWebKit();
|
|
17365
17374
|
const css2 = getComputedStyle$2(element);
|
|
@@ -17368,6 +17377,9 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
17368
17377
|
function getContainingBlock$1(element) {
|
|
17369
17378
|
let currentNode = getParentNode$1(element);
|
|
17370
17379
|
while (isHTMLElement$1(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
17380
|
+
if (isTopLayer(currentNode)) {
|
|
17381
|
+
return null;
|
|
17382
|
+
}
|
|
17371
17383
|
if (isContainingBlock(currentNode)) {
|
|
17372
17384
|
return currentNode;
|
|
17373
17385
|
}
|
|
@@ -17992,10 +18004,12 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
17992
18004
|
return {};
|
|
17993
18005
|
}
|
|
17994
18006
|
const side = getSide(placement);
|
|
18007
|
+
const initialSideAxis = getSideAxis(initialPlacement);
|
|
17995
18008
|
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
17996
18009
|
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
17997
18010
|
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement$1(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
17998
|
-
|
|
18011
|
+
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
|
|
18012
|
+
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
17999
18013
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
18000
18014
|
}
|
|
18001
18015
|
const placements2 = [initialPlacement, ...fallbackPlacements];
|
|
@@ -18032,8 +18046,14 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
18032
18046
|
if (!resetPlacement) {
|
|
18033
18047
|
switch (fallbackStrategy) {
|
|
18034
18048
|
case "bestFit": {
|
|
18035
|
-
var _overflowsData$
|
|
18036
|
-
const placement2 = (_overflowsData$
|
|
18049
|
+
var _overflowsData$filter2;
|
|
18050
|
+
const placement2 = (_overflowsData$filter2 = overflowsData.filter((d2) => {
|
|
18051
|
+
if (hasFallbackAxisSideDirection) {
|
|
18052
|
+
const currentSideAxis = getSideAxis(d2.placement);
|
|
18053
|
+
return currentSideAxis === initialSideAxis || currentSideAxis === "y";
|
|
18054
|
+
}
|
|
18055
|
+
return true;
|
|
18056
|
+
}).map((d2) => [d2.placement, d2.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a2, b2) => a2[1] - b2[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
18037
18057
|
if (placement2) {
|
|
18038
18058
|
resetPlacement = placement2;
|
|
18039
18059
|
}
|
|
@@ -18628,16 +18648,6 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
18628
18648
|
y: y2
|
|
18629
18649
|
});
|
|
18630
18650
|
}
|
|
18631
|
-
const topLayerSelectors = [":popover-open", ":modal"];
|
|
18632
|
-
function isTopLayer(element) {
|
|
18633
|
-
return topLayerSelectors.some((selector2) => {
|
|
18634
|
-
try {
|
|
18635
|
-
return element.matches(selector2);
|
|
18636
|
-
} catch (e3) {
|
|
18637
|
-
return false;
|
|
18638
|
-
}
|
|
18639
|
-
});
|
|
18640
|
-
}
|
|
18641
18651
|
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref2) {
|
|
18642
18652
|
let {
|
|
18643
18653
|
elements,
|
|
@@ -19421,78 +19431,73 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
19421
19431
|
} = props;
|
|
19422
19432
|
const pointerTypeRef = React__namespace.useRef();
|
|
19423
19433
|
const didKeyDownRef = React__namespace.useRef(false);
|
|
19424
|
-
|
|
19425
|
-
|
|
19426
|
-
|
|
19427
|
-
|
|
19428
|
-
|
|
19429
|
-
|
|
19430
|
-
|
|
19431
|
-
|
|
19432
|
-
|
|
19433
|
-
|
|
19434
|
-
|
|
19435
|
-
|
|
19436
|
-
|
|
19437
|
-
|
|
19438
|
-
|
|
19439
|
-
|
|
19440
|
-
|
|
19441
|
-
|
|
19442
|
-
|
|
19443
|
-
|
|
19444
|
-
|
|
19445
|
-
|
|
19446
|
-
|
|
19447
|
-
|
|
19448
|
-
|
|
19449
|
-
|
|
19450
|
-
|
|
19451
|
-
|
|
19452
|
-
|
|
19453
|
-
|
|
19454
|
-
|
|
19455
|
-
|
|
19456
|
-
|
|
19457
|
-
|
|
19458
|
-
|
|
19459
|
-
|
|
19460
|
-
|
|
19461
|
-
|
|
19462
|
-
|
|
19463
|
-
|
|
19464
|
-
|
|
19465
|
-
|
|
19466
|
-
|
|
19467
|
-
|
|
19468
|
-
|
|
19469
|
-
|
|
19470
|
-
|
|
19471
|
-
}
|
|
19472
|
-
if (event.key === "Enter") {
|
|
19473
|
-
if (open2 && toggle) {
|
|
19474
|
-
onOpenChange(false, event.nativeEvent, "click");
|
|
19475
|
-
} else {
|
|
19476
|
-
onOpenChange(true, event.nativeEvent, "click");
|
|
19477
|
-
}
|
|
19478
|
-
}
|
|
19479
|
-
},
|
|
19480
|
-
onKeyUp(event) {
|
|
19481
|
-
if (event.defaultPrevented || !keyboardHandlers || isButtonTarget(event) || isSpaceIgnored(domReference)) {
|
|
19482
|
-
return;
|
|
19483
|
-
}
|
|
19484
|
-
if (event.key === " " && didKeyDownRef.current) {
|
|
19485
|
-
didKeyDownRef.current = false;
|
|
19486
|
-
if (open2 && toggle) {
|
|
19487
|
-
onOpenChange(false, event.nativeEvent, "click");
|
|
19488
|
-
} else {
|
|
19489
|
-
onOpenChange(true, event.nativeEvent, "click");
|
|
19490
|
-
}
|
|
19491
|
-
}
|
|
19434
|
+
const reference2 = React__namespace.useMemo(() => ({
|
|
19435
|
+
onPointerDown(event) {
|
|
19436
|
+
pointerTypeRef.current = event.pointerType;
|
|
19437
|
+
},
|
|
19438
|
+
onMouseDown(event) {
|
|
19439
|
+
const pointerType = pointerTypeRef.current;
|
|
19440
|
+
if (event.button !== 0)
|
|
19441
|
+
return;
|
|
19442
|
+
if (eventOption === "click")
|
|
19443
|
+
return;
|
|
19444
|
+
if (isMouseLikePointerType(pointerType, true) && ignoreMouse)
|
|
19445
|
+
return;
|
|
19446
|
+
if (open2 && toggle && (dataRef.current.openEvent ? dataRef.current.openEvent.type === "mousedown" : true)) {
|
|
19447
|
+
onOpenChange(false, event.nativeEvent, "click");
|
|
19448
|
+
} else {
|
|
19449
|
+
event.preventDefault();
|
|
19450
|
+
onOpenChange(true, event.nativeEvent, "click");
|
|
19451
|
+
}
|
|
19452
|
+
},
|
|
19453
|
+
onClick(event) {
|
|
19454
|
+
const pointerType = pointerTypeRef.current;
|
|
19455
|
+
if (eventOption === "mousedown" && pointerTypeRef.current) {
|
|
19456
|
+
pointerTypeRef.current = void 0;
|
|
19457
|
+
return;
|
|
19458
|
+
}
|
|
19459
|
+
if (isMouseLikePointerType(pointerType, true) && ignoreMouse)
|
|
19460
|
+
return;
|
|
19461
|
+
if (open2 && toggle && (dataRef.current.openEvent ? dataRef.current.openEvent.type === "click" : true)) {
|
|
19462
|
+
onOpenChange(false, event.nativeEvent, "click");
|
|
19463
|
+
} else {
|
|
19464
|
+
onOpenChange(true, event.nativeEvent, "click");
|
|
19465
|
+
}
|
|
19466
|
+
},
|
|
19467
|
+
onKeyDown(event) {
|
|
19468
|
+
pointerTypeRef.current = void 0;
|
|
19469
|
+
if (event.defaultPrevented || !keyboardHandlers || isButtonTarget(event)) {
|
|
19470
|
+
return;
|
|
19471
|
+
}
|
|
19472
|
+
if (event.key === " " && !isSpaceIgnored(domReference)) {
|
|
19473
|
+
event.preventDefault();
|
|
19474
|
+
didKeyDownRef.current = true;
|
|
19475
|
+
}
|
|
19476
|
+
if (event.key === "Enter") {
|
|
19477
|
+
if (open2 && toggle) {
|
|
19478
|
+
onOpenChange(false, event.nativeEvent, "click");
|
|
19479
|
+
} else {
|
|
19480
|
+
onOpenChange(true, event.nativeEvent, "click");
|
|
19492
19481
|
}
|
|
19493
19482
|
}
|
|
19494
|
-
}
|
|
19495
|
-
|
|
19483
|
+
},
|
|
19484
|
+
onKeyUp(event) {
|
|
19485
|
+
if (event.defaultPrevented || !keyboardHandlers || isButtonTarget(event) || isSpaceIgnored(domReference)) {
|
|
19486
|
+
return;
|
|
19487
|
+
}
|
|
19488
|
+
if (event.key === " " && didKeyDownRef.current) {
|
|
19489
|
+
didKeyDownRef.current = false;
|
|
19490
|
+
if (open2 && toggle) {
|
|
19491
|
+
onOpenChange(false, event.nativeEvent, "click");
|
|
19492
|
+
} else {
|
|
19493
|
+
onOpenChange(true, event.nativeEvent, "click");
|
|
19494
|
+
}
|
|
19495
|
+
}
|
|
19496
|
+
}
|
|
19497
|
+
}), [dataRef, domReference, eventOption, ignoreMouse, keyboardHandlers, onOpenChange, open2, toggle]);
|
|
19498
|
+
return React__namespace.useMemo(() => enabled ? {
|
|
19499
|
+
reference: reference2
|
|
19500
|
+
} : {}, [enabled, reference2]);
|
|
19496
19501
|
}
|
|
19497
19502
|
const bubbleHandlerKeys = {
|
|
19498
19503
|
pointerdown: "onPointerDown",
|
|
@@ -19518,11 +19523,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
19518
19523
|
const {
|
|
19519
19524
|
open: open2,
|
|
19520
19525
|
onOpenChange,
|
|
19521
|
-
elements
|
|
19522
|
-
reference: reference2,
|
|
19523
|
-
domReference,
|
|
19524
|
-
floating
|
|
19525
|
-
},
|
|
19526
|
+
elements,
|
|
19526
19527
|
dataRef
|
|
19527
19528
|
} = context2;
|
|
19528
19529
|
const {
|
|
@@ -19600,7 +19601,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
19600
19601
|
}
|
|
19601
19602
|
const target = getTarget(event);
|
|
19602
19603
|
const inertSelector = "[" + createAttribute("inert") + "]";
|
|
19603
|
-
const markers = getDocument(floating).querySelectorAll(inertSelector);
|
|
19604
|
+
const markers = getDocument(elements.floating).querySelectorAll(inertSelector);
|
|
19604
19605
|
let targetRootAncestor = isElement$3(target) ? target : null;
|
|
19605
19606
|
while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {
|
|
19606
19607
|
const nextParent = getParentNode$1(targetRootAncestor);
|
|
@@ -19609,7 +19610,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
19609
19610
|
}
|
|
19610
19611
|
targetRootAncestor = nextParent;
|
|
19611
19612
|
}
|
|
19612
|
-
if (markers.length && isElement$3(target) && !isRootElement(target) && !contains$1(target, floating) && Array.from(markers).every((marker) => !contains$1(targetRootAncestor, marker))) {
|
|
19613
|
+
if (markers.length && isElement$3(target) && !isRootElement(target) && !contains$1(target, elements.floating) && Array.from(markers).every((marker) => !contains$1(targetRootAncestor, marker))) {
|
|
19613
19614
|
return;
|
|
19614
19615
|
}
|
|
19615
19616
|
if (isHTMLElement$1(target) && floating) {
|
|
@@ -19631,7 +19632,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
19631
19632
|
var _node$context;
|
|
19632
19633
|
return isEventTargetWithin(event, (_node$context = node.context) == null ? void 0 : _node$context.elements.floating);
|
|
19633
19634
|
});
|
|
19634
|
-
if (isEventTargetWithin(event, floating) || isEventTargetWithin(event, domReference) || targetIsInsideChildren) {
|
|
19635
|
+
if (isEventTargetWithin(event, elements.floating) || isEventTargetWithin(event, elements.domReference) || targetIsInsideChildren) {
|
|
19635
19636
|
return;
|
|
19636
19637
|
}
|
|
19637
19638
|
const children = tree ? getChildren$2(tree.nodesRef.current, nodeId) : [];
|
|
@@ -19668,19 +19669,19 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
19668
19669
|
function onScroll(event) {
|
|
19669
19670
|
onOpenChange(false, event, "ancestor-scroll");
|
|
19670
19671
|
}
|
|
19671
|
-
const doc = getDocument(floating);
|
|
19672
|
+
const doc = getDocument(elements.floating);
|
|
19672
19673
|
escapeKey && doc.addEventListener("keydown", escapeKeyCapture ? closeOnEscapeKeyDownCapture : closeOnEscapeKeyDown, escapeKeyCapture);
|
|
19673
19674
|
outsidePress && doc.addEventListener(outsidePressEvent, outsidePressCapture ? closeOnPressOutsideCapture : closeOnPressOutside, outsidePressCapture);
|
|
19674
19675
|
let ancestors = [];
|
|
19675
19676
|
if (ancestorScroll) {
|
|
19676
|
-
if (isElement$3(domReference)) {
|
|
19677
|
-
ancestors = getOverflowAncestors(domReference);
|
|
19677
|
+
if (isElement$3(elements.domReference)) {
|
|
19678
|
+
ancestors = getOverflowAncestors(elements.domReference);
|
|
19678
19679
|
}
|
|
19679
|
-
if (isElement$3(floating)) {
|
|
19680
|
-
ancestors = ancestors.concat(getOverflowAncestors(floating));
|
|
19680
|
+
if (isElement$3(elements.floating)) {
|
|
19681
|
+
ancestors = ancestors.concat(getOverflowAncestors(elements.floating));
|
|
19681
19682
|
}
|
|
19682
|
-
if (!isElement$3(
|
|
19683
|
-
ancestors = ancestors.concat(getOverflowAncestors(
|
|
19683
|
+
if (!isElement$3(elements.reference) && elements.reference && elements.reference.contextElement) {
|
|
19684
|
+
ancestors = ancestors.concat(getOverflowAncestors(elements.reference.contextElement));
|
|
19684
19685
|
}
|
|
19685
19686
|
}
|
|
19686
19687
|
ancestors = ancestors.filter((ancestor) => {
|
|
@@ -19699,37 +19700,34 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
19699
19700
|
ancestor.removeEventListener("scroll", onScroll);
|
|
19700
19701
|
});
|
|
19701
19702
|
};
|
|
19702
|
-
}, [dataRef,
|
|
19703
|
+
}, [dataRef, elements, escapeKey, outsidePress, outsidePressEvent, open2, onOpenChange, ancestorScroll, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, escapeKeyCapture, closeOnEscapeKeyDownCapture, closeOnPressOutside, outsidePressCapture, closeOnPressOutsideCapture]);
|
|
19703
19704
|
React__namespace.useEffect(() => {
|
|
19704
19705
|
insideReactTreeRef.current = false;
|
|
19705
19706
|
}, [outsidePress, outsidePressEvent]);
|
|
19706
|
-
|
|
19707
|
-
|
|
19708
|
-
|
|
19707
|
+
const reference2 = React__namespace.useMemo(() => ({
|
|
19708
|
+
onKeyDown: closeOnEscapeKeyDown,
|
|
19709
|
+
[bubbleHandlerKeys[referencePressEvent]]: (event) => {
|
|
19710
|
+
if (referencePress) {
|
|
19711
|
+
onOpenChange(false, event.nativeEvent, "reference-press");
|
|
19712
|
+
}
|
|
19713
|
+
}
|
|
19714
|
+
}), [closeOnEscapeKeyDown, onOpenChange, referencePress, referencePressEvent]);
|
|
19715
|
+
const floating = React__namespace.useMemo(() => ({
|
|
19716
|
+
onKeyDown: closeOnEscapeKeyDown,
|
|
19717
|
+
onMouseDown() {
|
|
19718
|
+
endedOrStartedInsideRef.current = true;
|
|
19719
|
+
},
|
|
19720
|
+
onMouseUp() {
|
|
19721
|
+
endedOrStartedInsideRef.current = true;
|
|
19722
|
+
},
|
|
19723
|
+
[captureHandlerKeys[outsidePressEvent]]: () => {
|
|
19724
|
+
insideReactTreeRef.current = true;
|
|
19709
19725
|
}
|
|
19710
|
-
|
|
19711
|
-
|
|
19712
|
-
|
|
19713
|
-
|
|
19714
|
-
|
|
19715
|
-
onOpenChange(false, event.nativeEvent, "reference-press");
|
|
19716
|
-
}
|
|
19717
|
-
}
|
|
19718
|
-
},
|
|
19719
|
-
floating: {
|
|
19720
|
-
onKeyDown: closeOnEscapeKeyDown,
|
|
19721
|
-
onMouseDown() {
|
|
19722
|
-
endedOrStartedInsideRef.current = true;
|
|
19723
|
-
},
|
|
19724
|
-
onMouseUp() {
|
|
19725
|
-
endedOrStartedInsideRef.current = true;
|
|
19726
|
-
},
|
|
19727
|
-
[captureHandlerKeys[outsidePressEvent]]: () => {
|
|
19728
|
-
insideReactTreeRef.current = true;
|
|
19729
|
-
}
|
|
19730
|
-
}
|
|
19731
|
-
};
|
|
19732
|
-
}, [enabled, referencePress, outsidePressEvent, referencePressEvent, onOpenChange, closeOnEscapeKeyDown]);
|
|
19726
|
+
}), [closeOnEscapeKeyDown, outsidePressEvent]);
|
|
19727
|
+
return React__namespace.useMemo(() => enabled ? {
|
|
19728
|
+
reference: reference2,
|
|
19729
|
+
floating
|
|
19730
|
+
} : {}, [enabled, reference2, floating]);
|
|
19733
19731
|
}
|
|
19734
19732
|
function useFloatingRootContext(options) {
|
|
19735
19733
|
const {
|
|
@@ -19916,18 +19914,20 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
19916
19914
|
if (propsList === void 0) {
|
|
19917
19915
|
propsList = [];
|
|
19918
19916
|
}
|
|
19919
|
-
const
|
|
19917
|
+
const referenceDeps = propsList.map((key) => key == null ? void 0 : key.reference);
|
|
19918
|
+
const floatingDeps = propsList.map((key) => key == null ? void 0 : key.floating);
|
|
19919
|
+
const itemDeps = propsList.map((key) => key == null ? void 0 : key.item);
|
|
19920
19920
|
const getReferenceProps = React__namespace.useCallback(
|
|
19921
19921
|
(userProps) => mergeProps(userProps, propsList, "reference"),
|
|
19922
|
-
|
|
19922
|
+
referenceDeps
|
|
19923
19923
|
);
|
|
19924
19924
|
const getFloatingProps = React__namespace.useCallback(
|
|
19925
19925
|
(userProps) => mergeProps(userProps, propsList, "floating"),
|
|
19926
|
-
|
|
19926
|
+
floatingDeps
|
|
19927
19927
|
);
|
|
19928
19928
|
const getItemProps = React__namespace.useCallback(
|
|
19929
19929
|
(userProps) => mergeProps(userProps, propsList, "item"),
|
|
19930
|
-
|
|
19930
|
+
itemDeps
|
|
19931
19931
|
);
|
|
19932
19932
|
return React__namespace.useMemo(() => ({
|
|
19933
19933
|
getReferenceProps,
|
|
@@ -19953,9 +19953,34 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
19953
19953
|
const referenceId = useId();
|
|
19954
19954
|
const parentId = useFloatingParentNodeId();
|
|
19955
19955
|
const isNested = parentId != null;
|
|
19956
|
-
|
|
19957
|
-
if (
|
|
19958
|
-
return {
|
|
19956
|
+
const reference2 = React__namespace.useMemo(() => {
|
|
19957
|
+
if (ariaRole === "tooltip" || role === "label") {
|
|
19958
|
+
return {
|
|
19959
|
+
["aria-" + (role === "label" ? "labelledby" : "describedby")]: open2 ? floatingId : void 0
|
|
19960
|
+
};
|
|
19961
|
+
}
|
|
19962
|
+
return {
|
|
19963
|
+
"aria-expanded": open2 ? "true" : "false",
|
|
19964
|
+
"aria-haspopup": ariaRole === "alertdialog" ? "dialog" : ariaRole,
|
|
19965
|
+
"aria-controls": open2 ? floatingId : void 0,
|
|
19966
|
+
...ariaRole === "listbox" && {
|
|
19967
|
+
role: "combobox"
|
|
19968
|
+
},
|
|
19969
|
+
...ariaRole === "menu" && {
|
|
19970
|
+
id: referenceId
|
|
19971
|
+
},
|
|
19972
|
+
...ariaRole === "menu" && isNested && {
|
|
19973
|
+
role: "menuitem"
|
|
19974
|
+
},
|
|
19975
|
+
...role === "select" && {
|
|
19976
|
+
"aria-autocomplete": "none"
|
|
19977
|
+
},
|
|
19978
|
+
...role === "combobox" && {
|
|
19979
|
+
"aria-autocomplete": "list"
|
|
19980
|
+
}
|
|
19981
|
+
};
|
|
19982
|
+
}, [ariaRole, floatingId, isNested, open2, referenceId, role]);
|
|
19983
|
+
const floating = React__namespace.useMemo(() => {
|
|
19959
19984
|
const floatingProps = {
|
|
19960
19985
|
id: floatingId,
|
|
19961
19986
|
...ariaRole && {
|
|
@@ -19963,70 +19988,48 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
19963
19988
|
}
|
|
19964
19989
|
};
|
|
19965
19990
|
if (ariaRole === "tooltip" || role === "label") {
|
|
19966
|
-
return
|
|
19967
|
-
reference: {
|
|
19968
|
-
["aria-" + (role === "label" ? "labelledby" : "describedby")]: open2 ? floatingId : void 0
|
|
19969
|
-
},
|
|
19970
|
-
floating: floatingProps
|
|
19971
|
-
};
|
|
19991
|
+
return floatingProps;
|
|
19972
19992
|
}
|
|
19973
19993
|
return {
|
|
19974
|
-
|
|
19975
|
-
|
|
19976
|
-
"aria-
|
|
19977
|
-
|
|
19978
|
-
|
|
19979
|
-
|
|
19980
|
-
|
|
19981
|
-
|
|
19982
|
-
|
|
19983
|
-
|
|
19984
|
-
|
|
19985
|
-
|
|
19986
|
-
|
|
19987
|
-
|
|
19988
|
-
|
|
19989
|
-
|
|
19990
|
-
|
|
19991
|
-
|
|
19992
|
-
|
|
19993
|
-
|
|
19994
|
-
|
|
19995
|
-
|
|
19996
|
-
|
|
19997
|
-
|
|
19998
|
-
|
|
19999
|
-
|
|
20000
|
-
item(_ref2) {
|
|
20001
|
-
let {
|
|
20002
|
-
active,
|
|
20003
|
-
selected
|
|
20004
|
-
} = _ref2;
|
|
20005
|
-
const commonProps = {
|
|
20006
|
-
role: "option",
|
|
19994
|
+
...floatingProps,
|
|
19995
|
+
...ariaRole === "menu" && {
|
|
19996
|
+
"aria-labelledby": referenceId
|
|
19997
|
+
}
|
|
19998
|
+
};
|
|
19999
|
+
}, [ariaRole, floatingId, referenceId, role]);
|
|
20000
|
+
const item = React__namespace.useCallback((_ref2) => {
|
|
20001
|
+
let {
|
|
20002
|
+
active,
|
|
20003
|
+
selected
|
|
20004
|
+
} = _ref2;
|
|
20005
|
+
const commonProps = {
|
|
20006
|
+
role: "option",
|
|
20007
|
+
...active && {
|
|
20008
|
+
id: floatingId + "-option"
|
|
20009
|
+
}
|
|
20010
|
+
};
|
|
20011
|
+
switch (role) {
|
|
20012
|
+
case "select":
|
|
20013
|
+
return {
|
|
20014
|
+
...commonProps,
|
|
20015
|
+
"aria-selected": active && selected
|
|
20016
|
+
};
|
|
20017
|
+
case "combobox": {
|
|
20018
|
+
return {
|
|
20019
|
+
...commonProps,
|
|
20007
20020
|
...active && {
|
|
20008
|
-
|
|
20021
|
+
"aria-selected": true
|
|
20009
20022
|
}
|
|
20010
20023
|
};
|
|
20011
|
-
switch (role) {
|
|
20012
|
-
case "select":
|
|
20013
|
-
return {
|
|
20014
|
-
...commonProps,
|
|
20015
|
-
"aria-selected": active && selected
|
|
20016
|
-
};
|
|
20017
|
-
case "combobox": {
|
|
20018
|
-
return {
|
|
20019
|
-
...commonProps,
|
|
20020
|
-
...active && {
|
|
20021
|
-
"aria-selected": true
|
|
20022
|
-
}
|
|
20023
|
-
};
|
|
20024
|
-
}
|
|
20025
|
-
}
|
|
20026
|
-
return {};
|
|
20027
20024
|
}
|
|
20028
|
-
}
|
|
20029
|
-
|
|
20025
|
+
}
|
|
20026
|
+
return {};
|
|
20027
|
+
}, [floatingId, role]);
|
|
20028
|
+
return React__namespace.useMemo(() => enabled ? {
|
|
20029
|
+
reference: reference2,
|
|
20030
|
+
floating,
|
|
20031
|
+
item
|
|
20032
|
+
} : {}, [enabled, reference2, floating, item]);
|
|
20030
20033
|
}
|
|
20031
20034
|
const matchWidthToReference = (delta = 0) => size$1({
|
|
20032
20035
|
apply({ rects, elements }) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darajs/core",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.3",
|
|
4
4
|
"description": "Dara Framework core",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"@babel/preset-env": "^7.23.0",
|
|
38
38
|
"@babel/preset-react": "^7.22.15",
|
|
39
39
|
"@babel/preset-typescript": "^7.23.0",
|
|
40
|
-
"@darajs/eslint-config": "~1.10.
|
|
41
|
-
"@darajs/prettier-config": "~1.10.
|
|
42
|
-
"@darajs/stylelint-config": "~1.10.
|
|
40
|
+
"@darajs/eslint-config": "~1.10.2",
|
|
41
|
+
"@darajs/prettier-config": "~1.10.2",
|
|
42
|
+
"@darajs/stylelint-config": "~1.10.2",
|
|
43
43
|
"@rollup/plugin-inject": "^4.0.4",
|
|
44
44
|
"@testing-library/dom": "^9.3.0",
|
|
45
45
|
"@testing-library/jest-dom": "^5.16.5",
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
"whatwg-fetch": "^3.6.2"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@darajs/styled-components": "~1.10.
|
|
83
|
-
"@darajs/ui-components": "~1.10.
|
|
84
|
-
"@darajs/ui-notifications": "~1.10.
|
|
85
|
-
"@darajs/ui-utils": "~1.10.
|
|
82
|
+
"@darajs/styled-components": "~1.10.2",
|
|
83
|
+
"@darajs/ui-components": "~1.10.2",
|
|
84
|
+
"@darajs/ui-notifications": "~1.10.2",
|
|
85
|
+
"@darajs/ui-utils": "~1.10.2",
|
|
86
86
|
"@fortawesome/fontawesome-free": "~6.4.0",
|
|
87
87
|
"@recoiljs/refine": "^0.1.1",
|
|
88
88
|
"@tanstack/query-core": "^4.0.0",
|
|
@@ -118,5 +118,5 @@
|
|
|
118
118
|
"publishConfig": {
|
|
119
119
|
"access": "public"
|
|
120
120
|
},
|
|
121
|
-
"gitHead": "
|
|
121
|
+
"gitHead": "7d528d1d369b25f98e3f34cd34900105b34b020d"
|
|
122
122
|
}
|