UNPKG

jobiqo-cl

Version:

[![CircleCI](https://circleci.com/gh/jobiqo/jobiqo-cl.svg?style=svg&circle-token=5a24efa5b8bbc4879276123e77d0d3f35ca7144c)](https://circleci.com/gh/jobiqo/jobiqo-cl)

47 lines (41 loc) 2.39 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var tslib_es6 = require('../../../tslib/tslib.es6.js'); var React = require('react'); var React__default = _interopDefault(React); require('../../../use-callback-ref/dist/es2015/assignRef.js'); require('../../../use-callback-ref/dist/es2015/useRef.js'); var useMergeRef = require('../../../use-callback-ref/dist/es2015/useMergeRef.js'); var constants = require('../../../react-remove-scroll-bar/dist/es2015/constants.js'); var medium = require('./medium.js'); var nothing = function () { return; }; var RemoveScroll = React.forwardRef(function (props, parentRef) { var ref = React.useRef(null); var _a = React.useState({ onScrollCapture: nothing, onWheelCapture: nothing, onTouchMoveCapture: nothing }), callbacks = _a[0], setCallbacks = _a[1]; var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, rest = tslib_es6.__rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom"]); var SideCar = sideCar; var containerProps = tslib_es6.__assign({ ref: useMergeRef.useMergeRefs([ ref, parentRef ]) }, rest, callbacks); return (React.createElement(React.Fragment, null, enabled && (React.createElement(SideCar, { sideCar: medium.effectCar, removeScrollBar: removeScrollBar, shards: shards, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref })), forwardProps ? (React.cloneElement(React.Children.only(children), containerProps)) : (React.createElement("div", tslib_es6.__assign({}, containerProps, { className: className }), children)))); }); RemoveScroll.defaultProps = { enabled: true, removeScrollBar: true, inert: false }; RemoveScroll.classNames = { fullWidth: constants.fullWidthClassName, zeroRight: constants.zeroRightClassName }; exports.RemoveScroll = RemoveScroll;