@elliemae/ds-popper 1.60.0 → 2.0.0-alpha.12
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/cjs/DSPopper.js +42 -55
- package/cjs/PopperContent.js +116 -146
- package/cjs/PopperImpl.js +273 -322
- package/cjs/getArrowStylesBySize.js +10 -6
- package/cjs/index.js +1 -20
- package/cjs/interaction.js +2 -3
- package/cjs/positions.js +2 -3
- package/cjs/props.js +10 -27
- package/esm/DSPopper.js +40 -53
- package/esm/PopperContent.js +113 -137
- package/esm/PopperImpl.js +273 -314
- package/esm/getArrowStylesBySize.js +8 -4
- package/esm/index.js +0 -19
- package/esm/interaction.js +2 -3
- package/esm/positions.js +2 -3
- package/esm/props.js +10 -27
- package/package.json +56 -11
- package/types/DSPopper.d.ts +188 -0
- package/types/PopperContent.d.ts +21 -0
- package/types/PopperImpl.d.ts +52 -0
- package/types/getArrowStylesBySize.d.ts +2 -0
- package/types/index.d.ts +3 -0
- package/types/interaction.d.ts +5 -0
- package/types/positions.d.ts +18 -0
- package/types/props.d.ts +119 -0
- package/DSPopper/package.json +0 -10
- package/PopperContent/package.json +0 -10
- package/PopperImpl/package.json +0 -10
- package/cjs/DSPopper.js.map +0 -1
- package/cjs/PopperContent.js.map +0 -1
- package/cjs/PopperImpl.js.map +0 -1
- package/cjs/getArrowStylesBySize.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/interaction.js.map +0 -1
- package/cjs/positions.js.map +0 -1
- package/cjs/props.js.map +0 -1
- package/esm/DSPopper.js.map +0 -1
- package/esm/PopperContent.js.map +0 -1
- package/esm/PopperImpl.js.map +0 -1
- package/esm/getArrowStylesBySize.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/interaction.js.map +0 -1
- package/esm/positions.js.map +0 -1
- package/esm/props.js.map +0 -1
- package/getArrowStylesBySize/package.json +0 -10
- package/interaction/package.json +0 -10
- package/positions/package.json +0 -10
- package/props/package.json +0 -10
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
5
10
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
11
|
|
|
7
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -10,11 +15,11 @@ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_definePropert
|
|
|
10
15
|
|
|
11
16
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
12
17
|
|
|
13
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
18
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
14
19
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
const getArrowStylesBySize = function (position) {
|
|
21
|
+
let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 30;
|
|
22
|
+
const basePosition = position && position.split('-')[0];
|
|
18
23
|
return _objectSpread({
|
|
19
24
|
borderWidth: size
|
|
20
25
|
}, {
|
|
@@ -37,6 +42,5 @@ var getArrowStylesBySize = function getArrowStylesBySize(position) {
|
|
|
37
42
|
}[basePosition]);
|
|
38
43
|
};
|
|
39
44
|
|
|
40
|
-
exports[
|
|
45
|
+
exports["default"] = getArrowStylesBySize;
|
|
41
46
|
exports.getArrowStylesBySize = getArrowStylesBySize;
|
|
42
|
-
//# sourceMappingURL=getArrowStylesBySize.js.map
|
package/cjs/index.js
CHANGED
|
@@ -6,33 +6,14 @@ var DSPopper = require('./DSPopper.js');
|
|
|
6
6
|
var getArrowStylesBySize = require('./getArrowStylesBySize.js');
|
|
7
7
|
var interaction = require('./interaction.js');
|
|
8
8
|
var positions = require('./positions.js');
|
|
9
|
-
require('react');
|
|
10
|
-
require('react-desc');
|
|
11
|
-
require('./PopperImpl.js');
|
|
12
|
-
require('@babel/runtime/helpers/defineProperty');
|
|
13
|
-
require('@babel/runtime/helpers/classCallCheck');
|
|
14
|
-
require('@babel/runtime/helpers/createClass');
|
|
15
|
-
require('@babel/runtime/helpers/assertThisInitialized');
|
|
16
|
-
require('@babel/runtime/helpers/inherits');
|
|
17
|
-
require('@babel/runtime/helpers/possibleConstructorReturn');
|
|
18
|
-
require('@babel/runtime/helpers/getPrototypeOf');
|
|
19
|
-
require('@elliemae/ds-utilities');
|
|
20
|
-
require('react-popper');
|
|
21
|
-
require('memoize-one');
|
|
22
|
-
require('./PopperContent.js');
|
|
23
|
-
require('@babel/runtime/helpers/extends');
|
|
24
|
-
require('react-spring/renderprops.cjs');
|
|
25
|
-
require('@elliemae/ds-overlay');
|
|
26
|
-
require('./props.js');
|
|
27
9
|
|
|
28
10
|
|
|
29
11
|
|
|
30
12
|
exports.DSPopper = DSPopper.DSPopper;
|
|
31
13
|
exports.DSPopperWithSchema = DSPopper.DSPopperWithSchema;
|
|
32
|
-
exports
|
|
14
|
+
exports["default"] = DSPopper.DSPopper;
|
|
33
15
|
exports.getArrowStylesBySize = getArrowStylesBySize.getArrowStylesBySize;
|
|
34
16
|
exports.PopperInteractions = interaction.Interaction;
|
|
35
17
|
exports.interactions = interaction.interactions;
|
|
36
18
|
exports.PopperPositions = positions.Position;
|
|
37
19
|
exports.positions = positions.positions;
|
|
38
|
-
//# sourceMappingURL=index.js.map
|
package/cjs/interaction.js
CHANGED
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const Interaction = {
|
|
6
6
|
CLICK: 'click',
|
|
7
7
|
HOVER: 'hover'
|
|
8
8
|
};
|
|
9
|
-
|
|
9
|
+
const interactions = [Interaction.CLICK, Interaction.HOVER];
|
|
10
10
|
|
|
11
11
|
exports.Interaction = Interaction;
|
|
12
12
|
exports.interactions = interactions;
|
|
13
|
-
//# sourceMappingURL=interaction.js.map
|
package/cjs/positions.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const Position = {
|
|
6
6
|
AUTO: 'auto',
|
|
7
7
|
AUTO_START: 'auto-start',
|
|
8
8
|
AUTO_END: 'auto-end',
|
|
@@ -19,8 +19,7 @@ var Position = {
|
|
|
19
19
|
TOP_START: 'top-start',
|
|
20
20
|
TOP_END: 'top-end'
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
const positions = [Position.AUTO_START, Position.AUTO_END, Position.AUTO, Position.TOP_START, Position.TOP, Position.TOP_END, Position.RIGHT_START, Position.RIGHT, Position.RIGHT_END, Position.BOTTOM_START, Position.BOTTOM, Position.BOTTOM_END, Position.LEFT_START, Position.LEFT, Position.LEFT_END];
|
|
23
23
|
|
|
24
24
|
exports.Position = Position;
|
|
25
25
|
exports.positions = positions;
|
|
26
|
-
//# sourceMappingURL=positions.js.map
|
package/cjs/props.js
CHANGED
|
@@ -6,7 +6,7 @@ var reactDesc = require('react-desc');
|
|
|
6
6
|
var positions = require('./positions.js');
|
|
7
7
|
var interaction = require('./interaction.js');
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
const popperProps = {
|
|
10
10
|
/** Hide menu component if trigger component is not visible/scrolled away */
|
|
11
11
|
hideIfNotVisible: reactDesc.PropTypes.bool.description('Hide menu component if trigger component is not visible/scrolled away'),
|
|
12
12
|
|
|
@@ -38,28 +38,20 @@ var popperProps = {
|
|
|
38
38
|
blockName: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.object]).description('Bem blockname for the popper'),
|
|
39
39
|
triggerComponent: reactDesc.PropTypes.element.description("The component that will open/close the tooltip. \n Cannot be used with disabled elements. \n https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled").isRequired
|
|
40
40
|
};
|
|
41
|
-
|
|
41
|
+
const defaultProps = {
|
|
42
42
|
containerProps: {},
|
|
43
43
|
arrowGap: 8,
|
|
44
44
|
arrowSize: 6,
|
|
45
45
|
blockName: '',
|
|
46
46
|
contentOffset: null,
|
|
47
47
|
contentStyle: null,
|
|
48
|
-
contentComponent:
|
|
49
|
-
return null;
|
|
50
|
-
},
|
|
48
|
+
contentComponent: () => null,
|
|
51
49
|
delayClose: 300,
|
|
52
50
|
delayOpen: 200,
|
|
53
51
|
interactionType: interaction.Interaction.CLICK,
|
|
54
|
-
onOpen:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
onClose: function onClose() {
|
|
58
|
-
return null;
|
|
59
|
-
},
|
|
60
|
-
onPlacementChange: function onPlacementChange() {
|
|
61
|
-
return null;
|
|
62
|
-
},
|
|
52
|
+
onOpen: () => null,
|
|
53
|
+
onClose: () => null,
|
|
54
|
+
onPlacementChange: () => null,
|
|
63
55
|
placement: positions.Position.BOTTOM,
|
|
64
56
|
preventOverflow: 'window',
|
|
65
57
|
showArrow: true,
|
|
@@ -84,22 +76,13 @@ var defaultProps = {
|
|
|
84
76
|
}
|
|
85
77
|
},
|
|
86
78
|
usePortal: true,
|
|
87
|
-
triggerComponent:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
getTargetFromChildren: function getTargetFromChildren() {
|
|
91
|
-
return null;
|
|
92
|
-
},
|
|
93
|
-
getContentFromChildren: function getContentFromChildren() {
|
|
94
|
-
return null;
|
|
95
|
-
},
|
|
79
|
+
triggerComponent: () => null,
|
|
80
|
+
getTargetFromChildren: () => null,
|
|
81
|
+
getContentFromChildren: () => null,
|
|
96
82
|
modifiers: {},
|
|
97
|
-
triggerRef:
|
|
98
|
-
return null;
|
|
99
|
-
},
|
|
83
|
+
triggerRef: () => null,
|
|
100
84
|
hideIfNotVisible: false
|
|
101
85
|
};
|
|
102
86
|
|
|
103
87
|
exports.defaultProps = defaultProps;
|
|
104
88
|
exports.popperProps = popperProps;
|
|
105
|
-
//# sourceMappingURL=props.js.map
|
package/esm/DSPopper.js
CHANGED
|
@@ -1,58 +1,47 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
2
3
|
import { describe } from 'react-desc';
|
|
3
4
|
import PopperImpl from './PopperImpl.js';
|
|
4
5
|
export { Position as PopperPositions, positions } from './positions.js';
|
|
5
6
|
export { Interaction as PopperInteractions, interactions } from './interaction.js';
|
|
6
7
|
import { popperProps, defaultProps } from './props.js';
|
|
7
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
8
|
-
import '@babel/runtime/helpers/esm/classCallCheck';
|
|
9
|
-
import '@babel/runtime/helpers/esm/createClass';
|
|
10
|
-
import '@babel/runtime/helpers/esm/assertThisInitialized';
|
|
11
|
-
import '@babel/runtime/helpers/esm/inherits';
|
|
12
|
-
import '@babel/runtime/helpers/esm/possibleConstructorReturn';
|
|
13
|
-
import '@babel/runtime/helpers/esm/getPrototypeOf';
|
|
14
|
-
import '@elliemae/ds-utilities';
|
|
15
|
-
import 'react-popper';
|
|
16
|
-
import 'memoize-one';
|
|
17
|
-
import './PopperContent.js';
|
|
18
|
-
import '@babel/runtime/helpers/esm/extends';
|
|
19
|
-
import 'react-spring/renderprops.cjs';
|
|
20
|
-
import '@elliemae/ds-overlay';
|
|
21
|
-
import './getArrowStylesBySize.js';
|
|
22
8
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
9
|
+
const DSPopper = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
containerProps,
|
|
12
|
+
arrowGap,
|
|
13
|
+
arrowSize,
|
|
14
|
+
blockName,
|
|
15
|
+
contentOffset,
|
|
16
|
+
contentStyle,
|
|
17
|
+
contentComponent,
|
|
18
|
+
delayClose,
|
|
19
|
+
delayOpen,
|
|
20
|
+
interactionType,
|
|
21
|
+
isOpen,
|
|
22
|
+
// if this is set DSPopper would be a controlled component if not, an uncontrolled one
|
|
23
|
+
onOpen,
|
|
24
|
+
onClose,
|
|
25
|
+
onPlacementChange,
|
|
26
|
+
placement,
|
|
27
|
+
preventOverflow,
|
|
28
|
+
showArrow,
|
|
29
|
+
closeAnimationConfig,
|
|
30
|
+
openAnimationConfig,
|
|
31
|
+
usePortal,
|
|
32
|
+
triggerComponent,
|
|
33
|
+
wrapExtraComponent,
|
|
34
|
+
getTargetFromChildren,
|
|
35
|
+
getContentFromChildren,
|
|
36
|
+
modifiers,
|
|
37
|
+
triggerRef,
|
|
38
|
+
children: customPopper,
|
|
39
|
+
renderReference,
|
|
40
|
+
referenceNode,
|
|
41
|
+
zIndex,
|
|
42
|
+
hideIfNotVisible
|
|
43
|
+
} = _ref;
|
|
44
|
+
return /*#__PURE__*/_jsx(PopperImpl, {
|
|
56
45
|
arrowGap: arrowGap,
|
|
57
46
|
arrowSize: arrowSize,
|
|
58
47
|
blockName: blockName,
|
|
@@ -83,14 +72,12 @@ var DSPopper = function DSPopper(_ref) {
|
|
|
83
72
|
wrapExtraComponent: wrapExtraComponent,
|
|
84
73
|
zIndex: zIndex,
|
|
85
74
|
hideIfNotVisible: hideIfNotVisible
|
|
86
|
-
}, customPopper);
|
|
75
|
+
}, void 0, customPopper);
|
|
87
76
|
}; // @deprecated: There's the NEW (not finished) popover that uses its own popper implementation.
|
|
88
77
|
|
|
89
78
|
|
|
90
|
-
DSPopper.propTypes = popperProps;
|
|
91
79
|
DSPopper.defaultProps = defaultProps;
|
|
92
|
-
|
|
80
|
+
const DSPopperWithSchema = describe(DSPopper);
|
|
93
81
|
DSPopperWithSchema.propTypes = popperProps;
|
|
94
82
|
|
|
95
83
|
export { DSPopper, DSPopperWithSchema, DSPopper as default };
|
|
96
|
-
//# sourceMappingURL=DSPopper.js.map
|
package/esm/PopperContent.js
CHANGED
|
@@ -1,116 +1,105 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
7
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
-
import
|
|
4
|
-
import _createClass from '@babel/runtime/helpers/esm/createClass';
|
|
5
|
-
import _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized';
|
|
6
|
-
import _inherits from '@babel/runtime/helpers/esm/inherits';
|
|
7
|
-
import _possibleConstructorReturn from '@babel/runtime/helpers/esm/possibleConstructorReturn';
|
|
8
|
-
import _getPrototypeOf from '@babel/runtime/helpers/esm/getPrototypeOf';
|
|
9
|
-
import React, { PureComponent } from 'react';
|
|
8
|
+
import { PureComponent } from 'react';
|
|
10
9
|
import { Popper } from 'react-popper';
|
|
11
|
-
import { Keyframes, animated } from 'react-spring/renderprops
|
|
12
|
-
import
|
|
10
|
+
import { Keyframes, animated } from 'react-spring/renderprops';
|
|
11
|
+
import getComponentFromProps from '@elliemae/ds-utilities/getComponentFromProps';
|
|
13
12
|
import DSOverlay from '@elliemae/ds-overlay';
|
|
14
13
|
import { getArrowStylesBySize } from './getArrowStylesBySize.js';
|
|
14
|
+
import { jsx } from 'react/jsx-runtime';
|
|
15
|
+
|
|
16
|
+
var _svg;
|
|
15
17
|
|
|
16
18
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
17
19
|
|
|
18
20
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
23
|
-
var Content = Keyframes.Spring({});
|
|
24
|
-
|
|
25
|
-
var PopperContent = /*#__PURE__*/function (_PureComponent) {
|
|
26
|
-
_inherits(PopperContent, _PureComponent);
|
|
27
|
-
|
|
28
|
-
var _super = _createSuper(PopperContent);
|
|
29
|
-
|
|
21
|
+
const Content = Keyframes.Spring({});
|
|
22
|
+
class PopperContent extends PureComponent {
|
|
30
23
|
// eslint-disable-next-line react/static-property-placement
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
_this.renderContent = _this.renderContent.bind(_assertThisInitialized(_this));
|
|
38
|
-
_this.renderArrow = _this.renderArrow.bind(_assertThisInitialized(_this));
|
|
39
|
-
_this.handleRestAnimation = _this.handleRestAnimation.bind(_assertThisInitialized(_this));
|
|
40
|
-
_this.handleRestAnimation = _this.handleRestAnimation.bind(_assertThisInitialized(_this));
|
|
41
|
-
return _this;
|
|
24
|
+
constructor(props) {
|
|
25
|
+
super(props);
|
|
26
|
+
this.renderContent = this.renderContent.bind(this);
|
|
27
|
+
this.renderArrow = this.renderArrow.bind(this);
|
|
28
|
+
this.handleRestAnimation = this.handleRestAnimation.bind(this);
|
|
29
|
+
this.handleRestAnimation = this.handleRestAnimation.bind(this);
|
|
42
30
|
}
|
|
43
31
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
onContentDestroyed = _this$props.onContentDestroyed;
|
|
32
|
+
handleRestAnimation() {
|
|
33
|
+
const {
|
|
34
|
+
isOpen,
|
|
35
|
+
onContentDestroyed
|
|
36
|
+
} = this.props;
|
|
50
37
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
38
|
+
if (!isOpen) {
|
|
39
|
+
onContentDestroyed();
|
|
54
40
|
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
renderArrow(_ref, placement) {
|
|
44
|
+
let {
|
|
45
|
+
ref,
|
|
46
|
+
style
|
|
47
|
+
} = _ref;
|
|
48
|
+
const {
|
|
49
|
+
blockName,
|
|
50
|
+
showArrow
|
|
51
|
+
} = this.props;
|
|
52
|
+
if (!showArrow) return null;
|
|
53
|
+
return /*#__PURE__*/jsx("div", {
|
|
54
|
+
ref: ref,
|
|
55
|
+
className: "".concat(blockName || 'popper', "__arrow"),
|
|
56
|
+
"data-placement": placement,
|
|
57
|
+
style: _objectSpread(_objectSpread({}, style), getArrowStylesBySize(placement, 25)),
|
|
58
|
+
children: _svg || (_svg = /*#__PURE__*/_jsx("svg", {
|
|
71
59
|
viewBox: "0 0 30 30"
|
|
72
|
-
}, /*#__PURE__*/
|
|
60
|
+
}, void 0, /*#__PURE__*/_jsx("path", {
|
|
73
61
|
className: "stroke",
|
|
74
62
|
d: "M23.7,27.1L17,19.9C16.5,19.3,15.8,19,15,19s-1.6,0.3-2.1,0.9l-6.6,7.2C5.3,28.1,3.4,29,2,29h26 C26.7,29,24.6,28.1,23.7,27.1z"
|
|
75
|
-
}), /*#__PURE__*/
|
|
63
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
76
64
|
className: "fill",
|
|
77
65
|
d: "M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"
|
|
78
|
-
})))
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
key: "renderContent",
|
|
82
|
-
value: function renderContent(_ref2) {
|
|
83
|
-
var _this2 = this;
|
|
84
|
-
|
|
85
|
-
var ref = _ref2.ref,
|
|
86
|
-
style = _ref2.style,
|
|
87
|
-
placement = _ref2.placement,
|
|
88
|
-
arrowProps = _ref2.arrowProps,
|
|
89
|
-
scheduleUpdate = _ref2.scheduleUpdate,
|
|
90
|
-
outOfBoundaries = _ref2.outOfBoundaries;
|
|
91
|
-
var _this$props3 = this.props,
|
|
92
|
-
contentComponent = _this$props3.contentComponent,
|
|
93
|
-
contentStyle = _this$props3.contentStyle,
|
|
94
|
-
isOpen = _this$props3.isOpen,
|
|
95
|
-
closeAnimationConfig = _this$props3.closeAnimationConfig,
|
|
96
|
-
openAnimationConfig = _this$props3.openAnimationConfig,
|
|
97
|
-
onMouseEnter = _this$props3.onMouseEnter,
|
|
98
|
-
onMouseLeave = _this$props3.onMouseLeave,
|
|
99
|
-
containerProps = _this$props3.containerProps,
|
|
100
|
-
zIndex = _this$props3.zIndex,
|
|
101
|
-
hideIfNotVisible = _this$props3.hideIfNotVisible;
|
|
102
|
-
|
|
103
|
-
var computedStyle = _objectSpread(_objectSpread(_objectSpread({}, style), contentStyle), {}, {
|
|
104
|
-
zIndex: zIndex
|
|
105
|
-
});
|
|
66
|
+
})))
|
|
67
|
+
}, "popper-arrow");
|
|
68
|
+
}
|
|
106
69
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
70
|
+
renderContent(_ref2) {
|
|
71
|
+
let {
|
|
72
|
+
ref,
|
|
73
|
+
style,
|
|
74
|
+
placement,
|
|
75
|
+
arrowProps,
|
|
76
|
+
scheduleUpdate,
|
|
77
|
+
outOfBoundaries
|
|
78
|
+
} = _ref2;
|
|
79
|
+
const {
|
|
80
|
+
contentComponent,
|
|
81
|
+
contentStyle,
|
|
82
|
+
isOpen,
|
|
83
|
+
closeAnimationConfig,
|
|
84
|
+
openAnimationConfig,
|
|
85
|
+
onMouseEnter,
|
|
86
|
+
onMouseLeave,
|
|
87
|
+
containerProps,
|
|
88
|
+
zIndex,
|
|
89
|
+
hideIfNotVisible
|
|
90
|
+
} = this.props;
|
|
91
|
+
|
|
92
|
+
const computedStyle = _objectSpread(_objectSpread(_objectSpread({}, style), contentStyle), {}, {
|
|
93
|
+
zIndex
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
97
|
+
"data-placement": placement,
|
|
98
|
+
onMouseEnter: onMouseEnter,
|
|
99
|
+
onMouseLeave: onMouseLeave,
|
|
100
|
+
style: computedStyle,
|
|
101
|
+
"data-testid": "popper-container",
|
|
102
|
+
children: /*#__PURE__*/_jsx(Content, {
|
|
114
103
|
native: true,
|
|
115
104
|
onRest: this.handleRestAnimation,
|
|
116
105
|
state: isOpen && (!outOfBoundaries || !hideIfNotVisible) ? 'open' : 'close',
|
|
@@ -120,52 +109,39 @@ var PopperContent = /*#__PURE__*/function (_PureComponent) {
|
|
|
120
109
|
}),
|
|
121
110
|
close: closeAnimationConfig
|
|
122
111
|
}
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}, {
|
|
133
|
-
key: "render",
|
|
134
|
-
value: function render() {
|
|
135
|
-
var _this$props4 = this.props,
|
|
136
|
-
_this$props4$destroye = _this$props4.destroyed,
|
|
137
|
-
destroyed = _this$props4$destroye === void 0 ? false : _this$props4$destroye,
|
|
138
|
-
_this$props4$onClickO = _this$props4.onClickOutside,
|
|
139
|
-
onClickOutside = _this$props4$onClickO === void 0 ? function () {
|
|
140
|
-
return null;
|
|
141
|
-
} : _this$props4$onClickO,
|
|
142
|
-
_this$props4$placemen = _this$props4.placement,
|
|
143
|
-
placement = _this$props4$placemen === void 0 ? 'bottom-start' : _this$props4$placemen,
|
|
144
|
-
_this$props4$modifier = _this$props4.modifiers,
|
|
145
|
-
modifiers = _this$props4$modifier === void 0 ? {} : _this$props4$modifier,
|
|
146
|
-
referenceNode = _this$props4.referenceNode,
|
|
147
|
-
_this$props4$usePorta = _this$props4.usePortal,
|
|
148
|
-
usePortal = _this$props4$usePorta === void 0 ? true : _this$props4$usePorta;
|
|
149
|
-
return /*#__PURE__*/React.createElement(DSOverlay, {
|
|
150
|
-
isOpen: !destroyed,
|
|
151
|
-
onClickOutside: onClickOutside,
|
|
152
|
-
usePortal: usePortal
|
|
153
|
-
}, /*#__PURE__*/React.createElement(Popper, {
|
|
154
|
-
modifiers: modifiers,
|
|
155
|
-
placement: placement,
|
|
156
|
-
referenceElement: referenceNode
|
|
157
|
-
}, this.renderContent));
|
|
158
|
-
}
|
|
159
|
-
}]);
|
|
112
|
+
}, void 0, animationStyle => /*#__PURE__*/jsx(animated.div, {
|
|
113
|
+
ref: ref,
|
|
114
|
+
style: animationStyle,
|
|
115
|
+
children: getComponentFromProps(contentComponent, {
|
|
116
|
+
scheduleUpdate
|
|
117
|
+
}, [this.renderArrow(arrowProps, placement)])
|
|
118
|
+
}))
|
|
119
|
+
}));
|
|
120
|
+
}
|
|
160
121
|
|
|
161
|
-
|
|
162
|
-
|
|
122
|
+
render() {
|
|
123
|
+
const {
|
|
124
|
+
destroyed = false,
|
|
125
|
+
onClickOutside = () => null,
|
|
126
|
+
placement = 'bottom-start',
|
|
127
|
+
modifiers = {},
|
|
128
|
+
referenceNode,
|
|
129
|
+
usePortal = true
|
|
130
|
+
} = this.props;
|
|
131
|
+
return /*#__PURE__*/_jsx(DSOverlay, {
|
|
132
|
+
isOpen: !destroyed,
|
|
133
|
+
onClickOutside: onClickOutside,
|
|
134
|
+
usePortal: usePortal
|
|
135
|
+
}, void 0, /*#__PURE__*/_jsx(Popper, {
|
|
136
|
+
modifiers: modifiers,
|
|
137
|
+
placement: placement,
|
|
138
|
+
referenceElement: referenceNode
|
|
139
|
+
}, void 0, this.renderContent));
|
|
140
|
+
}
|
|
163
141
|
|
|
142
|
+
}
|
|
164
143
|
PopperContent.defaultProps = {
|
|
165
|
-
onContentDestroyed:
|
|
166
|
-
return null;
|
|
167
|
-
}
|
|
144
|
+
onContentDestroyed: () => null
|
|
168
145
|
};
|
|
169
146
|
|
|
170
147
|
export { PopperContent as default };
|
|
171
|
-
//# sourceMappingURL=PopperContent.js.map
|