@elliemae/ds-popperjs 2.3.0-alpha.8 → 2.3.0-next.10
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 +54 -0
- package/cjs/PopoverContent.js +71 -0
- package/cjs/config/useConfigDSPopperjs.js +60 -0
- package/cjs/config/useConfiguredDefaultModifiers.js +70 -0
- package/cjs/config/useConfiguredDefaultProps.js +58 -0
- package/cjs/config/useConfiguredMergedProps.js +20 -0
- package/cjs/index.d.js +2 -0
- package/cjs/index.js +85 -0
- package/cjs/propTypes.js +85 -0
- package/cjs/styled.js +37 -0
- package/cjs/utils/hooks/useOnClickOutside.js +29 -0
- package/esm/PopoverArrow.js +45 -0
- package/esm/PopoverContent.js +62 -0
- package/esm/config/useConfigDSPopperjs.js +56 -0
- package/esm/config/useConfiguredDefaultModifiers.js +66 -0
- package/esm/config/useConfiguredDefaultProps.js +50 -0
- package/esm/config/useConfiguredMergedProps.js +16 -0
- package/esm/index.d.js +1 -0
- package/esm/index.js +74 -0
- package/esm/propTypes.js +81 -0
- package/esm/styled.js +27 -0
- package/esm/utils/hooks/useOnClickOutside.js +25 -0
- package/package.json +36 -38
- 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/dist/cjs/PopoverArrow.js +0 -91
- package/dist/cjs/PopoverArrow.js.map +0 -7
- package/dist/cjs/PopoverContent.js +0 -76
- package/dist/cjs/PopoverContent.js.map +0 -7
- package/dist/cjs/config/useConfigDSPopperjs.js +0 -69
- package/dist/cjs/config/useConfigDSPopperjs.js.map +0 -7
- package/dist/cjs/config/useConfiguredDefaultModifiers.js +0 -89
- package/dist/cjs/config/useConfiguredDefaultModifiers.js.map +0 -7
- package/dist/cjs/config/useConfiguredDefaultProps.js +0 -62
- package/dist/cjs/config/useConfiguredDefaultProps.js.map +0 -7
- package/dist/cjs/config/useConfiguredMergedProps.js +0 -40
- package/dist/cjs/config/useConfiguredMergedProps.js.map +0 -7
- package/dist/cjs/index.d.js +0 -27
- package/dist/cjs/index.d.js.map +0 -7
- package/dist/cjs/index.js +0 -101
- package/dist/cjs/index.js.map +0 -7
- package/dist/cjs/propTypes.js +0 -80
- package/dist/cjs/propTypes.js.map +0 -7
- package/dist/cjs/styled.js +0 -71
- package/dist/cjs/styled.js.map +0 -7
- package/dist/cjs/utils/hooks/useOnClickOutside.js +0 -51
- package/dist/cjs/utils/hooks/useOnClickOutside.js.map +0 -7
- package/dist/esm/PopoverArrow.js +0 -62
- package/dist/esm/PopoverArrow.js.map +0 -7
- package/dist/esm/PopoverContent.js +0 -47
- package/dist/esm/PopoverContent.js.map +0 -7
- package/dist/esm/config/useConfigDSPopperjs.js +0 -40
- package/dist/esm/config/useConfigDSPopperjs.js.map +0 -7
- package/dist/esm/config/useConfiguredDefaultModifiers.js +0 -60
- package/dist/esm/config/useConfiguredDefaultModifiers.js.map +0 -7
- package/dist/esm/config/useConfiguredDefaultProps.js +0 -33
- package/dist/esm/config/useConfiguredDefaultProps.js.map +0 -7
- package/dist/esm/config/useConfiguredMergedProps.js +0 -11
- package/dist/esm/config/useConfiguredMergedProps.js.map +0 -7
- package/dist/esm/index.d.js +0 -2
- package/dist/esm/index.d.js.map +0 -7
- package/dist/esm/index.js +0 -72
- package/dist/esm/index.js.map +0 -7
- package/dist/esm/propTypes.js +0 -51
- package/dist/esm/propTypes.js.map +0 -7
- package/dist/esm/styled.js +0 -42
- package/dist/esm/styled.js.map +0 -7
- package/dist/esm/utils/hooks/useOnClickOutside.js +0 -22
- package/dist/esm/utils/hooks/useOnClickOutside.js.map +0 -7
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").PropTypesDescValue;
|
|
8
|
+
showPopover: import("react-desc").PropTypesDescValue;
|
|
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").PropTypesDescValue;
|
|
7
|
+
/**
|
|
8
|
+
* Wheter or not to show the popper content
|
|
9
|
+
*/
|
|
10
|
+
showPopover: import("react-desc").PropTypesDescValue;
|
|
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
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface StyledContentWrapperPropsT {
|
|
2
|
+
zIndex: number;
|
|
3
|
+
}
|
|
4
|
+
interface StyledAnimatedPopperPropsT {
|
|
5
|
+
showPopover: boolean;
|
|
6
|
+
animationDuration: number;
|
|
7
|
+
withoutAnimation: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const StyledPopoverContentWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledContentWrapperPropsT, never>;
|
|
10
|
+
export declare const StyledAnimatedPopper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledAnimatedPopperPropsT, never>;
|
|
11
|
+
export {};
|
package/dist/cjs/PopoverArrow.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
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 __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 PopoverArrow_exports = {};
|
|
29
|
-
__export(PopoverArrow_exports, {
|
|
30
|
-
PopoverArrow: () => PopoverArrow
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_react = __toESM(require("react"));
|
|
34
|
-
var import_styled_components = __toESM(require("styled-components"));
|
|
35
|
-
const arrowWidth = 18;
|
|
36
|
-
const arrowHeight = 18;
|
|
37
|
-
const StyledArrow = import_styled_components.default.div`
|
|
38
|
-
position: absolute;
|
|
39
|
-
width: ${arrowWidth}px;
|
|
40
|
-
height: ${arrowHeight}px;
|
|
41
|
-
pointer-events: none;
|
|
42
|
-
background-color: transparent;
|
|
43
|
-
& .stroke {
|
|
44
|
-
fill: ${({ theme }) => theme.colors.neutral["500"]};
|
|
45
|
-
fill-opacity: 0.4;
|
|
46
|
-
}
|
|
47
|
-
& .fill {
|
|
48
|
-
fill: ${({ theme }) => theme.colors.neutral["000"]};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&[data-placement^='top'] {
|
|
52
|
-
svg {
|
|
53
|
-
transform: rotateZ(180deg);
|
|
54
|
-
}
|
|
55
|
-
bottom: -${arrowHeight}px;
|
|
56
|
-
}
|
|
57
|
-
&[data-placement^='right'] {
|
|
58
|
-
svg {
|
|
59
|
-
transform: rotateZ(-90deg);
|
|
60
|
-
}
|
|
61
|
-
left: -${arrowWidth}px;
|
|
62
|
-
}
|
|
63
|
-
&[data-placement^='bottom'] {
|
|
64
|
-
top: -${arrowHeight}px;
|
|
65
|
-
}
|
|
66
|
-
&[data-placement^='left'] {
|
|
67
|
-
svg {
|
|
68
|
-
transform: rotateZ(90deg);
|
|
69
|
-
}
|
|
70
|
-
right: -${arrowWidth}px;
|
|
71
|
-
}
|
|
72
|
-
margin-left: ${(props) => props["data-placement"].startsWith("top") || props["data-placement"].startsWith("bottom") ? `-${arrowWidth / 2}px;` : "0;"};
|
|
73
|
-
margin-top: ${(props) => props["data-placement"].startsWith("left") || props["data-placement"].startsWith("right") ? `-${arrowHeight / 2}px;` : "0;"};
|
|
74
|
-
`;
|
|
75
|
-
const PopoverArrow = ({ placement, style, arrowElementRef }) => /* @__PURE__ */ import_react.default.createElement(StyledArrow, {
|
|
76
|
-
key: "popper-arrow",
|
|
77
|
-
"data-placement": placement,
|
|
78
|
-
style,
|
|
79
|
-
ref: arrowElementRef,
|
|
80
|
-
"data-testid": "ds-tooltip-arrow"
|
|
81
|
-
}, /* @__PURE__ */ import_react.default.createElement("svg", {
|
|
82
|
-
viewBox: "0 0 30 30"
|
|
83
|
-
}, /* @__PURE__ */ import_react.default.createElement("path", {
|
|
84
|
-
className: "stroke",
|
|
85
|
-
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\n C26.7,29,24.6,28.1,23.7,27.1z"
|
|
86
|
-
}), /* @__PURE__ */ import_react.default.createElement("path", {
|
|
87
|
-
className: "fill",
|
|
88
|
-
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"
|
|
89
|
-
})));
|
|
90
|
-
module.exports = __toCommonJS(PopoverArrow_exports);
|
|
91
|
-
//# sourceMappingURL=PopoverArrow.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/PopoverArrow.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport styled from 'styled-components';\ninterface PopoverArrowT {\n placement: string;\n style: React.CSSProperties;\n arrowElementRef: React.Dispatch<React.SetStateAction<HTMLDivElement>>;\n}\nconst arrowWidth = 18;\nconst arrowHeight = 18;\n\nconst StyledArrow = styled.div`\n position: absolute;\n width: ${arrowWidth}px;\n height: ${arrowHeight}px;\n pointer-events: none;\n background-color: transparent;\n & .stroke {\n fill: ${({ theme }) => theme.colors.neutral['500']};\n fill-opacity: 0.4;\n }\n & .fill {\n fill: ${({ theme }) => theme.colors.neutral['000']};\n }\n\n &[data-placement^='top'] {\n svg {\n transform: rotateZ(180deg);\n }\n bottom: -${arrowHeight}px;\n }\n &[data-placement^='right'] {\n svg {\n transform: rotateZ(-90deg);\n }\n left: -${arrowWidth}px;\n }\n &[data-placement^='bottom'] {\n top: -${arrowHeight}px;\n }\n &[data-placement^='left'] {\n svg {\n transform: rotateZ(90deg);\n }\n right: -${arrowWidth}px;\n }\n margin-left: ${(props) =>\n props['data-placement'].startsWith('top') || props['data-placement'].startsWith('bottom')\n ? `-${arrowWidth / 2}px;`\n : '0;'};\n margin-top: ${(props) =>\n props['data-placement'].startsWith('left') || props['data-placement'].startsWith('right')\n ? `-${arrowHeight / 2}px;`\n : '0;'};\n`;\n\nexport const PopoverArrow = ({ placement, style, arrowElementRef }: PopoverArrowT): React.ReactElement => (\n <StyledArrow\n key=\"popper-arrow\"\n data-placement={placement}\n style={style}\n ref={arrowElementRef}\n data-testid=\"ds-tooltip-arrow\"\n >\n <svg viewBox=\"0 0 30 30\">\n <path\n className=\"stroke\"\n 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\n C26.7,29,24.6,28.1,23.7,27.1z\"\n />\n <path\n className=\"fill\"\n 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\"\n />\n </svg>\n </StyledArrow>\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,+BAAmB;AAMnB,MAAM,aAAa;AACnB,MAAM,cAAc;AAEpB,MAAM,cAAc,iCAAO;AAAA;AAAA,WAEhB;AAAA,YACC;AAAA;AAAA;AAAA;AAAA,YAIA,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAAA,YAIpC,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAOjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAMF;AAAA;AAAA;AAAA,YAGD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAME;AAAA;AAAA,iBAEG,CAAC,UACd,MAAM,kBAAkB,WAAW,UAAU,MAAM,kBAAkB,WAAW,YAC5E,IAAI,aAAa,SACjB;AAAA,gBACQ,CAAC,UACb,MAAM,kBAAkB,WAAW,WAAW,MAAM,kBAAkB,WAAW,WAC7E,IAAI,cAAc,SAClB;AAAA;AAGD,MAAM,eAAe,CAAC,EAAE,WAAW,OAAO,sBAC/C,mDAAC,aAAD;AAAA,EACE,KAAI;AAAA,EACJ,kBAAgB;AAAA,EAChB;AAAA,EACA,KAAK;AAAA,EACL,eAAY;AAAA,GAEZ,mDAAC,OAAD;AAAA,EAAK,SAAQ;AAAA,GACX,mDAAC,QAAD;AAAA,EACE,WAAU;AAAA,EACV,GAAE;AAAA,IAGJ,mDAAC,QAAD;AAAA,EACE,WAAU;AAAA,EACV,GAAE;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
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 __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 PopoverContent_exports = {};
|
|
29
|
-
__export(PopoverContent_exports, {
|
|
30
|
-
PopoverContent: () => PopoverContent
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_react = __toESM(require("react"));
|
|
34
|
-
var import_PopoverArrow = require("./PopoverArrow");
|
|
35
|
-
var import_styled = require("./styled");
|
|
36
|
-
const PopoverContent = ({
|
|
37
|
-
setPopperElement,
|
|
38
|
-
popperStyles,
|
|
39
|
-
popperAttributes,
|
|
40
|
-
children,
|
|
41
|
-
showPopover,
|
|
42
|
-
setArrowElement,
|
|
43
|
-
setIsAnimating,
|
|
44
|
-
arrowStyle,
|
|
45
|
-
withoutArrow,
|
|
46
|
-
withoutAnimation,
|
|
47
|
-
animationDuration,
|
|
48
|
-
zIndex
|
|
49
|
-
}) => {
|
|
50
|
-
const checkAnimationStatus = (0, import_react.useCallback)(() => {
|
|
51
|
-
if (!showPopover && !withoutAnimation) {
|
|
52
|
-
setIsAnimating(false);
|
|
53
|
-
}
|
|
54
|
-
}, [showPopover, withoutAnimation, setIsAnimating]);
|
|
55
|
-
const popperContent = (0, import_react.useMemo)(() => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, children, withoutArrow === false ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_PopoverArrow.PopoverArrow, {
|
|
56
|
-
arrowElementRef: setArrowElement,
|
|
57
|
-
style: arrowStyle,
|
|
58
|
-
placement: popperAttributes ? popperAttributes["data-popper-placement"] : "bottom"
|
|
59
|
-
}), /* @__PURE__ */ import_react.default.createElement("div", {
|
|
60
|
-
ref: setArrowElement,
|
|
61
|
-
style: arrowStyle
|
|
62
|
-
})) : null), [children, withoutArrow, arrowStyle, popperAttributes, setArrowElement]);
|
|
63
|
-
return /* @__PURE__ */ import_react.default.createElement(import_styled.StyledPopoverContentWrapper, {
|
|
64
|
-
zIndex,
|
|
65
|
-
ref: setPopperElement,
|
|
66
|
-
style: popperStyles,
|
|
67
|
-
...popperAttributes
|
|
68
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_styled.StyledAnimatedPopper, {
|
|
69
|
-
showPopover,
|
|
70
|
-
animationDuration,
|
|
71
|
-
withoutAnimation,
|
|
72
|
-
onAnimationEnd: checkAnimationStatus
|
|
73
|
-
}, popperContent));
|
|
74
|
-
};
|
|
75
|
-
module.exports = __toCommonJS(PopoverContent_exports);
|
|
76
|
-
//# sourceMappingURL=PopoverContent.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/PopoverContent.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useCallback, useMemo } from 'react';\nimport { PopoverArrow } from './PopoverArrow';\nimport type { PopoverContentPropsT } from './index.d';\nimport { StyledPopoverContentWrapper, StyledAnimatedPopper } from './styled';\n\nexport const PopoverContent = ({\n setPopperElement,\n popperStyles,\n popperAttributes,\n children,\n showPopover,\n setArrowElement,\n setIsAnimating,\n arrowStyle,\n withoutArrow,\n withoutAnimation,\n animationDuration,\n zIndex,\n}: PopoverContentPropsT): JSX.Element => {\n const checkAnimationStatus = useCallback(() => {\n if (!showPopover && !withoutAnimation) {\n setIsAnimating(false);\n }\n }, [showPopover, withoutAnimation, setIsAnimating]);\n\n const popperContent = useMemo(\n () => (\n <>\n {children}\n {withoutArrow === false ? (\n <>\n <PopoverArrow\n arrowElementRef={setArrowElement}\n style={arrowStyle}\n placement={popperAttributes ? popperAttributes['data-popper-placement'] : 'bottom'}\n />\n <div ref={setArrowElement} style={arrowStyle} />\n </>\n ) : null}\n </>\n ),\n [children, withoutArrow, arrowStyle, popperAttributes, setArrowElement],\n );\n return (\n <StyledPopoverContentWrapper zIndex={zIndex} ref={setPopperElement} style={popperStyles} {...popperAttributes}>\n <StyledAnimatedPopper\n showPopover={showPopover}\n animationDuration={animationDuration}\n withoutAnimation={withoutAnimation}\n onAnimationEnd={checkAnimationStatus}\n >\n {popperContent}\n </StyledAnimatedPopper>\n </StyledPopoverContentWrapper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA4C;AAC5C,0BAA6B;AAE7B,oBAAkE;AAE3D,MAAM,iBAAiB,CAAC;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MACuC;AACvC,QAAM,uBAAuB,8BAAY,MAAM;AAC7C,QAAI,CAAC,eAAe,CAAC,kBAAkB;AACrC,qBAAe;AAAA;AAAA,KAEhB,CAAC,aAAa,kBAAkB;AAEnC,QAAM,gBAAgB,0BACpB,MACE,wFACG,UACA,iBAAiB,QAChB,wFACE,mDAAC,kCAAD;AAAA,IACE,iBAAiB;AAAA,IACjB,OAAO;AAAA,IACP,WAAW,mBAAmB,iBAAiB,2BAA2B;AAAA,MAE5E,mDAAC,OAAD;AAAA,IAAK,KAAK;AAAA,IAAiB,OAAO;AAAA,QAElC,OAGR,CAAC,UAAU,cAAc,YAAY,kBAAkB;AAEzD,SACE,mDAAC,2CAAD;AAAA,IAA6B;AAAA,IAAgB,KAAK;AAAA,IAAkB,OAAO;AAAA,OAAkB;AAAA,KAC3F,mDAAC,oCAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,KAEf;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
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 __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 useConfigDSPopperjs_exports = {};
|
|
29
|
-
__export(useConfigDSPopperjs_exports, {
|
|
30
|
-
useConfigDSPopperjs: () => useConfigDSPopperjs
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_react = require("react");
|
|
34
|
-
var import_react_popper = require("react-popper");
|
|
35
|
-
var import_useConfiguredMergedProps = require("./useConfiguredMergedProps");
|
|
36
|
-
var import_useOnClickOutside = require("../utils/hooks/useOnClickOutside");
|
|
37
|
-
const useConfigDSPopperjs = (appProps) => {
|
|
38
|
-
const [popperElement, setPopperElement] = (0, import_react.useState)(null);
|
|
39
|
-
const [arrowElement, setArrowElement] = (0, import_react.useState)(null);
|
|
40
|
-
const [isAnimating, setIsAnimating] = (0, import_react.useState)(false);
|
|
41
|
-
const props = (0, import_useConfiguredMergedProps.useConfiguredMergedProps)({ props: appProps, arrowElement });
|
|
42
|
-
const { referenceElement, closeContextMenu, onClickOutside, modifiers, startPlacementPreference } = props;
|
|
43
|
-
const popperExtraOpts = (0, import_react.useMemo)(() => ({ placement: startPlacementPreference, modifiers }), [modifiers, startPlacementPreference]);
|
|
44
|
-
const popoverHelper = (0, import_react_popper.usePopper)(referenceElement, popperElement, popperExtraOpts);
|
|
45
|
-
const { showPopover, withoutAnimation } = props;
|
|
46
|
-
(0, import_react.useEffect)(() => {
|
|
47
|
-
if (showPopover && !withoutAnimation) {
|
|
48
|
-
setIsAnimating(true);
|
|
49
|
-
}
|
|
50
|
-
}, [showPopover, withoutAnimation]);
|
|
51
|
-
(0, import_useOnClickOutside.useOnClickOutside)(popperElement, (e) => {
|
|
52
|
-
if (!referenceElement?.contains?.(e?.target)) {
|
|
53
|
-
onClickOutside(e);
|
|
54
|
-
closeContextMenu();
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
return (0, import_react.useMemo)(() => ({
|
|
58
|
-
props,
|
|
59
|
-
popperElement,
|
|
60
|
-
setPopperElement,
|
|
61
|
-
arrowElement,
|
|
62
|
-
setArrowElement,
|
|
63
|
-
popoverHelper,
|
|
64
|
-
isAnimating,
|
|
65
|
-
setIsAnimating
|
|
66
|
-
}), [arrowElement, popoverHelper, popperElement, isAnimating, props]);
|
|
67
|
-
};
|
|
68
|
-
module.exports = __toCommonJS(useConfigDSPopperjs_exports);
|
|
69
|
-
//# sourceMappingURL=useConfigDSPopperjs.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/config/useConfigDSPopperjs.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useMemo, useState, useEffect } from 'react';\nimport { usePopper } from 'react-popper';\nimport { useConfiguredMergedProps } from './useConfiguredMergedProps';\nimport type { useDSPopperjsPropsArgT, useDSPopperjsRT } from '../index.d';\n\nimport { useOnClickOutside } from '../utils/hooks/useOnClickOutside';\n\nexport const useConfigDSPopperjs = (appProps: useDSPopperjsPropsArgT): useDSPopperjsRT => {\n const [popperElement, setPopperElement] = useState(null);\n const [arrowElement, setArrowElement] = useState(null);\n const [isAnimating, setIsAnimating] = useState<boolean>(false);\n\n const props = useConfiguredMergedProps({ props: appProps, arrowElement });\n const { referenceElement, closeContextMenu, onClickOutside, modifiers, startPlacementPreference } = props;\n const popperExtraOpts = useMemo(\n () => ({ placement: startPlacementPreference, modifiers }),\n [modifiers, startPlacementPreference],\n );\n\n const popoverHelper = usePopper(referenceElement, popperElement, popperExtraOpts);\n\n const { showPopover, withoutAnimation } = props;\n\n useEffect(() => {\n if (showPopover && !withoutAnimation) {\n setIsAnimating(true);\n }\n }, [showPopover, withoutAnimation]);\n\n useOnClickOutside(popperElement, (e) => {\n if (!referenceElement?.contains?.(e?.target)) {\n onClickOutside(e);\n closeContextMenu();\n }\n });\n\n return useMemo(\n () => ({\n props,\n popperElement,\n setPopperElement,\n arrowElement,\n setArrowElement,\n popoverHelper,\n isAnimating,\n setIsAnimating,\n }),\n [arrowElement, popoverHelper, popperElement, isAnimating, props],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA6C;AAC7C,0BAA0B;AAC1B,sCAAyC;AAGzC,+BAAkC;AAE3B,MAAM,sBAAsB,CAAC,aAAsD;AACxF,QAAM,CAAC,eAAe,oBAAoB,2BAAS;AACnD,QAAM,CAAC,cAAc,mBAAmB,2BAAS;AACjD,QAAM,CAAC,aAAa,kBAAkB,2BAAkB;AAExD,QAAM,QAAQ,8DAAyB,EAAE,OAAO,UAAU;AAC1D,QAAM,EAAE,kBAAkB,kBAAkB,gBAAgB,WAAW,6BAA6B;AACpG,QAAM,kBAAkB,0BACtB,MAAO,GAAE,WAAW,0BAA0B,cAC9C,CAAC,WAAW;AAGd,QAAM,gBAAgB,mCAAU,kBAAkB,eAAe;AAEjE,QAAM,EAAE,aAAa,qBAAqB;AAE1C,8BAAU,MAAM;AACd,QAAI,eAAe,CAAC,kBAAkB;AACpC,qBAAe;AAAA;AAAA,KAEhB,CAAC,aAAa;AAEjB,kDAAkB,eAAe,CAAC,MAAM;AACtC,QAAI,CAAC,kBAAkB,WAAW,GAAG,SAAS;AAC5C,qBAAe;AACf;AAAA;AAAA;AAIJ,SAAO,0BACL,MAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MAEF,CAAC,cAAc,eAAe,eAAe,aAAa;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
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 __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 useConfiguredDefaultModifiers_exports = {};
|
|
29
|
-
__export(useConfiguredDefaultModifiers_exports, {
|
|
30
|
-
useConfiguredDefaultModifiers: () => useConfiguredDefaultModifiers
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_react = require("react");
|
|
34
|
-
const useConfiguredDefaultModifiers = ({ props, arrowElement }) => {
|
|
35
|
-
const {
|
|
36
|
-
boundaryElement: explicitAppBoundaryElement,
|
|
37
|
-
withoutArrow: explicitAppWithoutArrow = false,
|
|
38
|
-
placementOrderPreference: explicitPlacementOrderPreference = ["top", "bottom", "left", "right"],
|
|
39
|
-
customOffset: explictAppOffset = void 0
|
|
40
|
-
} = props;
|
|
41
|
-
const defaultModifiers = (0, import_react.useMemo)(() => {
|
|
42
|
-
const mod = [];
|
|
43
|
-
mod.push({ name: "hide", enabled: true });
|
|
44
|
-
mod.push({
|
|
45
|
-
name: "flip",
|
|
46
|
-
options: {
|
|
47
|
-
fallbackPlacements: explicitPlacementOrderPreference
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
if (!explicitAppWithoutArrow || explictAppOffset) {
|
|
51
|
-
const defaultOffset = explictAppOffset || [0, 14];
|
|
52
|
-
mod.push({
|
|
53
|
-
name: "offset",
|
|
54
|
-
enabled: true,
|
|
55
|
-
options: {
|
|
56
|
-
offset: defaultOffset
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
if (!explicitAppWithoutArrow)
|
|
61
|
-
mod.push({
|
|
62
|
-
name: "arrow",
|
|
63
|
-
options: {
|
|
64
|
-
element: arrowElement,
|
|
65
|
-
padding: 18
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
if (explicitAppBoundaryElement)
|
|
69
|
-
mod.push({
|
|
70
|
-
name: "preventOverflow",
|
|
71
|
-
options: {
|
|
72
|
-
boundary: explicitAppBoundaryElement
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
return mod;
|
|
76
|
-
}, [
|
|
77
|
-
arrowElement,
|
|
78
|
-
explicitAppBoundaryElement,
|
|
79
|
-
explicitAppWithoutArrow,
|
|
80
|
-
explicitPlacementOrderPreference,
|
|
81
|
-
explictAppOffset
|
|
82
|
-
]);
|
|
83
|
-
const { modifiers: explicitAppModifiers = defaultModifiers } = props;
|
|
84
|
-
return (0, import_react.useMemo)(() => ({
|
|
85
|
-
modifiers: explicitAppModifiers
|
|
86
|
-
}), [explicitAppModifiers]);
|
|
87
|
-
};
|
|
88
|
-
module.exports = __toCommonJS(useConfiguredDefaultModifiers_exports);
|
|
89
|
-
//# sourceMappingURL=useConfiguredDefaultModifiers.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/config/useConfiguredDefaultModifiers.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useMemo } from 'react';\n\nexport const useConfiguredDefaultModifiers = ({ props, arrowElement }) => {\n // we destructure explicit app definitions before merge\n const {\n boundaryElement: explicitAppBoundaryElement,\n withoutArrow: explicitAppWithoutArrow = false,\n placementOrderPreference: explicitPlacementOrderPreference = ['top', 'bottom', 'left', 'right'],\n customOffset: explictAppOffset = undefined,\n } = props;\n // to build default modifiers on top of it\n const defaultModifiers = useMemo(() => {\n const mod = [];\n mod.push({ name: 'hide', enabled: true });\n mod.push({\n name: 'flip',\n options: {\n fallbackPlacements: explicitPlacementOrderPreference,\n },\n });\n // we apply an offset if the app defines one or if the app wants the arrow\n if (!explicitAppWithoutArrow || explictAppOffset) {\n const defaultOffset = explictAppOffset || [0, 14];\n mod.push({\n name: 'offset',\n enabled: true,\n options: {\n offset: defaultOffset,\n },\n });\n }\n // the app can opt for a \"no arrow\" implementation (we do so in datatable/calendar etc...)\n if (!explicitAppWithoutArrow)\n mod.push({\n name: 'arrow',\n options: {\n element: arrowElement,\n padding: 18,\n },\n });\n\n // the app can define an explicit element to act as a boundary instead of popperjs default one\n if (explicitAppBoundaryElement)\n mod.push({\n name: 'preventOverflow',\n options: {\n boundary: explicitAppBoundaryElement,\n },\n });\n return mod;\n }, [\n arrowElement,\n explicitAppBoundaryElement,\n explicitAppWithoutArrow,\n explicitPlacementOrderPreference,\n explictAppOffset,\n ]);\n // if the app pass custom modifier, we don't use \"default modifiers\"\n const { modifiers: explicitAppModifiers = defaultModifiers } = props;\n\n return useMemo(\n () => ({\n modifiers: explicitAppModifiers,\n }),\n [explicitAppModifiers],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwB;AAEjB,MAAM,gCAAgC,CAAC,EAAE,OAAO,mBAAmB;AAExE,QAAM;AAAA,IACJ,iBAAiB;AAAA,IACjB,cAAc,0BAA0B;AAAA,IACxC,0BAA0B,mCAAmC,CAAC,OAAO,UAAU,QAAQ;AAAA,IACvF,cAAc,mBAAmB;AAAA,MAC/B;AAEJ,QAAM,mBAAmB,0BAAQ,MAAM;AACrC,UAAM,MAAM;AACZ,QAAI,KAAK,EAAE,MAAM,QAAQ,SAAS;AAClC,QAAI,KAAK;AAAA,MACP,MAAM;AAAA,MACN,SAAS;AAAA,QACP,oBAAoB;AAAA;AAAA;AAIxB,QAAI,CAAC,2BAA2B,kBAAkB;AAChD,YAAM,gBAAgB,oBAAoB,CAAC,GAAG;AAC9C,UAAI,KAAK;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,QACT,SAAS;AAAA,UACP,QAAQ;AAAA;AAAA;AAAA;AAKd,QAAI,CAAC;AACH,UAAI,KAAK;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,UACP,SAAS;AAAA,UACT,SAAS;AAAA;AAAA;AAKf,QAAI;AACF,UAAI,KAAK;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,UACP,UAAU;AAAA;AAAA;AAGhB,WAAO;AAAA,KACN;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGF,QAAM,EAAE,WAAW,uBAAuB,qBAAqB;AAE/D,SAAO,0BACL,MAAO;AAAA,IACL,WAAW;AAAA,MAEb,CAAC;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
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 __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 useConfiguredDefaultProps_exports = {};
|
|
29
|
-
__export(useConfiguredDefaultProps_exports, {
|
|
30
|
-
useConfiguredDefaultProps: () => useConfiguredDefaultProps
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_react = require("react");
|
|
34
|
-
var import_useConfiguredDefaultModifiers = require("./useConfiguredDefaultModifiers");
|
|
35
|
-
const noop = () => {
|
|
36
|
-
};
|
|
37
|
-
const emptyObj = {};
|
|
38
|
-
const useConfiguredDefaultProps = ({ props, arrowElement }) => {
|
|
39
|
-
const staticDefaultProps = (0, import_react.useMemo)(() => ({
|
|
40
|
-
referenceElement: null,
|
|
41
|
-
showPopover: false,
|
|
42
|
-
closeContextMenu: noop,
|
|
43
|
-
onClickOutside: noop,
|
|
44
|
-
withoutPortal: false,
|
|
45
|
-
withoutArrow: false,
|
|
46
|
-
withoutAnimation: false,
|
|
47
|
-
animationDuration: 100,
|
|
48
|
-
portalDOMContainer: document.body,
|
|
49
|
-
startPlacementPreference: "top",
|
|
50
|
-
placementOrderPreference: ["top", "bottom", "left", "right"],
|
|
51
|
-
zIndex: 1,
|
|
52
|
-
extraPopperStyles: emptyObj
|
|
53
|
-
}), []);
|
|
54
|
-
const { modifiers: configuredModifiers } = (0, import_useConfiguredDefaultModifiers.useConfiguredDefaultModifiers)({
|
|
55
|
-
props,
|
|
56
|
-
arrowElement
|
|
57
|
-
});
|
|
58
|
-
const defaultProps = (0, import_react.useMemo)(() => ({ ...staticDefaultProps, modifiers: configuredModifiers }), [configuredModifiers, staticDefaultProps]);
|
|
59
|
-
return defaultProps;
|
|
60
|
-
};
|
|
61
|
-
module.exports = __toCommonJS(useConfiguredDefaultProps_exports);
|
|
62
|
-
//# sourceMappingURL=useConfiguredDefaultProps.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/config/useConfiguredDefaultProps.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useMemo } from 'react';\nimport { useConfiguredDefaultModifiers } from './useConfiguredDefaultModifiers';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = () => {};\n\nconst emptyObj = {};\n\nexport const useConfiguredDefaultProps = ({ props, arrowElement }) => {\n // don't move this out of the hook or `document.body` will explode\n const staticDefaultProps = useMemo(\n () => ({\n referenceElement: null,\n showPopover: false,\n closeContextMenu: noop,\n onClickOutside: noop,\n withoutPortal: false,\n withoutArrow: false,\n withoutAnimation: false,\n animationDuration: 100,\n portalDOMContainer: document.body,\n startPlacementPreference: 'top',\n placementOrderPreference: ['top', 'bottom', 'left', 'right'],\n zIndex: 1,\n extraPopperStyles: emptyObj,\n }),\n [],\n );\n const { modifiers: configuredModifiers } = useConfiguredDefaultModifiers({\n props,\n arrowElement,\n });\n\n const defaultProps = useMemo(\n () => ({ ...staticDefaultProps, modifiers: configuredModifiers }),\n [configuredModifiers, staticDefaultProps],\n );\n\n return defaultProps;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwB;AACxB,2CAA8C;AAG9C,MAAM,OAAO,MAAM;AAAA;AAEnB,MAAM,WAAW;AAEV,MAAM,4BAA4B,CAAC,EAAE,OAAO,mBAAmB;AAEpE,QAAM,qBAAqB,0BACzB,MAAO;AAAA,IACL,kBAAkB;AAAA,IAClB,aAAa;AAAA,IACb,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,cAAc;AAAA,IACd,kBAAkB;AAAA,IAClB,mBAAmB;AAAA,IACnB,oBAAoB,SAAS;AAAA,IAC7B,0BAA0B;AAAA,IAC1B,0BAA0B,CAAC,OAAO,UAAU,QAAQ;AAAA,IACpD,QAAQ;AAAA,IACR,mBAAmB;AAAA,MAErB;AAEF,QAAM,EAAE,WAAW,wBAAwB,wEAA8B;AAAA,IACvE;AAAA,IACA;AAAA;AAGF,QAAM,eAAe,0BACnB,MAAO,MAAK,oBAAoB,WAAW,wBAC3C,CAAC,qBAAqB;AAGxB,SAAO;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|