Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/**
* Set positioning priority template
*/
slidePriority: PropTypes.arrayOf(
PropTypes.oneOf([
'slideOnCurrentEdge',
'slideOnOppositeEdge',
'slideOnAdjacentEdge',
'changeType',
]),
),
/**
* Specify function to call on overflow
*/
onOverflow: PropTypes.func,
...Portal.propTypes,
children: PropTypes.oneOfType([
PropTypes.func,
PropTypes.element,
]).isRequired,
};
const defaultProps = {
parent: window,
wrapper: window,
positionStyle: 'absolute',
visible: false,
positionX: 'left',
positionY: 'top',
type: 'inner',
direction: 'horizontal',
overflowMargin: -5,
/**
* @author Dmitriy Malakhov
*/
'use strict';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Portal from 'react-portal';
import pick from 'lodash.pick';
import throttle from 'lodash.throttle';
import { noop } from 'reactackle-core';
const SCROLL_THROTTLE_DELAY = 20;
const keysPortalPropTypes = Object.keys(Portal.propTypes);
const propTypes = {
/**
* Define the element to which the component will be positioned
*/
parent: PropTypes.object,
/**
* Define boundaries to which the component will be positioned
*/
wrapper: PropTypes.object,
/**
* Determines css position property. We recommend to use 'absolute'
* positioning as it requires less calculations and is more effective.
*/
positionStyle: PropTypes.oneOf(['fixed', 'absolute']),
/**