@elliemae/ds-popper 3.0.0-alpha.0 → 3.0.0-alpha.1
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/dist/cjs/PopperContent.js +24 -14
- package/dist/cjs/PopperContent.js.map +1 -1
- package/dist/cjs/PopperImpl.js +27 -18
- package/dist/cjs/PopperImpl.js.map +1 -1
- package/dist/cjs/getArrowStylesBySize.js +34 -21
- package/dist/cjs/getArrowStylesBySize.js.map +1 -1
- package/dist/esm/PopperContent.js +26 -14
- package/dist/esm/PopperContent.js.map +1 -1
- package/dist/esm/PopperImpl.js +29 -18
- package/dist/esm/PopperImpl.js.map +1 -1
- package/dist/esm/getArrowStylesBySize.js +36 -21
- package/dist/esm/getArrowStylesBySize.js.map +1 -1
- package/package.json +4 -3
- package/dist/types/DSPopper.d.ts +0 -156
- package/dist/types/PopperContent.d.ts +0 -21
- package/dist/types/PopperImpl.d.ts +0 -52
- package/dist/types/getArrowStylesBySize.d.ts +0 -2
- package/dist/types/index.d.ts +0 -3
- package/dist/types/interaction.d.ts +0 -5
- package/dist/types/positions.d.ts +0 -18
- package/dist/types/props.d.ts +0 -119
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
7
24
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
25
|
var __export = (target, all) => {
|
|
9
26
|
for (var name in all)
|
|
@@ -59,10 +76,7 @@ class PopperContent extends import_react.PureComponent {
|
|
|
59
76
|
ref,
|
|
60
77
|
className: `${blockName || "popper"}__arrow`,
|
|
61
78
|
"data-placement": placement,
|
|
62
|
-
style: {
|
|
63
|
-
...style,
|
|
64
|
-
...(0, import_getArrowStylesBySize.getArrowStylesBySize)(placement, 25)
|
|
65
|
-
}
|
|
79
|
+
style: __spreadValues(__spreadValues({}, style), (0, import_getArrowStylesBySize.getArrowStylesBySize)(placement, 25))
|
|
66
80
|
}, /* @__PURE__ */ import_react.default.createElement("svg", {
|
|
67
81
|
viewBox: "0 0 30 30"
|
|
68
82
|
}, /* @__PURE__ */ import_react.default.createElement("path", {
|
|
@@ -93,27 +107,23 @@ class PopperContent extends import_react.PureComponent {
|
|
|
93
107
|
zIndex,
|
|
94
108
|
hideIfNotVisible
|
|
95
109
|
} = this.props;
|
|
96
|
-
const computedStyle = {
|
|
97
|
-
...style,
|
|
98
|
-
...contentStyle,
|
|
110
|
+
const computedStyle = __spreadProps(__spreadValues(__spreadValues({}, style), contentStyle), {
|
|
99
111
|
zIndex
|
|
100
|
-
};
|
|
101
|
-
return /* @__PURE__ */ import_react.default.createElement("div", {
|
|
102
|
-
...containerProps,
|
|
112
|
+
});
|
|
113
|
+
return /* @__PURE__ */ import_react.default.createElement("div", __spreadProps(__spreadValues({}, containerProps), {
|
|
103
114
|
"data-placement": placement,
|
|
104
115
|
onMouseEnter,
|
|
105
116
|
onMouseLeave,
|
|
106
117
|
style: computedStyle,
|
|
107
118
|
"data-testid": "popper-container"
|
|
108
|
-
}, /* @__PURE__ */ import_react.default.createElement(Content, {
|
|
119
|
+
}), /* @__PURE__ */ import_react.default.createElement(Content, {
|
|
109
120
|
native: true,
|
|
110
121
|
onRest: this.handleRestAnimation,
|
|
111
122
|
state: isOpen && (!outOfBoundaries || !hideIfNotVisible) ? "open" : "close",
|
|
112
123
|
states: {
|
|
113
|
-
open: {
|
|
114
|
-
...openAnimationConfig,
|
|
124
|
+
open: __spreadProps(__spreadValues({}, openAnimationConfig), {
|
|
115
125
|
from: closeAnimationConfig.to
|
|
116
|
-
},
|
|
126
|
+
}),
|
|
117
127
|
close: closeAnimationConfig
|
|
118
128
|
}
|
|
119
129
|
}, (animationStyle) => /* @__PURE__ */ import_react.default.createElement(import_renderprops.animated.div, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/PopperContent.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable react/prop-types */\nimport React, { PureComponent } from 'react';\nimport { Popper } from 'react-popper';\nimport { Keyframes, animated } from 'react-spring/renderprops';\nimport getComponentFromProps from '@elliemae/ds-utilities/getComponentFromProps';\nimport DSOverlay from '@elliemae/ds-overlay';\nimport { getArrowStylesBySize } from './getArrowStylesBySize';\n\nconst Content = Keyframes.Spring({});\n\nexport default class PopperContent extends PureComponent {\n // eslint-disable-next-line react/static-property-placement\n static defaultProps = { onContentDestroyed: () => null };\n\n constructor(props) {\n super(props);\n this.renderContent = this.renderContent.bind(this);\n this.renderArrow = this.renderArrow.bind(this);\n this.handleRestAnimation = this.handleRestAnimation.bind(this);\n }\n\n handleRestAnimation() {\n const { isOpen, onContentDestroyed } = this.props;\n if (!isOpen) {\n onContentDestroyed();\n }\n }\n\n renderArrow({ ref, style }, placement) {\n const { blockName, showArrow } = this.props;\n if (!showArrow) return null;\n return (\n <div\n key=\"popper-arrow\"\n ref={ref}\n className={`${blockName || 'popper'}__arrow`}\n data-placement={placement}\n style={{\n ...style,\n ...getArrowStylesBySize(placement, 25),\n }}\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 </div>\n );\n }\n\n renderContent({\n ref,\n style,\n placement,\n arrowProps,\n scheduleUpdate,\n outOfBoundaries,\n }) {\n const {\n contentComponent,\n contentStyle,\n isOpen,\n closeAnimationConfig,\n openAnimationConfig,\n onMouseEnter,\n onMouseLeave,\n containerProps,\n zIndex,\n hideIfNotVisible,\n } = this.props;\n\n const computedStyle = {\n ...style,\n ...contentStyle,\n zIndex,\n };\n return (\n <div\n {...containerProps}\n data-placement={placement}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n style={computedStyle}\n data-testid=\"popper-container\"\n >\n <Content\n native\n onRest={this.handleRestAnimation}\n state={\n isOpen && (!outOfBoundaries || !hideIfNotVisible) ? 'open' : 'close'\n }\n states={{\n open: {\n ...openAnimationConfig,\n from: closeAnimationConfig.to,\n },\n close: closeAnimationConfig,\n }}\n >\n {(animationStyle) => (\n <animated.div ref={ref} style={animationStyle}>\n {getComponentFromProps(contentComponent, { scheduleUpdate }, [\n this.renderArrow(arrowProps, placement),\n ])}\n </animated.div>\n )}\n </Content>\n </div>\n );\n }\n\n render() {\n const {\n destroyed = false,\n onClickOutside = () => null,\n placement = 'bottom-start',\n modifiers = {},\n referenceNode,\n usePortal = true,\n } = this.props;\n return (\n <DSOverlay\n isOpen={!destroyed}\n onClickOutside={onClickOutside}\n usePortal={usePortal}\n >\n <Popper\n modifiers={modifiers}\n placement={placement}\n referenceElement={referenceNode}\n >\n {this.renderContent}\n </Popper>\n </DSOverlay>\n );\n }\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAqC;AACrC,0BAAuB;AACvB,yBAAoC;AACpC,mCAAkC;AAClC,wBAAsB;AACtB,kCAAqC;AAErC,MAAM,UAAU,6BAAU,OAAO;AAEjC,4BAA2C,2BAAc;AAAA,EAIvD,YAAY,OAAO;AACjB,UAAM;AACN,SAAK,gBAAgB,KAAK,cAAc,KAAK;AAC7C,SAAK,cAAc,KAAK,YAAY,KAAK;AACzC,SAAK,sBAAsB,KAAK,oBAAoB,KAAK;AAAA;AAAA,EAG3D,sBAAsB;AACpB,UAAM,EAAE,QAAQ,uBAAuB,KAAK;AAC5C,QAAI,CAAC,QAAQ;AACX;AAAA;AAAA;AAAA,EAIJ,YAAY,EAAE,KAAK,SAAS,WAAW;AACrC,UAAM,EAAE,WAAW,cAAc,KAAK;AACtC,QAAI,CAAC;AAAW,aAAO;AACvB,WACE,mDAAC,OAAD;AAAA,MACE,KAAI;AAAA,MACJ;AAAA,MACA,WAAW,GAAG,aAAa;AAAA,MAC3B,kBAAgB;AAAA,MAChB,OAAO,kCACF,QACA,sDAAqB,WAAW;AAAA,OAGrC,mDAAC,OAAD;AAAA,MAAK,SAAQ;AAAA,OACX,mDAAC,QAAD;AAAA,MACE,WAAU;AAAA,MACV,GAAE;AAAA,QAGJ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|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/PopperImpl.js
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
7
24
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
25
|
var __export = (target, all) => {
|
|
9
26
|
for (var name in all)
|
|
@@ -180,17 +197,14 @@ class PopperImpl extends import_react.Component {
|
|
|
180
197
|
const componentInnerRef = (0, import_ds_utilities.get)(triggerComponent, ["props", "innerRef"], () => null);
|
|
181
198
|
const compRef = (0, import_ds_utilities.isDOMTypeElement)(triggerComponent) ? { ref } : { innerRef: (0, import_ds_utilities.mergeRefs)(ref, componentInnerRef) };
|
|
182
199
|
const triggerHandler = this.getInteractionObject(interactionType, triggerComponent.props).handlers;
|
|
183
|
-
const targetProps = {
|
|
184
|
-
...triggerHandler,
|
|
185
|
-
...compRef,
|
|
200
|
+
const targetProps = __spreadProps(__spreadValues(__spreadValues({}, triggerHandler), compRef), {
|
|
186
201
|
"aria-haspopup": true,
|
|
187
202
|
"aria-expanded": isOpen
|
|
188
|
-
};
|
|
203
|
+
});
|
|
189
204
|
if (renderReference) {
|
|
190
|
-
return renderReference({
|
|
191
|
-
ref
|
|
192
|
-
|
|
193
|
-
});
|
|
205
|
+
return renderReference(__spreadValues({
|
|
206
|
+
ref
|
|
207
|
+
}, targetProps));
|
|
194
208
|
}
|
|
195
209
|
return (0, import_ds_utilities.getComponentFromProps)(triggerComponent, targetProps);
|
|
196
210
|
}
|
|
@@ -215,7 +229,7 @@ class PopperImpl extends import_react.Component {
|
|
|
215
229
|
zIndex,
|
|
216
230
|
hideIfNotVisible
|
|
217
231
|
} = this.props;
|
|
218
|
-
const allModifiers = {
|
|
232
|
+
const allModifiers = __spreadValues({
|
|
219
233
|
offset: {
|
|
220
234
|
enabled: showArrow,
|
|
221
235
|
offset: `0, ${arrowSize + arrowGap}`
|
|
@@ -229,9 +243,8 @@ class PopperImpl extends import_react.Component {
|
|
|
229
243
|
enabled: true,
|
|
230
244
|
fn: this.updatePopoverState,
|
|
231
245
|
order: 900
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
};
|
|
246
|
+
}
|
|
247
|
+
}, modifiers);
|
|
235
248
|
const triggerHandler = this.getInteractionObject(interactionType).handlers;
|
|
236
249
|
const popperContentProps = {
|
|
237
250
|
hideIfNotVisible,
|
|
@@ -258,14 +271,10 @@ class PopperImpl extends import_react.Component {
|
|
|
258
271
|
return /* @__PURE__ */ import_react.default.createElement(import_react_popper.Manager, null, customPopper({
|
|
259
272
|
Reference: import_react_popper.Reference,
|
|
260
273
|
triggerHandler,
|
|
261
|
-
content: /* @__PURE__ */ import_react.default.createElement(import_PopperContent.default, {
|
|
262
|
-
...popperContentProps
|
|
263
|
-
})
|
|
274
|
+
content: /* @__PURE__ */ import_react.default.createElement(import_PopperContent.default, __spreadValues({}, popperContentProps))
|
|
264
275
|
}));
|
|
265
276
|
}
|
|
266
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react_popper.Manager, null, /* @__PURE__ */ import_react.default.createElement(import_react_popper.Reference, null, this.renderTarget), /* @__PURE__ */ import_react.default.createElement(import_PopperContent.default, {
|
|
267
|
-
...popperContentProps
|
|
268
|
-
}));
|
|
277
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react_popper.Manager, null, /* @__PURE__ */ import_react.default.createElement(import_react_popper.Reference, null, this.renderTarget), /* @__PURE__ */ import_react.default.createElement(import_PopperContent.default, __spreadValues({}, popperContentProps)));
|
|
269
278
|
}
|
|
270
279
|
}
|
|
271
280
|
module.exports = __toCommonJS(PopperImpl_exports);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/PopperImpl.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable max-lines */\nimport React, { Component } from 'react';\nimport { isFunction, get, isDOMTypeElement, getComponentFromProps, mergeRefs } from '@elliemae/ds-utilities';\nimport { Manager, Reference } from 'react-popper';\nimport memoizeOne from 'memoize-one';\nimport PopperContent from './PopperContent';\nimport { Interaction } from './interaction';\n\nexport default class PopperImpl extends Component<any, any> {\n // we use safeIsMounted because isMounted is not allowed by React.\n safeIsMounted = false;\n\n handlePopperPlacementChange = memoizeOne((placement) => {\n const { onPlacementChange } = this.props;\n onPlacementChange(placement);\n });\n\n constructor(props) {\n super(props);\n this.state = {\n isOpen: false,\n destroyed: true,\n };\n // TODO: Fix the autobinding to remove this!!\n this.handleMouseEnter = this.handleMouseEnter.bind(this);\n this.handleMouseLeave = this.handleMouseLeave.bind(this);\n this.handleTriggerClick = this.handleTriggerClick.bind(this);\n this.renderTarget = this.renderTarget.bind(this);\n this.updatePopoverState = this.updatePopoverState.bind(this);\n this.handlePopperPlacementChange = this.handlePopperPlacementChange.bind(\n this,\n );\n this.handleDestroyContent = this.handleDestroyContent.bind(this);\n this.handleContentMouseEnter = this.handleContentMouseEnter.bind(this);\n this.handleContentMouseLeave = this.handleContentMouseLeave.bind(this);\n }\n\n // this is needed to prevent setState on unmounted components\n componentDidMount() {\n this.safeIsMounted = true;\n }\n\n componentDidUpdate() {\n const { isOpen, destroyed } = this.state;\n if (isOpen === true && destroyed === true) {\n // eslint-disable-next-line react/no-did-update-set-state\n this.setState({ destroyed: false });\n }\n }\n\n componentWillUnmount() {\n this.safeIsMounted = false;\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const { isOpen } = nextProps;\n const { prevPropIsOpen } = prevState;\n // todo: this causes multiple rerenders\n if (isOpen !== prevPropIsOpen) {\n return {\n isOpen,\n prevPropIsOpen: isOpen,\n };\n }\n return null;\n }\n\n getInteractionObject(interaction, referenceProps = {}) {\n const { isOpen } = this.props;\n if (isOpen !== undefined) return {};\n return (\n {\n [Interaction.CLICK]: {\n handlers: {\n onClick: this.handleTriggerClick,\n },\n canClose: () => true,\n },\n [Interaction.HOVER]: {\n handlers: {\n onMouseEnter: referenceProps.onMouseEnter || this.handleMouseEnter,\n onPointerEnter: referenceProps.onMouseEnter || this.handleMouseEnter,\n onMouseLeave: referenceProps.onMouseLeave || this.handleMouseLeave,\n onPointerLeave: referenceProps.onMouseLeave || this.handleMouseLeave,\n onClick: this.handleTriggerClick,\n },\n canClose: (isOnTrigger, isOnPopper) => !isOnTrigger && !isOnPopper,\n },\n }[interaction] || {\n handlers: {},\n canClose: () => true,\n }\n );\n }\n\n setOpen(opening) {\n const { onOpen } = this.props;\n const { prevPropIsOpen } = this.state;\n if (!this.safeIsMounted) return;\n\n if (prevPropIsOpen === undefined) {\n this.setState({\n isOpen: opening,\n destroyed: false,\n });\n }\n onOpen(opening);\n }\n\n open() {\n clearTimeout(this.closeTimer);\n const { delayOpen } = this.props;\n this.openTimer = setTimeout(() => this.setOpen(true), delayOpen);\n }\n\n close() {\n clearTimeout(this.openTimer);\n const { delayClose, onClose = () => null } = this.props;\n this.closeTimer = setTimeout(() => {\n this.setOpen(false);\n onClose();\n }, delayClose);\n }\n\n handleTriggerClick(e) {\n const { triggerComponent } = this.props;\n const { onClick } = get(triggerComponent, 'props') || {};\n\n this.open();\n\n if (isFunction(onClick)) onClick(e);\n }\n\n handleContentMouseEnter() {\n this.isMouseOverContent = true;\n }\n\n handleContentMouseLeave() {\n this.isMouseOverContent = false;\n const { onClose = () => null } = this.props;\n setTimeout(() => {\n if (!this.isMouseOverTarget) {\n this.setOpen(false);\n onClose();\n }\n }, 10);\n }\n\n handleMouseEnter() {\n this.isMouseOverTarget = true;\n this.open();\n }\n\n handleMouseLeave() {\n this.isMouseOverTarget = false;\n setTimeout(() => {\n if (!this.isMouseOverContent) {\n this.close();\n }\n }, 10);\n }\n\n updatePopoverState(popperData) {\n this.handlePopperPlacementChange(popperData.placement);\n return popperData;\n }\n\n handleDestroyContent() {\n this.setState({ destroyed: true });\n }\n\n renderTarget({ ref }) {\n const { isOpen } = this.state;\n const { triggerComponent, interactionType, renderReference } = this.props;\n\n const componentInnerRef = get(\n triggerComponent,\n ['props', 'innerRef'],\n () => null,\n );\n const compRef = isDOMTypeElement(triggerComponent)\n ? { ref }\n : { innerRef: mergeRefs(ref, componentInnerRef) };\n\n const triggerHandler = this.getInteractionObject(\n interactionType,\n triggerComponent.props,\n ).handlers;\n\n const targetProps = {\n ...triggerHandler,\n ...compRef,\n 'aria-haspopup': true,\n 'aria-expanded': isOpen,\n };\n\n if (renderReference) {\n return renderReference({\n ref,\n ...targetProps,\n });\n }\n\n return getComponentFromProps(triggerComponent, targetProps);\n }\n\n render() {\n const { isOpen, destroyed } = this.state;\n\n const {\n placement,\n interactionType,\n showArrow,\n arrowSize,\n arrowGap,\n preventOverflow,\n children: customPopper,\n usePortal,\n blockName,\n contentComponent,\n openAnimationConfig,\n closeAnimationConfig,\n modifiers,\n referenceNode,\n containerProps,\n zIndex,\n hideIfNotVisible,\n } = this.props;\n\n const allModifiers = {\n offset: {\n enabled: showArrow,\n offset: `0, ${arrowSize + arrowGap}`,\n },\n preventOverflow: {\n enabled: true,\n padding: 0,\n boundariesElement: preventOverflow,\n },\n updatePopoverState: {\n enabled: true,\n fn: this.updatePopoverState,\n order: 900,\n },\n ...modifiers,\n };\n const triggerHandler = this.getInteractionObject(interactionType).handlers;\n\n const popperContentProps = {\n hideIfNotVisible,\n containerProps,\n isOpen,\n destroyed: isOpen ? false : destroyed,\n arrowSize,\n blockName,\n showArrow,\n modifiers: allModifiers,\n contentComponent,\n onContentDestroyed: this.handleDestroyContent,\n onClickOutside: () => this.close(),\n placement,\n usePortal,\n openAnimationConfig,\n closeAnimationConfig,\n onMouseEnter:\n interactionType === Interaction.HOVER\n ? this.handleContentMouseEnter\n : undefined,\n onMouseLeave:\n interactionType === Interaction.HOVER\n ? this.handleContentMouseLeave\n : undefined,\n referenceNode,\n zIndex,\n };\n\n if (customPopper && typeof customPopper === 'function') {\n return (\n <Manager>\n {customPopper({\n Reference,\n triggerHandler,\n content: <PopperContent {...popperContentProps} />,\n })}\n </Manager>\n );\n }\n\n return (\n <Manager>\n <Reference>{this.renderTarget}</Reference>\n <PopperContent {...popperContentProps} />\n </Manager>\n );\n }\n}\n\nexport { Reference, PopperContent };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAiC;AACjC,0BAAoF;AACpF,0BAAmC;AACnC,yBAAuB;AACvB,2BAA0B;AAC1B,yBAA4B;AAE5B,yBAAwC,uBAAoB;AAAA,EAS1D,YAAY,OAA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AA;AAAA,MAErB,oBAAoB;AAAA,QAClB,SAAS;AAAA,QACT,IAAI,KAAK;AAAA,QACT,OAAO;AAAA;AAAA,OAEN;AAEL,UAAM,iBAAiB,KAAK,qBAAqB,iBAAiB;AAElE,UAAM,qBAAqB;AAAA,MACzB;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW,SAAS,QAAQ;AAAA,MAC5B;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MACA,oBAAoB,KAAK;AAAA,MACzB,gBAAgB,MAAM,KAAK;AAAA,MAC3B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,cACE,oBAAoB,+BAAY,QAC5B,KAAK,0BACL;AAAA,MACN,cACE,oBAAoB,+BAAY,QAC5B,KAAK,0BACL;AAAA,MACN;AAAA,MACA;AAAA;AAGF,QAAI,gBAAgB,OAAO,iBAAiB,YAAY;AACtD,aACE,mDAAC,6BAAD,MACG,aAAa;AAAA,QACZ;AAAA,QACA;AAAA,QACA,SAAS,mDAAC,8BAAD,mBAAmB;AAAA;AAAA;AAMpC,WACE,mDAAC,6BAAD,MACE,mDAAC,+BAAD,MAAY,KAAK,eACjB,mDAAC,8BAAD,mBAAmB;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,8 +2,22 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
7
21
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
22
|
var __export = (target, all) => {
|
|
9
23
|
for (var name in all)
|
|
@@ -33,27 +47,26 @@ __export(getArrowStylesBySize_exports, {
|
|
|
33
47
|
var React = __toESM(require("react"));
|
|
34
48
|
const getArrowStylesBySize = (position, size = 30) => {
|
|
35
49
|
const basePosition = position && position.split("-")[0];
|
|
36
|
-
return {
|
|
37
|
-
borderWidth: size
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
};
|
|
50
|
+
return __spreadValues({
|
|
51
|
+
borderWidth: size
|
|
52
|
+
}, {
|
|
53
|
+
top: {
|
|
54
|
+
top: "100% !important",
|
|
55
|
+
transform: `rotateZ(${180}deg)`
|
|
56
|
+
},
|
|
57
|
+
right: {
|
|
58
|
+
right: "100%",
|
|
59
|
+
transform: `rotateZ(${-90}deg)`
|
|
60
|
+
},
|
|
61
|
+
bottom: {
|
|
62
|
+
bottom: "100%",
|
|
63
|
+
transform: `rotateZ(${0}deg)`
|
|
64
|
+
},
|
|
65
|
+
left: {
|
|
66
|
+
left: "100%",
|
|
67
|
+
transform: `rotateZ(${90}deg)`
|
|
68
|
+
}
|
|
69
|
+
}[basePosition]);
|
|
57
70
|
};
|
|
58
71
|
var getArrowStylesBySize_default = getArrowStylesBySize;
|
|
59
72
|
module.exports = __toCommonJS(getArrowStylesBySize_exports);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/getArrowStylesBySize.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export const getArrowStylesBySize = (position, size = 30) => {\n const basePosition = position && position.split('-')[0];\n return {\n borderWidth: size,\n ...{\n top: {\n top: '100% !important',\n transform: `rotateZ(${180}deg)`,\n },\n right: {\n right: '100%',\n transform: `rotateZ(${-90}deg)`,\n },\n bottom: {\n bottom: '100%',\n transform: `rotateZ(${0}deg)`,\n },\n left: {\n left: '100%',\n transform: `rotateZ(${90}deg)`,\n },\n }[basePosition],\n };\n};\n\nexport default getArrowStylesBySize;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,uBAAuB,CAAC,UAAU,OAAO,OAAO;AAC3D,QAAM,eAAe,YAAY,SAAS,MAAM,KAAK;AACrD,SAAO;AAAA,IACL,aAAa;AAAA,KACV;AAAA,IACD,KAAK;AAAA,MACH,KAAK;AAAA,MACL,WAAW,WAAW;AAAA;AAAA,IAExB,OAAO;AAAA,MACL,OAAO;AAAA,MACP,WAAW,WAAW;AAAA;AAAA,IAExB,QAAQ;AAAA,MACN,QAAQ;AAAA,MACR,WAAW,WAAW;AAAA;AAAA,IAExB,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,WAAW,WAAW;AAAA;AAAA,IAExB;AAAA;AAIN,IAAO,+BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
1
20
|
import * as React from "react";
|
|
2
21
|
import React2, { PureComponent } from "react";
|
|
3
22
|
import { Popper } from "react-popper";
|
|
@@ -28,10 +47,7 @@ class PopperContent extends PureComponent {
|
|
|
28
47
|
ref,
|
|
29
48
|
className: `${blockName || "popper"}__arrow`,
|
|
30
49
|
"data-placement": placement,
|
|
31
|
-
style: {
|
|
32
|
-
...style,
|
|
33
|
-
...getArrowStylesBySize(placement, 25)
|
|
34
|
-
}
|
|
50
|
+
style: __spreadValues(__spreadValues({}, style), getArrowStylesBySize(placement, 25))
|
|
35
51
|
}, /* @__PURE__ */ React2.createElement("svg", {
|
|
36
52
|
viewBox: "0 0 30 30"
|
|
37
53
|
}, /* @__PURE__ */ React2.createElement("path", {
|
|
@@ -62,27 +78,23 @@ class PopperContent extends PureComponent {
|
|
|
62
78
|
zIndex,
|
|
63
79
|
hideIfNotVisible
|
|
64
80
|
} = this.props;
|
|
65
|
-
const computedStyle = {
|
|
66
|
-
...style,
|
|
67
|
-
...contentStyle,
|
|
81
|
+
const computedStyle = __spreadProps(__spreadValues(__spreadValues({}, style), contentStyle), {
|
|
68
82
|
zIndex
|
|
69
|
-
};
|
|
70
|
-
return /* @__PURE__ */ React2.createElement("div", {
|
|
71
|
-
...containerProps,
|
|
83
|
+
});
|
|
84
|
+
return /* @__PURE__ */ React2.createElement("div", __spreadProps(__spreadValues({}, containerProps), {
|
|
72
85
|
"data-placement": placement,
|
|
73
86
|
onMouseEnter,
|
|
74
87
|
onMouseLeave,
|
|
75
88
|
style: computedStyle,
|
|
76
89
|
"data-testid": "popper-container"
|
|
77
|
-
}, /* @__PURE__ */ React2.createElement(Content, {
|
|
90
|
+
}), /* @__PURE__ */ React2.createElement(Content, {
|
|
78
91
|
native: true,
|
|
79
92
|
onRest: this.handleRestAnimation,
|
|
80
93
|
state: isOpen && (!outOfBoundaries || !hideIfNotVisible) ? "open" : "close",
|
|
81
94
|
states: {
|
|
82
|
-
open: {
|
|
83
|
-
...openAnimationConfig,
|
|
95
|
+
open: __spreadProps(__spreadValues({}, openAnimationConfig), {
|
|
84
96
|
from: closeAnimationConfig.to
|
|
85
|
-
},
|
|
97
|
+
}),
|
|
86
98
|
close: closeAnimationConfig
|
|
87
99
|
}
|
|
88
100
|
}, (animationStyle) => /* @__PURE__ */ React2.createElement(animated.div, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/PopperContent.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { PureComponent } from 'react';\nimport { Popper } from 'react-popper';\nimport { Keyframes, animated } from 'react-spring/renderprops';\nimport getComponentFromProps from '@elliemae/ds-utilities/getComponentFromProps';\nimport DSOverlay from '@elliemae/ds-overlay';\nimport { getArrowStylesBySize } from './getArrowStylesBySize';\n\nconst Content = Keyframes.Spring({});\n\nexport default class PopperContent extends PureComponent {\n // eslint-disable-next-line react/static-property-placement\n static defaultProps = { onContentDestroyed: () => null };\n\n constructor(props) {\n super(props);\n this.renderContent = this.renderContent.bind(this);\n this.renderArrow = this.renderArrow.bind(this);\n this.handleRestAnimation = this.handleRestAnimation.bind(this);\n }\n\n handleRestAnimation() {\n const { isOpen, onContentDestroyed } = this.props;\n if (!isOpen) {\n onContentDestroyed();\n }\n }\n\n renderArrow({ ref, style }, placement) {\n const { blockName, showArrow } = this.props;\n if (!showArrow) return null;\n return (\n <div\n key=\"popper-arrow\"\n ref={ref}\n className={`${blockName || 'popper'}__arrow`}\n data-placement={placement}\n style={{\n ...style,\n ...getArrowStylesBySize(placement, 25),\n }}\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 </div>\n );\n }\n\n renderContent({\n ref,\n style,\n placement,\n arrowProps,\n scheduleUpdate,\n outOfBoundaries,\n }) {\n const {\n contentComponent,\n contentStyle,\n isOpen,\n closeAnimationConfig,\n openAnimationConfig,\n onMouseEnter,\n onMouseLeave,\n containerProps,\n zIndex,\n hideIfNotVisible,\n } = this.props;\n\n const computedStyle = {\n ...style,\n ...contentStyle,\n zIndex,\n };\n return (\n <div\n {...containerProps}\n data-placement={placement}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n style={computedStyle}\n data-testid=\"popper-container\"\n >\n <Content\n native\n onRest={this.handleRestAnimation}\n state={\n isOpen && (!outOfBoundaries || !hideIfNotVisible) ? 'open' : 'close'\n }\n states={{\n open: {\n ...openAnimationConfig,\n from: closeAnimationConfig.to,\n },\n close: closeAnimationConfig,\n }}\n >\n {(animationStyle) => (\n <animated.div ref={ref} style={animationStyle}>\n {getComponentFromProps(contentComponent, { scheduleUpdate }, [\n this.renderArrow(arrowProps, placement),\n ])}\n </animated.div>\n )}\n </Content>\n </div>\n );\n }\n\n render() {\n const {\n destroyed = false,\n onClickOutside = () => null,\n placement = 'bottom-start',\n modifiers = {},\n referenceNode,\n usePortal = true,\n } = this.props;\n return (\n <DSOverlay\n isOpen={!destroyed}\n onClickOutside={onClickOutside}\n usePortal={usePortal}\n >\n <Popper\n modifiers={modifiers}\n placement={placement}\n referenceElement={referenceNode}\n >\n {this.renderContent}\n </Popper>\n </DSOverlay>\n );\n }\n}\n"],
|
|
5
|
-
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,UAAU,UAAU,OAAO;AAEjC,4BAA2C,cAAc;AAAA,EAIvD,YAAY,OAAO;AACjB,UAAM;AACN,SAAK,gBAAgB,KAAK,cAAc,KAAK;AAC7C,SAAK,cAAc,KAAK,YAAY,KAAK;AACzC,SAAK,sBAAsB,KAAK,oBAAoB,KAAK;AAAA;AAAA,EAG3D,sBAAsB;AACpB,UAAM,EAAE,QAAQ,uBAAuB,KAAK;AAC5C,QAAI,CAAC,QAAQ;AACX;AAAA;AAAA;AAAA,EAIJ,YAAY,EAAE,KAAK,SAAS,WAAW;AACrC,UAAM,EAAE,WAAW,cAAc,KAAK;AACtC,QAAI,CAAC;AAAW,aAAO;AACvB,WACE,qCAAC,OAAD;AAAA,MACE,KAAI;AAAA,MACJ;AAAA,MACA,WAAW,GAAG,aAAa;AAAA,MAC3B,kBAAgB;AAAA,MAChB,OAAO
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AAEA,M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,EAAC,mBAAmB,CAAC,oBAAoB,SAAS;AAAA,MAE/D,QAAQ;AAAA,QACN,MAAM,iCACD,sBADC;AAAA,UAEJ,MAAM,qBAAqB;AAAA;AAAA,QAE7B,OAAO;AAAA;AAAA,OAGR,CAAC,mBACA,qCAAC,SAAS,KAAV;AAAA,MAAc;AAAA,MAAU,OAAO;AAAA,OAC5B,sBAAsB,kBAAkB,EAAE,kBAAkB;AAAA,MAC3D,KAAK,YAAY,YAAY;AAAA;AAAA;AAAA,EAS3C,SAAS;AACP,UAAM;AAAA,MACJ,YAAY;AAAA,MACZ,iBAAiB,MAAM;AAAA,MACvB,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ;AAAA,MACA,YAAY;AAAA,QACV,KAAK;AACT,WACE,qCAAC,WAAD;AAAA,MACE,QAAQ,CAAC;AAAA,MACT;AAAA,MACA;AAAA,OAEA,qCAAC,QAAD;AAAA,MACE;AAAA,MACA;AAAA,MACA,kBAAkB;AAAA,OAEjB,KAAK;AAAA;AAAA;AA9HP,AAFT,cAES,eAAe,EAAE,oBAAoB,MAAM;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/PopperImpl.js
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
1
20
|
import * as React from "react";
|
|
2
21
|
import React2, { Component } from "react";
|
|
3
22
|
import { isFunction, get, isDOMTypeElement, getComponentFromProps, mergeRefs } from "@elliemae/ds-utilities";
|
|
@@ -147,17 +166,14 @@ class PopperImpl extends Component {
|
|
|
147
166
|
const componentInnerRef = get(triggerComponent, ["props", "innerRef"], () => null);
|
|
148
167
|
const compRef = isDOMTypeElement(triggerComponent) ? { ref } : { innerRef: mergeRefs(ref, componentInnerRef) };
|
|
149
168
|
const triggerHandler = this.getInteractionObject(interactionType, triggerComponent.props).handlers;
|
|
150
|
-
const targetProps = {
|
|
151
|
-
...triggerHandler,
|
|
152
|
-
...compRef,
|
|
169
|
+
const targetProps = __spreadProps(__spreadValues(__spreadValues({}, triggerHandler), compRef), {
|
|
153
170
|
"aria-haspopup": true,
|
|
154
171
|
"aria-expanded": isOpen
|
|
155
|
-
};
|
|
172
|
+
});
|
|
156
173
|
if (renderReference) {
|
|
157
|
-
return renderReference({
|
|
158
|
-
ref
|
|
159
|
-
|
|
160
|
-
});
|
|
174
|
+
return renderReference(__spreadValues({
|
|
175
|
+
ref
|
|
176
|
+
}, targetProps));
|
|
161
177
|
}
|
|
162
178
|
return getComponentFromProps(triggerComponent, targetProps);
|
|
163
179
|
}
|
|
@@ -182,7 +198,7 @@ class PopperImpl extends Component {
|
|
|
182
198
|
zIndex,
|
|
183
199
|
hideIfNotVisible
|
|
184
200
|
} = this.props;
|
|
185
|
-
const allModifiers = {
|
|
201
|
+
const allModifiers = __spreadValues({
|
|
186
202
|
offset: {
|
|
187
203
|
enabled: showArrow,
|
|
188
204
|
offset: `0, ${arrowSize + arrowGap}`
|
|
@@ -196,9 +212,8 @@ class PopperImpl extends Component {
|
|
|
196
212
|
enabled: true,
|
|
197
213
|
fn: this.updatePopoverState,
|
|
198
214
|
order: 900
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
};
|
|
215
|
+
}
|
|
216
|
+
}, modifiers);
|
|
202
217
|
const triggerHandler = this.getInteractionObject(interactionType).handlers;
|
|
203
218
|
const popperContentProps = {
|
|
204
219
|
hideIfNotVisible,
|
|
@@ -225,14 +240,10 @@ class PopperImpl extends Component {
|
|
|
225
240
|
return /* @__PURE__ */ React2.createElement(Manager, null, customPopper({
|
|
226
241
|
Reference,
|
|
227
242
|
triggerHandler,
|
|
228
|
-
content: /* @__PURE__ */ React2.createElement(PopperContent, {
|
|
229
|
-
...popperContentProps
|
|
230
|
-
})
|
|
243
|
+
content: /* @__PURE__ */ React2.createElement(PopperContent, __spreadValues({}, popperContentProps))
|
|
231
244
|
}));
|
|
232
245
|
}
|
|
233
|
-
return /* @__PURE__ */ React2.createElement(Manager, null, /* @__PURE__ */ React2.createElement(Reference, null, this.renderTarget), /* @__PURE__ */ React2.createElement(PopperContent, {
|
|
234
|
-
...popperContentProps
|
|
235
|
-
}));
|
|
246
|
+
return /* @__PURE__ */ React2.createElement(Manager, null, /* @__PURE__ */ React2.createElement(Reference, null, this.renderTarget), /* @__PURE__ */ React2.createElement(PopperContent, __spreadValues({}, popperContentProps)));
|
|
236
247
|
}
|
|
237
248
|
}
|
|
238
249
|
export {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/PopperImpl.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { Component } from 'react';\nimport { isFunction, get, isDOMTypeElement, getComponentFromProps, mergeRefs } from '@elliemae/ds-utilities';\nimport { Manager, Reference } from 'react-popper';\nimport memoizeOne from 'memoize-one';\nimport PopperContent from './PopperContent';\nimport { Interaction } from './interaction';\n\nexport default class PopperImpl extends Component<any, any> {\n // we use safeIsMounted because isMounted is not allowed by React.\n safeIsMounted = false;\n\n handlePopperPlacementChange = memoizeOne((placement) => {\n const { onPlacementChange } = this.props;\n onPlacementChange(placement);\n });\n\n constructor(props) {\n super(props);\n this.state = {\n isOpen: false,\n destroyed: true,\n };\n // TODO: Fix the autobinding to remove this!!\n this.handleMouseEnter = this.handleMouseEnter.bind(this);\n this.handleMouseLeave = this.handleMouseLeave.bind(this);\n this.handleTriggerClick = this.handleTriggerClick.bind(this);\n this.renderTarget = this.renderTarget.bind(this);\n this.updatePopoverState = this.updatePopoverState.bind(this);\n this.handlePopperPlacementChange = this.handlePopperPlacementChange.bind(\n this,\n );\n this.handleDestroyContent = this.handleDestroyContent.bind(this);\n this.handleContentMouseEnter = this.handleContentMouseEnter.bind(this);\n this.handleContentMouseLeave = this.handleContentMouseLeave.bind(this);\n }\n\n // this is needed to prevent setState on unmounted components\n componentDidMount() {\n this.safeIsMounted = true;\n }\n\n componentDidUpdate() {\n const { isOpen, destroyed } = this.state;\n if (isOpen === true && destroyed === true) {\n // eslint-disable-next-line react/no-did-update-set-state\n this.setState({ destroyed: false });\n }\n }\n\n componentWillUnmount() {\n this.safeIsMounted = false;\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const { isOpen } = nextProps;\n const { prevPropIsOpen } = prevState;\n // todo: this causes multiple rerenders\n if (isOpen !== prevPropIsOpen) {\n return {\n isOpen,\n prevPropIsOpen: isOpen,\n };\n }\n return null;\n }\n\n getInteractionObject(interaction, referenceProps = {}) {\n const { isOpen } = this.props;\n if (isOpen !== undefined) return {};\n return (\n {\n [Interaction.CLICK]: {\n handlers: {\n onClick: this.handleTriggerClick,\n },\n canClose: () => true,\n },\n [Interaction.HOVER]: {\n handlers: {\n onMouseEnter: referenceProps.onMouseEnter || this.handleMouseEnter,\n onPointerEnter: referenceProps.onMouseEnter || this.handleMouseEnter,\n onMouseLeave: referenceProps.onMouseLeave || this.handleMouseLeave,\n onPointerLeave: referenceProps.onMouseLeave || this.handleMouseLeave,\n onClick: this.handleTriggerClick,\n },\n canClose: (isOnTrigger, isOnPopper) => !isOnTrigger && !isOnPopper,\n },\n }[interaction] || {\n handlers: {},\n canClose: () => true,\n }\n );\n }\n\n setOpen(opening) {\n const { onOpen } = this.props;\n const { prevPropIsOpen } = this.state;\n if (!this.safeIsMounted) return;\n\n if (prevPropIsOpen === undefined) {\n this.setState({\n isOpen: opening,\n destroyed: false,\n });\n }\n onOpen(opening);\n }\n\n open() {\n clearTimeout(this.closeTimer);\n const { delayOpen } = this.props;\n this.openTimer = setTimeout(() => this.setOpen(true), delayOpen);\n }\n\n close() {\n clearTimeout(this.openTimer);\n const { delayClose, onClose = () => null } = this.props;\n this.closeTimer = setTimeout(() => {\n this.setOpen(false);\n onClose();\n }, delayClose);\n }\n\n handleTriggerClick(e) {\n const { triggerComponent } = this.props;\n const { onClick } = get(triggerComponent, 'props') || {};\n\n this.open();\n\n if (isFunction(onClick)) onClick(e);\n }\n\n handleContentMouseEnter() {\n this.isMouseOverContent = true;\n }\n\n handleContentMouseLeave() {\n this.isMouseOverContent = false;\n const { onClose = () => null } = this.props;\n setTimeout(() => {\n if (!this.isMouseOverTarget) {\n this.setOpen(false);\n onClose();\n }\n }, 10);\n }\n\n handleMouseEnter() {\n this.isMouseOverTarget = true;\n this.open();\n }\n\n handleMouseLeave() {\n this.isMouseOverTarget = false;\n setTimeout(() => {\n if (!this.isMouseOverContent) {\n this.close();\n }\n }, 10);\n }\n\n updatePopoverState(popperData) {\n this.handlePopperPlacementChange(popperData.placement);\n return popperData;\n }\n\n handleDestroyContent() {\n this.setState({ destroyed: true });\n }\n\n renderTarget({ ref }) {\n const { isOpen } = this.state;\n const { triggerComponent, interactionType, renderReference } = this.props;\n\n const componentInnerRef = get(\n triggerComponent,\n ['props', 'innerRef'],\n () => null,\n );\n const compRef = isDOMTypeElement(triggerComponent)\n ? { ref }\n : { innerRef: mergeRefs(ref, componentInnerRef) };\n\n const triggerHandler = this.getInteractionObject(\n interactionType,\n triggerComponent.props,\n ).handlers;\n\n const targetProps = {\n ...triggerHandler,\n ...compRef,\n 'aria-haspopup': true,\n 'aria-expanded': isOpen,\n };\n\n if (renderReference) {\n return renderReference({\n ref,\n ...targetProps,\n });\n }\n\n return getComponentFromProps(triggerComponent, targetProps);\n }\n\n render() {\n const { isOpen, destroyed } = this.state;\n\n const {\n placement,\n interactionType,\n showArrow,\n arrowSize,\n arrowGap,\n preventOverflow,\n children: customPopper,\n usePortal,\n blockName,\n contentComponent,\n openAnimationConfig,\n closeAnimationConfig,\n modifiers,\n referenceNode,\n containerProps,\n zIndex,\n hideIfNotVisible,\n } = this.props;\n\n const allModifiers = {\n offset: {\n enabled: showArrow,\n offset: `0, ${arrowSize + arrowGap}`,\n },\n preventOverflow: {\n enabled: true,\n padding: 0,\n boundariesElement: preventOverflow,\n },\n updatePopoverState: {\n enabled: true,\n fn: this.updatePopoverState,\n order: 900,\n },\n ...modifiers,\n };\n const triggerHandler = this.getInteractionObject(interactionType).handlers;\n\n const popperContentProps = {\n hideIfNotVisible,\n containerProps,\n isOpen,\n destroyed: isOpen ? false : destroyed,\n arrowSize,\n blockName,\n showArrow,\n modifiers: allModifiers,\n contentComponent,\n onContentDestroyed: this.handleDestroyContent,\n onClickOutside: () => this.close(),\n placement,\n usePortal,\n openAnimationConfig,\n closeAnimationConfig,\n onMouseEnter:\n interactionType === Interaction.HOVER\n ? this.handleContentMouseEnter\n : undefined,\n onMouseLeave:\n interactionType === Interaction.HOVER\n ? this.handleContentMouseLeave\n : undefined,\n referenceNode,\n zIndex,\n };\n\n if (customPopper && typeof customPopper === 'function') {\n return (\n <Manager>\n {customPopper({\n Reference,\n triggerHandler,\n content: <PopperContent {...popperContentProps} />,\n })}\n </Manager>\n );\n }\n\n return (\n <Manager>\n <Reference>{this.renderTarget}</Reference>\n <PopperContent {...pop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AC3B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,cACE,oBAAoB,YAAY,QAC5B,KAAK,0BACL;AAAA,MACN,cACE,oBAAoB,YAAY,QAC5B,KAAK,0BACL;AAAA,MACN;AAAA,MACA;AAAA;AAGF,QAAI,gBAAgB,OAAO,iBAAiB,YAAY;AACtD,aACE,qCAAC,SAAD,MACG,aAAa;AAAA,QACZ;AAAA,QACA;AAAA,QACA,SAAS,qCAAC,eAAD,mBAAmB;AAAA;AAAA;AAMpC,WACE,qCAAC,SAAD,MACE,qCAAC,WAAD,MAAY,KAAK,eACjB,qCAAC,eAAD,mBAAmB;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,27 +1,42 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
1
17
|
import * as React from "react";
|
|
2
18
|
const getArrowStylesBySize = (position, size = 30) => {
|
|
3
19
|
const basePosition = position && position.split("-")[0];
|
|
4
|
-
return {
|
|
5
|
-
borderWidth: size
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
20
|
+
return __spreadValues({
|
|
21
|
+
borderWidth: size
|
|
22
|
+
}, {
|
|
23
|
+
top: {
|
|
24
|
+
top: "100% !important",
|
|
25
|
+
transform: `rotateZ(${180}deg)`
|
|
26
|
+
},
|
|
27
|
+
right: {
|
|
28
|
+
right: "100%",
|
|
29
|
+
transform: `rotateZ(${-90}deg)`
|
|
30
|
+
},
|
|
31
|
+
bottom: {
|
|
32
|
+
bottom: "100%",
|
|
33
|
+
transform: `rotateZ(${0}deg)`
|
|
34
|
+
},
|
|
35
|
+
left: {
|
|
36
|
+
left: "100%",
|
|
37
|
+
transform: `rotateZ(${90}deg)`
|
|
38
|
+
}
|
|
39
|
+
}[basePosition]);
|
|
25
40
|
};
|
|
26
41
|
var getArrowStylesBySize_default = getArrowStylesBySize;
|
|
27
42
|
export {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/getArrowStylesBySize.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const getArrowStylesBySize = (position, size = 30) => {\n const basePosition = position && position.split('-')[0];\n return {\n borderWidth: size,\n ...{\n top: {\n top: '100% !important',\n transform: `rotateZ(${180}deg)`,\n },\n right: {\n right: '100%',\n transform: `rotateZ(${-90}deg)`,\n },\n bottom: {\n bottom: '100%',\n transform: `rotateZ(${0}deg)`,\n },\n left: {\n left: '100%',\n transform: `rotateZ(${90}deg)`,\n },\n }[basePosition],\n };\n};\n\nexport default getArrowStylesBySize;\n"],
|
|
5
|
-
"mappings": "AAAA;ACAO,MAAM,uBAAuB,CAAC,UAAU,OAAO,OAAO;AAC3D,QAAM,eAAe,YAAY,SAAS,MAAM,KAAK;AACrD,SAAO;AAAA,IACL,aAAa;AAAA,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACAO,MAAM,uBAAuB,CAAC,UAAU,OAAO,OAAO;AAC3D,QAAM,eAAe,YAAY,SAAS,MAAM,KAAK;AACrD,SAAO;AAAA,IACL,aAAa;AAAA,KACV;AAAA,IACD,KAAK;AAAA,MACH,KAAK;AAAA,MACL,WAAW,WAAW;AAAA;AAAA,IAExB,OAAO;AAAA,MACL,OAAO;AAAA,MACP,WAAW,WAAW;AAAA;AAAA,IAExB,QAAQ;AAAA,MACN,QAAQ;AAAA,MACR,WAAW,WAAW;AAAA;AAAA,IAExB,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,WAAW,WAAW;AAAA;AAAA,IAExB;AAAA;AAIN,IAAO,+BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-popper",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Popper",
|
|
6
6
|
"files": [
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"indent": 4
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@elliemae/ds-overlay": "3.0.0-alpha.
|
|
67
|
-
"@elliemae/ds-utilities": "3.0.0-alpha.
|
|
66
|
+
"@elliemae/ds-overlay": "3.0.0-alpha.1",
|
|
67
|
+
"@elliemae/ds-utilities": "3.0.0-alpha.1",
|
|
68
68
|
"memoize-one": "~5.1.1",
|
|
69
69
|
"prop-types": "~15.7.2",
|
|
70
70
|
"react-desc": "~4.1.3",
|
|
@@ -83,6 +83,7 @@
|
|
|
83
83
|
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
84
84
|
"test": "node ../../scripts/testing/test.mjs",
|
|
85
85
|
"lint": "node ../../scripts/lint.mjs",
|
|
86
|
+
"dts": "node ../../scripts/dts.mjs",
|
|
86
87
|
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
|
87
88
|
}
|
|
88
89
|
}
|
package/dist/types/DSPopper.d.ts
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
|
-
import { Position } from './positions';
|
|
4
|
-
import { Interaction } from './interaction';
|
|
5
|
-
declare const DSPopper: {
|
|
6
|
-
({ containerProps, arrowGap, arrowSize, blockName, contentOffset, contentStyle, contentComponent, delayClose, delayOpen, interactionType, isOpen, onOpen, onClose, onPlacementChange, placement, preventOverflow, showArrow, closeAnimationConfig, openAnimationConfig, usePortal, triggerComponent, wrapExtraComponent, getTargetFromChildren, getContentFromChildren, modifiers, triggerRef, children: customPopper, renderReference, referenceNode, zIndex, hideIfNotVisible, }: {
|
|
7
|
-
containerProps: any;
|
|
8
|
-
arrowGap: any;
|
|
9
|
-
arrowSize: any;
|
|
10
|
-
blockName: any;
|
|
11
|
-
contentOffset: any;
|
|
12
|
-
contentStyle: any;
|
|
13
|
-
contentComponent: any;
|
|
14
|
-
delayClose: any;
|
|
15
|
-
delayOpen: any;
|
|
16
|
-
interactionType: any;
|
|
17
|
-
isOpen: any;
|
|
18
|
-
onOpen: any;
|
|
19
|
-
onClose: any;
|
|
20
|
-
onPlacementChange: any;
|
|
21
|
-
placement: any;
|
|
22
|
-
preventOverflow: any;
|
|
23
|
-
showArrow: any;
|
|
24
|
-
closeAnimationConfig: any;
|
|
25
|
-
openAnimationConfig: any;
|
|
26
|
-
usePortal: any;
|
|
27
|
-
triggerComponent: any;
|
|
28
|
-
wrapExtraComponent: any;
|
|
29
|
-
getTargetFromChildren: any;
|
|
30
|
-
getContentFromChildren: any;
|
|
31
|
-
modifiers: any;
|
|
32
|
-
triggerRef: any;
|
|
33
|
-
children: any;
|
|
34
|
-
renderReference: any;
|
|
35
|
-
referenceNode: any;
|
|
36
|
-
zIndex: any;
|
|
37
|
-
hideIfNotVisible: any;
|
|
38
|
-
}): JSX.Element;
|
|
39
|
-
propTypes: {
|
|
40
|
-
hideIfNotVisible: {
|
|
41
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
42
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
43
|
-
};
|
|
44
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
45
|
-
};
|
|
46
|
-
containerProps: {
|
|
47
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
48
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
49
|
-
};
|
|
50
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
51
|
-
};
|
|
52
|
-
arrowGap: {
|
|
53
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
54
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
55
|
-
};
|
|
56
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
57
|
-
};
|
|
58
|
-
onOpen: {
|
|
59
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
60
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
61
|
-
};
|
|
62
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
63
|
-
};
|
|
64
|
-
onClose: {
|
|
65
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
66
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
67
|
-
};
|
|
68
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
69
|
-
};
|
|
70
|
-
delayClose: {
|
|
71
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
72
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
73
|
-
};
|
|
74
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
75
|
-
};
|
|
76
|
-
delayOpen: {
|
|
77
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
78
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
79
|
-
};
|
|
80
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
81
|
-
};
|
|
82
|
-
onPlacementChange: {
|
|
83
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
84
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
85
|
-
};
|
|
86
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
87
|
-
};
|
|
88
|
-
arrowSize: {
|
|
89
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
90
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
91
|
-
};
|
|
92
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
93
|
-
};
|
|
94
|
-
blockName: {
|
|
95
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
96
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
97
|
-
};
|
|
98
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
99
|
-
};
|
|
100
|
-
triggerComponent: import("react-desc").PropTypesDescValue;
|
|
101
|
-
};
|
|
102
|
-
defaultProps: {
|
|
103
|
-
containerProps: {};
|
|
104
|
-
arrowGap: number;
|
|
105
|
-
arrowSize: number;
|
|
106
|
-
blockName: string;
|
|
107
|
-
contentOffset: null;
|
|
108
|
-
contentStyle: null;
|
|
109
|
-
contentComponent: () => null;
|
|
110
|
-
delayClose: number;
|
|
111
|
-
delayOpen: number;
|
|
112
|
-
interactionType: string;
|
|
113
|
-
onOpen: () => null;
|
|
114
|
-
onClose: () => null;
|
|
115
|
-
onPlacementChange: () => null;
|
|
116
|
-
placement: string;
|
|
117
|
-
preventOverflow: string;
|
|
118
|
-
showArrow: boolean;
|
|
119
|
-
closeAnimationConfig: {
|
|
120
|
-
to: {
|
|
121
|
-
transform: string;
|
|
122
|
-
opacity: string;
|
|
123
|
-
};
|
|
124
|
-
config: {
|
|
125
|
-
delay: number;
|
|
126
|
-
duration: number;
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
openAnimationConfig: {
|
|
130
|
-
to: {
|
|
131
|
-
transform: string;
|
|
132
|
-
opacity: string;
|
|
133
|
-
};
|
|
134
|
-
config: {
|
|
135
|
-
delay: number;
|
|
136
|
-
duration: number;
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
usePortal: boolean;
|
|
140
|
-
triggerComponent: () => null;
|
|
141
|
-
getTargetFromChildren: () => null;
|
|
142
|
-
getContentFromChildren: () => null;
|
|
143
|
-
modifiers: {};
|
|
144
|
-
triggerRef: () => null;
|
|
145
|
-
hideIfNotVisible: boolean;
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
declare const DSPopperWithSchema: {
|
|
149
|
-
(props?: unknown): JSX.Element;
|
|
150
|
-
propTypes: unknown;
|
|
151
|
-
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
152
|
-
};
|
|
153
|
-
export { Interaction as PopperInteractions, Position as PopperPositions, DSPopperWithSchema, DSPopper };
|
|
154
|
-
export { interactions } from './interaction';
|
|
155
|
-
export { positions } from './positions';
|
|
156
|
-
export default DSPopper;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { PureComponent } from 'react';
|
|
2
|
-
export default class PopperContent extends PureComponent {
|
|
3
|
-
static defaultProps: {
|
|
4
|
-
onContentDestroyed: () => null;
|
|
5
|
-
};
|
|
6
|
-
constructor(props: any);
|
|
7
|
-
handleRestAnimation(): void;
|
|
8
|
-
renderArrow({ ref, style }: {
|
|
9
|
-
ref: any;
|
|
10
|
-
style: any;
|
|
11
|
-
}, placement: any): JSX.Element | null;
|
|
12
|
-
renderContent({ ref, style, placement, arrowProps, scheduleUpdate, outOfBoundaries, }: {
|
|
13
|
-
ref: any;
|
|
14
|
-
style: any;
|
|
15
|
-
placement: any;
|
|
16
|
-
arrowProps: any;
|
|
17
|
-
scheduleUpdate: any;
|
|
18
|
-
outOfBoundaries: any;
|
|
19
|
-
}): JSX.Element;
|
|
20
|
-
render(): JSX.Element;
|
|
21
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Component } from 'react';
|
|
2
|
-
import { Reference } from 'react-popper';
|
|
3
|
-
import PopperContent from './PopperContent';
|
|
4
|
-
export default class PopperImpl extends Component<any, any> {
|
|
5
|
-
safeIsMounted: boolean;
|
|
6
|
-
handlePopperPlacementChange: (this: any, placement: any) => void;
|
|
7
|
-
constructor(props: any);
|
|
8
|
-
componentDidMount(): void;
|
|
9
|
-
componentDidUpdate(): void;
|
|
10
|
-
componentWillUnmount(): void;
|
|
11
|
-
static getDerivedStateFromProps(nextProps: any, prevState: any): {
|
|
12
|
-
isOpen: any;
|
|
13
|
-
prevPropIsOpen: any;
|
|
14
|
-
} | null;
|
|
15
|
-
getInteractionObject(interaction: any, referenceProps?: {}): {
|
|
16
|
-
handlers?: undefined;
|
|
17
|
-
canClose?: undefined;
|
|
18
|
-
} | {
|
|
19
|
-
handlers: {
|
|
20
|
-
onClick: (e: any) => void;
|
|
21
|
-
onMouseEnter?: undefined;
|
|
22
|
-
onPointerEnter?: undefined;
|
|
23
|
-
onMouseLeave?: undefined;
|
|
24
|
-
onPointerLeave?: undefined;
|
|
25
|
-
};
|
|
26
|
-
canClose: () => boolean;
|
|
27
|
-
} | {
|
|
28
|
-
handlers: {
|
|
29
|
-
onMouseEnter: any;
|
|
30
|
-
onPointerEnter: any;
|
|
31
|
-
onMouseLeave: any;
|
|
32
|
-
onPointerLeave: any;
|
|
33
|
-
onClick: (e: any) => void;
|
|
34
|
-
};
|
|
35
|
-
canClose: (isOnTrigger: any, isOnPopper: any) => boolean;
|
|
36
|
-
};
|
|
37
|
-
setOpen(opening: any): void;
|
|
38
|
-
open(): void;
|
|
39
|
-
close(): void;
|
|
40
|
-
handleTriggerClick(e: any): void;
|
|
41
|
-
handleContentMouseEnter(): void;
|
|
42
|
-
handleContentMouseLeave(): void;
|
|
43
|
-
handleMouseEnter(): void;
|
|
44
|
-
handleMouseLeave(): void;
|
|
45
|
-
updatePopoverState(popperData: any): any;
|
|
46
|
-
handleDestroyContent(): void;
|
|
47
|
-
renderTarget({ ref }: {
|
|
48
|
-
ref: any;
|
|
49
|
-
}): any;
|
|
50
|
-
render(): JSX.Element;
|
|
51
|
-
}
|
|
52
|
-
export { Reference, PopperContent };
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare const Position: {
|
|
2
|
-
AUTO: string;
|
|
3
|
-
AUTO_START: string;
|
|
4
|
-
AUTO_END: string;
|
|
5
|
-
BOTTOM: string;
|
|
6
|
-
BOTTOM_START: string;
|
|
7
|
-
BOTTOM_END: string;
|
|
8
|
-
LEFT: string;
|
|
9
|
-
LEFT_END: string;
|
|
10
|
-
LEFT_START: string;
|
|
11
|
-
RIGHT: string;
|
|
12
|
-
RIGHT_END: string;
|
|
13
|
-
RIGHT_START: string;
|
|
14
|
-
TOP: string;
|
|
15
|
-
TOP_START: string;
|
|
16
|
-
TOP_END: string;
|
|
17
|
-
};
|
|
18
|
-
export declare const positions: string[];
|
package/dist/types/props.d.ts
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
-
export declare const popperProps: {
|
|
3
|
-
/** Hide menu component if trigger component is not visible/scrolled away */
|
|
4
|
-
hideIfNotVisible: {
|
|
5
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
6
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
7
|
-
};
|
|
8
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
9
|
-
};
|
|
10
|
-
/** props to inject to popper wrapper */
|
|
11
|
-
containerProps: {
|
|
12
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
13
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
14
|
-
};
|
|
15
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
16
|
-
};
|
|
17
|
-
/** Space between the arrow and the popup */
|
|
18
|
-
arrowGap: {
|
|
19
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
20
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
21
|
-
};
|
|
22
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
23
|
-
};
|
|
24
|
-
/** callback for when menu changes from close to open */
|
|
25
|
-
onOpen: {
|
|
26
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
27
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
28
|
-
};
|
|
29
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
30
|
-
};
|
|
31
|
-
/** callback for when menu changes from open to close */
|
|
32
|
-
onClose: {
|
|
33
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
34
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
35
|
-
};
|
|
36
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
37
|
-
};
|
|
38
|
-
/** Time in ms to delay close of menu */
|
|
39
|
-
delayClose: {
|
|
40
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
41
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
42
|
-
};
|
|
43
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
44
|
-
};
|
|
45
|
-
/** Time in ms to delay open of menu */
|
|
46
|
-
delayOpen: {
|
|
47
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
48
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
49
|
-
};
|
|
50
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
51
|
-
};
|
|
52
|
-
/** callback for when menu changes placement */
|
|
53
|
-
onPlacementChange: {
|
|
54
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
55
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
56
|
-
};
|
|
57
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
58
|
-
};
|
|
59
|
-
/** Arrow size */
|
|
60
|
-
arrowSize: {
|
|
61
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
62
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
63
|
-
};
|
|
64
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
65
|
-
};
|
|
66
|
-
/** Bem blockname for the popper */
|
|
67
|
-
blockName: {
|
|
68
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
69
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
70
|
-
};
|
|
71
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
72
|
-
};
|
|
73
|
-
triggerComponent: import("react-desc").PropTypesDescValue;
|
|
74
|
-
};
|
|
75
|
-
export declare const defaultProps: {
|
|
76
|
-
containerProps: {};
|
|
77
|
-
arrowGap: number;
|
|
78
|
-
arrowSize: number;
|
|
79
|
-
blockName: string;
|
|
80
|
-
contentOffset: null;
|
|
81
|
-
contentStyle: null;
|
|
82
|
-
contentComponent: () => null;
|
|
83
|
-
delayClose: number;
|
|
84
|
-
delayOpen: number;
|
|
85
|
-
interactionType: string;
|
|
86
|
-
onOpen: () => null;
|
|
87
|
-
onClose: () => null;
|
|
88
|
-
onPlacementChange: () => null;
|
|
89
|
-
placement: string;
|
|
90
|
-
preventOverflow: string;
|
|
91
|
-
showArrow: boolean;
|
|
92
|
-
closeAnimationConfig: {
|
|
93
|
-
to: {
|
|
94
|
-
transform: string;
|
|
95
|
-
opacity: string;
|
|
96
|
-
};
|
|
97
|
-
config: {
|
|
98
|
-
delay: number;
|
|
99
|
-
duration: number;
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
openAnimationConfig: {
|
|
103
|
-
to: {
|
|
104
|
-
transform: string;
|
|
105
|
-
opacity: string;
|
|
106
|
-
};
|
|
107
|
-
config: {
|
|
108
|
-
delay: number;
|
|
109
|
-
duration: number;
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
usePortal: boolean;
|
|
113
|
-
triggerComponent: () => null;
|
|
114
|
-
getTargetFromChildren: () => null;
|
|
115
|
-
getContentFromChildren: () => null;
|
|
116
|
-
modifiers: {};
|
|
117
|
-
triggerRef: () => null;
|
|
118
|
-
hideIfNotVisible: boolean;
|
|
119
|
-
};
|