@fluentui/react-positioning 0.0.0-nightly-20230316-0427.1 → 0.0.0-nightly-20230317-1454.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.swcrc +39 -0
- package/CHANGELOG.json +24 -9
- package/CHANGELOG.md +16 -7
- package/lib/constants.js +4 -4
- package/lib/constants.js.map +1 -1
- package/lib/createArrowStyles.js +19 -19
- package/lib/createArrowStyles.js.map +1 -1
- package/lib/createPositionManager.js +13 -13
- package/lib/createPositionManager.js.map +1 -1
- package/lib/createVirtualElementFromClick.js +1 -2
- package/lib/createVirtualElementFromClick.js.map +1 -1
- package/lib/index.js +5 -5
- package/lib/index.js.map +1 -1
- package/lib/middleware/coverTarget.js +6 -6
- package/lib/middleware/coverTarget.js.map +1 -1
- package/lib/middleware/flip.js +4 -4
- package/lib/middleware/flip.js.map +1 -1
- package/lib/middleware/index.js +6 -6
- package/lib/middleware/index.js.map +1 -1
- package/lib/middleware/intersecting.js +2 -2
- package/lib/middleware/intersecting.js.map +1 -1
- package/lib/middleware/maxSize.js +8 -8
- package/lib/middleware/maxSize.js.map +1 -1
- package/lib/middleware/offset.js +2 -2
- package/lib/middleware/offset.js.map +1 -1
- package/lib/middleware/shift.js +5 -5
- 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 +20 -26
- package/lib/usePositioning.js.map +1 -1
- package/lib/usePositioningMouseTarget.js +4 -4
- 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 +10 -10
- package/lib/utils/fromFloatingUIPlacement.js.map +1 -1
- package/lib/utils/getBoundary.js +8 -8
- package/lib/utils/getBoundary.js.map +1 -1
- package/lib/utils/getFloatingUIOffset.js +2 -2
- package/lib/utils/getFloatingUIOffset.js.map +1 -1
- package/lib/utils/getReactFiberFromNode.js +3 -2
- package/lib/utils/getReactFiberFromNode.js.map +1 -1
- package/lib/utils/getScrollParent.js +7 -10
- package/lib/utils/getScrollParent.js.map +1 -1
- package/lib/utils/hasAutoFocusFilter.js +3 -4
- package/lib/utils/hasAutoFocusFilter.js.map +1 -1
- package/lib/utils/index.js +15 -15
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/mergeArrowOffset.js +6 -8
- package/lib/utils/mergeArrowOffset.js.map +1 -1
- package/lib/utils/parseFloatingUIPlacement.js +2 -3
- package/lib/utils/parseFloatingUIPlacement.js.map +1 -1
- package/lib/utils/resolvePositioningShorthand.js +33 -33
- package/lib/utils/resolvePositioningShorthand.js.map +1 -1
- package/lib/utils/toFloatingUIPadding.js +3 -3
- package/lib/utils/toFloatingUIPadding.js.map +1 -1
- package/lib/utils/toFloatingUIPlacement.js +11 -11
- package/lib/utils/toFloatingUIPlacement.js.map +1 -1
- package/lib/utils/toggleScrollListener.js +4 -4
- package/lib/utils/toggleScrollListener.js.map +1 -1
- package/lib/utils/useCallbackRef.js +2 -2
- 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 +7 -8
- 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 +192 -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 +50 -56
- package/lib-commonjs/utils/getScrollParent.js.map +1 -1
- package/lib-commonjs/utils/hasAutoFocusFilter.js +17 -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 +32 -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 +36 -45
- package/lib-commonjs/utils/writeContainerupdates.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createVirtualElementFromClick = void 0;
|
|
7
1
|
/**
|
|
8
2
|
* Creates a virtual element based on the position of a click event
|
|
9
3
|
* Can be used as a target for popper in scenarios such as context menus
|
|
10
|
-
*/
|
|
4
|
+
*/ "use strict";
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "createVirtualElementFromClick", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: ()=>createVirtualElementFromClick
|
|
11
|
+
});
|
|
11
12
|
function createVirtualElementFromClick(nativeEvent) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
const left = nativeEvent.clientX;
|
|
14
|
+
const top = nativeEvent.clientY;
|
|
15
|
+
const right = left + 1;
|
|
16
|
+
const bottom = top + 1;
|
|
17
|
+
function getBoundingClientRect() {
|
|
18
|
+
return {
|
|
19
|
+
left,
|
|
20
|
+
top,
|
|
21
|
+
right,
|
|
22
|
+
bottom,
|
|
23
|
+
x: left,
|
|
24
|
+
y: top,
|
|
25
|
+
height: 1,
|
|
26
|
+
width: 1
|
|
27
|
+
};
|
|
28
|
+
}
|
|
17
29
|
return {
|
|
18
|
-
|
|
19
|
-
top,
|
|
20
|
-
right,
|
|
21
|
-
bottom,
|
|
22
|
-
x: left,
|
|
23
|
-
y: top,
|
|
24
|
-
height: 1,
|
|
25
|
-
width: 1
|
|
30
|
+
getBoundingClientRect
|
|
26
31
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
getBoundingClientRect
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
exports.createVirtualElementFromClick = createVirtualElementFromClick;
|
|
32
|
+
} //# sourceMappingURL=createVirtualElementFromClick.js.map
|
|
33
|
+
|
|
33
34
|
//# sourceMappingURL=createVirtualElementFromClick.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../lib/createVirtualElementFromClick.js"],"sourcesContent":["/**\n * Creates a virtual element based on the position of a click event\n * Can be used as a target for popper in scenarios such as context menus\n */export function createVirtualElementFromClick(nativeEvent) {\n const left = nativeEvent.clientX;\n const top = nativeEvent.clientY;\n const right = left + 1;\n const bottom = top + 1;\n function getBoundingClientRect() {\n return {\n left,\n top,\n right,\n bottom,\n x: left,\n y: top,\n height: 1,\n width: 1\n };\n }\n return {\n getBoundingClientRect\n };\n}\n//# sourceMappingURL=createVirtualElementFromClick.js.map"],"names":["createVirtualElementFromClick","nativeEvent","left","clientX","top","clientY","right","bottom","getBoundingClientRect","x","y","height","width"],"mappings":"AAAA;;;CAGC;;;;+BAAkBA;;aAAAA;;AAAT,SAASA,8BAA8BC,WAAW,EAAE;IAC5D,MAAMC,OAAOD,YAAYE,OAAO;IAChC,MAAMC,MAAMH,YAAYI,OAAO;IAC/B,MAAMC,QAAQJ,OAAO;IACrB,MAAMK,SAASH,MAAM;IACrB,SAASI,wBAAwB;QAC/B,OAAO;YACLN;YACAE;YACAE;YACAC;YACAE,GAAGP;YACHQ,GAAGN;YACHO,QAAQ;YACRC,OAAO;QACT;IACF;IACA,OAAO;QACLJ;IACF;AACF,EACA,yDAAyD"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -1,54 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Object.defineProperty(exports, "usePositioning", {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
get: function () {
|
|
31
|
-
return usePositioning_1.usePositioning;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
var usePositioningMouseTarget_1 = /*#__PURE__*/require("./usePositioningMouseTarget");
|
|
35
|
-
Object.defineProperty(exports, "usePositioningMouseTarget", {
|
|
36
|
-
enumerable: true,
|
|
37
|
-
get: function () {
|
|
38
|
-
return usePositioningMouseTarget_1.usePositioningMouseTarget;
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
var index_1 = /*#__PURE__*/require("./utils/index");
|
|
42
|
-
Object.defineProperty(exports, "resolvePositioningShorthand", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function () {
|
|
45
|
-
return index_1.resolvePositioningShorthand;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "mergeArrowOffset", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function () {
|
|
51
|
-
return index_1.mergeArrowOffset;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
createVirtualElementFromClick: ()=>_createVirtualElementFromClick.createVirtualElementFromClick,
|
|
13
|
+
createArrowHeightStyles: ()=>_createArrowStyles.createArrowHeightStyles,
|
|
14
|
+
createArrowStyles: ()=>_createArrowStyles.createArrowStyles,
|
|
15
|
+
usePositioning: ()=>_usePositioning.usePositioning,
|
|
16
|
+
usePositioningMouseTarget: ()=>_usePositioningMouseTarget.usePositioningMouseTarget,
|
|
17
|
+
resolvePositioningShorthand: ()=>_index.resolvePositioningShorthand,
|
|
18
|
+
mergeArrowOffset: ()=>_index.mergeArrowOffset
|
|
19
|
+
});
|
|
20
|
+
const _createVirtualElementFromClick = require("./createVirtualElementFromClick");
|
|
21
|
+
const _createArrowStyles = require("./createArrowStyles");
|
|
22
|
+
const _usePositioning = require("./usePositioning");
|
|
23
|
+
const _usePositioningMouseTarget = require("./usePositioningMouseTarget");
|
|
24
|
+
const _index = require("./utils/index");
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
26
|
+
|
|
54
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -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"}
|