@fluentui/react-positioning 0.0.0-nightly0e0cf06c3420211029.1 → 0.0.0-nightly627ad67f1120211109.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. package/CHANGELOG.json +14 -8
  2. package/CHANGELOG.md +8 -7
  3. package/lib/createVirtualElementFromClick.js +9 -9
  4. package/lib/createVirtualElementFromClick.js.map +1 -1
  5. package/lib/usePopper.js +64 -71
  6. package/lib/usePopper.js.map +1 -1
  7. package/lib/usePopperMouseTarget.js +5 -5
  8. package/lib/usePopperMouseTarget.js.map +1 -1
  9. package/lib/utils/getBoundary.js +1 -1
  10. package/lib/utils/getReactFiberFromNode.d.ts +0 -1
  11. package/lib/utils/getReactFiberFromNode.js +1 -1
  12. package/lib/utils/getReactFiberFromNode.js.map +1 -1
  13. package/lib/utils/getScrollParent.js +6 -6
  14. package/lib/utils/getScrollParent.js.map +1 -1
  15. package/lib/utils/mergeArrowOffset.js +5 -5
  16. package/lib/utils/mergeArrowOffset.js.map +1 -1
  17. package/lib/utils/positioningHelper.js +14 -14
  18. package/lib/utils/positioningHelper.js.map +1 -1
  19. package/lib/utils/resolvePositioningShorthand.js +1 -1
  20. package/lib/utils/resolvePositioningShorthand.js.map +1 -1
  21. package/lib/utils/useCallbackRef.js +6 -6
  22. package/lib/utils/useCallbackRef.js.map +1 -1
  23. package/lib-commonjs/createVirtualElementFromClick.js +9 -9
  24. package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
  25. package/lib-commonjs/index.js +1 -1
  26. package/lib-commonjs/usePopper.js +69 -76
  27. package/lib-commonjs/usePopper.js.map +1 -1
  28. package/lib-commonjs/usePopperMouseTarget.js +7 -7
  29. package/lib-commonjs/usePopperMouseTarget.js.map +1 -1
  30. package/lib-commonjs/utils/getBoundary.js +2 -2
  31. package/lib-commonjs/utils/getBoundary.js.map +1 -1
  32. package/lib-commonjs/utils/getReactFiberFromNode.d.ts +0 -1
  33. package/lib-commonjs/utils/getReactFiberFromNode.js +1 -1
  34. package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
  35. package/lib-commonjs/utils/getScrollParent.js +6 -6
  36. package/lib-commonjs/utils/getScrollParent.js.map +1 -1
  37. package/lib-commonjs/utils/index.js +1 -1
  38. package/lib-commonjs/utils/mergeArrowOffset.js +5 -5
  39. package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
  40. package/lib-commonjs/utils/positioningHelper.js +14 -14
  41. package/lib-commonjs/utils/positioningHelper.js.map +1 -1
  42. package/lib-commonjs/utils/resolvePositioningShorthand.js +1 -1
  43. package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
  44. package/lib-commonjs/utils/useCallbackRef.js +8 -8
  45. package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
  46. package/package.json +3 -3
package/CHANGELOG.json CHANGED
@@ -2,28 +2,34 @@
2
2
  "name": "@fluentui/react-positioning",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 29 Oct 2021 06:39:52 GMT",
6
- "tag": "@fluentui/react-positioning_v0.0.0-nightly0e0cf06c3420211029.1",
7
- "version": "0.0.0-nightly0e0cf06c3420211029.1",
5
+ "date": "Tue, 09 Nov 2021 04:20:26 GMT",
6
+ "tag": "@fluentui/react-positioning_v0.0.0-nightly627ad67f1120211109.1",
7
+ "version": "0.0.0-nightly627ad67f1120211109.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
11
11
  "author": "email not defined",
12
12
  "package": "@fluentui/react-positioning",
13
- "commit": "3535f78f7af73f13f2c1e7470293fb5e592866de",
13
+ "commit": "5e2f04f4741a9e3b98463480f9c1926ea2006337",
14
14
  "comment": "Release nightly v9"
15
15
  },
16
+ {
17
+ "author": "gcox@microsoft.com",
18
+ "package": "@fluentui/react-positioning",
19
+ "commit": "c9bd5b5a02ae94a8239ce1b56cac2f0d0dbd3586",
20
+ "comment": "Updated beta and RC components to ES2019"
21
+ },
16
22
  {
17
23
  "author": "beachball",
18
24
  "package": "@fluentui/react-positioning",
19
- "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly0e0cf06c3420211029.1",
20
- "commit": "3535f78f7af73f13f2c1e7470293fb5e592866de"
25
+ "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly627ad67f1120211109.1",
26
+ "commit": "5e2f04f4741a9e3b98463480f9c1926ea2006337"
21
27
  },
22
28
  {
23
29
  "author": "beachball",
24
30
  "package": "@fluentui/react-positioning",
25
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly0e0cf06c3420211029.1",
26
- "commit": "3535f78f7af73f13f2c1e7470293fb5e592866de"
31
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly627ad67f1120211109.1",
32
+ "commit": "5e2f04f4741a9e3b98463480f9c1926ea2006337"
27
33
  }
