@fluentui/react-positioning 9.5.4 → 9.5.6
Sign up to get free protection for your applications and to get access to all the features.
- package/.swcrc +30 -0
- package/CHANGELOG.json +55 -1
- package/CHANGELOG.md +24 -2
- package/lib/constants.js.map +1 -1
- package/lib/createArrowStyles.js.map +1 -1
- package/lib/createPositionManager.js.map +1 -1
- package/lib/createVirtualElementFromClick.js +1 -2
- package/lib/createVirtualElementFromClick.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/middleware/coverTarget.js.map +1 -1
- package/lib/middleware/flip.js.map +1 -1
- package/lib/middleware/index.js.map +1 -1
- package/lib/middleware/intersecting.js.map +1 -1
- package/lib/middleware/maxSize.js.map +1 -1
- package/lib/middleware/offset.js.map +1 -1
- package/lib/middleware/shift.js.map +1 -1
- package/lib/types.js +1 -1
- package/lib/types.js.map +1 -1
- package/lib/usePositioning.js +23 -21
- package/lib/usePositioning.js.map +1 -1
- package/lib/usePositioningMouseTarget.js.map +1 -1
- package/lib/utils/debounce.js +1 -2
- package/lib/utils/debounce.js.map +1 -1
- package/lib/utils/fromFloatingUIPlacement.js.map +1 -1
- package/lib/utils/getBoundary.js.map +1 -1
- package/lib/utils/getFloatingUIOffset.js.map +1 -1
- package/lib/utils/getReactFiberFromNode.js +1 -0
- package/lib/utils/getReactFiberFromNode.js.map +1 -1
- package/lib/utils/getScrollParent.js +5 -6
- package/lib/utils/getScrollParent.js.map +1 -1
- package/lib/utils/hasAutoFocusFilter.js +2 -2
- package/lib/utils/hasAutoFocusFilter.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/mergeArrowOffset.js +3 -4
- package/lib/utils/mergeArrowOffset.js.map +1 -1
- package/lib/utils/parseFloatingUIPlacement.js +1 -2
- package/lib/utils/parseFloatingUIPlacement.js.map +1 -1
- package/lib/utils/resolvePositioningShorthand.js.map +1 -1
- package/lib/utils/toFloatingUIPadding.js.map +1 -1
- package/lib/utils/toFloatingUIPlacement.js.map +1 -1
- package/lib/utils/toggleScrollListener.js.map +1 -1
- package/lib/utils/useCallbackRef.js.map +1 -1
- package/lib/utils/writeArrowUpdates.js +1 -2
- package/lib/utils/writeArrowUpdates.js.map +1 -1
- package/lib/utils/writeContainerupdates.js +4 -4
- package/lib/utils/writeContainerupdates.js.map +1 -1
- package/lib-commonjs/constants.js +18 -7
- package/lib-commonjs/constants.js.map +1 -1
- package/lib-commonjs/createArrowStyles.js +60 -88
- package/lib-commonjs/createArrowStyles.js.map +1 -1
- package/lib-commonjs/createPositionManager.js +103 -117
- package/lib-commonjs/createPositionManager.js.map +1 -1
- package/lib-commonjs/createVirtualElementFromClick.js +27 -26
- package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
- package/lib-commonjs/index.js +24 -51
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/middleware/coverTarget.js +34 -37
- package/lib-commonjs/middleware/coverTarget.js.map +1 -1
- package/lib-commonjs/middleware/flip.js +31 -38
- package/lib-commonjs/middleware/flip.js.map +1 -1
- package/lib-commonjs/middleware/index.js +10 -9
- package/lib-commonjs/middleware/index.js.map +1 -1
- package/lib-commonjs/middleware/intersecting.js +24 -22
- package/lib-commonjs/middleware/intersecting.js.map +1 -1
- package/lib-commonjs/middleware/maxSize.js +34 -40
- package/lib-commonjs/middleware/maxSize.js.map +1 -1
- package/lib-commonjs/middleware/offset.js +11 -12
- package/lib-commonjs/middleware/offset.js.map +1 -1
- package/lib-commonjs/middleware/shift.js +29 -37
- package/lib-commonjs/middleware/shift.js.map +1 -1
- package/lib-commonjs/types.js +5 -2
- package/lib-commonjs/types.js.map +1 -1
- package/lib-commonjs/usePositioning.js +200 -164
- package/lib-commonjs/usePositioning.js.map +1 -1
- package/lib-commonjs/usePositioningMouseTarget.js +34 -37
- package/lib-commonjs/usePositioningMouseTarget.js.map +1 -1
- package/lib-commonjs/utils/debounce.js +22 -21
- package/lib-commonjs/utils/debounce.js.map +1 -1
- package/lib-commonjs/utils/fromFloatingUIPlacement.js +30 -35
- package/lib-commonjs/utils/fromFloatingUIPlacement.js.map +1 -1
- package/lib-commonjs/utils/getBoundary.js +21 -22
- package/lib-commonjs/utils/getBoundary.js.map +1 -1
- package/lib-commonjs/utils/getFloatingUIOffset.js +23 -35
- package/lib-commonjs/utils/getFloatingUIOffset.js.map +1 -1
- package/lib-commonjs/utils/getReactFiberFromNode.js +45 -41
- package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
- package/lib-commonjs/utils/getScrollParent.js +52 -56
- package/lib-commonjs/utils/getScrollParent.js.map +1 -1
- package/lib-commonjs/utils/hasAutoFocusFilter.js +18 -17
- package/lib-commonjs/utils/hasAutoFocusFilter.js.map +1 -1
- package/lib-commonjs/utils/index.js +19 -18
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/mergeArrowOffset.js +33 -32
- package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
- package/lib-commonjs/utils/parseFloatingUIPlacement.js +15 -14
- package/lib-commonjs/utils/parseFloatingUIPlacement.js.map +1 -1
- package/lib-commonjs/utils/resolvePositioningShorthand.js +63 -61
- package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
- package/lib-commonjs/utils/toFloatingUIPadding.js +23 -25
- package/lib-commonjs/utils/toFloatingUIPadding.js.map +1 -1
- package/lib-commonjs/utils/toFloatingUIPlacement.js +31 -33
- package/lib-commonjs/utils/toFloatingUIPlacement.js.map +1 -1
- package/lib-commonjs/utils/toggleScrollListener.js +20 -24
- package/lib-commonjs/utils/toggleScrollListener.js.map +1 -1
- package/lib-commonjs/utils/useCallbackRef.js +39 -53
- package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
- package/lib-commonjs/utils/writeArrowUpdates.js +19 -24
- package/lib-commonjs/utils/writeArrowUpdates.js.map +1 -1
- package/lib-commonjs/utils/writeContainerupdates.js +37 -45
- package/lib-commonjs/utils/writeContainerupdates.js.map +1 -1
- package/package.json +7 -6
- package/lib-amd/constants.js +0 -10
- package/lib-amd/constants.js.map +0 -1
- package/lib-amd/createArrowStyles.js +0 -62
- package/lib-amd/createArrowStyles.js.map +0 -1
- package/lib-amd/createPositionManager.js +0 -97
- package/lib-amd/createPositionManager.js.map +0 -1
- package/lib-amd/createVirtualElementFromClick.js +0 -32
- package/lib-amd/createVirtualElementFromClick.js.map +0 -1
- package/lib-amd/index.js +0 -13
- package/lib-amd/index.js.map +0 -1
- package/lib-amd/middleware/coverTarget.js +0 -32
- package/lib-amd/middleware/coverTarget.js.map +0 -1
- package/lib-amd/middleware/flip.js +0 -19
- package/lib-amd/middleware/flip.js.map +0 -1
- package/lib-amd/middleware/index.js +0 -11
- package/lib-amd/middleware/index.js.map +0 -1
- package/lib-amd/middleware/intersecting.js +0 -33
- package/lib-amd/middleware/intersecting.js.map +0 -1
- package/lib-amd/middleware/maxSize.js +0 -33
- package/lib-amd/middleware/maxSize.js.map +0 -1
- package/lib-amd/middleware/offset.js +0 -14
- package/lib-amd/middleware/offset.js.map +0 -1
- package/lib-amd/middleware/shift.js +0 -17
- package/lib-amd/middleware/shift.js.map +0 -1
- package/lib-amd/types.js +0 -5
- package/lib-amd/types.js.map +0 -1
- package/lib-amd/usePositioning.js +0 -161
- package/lib-amd/usePositioning.js.map +0 -1
- package/lib-amd/usePositioningMouseTarget.js +0 -39
- package/lib-amd/usePositioningMouseTarget.js.map +0 -1
- package/lib-amd/utils/debounce.js +0 -27
- package/lib-amd/utils/debounce.js.map +0 -1
- package/lib-amd/utils/fromFloatingUIPlacement.js +0 -37
- package/lib-amd/utils/fromFloatingUIPlacement.js.map +0 -1
- package/lib-amd/utils/getBoundary.js +0 -26
- package/lib-amd/utils/getBoundary.js.map +0 -1
- package/lib-amd/utils/getFloatingUIOffset.js +0 -25
- package/lib-amd/utils/getFloatingUIOffset.js.map +0 -1
- package/lib-amd/utils/getReactFiberFromNode.js +0 -48
- package/lib-amd/utils/getReactFiberFromNode.js.map +0 -1
- package/lib-amd/utils/getScrollParent.js +0 -64
- package/lib-amd/utils/getScrollParent.js.map +0 -1
- package/lib-amd/utils/hasAutoFocusFilter.js +0 -31
- package/lib-amd/utils/hasAutoFocusFilter.js.map +0 -1
- package/lib-amd/utils/index.js +0 -20
- package/lib-amd/utils/index.js.map +0 -1
- package/lib-amd/utils/mergeArrowOffset.js +0 -38
- package/lib-amd/utils/mergeArrowOffset.js.map +0 -1
- package/lib-amd/utils/parseFloatingUIPlacement.js +0 -20
- package/lib-amd/utils/parseFloatingUIPlacement.js.map +0 -1
- package/lib-amd/utils/resolvePositioningShorthand.js +0 -31
- package/lib-amd/utils/resolvePositioningShorthand.js.map +0 -1
- package/lib-amd/utils/toFloatingUIPadding.js +0 -25
- package/lib-amd/utils/toFloatingUIPadding.js.map +0 -1
- package/lib-amd/utils/toFloatingUIPlacement.js +0 -40
- package/lib-amd/utils/toFloatingUIPlacement.js.map +0 -1
- package/lib-amd/utils/toggleScrollListener.js +0 -26
- package/lib-amd/utils/toggleScrollListener.js.map +0 -1
- package/lib-amd/utils/useCallbackRef.js +0 -55
- package/lib-amd/utils/useCallbackRef.js.map +0 -1
- package/lib-amd/utils/writeArrowUpdates.js +0 -21
- package/lib-amd/utils/writeArrowUpdates.js.map +0 -1
- package/lib-amd/utils/writeContainerupdates.js +0 -41
- package/lib-amd/utils/writeContainerupdates.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { createVirtualElementFromClick } from './createVirtualElementFromClick';\nexport { createArrowHeightStyles, createArrowStyles } from './createArrowStyles';\nexport { usePositioning } from './usePositioning';\nexport { usePositioningMouseTarget } from './usePositioningMouseTarget';\nexport { resolvePositioningShorthand, mergeArrowOffset } from './utils/index';\n//# sourceMappingURL=index.js.map"],"names":["createVirtualElementFromClick","createArrowHeightStyles","createArrowStyles","usePositioning","usePositioningMouseTarget","resolvePositioningShorthand","mergeArrowOffset"],"mappings":";;;;;;;;;;;IAASA,6BAA6B,MAA7BA,4DAA6B;IAC7BC,uBAAuB,MAAvBA,0CAAuB;IAAEC,iBAAiB,MAAjBA,oCAAiB;IAC1CC,cAAc,MAAdA,8BAAc;IACdC,yBAAyB,MAAzBA,oDAAyB;IACzBC,2BAA2B,MAA3BA,kCAA2B;IAAEC,gBAAgB,MAAhBA,uBAAgB;;+CAJR;mCACa;gCAC5B;2CACW;uBACoB;CAC9D,iCAAiC"}
|
@@ -1,42 +1,39 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "coverTarget", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>coverTarget
|
5
8
|
});
|
6
|
-
|
7
|
-
const index_1 = /*#__PURE__*/require("../utils/index");
|
9
|
+
const _index = require("../utils/index");
|
8
10
|
function coverTarget() {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
return newCoords;
|
38
|
-
}
|
39
|
-
};
|
40
|
-
}
|
41
|
-
exports.coverTarget = coverTarget;
|
11
|
+
return {
|
12
|
+
name: 'coverTarget',
|
13
|
+
fn: (middlewareArguments)=>{
|
14
|
+
const { placement , rects , x , y } = middlewareArguments;
|
15
|
+
const basePlacement = (0, _index.parseFloatingUIPlacement)(placement).side;
|
16
|
+
const newCoords = {
|
17
|
+
x,
|
18
|
+
y
|
19
|
+
};
|
20
|
+
switch(basePlacement){
|
21
|
+
case 'bottom':
|
22
|
+
newCoords.y -= rects.reference.height;
|
23
|
+
break;
|
24
|
+
case 'top':
|
25
|
+
newCoords.y += rects.reference.height;
|
26
|
+
break;
|
27
|
+
case 'left':
|
28
|
+
newCoords.x += rects.reference.width;
|
29
|
+
break;
|
30
|
+
case 'right':
|
31
|
+
newCoords.x -= rects.reference.width;
|
32
|
+
break;
|
33
|
+
}
|
34
|
+
return newCoords;
|
35
|
+
}
|
36
|
+
};
|
37
|
+
} //# sourceMappingURL=coverTarget.js.map
|
38
|
+
|
42
39
|
//# sourceMappingURL=coverTarget.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/middleware/coverTarget.js"],"sourcesContent":["import { parseFloatingUIPlacement } from '../utils/index';\nexport function coverTarget() {\n return {\n name: 'coverTarget',\n fn: middlewareArguments => {\n const {\n placement,\n rects,\n x,\n y\n } = middlewareArguments;\n const basePlacement = parseFloatingUIPlacement(placement).side;\n const newCoords = {\n x,\n y\n };\n switch (basePlacement) {\n case 'bottom':\n newCoords.y -= rects.reference.height;\n break;\n case 'top':\n newCoords.y += rects.reference.height;\n break;\n case 'left':\n newCoords.x += rects.reference.width;\n break;\n case 'right':\n newCoords.x -= rects.reference.width;\n break;\n }\n return newCoords;\n }\n };\n}\n//# sourceMappingURL=coverTarget.js.map"],"names":["coverTarget","name","fn","middlewareArguments","placement","rects","x","y","basePlacement","parseFloatingUIPlacement","side","newCoords","reference","height","width"],"mappings":";;;;+BACgBA;;aAAAA;;uBADyB;AAClC,SAASA,cAAc;IAC5B,OAAO;QACLC,MAAM;QACNC,IAAIC,CAAAA,sBAAuB;YACzB,MAAM,EACJC,UAAS,EACTC,MAAK,EACLC,EAAC,EACDC,EAAC,EACF,GAAGJ;YACJ,MAAMK,gBAAgBC,IAAAA,+BAAwB,EAACL,WAAWM,IAAI;YAC9D,MAAMC,YAAY;gBAChBL;gBACAC;YACF;YACA,OAAQC;gBACN,KAAK;oBACHG,UAAUJ,CAAC,IAAIF,MAAMO,SAAS,CAACC,MAAM;oBACrC,KAAM;gBACR,KAAK;oBACHF,UAAUJ,CAAC,IAAIF,MAAMO,SAAS,CAACC,MAAM;oBACrC,KAAM;gBACR,KAAK;oBACHF,UAAUL,CAAC,IAAID,MAAMO,SAAS,CAACE,KAAK;oBACpC,KAAM;gBACR,KAAK;oBACHH,UAAUL,CAAC,IAAID,MAAMO,SAAS,CAACE,KAAK;oBACpC,KAAM;YACV;YACA,OAAOH;QACT;IACF;AACF,EACA,uCAAuC"}
|
@@ -1,43 +1,36 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "flip", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>flip
|
5
8
|
});
|
6
|
-
|
7
|
-
const
|
8
|
-
const index_1 = /*#__PURE__*/require("../utils/index");
|
9
|
+
const _dom = require("@floating-ui/dom");
|
10
|
+
const _index = require("../utils/index");
|
9
11
|
function flip(options) {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
})
|
32
|
-
|
33
|
-
|
34
|
-
boundary: index_1.getBoundary(container, flipBoundary)
|
35
|
-
}),
|
36
|
-
fallbackStrategy: 'bestFit',
|
37
|
-
...(fallbackPlacements.length && {
|
38
|
-
fallbackPlacements
|
39
|
-
})
|
40
|
-
});
|
41
|
-
}
|
42
|
-
exports.flip = flip;
|
12
|
+
const { hasScrollableElement , flipBoundary , container , fallbackPositions =[] , isRtl } = options;
|
13
|
+
const fallbackPlacements = fallbackPositions.reduce((acc, shorthand)=>{
|
14
|
+
const { position , align } = (0, _index.resolvePositioningShorthand)(shorthand);
|
15
|
+
const placement = (0, _index.toFloatingUIPlacement)(align, position, isRtl);
|
16
|
+
if (placement) {
|
17
|
+
acc.push(placement);
|
18
|
+
}
|
19
|
+
return acc;
|
20
|
+
}, []);
|
21
|
+
return (0, _dom.flip)({
|
22
|
+
...hasScrollableElement && {
|
23
|
+
boundary: 'clippingAncestors'
|
24
|
+
},
|
25
|
+
...flipBoundary && {
|
26
|
+
altBoundary: true,
|
27
|
+
boundary: (0, _index.getBoundary)(container, flipBoundary)
|
28
|
+
},
|
29
|
+
fallbackStrategy: 'bestFit',
|
30
|
+
...fallbackPlacements.length && {
|
31
|
+
fallbackPlacements
|
32
|
+
}
|
33
|
+
});
|
34
|
+
} //# sourceMappingURL=flip.js.map
|
35
|
+
|
43
36
|
//# sourceMappingURL=flip.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/middleware/flip.js"],"sourcesContent":["import { flip as baseFlip } from '@floating-ui/dom';\nimport { getBoundary, resolvePositioningShorthand, toFloatingUIPlacement } from '../utils/index';\nexport function flip(options) {\n const {\n hasScrollableElement,\n flipBoundary,\n container,\n fallbackPositions = [],\n isRtl\n } = options;\n const fallbackPlacements = fallbackPositions.reduce((acc, shorthand) => {\n const {\n position,\n align\n } = resolvePositioningShorthand(shorthand);\n const placement = toFloatingUIPlacement(align, position, isRtl);\n if (placement) {\n acc.push(placement);\n }\n return acc;\n }, []);\n return baseFlip({\n ...(hasScrollableElement && {\n boundary: 'clippingAncestors'\n }),\n ...(flipBoundary && {\n altBoundary: true,\n boundary: getBoundary(container, flipBoundary)\n }),\n fallbackStrategy: 'bestFit',\n ...(fallbackPlacements.length && {\n fallbackPlacements\n })\n });\n}\n//# sourceMappingURL=flip.js.map"],"names":["flip","options","hasScrollableElement","flipBoundary","container","fallbackPositions","isRtl","fallbackPlacements","reduce","acc","shorthand","position","align","resolvePositioningShorthand","placement","toFloatingUIPlacement","push","baseFlip","boundary","altBoundary","getBoundary","fallbackStrategy","length"],"mappings":";;;;+BAEgBA;;aAAAA;;qBAFiB;uBAC+C;AACzE,SAASA,KAAKC,OAAO,EAAE;IAC5B,MAAM,EACJC,qBAAoB,EACpBC,aAAY,EACZC,UAAS,EACTC,mBAAoB,EAAE,CAAA,EACtBC,MAAK,EACN,GAAGL;IACJ,MAAMM,qBAAqBF,kBAAkBG,MAAM,CAAC,CAACC,KAAKC,YAAc;QACtE,MAAM,EACJC,SAAQ,EACRC,MAAK,EACN,GAAGC,IAAAA,kCAA2B,EAACH;QAChC,MAAMI,YAAYC,IAAAA,4BAAqB,EAACH,OAAOD,UAAUL;QACzD,IAAIQ,WAAW;YACbL,IAAIO,IAAI,CAACF;QACX,CAAC;QACD,OAAOL;IACT,GAAG,EAAE;IACL,OAAOQ,IAAAA,SAAQ,EAAC;QACd,GAAIf,wBAAwB;YAC1BgB,UAAU;QACZ,CAAC;QACD,GAAIf,gBAAgB;YAClBgB,aAAa,IAAI;YACjBD,UAAUE,IAAAA,kBAAW,EAAChB,WAAWD;QACnC,CAAC;QACDkB,kBAAkB;QAClB,GAAId,mBAAmBe,MAAM,IAAI;YAC/Bf;QACF,CAAC;IACH;AACF,EACA,gCAAgC"}
|
@@ -1,13 +1,14 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
5
4
|
});
|
6
|
-
const
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
6
|
+
_exportStar(require("./coverTarget"), exports);
|
7
|
+
_exportStar(require("./flip"), exports);
|
8
|
+
_exportStar(require("./intersecting"), exports);
|
9
|
+
_exportStar(require("./maxSize"), exports);
|
10
|
+
_exportStar(require("./offset"), exports);
|
11
|
+
_exportStar(require("./shift"), exports);
|
12
|
+
//# sourceMappingURL=index.js.map
|
13
|
+
|
13
14
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/middleware/index.js"],"sourcesContent":["export * from './coverTarget';\nexport * from './flip';\nexport * from './intersecting';\nexport * from './maxSize';\nexport * from './offset';\nexport * from './shift';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
|
@@ -1,28 +1,30 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "intersecting", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>intersecting
|
5
8
|
});
|
6
|
-
|
7
|
-
const dom_1 = /*#__PURE__*/require("@floating-ui/dom");
|
9
|
+
const _dom = require("@floating-ui/dom");
|
8
10
|
function intersecting() {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
11
|
+
return {
|
12
|
+
name: 'intersectionObserver',
|
13
|
+
fn: async (middlewareArguments)=>{
|
14
|
+
const floatingRect = middlewareArguments.rects.floating;
|
15
|
+
const altOverflow = await (0, _dom.detectOverflow)(middlewareArguments, {
|
16
|
+
altBoundary: true
|
17
|
+
});
|
18
|
+
const isIntersectingTop = altOverflow.top < floatingRect.height && altOverflow.top > 0;
|
19
|
+
const isIntersectingBottom = altOverflow.bottom < floatingRect.height && altOverflow.bottom > 0;
|
20
|
+
const isIntersecting = isIntersectingTop || isIntersectingBottom;
|
21
|
+
return {
|
22
|
+
data: {
|
23
|
+
intersecting: isIntersecting
|
24
|
+
}
|
25
|
+
};
|
22
26
|
}
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
}
|
27
|
-
exports.intersecting = intersecting;
|
27
|
+
};
|
28
|
+
} //# sourceMappingURL=intersecting.js.map
|
29
|
+
|
28
30
|
//# sourceMappingURL=intersecting.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/middleware/intersecting.js"],"sourcesContent":["import { detectOverflow } from '@floating-ui/dom';\nexport function intersecting() {\n return {\n name: 'intersectionObserver',\n fn: async middlewareArguments => {\n const floatingRect = middlewareArguments.rects.floating;\n const altOverflow = await detectOverflow(middlewareArguments, {\n altBoundary: true\n });\n const isIntersectingTop = altOverflow.top < floatingRect.height && altOverflow.top > 0;\n const isIntersectingBottom = altOverflow.bottom < floatingRect.height && altOverflow.bottom > 0;\n const isIntersecting = isIntersectingTop || isIntersectingBottom;\n return {\n data: {\n intersecting: isIntersecting\n }\n };\n }\n };\n}\n//# sourceMappingURL=intersecting.js.map"],"names":["intersecting","name","fn","middlewareArguments","floatingRect","rects","floating","altOverflow","detectOverflow","altBoundary","isIntersectingTop","top","height","isIntersectingBottom","bottom","isIntersecting","data"],"mappings":";;;;+BACgBA;;aAAAA;;qBADe;AACxB,SAASA,eAAe;IAC7B,OAAO;QACLC,MAAM;QACNC,IAAI,OAAMC,sBAAuB;YAC/B,MAAMC,eAAeD,oBAAoBE,KAAK,CAACC,QAAQ;YACvD,MAAMC,cAAc,MAAMC,IAAAA,mBAAc,EAACL,qBAAqB;gBAC5DM,aAAa,IAAI;YACnB;YACA,MAAMC,oBAAoBH,YAAYI,GAAG,GAAGP,aAAaQ,MAAM,IAAIL,YAAYI,GAAG,GAAG;YACrF,MAAME,uBAAuBN,YAAYO,MAAM,GAAGV,aAAaQ,MAAM,IAAIL,YAAYO,MAAM,GAAG;YAC9F,MAAMC,iBAAiBL,qBAAqBG;YAC5C,OAAO;gBACLG,MAAM;oBACJhB,cAAce;gBAChB;YACF;QACF;IACF;AACF,EACA,wCAAwC"}
|
@@ -1,45 +1,39 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "maxSize", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>maxSize
|
5
8
|
});
|
6
|
-
|
7
|
-
const
|
8
|
-
const getBoundary_1 = /*#__PURE__*/require("../utils/getBoundary");
|
9
|
+
const _dom = require("@floating-ui/dom");
|
10
|
+
const _getBoundary = require("../utils/getBoundary");
|
9
11
|
function maxSize(autoSize, options) {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
boxSizing: 'border-box',
|
38
|
-
overflowX: 'auto'
|
39
|
-
});
|
40
|
-
}
|
41
|
-
}
|
42
|
-
});
|
43
|
-
}
|
44
|
-
exports.maxSize = maxSize;
|
12
|
+
const { container , overflowBoundary } = options;
|
13
|
+
return (0, _dom.size)({
|
14
|
+
...overflowBoundary && {
|
15
|
+
altBoundary: true,
|
16
|
+
boundary: (0, _getBoundary.getBoundary)(container, overflowBoundary)
|
17
|
+
},
|
18
|
+
apply ({ availableHeight , availableWidth , elements , rects }) {
|
19
|
+
const applyMaxWidth = autoSize === 'always' || autoSize === 'width-always' || rects.floating.width > availableWidth && (autoSize === true || autoSize === 'width');
|
20
|
+
const applyMaxHeight = autoSize === 'always' || autoSize === 'height-always' || rects.floating.height > availableHeight && (autoSize === true || autoSize === 'height');
|
21
|
+
if (applyMaxHeight) {
|
22
|
+
Object.assign(elements.floating.style, {
|
23
|
+
maxHeight: `${availableHeight}px`,
|
24
|
+
boxSizing: 'border-box',
|
25
|
+
overflowY: 'auto'
|
26
|
+
});
|
27
|
+
}
|
28
|
+
if (applyMaxWidth) {
|
29
|
+
Object.assign(elements.floating.style, {
|
30
|
+
maxWidth: `${availableWidth}px`,
|
31
|
+
boxSizing: 'border-box',
|
32
|
+
overflowX: 'auto'
|
33
|
+
});
|
34
|
+
}
|
35
|
+
}
|
36
|
+
});
|
37
|
+
} //# sourceMappingURL=maxSize.js.map
|
38
|
+
|
45
39
|
//# sourceMappingURL=maxSize.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/middleware/maxSize.js"],"sourcesContent":["import { size } from '@floating-ui/dom';\nimport { getBoundary } from '../utils/getBoundary';\nexport function maxSize(autoSize, options) {\n const {\n container,\n overflowBoundary\n } = options;\n return size({\n ...(overflowBoundary && {\n altBoundary: true,\n boundary: getBoundary(container, overflowBoundary)\n }),\n apply({\n availableHeight,\n availableWidth,\n elements,\n rects\n }) {\n const applyMaxWidth = autoSize === 'always' || autoSize === 'width-always' || rects.floating.width > availableWidth && (autoSize === true || autoSize === 'width');\n const applyMaxHeight = autoSize === 'always' || autoSize === 'height-always' || rects.floating.height > availableHeight && (autoSize === true || autoSize === 'height');\n if (applyMaxHeight) {\n Object.assign(elements.floating.style, {\n maxHeight: `${availableHeight}px`,\n boxSizing: 'border-box',\n overflowY: 'auto'\n });\n }\n if (applyMaxWidth) {\n Object.assign(elements.floating.style, {\n maxWidth: `${availableWidth}px`,\n boxSizing: 'border-box',\n overflowX: 'auto'\n });\n }\n }\n });\n}\n//# sourceMappingURL=maxSize.js.map"],"names":["maxSize","autoSize","options","container","overflowBoundary","size","altBoundary","boundary","getBoundary","apply","availableHeight","availableWidth","elements","rects","applyMaxWidth","floating","width","applyMaxHeight","height","Object","assign","style","maxHeight","boxSizing","overflowY","maxWidth","overflowX"],"mappings":";;;;+BAEgBA;;aAAAA;;qBAFK;6BACO;AACrB,SAASA,QAAQC,QAAQ,EAAEC,OAAO,EAAE;IACzC,MAAM,EACJC,UAAS,EACTC,iBAAgB,EACjB,GAAGF;IACJ,OAAOG,IAAAA,SAAI,EAAC;QACV,GAAID,oBAAoB;YACtBE,aAAa,IAAI;YACjBC,UAAUC,IAAAA,wBAAW,EAACL,WAAWC;QACnC,CAAC;QACDK,OAAM,EACJC,gBAAe,EACfC,eAAc,EACdC,SAAQ,EACRC,MAAK,EACN,EAAE;YACD,MAAMC,gBAAgBb,aAAa,YAAYA,aAAa,kBAAkBY,MAAME,QAAQ,CAACC,KAAK,GAAGL,kBAAmBV,CAAAA,aAAa,IAAI,IAAIA,aAAa,OAAM;YAChK,MAAMgB,iBAAiBhB,aAAa,YAAYA,aAAa,mBAAmBY,MAAME,QAAQ,CAACG,MAAM,GAAGR,mBAAoBT,CAAAA,aAAa,IAAI,IAAIA,aAAa,QAAO;YACrK,IAAIgB,gBAAgB;gBAClBE,OAAOC,MAAM,CAACR,SAASG,QAAQ,CAACM,KAAK,EAAE;oBACrCC,WAAW,CAAC,EAAEZ,gBAAgB,EAAE,CAAC;oBACjCa,WAAW;oBACXC,WAAW;gBACb;YACF,CAAC;YACD,IAAIV,eAAe;gBACjBK,OAAOC,MAAM,CAACR,SAASG,QAAQ,CAACM,KAAK,EAAE;oBACrCI,UAAU,CAAC,EAAEd,eAAe,EAAE,CAAC;oBAC/BY,WAAW;oBACXG,WAAW;gBACb;YACF,CAAC;QACH;IACF;AACF,EACA,mCAAmC"}
|
@@ -1,17 +1,16 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "offset", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>offset
|
5
8
|
});
|
6
|
-
|
7
|
-
const
|
8
|
-
const getFloatingUIOffset_1 = /*#__PURE__*/require("../utils/getFloatingUIOffset");
|
9
|
-
/**
|
10
|
-
* Wraps floating UI offset middleware to to transform offset value
|
11
|
-
*/
|
9
|
+
const _dom = require("@floating-ui/dom");
|
10
|
+
const _getFloatingUIOffset = require("../utils/getFloatingUIOffset");
|
12
11
|
function offset(offsetValue) {
|
13
|
-
|
14
|
-
|
15
|
-
}
|
16
|
-
|
12
|
+
const floatingUIOffset = (0, _getFloatingUIOffset.getFloatingUIOffset)(offsetValue);
|
13
|
+
return (0, _dom.offset)(floatingUIOffset);
|
14
|
+
} //# sourceMappingURL=offset.js.map
|
15
|
+
|
17
16
|
//# sourceMappingURL=offset.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/middleware/offset.js"],"sourcesContent":["import { offset as baseOffset } from '@floating-ui/dom';\nimport { getFloatingUIOffset } from '../utils/getFloatingUIOffset';\n/**\n * Wraps floating UI offset middleware to to transform offset value\n */\nexport function offset(offsetValue) {\n const floatingUIOffset = getFloatingUIOffset(offsetValue);\n return baseOffset(floatingUIOffset);\n}\n//# sourceMappingURL=offset.js.map"],"names":["offset","offsetValue","floatingUIOffset","getFloatingUIOffset","baseOffset"],"mappings":";;;;+BAKgBA;;aAAAA;;qBALqB;qCACD;AAI7B,SAASA,OAAOC,WAAW,EAAE;IAClC,MAAMC,mBAAmBC,IAAAA,wCAAmB,EAACF;IAC7C,OAAOG,IAAAA,WAAU,EAACF;AACpB,EACA,kCAAkC"}
|
@@ -1,42 +1,34 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "shift", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>shift
|
5
8
|
});
|
6
|
-
|
7
|
-
const
|
8
|
-
const index_1 = /*#__PURE__*/require("../utils/index");
|
9
|
-
/**
|
10
|
-
* Wraps the floating UI shift middleware for easier usage of our options
|
11
|
-
*/
|
9
|
+
const _dom = require("@floating-ui/dom");
|
10
|
+
const _index = require("../utils/index");
|
12
11
|
function shift(options) {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
...(overflowBoundary && {
|
36
|
-
altBoundary: true,
|
37
|
-
boundary: index_1.getBoundary(container, overflowBoundary)
|
38
|
-
})
|
39
|
-
});
|
40
|
-
}
|
41
|
-
exports.shift = shift;
|
12
|
+
const { hasScrollableElement , disableTether , overflowBoundary , container , overflowBoundaryPadding , isRtl } = options;
|
13
|
+
return (0, _dom.shift)({
|
14
|
+
...hasScrollableElement && {
|
15
|
+
boundary: 'clippingAncestors'
|
16
|
+
},
|
17
|
+
...disableTether && {
|
18
|
+
crossAxis: disableTether === 'all',
|
19
|
+
limiter: (0, _dom.limitShift)({
|
20
|
+
crossAxis: disableTether !== 'all',
|
21
|
+
mainAxis: false
|
22
|
+
})
|
23
|
+
},
|
24
|
+
...overflowBoundaryPadding && {
|
25
|
+
padding: (0, _index.toFloatingUIPadding)(overflowBoundaryPadding, isRtl)
|
26
|
+
},
|
27
|
+
...overflowBoundary && {
|
28
|
+
altBoundary: true,
|
29
|
+
boundary: (0, _index.getBoundary)(container, overflowBoundary)
|
30
|
+
}
|
31
|
+
});
|
32
|
+
} //# sourceMappingURL=shift.js.map
|
33
|
+
|
42
34
|
//# sourceMappingURL=shift.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/middleware/shift.js"],"sourcesContent":["import { shift as baseShift, limitShift } from '@floating-ui/dom';\nimport { getBoundary, toFloatingUIPadding } from '../utils/index';\n/**\n * Wraps the floating UI shift middleware for easier usage of our options\n */\nexport function shift(options) {\n const {\n hasScrollableElement,\n disableTether,\n overflowBoundary,\n container,\n overflowBoundaryPadding,\n isRtl\n } = options;\n return baseShift({\n ...(hasScrollableElement && {\n boundary: 'clippingAncestors'\n }),\n ...(disableTether && {\n crossAxis: disableTether === 'all',\n limiter: limitShift({\n crossAxis: disableTether !== 'all',\n mainAxis: false\n })\n }),\n ...(overflowBoundaryPadding && {\n padding: toFloatingUIPadding(overflowBoundaryPadding, isRtl)\n }),\n ...(overflowBoundary && {\n altBoundary: true,\n boundary: getBoundary(container, overflowBoundary)\n })\n });\n}\n//# sourceMappingURL=shift.js.map"],"names":["shift","options","hasScrollableElement","disableTether","overflowBoundary","container","overflowBoundaryPadding","isRtl","baseShift","boundary","crossAxis","limiter","limitShift","mainAxis","padding","toFloatingUIPadding","altBoundary","getBoundary"],"mappings":";;;;+BAKgBA;;aAAAA;;qBAL+B;uBACE;AAI1C,SAASA,MAAMC,OAAO,EAAE;IAC7B,MAAM,EACJC,qBAAoB,EACpBC,cAAa,EACbC,iBAAgB,EAChBC,UAAS,EACTC,wBAAuB,EACvBC,MAAK,EACN,GAAGN;IACJ,OAAOO,IAAAA,UAAS,EAAC;QACf,GAAIN,wBAAwB;YAC1BO,UAAU;QACZ,CAAC;QACD,GAAIN,iBAAiB;YACnBO,WAAWP,kBAAkB;YAC7BQ,SAASC,IAAAA,eAAU,EAAC;gBAClBF,WAAWP,kBAAkB;gBAC7BU,UAAU,KAAK;YACjB;QACF,CAAC;QACD,GAAIP,2BAA2B;YAC7BQ,SAASC,IAAAA,0BAAmB,EAACT,yBAAyBC;QACxD,CAAC;QACD,GAAIH,oBAAoB;YACtBY,aAAa,IAAI;YACjBP,UAAUQ,IAAAA,kBAAW,EAACZ,WAAWD;QACnC,CAAC;IACH;AACF,EACA,iCAAiC"}
|
package/lib-commonjs/types.js
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
5
4
|
});
|
5
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
6
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
7
|
+
//# sourceMappingURL=types.js.map
|
8
|
+
|
6
9
|
//# sourceMappingURL=types.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../lib/types.js"],"sourcesContent":["import * as React from 'react';\n//# sourceMappingURL=types.js.map"],"names":[],"mappings":";;;;;6DAAuB;CACvB,iCAAiC"}
|