@fluentui/react-positioning 9.0.0-alpha.6 → 9.0.0-alpha.60
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +1116 -1
- package/CHANGELOG.md +520 -2
- package/dist/react-positioning.d.ts +72 -27
- package/lib/createVirtualElementFromClick.d.ts +6 -0
- package/lib/createVirtualElementFromClick.js +24 -0
- package/lib/createVirtualElementFromClick.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/types.d.ts +22 -27
- package/lib/types.js +1 -0
- package/lib/types.js.map +1 -1
- package/lib/usePopper.d.ts +21 -1
- package/lib/usePopper.js +67 -29
- package/lib/usePopper.js.map +1 -1
- package/lib/usePopperMouseTarget.d.ts +11 -0
- package/lib/usePopperMouseTarget.js +34 -0
- package/lib/usePopperMouseTarget.js.map +1 -0
- package/lib/utils/getBasePlacement.d.ts +8 -0
- package/lib/utils/getBasePlacement.js +10 -0
- package/lib/utils/getBasePlacement.js.map +1 -0
- package/lib/utils/getBoundary.d.ts +1 -1
- package/lib/utils/getBoundary.js +2 -3
- package/lib/utils/getBoundary.js.map +1 -1
- package/lib/utils/getReactFiberFromNode.js.map +1 -1
- package/lib/utils/getScrollParent.js.map +1 -1
- package/lib/utils/index.d.ts +5 -3
- package/lib/utils/index.js +5 -3
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/mergeArrowOffset.d.ts +10 -0
- package/lib/utils/mergeArrowOffset.js +37 -0
- package/lib/utils/mergeArrowOffset.js.map +1 -0
- package/lib/utils/positioningHelper.d.ts +2 -2
- package/lib/utils/positioningHelper.js.map +1 -1
- package/lib/utils/resolvePositioningShorthand.d.ts +2 -0
- package/lib/utils/resolvePositioningShorthand.js +25 -0
- package/lib/utils/resolvePositioningShorthand.js.map +1 -0
- package/lib/utils/useCallbackRef.js.map +1 -1
- package/lib-commonjs/createVirtualElementFromClick.d.ts +6 -0
- package/lib-commonjs/createVirtualElementFromClick.js +28 -0
- package/lib-commonjs/createVirtualElementFromClick.js.map +1 -0
- package/lib-commonjs/index.d.ts +3 -0
- package/lib-commonjs/index.js +7 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/types.d.ts +22 -27
- package/lib-commonjs/types.js.map +1 -1
- package/lib-commonjs/usePopper.d.ts +21 -1
- package/lib-commonjs/usePopper.js +67 -28
- package/lib-commonjs/usePopper.js.map +1 -1
- package/lib-commonjs/usePopperMouseTarget.d.ts +11 -0
- package/lib-commonjs/usePopperMouseTarget.js +38 -0
- package/lib-commonjs/usePopperMouseTarget.js.map +1 -0
- package/lib-commonjs/utils/getBasePlacement.d.ts +8 -0
- package/lib-commonjs/utils/getBasePlacement.js +14 -0
- package/lib-commonjs/utils/getBasePlacement.js.map +1 -0
- package/lib-commonjs/utils/getBoundary.d.ts +1 -1
- package/lib-commonjs/utils/getBoundary.js +3 -3
- package/lib-commonjs/utils/getBoundary.js.map +1 -1
- package/lib-commonjs/utils/getReactFiberFromNode.js +1 -0
- package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
- package/lib-commonjs/utils/getScrollParent.js +5 -2
- package/lib-commonjs/utils/getScrollParent.js.map +1 -1
- package/lib-commonjs/utils/index.d.ts +5 -3
- package/lib-commonjs/utils/index.js +5 -3
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/mergeArrowOffset.d.ts +10 -0
- package/lib-commonjs/utils/mergeArrowOffset.js +41 -0
- package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -0
- package/lib-commonjs/utils/positioningHelper.d.ts +2 -2
- package/lib-commonjs/utils/positioningHelper.js +5 -2
- package/lib-commonjs/utils/positioningHelper.js.map +1 -1
- package/lib-commonjs/utils/resolvePositioningShorthand.d.ts +2 -0
- package/lib-commonjs/utils/resolvePositioningShorthand.js +29 -0
- package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -0
- package/lib-commonjs/utils/useCallbackRef.js +1 -0
- package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
- package/package.json +11 -8
- package/NOTICE.txt +0 -0
- package/config/api-extractor.json +0 -3
- package/etc/react-positioning.api.md +0 -69
- package/just.config.ts +0 -3
- package/lib/utils/isBrowser.d.ts +0 -1
- package/lib/utils/isBrowser.js +0 -4
- package/lib/utils/isBrowser.js.map +0 -1
- package/lib-amd/index.d.ts +0 -2
- package/lib-amd/index.js +0 -6
- package/lib-amd/index.js.map +0 -1
- package/lib-amd/types.d.ts +0 -73
- package/lib-amd/types.js +0 -5
- package/lib-amd/types.js.map +0 -1
- package/lib-amd/usePopper.d.ts +0 -15
- package/lib-amd/usePopper.js +0 -280
- package/lib-amd/usePopper.js.map +0 -1
- package/lib-amd/utils/getBoundary.d.ts +0 -6
- package/lib-amd/utils/getBoundary.js +0 -23
- package/lib-amd/utils/getBoundary.js.map +0 -1
- package/lib-amd/utils/getReactFiberFromNode.d.ts +0 -109
- package/lib-amd/utils/getReactFiberFromNode.js +0 -47
- package/lib-amd/utils/getReactFiberFromNode.js.map +0 -1
- package/lib-amd/utils/getScrollParent.d.ts +0 -12
- package/lib-amd/utils/getScrollParent.js +0 -55
- package/lib-amd/utils/getScrollParent.js.map +0 -1
- package/lib-amd/utils/index.d.ts +0 -6
- package/lib-amd/utils/index.js +0 -11
- package/lib-amd/utils/index.js.map +0 -1
- package/lib-amd/utils/isBrowser.d.ts +0 -1
- package/lib-amd/utils/isBrowser.js +0 -8
- package/lib-amd/utils/isBrowser.js.map +0 -1
- package/lib-amd/utils/positioningHelper.d.ts +0 -7
- package/lib-amd/utils/positioningHelper.js +0 -45
- package/lib-amd/utils/positioningHelper.js.map +0 -1
- package/lib-amd/utils/useCallbackRef.d.ts +0 -19
- package/lib-amd/utils/useCallbackRef.js +0 -54
- package/lib-amd/utils/useCallbackRef.js.map +0 -1
- package/lib-commonjs/utils/isBrowser.d.ts +0 -1
- package/lib-commonjs/utils/isBrowser.js +0 -6
- package/lib-commonjs/utils/isBrowser.js.map +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"mergeArrowOffset.js","sourceRoot":"","sources":["../../src/utils/mergeArrowOffset.ts"],"names":[],"mappings":";;;AAEA;;;;;;;GAOG;AACH,SAAgB,gBAAgB,CAAC,UAAqC,EAAE,WAAmB;IACzF,IAAI,eAAe,GAAG,UAAU,CAAC;IACjC,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;KACzB;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;QAClC,cAAc,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;QAC7C,OAAO,eAAe,CAAC;KACxB;IAED,IAAI,OAAO,eAAe,KAAK,UAAU,EAAE;QACzC,IAAM,cAAY,GAAG,eAAe,CAAC;QACrC,eAAe,GAAG,UAAA,YAAY;YAC5B,IAAM,MAAM,GAAG,cAAY,CAAC,YAAY,CAAC,CAAC;YAC1C,cAAc,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;YACpC,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;KACH;IAED,2BAA2B;IAC3B,OAAO,CAAC,CAAC,EAAE,CAAC,CAAU,CAAC;AACzB,CAAC;AAtBD,4CAsBC;AAED,IAAM,cAAc,GAAG,UAAC,MAA8D,EAAE,WAAmB;IACzG,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE;QACjD,MAAM,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC;KAC1B;SAAM;QACL,MAAM,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC;KACzB;AACH,CAAC,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as PopperJs from '@popperjs/core';
|
2
|
-
import {
|
2
|
+
import type { Offset } from '../types';
|
3
3
|
/**
|
4
4
|
* @see positioninHelper.test.ts for expected placement values
|
5
5
|
*/
|
6
6
|
export declare const getPlacement: (align?: "top" | "bottom" | "start" | "end" | "center" | undefined, position?: "above" | "below" | "before" | "after" | undefined, rtl?: boolean | undefined) => PopperJs.Placement;
|
7
|
-
export declare const applyRtlToOffset: (offset:
|
7
|
+
export declare const applyRtlToOffset: (offset: Offset | undefined) => Offset | undefined;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.applyRtlToOffset = exports.getPlacement = void 0;
|
3
4
|
var getPositionMap = function (rtl) { return ({
|
4
5
|
above: 'top',
|
5
6
|
below: 'bottom',
|
@@ -21,7 +22,7 @@ var shouldAlignToCenter = function (p, a) {
|
|
21
22
|
/**
|
22
23
|
* @see positioninHelper.test.ts for expected placement values
|
23
24
|
*/
|
24
|
-
|
25
|
+
var getPlacement = function (align, position, rtl) {
|
25
26
|
var alignment = shouldAlignToCenter(position, align) ? 'center' : align;
|
26
27
|
var computedPosition = position && getPositionMap(rtl)[position];
|
27
28
|
var computedAlignmnent = alignment && getAlignmentMap(rtl)[alignment];
|
@@ -30,7 +31,8 @@ exports.getPlacement = function (align, position, rtl) {
|
|
30
31
|
}
|
31
32
|
return computedPosition || 'auto';
|
32
33
|
};
|
33
|
-
exports.
|
34
|
+
exports.getPlacement = getPlacement;
|
35
|
+
var applyRtlToOffset = function (offset) {
|
34
36
|
if (typeof offset === 'undefined') {
|
35
37
|
return undefined;
|
36
38
|
}
|
@@ -40,4 +42,5 @@ exports.applyRtlToOffset = function (offset) {
|
|
40
42
|
}
|
41
43
|
return (function (param) { return exports.applyRtlToOffset(offset(param)); });
|
42
44
|
};
|
45
|
+
exports.applyRtlToOffset = applyRtlToOffset;
|
43
46
|
//# sourceMappingURL=positioningHelper.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"positioningHelper.js","sourceRoot":"
|
1
|
+
{"version":3,"file":"positioningHelper.js","sourceRoot":"","sources":["../../src/utils/positioningHelper.ts"],"names":[],"mappings":";;;AAMA,IAAM,cAAc,GAAG,UAAC,GAAa,IAA0C,OAAA,CAAC;IAC9E,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;IAC9B,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;CAC9B,CAAC,EAL6E,CAK7E,CAAC;AAEH,IAAM,eAAe,GAAG,UAAC,GAAa,IAAwC,OAAA,CAAC;IAC7E,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO;IAC5B,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK;IAC1B,GAAG,EAAE,OAAO;IACZ,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,EAAE;CACX,CAAC,EAN4E,CAM5E,CAAC;AAEH,IAAM,mBAAmB,GAAG,UAAC,CAAY,EAAE,CAAa;IACtD,IAAM,oBAAoB,GAAG,CAAC,KAAK,OAAO,IAAI,CAAC,KAAK,OAAO,CAAC;IAC5D,IAAM,iBAAiB,GAAG,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,QAAQ,CAAC;IAExD,OAAO,CAAC,oBAAoB,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAC,oBAAoB,IAAI,CAAC,iBAAiB,CAAC,CAAC;AACtG,CAAC,CAAC;AAEF;;GAEG;AACI,IAAM,YAAY,GAAG,UAAC,KAAiB,EAAE,QAAmB,EAAE,GAAa;IAChF,IAAM,SAAS,GAAG,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;IAE1E,IAAM,gBAAgB,GAAG,QAAQ,IAAI,cAAc,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;IACnE,IAAM,kBAAkB,GAAG,SAAS,IAAI,eAAe,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;IAExE,IAAI,gBAAgB,IAAI,kBAAkB,EAAE;QAC1C,OAAU,gBAAgB,SAAI,kBAA0C,CAAC;KAC1E;IAED,OAAO,gBAAgB,IAAK,MAA6B,CAAC;AAC5D,CAAC,CAAC;AAXW,QAAA,YAAY,gBAWvB;AAEK,IAAM,gBAAgB,GAAG,UAAC,MAA0B;IACzD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACzB,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAE,GAAG,CAAC,CAAC,CAAC;QAE5B,OAAO,MAAM,CAAC;KACf;IAED,OAAO,CAAC,UAAC,KAA0B,IAAK,OAAA,wBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAA/B,CAA+B,CAAmB,CAAC;AAC7F,CAAC,CAAC;AAZW,QAAA,gBAAgB,oBAY3B"}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.resolvePositioningShorthand = void 0;
|
4
|
+
// Look up table for shorthand to avoid parsing strings
|
5
|
+
var shorthandLookup = {
|
6
|
+
above: { position: 'above', align: 'center' },
|
7
|
+
'above-start': { position: 'above', align: 'start' },
|
8
|
+
'above-end': { position: 'above', align: 'end' },
|
9
|
+
below: { position: 'below', align: 'center' },
|
10
|
+
'below-start': { position: 'below', align: 'start' },
|
11
|
+
'below-end': { position: 'below', align: 'end' },
|
12
|
+
before: { position: 'before', align: 'center' },
|
13
|
+
'before-top': { position: 'before', align: 'top' },
|
14
|
+
'before-bottom': { position: 'before', align: 'bottom' },
|
15
|
+
after: { position: 'after', align: 'center' },
|
16
|
+
'after-top': { position: 'after', align: 'top' },
|
17
|
+
'after-bottom': { position: 'after', align: 'bottom' },
|
18
|
+
};
|
19
|
+
function resolvePositioningShorthand(shorthand) {
|
20
|
+
if (shorthand === undefined || shorthand === null) {
|
21
|
+
return {};
|
22
|
+
}
|
23
|
+
if (typeof shorthand === 'string') {
|
24
|
+
return shorthandLookup[shorthand];
|
25
|
+
}
|
26
|
+
return shorthand;
|
27
|
+
}
|
28
|
+
exports.resolvePositioningShorthand = resolvePositioningShorthand;
|
29
|
+
//# sourceMappingURL=resolvePositioningShorthand.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"resolvePositioningShorthand.js","sourceRoot":"","sources":["../../src/utils/resolvePositioningShorthand.ts"],"names":[],"mappings":";;;AAEA,uDAAuD;AACvD,IAAM,eAAe,GAAoF;IACvG,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC7C,aAAa,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IACpD,WAAW,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE;IAChD,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC7C,aAAa,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IACpD,WAAW,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE;IAChD,MAAM,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC/C,YAAY,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE;IAClD,eAAe,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;IACxD,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC7C,WAAW,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE;IAChD,cAAc,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE;CACvD,CAAC;AAEF,SAAgB,2BAA2B,CACzC,SAAkD;IAElD,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,IAAI,EAAE;QACjD,OAAO,EAAE,CAAC;KACX;IAED,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE;QACjC,OAAO,eAAe,CAAC,SAAS,CAAC,CAAC;KACnC;IAED,OAAO,SAAuC,CAAC;AACjD,CAAC;AAZD,kEAYC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useCallbackRef.js","sourceRoot":"
|
1
|
+
{"version":3,"file":"useCallbackRef.js","sourceRoot":"","sources":["../../src/utils/useCallbackRef.ts"],"names":[],"mappings":";;;AAAA,6BAA+B;AAC/B,6DAAsE;AAEtE;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,cAAc,CAC5B,YAAsB,EACtB,QAA2D,EAC3D,kBAA4B;IAE5B,IAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC5B,IAAA,GAAG,GAAI,KAAK,CAAC,QAAQ,CAAC,cAAM,OAAA,CAAC;QAClC,QAAQ;QACR,KAAK,EAAE,YAAY;QACnB,gBAAgB;QAChB,QAAQ,UAAA;QACR,8BAA8B;QAC9B,MAAM,EAAE;YACN,IAAI,OAAO;gBACT,OAAO,GAAG,CAAC,KAAK,CAAC;YACnB,CAAC;YACD,IAAI,OAAO,CAAC,KAAK;gBACf,IAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC;gBAEvB,IAAI,IAAI,KAAK,KAAK,EAAE;oBAClB,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;oBAElB,IAAI,kBAAkB,IAAI,OAAO,CAAC,OAAO,EAAE;wBACzC,OAAO;qBACR;oBAED,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;iBAC3B;YACH,CAAC;SACF;KACF,CAAC,EAxBiC,CAwBjC,CAAC,GAxBO,CAwBN;IAEJ,2CAAyB,CAAC;QACxB,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;IAC1B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,kBAAkB;IAClB,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAExB,OAAO,GAAG,CAAC,MAAM,CAAC;AACpB,CAAC;AAxCD,wCAwCC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-positioning",
|
3
|
-
"version": "9.0.0-alpha.
|
3
|
+
"version": "9.0.0-alpha.60",
|
4
4
|
"description": "A react wrapper around Popper.js for Fluent UI",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -13,16 +13,19 @@
|
|
13
13
|
"license": "MIT",
|
14
14
|
"scripts": {
|
15
15
|
"build": "just-scripts build",
|
16
|
+
"bundle-size": "bundle-size measure",
|
16
17
|
"clean": "just-scripts clean",
|
17
18
|
"code-style": "just-scripts code-style",
|
18
19
|
"just": "just-scripts",
|
19
20
|
"lint": "just-scripts lint",
|
20
|
-
"
|
21
|
-
"
|
22
|
-
"
|
21
|
+
"test": "jest",
|
22
|
+
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
|
23
|
+
"build:local": "tsc -p . --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output dist/react-positioning/src && yarn docs",
|
24
|
+
"storybook": "start-storybook",
|
25
|
+
"start": "yarn storybook"
|
23
26
|
},
|
24
27
|
"devDependencies": {
|
25
|
-
"@fluentui/eslint-plugin": "
|
28
|
+
"@fluentui/eslint-plugin": "*",
|
26
29
|
"@fluentui/scripts": "^1.0.0",
|
27
30
|
"@types/react": "16.9.42",
|
28
31
|
"@types/react-dom": "16.9.10",
|
@@ -30,10 +33,10 @@
|
|
30
33
|
"react-dom": "16.8.6"
|
31
34
|
},
|
32
35
|
"dependencies": {
|
33
|
-
"@fluentui/react-
|
34
|
-
"@fluentui/react-utilities": "
|
36
|
+
"@fluentui/react-shared-contexts": "9.0.0-alpha.25",
|
37
|
+
"@fluentui/react-utilities": "9.0.0-alpha.52",
|
35
38
|
"@popperjs/core": "~2.4.3",
|
36
|
-
"tslib": "^1.
|
39
|
+
"tslib": "^2.1.0"
|
37
40
|
},
|
38
41
|
"peerDependencies": {
|
39
42
|
"@types/react": ">=16.8.0 <18.0.0",
|
package/NOTICE.txt
DELETED
File without changes
|
@@ -1,69 +0,0 @@
|
|
1
|
-
## API Report File for "@fluentui/react-positioning"
|
2
|
-
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
4
|
-
|
5
|
-
```ts
|
6
|
-
|
7
|
-
import * as PopperJs from '@popperjs/core';
|
8
|
-
import * as React from 'react';
|
9
|
-
|
10
|
-
// @public (undocumented)
|
11
|
-
export type Alignment = 'top' | 'bottom' | 'start' | 'end' | 'center';
|
12
|
-
|
13
|
-
// @public (undocumented)
|
14
|
-
export type Boundary = PopperJs.Boundary | 'scrollParent' | 'window';
|
15
|
-
|
16
|
-
// @public (undocumented)
|
17
|
-
export type Offset = OffsetFunction | [number | null | undefined, number | null | undefined];
|
18
|
-
|
19
|
-
// @public (undocumented)
|
20
|
-
export type OffsetFunction = (param: OffsetFunctionParam) => [number | null | undefined, number | null | undefined];
|
21
|
-
|
22
|
-
// @public (undocumented)
|
23
|
-
export type OffsetFunctionParam = {
|
24
|
-
popper: PopperJs.Rect;
|
25
|
-
reference: PopperJs.Rect;
|
26
|
-
placement: PopperJs.Placement;
|
27
|
-
};
|
28
|
-
|
29
|
-
// @public (undocumented)
|
30
|
-
export interface PopperOptions extends PositioningProps {
|
31
|
-
enabled?: boolean;
|
32
|
-
// (undocumented)
|
33
|
-
onStateUpdate?: (state: Partial<PopperJs.State>) => void;
|
34
|
-
positioningDependencies?: React.DependencyList;
|
35
|
-
}
|
36
|
-
|
37
|
-
// @public (undocumented)
|
38
|
-
export type PopperRefHandle = {
|
39
|
-
updatePosition: () => void;
|
40
|
-
};
|
41
|
-
|
42
|
-
// @public (undocumented)
|
43
|
-
export type Position = 'above' | 'below' | 'before' | 'after';
|
44
|
-
|
45
|
-
// @public (undocumented)
|
46
|
-
export interface PositioningProps {
|
47
|
-
align?: Alignment;
|
48
|
-
autoSize?: 'height' | 'width' | boolean;
|
49
|
-
containerRef?: React.Ref<PopperRefHandle>;
|
50
|
-
flipBoundary?: Boundary;
|
51
|
-
offset?: Offset;
|
52
|
-
overflowBoundary?: Boundary;
|
53
|
-
position?: Position;
|
54
|
-
positionFixed?: boolean;
|
55
|
-
unstable_disableTether?: boolean | 'all';
|
56
|
-
unstable_pinned?: boolean;
|
57
|
-
}
|
58
|
-
|
59
|
-
// @public
|
60
|
-
export function usePopper(options?: PopperOptions): {
|
61
|
-
targetRef: React.MutableRefObject<any>;
|
62
|
-
containerRef: React.MutableRefObject<any>;
|
63
|
-
arrowRef: React.MutableRefObject<any>;
|
64
|
-
};
|
65
|
-
|
66
|
-
|
67
|
-
// (No @packageDocumentation comment for this package)
|
68
|
-
|
69
|
-
```
|
package/just.config.ts
DELETED
package/lib/utils/isBrowser.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export declare const isBrowser: () => boolean;
|
package/lib/utils/isBrowser.js
DELETED
@@ -1,4 +0,0 @@
|
|
1
|
-
var hasDocument = typeof document === 'object' && document !== null;
|
2
|
-
var hasWindow = typeof window === 'object' && window !== null && window.self === window;
|
3
|
-
export var isBrowser = function () { return hasDocument && hasWindow; };
|
4
|
-
//# sourceMappingURL=isBrowser.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"isBrowser.js","sourceRoot":"../src/","sources":["utils/isBrowser.tsx"],"names":[],"mappings":"AAAA,IAAM,WAAW,GAAG,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI,CAAC;AACtE,IAAM,SAAS,GAAG,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC;AAE1F,MAAM,CAAC,IAAM,SAAS,GAAG,cAAM,OAAA,WAAW,IAAI,SAAS,EAAxB,CAAwB,CAAC","sourcesContent":["const hasDocument = typeof document === 'object' && document !== null;\nconst hasWindow = typeof window === 'object' && window !== null && window.self === window;\n\nexport const isBrowser = () => hasDocument && hasWindow;\n"]}
|
package/lib-amd/index.d.ts
DELETED
package/lib-amd/index.js
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "./usePopper"], function (require, exports, tslib_1, usePopper_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
tslib_1.__exportStar(usePopper_1, exports);
|
5
|
-
});
|
6
|
-
//# sourceMappingURL=index.js.map
|
package/lib-amd/index.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":";;;IAAA,2CAA4B","sourcesContent":["export * from './usePopper';\nexport * from './types';\n"]}
|
package/lib-amd/types.d.ts
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
import * as PopperJs from '@popperjs/core';
|
2
|
-
import * as React from 'react';
|
3
|
-
export declare type OffsetFunctionParam = {
|
4
|
-
popper: PopperJs.Rect;
|
5
|
-
reference: PopperJs.Rect;
|
6
|
-
placement: PopperJs.Placement;
|
7
|
-
};
|
8
|
-
export declare type OffsetFunction = (param: OffsetFunctionParam) => [number | null | undefined, number | null | undefined];
|
9
|
-
export declare type Offset = OffsetFunction | [number | null | undefined, number | null | undefined];
|
10
|
-
export declare type Position = 'above' | 'below' | 'before' | 'after';
|
11
|
-
export declare type Alignment = 'top' | 'bottom' | 'start' | 'end' | 'center';
|
12
|
-
export declare type Boundary = PopperJs.Boundary | 'scrollParent' | 'window';
|
13
|
-
export declare type PopperRefHandle = {
|
14
|
-
updatePosition: () => void;
|
15
|
-
};
|
16
|
-
export interface PositioningProps {
|
17
|
-
/**
|
18
|
-
* Alignment for the component.
|
19
|
-
*/
|
20
|
-
align?: Alignment;
|
21
|
-
/** The element which will define the boundaries of the popper position for the flip behavior. */
|
22
|
-
flipBoundary?: Boundary;
|
23
|
-
/** The element which will define the boundaries of the popper position for the overflow behavior. */
|
24
|
-
overflowBoundary?: Boundary;
|
25
|
-
/** An imperative handle to Popper methods. */
|
26
|
-
containerRef?: React.Ref<PopperRefHandle>;
|
27
|
-
/**
|
28
|
-
* Position for the component. Position has higher priority than align. If position is vertical ('above' | 'below')
|
29
|
-
* and align is also vertical ('top' | 'bottom') or if both position and align are horizontal ('before' | 'after'
|
30
|
-
* and 'start' | 'end' respectively),
|
31
|
-
* then provided value for 'align' will be ignored and 'center' will be used instead.
|
32
|
-
*/
|
33
|
-
position?: Position;
|
34
|
-
/**
|
35
|
-
* Enables the Popper box to position itself in 'fixed' mode (default value is position: 'absolute')
|
36
|
-
* @default false
|
37
|
-
*/
|
38
|
-
positionFixed?: boolean;
|
39
|
-
/**
|
40
|
-
* Lets you displace a popper element from its reference element.
|
41
|
-
* This can be useful if you need to apply some margin between them or if you need to fine tune the
|
42
|
-
* position according to some custom logic.
|
43
|
-
*/
|
44
|
-
offset?: Offset;
|
45
|
-
/**
|
46
|
-
* When the reference element or the viewport is outside viewport allows a popper element to be fully in viewport.
|
47
|
-
* "all" enables this behavior for all axis.
|
48
|
-
*/
|
49
|
-
unstable_disableTether?: boolean | 'all';
|
50
|
-
/**
|
51
|
-
* Disables automatic repositioning of the component; it will always be placed according to the values of `align` and
|
52
|
-
* `position` props, regardless of the size of the component, the reference element or the viewport.
|
53
|
-
*/
|
54
|
-
unstable_pinned?: boolean;
|
55
|
-
/**
|
56
|
-
* Applies max-height and max-width on popper to fit it within the available space in viewport.
|
57
|
-
* true enables this for both width and height.
|
58
|
-
* 'height' applies only `max-height` and 'width' for `max-width`
|
59
|
-
*/
|
60
|
-
autoSize?: 'height' | 'width' | boolean;
|
61
|
-
}
|
62
|
-
export interface PopperOptions extends PositioningProps {
|
63
|
-
/**
|
64
|
-
* If false, delays Popper's creation.
|
65
|
-
* @default true
|
66
|
-
*/
|
67
|
-
enabled?: boolean;
|
68
|
-
/**
|
69
|
-
* Array of conditions to be met in order to trigger a subsequent render to reposition the elements.
|
70
|
-
*/
|
71
|
-
positioningDependencies?: React.DependencyList;
|
72
|
-
onStateUpdate?: (state: Partial<PopperJs.State>) => void;
|
73
|
-
}
|
package/lib-amd/types.js
DELETED
package/lib-amd/types.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"../src/","sources":["types.ts"],"names":[],"mappings":"","sourcesContent":["import * as PopperJs from '@popperjs/core';\nimport * as React from 'react';\n\nexport type OffsetFunctionParam = {\n popper: PopperJs.Rect;\n reference: PopperJs.Rect;\n placement: PopperJs.Placement;\n};\n\nexport type OffsetFunction = (param: OffsetFunctionParam) => [number | null | undefined, number | null | undefined];\n\nexport type Offset = OffsetFunction | [number | null | undefined, number | null | undefined];\n\nexport type Position = 'above' | 'below' | 'before' | 'after';\nexport type Alignment = 'top' | 'bottom' | 'start' | 'end' | 'center';\n\nexport type Boundary = PopperJs.Boundary | 'scrollParent' | 'window';\n\nexport type PopperRefHandle = { updatePosition: () => void };\n\nexport interface PositioningProps {\n /**\n * Alignment for the component.\n */\n align?: Alignment;\n\n /** The element which will define the boundaries of the popper position for the flip behavior. */\n flipBoundary?: Boundary;\n\n /** The element which will define the boundaries of the popper position for the overflow behavior. */\n overflowBoundary?: Boundary;\n\n /** An imperative handle to Popper methods. */\n containerRef?: React.Ref<PopperRefHandle>;\n\n /**\n * Position for the component. Position has higher priority than align. If position is vertical ('above' | 'below')\n * and align is also vertical ('top' | 'bottom') or if both position and align are horizontal ('before' | 'after'\n * and 'start' | 'end' respectively),\n * then provided value for 'align' will be ignored and 'center' will be used instead.\n */\n position?: Position;\n\n /**\n * Enables the Popper box to position itself in 'fixed' mode (default value is position: 'absolute')\n * @default false\n */\n positionFixed?: boolean;\n\n /**\n * Lets you displace a popper element from its reference element.\n * This can be useful if you need to apply some margin between them or if you need to fine tune the\n * position according to some custom logic.\n */\n offset?: Offset;\n\n /**\n * When the reference element or the viewport is outside viewport allows a popper element to be fully in viewport.\n * \"all\" enables this behavior for all axis.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableTether?: boolean | 'all';\n\n /**\n * Disables automatic repositioning of the component; it will always be placed according to the values of `align` and\n * `position` props, regardless of the size of the component, the reference element or the viewport.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_pinned?: boolean;\n\n /**\n * Applies max-height and max-width on popper to fit it within the available space in viewport.\n * true enables this for both width and height.\n * 'height' applies only `max-height` and 'width' for `max-width`\n */\n autoSize?: 'height' | 'width' | boolean;\n}\n\nexport interface PopperOptions extends PositioningProps {\n /**\n * If false, delays Popper's creation.\n * @default true\n */\n enabled?: boolean;\n\n /**\n * Array of conditions to be met in order to trigger a subsequent render to reposition the elements.\n */\n positioningDependencies?: React.DependencyList;\n\n onStateUpdate?: (state: Partial<PopperJs.State>) => void;\n}\n"]}
|
package/lib-amd/usePopper.d.ts
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { PopperOptions } from './types';
|
3
|
-
/**
|
4
|
-
* Exposes Popper positioning API via React hook. Contains few important differences between an official "react-popper"
|
5
|
-
* package:
|
6
|
-
* - style attributes are applied directly on DOM to avoid re-renders
|
7
|
-
* - refs changes and resolution is handled properly without re-renders
|
8
|
-
* - contains a specific to React fix related to initial positioning when containers have components with managed focus
|
9
|
-
* to avoid focus jumps
|
10
|
-
*/
|
11
|
-
export declare function usePopper(options?: PopperOptions): {
|
12
|
-
targetRef: React.MutableRefObject<any>;
|
13
|
-
containerRef: React.MutableRefObject<any>;
|
14
|
-
arrowRef: React.MutableRefObject<any>;
|
15
|
-
};
|