28
34
  ]
29
35
  }
package/CHANGELOG.md CHANGED
@@ -1,19 +1,20 @@
1
1
  # Change Log - @fluentui/react-positioning
2
2
 
3
- This log was last generated on Fri, 29 Oct 2021 06:39:52 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 09 Nov 2021 04:20:26 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly0e0cf06c3420211029.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v0.0.0-nightly0e0cf06c3420211029.1)
7
+ ## [0.0.0-nightly627ad67f1120211109.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v0.0.0-nightly627ad67f1120211109.1)
8
8
 
9
- Fri, 29 Oct 2021 06:39:52 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.0.0-beta.2..@fluentui/react-positioning_v0.0.0-nightly0e0cf06c3420211029.1)
9
+ Tue, 09 Nov 2021 04:20:26 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.0.0-beta.2..@fluentui/react-positioning_v0.0.0-nightly627ad67f1120211109.1)
11
11
 
12
12
  ### Changes
13
13
 
14
- - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/3535f78f7af73f13f2c1e7470293fb5e592866de) by email not defined)
15
- - Bump @fluentui/react-shared-contexts to v0.0.0-nightly0e0cf06c3420211029.1 ([commit](https://github.com/microsoft/fluentui/commit/3535f78f7af73f13f2c1e7470293fb5e592866de) by beachball)
16
- - Bump @fluentui/react-utilities to v0.0.0-nightly0e0cf06c3420211029.1 ([commit](https://github.com/microsoft/fluentui/commit/3535f78f7af73f13f2c1e7470293fb5e592866de) by beachball)
14
+ - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/5e2f04f4741a9e3b98463480f9c1926ea2006337) by email not defined)
15
+ - Updated beta and RC components to ES2019 ([PR #20405](https://github.com/microsoft/fluentui/pull/20405) by gcox@microsoft.com)
16
+ - Bump @fluentui/react-shared-contexts to v0.0.0-nightly627ad67f1120211109.1 ([commit](https://github.com/microsoft/fluentui/commit/5e2f04f4741a9e3b98463480f9c1926ea2006337) by beachball)
17
+ - Bump @fluentui/react-utilities to v0.0.0-nightly627ad67f1120211109.1 ([commit](https://github.com/microsoft/fluentui/commit/5e2f04f4741a9e3b98463480f9c1926ea2006337) by beachball)
17
18
 
18
19
  ## [9.0.0-beta.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.0.0-beta.2)
19
20
 
@@ -3,22 +3,22 @@
3
3
  * Can be used as a target for popper in scenarios such as context menus
4
4
  */
5
5
  export function createVirtualElementFromClick(nativeEvent) {
6
- var left = nativeEvent.clientX;
7
- var top = nativeEvent.clientY;
8
- var right = left + 1;
9
- var bottom = top + 1;
6
+ const left = nativeEvent.clientX;
7
+ const top = nativeEvent.clientY;
8
+ const right = left + 1;
9
+ const bottom = top + 1;
10
10
  function getBoundingClientRect() {
11
11
  return {
12
- left: left,
13
- top: top,
14
- right: right,
15
- bottom: bottom,
12
+ left,
13
+ top,
14
+ right,
15
+ bottom,
16
16
  height: 1,
17
17
  width: 1,
18
18
  };
19
19
  }
20
20
  return {
21
- getBoundingClientRect: getBoundingClientRect,
21
+ getBoundingClientRect,
22
22
  };
23
23
  }
24
24
  //# sourceMappingURL=createVirtualElementFromClick.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createVirtualElementFromClick.js","sourceRoot":"","sources":["../src/createVirtualElementFromClick.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,6BAA6B,CAAC,WAAuB;IACnE,IAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC;IACjC,IAAM,GAAG,GAAG,WAAW,CAAC,OAAO,CAAC;IAChC,IAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC;IACvB,IAAM,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC;IAEvB,SAAS,qBAAqB;QAC5B,OAAO;YACL,IAAI,MAAA;YACJ,GAAG,KAAA;YACH,KAAK,OAAA;YACL,MAAM,QAAA;YAEN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,CAAC;SACT,CAAC;IACJ,CAAC;IAED,OAAO;QACL,qBAAqB,uBAAA;KACtB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"createVirtualElementFromClick.js","sourceRoot":"","sources":["../src/createVirtualElementFromClick.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,6BAA6B,CAAC,WAAuB;IACnE,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC;IACjC,MAAM,GAAG,GAAG,WAAW,CAAC,OAAO,CAAC;IAChC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC;IACvB,MAAM,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC;IAEvB,SAAS,qBAAqB;QAC5B,OAAO;YACL,IAAI;YACJ,GAAG;YACH,KAAK;YACL,MAAM;YAEN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,CAAC;SACT,CAAC;IACJ,CAAC;IAED,OAAO;QACL,qBAAqB;KACtB,CAAC;AACJ,CAAC"}
package/lib/usePopper.js CHANGED
@@ -13,7 +13,7 @@ import * as React from 'react';
13
13
  function hasAutofocusProp(node) {
14
14
  var _a;
15
15
  // https://github.com/facebook/react/blob/848bb2426e44606e0a55dfe44c7b3ece33772485/packages/react-dom/src/client/ReactDOMHostConfig.js#L157-L166
16
- var isAutoFocusableElement = node.nodeName === 'BUTTON' ||
16
+ const isAutoFocusableElement = node.nodeName === 'BUTTON' ||
17
17
  node.nodeName === 'INPUT' ||
18
18
  node.nodeName === 'SELECT' ||
19
19
  node.nodeName === 'TEXTAREA';
@@ -33,33 +33,30 @@ function hasAutofocusFilter(node) {
33
33
  * that can't be resolved properly during an initial rendering.
34
34
  */
35
35
  function usePopperOptions(options, popperOriginalPositionRef) {
36
- var arrowPadding = options.arrowPadding, autoSize = options.autoSize, coverTarget = options.coverTarget, flipBoundary = options.flipBoundary, offset = options.offset, onStateUpdate = options.onStateUpdate, overflowBoundary = options.overflowBoundary,
36
+ const { arrowPadding, autoSize, coverTarget, flipBoundary, offset, onStateUpdate, overflowBoundary,
37
37
  // eslint-disable-next-line @typescript-eslint/naming-convention
38
- unstable_disableTether = options.unstable_disableTether, pinned = options.pinned;
39
- var isRtl = useFluent().dir === 'rtl';
40
- var placement = getPlacement(options.align, options.position, isRtl);
41
- var strategy = options.positionFixed ? 'fixed' : 'absolute';
42
- var handleStateUpdate = useEventCallback(function (_a) {
43
- var state = _a.state;
38
+ unstable_disableTether, pinned, } = options;
39
+ const isRtl = useFluent().dir === 'rtl';
40
+ const placement = getPlacement(options.align, options.position, isRtl);
41
+ const strategy = options.positionFixed ? 'fixed' : 'absolute';
42
+ const handleStateUpdate = useEventCallback(({ state }) => {
44
43
  if (onStateUpdate) {
45
44
  onStateUpdate(state);
46
45
  }
47
46
  });
48
- var offsetModifier = React.useMemo(function () {
49
- return offset
50
- ? {
51
- name: 'offset',
52
- options: { offset: isRtl ? applyRtlToOffset(offset) : offset },
53
- }
54
- : null;
55
- }, [offset, isRtl]);
56
- return React.useCallback(function (target, container, arrow) {
47
+ const offsetModifier = React.useMemo(() => offset
48
+ ? {
49
+ name: 'offset',
50
+ options: { offset: isRtl ? applyRtlToOffset(offset) : offset },
51
+ }
52
+ : null, [offset, isRtl]);
53
+ return React.useCallback((target, container, arrow) => {
57
54
  var _a;
58
- var scrollParentElement = getScrollParent(container);
59
- var hasScrollableElement = scrollParentElement
55
+ const scrollParentElement = getScrollParent(container);
56
+ const hasScrollableElement = scrollParentElement
60
57
  ? scrollParentElement !== ((_a = scrollParentElement.ownerDocument) === null || _a === void 0 ? void 0 : _a.body)
61
58
  : false;
62
- var modifiers = [
59
+ const modifiers = [
63
60
  /**
64
61
  * We are setting the position to `fixed` in the first effect to prevent scroll jumps in case of the content
65
62
  * with managed focus. Modifier sets the position to `fixed` before all other modifier effects. Another part of
@@ -69,15 +66,14 @@ function usePopperOptions(options, popperOriginalPositionRef) {
69
66
  name: 'positionStyleFix',
70
67
  enabled: true,
71
68
  phase: 'afterWrite',
72
- effect: function (_a) {
73
- var state = _a.state, instance = _a.instance;
69
+ effect: ({ state, instance }) => {
74
70
  // ".isFirstRun" is a part of our patch, on a first evaluation it will "undefined"
75
71
  // should be disabled for subsequent runs as it breaks positioning for them
76
72
  if (instance.isFirstRun !== false) {
77
73
  popperOriginalPositionRef.current = state.elements.popper.style.position;
78
74
  state.elements.popper.style.position = 'fixed';
79
75
  }
80
- return function () { return undefined; };
76
+ return () => undefined;
81
77
  },
82
78
  requires: [],
83
79
  },
@@ -139,25 +135,24 @@ function usePopperOptions(options, popperOriginalPositionRef) {
139
135
  altBoundary: true,
140
136
  boundary: getBoundary(container, overflowBoundary),
141
137
  },
142
- fn: function (_a) {
143
- var state = _a.state, modifierOptions = _a.options;
144
- var overflow = PopperJs.detectOverflow(state, modifierOptions);
145
- var _b = state.modifiersData.preventOverflow || { x: 0, y: 0 }, x = _b.x, y = _b.y;
146
- var _c = state.rects.popper, width = _c.width, height = _c.height;
147
- var basePlacement = getBasePlacement(state.placement);
148
- var widthProp = basePlacement === 'left' ? 'left' : 'right';
149
- var heightProp = basePlacement === 'top' ? 'top' : 'bottom';
150
- var applyMaxWidth = autoSize === 'always' ||
138
+ fn({ state, options: modifierOptions }) {
139
+ const overflow = PopperJs.detectOverflow(state, modifierOptions);
140
+ const { x, y } = state.modifiersData.preventOverflow || { x: 0, y: 0 };
141
+ const { width, height } = state.rects.popper;
142
+ const basePlacement = getBasePlacement(state.placement);
143
+ const widthProp = basePlacement === 'left' ? 'left' : 'right';
144
+ const heightProp = basePlacement === 'top' ? 'top' : 'bottom';
145
+ const applyMaxWidth = autoSize === 'always' ||
151
146
  autoSize === 'width-always' ||
152
147
  (overflow[widthProp] > 0 && (autoSize === true || autoSize === 'width'));
153
- var applyMaxHeight = autoSize === 'always' ||
148
+ const applyMaxHeight = autoSize === 'always' ||
154
149
  autoSize === 'height-always' ||
155
150
  (overflow[heightProp] > 0 && (autoSize === true || autoSize === 'height'));
156
151
  if (applyMaxWidth) {
157
- state.styles.popper.maxWidth = width - overflow[widthProp] - x + "px";
152
+ state.styles.popper.maxWidth = `${width - overflow[widthProp] - x}px`;
158
153
  }
159
154
  if (applyMaxHeight) {
160
- state.styles.popper.maxHeight = height - overflow[heightProp] - y + "px";
155
+ state.styles.popper.maxHeight = `${height - overflow[heightProp] - y}px`;
161
156
  }
162
157
  },
163
158
  },
@@ -178,9 +173,8 @@ function usePopperOptions(options, popperOriginalPositionRef) {
178
173
  enabled: !!coverTarget,
179
174
  phase: 'main',
180
175
  requiresIfExists: ['offset', 'preventOverflow', 'flip'],
181
- fn: function (_a) {
182
- var state = _a.state;
183
- var basePlacement = getBasePlacement(state.placement);
176
+ fn({ state }) {
177
+ const basePlacement = getBasePlacement(state.placement);
184
178
  switch (basePlacement) {
185
179
  case 'bottom':
186
180
  state.modifiersData.popperOffsets.y -= state.rects.reference.height;
@@ -198,11 +192,11 @@ function usePopperOptions(options, popperOriginalPositionRef) {
198
192
  },
199
193
  },
200
194
  ].filter(Boolean); // filter boolean conditional spreading values
201
- var popperOptions = {
202
- modifiers: modifiers,
203
- placement: placement,
204
- strategy: strategy,
205
- onFirstUpdate: function (state) { return handleStateUpdate({ state: state }); },
195
+ const popperOptions = {
196
+ modifiers,
197
+ placement,
198
+ strategy,
199
+ onFirstUpdate: state => handleStateUpdate({ state }),
206
200
  };
207
201
  return popperOptions;
208
202
  }, [
@@ -229,19 +223,18 @@ function usePopperOptions(options, popperOriginalPositionRef) {
229
223
  * - contains a specific to React fix related to initial positioning when containers have components with managed focus
230
224
  * to avoid focus jumps
231
225
  */
232
- export function usePopper(options) {
233
- if (options === void 0) { options = {}; }
234
- var _a = options.enabled, enabled = _a === void 0 ? true : _a;
235
- var isFirstMount = useFirstMount();
236
- var popperOriginalPositionRef = React.useRef('absolute');
237
- var resolvePopperOptions = usePopperOptions(options, popperOriginalPositionRef);
238
- var popperInstanceRef = React.useRef(null);
239
- var handlePopperUpdate = useEventCallback(function () {
226
+ export function usePopper(options = {}) {
227
+ const { enabled = true } = options;
228
+ const isFirstMount = useFirstMount();
229
+ const popperOriginalPositionRef = React.useRef('absolute');
230
+ const resolvePopperOptions = usePopperOptions(options, popperOriginalPositionRef);
231
+ const popperInstanceRef = React.useRef(null);
232
+ const handlePopperUpdate = useEventCallback(() => {
240
233
  var _a;
241
234
  (_a = popperInstanceRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
242
235
  popperInstanceRef.current = null;
243
- var _b = options.target, target = _b === void 0 ? targetRef.current : _b;
244
- var popperInstance = null;
236
+ const { target = targetRef.current } = options;
237
+ let popperInstance = null;
245
238
  if (canUseDOM() && enabled) {
246
239
  if (target && containerRef.current) {
247
240
  popperInstance = PopperJs.createPopper(target, containerRef.current, resolvePopperOptions(target, containerRef.current, arrowRef.current));
@@ -252,14 +245,14 @@ export function usePopper(options) {
252
245
  * The patch updates `.forceUpdate()` Popper function which restores the original position before the first
253
246
  * forceUpdate() call. See also "positionStyleFix" modifier in usePopperOptions().
254
247
  */
255
- var originalForceUpdate_1 = popperInstance.forceUpdate;
248
+ const originalForceUpdate = popperInstance.forceUpdate;
256
249
  popperInstance.isFirstRun = true;
257
- popperInstance.forceUpdate = function () {
250
+ popperInstance.forceUpdate = () => {
258
251
  if (popperInstance === null || popperInstance === void 0 ? void 0 : popperInstance.isFirstRun) {
259
252
  popperInstance.state.elements.popper.style.position = popperOriginalPositionRef.current;
260
253
  popperInstance.isFirstRun = false;
261
254
  }
262
- originalForceUpdate_1();
255
+ originalForceUpdate();
263
256
  };
264
257
  }
265
258
  popperInstanceRef.current = popperInstance;
@@ -284,24 +277,24 @@ export function usePopper(options) {
284
277
  //
285
278
  // This again can be solved with callback refs. It's not a huge issue as with hooks we are moving popper's creation
286
279
  // to ChatMessage itself, however, without `useCallback()` refs it's still a Pandora box.
287
- var targetRef = useCallbackRef(null, handlePopperUpdate, true);
288
- var containerRef = useCallbackRef(null, handlePopperUpdate, true);
289
- var arrowRef = useCallbackRef(null, handlePopperUpdate, true);
290
- React.useImperativeHandle(options.popperRef, function () { return ({
291
- updatePosition: function () {
280
+ const targetRef = useCallbackRef(null, handlePopperUpdate, true);
281
+ const containerRef = useCallbackRef(null, handlePopperUpdate, true);
282
+ const arrowRef = useCallbackRef(null, handlePopperUpdate, true);
283
+ React.useImperativeHandle(options.popperRef, () => ({
284
+ updatePosition: () => {
292
285
  var _a;
293
286
  (_a = popperInstanceRef.current) === null || _a === void 0 ? void 0 : _a.update();
294
287
  },
295
- }); }, []);
296
- useIsomorphicLayoutEffect(function () {
288
+ }), []);
289
+ useIsomorphicLayoutEffect(() => {
297
290
  handlePopperUpdate();
298
- return function () {
291
+ return () => {
299
292
  var _a;
300
293
  (_a = popperInstanceRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
301
294
  popperInstanceRef.current = null;
302
295
  };
303
296
  }, [handlePopperUpdate, options.enabled, options.target]);
304
- useIsomorphicLayoutEffect(function () {
297
+ useIsomorphicLayoutEffect(() => {
305
298
  var _a;
306
299
  if (!isFirstMount) {
307
300
  (_a = popperInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setOptions(resolvePopperOptions(options.target || targetRef.current, containerRef.current, arrowRef.current));
@@ -316,15 +309,15 @@ export function usePopper(options) {
316
309
  if (process.env.NODE_ENV !== 'production') {
317
310
  // This checked should run only in development mode
318
311
  // eslint-disable-next-line react-hooks/rules-of-hooks
319
- React.useEffect(function () {
312
+ React.useEffect(() => {
320
313
  var _a;
321
314
  if (containerRef.current) {
322
- var contentNode = containerRef.current;
323
- var treeWalker = (_a = contentNode.ownerDocument) === null || _a === void 0 ? void 0 : _a.createTreeWalker(contentNode, NodeFilter.SHOW_ELEMENT, {
315
+ const contentNode = containerRef.current;
316
+ const treeWalker = (_a = contentNode.ownerDocument) === null || _a === void 0 ? void 0 : _a.createTreeWalker(contentNode, NodeFilter.SHOW_ELEMENT, {
324
317
  acceptNode: hasAutofocusFilter,
325
318
  });
326
319
  while (treeWalker === null || treeWalker === void 0 ? void 0 : treeWalker.nextNode()) {
327
- var node = treeWalker.currentNode;
320
+ const node = treeWalker.currentNode;
328
321
  // eslint-disable-next-line no-console
329
322
  console.warn('<Popper>:', node);
330
323
  // eslint-disable-next-line no-console
@@ -338,7 +331,7 @@ export function usePopper(options) {
338
331
  '(React.useEffect(), componentDidMount(), etc.) and we can not prevent this behavior. If you really',
339
332
  'want to use "autoFocus" please add "position: fixed" to styles of the element that is wrapped by',
340
333
  '"Popper".',
341
- "In general, it's not recommended to use \"autoFocus\" as it may break accessibility aspects:",
334
+ `In general, it's not recommended to use "autoFocus" as it may break accessibility aspects:`,
342
335
  'https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-autofocus.md',
343
336
  '\n',
344
337
  'We suggest to use the "trapFocus" prop on Fluent components or a catch "ref" and then use',
@@ -352,6 +345,6 @@ export function usePopper(options) {
352
345
  // eslint-disable-next-line react-hooks/exhaustive-deps
353
346
  }, []);
354
347
  }
355
- return { targetRef: targetRef, containerRef: containerRef, arrowRef: arrowRef };
348
+ return { targetRef, containerRef, arrowRef };
356
349
  }
357
350
  //# sourceMappingURL=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AAC,GAAG,EAAE;;YACnB,IAAI,YAAY,CAAC,OAAO,EAAE;gBACxB,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC;gBACzC,MAAM,UAAU,SAAG,WAAW,CAAC,aAAa,0CAAE,gBAAgB,CAAC,WAAW,EAAE,UAAU,CAAC,YAAY,EAAE;oBACnG,UAAU,EAAE,kBAAkB;iBAC/B,CAAC,CAAC;gBAEH,OAAO,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,QAAQ,IAAI;oBAC7B,MAAM,IAAI,GAAG,UAAU,CAAC,WAAW,CAAC;oBACpC,sCAAsC;oBACtC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;oBAChC,sCAAsC;oBACtC,OAAO,CAAC,IAAI,CACV;wBACE,gGAAgG;wBAChG,qGAAqG;wBACrG,2EAA2E;wBAC3E,uEAAuE;wBACvE,IAAI;wBACJ,yFAAyF;wBACzF,oGAAoG;wBACpG,kGAAkG;wBAClG,WAAW;wBACX,4FAA4F;wBAC5F,6FAA6F;wBAC7F,IAAI;wBACJ,2FAA2F;wBAC3F,2CAA2C;wBAC3C,8EAA8E;qBAC/E,CAAC,IAAI,CAAC,GAAG,CAAC,CACZ,CAAC;iBACH;aACF;YACD,mDAAmD;YACnD,0EAA0E;YAC1E,uDAAuD;QACzD,CAAC,EAAE,EAAE,CAAC,CAAC;KACR;IAED,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;AAC/C,CAAC"}
@@ -8,14 +8,14 @@ import { createVirtualElementFromClick } from './createVirtualElementFromClick';
8
8
  * @param initialState - initializes a user provided state similare to useState
9
9
  * @returns state and dispatcher for a Popper virtual element that uses native/synthetic mouse events
10
10
  */
11
- export var usePopperMouseTarget = function (initialState) {
12
- var _a = React.useState(initialState), virtualElement = _a[0], setVirtualElement = _a[1];
13
- var setVirtualMouseTarget = function (event) {
11
+ export const usePopperMouseTarget = (initialState) => {
12
+ const [virtualElement, setVirtualElement] = React.useState(initialState);
13
+ const setVirtualMouseTarget = (event) => {
14
14
  if (event === undefined || event === null) {
15
15
  setVirtualElement(undefined);
16
16
  return;
17
17
  }
18
- var mouseevent;
18
+ let mouseevent;
19
19
  if (!(event instanceof MouseEvent)) {
20
20
  mouseevent = event.nativeEvent;
21
21
  }
@@ -26,7 +26,7 @@ export var usePopperMouseTarget = function (initialState) {
26
26
  // eslint-disable-next-line no-console
27
27
  console.error('usePopperMouseTarget should only be used with MouseEvent');
28
28
  }
29
- var contextTarget = createVirtualElementFromClick(mouseevent);
29
+ const contextTarget = createVirtualElementFromClick(mouseevent);
30
30
  setVirtualElement(contextTarget);
31
31
  };
32
32
  return [virtualElement, setVirtualMouseTarget];
@@ -1 +1 @@
1
- {"version":3,"file":"usePopperMouseTarget.js","sourceRoot":"","sources":["../src/usePopperMouseTarget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAGhF;;;;;;;GAOG;AACH,MAAM,CAAC,IAAM,oBAAoB,GAAG,UAAC,YAAwE;IACrG,IAAA,KAAsC,KAAK,CAAC,QAAQ,CAAsC,YAAY,CAAC,EAAtG,cAAc,QAAA,EAAE,iBAAiB,QAAqE,CAAC;IAE9G,IAAM,qBAAqB,GAAG,UAAC,KAAuD;QACpF,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE;YACzC,iBAAiB,CAAC,SAAS,CAAC,CAAC;YAC7B,OAAO;SACR;QAED,IAAI,UAAsB,CAAC;QAC3B,IAAI,CAAC,CAAC,KAAK,YAAY,UAAU,CAAC,EAAE;YAClC,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC;SAChC;aAAM;YACL,UAAU,GAAG,KAAK,CAAC;SACpB;QAED,IAAI,CAAC,CAAC,UAAU,YAAY,UAAU,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,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,CAAC;IACnC,CAAC,CAAC;IAEF,OAAO,CAAC,cAAc,EAAE,qBAAqB,CAAU,CAAC;AAC1D,CAAC,CAAC"}
@@ -7,7 +7,7 @@ export function getBoundary(element, boundary) {
7
7
  return element === null || element === void 0 ? void 0 : element.ownerDocument.documentElement;
8
8
  }
9
9
  if (boundary === 'scrollParent') {
10
- var boundariesNode = getScrollParent(element);
10
+ let boundariesNode = getScrollParent(element);
11
11
  if (boundariesNode.nodeName === 'BODY') {
12
12
  boundariesNode = element === null || element === void 0 ? void 0 : element.ownerDocument.documentElement;
13
13
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="custom-global" />
2
1
  import * as React from 'react';
3
2
  declare type ReactEventResponder<E, C> = {
4
3
  $$typeof: Symbol | number;
@@ -27,7 +27,7 @@ export function getReactFiberFromNode(elm) {
27
27
  if (!elm) {
28
28
  return null;
29
29
  }
30
- for (var k in elm) {
30
+ for (const k in elm) {
31
31
  // React 16 uses "__reactInternalInstance$" prefix
32
32
  // React 17 uses "__reactFiber$" prefix
33
33
  // https://github.com/facebook/react/pull/18377
@@ -1 +1 @@
1
- {"version":3,"file":"getReactFiberFromNode.js","sourceRoot":"","sources":["../../src/utils/getReactFiberFromNode.ts"],"names":[],"mappings":"AAuEA,IAAK,OAuBJ;AAvBD,WAAK,OAAO;IACV,+DAAqB,CAAA;IACrB,yDAAkB,CAAA;IAClB,yEAA0B,CAAA;IAC1B,6CAAY,CAAA;IACZ,iDAAc,CAAA;IACd,uDAAiB,CAAA;IACjB,6CAAY,CAAA;IACZ,6CAAY,CAAA;IACZ,qCAAQ,CAAA;IACR,2DAAmB,CAAA;IACnB,4DAAoB,CAAA;IACpB,kDAAe,CAAA;IACf,8CAAa,CAAA;IACb,gEAAsB,CAAA;IACtB,wDAAkB,CAAA;IAClB,oEAAwB,CAAA;IACxB,wDAAkB,CAAA;IAClB,8EAA6B,CAAA;IAC7B,kEAAuB,CAAA;IACvB,wEAA0B,CAAA;IAC1B,sEAAyB,CAAA;IACzB,0DAAmB,CAAA;AACrB,CAAC,EAvBI,OAAO,KAAP,OAAO,QAuBX;AA+JD,MAAM,UAAU,qBAAqB,CAAC,GAAqB;IACzD,IAAI,CAAC,GAAG,EAAE;QACR,OAAO,IAAI,CAAC;KACb;IAED,KAAK,IAAM,CAAC,IAAI,GAAG,EAAE;QACnB,kDAAkD;QAClD,uCAAuC;QACvC,+CAA+C;QAC/C,IAAI,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE;YACnF,6DAA6D;YAC7D,aAAa;YACb,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;SACf;KACF;IAED,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;AAC7E,CAAC"}
1
+ {"version":3,"file":"getReactFiberFromNode.js","sourceRoot":"","sources":["../../src/utils/getReactFiberFromNode.ts"],"names":[],"mappings":"AAuEA,IAAK,OAuBJ;AAvBD,WAAK,OAAO;IACV,+DAAqB,CAAA;IACrB,yDAAkB,CAAA;IAClB,yEAA0B,CAAA;IAC1B,6CAAY,CAAA;IACZ,iDAAc,CAAA;IACd,uDAAiB,CAAA;IACjB,6CAAY,CAAA;IACZ,6CAAY,CAAA;IACZ,qCAAQ,CAAA;IACR,2DAAmB,CAAA;IACnB,4DAAoB,CAAA;IACpB,kDAAe,CAAA;IACf,8CAAa,CAAA;IACb,gEAAsB,CAAA;IACtB,wDAAkB,CAAA;IAClB,oEAAwB,CAAA;IACxB,wDAAkB,CAAA;IAClB,8EAA6B,CAAA;IAC7B,kEAAuB,CAAA;IACvB,wEAA0B,CAAA;IAC1B,sEAAyB,CAAA;IACzB,0DAAmB,CAAA;AACrB,CAAC,EAvBI,OAAO,KAAP,OAAO,QAuBX;AA+JD,MAAM,UAAU,qBAAqB,CAAC,GAAqB;IACzD,IAAI,CAAC,GAAG,EAAE;QACR,OAAO,IAAI,CAAC;KACb;IAED,KAAK,MAAM,CAAC,IAAI,GAAG,EAAE;QACnB,kDAAkD;QAClD,uCAAuC;QACvC,+CAA+C;QAC/C,IAAI,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE;YACnF,6DAA6D;YAC7D,aAAa;YACb,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;SACf;KACF;IAED,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;AAC7E,CAAC"}
@@ -3,7 +3,7 @@
3
3
  * @param node - DOM node.
4
4
  * @returns - parent DOM node.
5
5
  */
6
- export var getParentNode = function (node) {
6
+ export const getParentNode = (node) => {
7
7
  if (node.nodeName === 'HTML') {
8
8
  return node;
9
9
  }
@@ -15,12 +15,12 @@ export var getParentNode = function (node) {
15
15
  * @param node - DOM node.
16
16
  * @returns - CSS styles.
17
17
  */
18
- var getStyleComputedProperty = function (node) {
18
+ const getStyleComputedProperty = (node) => {
19
19
  var _a;
20
20
  if (node.nodeType !== 1) {
21
21
  return {};
22
22
  }
23
- var window = (_a = node.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView;
23
+ const window = (_a = node.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView;
24
24
  return window.getComputedStyle(node, null);
25
25
  };
26
26
  /**
@@ -28,9 +28,9 @@ var getStyleComputedProperty = function (node) {
28
28
  * @param node - DOM node.
29
29
  * @returns - the first scrollable parent.
30
30
  */
31
- export var getScrollParent = function (node) {
31
+ export const getScrollParent = (node) => {
32
32
  // Return body, `getScroll` will take care to get the correct `scrollTop` from it
33
- var parentNode = node && getParentNode(node);
33
+ const parentNode = node && getParentNode(node);
34
34
  // eslint-disable-next-line
35
35
  if (!parentNode)
36
36
  return document.body;
@@ -42,7 +42,7 @@ export var getScrollParent = function (node) {
42
42
  return parentNode.body;
43
43
  }
44
44
  // If any of the overflow props is defined for the node then we return it as the parent
45
- var _a = getStyleComputedProperty(parentNode), overflow = _a.overflow, overflowX = _a.overflowX, overflowY = _a.overflowY;
45
+ const { overflow, overflowX, overflowY } = getStyleComputedProperty(parentNode);
46
46
  if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
47
47
  return parentNode;
48
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getScrollParent.js","sourceRoot":"","sources":["../../src/utils/getScrollParent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,IAAM,aAAa,GAAG,UAAC,IAAiB;IAC7C,IAAI,IAAI,CAAC,QAAQ,KAAK,MAAM,EAAE;QAC5B,OAAO,IAAI,CAAC;KACb;IACD,8DAA8D;IAC9D,OAAO,IAAI,CAAC,UAAU,IAAK,IAAY,CAAC,IAAI,CAAC;AAC/C,CAAC,CAAC;AAEF;;;;GAIG;AACH,IAAM,wBAAwB,GAAG,UAAC,IAAiB;;IACjD,IAAI,IAAI,CAAC,QAAQ,KAAK,CAAC,EAAE;QACvB,OAAO,EAAE,CAAC;KACX;IAED,IAAM,MAAM,SAAG,IAAI,CAAC,aAAa,0CAAE,WAAW,CAAC;IAC/C,OAAO,MAAO,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC9C,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,IAAM,eAAe,GAAG,UAAC,IAAmC;IACjE,iFAAiF;IACjF,IAAM,UAAU,GAAG,IAAI,IAAI,aAAa,CAAC,IAAmB,CAAC,CAAC;IAC9D,2BAA2B;IAC3B,IAAI,CAAC,UAAU;QAAE,OAAO,QAAQ,CAAC,IAAI,CAAC;IAEtC,QAAQ,UAAU,CAAC,QAAQ,EAAE;QAC3B,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM;YACT,OAAO,UAAU,CAAC,aAAc,CAAC,IAAI,CAAC;QACxC,KAAK,WAAW;YACd,OAAS,UAAmC,CAAC,IAAI,CAAC;KACrD;IAED,uFAAuF;IACjF,IAA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CAAC,aAAc,CAAC,IAAI,CAAC;QACxC,KAAK,WAAW;YACd,OAAS,UAAmC,CAAC,IAAI,CAAC;KACrD;IAED,uFAAuF;IACvF,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,wBAAwB,CAAC,UAAU,CAAC,CAAC;IAChF,IAAI,uBAAuB,CAAC,IAAI,CAAC,QAAS,GAAG,SAAU,GAAG,SAAS,CAAC,EAAE;QACpE,OAAO,UAAU,CAAC;KACnB;IAED,OAAO,eAAe,CAAC,UAAU,CAAC,CAAC;AACrC,CAAC,CAAC"}
@@ -7,7 +7,7 @@
7
7
  * @returns User offset augmented with arrow height
8
8
  */
9
9
  export function mergeArrowOffset(userOffset, arrowHeight) {
10
- var offsetWithArrow = userOffset;
10
+ let offsetWithArrow = userOffset;
11
11
  if (!userOffset) {
12
12
  return [0, arrowHeight];
13
13
  }
@@ -16,9 +16,9 @@ export function mergeArrowOffset(userOffset, arrowHeight) {
16
16
  return offsetWithArrow;
17
17
  }
18
18
  if (typeof offsetWithArrow === 'function') {
19
- var userOffsetFn_1 = offsetWithArrow;
20
- offsetWithArrow = function (offsetParams) {
21
- var offset = userOffsetFn_1(offsetParams);
19
+ const userOffsetFn = offsetWithArrow;
20
+ offsetWithArrow = offsetParams => {
21
+ const offset = userOffsetFn(offsetParams);
22
22
  setArrowOffset(offset, arrowHeight);
23
23
  return offset;
24
24
  };
@@ -26,7 +26,7 @@ export function mergeArrowOffset(userOffset, arrowHeight) {
26
26
  // This should never happen
27
27
  return [0, 0];
28
28
  }
29
- var setArrowOffset = function (offset, arrowHeight) {
29
+ const setArrowOffset = (offset, arrowHeight) => {
30
30
  if (offset[1] !== null && offset[1] !== undefined) {
31
31
  offset[1] += arrowHeight;
32
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"mergeArrowOffset.js","sourceRoot":"","sources":["../../src/utils/mergeArrowOffset.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,UAAU,g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