@elliemae/ds-popperjs 3.15.0 → 3.16.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/dist/cjs/PopoverContent.js +2 -2
- package/dist/cjs/PopoverContent.js.map +2 -2
- package/dist/cjs/config/useConfigDSPopperjs.js +5 -5
- package/dist/cjs/config/useConfigDSPopperjs.js.map +2 -2
- package/dist/cjs/config/useConfiguredDefaultModifiers.js.map +1 -1
- package/dist/cjs/config/useConfiguredDefaultProps.js +1 -1
- package/dist/cjs/config/useConfiguredDefaultProps.js.map +1 -1
- package/dist/cjs/config/useConfiguredMergedProps.js +3 -3
- package/dist/cjs/config/useConfiguredMergedProps.js.map +2 -2
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/react-desc-prop-types.js +21 -21
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/esm/PopoverContent.js +2 -2
- package/dist/esm/PopoverContent.js.map +2 -2
- package/dist/esm/config/useConfigDSPopperjs.js +3 -3
- package/dist/esm/config/useConfigDSPopperjs.js.map +2 -2
- package/dist/esm/config/useConfiguredDefaultModifiers.js.map +1 -1
- package/dist/esm/config/useConfiguredDefaultProps.js +1 -1
- package/dist/esm/config/useConfiguredDefaultProps.js.map +1 -1
- package/dist/esm/config/useConfiguredMergedProps.js +2 -2
- package/dist/esm/config/useConfiguredMergedProps.js.map +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +7 -0
- package/dist/esm/react-desc-prop-types.js +1 -1
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/types/PopoverContent.d.ts +1 -1
- package/dist/types/config/useConfigDSPopperjs.d.ts +1 -1
- package/dist/types/config/useConfiguredDefaultModifiers.d.ts +1 -1
- package/dist/types/config/useConfiguredDefaultProps.d.ts +3 -3
- package/dist/types/config/useConfiguredMergedProps.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/react-desc-prop-types.d.ts +1 -1
- package/package.json +5 -4
|
@@ -30,8 +30,8 @@ module.exports = __toCommonJS(PopoverContent_exports);
|
|
|
30
30
|
var React = __toESM(require("react"));
|
|
31
31
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
32
|
var import_react = require("react");
|
|
33
|
-
var import_PopoverArrow = require("./PopoverArrow");
|
|
34
|
-
var import_styled = require("./styled");
|
|
33
|
+
var import_PopoverArrow = require("./PopoverArrow.js");
|
|
34
|
+
var import_styled = require("./styled.js");
|
|
35
35
|
const PopoverContent = ({
|
|
36
36
|
setPopperElement,
|
|
37
37
|
popperStyles,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/PopoverContent.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useCallback, useMemo } from 'react';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React, { useCallback, useMemo } from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { PopoverArrow } from './PopoverArrow.js';\nimport { StyledPopoverContentWrapper, StyledAnimatedPopper } from './styled.js';\n\nexport interface PopoverContentPropsT {\n setPopperElement: React.Dispatch<React.SetStateAction<HTMLDivElement | null>>;\n popperStyles: React.CSSProperties;\n arrowStyle: React.CSSProperties;\n popperAttributes: Record<string, string> | undefined;\n children: JSX.Element | JSX.Element[];\n setArrowElement: React.Dispatch<React.SetStateAction<HTMLDivElement | null>>;\n withoutArrow: boolean;\n withoutAnimation: boolean;\n animationDuration: number;\n zIndex: number;\n showPopover: boolean;\n setIsAnimating: React.Dispatch<React.SetStateAction<boolean>>;\n globalAttrs: GlobalAttributesT;\n xStyledAttrs: XstyledProps;\n}\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 globalAttrs,\n xStyledAttrs,\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\n ref={setPopperElement}\n style={popperStyles}\n {...popperAttributes}\n {...globalAttrs}\n {...xStyledAttrs}\n zIndex={zIndex}\n >\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;AAAA;ACAA,YAAuB;ADkDb;AAlDV,mBAA4C;AAG5C,0BAA6B;AAC7B,oBAAkE;AAmB3D,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,EACA;AAAA,EACA;AACF,MAAyC;AACvC,QAAM,2BAAuB,0BAAY,MAAM;AAC7C,QAAI,CAAC,eAAe,CAAC,kBAAkB;AACrC,qBAAe,KAAK;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,aAAa,kBAAkB,cAAc,CAAC;AAElD,QAAM,oBAAgB;AAAA,IACpB,MACE,4EACG;AAAA;AAAA,MACA,iBAAiB,QAChB,4EACE;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,iBAAiB;AAAA,YACjB,OAAO;AAAA,YACP,WAAW,mBAAmB,iBAAiB,2BAA2B;AAAA;AAAA,QAC5E;AAAA,QACA,4CAAC,SAAI,KAAK,iBAAiB,OAAO,YAAY;AAAA,SAChD,IACE;AAAA,OACN;AAAA,IAEF,CAAC,UAAU,cAAc,YAAY,kBAAkB,eAAe;AAAA,EACxE;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,OAAO;AAAA,MACN,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA,gBAAgB;AAAA,UAEf;AAAA;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -30,9 +30,9 @@ module.exports = __toCommonJS(useConfigDSPopperjs_exports);
|
|
|
30
30
|
var React = __toESM(require("react"));
|
|
31
31
|
var import_react = require("react");
|
|
32
32
|
var import_react_popper = require("react-popper");
|
|
33
|
-
var
|
|
34
|
-
var import_useConfiguredMergedProps = require("./useConfiguredMergedProps");
|
|
35
|
-
var import_useOnClickOutside = require("../utils/hooks/useOnClickOutside");
|
|
33
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
34
|
+
var import_useConfiguredMergedProps = require("./useConfiguredMergedProps.js");
|
|
35
|
+
var import_useOnClickOutside = require("../utils/hooks/useOnClickOutside.js");
|
|
36
36
|
const useConfigDSPopperjs = (appProps) => {
|
|
37
37
|
const [popperElement, setPopperElement] = (0, import_react.useState)(null);
|
|
38
38
|
const [arrowElement, setArrowElement] = (0, import_react.useState)(null);
|
|
@@ -56,8 +56,8 @@ const useConfigDSPopperjs = (appProps) => {
|
|
|
56
56
|
closeContextMenu();
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
|
-
const globalAttrs = (0,
|
|
60
|
-
const xStyledAttrs = (0,
|
|
59
|
+
const globalAttrs = (0, import_ds_props_helpers.useGetGlobalAttributes)(props);
|
|
60
|
+
const xStyledAttrs = (0, import_ds_props_helpers.useGetXstyledProps)(props);
|
|
61
61
|
return (0, import_react.useMemo)(
|
|
62
62
|
() => ({
|
|
63
63
|
props,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA6C;AAC7C,0BAA0B;AAC1B,
|
|
4
|
+
"sourcesContent": ["import { useMemo, useState, useEffect } from 'react';\nimport { usePopper } from 'react-popper';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport { useConfiguredMergedProps } from './useConfiguredMergedProps.js';\nimport type { UseDSPopperjsPropsArgT, UseDSPopperjsRT } from '../react-desc-prop-types.js';\nimport { useOnClickOutside } from '../utils/hooks/useOnClickOutside.js';\n\nexport const useConfigDSPopperjs = (appProps: UseDSPopperjsPropsArgT): UseDSPopperjsRT => {\n const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null);\n const [arrowElement, setArrowElement] = useState<HTMLDivElement | null>(null);\n const [isAnimating, setIsAnimating] = useState(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 as Node, (e) => {\n if (!referenceElement?.contains?.(e?.target as Node)) {\n onClickOutside(e);\n closeContextMenu();\n }\n });\n\n const globalAttrs = useGetGlobalAttributes(props);\n const xStyledAttrs = useGetXstyledProps(props);\n\n return useMemo(\n () => ({\n props,\n popperElement,\n setPopperElement,\n arrowElement,\n setArrowElement,\n popoverHelper,\n isAnimating,\n setIsAnimating,\n globalAttrs,\n xStyledAttrs,\n }),\n [props, popperElement, arrowElement, popoverHelper, isAnimating, globalAttrs, xStyledAttrs],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA6C;AAC7C,0BAA0B;AAC1B,8BAA2D;AAC3D,sCAAyC;AAEzC,+BAAkC;AAE3B,MAAM,sBAAsB,CAAC,aAAsD;AACxF,QAAM,CAAC,eAAe,gBAAgB,QAAI,uBAAgC,IAAI;AAC9E,QAAM,CAAC,cAAc,eAAe,QAAI,uBAAgC,IAAI;AAC5E,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAS,KAAK;AAEpD,QAAM,YAAQ,0DAAyB,EAAE,OAAO,UAAU,aAAa,CAAC;AACxE,QAAM,EAAE,kBAAkB,kBAAkB,gBAAgB,WAAW,yBAAyB,IAAI;AACpG,QAAM,sBAAkB;AAAA,IACtB,OAAO,EAAE,WAAW,0BAA0B,UAAU;AAAA,IACxD,CAAC,WAAW,wBAAwB;AAAA,EACtC;AAEA,QAAM,oBAAgB,+BAAU,kBAAkB,eAAe,eAAe;AAEhF,QAAM,EAAE,aAAa,iBAAiB,IAAI;AAE1C,8BAAU,MAAM;AACd,QAAI,eAAe,CAAC,kBAAkB;AACpC,qBAAe,IAAI;AAAA,IACrB;AAAA,EACF,GAAG,CAAC,aAAa,gBAAgB,CAAC;AAElC,kDAAkB,eAAuB,CAAC,MAAM;AAC9C,QAAI,CAAC,kBAAkB,WAAW,GAAG,MAAc,GAAG;AACpD,qBAAe,CAAC;AAChB,uBAAiB;AAAA,IACnB;AAAA,EACF,CAAC;AAED,QAAM,kBAAc,gDAAuB,KAAK;AAChD,QAAM,mBAAe,4CAAmB,KAAK;AAE7C,aAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,OAAO,eAAe,cAAc,eAAe,aAAa,aAAa,YAAY;AAAA,EAC5F;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useConfiguredDefaultModifiers.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useMemo } from 'react';\nimport type { UseDSPopperjsPropsArgT } from '../react-desc-prop-types';\n\ninterface UseConfiguredDefaultModifiersT {\n props: UseDSPopperjsPropsArgT;\n arrowElement: HTMLDivElement | null;\n}\n\nexport const useConfiguredDefaultModifiers = ({ props, arrowElement }: UseConfiguredDefaultModifiersT) => {\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"],
|
|
4
|
+
"sourcesContent": ["import { useMemo } from 'react';\nimport type { UseDSPopperjsPropsArgT } from '../react-desc-prop-types.js';\n\ninterface UseConfiguredDefaultModifiersT {\n props: UseDSPopperjsPropsArgT;\n arrowElement: HTMLDivElement | null;\n}\n\nexport const useConfiguredDefaultModifiers = ({ props, arrowElement }: UseConfiguredDefaultModifiersT) => {\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
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwB;AAQjB,MAAM,gCAAgC,CAAC,EAAE,OAAO,aAAa,MAAsC;AAExG,QAAM;AAAA,IACJ,iBAAiB;AAAA,IACjB,cAAc,0BAA0B;AAAA,IACxC,0BAA0B,mCAAmC,CAAC,OAAO,UAAU,QAAQ,OAAO;AAAA,IAC9F,cAAc,mBAAmB;AAAA,EACnC,IAAI;AAEJ,QAAM,uBAAmB,sBAAQ,MAAM;AACrC,UAAM,MAAM,CAAC;AACb,QAAI,KAAK,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AACxC,QAAI,KAAK;AAAA,MACP,MAAM;AAAA,MACN,SAAS;AAAA,QACP,oBAAoB;AAAA,MACtB;AAAA,IACF,CAAC;AAED,QAAI,CAAC,2BAA2B,kBAAkB;AAChD,YAAM,gBAAgB,oBAAoB,CAAC,GAAG,EAAE;AAChD,UAAI,KAAK;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,QACT,SAAS;AAAA,UACP,QAAQ;AAAA,QACV;AAAA,MACF,CAAC;AAAA,IACH;AAEA,QAAI,CAAC;AACH,UAAI,KAAK;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,UACP,SAAS;AAAA,UACT,SAAS;AAAA,QACX;AAAA,MACF,CAAC;AAGH,QAAI;AACF,UAAI,KAAK;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,UACP,UAAU;AAAA,QACZ;AAAA,MACF,CAAC;AACH,WAAO;AAAA,EACT,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,EAAE,WAAW,uBAAuB,iBAAiB,IAAI;AAE/D,aAAO;AAAA,IACL,OAAO;AAAA,MACL,WAAW;AAAA,IACb;AAAA,IACA,CAAC,oBAAoB;AAAA,EACvB;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -29,7 +29,7 @@ __export(useConfiguredDefaultProps_exports, {
|
|
|
29
29
|
module.exports = __toCommonJS(useConfiguredDefaultProps_exports);
|
|
30
30
|
var React = __toESM(require("react"));
|
|
31
31
|
var import_react = require("react");
|
|
32
|
-
var import_useConfiguredDefaultModifiers = require("./useConfiguredDefaultModifiers");
|
|
32
|
+
var import_useConfiguredDefaultModifiers = require("./useConfiguredDefaultModifiers.js");
|
|
33
33
|
const noop = () => {
|
|
34
34
|
};
|
|
35
35
|
const emptyObj = {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useConfiguredDefaultProps.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useMemo } from 'react';\nimport { useConfiguredDefaultModifiers } from './useConfiguredDefaultModifiers';\nimport type { UseDSPopperjsPropsArgT } from '../react-desc-prop-types';\n\nconst noop = () => {};\n\nconst emptyObj = {};\n\ninterface UseConfiguredDefaultPropsT {\n props: UseDSPopperjsPropsArgT;\n arrowElement: HTMLDivElement | null;\n}\n\nexport const useConfiguredDefaultProps = ({ props, arrowElement }: Required<UseConfiguredDefaultPropsT>) => {\n // don't move this out of the hook or `document.body` will explode\n const staticDefaultProps: UseDSPopperjsPropsArgT = 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 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"],
|
|
4
|
+
"sourcesContent": ["import { useMemo } from 'react';\nimport { useConfiguredDefaultModifiers } from './useConfiguredDefaultModifiers.js';\nimport type { UseDSPopperjsPropsArgT } from '../react-desc-prop-types.js';\n\nconst noop = () => {};\n\nconst emptyObj = {};\n\ninterface UseConfiguredDefaultPropsT {\n props: UseDSPopperjsPropsArgT;\n arrowElement: HTMLDivElement | null;\n}\n\nexport const useConfiguredDefaultProps = ({ props, arrowElement }: Required<UseConfiguredDefaultPropsT>) => {\n // don't move this out of the hook or `document.body` will explode\n const staticDefaultProps: UseDSPopperjsPropsArgT = 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 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
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwB;AACxB,2CAA8C;AAG9C,MAAM,OAAO,MAAM;AAAC;AAEpB,MAAM,WAAW,CAAC;AAOX,MAAM,4BAA4B,CAAC,EAAE,OAAO,aAAa,MAA4C;AAE1G,QAAM,yBAA6C;AAAA,IACjD,OAAO;AAAA,MACL,kBAAkB;AAAA,MAClB,aAAa;AAAA,MACb,kBAAkB;AAAA,MAClB,gBAAgB;AAAA,MAChB,eAAe;AAAA,MACf,cAAc;AAAA,MACd,kBAAkB;AAAA,MAClB,mBAAmB;AAAA,MACnB,oBAAoB,SAAS;AAAA,MAC7B,0BAA0B;AAAA,MAC1B,0BAA0B,CAAC,OAAO,UAAU,QAAQ,OAAO;AAAA,MAC3D,mBAAmB;AAAA,IACrB;AAAA,IACA,CAAC;AAAA,EACH;AACA,QAAM,EAAE,WAAW,oBAAoB,QAAI,oEAA8B;AAAA,IACvE;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,mBAAe;AAAA,IACnB,OAAO,EAAE,GAAG,oBAAoB,WAAW,oBAAoB;AAAA,IAC/D,CAAC,qBAAqB,kBAAkB;AAAA,EAC1C;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -28,10 +28,10 @@ __export(useConfiguredMergedProps_exports, {
|
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(useConfiguredMergedProps_exports);
|
|
30
30
|
var React = __toESM(require("react"));
|
|
31
|
-
var
|
|
32
|
-
var import_useConfiguredDefaultProps = require("./useConfiguredDefaultProps");
|
|
31
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
32
|
+
var import_useConfiguredDefaultProps = require("./useConfiguredDefaultProps.js");
|
|
33
33
|
const useConfiguredMergedProps = ({ props, arrowElement }) => {
|
|
34
34
|
const defaultProps = (0, import_useConfiguredDefaultProps.useConfiguredDefaultProps)({ props, arrowElement });
|
|
35
|
-
return (0,
|
|
35
|
+
return (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, defaultProps);
|
|
36
36
|
};
|
|
37
37
|
//# sourceMappingURL=useConfiguredMergedProps.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useConfiguredMergedProps.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useMemoMergePropsWithDefault } from '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,
|
|
4
|
+
"sourcesContent": ["import { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { useConfiguredDefaultProps } from './useConfiguredDefaultProps.js';\nimport type { UseDSPopperjsPropsArgT } from '../react-desc-prop-types.js';\n\ninterface UseConfiguredMergedPropsT {\n props: UseDSPopperjsPropsArgT;\n arrowElement: HTMLDivElement | null;\n}\n\nexport const useConfiguredMergedProps = ({ props, arrowElement }: UseConfiguredMergedPropsT) => {\n const defaultProps = useConfiguredDefaultProps({ props, arrowElement });\n\n return useMemoMergePropsWithDefault<Required<UseDSPopperjsPropsArgT>>(props, defaultProps);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA6C;AAC7C,uCAA0C;AAQnC,MAAM,2BAA2B,CAAC,EAAE,OAAO,aAAa,MAAiC;AAC9F,QAAM,mBAAe,4DAA0B,EAAE,OAAO,aAAa,CAAC;AAEtE,aAAO,sDAA+D,OAAO,YAAY;AAC3F;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -33,10 +33,10 @@ var React = __toESM(require("react"));
|
|
|
33
33
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
34
|
var import_react = require("react");
|
|
35
35
|
var import_react_dom = require("react-dom");
|
|
36
|
-
var
|
|
37
|
-
var import_PopoverContent = require("./PopoverContent");
|
|
38
|
-
var import_useConfigDSPopperjs = require("./config/useConfigDSPopperjs");
|
|
39
|
-
var import_react_desc_prop_types = require("./react-desc-prop-types");
|
|
36
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
37
|
+
var import_PopoverContent = require("./PopoverContent.js");
|
|
38
|
+
var import_useConfigDSPopperjs = require("./config/useConfigDSPopperjs.js");
|
|
39
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
40
40
|
const DSPopperJS = (props) => {
|
|
41
41
|
const {
|
|
42
42
|
props: {
|
|
@@ -107,7 +107,7 @@ const DSPopperJS = (props) => {
|
|
|
107
107
|
};
|
|
108
108
|
DSPopperJS.propTypes = import_react_desc_prop_types.dspopperjsPropTypes;
|
|
109
109
|
DSPopperJS.displayName = "DSPopperJS";
|
|
110
|
-
const DSPopperJSWithSchema = (0,
|
|
110
|
+
const DSPopperJSWithSchema = (0, import_ds_props_helpers.describe)(DSPopperJS).description("A dimsum custom styling wrapper on top of popperjs");
|
|
111
111
|
DSPopperJSWithSchema.propTypes = import_react_desc_prop_types.dspopperjsPropTypes;
|
|
112
112
|
var src_default = DSPopperJS;
|
|
113
113
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useMemo } from 'react';\nimport { createPortal } from 'react-dom';\nimport { describe } from '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgCjB;AAhCN,mBAA+B;AAC/B,uBAA6B;AAC7B,
|
|
4
|
+
"sourcesContent": ["import React, { useMemo } from 'react';\nimport { createPortal } from 'react-dom';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { PopoverContent } from './PopoverContent.js';\nimport { useConfigDSPopperjs } from './config/useConfigDSPopperjs.js';\nimport type { DSDSPopperjsPropsT } from './react-desc-prop-types.js';\nimport { dspopperjsPropTypes } from './react-desc-prop-types.js';\n\nconst DSPopperJS: React.ComponentType<DSDSPopperjsPropsT> = (props) => {\n const {\n props: {\n showPopover,\n withoutAnimation,\n animationDuration,\n withoutPortal,\n withoutArrow,\n portalDOMContainer,\n zIndex,\n extraPopperStyles,\n },\n globalAttrs,\n xStyledAttrs,\n setPopperElement,\n setArrowElement,\n setIsAnimating,\n popoverHelper,\n isAnimating,\n } = useConfigDSPopperjs(props);\n const { children } = props;\n const { styles, attributes } = popoverHelper;\n const contentJSX = useMemo(\n () => (\n <PopoverContent\n setPopperElement={setPopperElement}\n popperStyles={{ ...styles.popper, ...extraPopperStyles }}\n popperAttributes={attributes.popper}\n setArrowElement={setArrowElement}\n arrowStyle={styles.arrow}\n withoutArrow={withoutArrow}\n withoutAnimation={withoutAnimation}\n animationDuration={animationDuration}\n zIndex={zIndex}\n showPopover={showPopover}\n setIsAnimating={setIsAnimating}\n globalAttrs={globalAttrs}\n xStyledAttrs={xStyledAttrs}\n >\n {children}\n </PopoverContent>\n ),\n [\n attributes.popper,\n children,\n setIsAnimating,\n showPopover,\n extraPopperStyles,\n setArrowElement,\n setPopperElement,\n styles.arrow,\n styles.popper,\n withoutArrow,\n withoutAnimation,\n animationDuration,\n zIndex,\n globalAttrs,\n xStyledAttrs,\n ],\n );\n if (showPopover || isAnimating) {\n if (withoutPortal === true) return contentJSX;\n if (withoutPortal === false) return <>{createPortal(contentJSX, portalDOMContainer)}</>;\n }\n return null;\n};\n\nDSPopperJS.propTypes = dspopperjsPropTypes;\nDSPopperJS.displayName = 'DSPopperJS';\nconst DSPopperJSWithSchema = describe(DSPopperJS).description('A dimsum custom styling wrapper on top of popperjs');\nDSPopperJSWithSchema.propTypes = dspopperjsPropTypes;\n\nexport { DSPopperJS, DSPopperJSWithSchema };\nexport default DSPopperJS;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgCjB;AAhCN,mBAA+B;AAC/B,uBAA6B;AAC7B,8BAAyB;AACzB,4BAA+B;AAC/B,iCAAoC;AAEpC,mCAAoC;AAEpC,MAAM,aAAsD,CAAC,UAAU;AACrE,QAAM;AAAA,IACJ,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,gDAAoB,KAAK;AAC7B,QAAM,EAAE,SAAS,IAAI;AACrB,QAAM,EAAE,QAAQ,WAAW,IAAI;AAC/B,QAAM,iBAAa;AAAA,IACjB,MACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,cAAc,EAAE,GAAG,OAAO,QAAQ,GAAG,kBAAkB;AAAA,QACvD,kBAAkB,WAAW;AAAA,QAC7B;AAAA,QACA,YAAY,OAAO;AAAA,QACnB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,IAEF;AAAA,MACE,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACA,MAAI,eAAe,aAAa;AAC9B,QAAI,kBAAkB;AAAM,aAAO;AACnC,QAAI,kBAAkB;AAAO,aAAO,2EAAG,6CAAa,YAAY,kBAAkB,GAAE;AAAA,EACtF;AACA,SAAO;AACT;AAEA,WAAW,YAAY;AACvB,WAAW,cAAc;AACzB,MAAM,2BAAuB,kCAAS,UAAU,EAAE,YAAY,oDAAoD;AAClH,qBAAqB,YAAY;AAGjC,IAAO,cAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -28,26 +28,26 @@ __export(react_desc_prop_types_exports, {
|
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
30
30
|
var React = __toESM(require("react"));
|
|
31
|
-
var
|
|
31
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
32
32
|
const dspopperjsPropTypes = {
|
|
33
|
-
...
|
|
34
|
-
...
|
|
35
|
-
referenceElement:
|
|
33
|
+
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
34
|
+
...import_ds_props_helpers.xstyledPropTypes,
|
|
35
|
+
referenceElement: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.instanceOf(Element), import_ds_props_helpers.PropTypes.oneOf([null])]).description(
|
|
36
36
|
"popperjs DOM referenceElement"
|
|
37
37
|
).isRequired,
|
|
38
|
-
showPopover:
|
|
39
|
-
closeContextMenu:
|
|
38
|
+
showPopover: import_ds_props_helpers.PropTypes.bool.description("whether or not to show the popper content").isRequired,
|
|
39
|
+
closeContextMenu: import_ds_props_helpers.PropTypes.func.description(
|
|
40
40
|
'Callback to close the context menu, used for "on click outside", if not provided click outside will not trigger anything'
|
|
41
41
|
).defaultValue("() => {}"),
|
|
42
|
-
withoutPortal:
|
|
43
|
-
withoutArrow:
|
|
44
|
-
withoutAnimation:
|
|
45
|
-
animationDuration:
|
|
46
|
-
boundaryElement:
|
|
42
|
+
withoutPortal: import_ds_props_helpers.PropTypes.bool.description("Whether or not the popper content should appear in a DOM portal or not").defaultValue(true),
|
|
43
|
+
withoutArrow: import_ds_props_helpers.PropTypes.bool.description("Whether or not the popper context menu should print the arrow").defaultValue(false),
|
|
44
|
+
withoutAnimation: import_ds_props_helpers.PropTypes.bool.description("Whether or not the popper context menu should be animated").defaultValue(false),
|
|
45
|
+
animationDuration: import_ds_props_helpers.PropTypes.number.description("Popper context menus Animation duration in ms").defaultValue(100),
|
|
46
|
+
boundaryElement: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.instanceOf(Element), import_ds_props_helpers.PropTypes.oneOf([null])]).description(
|
|
47
47
|
'Bounding element to calculate upon, defaults to "clippingParents",which are the scrolling containers that may cause element to be partially or fully cut off'
|
|
48
48
|
).defaultValue(void 0),
|
|
49
|
-
portalDOMContainer:
|
|
50
|
-
startPlacementPreference:
|
|
49
|
+
portalDOMContainer: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.instanceOf(Element), import_ds_props_helpers.PropTypes.oneOf([null])]).description("When using portal, the container in which to append the DOM content, defaults to document body").defaultValue(void 0),
|
|
50
|
+
startPlacementPreference: import_ds_props_helpers.PropTypes.oneOf([
|
|
51
51
|
"top-start",
|
|
52
52
|
"top",
|
|
53
53
|
"top-end",
|
|
@@ -61,8 +61,8 @@ const dspopperjsPropTypes = {
|
|
|
61
61
|
"left",
|
|
62
62
|
"left-start"
|
|
63
63
|
]).description("start placement preferences, as per popperjs placement option").defaultValue("'top'"),
|
|
64
|
-
placementOrderPreference:
|
|
65
|
-
|
|
64
|
+
placementOrderPreference: import_ds_props_helpers.PropTypes.arrayOf(
|
|
65
|
+
import_ds_props_helpers.PropTypes.oneOf([
|
|
66
66
|
"top-start",
|
|
67
67
|
"top",
|
|
68
68
|
"top-end",
|
|
@@ -77,11 +77,11 @@ const dspopperjsPropTypes = {
|
|
|
77
77
|
"left-start"
|
|
78
78
|
])
|
|
79
79
|
).description('Array of placement preferences, as per popperjs "flip" placement option').defaultValue("['top', 'bottom', 'left', 'right']"),
|
|
80
|
-
zIndex:
|
|
81
|
-
customOffset:
|
|
82
|
-
modifiers:
|
|
83
|
-
extraPopperStyles:
|
|
84
|
-
onClickOutside:
|
|
85
|
-
children:
|
|
80
|
+
zIndex: import_ds_props_helpers.PropTypes.number.description("popperjs content z-index").defaultValue(1),
|
|
81
|
+
customOffset: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.number).description("placement offset array").defaultValue(1),
|
|
82
|
+
modifiers: import_ds_props_helpers.PropTypes.array.description("modifiers array for full-custom popper-js override, https://popper.js.org/docs/v2/modifiers/").defaultValue(1),
|
|
83
|
+
extraPopperStyles: import_ds_props_helpers.PropTypes.object.description("Extra object styles to attach to the popper element").defaultValue({}),
|
|
84
|
+
onClickOutside: import_ds_props_helpers.PropTypes.func.description("Callback triggered when clicking outside the popper").defaultValue(() => null),
|
|
85
|
+
children: import_ds_props_helpers.PropTypes.node.description("The content of the popper").defaultValue(void 0)
|
|
86
86
|
};
|
|
87
87
|
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.ts", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type React from 'react';\nimport type { WeakValidationMap } from 'react';\nimport { globalAttributesPropTypes, PropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,
|
|
4
|
+
"sourcesContent": ["import type React from 'react';\nimport type { WeakValidationMap } from 'react';\nimport { globalAttributesPropTypes, PropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport type { usePopper } from 'react-popper';\n\nexport type PopperPlacementsT =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'right-start'\n | 'right'\n | 'right-end'\n | 'bottom-end'\n | 'bottom'\n | 'bottom-start'\n | 'left-end'\n | 'left'\n | 'left-start';\nexport interface UseDSPopperjsPropsArgT {\n referenceElement: HTMLElement | null;\n showPopover: boolean;\n closeContextMenu?: () => void;\n onClickOutside?: (e: MouseEvent | TouchEvent) => void;\n withoutPortal?: boolean;\n withoutArrow?: boolean;\n withoutAnimation?: boolean;\n animationDuration?: number;\n boundaryElement?: HTMLElement;\n portalDOMContainer?: HTMLElement;\n placementOrderPreference?: PopperPlacementsT[];\n startPlacementPreference?: PopperPlacementsT;\n modifiers?: Record<string, unknown>[];\n customOffset?: [number, number];\n zIndex?: number;\n extraPopperStyles?: Record<string, unknown>;\n}\nexport interface UseDSPopperjsRT {\n props: Required<UseDSPopperjsPropsArgT>;\n popperElement: HTMLDivElement | null;\n setIsAnimating: React.Dispatch<React.SetStateAction<boolean>>;\n isAnimating: boolean;\n setPopperElement: React.Dispatch<React.SetStateAction<HTMLDivElement | null>>;\n arrowElement: HTMLDivElement | null;\n setArrowElement: React.Dispatch<React.SetStateAction<HTMLDivElement | null>>;\n popoverHelper: ReturnType<typeof usePopper>;\n globalAttrs: GlobalAttributesT<Element>;\n xStyledAttrs: XstyledProps;\n}\nexport interface DSDSPopperjsPropsT extends UseDSPopperjsPropsArgT {\n children: JSX.Element | JSX.Element[];\n}\n\nexport const dspopperjsPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n /**\n * React ref to popperjs referenceElement\n */\n referenceElement: PropTypes.oneOfType([PropTypes.instanceOf(Element), PropTypes.oneOf([null])]).description(\n 'popperjs DOM referenceElement',\n ).isRequired,\n /**\n * Wheter or not to show the popper content\n */\n showPopover: PropTypes.bool.description('whether or not to show the popper content').isRequired,\n /**\n * Callback to close the context menu, used for \"on click outside\",\n * if not provided click outside will not trigger anything\n */\n closeContextMenu: PropTypes.func\n .description(\n 'Callback to close the context menu, used for \"on click outside\",' +\n ' if not provided click outside will not trigger anything',\n )\n .defaultValue('() => {}'),\n /**\n * Wheter or not the popper content should appear in a DOM portal or not\n */\n withoutPortal: PropTypes.bool\n .description('Whether or not the popper content should appear in a DOM portal or not')\n .defaultValue(true),\n /**\n * Wheter or not the popper context menu should print the arrow\n */\n withoutArrow: PropTypes.bool\n .description('Whether or not the popper context menu should print the arrow')\n .defaultValue(false),\n /**\n * Whether or not the popper context menu should be animated\n */\n withoutAnimation: PropTypes.bool\n .description('Whether or not the popper context menu should be animated')\n .defaultValue(false),\n /**\n * Popper context menus Animation duration in ms\n */\n animationDuration: PropTypes.number.description('Popper context menus Animation duration in ms').defaultValue(100),\n /**\n * Bounding element to calculate upon, defaults to it is \"clippingParents\",\n * which are the scrolling containers that may cause the element to be partially or fully cut off.\n */\n boundaryElement: PropTypes.oneOfType([PropTypes.instanceOf(Element), PropTypes.oneOf([null])])\n .description(\n 'Bounding element to calculate upon, defaults to \"clippingParents\",' +\n 'which are the scrolling containers that may cause element to be partially or fully cut off',\n )\n .defaultValue(undefined),\n /**\n * When using portal, the container in which to append the DOM content, defaults to document body\n */\n portalDOMContainer: PropTypes.oneOfType([PropTypes.instanceOf(Element), PropTypes.oneOf([null])])\n .description('When using portal, the container in which to append the DOM content, defaults to document body')\n .defaultValue(undefined),\n /**\n * start placement preferences, as per popperjs placement option\n */\n startPlacementPreference: PropTypes.oneOf([\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n ])\n .description('start placement preferences, as per popperjs placement option')\n .defaultValue(\"'top'\"),\n /**\n * Array of placement preferences, as per popperjs \"flip\" placement option\n */\n placementOrderPreference: PropTypes.arrayOf(\n PropTypes.oneOf([\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n ]),\n )\n .description('Array of placement preferences, as per popperjs \"flip\" placement option')\n .defaultValue(\"['top', 'bottom', 'left', 'right']\"),\n /**\n * popperjs content z-index\n */\n zIndex: PropTypes.number.description('popperjs content z-index').defaultValue(1),\n /**\n * placement offset array\n */\n customOffset: PropTypes.arrayOf(PropTypes.number).description('placement offset array').defaultValue(1),\n /**\n * modifiers array for full-custom popper-js override\n * https://popper.js.org/docs/v2/modifiers/\n */\n modifiers: PropTypes.array\n .description('modifiers array for full-custom popper-js override, https://popper.js.org/docs/v2/modifiers/')\n .defaultValue(1),\n extraPopperStyles: PropTypes.object\n .description('Extra object styles to attach to the popper element')\n .defaultValue({}),\n onClickOutside: PropTypes.func\n .description('Callback triggered when clicking outside the popper')\n .defaultValue(() => null),\n children: PropTypes.node.description('The content of the popper').defaultValue(undefined),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAAuE;AAoDhE,MAAM,sBAAsB;AAAA,EACjC,GAAG;AAAA,EACH,GAAG;AAAA,EAIH,kBAAkB,kCAAU,UAAU,CAAC,kCAAU,WAAW,OAAO,GAAG,kCAAU,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;AAAA,IAC9F;AAAA,EACF,EAAE;AAAA,EAIF,aAAa,kCAAU,KAAK,YAAY,2CAA2C,EAAE;AAAA,EAKrF,kBAAkB,kCAAU,KACzB;AAAA,IACC;AAAA,EAEF,EACC,aAAa,UAAU;AAAA,EAI1B,eAAe,kCAAU,KACtB,YAAY,wEAAwE,EACpF,aAAa,IAAI;AAAA,EAIpB,cAAc,kCAAU,KACrB,YAAY,+DAA+D,EAC3E,aAAa,KAAK;AAAA,EAIrB,kBAAkB,kCAAU,KACzB,YAAY,2DAA2D,EACvE,aAAa,KAAK;AAAA,EAIrB,mBAAmB,kCAAU,OAAO,YAAY,+CAA+C,EAAE,aAAa,GAAG;AAAA,EAKjH,iBAAiB,kCAAU,UAAU,CAAC,kCAAU,WAAW,OAAO,GAAG,kCAAU,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAC1F;AAAA,IACC;AAAA,EAEF,EACC,aAAa,MAAS;AAAA,EAIzB,oBAAoB,kCAAU,UAAU,CAAC,kCAAU,WAAW,OAAO,GAAG,kCAAU,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAC7F,YAAY,gGAAgG,EAC5G,aAAa,MAAS;AAAA,EAIzB,0BAA0B,kCAAU,MAAM;AAAA,IACxC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC,EACE,YAAY,+DAA+D,EAC3E,aAAa,OAAO;AAAA,EAIvB,0BAA0B,kCAAU;AAAA,IAClC,kCAAU,MAAM;AAAA,MACd;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH,EACG,YAAY,yEAAyE,EACrF,aAAa,oCAAoC;AAAA,EAIpD,QAAQ,kCAAU,OAAO,YAAY,0BAA0B,EAAE,aAAa,CAAC;AAAA,EAI/E,cAAc,kCAAU,QAAQ,kCAAU,MAAM,EAAE,YAAY,wBAAwB,EAAE,aAAa,CAAC;AAAA,EAKtG,WAAW,kCAAU,MAClB,YAAY,8FAA8F,EAC1G,aAAa,CAAC;AAAA,EACjB,mBAAmB,kCAAU,OAC1B,YAAY,qDAAqD,EACjE,aAAa,CAAC,CAAC;AAAA,EAClB,gBAAgB,kCAAU,KACvB,YAAY,qDAAqD,EACjE,aAAa,MAAM,IAAI;AAAA,EAC1B,UAAU,kCAAU,KAAK,YAAY,2BAA2B,EAAE,aAAa,MAAS;AAC1F;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useMemo } from "react";
|
|
4
|
-
import { PopoverArrow } from "./PopoverArrow";
|
|
5
|
-
import { StyledPopoverContentWrapper, StyledAnimatedPopper } from "./styled";
|
|
4
|
+
import { PopoverArrow } from "./PopoverArrow.js";
|
|
5
|
+
import { StyledPopoverContentWrapper, StyledAnimatedPopper } from "./styled.js";
|
|
6
6
|
const PopoverContent = ({
|
|
7
7
|
setPopperElement,
|
|
8
8
|
popperStyles,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/PopoverContent.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useMemo } from 'react';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useMemo } from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { PopoverArrow } from './PopoverArrow.js';\nimport { StyledPopoverContentWrapper, StyledAnimatedPopper } from './styled.js';\n\nexport interface PopoverContentPropsT {\n setPopperElement: React.Dispatch<React.SetStateAction<HTMLDivElement | null>>;\n popperStyles: React.CSSProperties;\n arrowStyle: React.CSSProperties;\n popperAttributes: Record<string, string> | undefined;\n children: JSX.Element | JSX.Element[];\n setArrowElement: React.Dispatch<React.SetStateAction<HTMLDivElement | null>>;\n withoutArrow: boolean;\n withoutAnimation: boolean;\n animationDuration: number;\n zIndex: number;\n showPopover: boolean;\n setIsAnimating: React.Dispatch<React.SetStateAction<boolean>>;\n globalAttrs: GlobalAttributesT;\n xStyledAttrs: XstyledProps;\n}\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 globalAttrs,\n xStyledAttrs,\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\n ref={setPopperElement}\n style={popperStyles}\n {...popperAttributes}\n {...globalAttrs}\n {...xStyledAttrs}\n zIndex={zIndex}\n >\n <StyledAnimatedPopper\n showPopover={showPopover}\n animationDuration={animationDuration}\n withoutAnimation={withoutAnimation}\n onAnimationEnd={checkAnimationStatus}\n >\n {popperContent}\n </StyledAnimatedPopper>\n </StyledPopoverContentWrapper>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACkDb,mBACE,KADF;AAlDV,SAAgB,aAAa,eAAe;AAG5C,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B,4BAA4B;AAmB3D,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,EACA;AAAA,EACA;AACF,MAAyC;AACvC,QAAM,uBAAuB,YAAY,MAAM;AAC7C,QAAI,CAAC,eAAe,CAAC,kBAAkB;AACrC,qBAAe,KAAK;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,aAAa,kBAAkB,cAAc,CAAC;AAElD,QAAM,gBAAgB;AAAA,IACpB,MACE,iCACG;AAAA;AAAA,MACA,iBAAiB,QAChB,iCACE;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,iBAAiB;AAAA,YACjB,OAAO;AAAA,YACP,WAAW,mBAAmB,iBAAiB,2BAA2B;AAAA;AAAA,QAC5E;AAAA,QACA,oBAAC,SAAI,KAAK,iBAAiB,OAAO,YAAY;AAAA,SAChD,IACE;AAAA,OACN;AAAA,IAEF,CAAC,UAAU,cAAc,YAAY,kBAAkB,eAAe;AAAA,EACxE;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,OAAO;AAAA,MACN,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA,gBAAgB;AAAA,UAEf;AAAA;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useMemo, useState, useEffect } from "react";
|
|
3
3
|
import { usePopper } from "react-popper";
|
|
4
|
-
import { useGetGlobalAttributes, useGetXstyledProps } from "@elliemae/ds-
|
|
5
|
-
import { useConfiguredMergedProps } from "./useConfiguredMergedProps";
|
|
6
|
-
import { useOnClickOutside } from "../utils/hooks/useOnClickOutside";
|
|
4
|
+
import { useGetGlobalAttributes, useGetXstyledProps } from "@elliemae/ds-props-helpers";
|
|
5
|
+
import { useConfiguredMergedProps } from "./useConfiguredMergedProps.js";
|
|
6
|
+
import { useOnClickOutside } from "../utils/hooks/useOnClickOutside.js";
|
|
7
7
|
const useConfigDSPopperjs = (appProps) => {
|
|
8
8
|
const [popperElement, setPopperElement] = useState(null);
|
|
9
9
|
const [arrowElement, setArrowElement] = useState(null);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useConfigDSPopperjs.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo, useState, useEffect } from 'react';\nimport { usePopper } from 'react-popper';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,SAAS,UAAU,iBAAiB;AAC7C,SAAS,iBAAiB;AAC1B,SAAS,wBAAwB,0BAA0B;AAC3D,SAAS,gCAAgC;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo, useState, useEffect } from 'react';\nimport { usePopper } from 'react-popper';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport { useConfiguredMergedProps } from './useConfiguredMergedProps.js';\nimport type { UseDSPopperjsPropsArgT, UseDSPopperjsRT } from '../react-desc-prop-types.js';\nimport { useOnClickOutside } from '../utils/hooks/useOnClickOutside.js';\n\nexport const useConfigDSPopperjs = (appProps: UseDSPopperjsPropsArgT): UseDSPopperjsRT => {\n const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null);\n const [arrowElement, setArrowElement] = useState<HTMLDivElement | null>(null);\n const [isAnimating, setIsAnimating] = useState(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 as Node, (e) => {\n if (!referenceElement?.contains?.(e?.target as Node)) {\n onClickOutside(e);\n closeContextMenu();\n }\n });\n\n const globalAttrs = useGetGlobalAttributes(props);\n const xStyledAttrs = useGetXstyledProps(props);\n\n return useMemo(\n () => ({\n props,\n popperElement,\n setPopperElement,\n arrowElement,\n setArrowElement,\n popoverHelper,\n isAnimating,\n setIsAnimating,\n globalAttrs,\n xStyledAttrs,\n }),\n [props, popperElement, arrowElement, popoverHelper, isAnimating, globalAttrs, xStyledAttrs],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,SAAS,UAAU,iBAAiB;AAC7C,SAAS,iBAAiB;AAC1B,SAAS,wBAAwB,0BAA0B;AAC3D,SAAS,gCAAgC;AAEzC,SAAS,yBAAyB;AAE3B,MAAM,sBAAsB,CAAC,aAAsD;AACxF,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAgC,IAAI;AAC9E,QAAM,CAAC,cAAc,eAAe,IAAI,SAAgC,IAAI;AAC5E,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,KAAK;AAEpD,QAAM,QAAQ,yBAAyB,EAAE,OAAO,UAAU,aAAa,CAAC;AACxE,QAAM,EAAE,kBAAkB,kBAAkB,gBAAgB,WAAW,yBAAyB,IAAI;AACpG,QAAM,kBAAkB;AAAA,IACtB,OAAO,EAAE,WAAW,0BAA0B,UAAU;AAAA,IACxD,CAAC,WAAW,wBAAwB;AAAA,EACtC;AAEA,QAAM,gBAAgB,UAAU,kBAAkB,eAAe,eAAe;AAEhF,QAAM,EAAE,aAAa,iBAAiB,IAAI;AAE1C,YAAU,MAAM;AACd,QAAI,eAAe,CAAC,kBAAkB;AACpC,qBAAe,IAAI;AAAA,IACrB;AAAA,EACF,GAAG,CAAC,aAAa,gBAAgB,CAAC;AAElC,oBAAkB,eAAuB,CAAC,MAAM;AAC9C,QAAI,CAAC,kBAAkB,WAAW,GAAG,MAAc,GAAG;AACpD,qBAAe,CAAC;AAChB,uBAAiB;AAAA,IACnB;AAAA,EACF,CAAC;AAED,QAAM,cAAc,uBAAuB,KAAK;AAChD,QAAM,eAAe,mBAAmB,KAAK;AAE7C,SAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,OAAO,eAAe,cAAc,eAAe,aAAa,aAAa,YAAY;AAAA,EAC5F;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useConfiguredDefaultModifiers.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo } from 'react';\nimport type { UseDSPopperjsPropsArgT } from '../react-desc-prop-types';\n\ninterface UseConfiguredDefaultModifiersT {\n props: UseDSPopperjsPropsArgT;\n arrowElement: HTMLDivElement | null;\n}\n\nexport const useConfiguredDefaultModifiers = ({ props, arrowElement }: UseConfiguredDefaultModifiersT) => {\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"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo } from 'react';\nimport type { UseDSPopperjsPropsArgT } from '../react-desc-prop-types.js';\n\ninterface UseConfiguredDefaultModifiersT {\n props: UseDSPopperjsPropsArgT;\n arrowElement: HTMLDivElement | null;\n}\n\nexport const useConfiguredDefaultModifiers = ({ props, arrowElement }: UseConfiguredDefaultModifiersT) => {\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"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,eAAe;AAQjB,MAAM,gCAAgC,CAAC,EAAE,OAAO,aAAa,MAAsC;AAExG,QAAM;AAAA,IACJ,iBAAiB;AAAA,IACjB,cAAc,0BAA0B;AAAA,IACxC,0BAA0B,mCAAmC,CAAC,OAAO,UAAU,QAAQ,OAAO;AAAA,IAC9F,cAAc,mBAAmB;AAAA,EACnC,IAAI;AAEJ,QAAM,mBAAmB,QAAQ,MAAM;AACrC,UAAM,MAAM,CAAC;AACb,QAAI,KAAK,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AACxC,QAAI,KAAK;AAAA,MACP,MAAM;AAAA,MACN,SAAS;AAAA,QACP,oBAAoB;AAAA,MACtB;AAAA,IACF,CAAC;AAED,QAAI,CAAC,2BAA2B,kBAAkB;AAChD,YAAM,gBAAgB,oBAAoB,CAAC,GAAG,EAAE;AAChD,UAAI,KAAK;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,QACT,SAAS;AAAA,UACP,QAAQ;AAAA,QACV;AAAA,MACF,CAAC;AAAA,IACH;AAEA,QAAI,CAAC;AACH,UAAI,KAAK;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,UACP,SAAS;AAAA,UACT,SAAS;AAAA,QACX;AAAA,MACF,CAAC;AAGH,QAAI;AACF,UAAI,KAAK;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,UACP,UAAU;AAAA,QACZ;AAAA,MACF,CAAC;AACH,WAAO;AAAA,EACT,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,EAAE,WAAW,uBAAuB,iBAAiB,IAAI;AAE/D,SAAO;AAAA,IACL,OAAO;AAAA,MACL,WAAW;AAAA,IACb;AAAA,IACA,CAAC,oBAAoB;AAAA,EACvB;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
-
import { useConfiguredDefaultModifiers } from "./useConfiguredDefaultModifiers";
|
|
3
|
+
import { useConfiguredDefaultModifiers } from "./useConfiguredDefaultModifiers.js";
|
|
4
4
|
const noop = () => {
|
|
5
5
|
};
|
|
6
6
|
const emptyObj = {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useConfiguredDefaultProps.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo } from 'react';\nimport { useConfiguredDefaultModifiers } from './useConfiguredDefaultModifiers';\nimport type { UseDSPopperjsPropsArgT } from '../react-desc-prop-types';\n\nconst noop = () => {};\n\nconst emptyObj = {};\n\ninterface UseConfiguredDefaultPropsT {\n props: UseDSPopperjsPropsArgT;\n arrowElement: HTMLDivElement | null;\n}\n\nexport const useConfiguredDefaultProps = ({ props, arrowElement }: Required<UseConfiguredDefaultPropsT>) => {\n // don't move this out of the hook or `document.body` will explode\n const staticDefaultProps: UseDSPopperjsPropsArgT = 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 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"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo } from 'react';\nimport { useConfiguredDefaultModifiers } from './useConfiguredDefaultModifiers.js';\nimport type { UseDSPopperjsPropsArgT } from '../react-desc-prop-types.js';\n\nconst noop = () => {};\n\nconst emptyObj = {};\n\ninterface UseConfiguredDefaultPropsT {\n props: UseDSPopperjsPropsArgT;\n arrowElement: HTMLDivElement | null;\n}\n\nexport const useConfiguredDefaultProps = ({ props, arrowElement }: Required<UseConfiguredDefaultPropsT>) => {\n // don't move this out of the hook or `document.body` will explode\n const staticDefaultProps: UseDSPopperjsPropsArgT = 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 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"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,eAAe;AACxB,SAAS,qCAAqC;AAG9C,MAAM,OAAO,MAAM;AAAC;AAEpB,MAAM,WAAW,CAAC;AAOX,MAAM,4BAA4B,CAAC,EAAE,OAAO,aAAa,MAA4C;AAE1G,QAAM,qBAA6C;AAAA,IACjD,OAAO;AAAA,MACL,kBAAkB;AAAA,MAClB,aAAa;AAAA,MACb,kBAAkB;AAAA,MAClB,gBAAgB;AAAA,MAChB,eAAe;AAAA,MACf,cAAc;AAAA,MACd,kBAAkB;AAAA,MAClB,mBAAmB;AAAA,MACnB,oBAAoB,SAAS;AAAA,MAC7B,0BAA0B;AAAA,MAC1B,0BAA0B,CAAC,OAAO,UAAU,QAAQ,OAAO;AAAA,MAC3D,mBAAmB;AAAA,IACrB;AAAA,IACA,CAAC;AAAA,EACH;AACA,QAAM,EAAE,WAAW,oBAAoB,IAAI,8BAA8B;AAAA,IACvE;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,eAAe;AAAA,IACnB,OAAO,EAAE,GAAG,oBAAoB,WAAW,oBAAoB;AAAA,IAC/D,CAAC,qBAAqB,kBAAkB;AAAA,EAC1C;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { useMemoMergePropsWithDefault } from "@elliemae/ds-
|
|
3
|
-
import { useConfiguredDefaultProps } from "./useConfiguredDefaultProps";
|
|
2
|
+
import { useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
|
|
3
|
+
import { useConfiguredDefaultProps } from "./useConfiguredDefaultProps.js";
|
|
4
4
|
const useConfiguredMergedProps = ({ props, arrowElement }) => {
|
|
5
5
|
const defaultProps = useConfiguredDefaultProps({ props, arrowElement });
|
|
6
6
|
return useMemoMergePropsWithDefault(props, defaultProps);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useConfiguredMergedProps.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemoMergePropsWithDefault } from '@elliemae/ds-
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { useConfiguredDefaultProps } from './useConfiguredDefaultProps.js';\nimport type { UseDSPopperjsPropsArgT } from '../react-desc-prop-types.js';\n\ninterface UseConfiguredMergedPropsT {\n props: UseDSPopperjsPropsArgT;\n arrowElement: HTMLDivElement | null;\n}\n\nexport const useConfiguredMergedProps = ({ props, arrowElement }: UseConfiguredMergedPropsT) => {\n const defaultProps = useConfiguredDefaultProps({ props, arrowElement });\n\n return useMemoMergePropsWithDefault<Required<UseDSPopperjsPropsArgT>>(props, defaultProps);\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,oCAAoC;AAC7C,SAAS,iCAAiC;AAQnC,MAAM,2BAA2B,CAAC,EAAE,OAAO,aAAa,MAAiC;AAC9F,QAAM,eAAe,0BAA0B,EAAE,OAAO,aAAa,CAAC;AAEtE,SAAO,6BAA+D,OAAO,YAAY;AAC3F;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -2,10 +2,10 @@ import * as React from "react";
|
|
|
2
2
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { createPortal } from "react-dom";
|
|
5
|
-
import { describe } from "@elliemae/ds-
|
|
6
|
-
import { PopoverContent } from "./PopoverContent";
|
|
7
|
-
import { useConfigDSPopperjs } from "./config/useConfigDSPopperjs";
|
|
8
|
-
import { dspopperjsPropTypes } from "./react-desc-prop-types";
|
|
5
|
+
import { describe } from "@elliemae/ds-props-helpers";
|
|
6
|
+
import { PopoverContent } from "./PopoverContent.js";
|
|
7
|
+
import { useConfigDSPopperjs } from "./config/useConfigDSPopperjs.js";
|
|
8
|
+
import { dspopperjsPropTypes } from "./react-desc-prop-types.js";
|
|
9
9
|
const DSPopperJS = (props) => {
|
|
10
10
|
const {
|
|
11
11
|
props: {
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo } from 'react';\nimport { createPortal } from 'react-dom';\nimport { describe } from '@elliemae/ds-
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo } from 'react';\nimport { createPortal } from 'react-dom';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { PopoverContent } from './PopoverContent.js';\nimport { useConfigDSPopperjs } from './config/useConfigDSPopperjs.js';\nimport type { DSDSPopperjsPropsT } from './react-desc-prop-types.js';\nimport { dspopperjsPropTypes } from './react-desc-prop-types.js';\n\nconst DSPopperJS: React.ComponentType<DSDSPopperjsPropsT> = (props) => {\n const {\n props: {\n showPopover,\n withoutAnimation,\n animationDuration,\n withoutPortal,\n withoutArrow,\n portalDOMContainer,\n zIndex,\n extraPopperStyles,\n },\n globalAttrs,\n xStyledAttrs,\n setPopperElement,\n setArrowElement,\n setIsAnimating,\n popoverHelper,\n isAnimating,\n } = useConfigDSPopperjs(props);\n const { children } = props;\n const { styles, attributes } = popoverHelper;\n const contentJSX = useMemo(\n () => (\n <PopoverContent\n setPopperElement={setPopperElement}\n popperStyles={{ ...styles.popper, ...extraPopperStyles }}\n popperAttributes={attributes.popper}\n setArrowElement={setArrowElement}\n arrowStyle={styles.arrow}\n withoutArrow={withoutArrow}\n withoutAnimation={withoutAnimation}\n animationDuration={animationDuration}\n zIndex={zIndex}\n showPopover={showPopover}\n setIsAnimating={setIsAnimating}\n globalAttrs={globalAttrs}\n xStyledAttrs={xStyledAttrs}\n >\n {children}\n </PopoverContent>\n ),\n [\n attributes.popper,\n children,\n setIsAnimating,\n showPopover,\n extraPopperStyles,\n setArrowElement,\n setPopperElement,\n styles.arrow,\n styles.popper,\n withoutArrow,\n withoutAnimation,\n animationDuration,\n zIndex,\n globalAttrs,\n xStyledAttrs,\n ],\n );\n if (showPopover || isAnimating) {\n if (withoutPortal === true) return contentJSX;\n if (withoutPortal === false) return <>{createPortal(contentJSX, portalDOMContainer)}</>;\n }\n return null;\n};\n\nDSPopperJS.propTypes = dspopperjsPropTypes;\nDSPopperJS.displayName = 'DSPopperJS';\nconst DSPopperJSWithSchema = describe(DSPopperJS).description('A dimsum custom styling wrapper on top of popperjs');\nDSPopperJSWithSchema.propTypes = dspopperjsPropTypes;\n\nexport { DSPopperJS, DSPopperJSWithSchema };\nexport default DSPopperJS;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACgCjB,SAsCkC,UAtClC;AAhCN,SAAgB,eAAe;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAC/B,SAAS,2BAA2B;AAEpC,SAAS,2BAA2B;AAEpC,MAAM,aAAsD,CAAC,UAAU;AACrE,QAAM;AAAA,IACJ,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,oBAAoB,KAAK;AAC7B,QAAM,EAAE,SAAS,IAAI;AACrB,QAAM,EAAE,QAAQ,WAAW,IAAI;AAC/B,QAAM,aAAa;AAAA,IACjB,MACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,cAAc,EAAE,GAAG,OAAO,QAAQ,GAAG,kBAAkB;AAAA,QACvD,kBAAkB,WAAW;AAAA,QAC7B;AAAA,QACA,YAAY,OAAO;AAAA,QACnB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,IAEF;AAAA,MACE,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACA,MAAI,eAAe,aAAa;AAC9B,QAAI,kBAAkB;AAAM,aAAO;AACnC,QAAI,kBAAkB;AAAO,aAAO,gCAAG,uBAAa,YAAY,kBAAkB,GAAE;AAAA,EACtF;AACA,SAAO;AACT;AAEA,WAAW,YAAY;AACvB,WAAW,cAAc;AACzB,MAAM,uBAAuB,SAAS,UAAU,EAAE,YAAY,oDAAoD;AAClH,qBAAqB,YAAY;AAGjC,IAAO,cAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { globalAttributesPropTypes, PropTypes, xstyledPropTypes } from "@elliemae/ds-
|
|
2
|
+
import { globalAttributesPropTypes, PropTypes, xstyledPropTypes } from "@elliemae/ds-props-helpers";
|
|
3
3
|
const dspopperjsPropTypes = {
|
|
4
4
|
...globalAttributesPropTypes,
|
|
5
5
|
...xstyledPropTypes,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport type { WeakValidationMap } from 'react';\nimport { globalAttributesPropTypes, PropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,2BAA2B,WAAW,wBAAwB;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport type { WeakValidationMap } from 'react';\nimport { globalAttributesPropTypes, PropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport type { usePopper } from 'react-popper';\n\nexport type PopperPlacementsT =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'right-start'\n | 'right'\n | 'right-end'\n | 'bottom-end'\n | 'bottom'\n | 'bottom-start'\n | 'left-end'\n | 'left'\n | 'left-start';\nexport interface UseDSPopperjsPropsArgT {\n referenceElement: HTMLElement | null;\n showPopover: boolean;\n closeContextMenu?: () => void;\n onClickOutside?: (e: MouseEvent | TouchEvent) => void;\n withoutPortal?: boolean;\n withoutArrow?: boolean;\n withoutAnimation?: boolean;\n animationDuration?: number;\n boundaryElement?: HTMLElement;\n portalDOMContainer?: HTMLElement;\n placementOrderPreference?: PopperPlacementsT[];\n startPlacementPreference?: PopperPlacementsT;\n modifiers?: Record<string, unknown>[];\n customOffset?: [number, number];\n zIndex?: number;\n extraPopperStyles?: Record<string, unknown>;\n}\nexport interface UseDSPopperjsRT {\n props: Required<UseDSPopperjsPropsArgT>;\n popperElement: HTMLDivElement | null;\n setIsAnimating: React.Dispatch<React.SetStateAction<boolean>>;\n isAnimating: boolean;\n setPopperElement: React.Dispatch<React.SetStateAction<HTMLDivElement | null>>;\n arrowElement: HTMLDivElement | null;\n setArrowElement: React.Dispatch<React.SetStateAction<HTMLDivElement | null>>;\n popoverHelper: ReturnType<typeof usePopper>;\n globalAttrs: GlobalAttributesT<Element>;\n xStyledAttrs: XstyledProps;\n}\nexport interface DSDSPopperjsPropsT extends UseDSPopperjsPropsArgT {\n children: JSX.Element | JSX.Element[];\n}\n\nexport const dspopperjsPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n /**\n * React ref to popperjs referenceElement\n */\n referenceElement: PropTypes.oneOfType([PropTypes.instanceOf(Element), PropTypes.oneOf([null])]).description(\n 'popperjs DOM referenceElement',\n ).isRequired,\n /**\n * Wheter or not to show the popper content\n */\n showPopover: PropTypes.bool.description('whether or not to show the popper content').isRequired,\n /**\n * Callback to close the context menu, used for \"on click outside\",\n * if not provided click outside will not trigger anything\n */\n closeContextMenu: PropTypes.func\n .description(\n 'Callback to close the context menu, used for \"on click outside\",' +\n ' if not provided click outside will not trigger anything',\n )\n .defaultValue('() => {}'),\n /**\n * Wheter or not the popper content should appear in a DOM portal or not\n */\n withoutPortal: PropTypes.bool\n .description('Whether or not the popper content should appear in a DOM portal or not')\n .defaultValue(true),\n /**\n * Wheter or not the popper context menu should print the arrow\n */\n withoutArrow: PropTypes.bool\n .description('Whether or not the popper context menu should print the arrow')\n .defaultValue(false),\n /**\n * Whether or not the popper context menu should be animated\n */\n withoutAnimation: PropTypes.bool\n .description('Whether or not the popper context menu should be animated')\n .defaultValue(false),\n /**\n * Popper context menus Animation duration in ms\n */\n animationDuration: PropTypes.number.description('Popper context menus Animation duration in ms').defaultValue(100),\n /**\n * Bounding element to calculate upon, defaults to it is \"clippingParents\",\n * which are the scrolling containers that may cause the element to be partially or fully cut off.\n */\n boundaryElement: PropTypes.oneOfType([PropTypes.instanceOf(Element), PropTypes.oneOf([null])])\n .description(\n 'Bounding element to calculate upon, defaults to \"clippingParents\",' +\n 'which are the scrolling containers that may cause element to be partially or fully cut off',\n )\n .defaultValue(undefined),\n /**\n * When using portal, the container in which to append the DOM content, defaults to document body\n */\n portalDOMContainer: PropTypes.oneOfType([PropTypes.instanceOf(Element), PropTypes.oneOf([null])])\n .description('When using portal, the container in which to append the DOM content, defaults to document body')\n .defaultValue(undefined),\n /**\n * start placement preferences, as per popperjs placement option\n */\n startPlacementPreference: PropTypes.oneOf([\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n ])\n .description('start placement preferences, as per popperjs placement option')\n .defaultValue(\"'top'\"),\n /**\n * Array of placement preferences, as per popperjs \"flip\" placement option\n */\n placementOrderPreference: PropTypes.arrayOf(\n PropTypes.oneOf([\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n ]),\n )\n .description('Array of placement preferences, as per popperjs \"flip\" placement option')\n .defaultValue(\"['top', 'bottom', 'left', 'right']\"),\n /**\n * popperjs content z-index\n */\n zIndex: PropTypes.number.description('popperjs content z-index').defaultValue(1),\n /**\n * placement offset array\n */\n customOffset: PropTypes.arrayOf(PropTypes.number).description('placement offset array').defaultValue(1),\n /**\n * modifiers array for full-custom popper-js override\n * https://popper.js.org/docs/v2/modifiers/\n */\n modifiers: PropTypes.array\n .description('modifiers array for full-custom popper-js override, https://popper.js.org/docs/v2/modifiers/')\n .defaultValue(1),\n extraPopperStyles: PropTypes.object\n .description('Extra object styles to attach to the popper element')\n .defaultValue({}),\n onClickOutside: PropTypes.func\n .description('Callback triggered when clicking outside the popper')\n .defaultValue(() => null),\n children: PropTypes.node.description('The content of the popper').defaultValue(undefined),\n} as WeakValidationMap<unknown>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,2BAA2B,WAAW,wBAAwB;AAoDhE,MAAM,sBAAsB;AAAA,EACjC,GAAG;AAAA,EACH,GAAG;AAAA,EAIH,kBAAkB,UAAU,UAAU,CAAC,UAAU,WAAW,OAAO,GAAG,UAAU,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;AAAA,IAC9F;AAAA,EACF,EAAE;AAAA,EAIF,aAAa,UAAU,KAAK,YAAY,2CAA2C,EAAE;AAAA,EAKrF,kBAAkB,UAAU,KACzB;AAAA,IACC;AAAA,EAEF,EACC,aAAa,UAAU;AAAA,EAI1B,eAAe,UAAU,KACtB,YAAY,wEAAwE,EACpF,aAAa,IAAI;AAAA,EAIpB,cAAc,UAAU,KACrB,YAAY,+DAA+D,EAC3E,aAAa,KAAK;AAAA,EAIrB,kBAAkB,UAAU,KACzB,YAAY,2DAA2D,EACvE,aAAa,KAAK;AAAA,EAIrB,mBAAmB,UAAU,OAAO,YAAY,+CAA+C,EAAE,aAAa,GAAG;AAAA,EAKjH,iBAAiB,UAAU,UAAU,CAAC,UAAU,WAAW,OAAO,GAAG,UAAU,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAC1F;AAAA,IACC;AAAA,EAEF,EACC,aAAa,MAAS;AAAA,EAIzB,oBAAoB,UAAU,UAAU,CAAC,UAAU,WAAW,OAAO,GAAG,UAAU,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAC7F,YAAY,gGAAgG,EAC5G,aAAa,MAAS;AAAA,EAIzB,0BAA0B,UAAU,MAAM;AAAA,IACxC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC,EACE,YAAY,+DAA+D,EAC3E,aAAa,OAAO;AAAA,EAIvB,0BAA0B,UAAU;AAAA,IAClC,UAAU,MAAM;AAAA,MACd;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH,EACG,YAAY,yEAAyE,EACrF,aAAa,oCAAoC;AAAA,EAIpD,QAAQ,UAAU,OAAO,YAAY,0BAA0B,EAAE,aAAa,CAAC;AAAA,EAI/E,cAAc,UAAU,QAAQ,UAAU,MAAM,EAAE,YAAY,wBAAwB,EAAE,aAAa,CAAC;AAAA,EAKtG,WAAW,UAAU,MAClB,YAAY,8FAA8F,EAC1G,aAAa,CAAC;AAAA,EACjB,mBAAmB,UAAU,OAC1B,YAAY,qDAAqD,EACjE,aAAa,CAAC,CAAC;AAAA,EAClB,gBAAgB,UAAU,KACvB,YAAY,qDAAqD,EACjE,aAAa,MAAM,IAAI;AAAA,EAC1B,UAAU,UAAU,KAAK,YAAY,2BAA2B,EAAE,aAAa,MAAS;AAC1F;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-
|
|
2
|
+
import type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';
|
|
3
3
|
export interface PopoverContentPropsT {
|
|
4
4
|
setPopperElement: React.Dispatch<React.SetStateAction<HTMLDivElement | null>>;
|
|
5
5
|
popperStyles: React.CSSProperties;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { UseDSPopperjsPropsArgT, UseDSPopperjsRT } from '../react-desc-prop-types';
|
|
1
|
+
import type { UseDSPopperjsPropsArgT, UseDSPopperjsRT } from '../react-desc-prop-types.js';
|
|
2
2
|
export declare const useConfigDSPopperjs: (appProps: UseDSPopperjsPropsArgT) => UseDSPopperjsRT;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UseDSPopperjsPropsArgT } from '../react-desc-prop-types';
|
|
1
|
+
import type { UseDSPopperjsPropsArgT } from '../react-desc-prop-types.js';
|
|
2
2
|
interface UseConfiguredDefaultPropsT {
|
|
3
3
|
props: UseDSPopperjsPropsArgT;
|
|
4
4
|
arrowElement: HTMLDivElement | null;
|
|
@@ -15,8 +15,8 @@ export declare const useConfiguredDefaultProps: ({ props, arrowElement }: Requir
|
|
|
15
15
|
animationDuration?: number | undefined;
|
|
16
16
|
boundaryElement?: HTMLElement | undefined;
|
|
17
17
|
portalDOMContainer?: HTMLElement | undefined;
|
|
18
|
-
placementOrderPreference?: import("../react-desc-prop-types").PopperPlacementsT[] | undefined;
|
|
19
|
-
startPlacementPreference?: import("../react-desc-prop-types").PopperPlacementsT | undefined;
|
|
18
|
+
placementOrderPreference?: import("../react-desc-prop-types.js").PopperPlacementsT[] | undefined;
|
|
19
|
+
startPlacementPreference?: import("../react-desc-prop-types.js").PopperPlacementsT | undefined;
|
|
20
20
|
customOffset?: [number, number] | undefined;
|
|
21
21
|
zIndex?: number | undefined;
|
|
22
22
|
extraPopperStyles?: Record<string, unknown> | undefined;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { DSDSPopperjsPropsT } from './react-desc-prop-types';
|
|
2
|
+
import type { DSDSPopperjsPropsT } from './react-desc-prop-types.js';
|
|
3
3
|
declare const DSPopperJS: React.ComponentType<DSDSPopperjsPropsT>;
|
|
4
|
-
declare const DSPopperJSWithSchema: import("@elliemae/ds-
|
|
4
|
+
declare const DSPopperJSWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSDSPopperjsPropsT>;
|
|
5
5
|
export { DSPopperJS, DSPopperJSWithSchema };
|
|
6
6
|
export default DSPopperJS;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-
|
|
2
|
+
import type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';
|
|
3
3
|
import type { usePopper } from 'react-popper';
|
|
4
4
|
export type PopperPlacementsT = 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-end' | 'bottom' | 'bottom-start' | 'left-end' | 'left' | 'left-start';
|
|
5
5
|
export interface UseDSPopperjsPropsArgT {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-popperjs",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.16.0-next.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Popper JS Wrapper",
|
|
6
6
|
"files": [
|
|
@@ -72,8 +72,9 @@
|
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"react-popper": "~2.3.0",
|
|
75
|
-
"@elliemae/ds-
|
|
76
|
-
"@elliemae/ds-
|
|
75
|
+
"@elliemae/ds-props-helpers": "3.16.0-next.10",
|
|
76
|
+
"@elliemae/ds-system": "3.16.0-next.10",
|
|
77
|
+
"@elliemae/ds-utilities": "3.16.0-next.10"
|
|
77
78
|
},
|
|
78
79
|
"devDependencies": {
|
|
79
80
|
"styled-components": "~5.3.6"
|
|
@@ -94,7 +95,7 @@
|
|
|
94
95
|
"eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../.eslintrc.js' src/",
|
|
95
96
|
"dts": "node ../../scripts/dts.mjs",
|
|
96
97
|
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
|
|
97
|
-
"dev:build": "pnpm --filter {.}... build
|
|
98
|
+
"dev:build": "pnpm --filter {.}... build",
|
|
98
99
|
"dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
|
|
99
100
|
"checkDeps": "npx -yes ../ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
|
|
100
101
|
}
|