@fluentui/react-positioning 0.0.0-nightly-20230222-0421.1 → 0.0.0-nightly-20230223-2115.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 +33 -0
- package/CHANGELOG.json +24 -9
- package/CHANGELOG.md +16 -7
- package/lib/constants.js.map +1 -1
- package/lib/createArrowStyles.js.map +1 -1
- package/lib/createPositionManager.js +7 -6
- 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 +7 -6
- 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 +21 -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 +8 -7
- 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 +2 -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 -116
- 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 +20 -22
- 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 +35 -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 +195 -161
- 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 +24 -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 +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 +19 -23
- 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 +6 -6
|
@@ -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,27 +1,25 @@
|
|
|
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
|
-
fallbackStrategy: 'bestFit'
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
exports.flip = flip;
|
|
12
|
+
const { hasScrollableElement , flipBoundary , container } = options;
|
|
13
|
+
return (0, _dom.flip)({
|
|
14
|
+
...hasScrollableElement && {
|
|
15
|
+
boundary: 'clippingAncestors'
|
|
16
|
+
},
|
|
17
|
+
...flipBoundary && {
|
|
18
|
+
altBoundary: true,
|
|
19
|
+
boundary: (0, _index.getBoundary)(container, flipBoundary)
|
|
20
|
+
},
|
|
21
|
+
fallbackStrategy: 'bestFit'
|
|
22
|
+
});
|
|
23
|
+
} //# sourceMappingURL=flip.js.map
|
|
24
|
+
|
|
27
25
|
//# 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 } from '../utils/index';\nexport function flip(options) {\n const {\n hasScrollableElement,\n flipBoundary,\n container\n } = options;\n return baseFlip({\n ...(hasScrollableElement && {\n boundary: 'clippingAncestors'\n }),\n ...(flipBoundary && {\n altBoundary: true,\n boundary: getBoundary(container, flipBoundary)\n }),\n fallbackStrategy: 'bestFit'\n });\n}\n//# sourceMappingURL=flip.js.map"],"names":["flip","options","hasScrollableElement","flipBoundary","container","baseFlip","boundary","altBoundary","getBoundary","fallbackStrategy"],"mappings":";;;;+BAEgBA;;aAAAA;;qBAFiB;uBACL;AACrB,SAASA,KAAKC,OAAO,EAAE;IAC5B,MAAM,EACJC,qBAAoB,EACpBC,aAAY,EACZC,UAAS,EACV,GAAGH;IACJ,OAAOI,IAAAA,SAAQ,EAAC;QACd,GAAIH,wBAAwB;YAC1BI,UAAU;QACZ,CAAC;QACD,GAAIH,gBAAgB;YAClBI,aAAa,IAAI;YACjBD,UAAUE,IAAAA,kBAAW,EAACJ,WAAWD;QACnC,CAAC;QACDM,kBAAkB;IACpB;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,40 @@
|
|
|
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
|
-
|
|
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 (param) {
|
|
19
|
+
let { availableHeight , availableWidth , elements , rects } = param;
|
|
20
|
+
const applyMaxWidth = autoSize === 'always' || autoSize === 'width-always' || rects.floating.width > availableWidth && (autoSize === true || autoSize === 'width');
|
|
21
|
+
const applyMaxHeight = autoSize === 'always' || autoSize === 'height-always' || rects.floating.height > availableHeight && (autoSize === true || autoSize === 'height');
|
|
22
|
+
if (applyMaxHeight) {
|
|
23
|
+
Object.assign(elements.floating.style, {
|
|
24
|
+
maxHeight: `${availableHeight}px`,
|
|
25
|
+
boxSizing: 'border-box',
|
|
26
|
+
overflowY: 'auto'
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
if (applyMaxWidth) {
|
|
30
|
+
Object.assign(elements.floating.style, {
|
|
31
|
+
maxWidth: `${availableWidth}px`,
|
|
32
|
+
boxSizing: 'border-box',
|
|
33
|
+
overflowX: 'auto'
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
} //# sourceMappingURL=maxSize.js.map
|
|
39
|
+
|
|
45
40
|
//# 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(param) {\n let {\n availableHeight,\n availableWidth,\n elements,\n rects\n } = param;\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","param","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,OAAMC,KAAK,EAAE;YACX,IAAI,EACFC,gBAAe,EACfC,eAAc,EACdC,SAAQ,EACRC,MAAK,EACN,GAAGJ;YACJ,MAAMK,gBAAgBd,aAAa,YAAYA,aAAa,kBAAkBa,MAAME,QAAQ,CAACC,KAAK,GAAGL,kBAAmBX,CAAAA,aAAa,IAAI,IAAIA,aAAa,OAAM;YAChK,MAAMiB,iBAAiBjB,aAAa,YAAYA,aAAa,mBAAmBa,MAAME,QAAQ,CAACG,MAAM,GAAGR,mBAAoBV,CAAAA,aAAa,IAAI,IAAIA,aAAa,QAAO;YACrK,IAAIiB,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"}
|