@elliemae/ds-popperjs 2.2.0-alpha.4 → 3.0.0-next.2
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 +51 -88
- package/cjs/PopoverContent.js +65 -70
- package/cjs/config/useConfigDSPopperjs.js +42 -51
- package/cjs/config/useConfiguredDefaultModifiers.js +50 -69
- package/cjs/config/useConfiguredDefaultProps.js +40 -44
- package/cjs/config/useConfiguredMergedProps.js +19 -39
- package/cjs/index.d.js +2 -27
- package/cjs/index.js +63 -79
- package/cjs/propTypes.js +83 -78
- package/cjs/styled.js +34 -68
- package/cjs/utils/hooks/useOnClickOutside.js +20 -42
- package/esm/PopoverArrow.js +42 -59
- package/esm/PopoverContent.js +55 -40
- package/esm/config/useConfigDSPopperjs.js +32 -16
- package/esm/config/useConfiguredDefaultModifiers.js +44 -38
- package/esm/config/useConfiguredDefaultProps.js +31 -14
- package/esm/config/useConfiguredMergedProps.js +14 -9
- package/esm/index.d.js +1 -2
- package/esm/index.js +50 -48
- package/esm/propTypes.js +79 -49
- package/esm/styled.js +25 -40
- package/esm/utils/hooks/useOnClickOutside.js +15 -12
- package/package.json +3 -3
- package/cjs/PopoverArrow.js.map +0 -7
- package/cjs/PopoverContent.js.map +0 -7
- package/cjs/config/useConfigDSPopperjs.js.map +0 -7
- package/cjs/config/useConfiguredDefaultModifiers.js.map +0 -7
- package/cjs/config/useConfiguredDefaultProps.js.map +0 -7
- package/cjs/config/useConfiguredMergedProps.js.map +0 -7
- package/cjs/index.d.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/propTypes.js.map +0 -7
- package/cjs/styled.js.map +0 -7
- package/cjs/utils/hooks/useOnClickOutside.js.map +0 -7
- package/esm/PopoverArrow.js.map +0 -7
- package/esm/PopoverContent.js.map +0 -7
- package/esm/config/useConfigDSPopperjs.js.map +0 -7
- package/esm/config/useConfiguredDefaultModifiers.js.map +0 -7
- package/esm/config/useConfiguredDefaultProps.js.map +0 -7
- package/esm/config/useConfiguredMergedProps.js.map +0 -7
- package/esm/index.d.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/propTypes.js.map +0 -7
- package/esm/styled.js.map +0 -7
- package/esm/utils/hooks/useOnClickOutside.js.map +0 -7
|
@@ -1,40 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
6
|
+
var useConfiguredDefaultProps = require('./useConfiguredDefaultProps.js');
|
|
7
|
+
|
|
8
|
+
const useConfiguredMergedProps = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
props,
|
|
11
|
+
arrowElement
|
|
12
|
+
} = _ref;
|
|
13
|
+
const defaultProps = useConfiguredDefaultProps.useConfiguredDefaultProps({
|
|
14
|
+
props,
|
|
15
|
+
arrowElement
|
|
16
|
+
});
|
|
17
|
+
return dsPropsHelpers.useMemoMergePropsWithDefault(props, defaultProps);
|
|
11
18
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var useConfiguredMergedProps_exports = {};
|
|
29
|
-
__export(useConfiguredMergedProps_exports, {
|
|
30
|
-
useConfiguredMergedProps: () => useConfiguredMergedProps
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
34
|
-
var import_useConfiguredDefaultProps = require("./useConfiguredDefaultProps");
|
|
35
|
-
const useConfiguredMergedProps = ({ props, arrowElement }) => {
|
|
36
|
-
const defaultProps = (0, import_useConfiguredDefaultProps.useConfiguredDefaultProps)({ props, arrowElement });
|
|
37
|
-
return (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, defaultProps);
|
|
38
|
-
};
|
|
39
|
-
module.exports = __toCommonJS(useConfiguredMergedProps_exports);
|
|
40
|
-
//# sourceMappingURL=useConfiguredMergedProps.js.map
|
|
19
|
+
|
|
20
|
+
exports.useConfiguredMergedProps = useConfiguredMergedProps;
|
package/cjs/index.d.js
CHANGED
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
9
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(module2))
|
|
11
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (module2, isNodeMode) => {
|
|
17
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
-
var index_d_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
|
-
module.exports = __toCommonJS(index_d_exports);
|
|
27
|
-
//# sourceMappingURL=index.d.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
package/cjs/index.js
CHANGED
|
@@ -1,44 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
DSPopperJS: () => DSPopperJS,
|
|
31
|
-
DSPopperJSWithSchema: () => DSPopperJSWithSchema,
|
|
32
|
-
default: () => src_default
|
|
33
|
-
});
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_react = __toESM(require("react"));
|
|
36
|
-
var import_react_dom = require("react-dom");
|
|
37
|
-
var import_react_desc = require("react-desc");
|
|
38
|
-
var import_propTypes = require("./propTypes");
|
|
39
|
-
var import_PopoverContent = require("./PopoverContent");
|
|
40
|
-
var import_useConfigDSPopperjs = require("./config/useConfigDSPopperjs");
|
|
41
|
-
const DSPopperJS = (props) => {
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
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');
|
|
10
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
11
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
12
|
+
var react = require('react');
|
|
13
|
+
var reactDom = require('react-dom');
|
|
14
|
+
var reactDesc = require('react-desc');
|
|
15
|
+
var propTypes = require('./propTypes.js');
|
|
16
|
+
var PopoverContent = require('./PopoverContent.js');
|
|
17
|
+
var useConfigDSPopperjs = require('./config/useConfigDSPopperjs.js');
|
|
18
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
19
|
+
|
|
20
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
21
|
+
|
|
22
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
23
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
24
|
+
|
|
25
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
26
|
+
|
|
27
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
28
|
+
|
|
29
|
+
const DSPopperJS = props => {
|
|
42
30
|
const {
|
|
43
31
|
props: {
|
|
44
32
|
showPopover,
|
|
@@ -55,47 +43,43 @@ const DSPopperJS = (props) => {
|
|
|
55
43
|
setIsAnimating,
|
|
56
44
|
popoverHelper,
|
|
57
45
|
isAnimating
|
|
58
|
-
} =
|
|
59
|
-
const {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
46
|
+
} = useConfigDSPopperjs.useConfigDSPopperjs(props);
|
|
47
|
+
const {
|
|
48
|
+
children
|
|
49
|
+
} = props;
|
|
50
|
+
const {
|
|
51
|
+
styles,
|
|
52
|
+
attributes
|
|
53
|
+
} = popoverHelper;
|
|
54
|
+
const contentJSX = react.useMemo(() => /*#__PURE__*/_jsx__default["default"](PopoverContent.PopoverContent, {
|
|
55
|
+
setPopperElement: setPopperElement,
|
|
56
|
+
popperStyles: _objectSpread(_objectSpread({}, styles.popper), extraPopperStyles),
|
|
64
57
|
popperAttributes: attributes.popper,
|
|
65
|
-
setArrowElement,
|
|
58
|
+
setArrowElement: setArrowElement,
|
|
66
59
|
arrowStyle: styles.arrow,
|
|
67
|
-
withoutArrow,
|
|
68
|
-
withoutAnimation,
|
|
69
|
-
animationDuration,
|
|
70
|
-
zIndex,
|
|
71
|
-
showPopover,
|
|
72
|
-
setIsAnimating
|
|
73
|
-
}, children), [
|
|
74
|
-
|
|
75
|
-
children,
|
|
76
|
-
setIsAnimating,
|
|
77
|
-
showPopover,
|
|
78
|
-
extraPopperStyles,
|
|
79
|
-
setArrowElement,
|
|
80
|
-
setPopperElement,
|
|
81
|
-
styles.arrow,
|
|
82
|
-
styles.popper,
|
|
83
|
-
withoutArrow,
|
|
84
|
-
withoutAnimation,
|
|
85
|
-
animationDuration,
|
|
86
|
-
zIndex
|
|
87
|
-
]);
|
|
60
|
+
withoutArrow: withoutArrow,
|
|
61
|
+
withoutAnimation: withoutAnimation,
|
|
62
|
+
animationDuration: animationDuration,
|
|
63
|
+
zIndex: zIndex,
|
|
64
|
+
showPopover: showPopover,
|
|
65
|
+
setIsAnimating: setIsAnimating
|
|
66
|
+
}, void 0, children), [attributes.popper, children, setIsAnimating, showPopover, extraPopperStyles, setArrowElement, setPopperElement, styles.arrow, styles.popper, withoutArrow, withoutAnimation, animationDuration, zIndex]);
|
|
67
|
+
|
|
88
68
|
if (showPopover || isAnimating) {
|
|
89
|
-
if (withoutPortal === true)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
69
|
+
if (withoutPortal === true) return contentJSX;
|
|
70
|
+
if (withoutPortal === false) return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
71
|
+
children: /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
72
|
+
children: contentJSX
|
|
73
|
+
}), portalDOMContainer)
|
|
74
|
+
});
|
|
93
75
|
}
|
|
76
|
+
|
|
94
77
|
return null;
|
|
95
78
|
};
|
|
96
|
-
|
|
97
|
-
const DSPopperJSWithSchema =
|
|
98
|
-
DSPopperJSWithSchema.propTypes =
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
79
|
+
|
|
80
|
+
const DSPopperJSWithSchema = reactDesc.describe(DSPopperJS).description('A dimsum custom styling wrapper on top of popperjs');
|
|
81
|
+
DSPopperJSWithSchema.propTypes = propTypes.dspopperjsPropTypes;
|
|
82
|
+
|
|
83
|
+
exports.DSPopperJS = DSPopperJS;
|
|
84
|
+
exports.DSPopperJSWithSchema = DSPopperJSWithSchema;
|
|
85
|
+
exports["default"] = DSPopperJS;
|
package/cjs/propTypes.js
CHANGED
|
@@ -1,80 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var propTypes_exports = {};
|
|
29
|
-
__export(propTypes_exports, {
|
|
30
|
-
dspopperjsPropTypes: () => dspopperjsPropTypes
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_react_desc = require("react-desc");
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var reactDesc = require('react-desc');
|
|
6
|
+
|
|
34
7
|
const dspopperjsPropTypes = {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
8
|
+
/**
|
|
9
|
+
* React ref to popperjs referenceElement
|
|
10
|
+
*/
|
|
11
|
+
referenceElement: reactDesc.PropTypes.element.description('popperjs DOM referenceElement').isRequired,
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Wheter or not to show the popper content
|
|
15
|
+
*/
|
|
16
|
+
showPopover: reactDesc.PropTypes.bool.description('whether or not to show the popper content').isRequired,
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Callback to close the context menu, used for "on click outside",
|
|
20
|
+
* if not provided click outside will not trigger anything
|
|
21
|
+
*/
|
|
22
|
+
closeContextMenu: reactDesc.PropTypes.func.description('Callback to close the context menu, used for "on click outside",' + ' if not provided click outside will not trigger anything').defaultValue('() => {}'),
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Wheter or not the popper content should appear in a DOM portal or not
|
|
26
|
+
*/
|
|
27
|
+
withoutPortal: reactDesc.PropTypes.bool.description('Whether or not the popper content should appear in a DOM portal or not').defaultValue(true),
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Wheter or not the popper context menu should print the arrow
|
|
31
|
+
*/
|
|
32
|
+
withoutArrow: reactDesc.PropTypes.bool.description('Whether or not the popper context menu should print the arrow').defaultValue(false),
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Whether or not the popper context menu should be animated
|
|
36
|
+
*/
|
|
37
|
+
withoutAnimation: reactDesc.PropTypes.bool.description('Whether or not the popper context menu should be animated').defaultValue(false),
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Popper context menus Animation duration in ms
|
|
41
|
+
*/
|
|
42
|
+
animationDuration: reactDesc.PropTypes.number.description('Popper context menus Animation duration in ms').defaultValue(100),
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Bounding element to calculate upon, defaults to it is "clippingParents",
|
|
46
|
+
* which are the scrolling containers that may cause the element to be partially or fully cut off.
|
|
47
|
+
*/
|
|
48
|
+
boundaryElement: reactDesc.PropTypes.element.description('Bounding element to calculate upon, defaults to "clippingParents",' + 'which are the scrolling containers that may cause element to be partially or fully cut off').defaultValue(undefined),
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* When using portal, the container in which to append the DOM content, defaults to document body
|
|
52
|
+
*/
|
|
53
|
+
portalDOMContainer: reactDesc.PropTypes.element.description('When using portal, the container in which to append the DOM content, defaults to document body').defaultValue(undefined),
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* start placement preferences, as per popperjs placement option
|
|
57
|
+
*/
|
|
58
|
+
startPlacementPreference: reactDesc.PropTypes.oneOf(['top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']).description('start placement preferences, as per popperjs placement option').defaultValue("'top'"),
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Array of placement preferences, as per popperjs "flip" placement option
|
|
62
|
+
*/
|
|
63
|
+
placementOrderPreference: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.oneOf(['top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'])).description('Array of placement preferences, as per popperjs "flip" placement option').defaultValue("['top', 'bottom', 'left', 'right']"),
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* popperjs content z-index
|
|
67
|
+
*/
|
|
68
|
+
zIndex: reactDesc.PropTypes.number.description('popperjs content z-index').defaultValue(1),
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* placement offset array
|
|
72
|
+
*/
|
|
73
|
+
customOffset: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.number).description('placement offset array').defaultValue(1),
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* modifiers array for full-custom popper-js override
|
|
77
|
+
* https://popper.js.org/docs/v2/modifiers/
|
|
78
|
+
*/
|
|
79
|
+
modifiers: reactDesc.PropTypes.array.description('modifiers array for full-custom popper-js override, https://popper.js.org/docs/v2/modifiers/').defaultValue(1),
|
|
80
|
+
extraPopperStyles: reactDesc.PropTypes.object.description('Extra object styles to attach to the popper element').defaultValue({}),
|
|
81
|
+
onClickOutside: reactDesc.PropTypes.func.description('Callback triggered when clicking outside the popper').defaultValue(() => null),
|
|
82
|
+
children: reactDesc.PropTypes.node.description('The content of the popper').defaultValue(undefined)
|
|
78
83
|
};
|
|
79
|
-
|
|
80
|
-
|
|
84
|
+
|
|
85
|
+
exports.dspopperjsPropTypes = dspopperjsPropTypes;
|
package/cjs/styled.js
CHANGED
|
@@ -1,71 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var styled_exports = {};
|
|
29
|
-
__export(styled_exports, {
|
|
30
|
-
StyledAnimatedPopper: () => StyledAnimatedPopper,
|
|
31
|
-
StyledPopoverContentWrapper: () => StyledPopoverContentWrapper
|
|
32
|
-
});
|
|
33
|
-
var React = __toESM(require("react"));
|
|
34
|
-
var import_styled_components = __toESM(require("styled-components"));
|
|
35
|
-
var import_ds_system = require("@elliemae/ds-system");
|
|
36
|
-
const showAnimation = import_ds_system.kfrm`
|
|
37
|
-
from {
|
|
38
|
-
opacity: 0;
|
|
39
|
-
transform: scale(0.8);
|
|
40
|
-
}
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
|
|
6
|
+
var styled = require('styled-components');
|
|
7
|
+
var dsSystem = require('@elliemae/ds-system');
|
|
41
8
|
|
|
42
|
-
|
|
43
|
-
opacity: 1;
|
|
44
|
-
transform: scale(1);
|
|
45
|
-
visibility: visible;
|
|
46
|
-
}
|
|
47
|
-
`;
|
|
48
|
-
const hideAnimation = import_ds_system.kfrm`
|
|
49
|
-
from {
|
|
50
|
-
opacity: 1;
|
|
51
|
-
transform: scale(1);
|
|
52
|
-
}
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
53
10
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const StyledPopoverContentWrapper =
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
11
|
+
var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
|
|
12
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
13
|
+
|
|
14
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
15
|
+
const showAnimation = dsSystem.kfrm(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["\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"])));
|
|
16
|
+
const hideAnimation = dsSystem.kfrm(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral__default["default"](["\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"])));
|
|
17
|
+
const StyledPopoverContentWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
18
|
+
componentId: "sc-1giz5kx-0"
|
|
19
|
+
})(["z-index:", ";"], _ref => {
|
|
20
|
+
let {
|
|
21
|
+
zIndex
|
|
22
|
+
} = _ref;
|
|
23
|
+
return zIndex;
|
|
24
|
+
});
|
|
25
|
+
const StyledAnimatedPopper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
26
|
+
componentId: "sc-1giz5kx-1"
|
|
27
|
+
})(["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 => {
|
|
28
|
+
let {
|
|
29
|
+
showPopover,
|
|
30
|
+
animationDuration,
|
|
31
|
+
withoutAnimation
|
|
32
|
+
} = _ref2;
|
|
33
|
+
return !withoutAnimation && dsSystem.css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral__default["default"](["\n animation: ", " ", "ms ease-in;\n "])), showPopover ? showAnimation : hideAnimation, animationDuration);
|
|
34
|
+
});
|
|
65
35
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
`}
|
|
69
|
-
`;
|
|
70
|
-
module.exports = __toCommonJS(styled_exports);
|
|
71
|
-
//# sourceMappingURL=styled.js.map
|
|
36
|
+
exports.StyledAnimatedPopper = StyledAnimatedPopper;
|
|
37
|
+
exports.StyledPopoverContentWrapper = StyledPopoverContentWrapper;
|
|
@@ -1,51 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var useOnClickOutside_exports = {};
|
|
29
|
-
__export(useOnClickOutside_exports, {
|
|
30
|
-
useOnClickOutside: () => useOnClickOutside
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_react = require("react");
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var react = require('react');
|
|
6
|
+
|
|
34
7
|
function useOnClickOutside(ref, cb) {
|
|
35
|
-
|
|
36
|
-
const listener =
|
|
37
|
-
|
|
8
|
+
react.useEffect(() => {
|
|
9
|
+
const listener = event => {
|
|
10
|
+
var _ref$contains;
|
|
11
|
+
|
|
12
|
+
// Do nothing if clicking ref's element or descendent elements
|
|
13
|
+
if (!ref || ref !== null && ref !== void 0 && (_ref$contains = ref.contains) !== null && _ref$contains !== void 0 && _ref$contains.call(ref, event.target)) {
|
|
38
14
|
return;
|
|
39
15
|
}
|
|
16
|
+
|
|
40
17
|
cb(event);
|
|
41
18
|
};
|
|
42
|
-
|
|
43
|
-
document.addEventListener(
|
|
19
|
+
|
|
20
|
+
document.addEventListener('mousedown', listener);
|
|
21
|
+
document.addEventListener('touchstart', listener);
|
|
44
22
|
return () => {
|
|
45
|
-
document.removeEventListener(
|
|
46
|
-
document.removeEventListener(
|
|
23
|
+
document.removeEventListener('mousedown', listener);
|
|
24
|
+
document.removeEventListener('touchstart', listener);
|
|
47
25
|
};
|
|
48
26
|
}, [ref, cb]);
|
|
49
27
|
}
|
|
50
|
-
|
|
51
|
-
|
|
28
|
+
|
|
29
|
+
exports.useOnClickOutside = useOnClickOutside;
|