File: //usr/share/opensearch-dashboards/node_modules/react-focus-on/dist/es5/component.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var UI_1 = require("react-remove-scroll/UI");
var UI_2 = require("react-focus-lock/UI");
var InteractivityDisabler_1 = require("./InteractivityDisabler");
var extractRef = function (ref) { return (('current' in ref) ? ref.current : ref); };
function ReactFocusOn(props) {
var _a = React.useState(null), lockProps = _a[0], setLockProps = _a[1];
var _b = this.props, children = _b.children, autoFocus = _b.autoFocus, shards = _b.shards, _c = _b.enabled, enabled = _c === void 0 ? true : _c, _d = _b.scrollLock, scrollLock = _d === void 0 ? true : _d, _e = _b.focusLock, focusLock = _e === void 0 ? true : _e, sideCar = _b.sideCar;
return (React.createElement(React.Fragment, null,
React.createElement(UI_1.RemoveScroll, { sideCar: enabled && sideCar, enabled: enabled && scrollLock, shards: shards },
enabled && React.createElement(InteractivityDisabler_1.InteractivityDisabler, null),
React.createElement(UI_2.default, { sideCar: enabled && sideCar, disabled: !(this.state.lockProps && enabled && focusLock), returnFocus: true, autoFocus: autoFocus, onActivation: this.onActivation, onDeactivation: this.onDeactivation, shards: shards, lockProps: lockProps }, children))));
}
exports.ReactFocusOn = ReactFocusOn;