@fluentui/react-positioning 0.0.0-nightly-20230223-2115.1 → 0.0.0-nightly-20230228-0425.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/CHANGELOG.json +9 -9
- package/CHANGELOG.md +7 -7
- package/lib/constants.js.map +1 -1
- package/lib/createArrowStyles.js.map +1 -1
- package/lib/createPositionManager.js +6 -7
- package/lib/createPositionManager.js.map +1 -1
- package/lib/createVirtualElementFromClick.js +2 -1
- 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 +6 -7
- 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 +2 -1
- 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 +7 -8
- package/lib/utils/getFloatingUIOffset.js.map +1 -1
- package/lib/utils/getReactFiberFromNode.js +0 -1
- package/lib/utils/getReactFiberFromNode.js.map +1 -1
- package/lib/utils/getScrollParent.js +6 -5
- 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 +4 -2
- package/lib/utils/mergeArrowOffset.js.map +1 -1
- package/lib/utils/parseFloatingUIPlacement.js +2 -1
- 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 +2 -1
- 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 +7 -18
- package/lib-commonjs/constants.js.map +1 -1
- package/lib-commonjs/createArrowStyles.js +88 -60
- package/lib-commonjs/createArrowStyles.js.map +1 -1
- package/lib-commonjs/createPositionManager.js +116 -103
- package/lib-commonjs/createPositionManager.js.map +1 -1
- package/lib-commonjs/createVirtualElementFromClick.js +26 -27
- package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
- package/lib-commonjs/index.js +51 -24
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/middleware/coverTarget.js +37 -34
- package/lib-commonjs/middleware/coverTarget.js.map +1 -1
- package/lib-commonjs/middleware/flip.js +22 -20
- package/lib-commonjs/middleware/flip.js.map +1 -1
- package/lib-commonjs/middleware/index.js +9 -10
- package/lib-commonjs/middleware/index.js.map +1 -1
- package/lib-commonjs/middleware/intersecting.js +22 -24
- package/lib-commonjs/middleware/intersecting.js.map +1 -1
- package/lib-commonjs/middleware/maxSize.js +40 -35
- package/lib-commonjs/middleware/maxSize.js.map +1 -1
- package/lib-commonjs/middleware/offset.js +12 -11
- package/lib-commonjs/middleware/offset.js.map +1 -1
- package/lib-commonjs/middleware/shift.js +37 -29
- package/lib-commonjs/middleware/shift.js.map +1 -1
- package/lib-commonjs/types.js +2 -5
- package/lib-commonjs/types.js.map +1 -1
- package/lib-commonjs/usePositioning.js +161 -195
- package/lib-commonjs/usePositioning.js.map +1 -1
- package/lib-commonjs/usePositioningMouseTarget.js +37 -34
- package/lib-commonjs/usePositioningMouseTarget.js.map +1 -1
- package/lib-commonjs/utils/debounce.js +21 -22
- package/lib-commonjs/utils/debounce.js.map +1 -1
- package/lib-commonjs/utils/fromFloatingUIPlacement.js +35 -30
- package/lib-commonjs/utils/fromFloatingUIPlacement.js.map +1 -1
- package/lib-commonjs/utils/getBoundary.js +22 -21
- package/lib-commonjs/utils/getBoundary.js.map +1 -1
- package/lib-commonjs/utils/getFloatingUIOffset.js +35 -24
- package/lib-commonjs/utils/getFloatingUIOffset.js.map +1 -1
- package/lib-commonjs/utils/getReactFiberFromNode.js +41 -45
- package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
- package/lib-commonjs/utils/getScrollParent.js +56 -52
- package/lib-commonjs/utils/getScrollParent.js.map +1 -1
- package/lib-commonjs/utils/hasAutoFocusFilter.js +17 -18
- package/lib-commonjs/utils/hasAutoFocusFilter.js.map +1 -1
- package/lib-commonjs/utils/index.js +18 -19
- 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 +14 -15
- package/lib-commonjs/utils/parseFloatingUIPlacement.js.map +1 -1
- package/lib-commonjs/utils/resolvePositioningShorthand.js +61 -63
- package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
- package/lib-commonjs/utils/toFloatingUIPadding.js +25 -23
- package/lib-commonjs/utils/toFloatingUIPadding.js.map +1 -1
- package/lib-commonjs/utils/toFloatingUIPlacement.js +33 -31
- package/lib-commonjs/utils/toFloatingUIPlacement.js.map +1 -1
- package/lib-commonjs/utils/toggleScrollListener.js +23 -19
- package/lib-commonjs/utils/toggleScrollListener.js.map +1 -1
- package/lib-commonjs/utils/useCallbackRef.js +53 -39
- package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
- package/lib-commonjs/utils/writeArrowUpdates.js +24 -19
- package/lib-commonjs/utils/writeArrowUpdates.js.map +1 -1
- package/lib-commonjs/utils/writeContainerupdates.js +45 -37
- package/lib-commonjs/utils/writeContainerupdates.js.map +1 -1
- package/package.json +6 -6
- package/.swcrc +0 -33
@@ -1,67 +1,95 @@
|
|
1
1
|
"use strict";
|
2
|
+
|
2
3
|
Object.defineProperty(exports, "__esModule", {
|
3
|
-
|
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
|
-
createArrowStyles: ()=>createArrowStyles,
|
13
|
-
createArrowHeightStyles: ()=>createArrowHeightStyles
|
4
|
+
value: true
|
14
5
|
});
|
15
|
-
|
16
|
-
const
|
6
|
+
exports.createArrowHeightStyles = exports.createArrowStyles = void 0;
|
7
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
8
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
9
|
+
/**
|
10
|
+
* @internal
|
11
|
+
* Helper that creates a makeStyles rule for an arrow element.
|
12
|
+
* For runtime arrow size toggling simply create extra classnames to apply to the arrow element
|
13
|
+
*
|
14
|
+
* ```ts
|
15
|
+
* makeStyles({
|
16
|
+
* arrowWithSize: createArrowStyles({ arrowHeight: 6 }),
|
17
|
+
*
|
18
|
+
* arrowWithoutSize: createArrowStyles({ arrowHeight: undefined }),
|
19
|
+
* mediumArrow: createArrowHeightStyles(4),
|
20
|
+
* smallArrow: createArrowHeightStyles(2),
|
21
|
+
* })
|
22
|
+
* ...
|
23
|
+
*
|
24
|
+
* state.arrowWithSize.className = styles.arrowWithSize;
|
25
|
+
* state.arrowWithoutSize.className = mergeClasses(
|
26
|
+
* styles.arrowWithoutSize,
|
27
|
+
* state.smallArrow && styles.smallArrow,
|
28
|
+
* state.mediumArrow && styles.mediumArrow,
|
29
|
+
* )
|
30
|
+
* ```
|
31
|
+
*/
|
17
32
|
function createArrowStyles(options) {
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
}
|
33
|
+
const {
|
34
|
+
arrowHeight,
|
35
|
+
borderWidth = '1px',
|
36
|
+
borderStyle = 'solid',
|
37
|
+
borderColor = react_theme_1.tokens.colorTransparentStroke
|
38
|
+
} = options;
|
39
|
+
return {
|
40
|
+
position: 'absolute',
|
41
|
+
backgroundColor: 'inherit',
|
42
|
+
visibility: 'hidden',
|
43
|
+
zIndex: -1,
|
44
|
+
...(arrowHeight && createArrowHeightStyles(arrowHeight)),
|
45
|
+
'::before': {
|
46
|
+
content: '""',
|
47
|
+
visibility: 'visible',
|
48
|
+
position: 'absolute',
|
49
|
+
boxSizing: 'border-box',
|
50
|
+
width: 'inherit',
|
51
|
+
height: 'inherit',
|
52
|
+
backgroundColor: 'inherit',
|
53
|
+
...react_1.shorthands.borderRight(`${borderWidth} /* @noflip */`, `${borderStyle} /* @noflip */`, `${borderColor} /* @noflip */`),
|
54
|
+
...react_1.shorthands.borderBottom(borderWidth, borderStyle, borderColor),
|
55
|
+
borderBottomRightRadius: react_theme_1.tokens.borderRadiusSmall,
|
56
|
+
transform: 'rotate(var(--angle)) translate(0, 50%) rotate(45deg)'
|
57
|
+
},
|
58
|
+
// Popper sets data-popper-placement on the root element, which is used to align the arrow
|
59
|
+
':global([data-popper-placement^="top"])': {
|
60
|
+
bottom: `-${borderWidth}`,
|
61
|
+
'--angle': '0'
|
62
|
+
},
|
63
|
+
':global([data-popper-placement^="right"])': {
|
64
|
+
left: `-${borderWidth} /* @noflip */`,
|
65
|
+
'--angle': '90deg'
|
66
|
+
},
|
67
|
+
':global([data-popper-placement^="bottom"])': {
|
68
|
+
top: `-${borderWidth}`,
|
69
|
+
'--angle': '180deg'
|
70
|
+
},
|
71
|
+
':global([data-popper-placement^="left"])': {
|
72
|
+
right: `-${borderWidth} /* @noflip */`,
|
73
|
+
'--angle': '270deg'
|
74
|
+
}
|
75
|
+
};
|
56
76
|
}
|
77
|
+
exports.createArrowStyles = createArrowStyles;
|
78
|
+
/**
|
79
|
+
* @internal
|
80
|
+
* Creates CSS styles to size the arrow created by createArrowStyles to the given height.
|
81
|
+
*
|
82
|
+
* Use this when you need to create classes for several different arrow sizes. If you only need a
|
83
|
+
* constant arrow size, you can pass the `arrowHeight` param to createArrowStyles instead.
|
84
|
+
*/
|
57
85
|
function createArrowHeightStyles(arrowHeight) {
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
}
|
66
|
-
|
86
|
+
// The arrow is a square rotated 45 degrees to have its bottom and right edges form a right triangle.
|
87
|
+
// Multiply the triangle's height by sqrt(2) to get length of its edges.
|
88
|
+
const edgeLength = `${1.414 * arrowHeight}px`;
|
89
|
+
return {
|
90
|
+
width: edgeLength,
|
91
|
+
height: edgeLength
|
92
|
+
};
|
93
|
+
}
|
94
|
+
exports.createArrowHeightStyles = createArrowHeightStyles;
|
67
95
|
//# sourceMappingURL=createArrowStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AAsCA;;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAgBA,iBAAiB,CAACC,OAAiC;EACjE,MAAM;IACJC,WAAW;IACXC,WAAW,GAAG,KAAK;IACnBC,WAAW,GAAG,OAAO;IACrBC,WAAW,GAAGC,oBAAM,CAACC;EAAsB,CAC5C,GAAGN,OAAO;EAEX,OAAO;IACLO,QAAQ,EAAE,UAAU;IACpBC,eAAe,EAAE,SAAS;IAC1BC,UAAU,EAAE,QAAQ;IACpBC,MAAM,EAAE,CAAC,CAAC;IAEV,IAAIT,WAAW,IAAIU,uBAAuB,CAACV,WAAW,CAAC,CAAC;IAExD,UAAU,EAAE;MACVW,OAAO,EAAE,IAAI;MACbH,UAAU,EAAE,SAAS;MACrBF,QAAQ,EAAE,UAAU;MACpBM,SAAS,EAAE,YAAY;MACvBC,KAAK,EAAE,SAAS;MAChBC,MAAM,EAAE,SAAS;MACjBP,eAAe,EAAE,SAAS;MAC1B,GAAGQ,kBAAU,CAACC,WAAW,CACvB,GAAGf,WAAW,gBAAgB,EAC9B,GAAGC,WAAW,gBAAgB,EAC9B,GAAGC,WAAW,gBAAgB,CAC/B;MACD,GAAGY,kBAAU,CAACE,YAAY,CAAChB,WAAW,EAAEC,WAAW,EAAEC,WAAW,CAAC;MACjEe,uBAAuB,EAAEd,oBAAM,CAACe,iBAAiB;MACjDC,SAAS,EAAE;KACZ;IAED;IACA,yCAAyC,EAAE;MACzCC,MAAM,EAAE,IAAIpB,WAAW,EAAE;MACzB,SAAS,EAAE;KACZ;IACD,2CAA2C,EAAE;MAC3CqB,IAAI,EAAE,IAAIrB,WAAW,gBAAgB;MACrC,SAAS,EAAE;KACZ;IACD,4CAA4C,EAAE;MAC5CsB,GAAG,EAAE,IAAItB,WAAW,EAAE;MACtB,SAAS,EAAE;KACZ;IACD,0CAA0C,EAAE;MAC1CuB,KAAK,EAAE,IAAIvB,WAAW,gBAAgB;MACtC,SAAS,EAAE;;GAEd;AACH;AApDAwB;AAsDA;;;;;;;AAOA,SAAgBf,uBAAuB,CAACV,WAAmB;EACzD;EACA;EACA,MAAM0B,UAAU,GAAG,GAAG,KAAK,GAAG1B,WAAW,IAAI;EAC7C,OAAO;IAAEa,KAAK,EAAEa,UAAU;IAAEZ,MAAM,EAAEY;EAAU,CAAE;AAClD;AALAD","names":["createArrowStyles","options","arrowHeight","borderWidth","borderStyle","borderColor","react_theme_1","colorTransparentStroke","position","backgroundColor","visibility","zIndex","createArrowHeightStyles","content","boxSizing","width","height","react_1","borderRight","borderBottom","borderBottomRightRadius","borderRadiusSmall","transform","bottom","left","top","right","exports","edgeLength"],"sourceRoot":"","sources":["../../../../../../../packages/react-components/react-positioning/src/createArrowStyles.ts"],"sourcesContent":["import { shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { GriffelStyle } from '@griffel/react';\n\n/**\n * @internal\n * Options parameter for the createArrowStyles function\n */\nexport type CreateArrowStylesOptions = {\n /**\n * The height of the arrow from the base to the tip, in px. The base width of the arrow is always twice its height.\n *\n * This can be undefined to leave out the arrow size styles. You must then add styles created by\n * createArrowHeightStyles to set the arrow's size correctly. This can be useful if the arrow can be different sizes.\n */\n arrowHeight: number | undefined;\n\n /**\n * The borderWidth of the arrow. Should be the same borderWidth as the parent element.\n *\n * @defaultvalue 1px\n */\n borderWidth?: GriffelStyle['borderBottomWidth'];\n\n /**\n * The borderStyle for the arrow. Should be the same borderStyle as the parent element.\n *\n * @defaultvalue solid\n */\n borderStyle?: GriffelStyle['borderBottomStyle'];\n\n /**\n * The borderColor of the arrow. Should be the same borderColor as the parent element.\n *\n * @defaultvalue tokens.colorTransparentStroke\n */\n borderColor?: GriffelStyle['borderBottomColor'];\n};\n\n/**\n * @internal\n * Helper that creates a makeStyles rule for an arrow element.\n * For runtime arrow size toggling simply create extra classnames to apply to the arrow element\n *\n * ```ts\n * makeStyles({\n * arrowWithSize: createArrowStyles({ arrowHeight: 6 }),\n *\n * arrowWithoutSize: createArrowStyles({ arrowHeight: undefined }),\n * mediumArrow: createArrowHeightStyles(4),\n * smallArrow: createArrowHeightStyles(2),\n * })\n * ...\n *\n * state.arrowWithSize.className = styles.arrowWithSize;\n * state.arrowWithoutSize.className = mergeClasses(\n * styles.arrowWithoutSize,\n * state.smallArrow && styles.smallArrow,\n * state.mediumArrow && styles.mediumArrow,\n * )\n * ```\n */\nexport function createArrowStyles(options: CreateArrowStylesOptions): GriffelStyle {\n const {\n arrowHeight,\n borderWidth = '1px',\n borderStyle = 'solid',\n borderColor = tokens.colorTransparentStroke,\n } = options;\n\n return {\n position: 'absolute',\n backgroundColor: 'inherit',\n visibility: 'hidden',\n zIndex: -1,\n\n ...(arrowHeight && createArrowHeightStyles(arrowHeight)),\n\n '::before': {\n content: '\"\"',\n visibility: 'visible',\n position: 'absolute',\n boxSizing: 'border-box',\n width: 'inherit',\n height: 'inherit',\n backgroundColor: 'inherit',\n ...shorthands.borderRight(\n `${borderWidth} /* @noflip */`,\n `${borderStyle} /* @noflip */`,\n `${borderColor} /* @noflip */`,\n ),\n ...shorthands.borderBottom(borderWidth, borderStyle, borderColor),\n borderBottomRightRadius: tokens.borderRadiusSmall,\n transform: 'rotate(var(--angle)) translate(0, 50%) rotate(45deg)',\n },\n\n // Popper sets data-popper-placement on the root element, which is used to align the arrow\n ':global([data-popper-placement^=\"top\"])': {\n bottom: `-${borderWidth}`,\n '--angle': '0',\n },\n ':global([data-popper-placement^=\"right\"])': {\n left: `-${borderWidth} /* @noflip */`,\n '--angle': '90deg',\n },\n ':global([data-popper-placement^=\"bottom\"])': {\n top: `-${borderWidth}`,\n '--angle': '180deg',\n },\n ':global([data-popper-placement^=\"left\"])': {\n right: `-${borderWidth} /* @noflip */`,\n '--angle': '270deg',\n },\n };\n}\n\n/**\n * @internal\n * Creates CSS styles to size the arrow created by createArrowStyles to the given height.\n *\n * Use this when you need to create classes for several different arrow sizes. If you only need a\n * constant arrow size, you can pass the `arrowHeight` param to createArrowStyles instead.\n */\nexport function createArrowHeightStyles(arrowHeight: number) {\n // The arrow is a square rotated 45 degrees to have its bottom and right edges form a right triangle.\n // Multiply the triangle's height by sqrt(2) to get length of its edges.\n const edgeLength = `${1.414 * arrowHeight}px`;\n return { width: edgeLength, height: edgeLength };\n}\n"]}
|
@@ -1,113 +1,126 @@
|
|
1
1
|
"use strict";
|
2
|
+
|
2
3
|
Object.defineProperty(exports, "__esModule", {
|
3
|
-
|
4
|
-
});
|
5
|
-
Object.defineProperty(exports, "createPositionManager", {
|
6
|
-
enumerable: true,
|
7
|
-
get: ()=>createPositionManager
|
4
|
+
value: true
|
8
5
|
});
|
9
|
-
|
10
|
-
const
|
6
|
+
exports.createPositionManager = void 0;
|
7
|
+
const dom_1 = /*#__PURE__*/require("@floating-ui/dom");
|
8
|
+
const utils_1 = /*#__PURE__*/require("./utils");
|
9
|
+
/**
|
10
|
+
* @internal
|
11
|
+
* @returns manager that handles positioning out of the react lifecycle
|
12
|
+
*/
|
11
13
|
function createPositionManager(options) {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
const {
|
15
|
+
container,
|
16
|
+
target,
|
17
|
+
arrow,
|
18
|
+
strategy,
|
19
|
+
middleware,
|
20
|
+
placement
|
21
|
+
} = options;
|
22
|
+
let isDestroyed = false;
|
23
|
+
if (!target || !container) {
|
24
|
+
return {
|
25
|
+
updatePosition: () => undefined,
|
26
|
+
dispose: () => undefined
|
27
|
+
};
|
28
|
+
}
|
29
|
+
let isFirstUpdate = true;
|
30
|
+
const scrollParents = new Set();
|
31
|
+
const targetWindow = container.ownerDocument.defaultView;
|
32
|
+
// When the container is first resolved, set position `fixed` to avoid scroll jumps.
|
33
|
+
// Without this scroll jumps can occur when the element is rendered initially and receives focus
|
34
|
+
Object.assign(container.style, {
|
35
|
+
position: 'fixed',
|
36
|
+
left: 0,
|
37
|
+
top: 0,
|
38
|
+
margin: 0
|
39
|
+
});
|
40
|
+
const forceUpdate = () => {
|
41
|
+
// debounced update can still occur afterwards
|
42
|
+
// early return to avoid memory leaks
|
43
|
+
if (isDestroyed) {
|
44
|
+
return;
|
45
|
+
}
|
46
|
+
if (isFirstUpdate) {
|
47
|
+
scrollParents.add(utils_1.getScrollParent(container));
|
48
|
+
if (target instanceof HTMLElement) {
|
49
|
+
scrollParents.add(utils_1.getScrollParent(target));
|
50
|
+
}
|
51
|
+
scrollParents.forEach(scrollParent => {
|
52
|
+
scrollParent.addEventListener('scroll', updatePosition);
|
53
|
+
});
|
54
|
+
isFirstUpdate = false;
|
19
55
|
}
|
20
|
-
let isFirstUpdate = true;
|
21
|
-
const scrollParents = new Set();
|
22
|
-
const targetWindow = container.ownerDocument.defaultView;
|
23
|
-
// When the container is first resolved, set position `fixed` to avoid scroll jumps.
|
24
|
-
// Without this scroll jumps can occur when the element is rendered initially and receives focus
|
25
56
|
Object.assign(container.style, {
|
26
|
-
|
27
|
-
left: 0,
|
28
|
-
top: 0,
|
29
|
-
margin: 0
|
57
|
+
position: strategy
|
30
58
|
});
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
// FIXME for node > 14
|
79
|
-
// node 15 introduces promise rejection which means that any components
|
80
|
-
// tests need to be `it('', async () => {})` otherwise there can be race conditions with
|
81
|
-
// JSDOM being torn down before this promise is resolved so globals like `window` and `document` don't exist
|
82
|
-
// Unless all tests that ever use `usePositioning` are turned into async tests, any logging during testing
|
83
|
-
// will actually be counter productive
|
84
|
-
if (process.env.NODE_ENV === 'development') {
|
85
|
-
// eslint-disable-next-line no-console
|
86
|
-
console.error('[usePositioning]: Failed to calculate position', err);
|
87
|
-
}
|
88
|
-
});
|
89
|
-
};
|
90
|
-
const updatePosition = (0, _utils.debounce)(()=>forceUpdate());
|
91
|
-
const dispose = ()=>{
|
92
|
-
isDestroyed = true;
|
93
|
-
if (targetWindow) {
|
94
|
-
targetWindow.removeEventListener('scroll', updatePosition);
|
95
|
-
targetWindow.removeEventListener('resize', updatePosition);
|
96
|
-
}
|
97
|
-
scrollParents.forEach((scrollParent)=>{
|
98
|
-
scrollParent.removeEventListener('scroll', updatePosition);
|
99
|
-
});
|
100
|
-
};
|
59
|
+
dom_1.computePosition(target, container, {
|
60
|
+
placement,
|
61
|
+
middleware,
|
62
|
+
strategy
|
63
|
+
}).then(({
|
64
|
+
x,
|
65
|
+
y,
|
66
|
+
middlewareData,
|
67
|
+
placement: computedPlacement
|
68
|
+
}) => {
|
69
|
+
// Promise can still resolve after destruction
|
70
|
+
// early return to avoid applying outdated position
|
71
|
+
if (isDestroyed) {
|
72
|
+
return;
|
73
|
+
}
|
74
|
+
utils_1.writeArrowUpdates({
|
75
|
+
arrow,
|
76
|
+
middlewareData
|
77
|
+
});
|
78
|
+
utils_1.writeContainerUpdates({
|
79
|
+
container,
|
80
|
+
middlewareData,
|
81
|
+
placement: computedPlacement,
|
82
|
+
coordinates: {
|
83
|
+
x,
|
84
|
+
y
|
85
|
+
},
|
86
|
+
lowPPI: ((targetWindow === null || targetWindow === void 0 ? void 0 : targetWindow.devicePixelRatio) || 1) <= 1,
|
87
|
+
strategy
|
88
|
+
});
|
89
|
+
}).catch(err => {
|
90
|
+
// https://github.com/floating-ui/floating-ui/issues/1845
|
91
|
+
// FIXME for node > 14
|
92
|
+
// node 15 introduces promise rejection which means that any components
|
93
|
+
// tests need to be `it('', async () => {})` otherwise there can be race conditions with
|
94
|
+
// JSDOM being torn down before this promise is resolved so globals like `window` and `document` don't exist
|
95
|
+
// Unless all tests that ever use `usePositioning` are turned into async tests, any logging during testing
|
96
|
+
// will actually be counter productive
|
97
|
+
if (process.env.NODE_ENV === 'development') {
|
98
|
+
// eslint-disable-next-line no-console
|
99
|
+
console.error('[usePositioning]: Failed to calculate position', err);
|
100
|
+
}
|
101
|
+
});
|
102
|
+
};
|
103
|
+
const updatePosition = utils_1.debounce(() => forceUpdate());
|
104
|
+
const dispose = () => {
|
105
|
+
isDestroyed = true;
|
101
106
|
if (targetWindow) {
|
102
|
-
|
103
|
-
|
107
|
+
targetWindow.removeEventListener('scroll', updatePosition);
|
108
|
+
targetWindow.removeEventListener('resize', updatePosition);
|
104
109
|
}
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
110
|
+
scrollParents.forEach(scrollParent => {
|
111
|
+
scrollParent.removeEventListener('scroll', updatePosition);
|
112
|
+
});
|
113
|
+
};
|
114
|
+
if (targetWindow) {
|
115
|
+
targetWindow.addEventListener('scroll', updatePosition);
|
116
|
+
targetWindow.addEventListener('resize', updatePosition);
|
117
|
+
}
|
118
|
+
// Update the position on initialization
|
119
|
+
updatePosition();
|
120
|
+
return {
|
121
|
+
updatePosition,
|
122
|
+
dispose
|
123
|
+
};
|
124
|
+
}
|
125
|
+
exports.createPositionManager = createPositionManager;
|
113
126
|
//# sourceMappingURL=createPositionManager.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"mappings":"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","names":["createPositionManager","options","container","target","arrow","strategy","middleware","placement","isDestroyed","updatePosition","undefined","dispose","isFirstUpdate","scrollParents","Set","targetWindow","ownerDocument","defaultView","Object","assign","style","position","left","top","margin","forceUpdate","add","utils_1","HTMLElement","forEach","scrollParent","addEventListener","dom_1","then","x","y","middlewareData","computedPlacement","coordinates","lowPPI","devicePixelRatio","catch","err","process","env","NODE_ENV","console","error","removeEventListener","exports"],"sourceRoot":"","sources":["../../../../../../../packages/react-components/react-positioning/src/createPositionManager.ts"],"sourcesContent":["import { computePosition } from '@floating-ui/dom';\nimport type { Middleware, Placement, Strategy } from '@floating-ui/dom';\nimport type { PositionManager, TargetElement } from './types';\nimport { debounce, writeArrowUpdates, writeContainerUpdates, getScrollParent } from './utils';\n\ninterface PositionManagerOptions {\n /**\n * The positioned element\n */\n container: HTMLElement;\n /**\n * Element that the container will be anchored to\n */\n target: TargetElement;\n /**\n * Arrow that points from the container to the target\n */\n arrow: HTMLElement | null;\n /**\n * The value of the css `position` property\n * @default absolute\n */\n strategy: Strategy;\n /**\n * [Floating UI middleware](https://floating-ui.com/docs/middleware)\n */\n middleware: Middleware[];\n /**\n * [Floating UI placement](https://floating-ui.com/docs/computePosition#placement)\n */\n placement?: Placement;\n}\n\n/**\n * @internal\n * @returns manager that handles positioning out of the react lifecycle\n */\nexport function createPositionManager(options: PositionManagerOptions): PositionManager {\n const { container, target, arrow, strategy, middleware, placement } = options;\n let isDestroyed = false;\n if (!target || !container) {\n return {\n updatePosition: () => undefined,\n dispose: () => undefined,\n };\n }\n\n let isFirstUpdate = true;\n const scrollParents: Set<HTMLElement> = new Set<HTMLElement>();\n const targetWindow = container.ownerDocument.defaultView;\n\n // When the container is first resolved, set position `fixed` to avoid scroll jumps.\n // Without this scroll jumps can occur when the element is rendered initially and receives focus\n Object.assign(container.style, { position: 'fixed', left: 0, top: 0, margin: 0 });\n\n const forceUpdate = () => {\n // debounced update can still occur afterwards\n // early return to avoid memory leaks\n if (isDestroyed) {\n return;\n }\n\n if (isFirstUpdate) {\n scrollParents.add(getScrollParent(container));\n if (target instanceof HTMLElement) {\n scrollParents.add(getScrollParent(target));\n }\n\n scrollParents.forEach(scrollParent => {\n scrollParent.addEventListener('scroll', updatePosition);\n });\n\n isFirstUpdate = false;\n }\n\n Object.assign(container.style, { position: strategy });\n computePosition(target, container, { placement, middleware, strategy })\n .then(({ x, y, middlewareData, placement: computedPlacement }) => {\n // Promise can still resolve after destruction\n // early return to avoid applying outdated position\n if (isDestroyed) {\n return;\n }\n\n writeArrowUpdates({ arrow, middlewareData });\n writeContainerUpdates({\n container,\n middlewareData,\n placement: computedPlacement,\n coordinates: { x, y },\n lowPPI: (targetWindow?.devicePixelRatio || 1) <= 1,\n strategy,\n });\n })\n .catch(err => {\n // https://github.com/floating-ui/floating-ui/issues/1845\n // FIXME for node > 14\n // node 15 introduces promise rejection which means that any components\n // tests need to be `it('', async () => {})` otherwise there can be race conditions with\n // JSDOM being torn down before this promise is resolved so globals like `window` and `document` don't exist\n // Unless all tests that ever use `usePositioning` are turned into async tests, any logging during testing\n // will actually be counter productive\n if (process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.error('[usePositioning]: Failed to calculate position', err);\n }\n });\n };\n\n const updatePosition = debounce(() => forceUpdate());\n\n const dispose = () => {\n isDestroyed = true;\n\n if (targetWindow) {\n targetWindow.removeEventListener('scroll', updatePosition);\n targetWindow.removeEventListener('resize', updatePosition);\n }\n\n scrollParents.forEach(scrollParent => {\n scrollParent.removeEventListener('scroll', updatePosition);\n });\n };\n\n if (targetWindow) {\n targetWindow.addEventListener('scroll', updatePosition);\n targetWindow.addEventListener('resize', updatePosition);\n }\n\n // Update the position on initialization\n updatePosition();\n\n return {\n updatePosition,\n dispose,\n };\n}\n"]}
|
@@ -1,34 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.createVirtualElementFromClick = void 0;
|
1
7
|
/**
|
2
8
|
* Creates a virtual element based on the position of a click event
|
3
9
|
* Can be used as a target for popper in scenarios such as context menus
|
4
|
-
*/
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
6
|
-
value: true
|
7
|
-
});
|
8
|
-
Object.defineProperty(exports, "createVirtualElementFromClick", {
|
9
|
-
enumerable: true,
|
10
|
-
get: ()=>createVirtualElementFromClick
|
11
|
-
});
|
10
|
+
*/
|
12
11
|
function createVirtualElementFromClick(nativeEvent) {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
return {
|
19
|
-
left,
|
20
|
-
top,
|
21
|
-
right,
|
22
|
-
bottom,
|
23
|
-
x: left,
|
24
|
-
y: top,
|
25
|
-
height: 1,
|
26
|
-
width: 1
|
27
|
-
};
|
28
|
-
}
|
12
|
+
const left = nativeEvent.clientX;
|
13
|
+
const top = nativeEvent.clientY;
|
14
|
+
const right = left + 1;
|
15
|
+
const bottom = top + 1;
|
16
|
+
function getBoundingClientRect() {
|
29
17
|
return {
|
30
|
-
|
18
|
+
left,
|
19
|
+
top,
|
20
|
+
right,
|
21
|
+
bottom,
|
22
|
+
x: left,
|
23
|
+
y: top,
|
24
|
+
height: 1,
|
25
|
+
width: 1
|
31
26
|
};
|
32
|
-
}
|
33
|
-
|
27
|
+
}
|
28
|
+
return {
|
29
|
+
getBoundingClientRect
|
30
|
+
};
|
31
|
+
}
|
32
|
+
exports.createVirtualElementFromClick = createVirtualElementFromClick;
|
34
33
|
//# sourceMappingURL=createVirtualElementFromClick.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"mappings":";;;;;;AAEA;;;;AAIA,SAAgBA,6BAA6B,CAACC,WAAuB;EACnE,MAAMC,IAAI,GAAGD,WAAW,CAACE,OAAO;EAChC,MAAMC,GAAG,GAAGH,WAAW,CAACI,OAAO;EAC/B,MAAMC,KAAK,GAAGJ,IAAI,GAAG,CAAC;EACtB,MAAMK,MAAM,GAAGH,GAAG,GAAG,CAAC;EAEtB,SAASI,qBAAqB;IAC5B,OAAO;MACLN,IAAI;MACJE,GAAG;MACHE,KAAK;MACLC,MAAM;MACNE,CAAC,EAAEP,IAAI;MACPQ,CAAC,EAAEN,GAAG;MACNO,MAAM,EAAE,CAAC;MACTC,KAAK,EAAE;KACR;EACH;EAEA,OAAO;IACLJ;GACD;AACH;AAtBAK","names":["createVirtualElementFromClick","nativeEvent","left","clientX","top","clientY","right","bottom","getBoundingClientRect","x","y","height","width","exports"],"sourceRoot":"","sources":["../../../../../../../packages/react-components/react-positioning/src/createVirtualElementFromClick.ts"],"sourcesContent":["import type { PositioningVirtualElement } from './types';\n\n/**\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 */\nexport function createVirtualElementFromClick(nativeEvent: MouseEvent): PositioningVirtualElement {\n const left = nativeEvent.clientX;\n const top = nativeEvent.clientY;\n const right = left + 1;\n const bottom = top + 1;\n\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\n return {\n getBoundingClientRect,\n };\n}\n"]}
|
package/lib-commonjs/index.js
CHANGED
@@ -1,27 +1,54 @@
|
|
1
1
|
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
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
2
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.mergeArrowOffset = exports.resolvePositioningShorthand = exports.usePositioningMouseTarget = exports.usePositioning = exports.createArrowStyles = exports.createArrowHeightStyles = exports.createVirtualElementFromClick = void 0;
|
7
|
+
var createVirtualElementFromClick_1 = /*#__PURE__*/require("./createVirtualElementFromClick");
|
8
|
+
Object.defineProperty(exports, "createVirtualElementFromClick", {
|
9
|
+
enumerable: true,
|
10
|
+
get: function () {
|
11
|
+
return createVirtualElementFromClick_1.createVirtualElementFromClick;
|
12
|
+
}
|
13
|
+
});
|
14
|
+
var createArrowStyles_1 = /*#__PURE__*/require("./createArrowStyles");
|
15
|
+
Object.defineProperty(exports, "createArrowHeightStyles", {
|
16
|
+
enumerable: true,
|
17
|
+
get: function () {
|
18
|
+
return createArrowStyles_1.createArrowHeightStyles;
|
19
|
+
}
|
20
|
+
});
|
21
|
+
Object.defineProperty(exports, "createArrowStyles", {
|
22
|
+
enumerable: true,
|
23
|
+
get: function () {
|
24
|
+
return createArrowStyles_1.createArrowStyles;
|
25
|
+
}
|
26
|
+
});
|
27
|
+
var usePositioning_1 = /*#__PURE__*/require("./usePositioning");
|
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
|
+
});
|
27
54
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AAASA;EAAAC;EAAAC;IAAA,oEAA6B;EAAA;AAAA;AACtC;AAASF;EAAAC;EAAAC;IAAA,kDAAuB;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,4CAAiB;EAAA;AAAA;AAEnD;AAASF;EAAAC;EAAAC;IAAA,sCAAc;EAAA;AAAA;AACvB;AAASF;EAAAC;EAAAC;IAAA,4DAAyB;EAAA;AAAA;AAClC;AAASF;EAAAC;EAAAC;IAAA,0CAA2B;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,+BAAgB;EAAA;AAAA","names":["Object","enumerable","get"],"sourceRoot":"","sources":["../../../../../../../packages/react-components/react-positioning/src/index.ts"],"sourcesContent":["export { createVirtualElementFromClick } from './createVirtualElementFromClick';\nexport { createArrowHeightStyles, createArrowStyles } from './createArrowStyles';\nexport type { CreateArrowStylesOptions } from './createArrowStyles';\nexport { usePositioning } from './usePositioning';\nexport { usePositioningMouseTarget } from './usePositioningMouseTarget';\nexport { resolvePositioningShorthand, mergeArrowOffset } from './utils/index';\nexport type {\n Alignment,\n AutoSize,\n Boundary,\n Offset,\n OffsetFunction,\n OffsetFunctionParam,\n OffsetObject,\n OffsetShorthand,\n Position,\n PositioningImperativeRef,\n PositioningProps,\n PositioningShorthand,\n PositioningShorthandValue,\n PositioningVirtualElement,\n SetVirtualMouseTarget,\n} from './types';\n"]}
|