react-focus-on 3.9.0 → 3.9.2

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/dist/es2015/UI.js CHANGED
@@ -3,6 +3,7 @@ import * as React from 'react';
3
3
  import { RemoveScroll } from 'react-remove-scroll/UI';
4
4
  import ReactFocusLock from 'react-focus-lock/UI';
5
5
  import { effectCar } from './medium';
6
+ var PREVENT_SCROLL = { preventScroll: true };
6
7
  export var FocusOn = React.forwardRef(function (props, parentRef) {
7
8
  var _a = React.useState(false), lockProps = _a[0], setLockProps = _a[1];
8
9
  var children = props.children, autoFocus = props.autoFocus, shards = props.shards, crossFrame = props.crossFrame, _b = props.enabled, enabled = _b === void 0 ? true : _b, _c = props.scrollLock, scrollLock = _c === void 0 ? true : _c, _d = props.focusLock, focusLock = _d === void 0 ? true : _d, _e = props.returnFocus, returnFocus = _e === void 0 ? true : _e, inert = props.inert, allowPinchZoom = props.allowPinchZoom, sideCar = props.sideCar, className = props.className, shouldIgnore = props.shouldIgnore, preventScrollOnFocus = props.preventScrollOnFocus, style = props.style, as = props.as, gapMode = props.gapMode, rest = __rest(props, ["children", "autoFocus", "shards", "crossFrame", "enabled", "scrollLock", "focusLock", "returnFocus", "inert", "allowPinchZoom", "sideCar", "className", "shouldIgnore", "preventScrollOnFocus", "style", "as", "gapMode"]);
@@ -16,7 +17,7 @@ export var FocusOn = React.forwardRef(function (props, parentRef) {
16
17
  gapMode: gapMode,
17
18
  inert: inert, enabled: enabled && scrollLock });
18
19
  return (React.createElement(React.Fragment, null,
19
- React.createElement(ReactFocusLock, { ref: parentRef, sideCar: sideCar, disabled: !(lockProps && enabled && focusLock), returnFocus: returnFocus, autoFocus: autoFocus, shards: shards, crossFrame: crossFrame, onActivation: onActivation, onDeactivation: onDeactivation, className: className, whiteList: shouldIgnore, lockProps: appliedLockProps, focusOptions: preventScrollOnFocus ? { preventScroll: true } : undefined, as: RemoveScroll }, children),
20
+ React.createElement(ReactFocusLock, { ref: parentRef, sideCar: sideCar, disabled: !(lockProps && enabled && focusLock), returnFocus: returnFocus, autoFocus: autoFocus, shards: shards, crossFrame: crossFrame, onActivation: onActivation, onDeactivation: onDeactivation, className: className, whiteList: shouldIgnore, lockProps: appliedLockProps, focusOptions: preventScrollOnFocus ? PREVENT_SCROLL : undefined, as: RemoveScroll }, children),
20
21
  enabled && (React.createElement(SideCar, __assign({}, rest, { sideCar: effectCar, setLockProps: setLockProps, shards: shards })))));
21
22
  });
22
23
  export * from './reExports';
package/dist/es5/UI.js CHANGED
@@ -6,6 +6,7 @@ var React = require("react");
6
6
  var UI_1 = require("react-remove-scroll/UI");
7
7
  var UI_2 = require("react-focus-lock/UI");
8
8
  var medium_1 = require("./medium");
9
+ var PREVENT_SCROLL = { preventScroll: true };
9
10
  exports.FocusOn = React.forwardRef(function (props, parentRef) {
10
11
  var _a = React.useState(false), lockProps = _a[0], setLockProps = _a[1];
11
12
  var children = props.children, autoFocus = props.autoFocus, shards = props.shards, crossFrame = props.crossFrame, _b = props.enabled, enabled = _b === void 0 ? true : _b, _c = props.scrollLock, scrollLock = _c === void 0 ? true : _c, _d = props.focusLock, focusLock = _d === void 0 ? true : _d, _e = props.returnFocus, returnFocus = _e === void 0 ? true : _e, inert = props.inert, allowPinchZoom = props.allowPinchZoom, sideCar = props.sideCar, className = props.className, shouldIgnore = props.shouldIgnore, preventScrollOnFocus = props.preventScrollOnFocus, style = props.style, as = props.as, gapMode = props.gapMode, rest = tslib_1.__rest(props, ["children", "autoFocus", "shards", "crossFrame", "enabled", "scrollLock", "focusLock", "returnFocus", "inert", "allowPinchZoom", "sideCar", "className", "shouldIgnore", "preventScrollOnFocus", "style", "as", "gapMode"]);
@@ -19,7 +20,7 @@ exports.FocusOn = React.forwardRef(function (props, parentRef) {
19
20
  gapMode: gapMode,
20
21
  inert: inert, enabled: enabled && scrollLock });
21
22
  return (React.createElement(React.Fragment, null,
22
- React.createElement(UI_2.default, { ref: parentRef, sideCar: sideCar, disabled: !(lockProps && enabled && focusLock), returnFocus: returnFocus, autoFocus: autoFocus, shards: shards, crossFrame: crossFrame, onActivation: onActivation, onDeactivation: onDeactivation, className: className, whiteList: shouldIgnore, lockProps: appliedLockProps, focusOptions: preventScrollOnFocus ? { preventScroll: true } : undefined, as: UI_1.RemoveScroll }, children),
23
+ React.createElement(UI_2.default, { ref: parentRef, sideCar: sideCar, disabled: !(lockProps && enabled && focusLock), returnFocus: returnFocus, autoFocus: autoFocus, shards: shards, crossFrame: crossFrame, onActivation: onActivation, onDeactivation: onDeactivation, className: className, whiteList: shouldIgnore, lockProps: appliedLockProps, focusOptions: preventScrollOnFocus ? PREVENT_SCROLL : undefined, as: UI_1.RemoveScroll }, children),
23
24
  enabled && (React.createElement(SideCar, tslib_1.__assign({}, rest, { sideCar: medium_1.effectCar, setLockProps: setLockProps, shards: shards })))));
24
25
  });
25
26
  tslib_1.__exportStar(require("./reExports"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-focus-on",
3
- "version": "3.9.0",
3
+ "version": "3.9.2",
4
4
  "description": "The final solution for WAI ARIA compatible modal dialogs or full-screen tasks.",
5
5
  "main": "dist/es5/index.js",
6
6
  "scripts": {
@@ -45,9 +45,9 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "aria-hidden": "^1.2.2",
48
- "react-focus-lock": "^2.9.4",
49
- "react-remove-scroll": "^2.5.6",
50
- "react-style-singleton": "^2.2.0",
48
+ "react-focus-lock": "^2.11.2",
49
+ "react-remove-scroll": "^2.5.7",
50
+ "react-style-singleton": "^2.2.1",
51
51
  "tslib": "^2.3.1",
52
52
  "use-callback-ref": "^1.3.0",
53
53
  "use-sidecar": "^1.1.2"