@elliemae/ds-popperjs 1.59.8 → 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/PopoverArrow.js +35 -31
- package/cjs/PopoverContent.js +51 -39
- package/cjs/config/useConfigDSPopperjs.js +40 -61
- package/cjs/config/useConfiguredDefaultModifiers.js +21 -22
- package/cjs/config/useConfiguredDefaultProps.js +39 -38
- package/cjs/config/useConfiguredMergedProps.js +9 -11
- package/cjs/index.d.js +0 -1
- package/cjs/index.js +56 -57
- package/cjs/propTypes.js +4 -3
- package/cjs/styled.js +15 -12
- package/cjs/utils/hooks/useOnClickOutside.js +4 -5
- package/esm/PopoverArrow.js +34 -30
- package/esm/PopoverContent.js +49 -37
- package/esm/config/useConfigDSPopperjs.js +36 -53
- package/esm/config/useConfiguredDefaultModifiers.js +20 -21
- package/esm/config/useConfiguredDefaultProps.js +36 -35
- package/esm/config/useConfiguredMergedProps.js +8 -10
- package/esm/index.d.js +0 -1
- package/esm/index.js +52 -53
- package/esm/propTypes.js +4 -3
- package/esm/styled.js +14 -11
- package/esm/utils/hooks/useOnClickOutside.js +3 -4
- package/package.json +66 -11
- package/types/PopoverArrow.d.ts +8 -0
- package/types/PopoverContent.d.ts +3 -0
- package/types/config/useConfigDSPopperjs.d.ts +2 -0
- package/types/config/useConfiguredDefaultModifiers.d.ts +6 -0
- package/types/config/useConfiguredDefaultProps.d.ts +19 -0
- package/types/config/useConfiguredMergedProps.d.ts +19 -0
- package/types/index.d.ts +58 -0
- package/types/propTypes.d.ts +95 -0
- package/types/styled.d.ts +11 -0
- package/types/utils/hooks/useOnClickOutside.d.ts +4 -0
- package/PopoverArrow/package.json +0 -10
- package/PopoverContent/package.json +0 -10
- package/cjs/PopoverArrow.js.map +0 -1
- package/cjs/PopoverContent.js.map +0 -1
- package/cjs/config/useConfigDSPopperjs.js.map +0 -1
- package/cjs/config/useConfiguredDefaultModifiers.js.map +0 -1
- package/cjs/config/useConfiguredDefaultProps.js.map +0 -1
- package/cjs/config/useConfiguredMergedProps.js.map +0 -1
- package/cjs/index.d.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/propTypes.js.map +0 -1
- package/cjs/styled.js.map +0 -1
- package/cjs/utils/hooks/useOnClickOutside.js.map +0 -1
- package/config/useConfigDSPopperjs/package.json +0 -10
- package/config/useConfiguredDefaultModifiers/package.json +0 -10
- package/config/useConfiguredDefaultProps/package.json +0 -10
- package/config/useConfiguredMergedProps/package.json +0 -10
- package/esm/PopoverArrow.js.map +0 -1
- package/esm/PopoverContent.js.map +0 -1
- package/esm/config/useConfigDSPopperjs.js.map +0 -1
- package/esm/config/useConfiguredDefaultModifiers.js.map +0 -1
- package/esm/config/useConfiguredDefaultProps.js.map +0 -1
- package/esm/config/useConfiguredMergedProps.js.map +0 -1
- package/esm/index.d.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/propTypes.js.map +0 -1
- package/esm/styled.js.map +0 -1
- package/esm/utils/hooks/useOnClickOutside.js.map +0 -1
- package/propTypes/package.json +0 -10
- package/styled/package.json +0 -10
- package/utils/hooks/useOnClickOutside/package.json +0 -10
|
@@ -1,3 +1,8 @@
|
|
|
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';
|
|
1
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
7
|
import { useMemo } from 'react';
|
|
3
8
|
import { useConfiguredDefaultModifiers } from './useConfiguredDefaultModifiers.js';
|
|
@@ -6,44 +11,40 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
6
11
|
|
|
7
12
|
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; }
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
const noop = () => {};
|
|
10
15
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
const emptyObj = {};
|
|
17
|
+
const useConfiguredDefaultProps = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
props,
|
|
20
|
+
arrowElement
|
|
21
|
+
} = _ref;
|
|
15
22
|
// don't move this out of the hook or `document.body` will explode
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var defaultProps = useMemo(function () {
|
|
41
|
-
return _objectSpread(_objectSpread({}, staticDefaultProps), {}, {
|
|
42
|
-
modifiers: configuredModifiers
|
|
43
|
-
});
|
|
44
|
-
}, [configuredModifiers, staticDefaultProps]);
|
|
23
|
+
const staticDefaultProps = useMemo(() => ({
|
|
24
|
+
referenceElement: null,
|
|
25
|
+
showPopover: false,
|
|
26
|
+
closeContextMenu: noop,
|
|
27
|
+
onClickOutside: noop,
|
|
28
|
+
withoutPortal: false,
|
|
29
|
+
withoutArrow: false,
|
|
30
|
+
withoutAnimation: false,
|
|
31
|
+
animationDuration: 100,
|
|
32
|
+
portalDOMContainer: document.body,
|
|
33
|
+
startPlacementPreference: 'top',
|
|
34
|
+
placementOrderPreference: ['top', 'bottom', 'left', 'right'],
|
|
35
|
+
zIndex: 1,
|
|
36
|
+
extraPopperStyles: emptyObj
|
|
37
|
+
}), []);
|
|
38
|
+
const {
|
|
39
|
+
modifiers: configuredModifiers
|
|
40
|
+
} = useConfiguredDefaultModifiers({
|
|
41
|
+
props,
|
|
42
|
+
arrowElement
|
|
43
|
+
});
|
|
44
|
+
const defaultProps = useMemo(() => _objectSpread(_objectSpread({}, staticDefaultProps), {}, {
|
|
45
|
+
modifiers: configuredModifiers
|
|
46
|
+
}), [configuredModifiers, staticDefaultProps]);
|
|
45
47
|
return defaultProps;
|
|
46
48
|
};
|
|
47
49
|
|
|
48
50
|
export { useConfiguredDefaultProps };
|
|
49
|
-
//# sourceMappingURL=useConfiguredDefaultProps.js.map
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';
|
|
2
2
|
import { useConfiguredDefaultProps } from './useConfiguredDefaultProps.js';
|
|
3
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
4
|
-
import 'react';
|
|
5
|
-
import './useConfiguredDefaultModifiers.js';
|
|
6
3
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
const useConfiguredMergedProps = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
props,
|
|
7
|
+
arrowElement
|
|
8
|
+
} = _ref;
|
|
9
|
+
const defaultProps = useConfiguredDefaultProps({
|
|
10
|
+
props,
|
|
11
|
+
arrowElement
|
|
13
12
|
});
|
|
14
13
|
return useMemoMergePropsWithDefault(props, defaultProps);
|
|
15
14
|
};
|
|
16
15
|
|
|
17
16
|
export { useConfiguredMergedProps };
|
|
18
|
-
//# sourceMappingURL=useConfiguredMergedProps.js.map
|
package/esm/index.d.js
CHANGED
package/esm/index.js
CHANGED
|
@@ -1,75 +1,74 @@
|
|
|
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';
|
|
1
7
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
-
import
|
|
8
|
+
import { useMemo } from 'react';
|
|
3
9
|
import { createPortal } from 'react-dom';
|
|
4
10
|
import { describe } from 'react-desc';
|
|
5
11
|
import { dspopperjsPropTypes } from './propTypes.js';
|
|
6
12
|
import { PopoverContent } from './PopoverContent.js';
|
|
7
13
|
import { useConfigDSPopperjs } from './config/useConfigDSPopperjs.js';
|
|
8
|
-
import '
|
|
9
|
-
import './PopoverArrow.js';
|
|
10
|
-
import 'styled-components';
|
|
11
|
-
import './styled.js';
|
|
12
|
-
import '@babel/runtime/helpers/esm/taggedTemplateLiteral';
|
|
13
|
-
import '@elliemae/ds-system';
|
|
14
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
15
|
-
import 'react-popper';
|
|
16
|
-
import './config/useConfiguredMergedProps.js';
|
|
17
|
-
import '@elliemae/ds-props-helpers';
|
|
18
|
-
import './config/useConfiguredDefaultProps.js';
|
|
19
|
-
import './config/useConfiguredDefaultModifiers.js';
|
|
20
|
-
import './utils/hooks/useOnClickOutside.js';
|
|
14
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
21
15
|
|
|
22
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; }
|
|
23
17
|
|
|
24
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(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; }
|
|
25
19
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
showPopover
|
|
30
|
-
withoutAnimation
|
|
31
|
-
animationDuration
|
|
32
|
-
withoutPortal
|
|
33
|
-
withoutArrow
|
|
34
|
-
portalDOMContainer
|
|
35
|
-
zIndex
|
|
36
|
-
extraPopperStyles
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
20
|
+
const DSPopperJS = props => {
|
|
21
|
+
const {
|
|
22
|
+
props: {
|
|
23
|
+
showPopover,
|
|
24
|
+
withoutAnimation,
|
|
25
|
+
animationDuration,
|
|
26
|
+
withoutPortal,
|
|
27
|
+
withoutArrow,
|
|
28
|
+
portalDOMContainer,
|
|
29
|
+
zIndex,
|
|
30
|
+
extraPopperStyles
|
|
31
|
+
},
|
|
32
|
+
setPopperElement,
|
|
33
|
+
setArrowElement,
|
|
34
|
+
setIsAnimating,
|
|
35
|
+
popoverHelper,
|
|
36
|
+
isAnimating
|
|
37
|
+
} = useConfigDSPopperjs(props);
|
|
38
|
+
const {
|
|
39
|
+
children
|
|
40
|
+
} = props;
|
|
41
|
+
const {
|
|
42
|
+
styles,
|
|
43
|
+
attributes
|
|
44
|
+
} = popoverHelper;
|
|
45
|
+
const contentJSX = useMemo(() => /*#__PURE__*/_jsx(PopoverContent, {
|
|
46
|
+
setPopperElement: setPopperElement,
|
|
47
|
+
popperStyles: _objectSpread(_objectSpread({}, styles.popper), extraPopperStyles),
|
|
48
|
+
popperAttributes: attributes.popper,
|
|
49
|
+
setArrowElement: setArrowElement,
|
|
50
|
+
arrowStyle: styles.arrow,
|
|
51
|
+
withoutArrow: withoutArrow,
|
|
52
|
+
withoutAnimation: withoutAnimation,
|
|
53
|
+
animationDuration: animationDuration,
|
|
54
|
+
zIndex: zIndex,
|
|
55
|
+
showPopover: showPopover,
|
|
56
|
+
setIsAnimating: setIsAnimating
|
|
57
|
+
}, void 0, children), [attributes.popper, children, setIsAnimating, showPopover, extraPopperStyles, setArrowElement, setPopperElement, styles.arrow, styles.popper, withoutArrow, withoutAnimation, animationDuration, zIndex]);
|
|
61
58
|
|
|
62
59
|
if (showPopover || isAnimating) {
|
|
63
60
|
if (withoutPortal === true) return contentJSX;
|
|
64
|
-
if (withoutPortal === false) return /*#__PURE__*/
|
|
61
|
+
if (withoutPortal === false) return /*#__PURE__*/jsx(Fragment, {
|
|
62
|
+
children: /*#__PURE__*/createPortal( /*#__PURE__*/jsx(Fragment, {
|
|
63
|
+
children: contentJSX
|
|
64
|
+
}), portalDOMContainer)
|
|
65
|
+
});
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
return null;
|
|
68
69
|
};
|
|
69
70
|
|
|
70
|
-
DSPopperJS.
|
|
71
|
-
var DSPopperJSWithSchema = describe(DSPopperJS).description('A dimsum custom styling wrapper on top of popperjs');
|
|
71
|
+
const DSPopperJSWithSchema = describe(DSPopperJS).description('A dimsum custom styling wrapper on top of popperjs');
|
|
72
72
|
DSPopperJSWithSchema.propTypes = dspopperjsPropTypes;
|
|
73
73
|
|
|
74
74
|
export { DSPopperJS, DSPopperJSWithSchema, DSPopperJS as default };
|
|
75
|
-
//# sourceMappingURL=index.js.map
|
package/esm/propTypes.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropTypes } from 'react-desc';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const dspopperjsPropTypes = {
|
|
4
4
|
/**
|
|
5
5
|
* React ref to popperjs referenceElement
|
|
6
6
|
*/
|
|
@@ -73,8 +73,9 @@ var dspopperjsPropTypes = {
|
|
|
73
73
|
* https://popper.js.org/docs/v2/modifiers/
|
|
74
74
|
*/
|
|
75
75
|
modifiers: PropTypes.array.description('modifiers array for full-custom popper-js override, https://popper.js.org/docs/v2/modifiers/').defaultValue(1),
|
|
76
|
-
extraPopperStyles: PropTypes.object.description('Extra object styles to attach to the popper element').defaultValue({})
|
|
76
|
+
extraPopperStyles: PropTypes.object.description('Extra object styles to attach to the popper element').defaultValue({}),
|
|
77
|
+
onClickOutside: PropTypes.func.description('Callback triggered when clicking outside the popper').defaultValue(() => null),
|
|
78
|
+
children: PropTypes.node.description('The content of the popper').defaultValue(undefined)
|
|
77
79
|
};
|
|
78
80
|
|
|
79
81
|
export { dspopperjsPropTypes };
|
|
80
|
-
//# sourceMappingURL=propTypes.js.map
|
package/esm/styled.js
CHANGED
|
@@ -3,22 +3,25 @@ import styled from 'styled-components';
|
|
|
3
3
|
import { kfrm, css } from '@elliemae/ds-system';
|
|
4
4
|
|
|
5
5
|
var _templateObject, _templateObject2, _templateObject3;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const showAnimation = kfrm(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n from {\n opacity: 0;\n transform: scale(0.8);\n }\n\n to {\n opacity: 1;\n transform: scale(1);\n visibility: visible;\n }\n"])));
|
|
7
|
+
const hideAnimation = kfrm(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n from {\n opacity: 1;\n transform: scale(1);\n }\n\n to {\n opacity: 0;\n transform: scale(0.8);\n visibility: hidden;\n }\n"])));
|
|
8
|
+
const StyledPopoverContentWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
9
9
|
componentId: "sc-1giz5kx-0"
|
|
10
|
-
})(["z-index:", ";"],
|
|
11
|
-
|
|
10
|
+
})(["z-index:", ";"], _ref => {
|
|
11
|
+
let {
|
|
12
|
+
zIndex
|
|
13
|
+
} = _ref;
|
|
12
14
|
return zIndex;
|
|
13
15
|
});
|
|
14
|
-
|
|
16
|
+
const StyledAnimatedPopper = /*#__PURE__*/styled.div.withConfig({
|
|
15
17
|
componentId: "sc-1giz5kx-1"
|
|
16
|
-
})(["box-shadow:0 0 0 1px rgba(16,22,26,0.1),0 2px 4px rgba(16,22,26,0.2),0 8px 24px rgba(16,22,26,0.2);", ""],
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
})(["box-shadow:0 0 0 1px rgba(16,22,26,0.1),0 2px 4px rgba(16,22,26,0.2),0 8px 24px rgba(16,22,26,0.2);", ""], _ref2 => {
|
|
19
|
+
let {
|
|
20
|
+
showPopover,
|
|
21
|
+
animationDuration,
|
|
22
|
+
withoutAnimation
|
|
23
|
+
} = _ref2;
|
|
20
24
|
return !withoutAnimation && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n animation: ", " ", "ms ease-in;\n "])), showPopover ? showAnimation : hideAnimation, animationDuration);
|
|
21
25
|
});
|
|
22
26
|
|
|
23
27
|
export { StyledAnimatedPopper, StyledPopoverContentWrapper };
|
|
24
|
-
//# sourceMappingURL=styled.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
|
|
3
3
|
function useOnClickOutside(ref, cb) {
|
|
4
|
-
useEffect(
|
|
5
|
-
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
const listener = event => {
|
|
6
6
|
var _ref$contains;
|
|
7
7
|
|
|
8
8
|
// Do nothing if clicking ref's element or descendent elements
|
|
@@ -15,7 +15,7 @@ function useOnClickOutside(ref, cb) {
|
|
|
15
15
|
|
|
16
16
|
document.addEventListener('mousedown', listener);
|
|
17
17
|
document.addEventListener('touchstart', listener);
|
|
18
|
-
return
|
|
18
|
+
return () => {
|
|
19
19
|
document.removeEventListener('mousedown', listener);
|
|
20
20
|
document.removeEventListener('touchstart', listener);
|
|
21
21
|
};
|
|
@@ -23,4 +23,3 @@ function useOnClickOutside(ref, cb) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export { useOnClickOutside };
|
|
26
|
-
//# sourceMappingURL=useOnClickOutside.js.map
|
package/package.json
CHANGED
|
@@ -1,14 +1,66 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-popperjs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.12",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"description": "
|
|
6
|
-
"module": "esm/index.js",
|
|
7
|
-
"main": "cjs/index.js",
|
|
5
|
+
"description": "ICE MT - Dimsum - Popper JS Wrapper",
|
|
6
|
+
"module": "./esm/index.js",
|
|
7
|
+
"main": "./cjs/index.js",
|
|
8
|
+
"types": "./types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./esm/index.js",
|
|
12
|
+
"require": "./cjs/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./utils/hooks/useOnClickOutside": {
|
|
15
|
+
"import": "./esm/utils/hooks/useOnClickOutside.js",
|
|
16
|
+
"require": "./cjs/utils/hooks/useOnClickOutside.js"
|
|
17
|
+
},
|
|
18
|
+
"./styled": {
|
|
19
|
+
"import": "./esm/styled.js",
|
|
20
|
+
"require": "./cjs/styled.js"
|
|
21
|
+
},
|
|
22
|
+
"./propTypes": {
|
|
23
|
+
"import": "./esm/propTypes.js",
|
|
24
|
+
"require": "./cjs/propTypes.js"
|
|
25
|
+
},
|
|
26
|
+
"./PopoverContent": {
|
|
27
|
+
"import": "./esm/PopoverContent.js",
|
|
28
|
+
"require": "./cjs/PopoverContent.js"
|
|
29
|
+
},
|
|
30
|
+
"./PopoverArrow": {
|
|
31
|
+
"import": "./esm/PopoverArrow.js",
|
|
32
|
+
"require": "./cjs/PopoverArrow.js"
|
|
33
|
+
},
|
|
34
|
+
"./config/useConfiguredMergedProps": {
|
|
35
|
+
"import": "./esm/config/useConfiguredMergedProps.js",
|
|
36
|
+
"require": "./cjs/config/useConfiguredMergedProps.js"
|
|
37
|
+
},
|
|
38
|
+
"./config/useConfiguredDefaultProps": {
|
|
39
|
+
"import": "./esm/config/useConfiguredDefaultProps.js",
|
|
40
|
+
"require": "./cjs/config/useConfiguredDefaultProps.js"
|
|
41
|
+
},
|
|
42
|
+
"./config/useConfiguredDefaultModifiers": {
|
|
43
|
+
"import": "./esm/config/useConfiguredDefaultModifiers.js",
|
|
44
|
+
"require": "./cjs/config/useConfiguredDefaultModifiers.js"
|
|
45
|
+
},
|
|
46
|
+
"./config/useConfigDSPopperjs": {
|
|
47
|
+
"import": "./esm/config/useConfigDSPopperjs.js",
|
|
48
|
+
"require": "./cjs/config/useConfigDSPopperjs.js"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
8
51
|
"sideEffects": [
|
|
9
52
|
"*.css",
|
|
10
53
|
"*.scss"
|
|
11
54
|
],
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "git",
|
|
57
|
+
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
58
|
+
},
|
|
59
|
+
"engines": {
|
|
60
|
+
"npm": ">=7",
|
|
61
|
+
"node": ">=14"
|
|
62
|
+
},
|
|
63
|
+
"author": "ICE MT",
|
|
12
64
|
"scripts": {
|
|
13
65
|
"dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
|
|
14
66
|
"prebuild": "exit 0",
|
|
@@ -16,19 +68,22 @@
|
|
|
16
68
|
"build": "node ../../scripts/build/build.js"
|
|
17
69
|
},
|
|
18
70
|
"dependencies": {
|
|
19
|
-
"@elliemae/ds-props-helpers": "
|
|
20
|
-
"
|
|
71
|
+
"@elliemae/ds-props-helpers": "2.0.0-alpha.12",
|
|
72
|
+
"@elliemae/ds-system": "2.0.0-alpha.12",
|
|
73
|
+
"react-desc": "~4.1.3",
|
|
74
|
+
"react-popper": "~2.2.5"
|
|
21
75
|
},
|
|
22
76
|
"devDependencies": {
|
|
23
|
-
"styled-components": "~5.3.
|
|
77
|
+
"styled-components": "~5.3.3"
|
|
24
78
|
},
|
|
25
79
|
"peerDependencies": {
|
|
26
|
-
"react": "^17.0.
|
|
27
|
-
"react-dom": "^17.0.
|
|
28
|
-
"styled-components": "^5.3.
|
|
80
|
+
"react": "^17.0.2",
|
|
81
|
+
"react-dom": "^17.0.2",
|
|
82
|
+
"styled-components": "^5.3.3"
|
|
29
83
|
},
|
|
30
84
|
"publishConfig": {
|
|
31
85
|
"access": "public",
|
|
32
|
-
"directory": "dist"
|
|
86
|
+
"directory": "dist",
|
|
87
|
+
"generateSubmodules": true
|
|
33
88
|
}
|
|
34
89
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface PopoverArrowT {
|
|
3
|
+
placement: string;
|
|
4
|
+
style: React.CSSProperties;
|
|
5
|
+
arrowElementRef: React.Dispatch<React.SetStateAction<HTMLDivElement>>;
|
|
6
|
+
}
|
|
7
|
+
export declare const PopoverArrow: ({ placement, style, arrowElementRef }: PopoverArrowT) => React.ReactElement;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { PopoverContentPropsT } from './index.d';
|
|
3
|
+
export declare const PopoverContent: ({ setPopperElement, popperStyles, popperAttributes, children, showPopover, setArrowElement, setIsAnimating, arrowStyle, withoutArrow, withoutAnimation, animationDuration, zIndex, }: PopoverContentPropsT) => JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const useConfiguredDefaultProps: ({ props, arrowElement }: {
|
|
2
|
+
props: any;
|
|
3
|
+
arrowElement: any;
|
|
4
|
+
}) => {
|
|
5
|
+
modifiers: any;
|
|
6
|
+
referenceElement: null;
|
|
7
|
+
showPopover: boolean;
|
|
8
|
+
closeContextMenu: () => void;
|
|
9
|
+
onClickOutside: () => void;
|
|
10
|
+
withoutPortal: boolean;
|
|
11
|
+
withoutArrow: boolean;
|
|
12
|
+
withoutAnimation: boolean;
|
|
13
|
+
animationDuration: number;
|
|
14
|
+
portalDOMContainer: HTMLElement;
|
|
15
|
+
startPlacementPreference: string;
|
|
16
|
+
placementOrderPreference: string[];
|
|
17
|
+
zIndex: number;
|
|
18
|
+
extraPopperStyles: {};
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const useConfiguredMergedProps: ({ props, arrowElement }: {
|
|
2
|
+
props: any;
|
|
3
|
+
arrowElement: any;
|
|
4
|
+
}) => {
|
|
5
|
+
modifiers: any;
|
|
6
|
+
referenceElement: null;
|
|
7
|
+
showPopover: boolean;
|
|
8
|
+
closeContextMenu: () => void;
|
|
9
|
+
onClickOutside: () => void;
|
|
10
|
+
withoutPortal: boolean;
|
|
11
|
+
withoutArrow: boolean;
|
|
12
|
+
withoutAnimation: boolean;
|
|
13
|
+
animationDuration: number;
|
|
14
|
+
portalDOMContainer: HTMLElement;
|
|
15
|
+
startPlacementPreference: string;
|
|
16
|
+
placementOrderPreference: string[];
|
|
17
|
+
zIndex: number;
|
|
18
|
+
extraPopperStyles: {};
|
|
19
|
+
};
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
import type { DSDSPopperjsPropsT } from './index.d';
|
|
4
|
+
declare const DSPopperJS: {
|
|
5
|
+
(props: DSDSPopperjsPropsT): JSX.Element;
|
|
6
|
+
propTypes: {
|
|
7
|
+
referenceElement: import("react-desc").PropTypesDescValidator;
|
|
8
|
+
showPopover: import("react-desc").PropTypesDescValidator;
|
|
9
|
+
closeContextMenu: {
|
|
10
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
11
|
+
};
|
|
12
|
+
withoutPortal: {
|
|
13
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
14
|
+
};
|
|
15
|
+
withoutArrow: {
|
|
16
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
17
|
+
};
|
|
18
|
+
withoutAnimation: {
|
|
19
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
20
|
+
};
|
|
21
|
+
animationDuration: {
|
|
22
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
23
|
+
};
|
|
24
|
+
boundaryElement: {
|
|
25
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
26
|
+
};
|
|
27
|
+
portalDOMContainer: {
|
|
28
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
29
|
+
};
|
|
30
|
+
startPlacementPreference: {
|
|
31
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
32
|
+
};
|
|
33
|
+
placementOrderPreference: {
|
|
34
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
35
|
+
};
|
|
36
|
+
zIndex: {
|
|
37
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
38
|
+
};
|
|
39
|
+
customOffset: {
|
|
40
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
41
|
+
};
|
|
42
|
+
modifiers: {
|
|
43
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
44
|
+
};
|
|
45
|
+
extraPopperStyles: {
|
|
46
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
47
|
+
};
|
|
48
|
+
onClickOutside: {
|
|
49
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
50
|
+
};
|
|
51
|
+
children: {
|
|
52
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
declare const DSPopperJSWithSchema: any;
|
|
57
|
+
export { DSPopperJS, DSPopperJSWithSchema };
|
|
58
|
+
export default DSPopperJS;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
+
export declare const dspopperjsPropTypes: {
|
|
3
|
+
/**
|
|
4
|
+
* React ref to popperjs referenceElement
|
|
5
|
+
*/
|
|
6
|
+
referenceElement: import("react-desc").PropTypesDescValidator;
|
|
7
|
+
/**
|
|
8
|
+
* Wheter or not to show the popper content
|
|
9
|
+
*/
|
|
10
|
+
showPopover: import("react-desc").PropTypesDescValidator;
|
|
11
|
+
/**
|
|
12
|
+
* Callback to close the context menu, used for "on click outside",
|
|
13
|
+
* if not provided click outside will not trigger anything
|
|
14
|
+
*/
|
|
15
|
+
closeContextMenu: {
|
|
16
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Wheter or not the popper content should appear in a DOM portal or not
|
|
20
|
+
*/
|
|
21
|
+
withoutPortal: {
|
|
22
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Wheter or not the popper context menu should print the arrow
|
|
26
|
+
*/
|
|
27
|
+
withoutArrow: {
|
|
28
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Whether or not the popper context menu should be animated
|
|
32
|
+
*/
|
|
33
|
+
withoutAnimation: {
|
|
34
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Popper context menus Animation duration in ms
|
|
38
|
+
*/
|
|
39
|
+
animationDuration: {
|
|
40
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Bounding element to calculate upon, defaults to it is "clippingParents",
|
|
44
|
+
* which are the scrolling containers that may cause the element to be partially or fully cut off.
|
|
45
|
+
*/
|
|
46
|
+
boundaryElement: {
|
|
47
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* When using portal, the container in which to append the DOM content, defaults to document body
|
|
51
|
+
*/
|
|
52
|
+
portalDOMContainer: {
|
|
53
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* start placement preferences, as per popperjs placement option
|
|
57
|
+
*/
|
|
58
|
+
startPlacementPreference: {
|
|
59
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Array of placement preferences, as per popperjs "flip" placement option
|
|
63
|
+
*/
|
|
64
|
+
placementOrderPreference: {
|
|
65
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* popperjs content z-index
|
|
69
|
+
*/
|
|
70
|
+
zIndex: {
|
|
71
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* placement offset array
|
|
75
|
+
*/
|
|
76
|
+
customOffset: {
|
|
77
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* modifiers array for full-custom popper-js override
|
|
81
|
+
* https://popper.js.org/docs/v2/modifiers/
|
|
82
|
+
*/
|
|
83
|
+
modifiers: {
|
|
84
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
85
|
+
};
|
|
86
|
+
extraPopperStyles: {
|
|
87
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
88
|
+
};
|
|
89
|
+
onClickOutside: {
|
|
90
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
91
|
+
};
|
|
92
|
+
children: {
|
|
93
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
94
|
+
};
|
|
95
|
+
};
|