@elliemae/ds-floating-context 3.44.0-rc.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/DSFloatingContext.js +151 -0
- package/dist/cjs/DSFloatingContext.js.map +7 -0
- package/dist/cjs/index.js +42 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/parts/FloatingWrapper/FloatingWrapper.js +95 -0
- package/dist/cjs/parts/FloatingWrapper/FloatingWrapper.js.map +7 -0
- package/dist/cjs/parts/FloatingWrapper/config/useFloatingWrapper.js +58 -0
- package/dist/cjs/parts/FloatingWrapper/config/useFloatingWrapper.js.map +7 -0
- package/dist/cjs/parts/FloatingWrapper/config/useValidateProps.js +39 -0
- package/dist/cjs/parts/FloatingWrapper/config/useValidateProps.js.map +7 -0
- package/dist/cjs/parts/FloatingWrapper/constants/index.js +40 -0
- package/dist/cjs/parts/FloatingWrapper/constants/index.js.map +7 -0
- package/dist/cjs/parts/FloatingWrapper/index.js +37 -0
- package/dist/cjs/parts/FloatingWrapper/index.js.map +7 -0
- package/dist/cjs/parts/FloatingWrapper/react-desc-prop-types.js +63 -0
- package/dist/cjs/parts/FloatingWrapper/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/parts/FloatingWrapper/styled.js +77 -0
- package/dist/cjs/parts/FloatingWrapper/styled.js.map +7 -0
- package/dist/cjs/parts/PopoverArrow.js +114 -0
- package/dist/cjs/parts/PopoverArrow.js.map +7 -0
- package/dist/cjs/react-desc-prop-types.js +84 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/utils/computeOffsets.js +90 -0
- package/dist/cjs/utils/computeOffsets.js.map +7 -0
- package/dist/cjs/utils/computePosition.js +105 -0
- package/dist/cjs/utils/computePosition.js.map +7 -0
- package/dist/cjs/utils/detectOverflow.js +82 -0
- package/dist/cjs/utils/detectOverflow.js.map +7 -0
- package/dist/cjs/utils/getAlteredPosition.js +44 -0
- package/dist/cjs/utils/getAlteredPosition.js.map +7 -0
- package/dist/cjs/utils/getArrowOffset.js +41 -0
- package/dist/cjs/utils/getArrowOffset.js.map +7 -0
- package/dist/cjs/utils/getExpandedFallbackPlacements.js +58 -0
- package/dist/cjs/utils/getExpandedFallbackPlacements.js.map +7 -0
- package/dist/cjs/utils/getOppositePlacement.js +44 -0
- package/dist/cjs/utils/getOppositePlacement.js.map +7 -0
- package/dist/cjs/utils/getOppositeVariationPlacement.js +46 -0
- package/dist/cjs/utils/getOppositeVariationPlacement.js.map +7 -0
- package/dist/esm/DSFloatingContext.js +125 -0
- package/dist/esm/DSFloatingContext.js.map +7 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +7 -0
- package/dist/esm/parts/FloatingWrapper/FloatingWrapper.js +65 -0
- package/dist/esm/parts/FloatingWrapper/FloatingWrapper.js.map +7 -0
- package/dist/esm/parts/FloatingWrapper/config/useFloatingWrapper.js +28 -0
- package/dist/esm/parts/FloatingWrapper/config/useFloatingWrapper.js.map +7 -0
- package/dist/esm/parts/FloatingWrapper/config/useValidateProps.js +9 -0
- package/dist/esm/parts/FloatingWrapper/config/useValidateProps.js.map +7 -0
- package/dist/esm/parts/FloatingWrapper/constants/index.js +10 -0
- package/dist/esm/parts/FloatingWrapper/constants/index.js.map +7 -0
- package/dist/esm/parts/FloatingWrapper/index.js +7 -0
- package/dist/esm/parts/FloatingWrapper/index.js.map +7 -0
- package/dist/esm/parts/FloatingWrapper/react-desc-prop-types.js +38 -0
- package/dist/esm/parts/FloatingWrapper/react-desc-prop-types.js.map +7 -0
- package/dist/esm/parts/FloatingWrapper/styled.js +47 -0
- package/dist/esm/parts/FloatingWrapper/styled.js.map +7 -0
- package/dist/esm/parts/PopoverArrow.js +84 -0
- package/dist/esm/parts/PopoverArrow.js.map +7 -0
- package/dist/esm/react-desc-prop-types.js +54 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/utils/computeOffsets.js +60 -0
- package/dist/esm/utils/computeOffsets.js.map +7 -0
- package/dist/esm/utils/computePosition.js +75 -0
- package/dist/esm/utils/computePosition.js.map +7 -0
- package/dist/esm/utils/detectOverflow.js +52 -0
- package/dist/esm/utils/detectOverflow.js.map +7 -0
- package/dist/esm/utils/getAlteredPosition.js +14 -0
- package/dist/esm/utils/getAlteredPosition.js.map +7 -0
- package/dist/esm/utils/getArrowOffset.js +11 -0
- package/dist/esm/utils/getArrowOffset.js.map +7 -0
- package/dist/esm/utils/getExpandedFallbackPlacements.js +28 -0
- package/dist/esm/utils/getExpandedFallbackPlacements.js.map +7 -0
- package/dist/esm/utils/getOppositePlacement.js +14 -0
- package/dist/esm/utils/getOppositePlacement.js.map +7 -0
- package/dist/esm/utils/getOppositeVariationPlacement.js +16 -0
- package/dist/esm/utils/getOppositeVariationPlacement.js.map +7 -0
- package/dist/types/DSFloatingContext.d.ts +34 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/parts/FloatingWrapper/FloatingWrapper.d.ts +5 -0
- package/dist/types/parts/FloatingWrapper/config/useFloatingWrapper.d.ts +12 -0
- package/dist/types/parts/FloatingWrapper/config/useValidateProps.d.ts +3 -0
- package/dist/types/parts/FloatingWrapper/constants/index.d.ts +4 -0
- package/dist/types/parts/FloatingWrapper/index.d.ts +1 -0
- package/dist/types/parts/FloatingWrapper/react-desc-prop-types.d.ts +30 -0
- package/dist/types/parts/FloatingWrapper/styled.d.ts +8 -0
- package/dist/types/parts/PopoverArrow.d.ts +8 -0
- package/dist/types/react-desc-prop-types.d.ts +23 -0
- package/dist/types/utils/computeOffsets.d.ts +5 -0
- package/dist/types/utils/computePosition.d.ts +23 -0
- package/dist/types/utils/detectOverflow.d.ts +7 -0
- package/dist/types/utils/getAlteredPosition.d.ts +1 -0
- package/dist/types/utils/getArrowOffset.d.ts +7 -0
- package/dist/types/utils/getExpandedFallbackPlacements.d.ts +2 -0
- package/dist/types/utils/getOppositePlacement.d.ts +1 -0
- package/dist/types/utils/getOppositeVariationPlacement.d.ts +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var DSFloatingContext_exports = {};
|
|
30
|
+
__export(DSFloatingContext_exports, {
|
|
31
|
+
UseFloatingContextWithSchema: () => UseFloatingContextWithSchema,
|
|
32
|
+
useFloatingContext: () => useFloatingContext
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(DSFloatingContext_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_lodash = require("lodash");
|
|
38
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
39
|
+
var import_ds_hooks_headless_tooltip = require("@elliemae/ds-hooks-headless-tooltip");
|
|
40
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
41
|
+
var import_computePosition = require("./utils/computePosition.js");
|
|
42
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
43
|
+
const useFloatingContext = (props = {}) => {
|
|
44
|
+
const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultProps);
|
|
45
|
+
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.DSFloatingContextPropTypes, "FloatingContext");
|
|
46
|
+
const {
|
|
47
|
+
withoutPortal,
|
|
48
|
+
withoutAnimation,
|
|
49
|
+
portalDOMContainer,
|
|
50
|
+
animationDuration,
|
|
51
|
+
placement,
|
|
52
|
+
customOffset,
|
|
53
|
+
placementOrderPreference,
|
|
54
|
+
onOpen,
|
|
55
|
+
onClose
|
|
56
|
+
} = propsWithDefault;
|
|
57
|
+
const tooltipHelpers = (0, import_ds_hooks_headless_tooltip.useHeadlessTooltip)({ onOpen, onClose });
|
|
58
|
+
const { setReferenceElement, hideTooltip, showTooltip } = tooltipHelpers;
|
|
59
|
+
const [floatingStyles, setFloatingStyles] = (0, import_react.useState)({
|
|
60
|
+
position: "absolute",
|
|
61
|
+
zIndex: 3e3,
|
|
62
|
+
top: 0,
|
|
63
|
+
left: 0
|
|
64
|
+
});
|
|
65
|
+
const [arrowStyles, setArrowStyles] = (0, import_react.useState)({
|
|
66
|
+
style: { left: 0 },
|
|
67
|
+
placement: "top"
|
|
68
|
+
});
|
|
69
|
+
const [reference, _setReference] = import_react.default.useState(null);
|
|
70
|
+
const [floating, setFloating] = import_react.default.useState(null);
|
|
71
|
+
(0, import_react.useEffect)(() => {
|
|
72
|
+
const update = () => {
|
|
73
|
+
if (reference && floating) {
|
|
74
|
+
const { coordsStyle, finalPlacement, coordsArrow } = (0, import_computePosition.computePosition)({
|
|
75
|
+
reference,
|
|
76
|
+
floating,
|
|
77
|
+
placement,
|
|
78
|
+
placementOrderPreference,
|
|
79
|
+
customOffset,
|
|
80
|
+
withoutPortal
|
|
81
|
+
});
|
|
82
|
+
const styles = {
|
|
83
|
+
position: "absolute",
|
|
84
|
+
zIndex: 3e3,
|
|
85
|
+
top: 0,
|
|
86
|
+
left: 0,
|
|
87
|
+
...coordsStyle
|
|
88
|
+
};
|
|
89
|
+
setFloatingStyles(styles);
|
|
90
|
+
setArrowStyles({ style: coordsArrow, placement: finalPlacement });
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
update();
|
|
94
|
+
const debouncedCb = (0, import_lodash.debounce)(update, 300);
|
|
95
|
+
window.addEventListener("scroll", debouncedCb);
|
|
96
|
+
return () => {
|
|
97
|
+
window.removeEventListener("scroll", debouncedCb);
|
|
98
|
+
};
|
|
99
|
+
}, [reference, floating, placement, placementOrderPreference, customOffset, withoutPortal]);
|
|
100
|
+
const setReference = (0, import_ds_system.mergeRefs)(_setReference, setReferenceElement);
|
|
101
|
+
const refs = import_react.default.useMemo(
|
|
102
|
+
() => ({
|
|
103
|
+
setReference,
|
|
104
|
+
setFloating
|
|
105
|
+
}),
|
|
106
|
+
[setReference, setFloating]
|
|
107
|
+
);
|
|
108
|
+
const handlers = import_react.default.useMemo(
|
|
109
|
+
() => ({
|
|
110
|
+
onMouseEnter: tooltipHelpers.onMouseEnter,
|
|
111
|
+
onMouseLeave: tooltipHelpers.onMouseLeave,
|
|
112
|
+
onFocus: tooltipHelpers.onFocus,
|
|
113
|
+
onBlur: tooltipHelpers.onBlur
|
|
114
|
+
}),
|
|
115
|
+
[tooltipHelpers.onBlur, tooltipHelpers.onFocus, tooltipHelpers.onMouseEnter, tooltipHelpers.onMouseLeave]
|
|
116
|
+
);
|
|
117
|
+
return (0, import_react.useMemo)(
|
|
118
|
+
() => ({
|
|
119
|
+
refs,
|
|
120
|
+
floatingStyles,
|
|
121
|
+
handlers,
|
|
122
|
+
isOpen: tooltipHelpers.shouldShowPopover,
|
|
123
|
+
arrowStyles,
|
|
124
|
+
hideTooltip,
|
|
125
|
+
showTooltip,
|
|
126
|
+
context: {
|
|
127
|
+
withoutPortal,
|
|
128
|
+
withoutAnimation,
|
|
129
|
+
portalDOMContainer,
|
|
130
|
+
animationDuration
|
|
131
|
+
}
|
|
132
|
+
}),
|
|
133
|
+
[
|
|
134
|
+
animationDuration,
|
|
135
|
+
arrowStyles,
|
|
136
|
+
floatingStyles,
|
|
137
|
+
handlers,
|
|
138
|
+
hideTooltip,
|
|
139
|
+
portalDOMContainer,
|
|
140
|
+
refs,
|
|
141
|
+
showTooltip,
|
|
142
|
+
tooltipHelpers.shouldShowPopover,
|
|
143
|
+
withoutAnimation,
|
|
144
|
+
withoutPortal
|
|
145
|
+
]
|
|
146
|
+
);
|
|
147
|
+
};
|
|
148
|
+
useFloatingContext.displayName = "FloatingContext";
|
|
149
|
+
const UseFloatingContextWithSchema = (0, import_ds_props_helpers.describe)(useFloatingContext);
|
|
150
|
+
UseFloatingContextWithSchema.propTypes = import_react_desc_prop_types.DSFloatingContextPropTypes;
|
|
151
|
+
//# sourceMappingURL=DSFloatingContext.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSFloatingContext.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-nested-ternary */\n/* eslint-disable arrow-body-style */\n/* eslint-disable no-unused-vars */\n/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/naming-convention */\n/* eslint-disable @typescript-eslint/no-use-before-define */\nimport React, { useState, useEffect, useMemo } from 'react';\nimport { debounce } from 'lodash';\nimport {\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n describe,\n type ValidationMap,\n} from '@elliemae/ds-props-helpers';\nimport { useHeadlessTooltip } from '@elliemae/ds-hooks-headless-tooltip';\nimport { type CSSProperties } from 'styled-components';\nimport { mergeRefs } from '@elliemae/ds-system';\nimport { computePosition } from './utils/computePosition.js';\nimport type { DSHookFloatingContextT } from './react-desc-prop-types.js';\nimport { defaultProps, DSFloatingContextPropTypes } from './react-desc-prop-types.js';\n\nconst useFloatingContext = (props: DSHookFloatingContextT.Props = {}) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSHookFloatingContextT.InternalProps>(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, DSFloatingContextPropTypes, 'FloatingContext');\n\n const {\n withoutPortal,\n withoutAnimation,\n portalDOMContainer,\n animationDuration,\n placement,\n customOffset,\n placementOrderPreference,\n onOpen,\n onClose,\n } = propsWithDefault;\n\n const tooltipHelpers = useHeadlessTooltip({ onOpen, onClose });\n\n const { setReferenceElement, hideTooltip, showTooltip } = tooltipHelpers;\n const [floatingStyles, setFloatingStyles] = useState<CSSProperties>({\n position: 'absolute',\n zIndex: 3000,\n top: 0,\n left: 0,\n });\n const [arrowStyles, setArrowStyles] = useState<{ style: CSSProperties; placement: string }>({\n style: { left: 0 },\n placement: 'top',\n });\n\n const [reference, _setReference] = React.useState<Element | null>(null);\n const [floating, setFloating] = React.useState<HTMLElement | null>(null);\n useEffect(() => {\n const update = () => {\n if (reference && floating) {\n const { coordsStyle, finalPlacement, coordsArrow } = computePosition({\n reference,\n floating,\n placement,\n placementOrderPreference,\n customOffset,\n withoutPortal,\n });\n\n const styles: CSSProperties = {\n position: 'absolute',\n zIndex: 3000,\n top: 0,\n left: 0,\n ...coordsStyle,\n };\n setFloatingStyles(styles);\n setArrowStyles({ style: coordsArrow, placement: finalPlacement });\n }\n };\n\n // initial position calculation\n update();\n\n const debouncedCb = debounce(update, 300);\n\n // auto update position on scrolling\n window.addEventListener('scroll', debouncedCb);\n\n return () => {\n window.removeEventListener('scroll', debouncedCb);\n };\n }, [reference, floating, placement, placementOrderPreference, customOffset, withoutPortal]);\n\n const setReference = mergeRefs(_setReference, setReferenceElement);\n\n const refs = React.useMemo(\n () => ({\n setReference,\n setFloating,\n }),\n [setReference, setFloating],\n );\n\n const handlers = React.useMemo(\n () => ({\n onMouseEnter: tooltipHelpers.onMouseEnter,\n onMouseLeave: tooltipHelpers.onMouseLeave,\n onFocus: tooltipHelpers.onFocus,\n onBlur: tooltipHelpers.onBlur,\n }),\n [tooltipHelpers.onBlur, tooltipHelpers.onFocus, tooltipHelpers.onMouseEnter, tooltipHelpers.onMouseLeave],\n );\n\n return useMemo(\n () => ({\n refs,\n floatingStyles,\n handlers,\n isOpen: tooltipHelpers.shouldShowPopover,\n arrowStyles,\n hideTooltip,\n showTooltip,\n context: {\n withoutPortal,\n withoutAnimation,\n portalDOMContainer,\n animationDuration,\n },\n }),\n [\n animationDuration,\n arrowStyles,\n floatingStyles,\n handlers,\n hideTooltip,\n portalDOMContainer,\n refs,\n showTooltip,\n tooltipHelpers.shouldShowPopover,\n withoutAnimation,\n withoutPortal,\n ],\n );\n};\n\nuseFloatingContext.displayName = 'FloatingContext';\nconst UseFloatingContextWithSchema = describe(useFloatingContext);\nUseFloatingContextWithSchema.propTypes =\n DSFloatingContextPropTypes as unknown as ValidationMap<DSHookFloatingContextT.Props>;\n\nexport { useFloatingContext, UseFloatingContextWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADMvB,mBAAoD;AACpD,oBAAyB;AACzB,8BAKO;AACP,uCAAmC;AAEnC,uBAA0B;AAC1B,6BAAgC;AAEhC,mCAAyD;AAEzD,MAAM,qBAAqB,CAAC,QAAsC,CAAC,MAAM;AACvE,QAAM,uBAAmB,sDAAmE,OAAO,yCAAY;AAC/G,8DAA+B,kBAAkB,yDAA4B,iBAAiB;AAE9F,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,qBAAiB,qDAAmB,EAAE,QAAQ,QAAQ,CAAC;AAE7D,QAAM,EAAE,qBAAqB,aAAa,YAAY,IAAI;AAC1D,QAAM,CAAC,gBAAgB,iBAAiB,QAAI,uBAAwB;AAAA,IAClE,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,MAAM;AAAA,EACR,CAAC;AACD,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAsD;AAAA,IAC1F,OAAO,EAAE,MAAM,EAAE;AAAA,IACjB,WAAW;AAAA,EACb,CAAC;AAED,QAAM,CAAC,WAAW,aAAa,IAAI,aAAAA,QAAM,SAAyB,IAAI;AACtE,QAAM,CAAC,UAAU,WAAW,IAAI,aAAAA,QAAM,SAA6B,IAAI;AACvE,8BAAU,MAAM;AACd,UAAM,SAAS,MAAM;AACnB,UAAI,aAAa,UAAU;AACzB,cAAM,EAAE,aAAa,gBAAgB,YAAY,QAAI,wCAAgB;AAAA,UACnE;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAED,cAAM,SAAwB;AAAA,UAC5B,UAAU;AAAA,UACV,QAAQ;AAAA,UACR,KAAK;AAAA,UACL,MAAM;AAAA,UACN,GAAG;AAAA,QACL;AACA,0BAAkB,MAAM;AACxB,uBAAe,EAAE,OAAO,aAAa,WAAW,eAAe,CAAC;AAAA,MAClE;AAAA,IACF;AAGA,WAAO;AAEP,UAAM,kBAAc,wBAAS,QAAQ,GAAG;AAGxC,WAAO,iBAAiB,UAAU,WAAW;AAE7C,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU,WAAW;AAAA,IAClD;AAAA,EACF,GAAG,CAAC,WAAW,UAAU,WAAW,0BAA0B,cAAc,aAAa,CAAC;AAE1F,QAAM,mBAAe,4BAAU,eAAe,mBAAmB;AAEjE,QAAM,OAAO,aAAAA,QAAM;AAAA,IACjB,OAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,cAAc,WAAW;AAAA,EAC5B;AAEA,QAAM,WAAW,aAAAA,QAAM;AAAA,IACrB,OAAO;AAAA,MACL,cAAc,eAAe;AAAA,MAC7B,cAAc,eAAe;AAAA,MAC7B,SAAS,eAAe;AAAA,MACxB,QAAQ,eAAe;AAAA,IACzB;AAAA,IACA,CAAC,eAAe,QAAQ,eAAe,SAAS,eAAe,cAAc,eAAe,YAAY;AAAA,EAC1G;AAEA,aAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,QAAQ,eAAe;AAAA,MACvB;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS;AAAA,QACP;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,eAAe;AAAA,MACf;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AAEA,mBAAmB,cAAc;AACjC,MAAM,mCAA+B,kCAAS,kBAAkB;AAChE,6BAA6B,YAC3B;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var src_exports = {};
|
|
30
|
+
__export(src_exports, {
|
|
31
|
+
FloatingWrapper: () => import_FloatingWrapper.FloatingWrapper,
|
|
32
|
+
FloatingWrapperWithSchema: () => import_FloatingWrapper.FloatingWrapperWithSchema,
|
|
33
|
+
PopoverArrow: () => import_PopoverArrow.PopoverArrow,
|
|
34
|
+
UseFloatingContextWithSchema: () => import_DSFloatingContext.UseFloatingContextWithSchema,
|
|
35
|
+
useFloatingContext: () => import_DSFloatingContext.useFloatingContext
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(src_exports);
|
|
38
|
+
var React = __toESM(require("react"));
|
|
39
|
+
var import_DSFloatingContext = require("./DSFloatingContext.js");
|
|
40
|
+
var import_PopoverArrow = require("./parts/PopoverArrow.js");
|
|
41
|
+
var import_FloatingWrapper = require("./parts/FloatingWrapper/index.js");
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export { useFloatingContext, UseFloatingContextWithSchema } from './DSFloatingContext.js';\nexport { PopoverArrow } from './parts/PopoverArrow.js';\nexport { FloatingWrapper, FloatingWrapperWithSchema } from './parts/FloatingWrapper/index.js';\nexport type { DSHookFloatingContextT } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAiE;AACjE,0BAA6B;AAC7B,6BAA2D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var FloatingWrapper_exports = {};
|
|
30
|
+
__export(FloatingWrapper_exports, {
|
|
31
|
+
FloatingWrapper: () => FloatingWrapper,
|
|
32
|
+
FloatingWrapperWithSchema: () => FloatingWrapperWithSchema
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(FloatingWrapper_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
var import_react = require("react");
|
|
38
|
+
var import_react_dom = require("react-dom");
|
|
39
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
40
|
+
var import_styled = require("./styled.js");
|
|
41
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
42
|
+
var import_useFloatingWrapper = require("./config/useFloatingWrapper.js");
|
|
43
|
+
var import_constants = require("./constants/index.js");
|
|
44
|
+
const FloatingWrapper = (props) => {
|
|
45
|
+
const { propsWithDefault, xstyledProps } = (0, import_useFloatingWrapper.useFloatingWrapper)(props);
|
|
46
|
+
const {
|
|
47
|
+
children,
|
|
48
|
+
innerRef,
|
|
49
|
+
floatingStyles,
|
|
50
|
+
isOpen,
|
|
51
|
+
context: { portalDOMContainer, withoutPortal, animationDuration, withoutAnimation }
|
|
52
|
+
} = propsWithDefault;
|
|
53
|
+
const [isAnimating, setIsAnimating] = (0, import_react.useState)(false);
|
|
54
|
+
(0, import_react.useEffect)(() => {
|
|
55
|
+
if (isOpen && !withoutAnimation) {
|
|
56
|
+
setIsAnimating(true);
|
|
57
|
+
}
|
|
58
|
+
}, [isOpen, withoutAnimation]);
|
|
59
|
+
const checkAnimationStatus = (0, import_react.useCallback)(() => {
|
|
60
|
+
if (!isOpen && !withoutAnimation) {
|
|
61
|
+
setIsAnimating(false);
|
|
62
|
+
}
|
|
63
|
+
}, [isOpen, withoutAnimation]);
|
|
64
|
+
const contentJSX = (0, import_react.useMemo)(
|
|
65
|
+
() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledFloatingWrapper, { innerRef, style: floatingStyles, ...xstyledProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
66
|
+
import_styled.StyledFloatingAnimation,
|
|
67
|
+
{
|
|
68
|
+
onAnimationEnd: checkAnimationStatus,
|
|
69
|
+
isOpen,
|
|
70
|
+
animationDuration,
|
|
71
|
+
withoutAnimation,
|
|
72
|
+
children
|
|
73
|
+
}
|
|
74
|
+
) }),
|
|
75
|
+
[
|
|
76
|
+
animationDuration,
|
|
77
|
+
checkAnimationStatus,
|
|
78
|
+
children,
|
|
79
|
+
floatingStyles,
|
|
80
|
+
innerRef,
|
|
81
|
+
isOpen,
|
|
82
|
+
withoutAnimation,
|
|
83
|
+
xstyledProps
|
|
84
|
+
]
|
|
85
|
+
);
|
|
86
|
+
if (isOpen || isAnimating) {
|
|
87
|
+
if (withoutPortal === true) return contentJSX;
|
|
88
|
+
if (!withoutPortal) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: (0, import_react_dom.createPortal)(contentJSX, portalDOMContainer || document.body) });
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
};
|
|
92
|
+
FloatingWrapper.displayName = import_constants.DSFloatingWrapperName;
|
|
93
|
+
const FloatingWrapperWithSchema = (0, import_ds_props_helpers.describe)(FloatingWrapper);
|
|
94
|
+
FloatingWrapperWithSchema.propTypes = import_react_desc_prop_types.DSFloatingWrapperPropTypes;
|
|
95
|
+
//# sourceMappingURL=FloatingWrapper.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/FloatingWrapper/FloatingWrapper.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React, { useMemo, useState, useCallback, useEffect } from 'react';\nimport { createPortal } from 'react-dom';\nimport { describe, type ValidationMap } from '@elliemae/ds-props-helpers';\nimport { StyledFloatingAnimation, StyledFloatingWrapper } from './styled.js';\nimport { type DSFloatingWrapperT, DSFloatingWrapperPropTypes } from './react-desc-prop-types.js';\nimport { useFloatingWrapper } from './config/useFloatingWrapper.js';\nimport { DSFloatingWrapperName } from './constants/index.js';\n\nconst FloatingWrapper: React.ComponentType<DSFloatingWrapperT.Props> = (props) => {\n const { propsWithDefault, xstyledProps } = useFloatingWrapper(props);\n const {\n children,\n innerRef,\n floatingStyles,\n isOpen,\n context: { portalDOMContainer, withoutPortal, animationDuration, withoutAnimation },\n } = propsWithDefault;\n const [isAnimating, setIsAnimating] = useState(false);\n useEffect(() => {\n if (isOpen && !withoutAnimation) {\n setIsAnimating(true);\n }\n }, [isOpen, withoutAnimation]);\n\n const checkAnimationStatus = useCallback(() => {\n if (!isOpen && !withoutAnimation) {\n setIsAnimating(false);\n }\n }, [isOpen, withoutAnimation]);\n\n const contentJSX = useMemo(\n () => (\n <StyledFloatingWrapper innerRef={innerRef} style={floatingStyles} {...xstyledProps}>\n <StyledFloatingAnimation\n onAnimationEnd={checkAnimationStatus}\n isOpen={isOpen}\n animationDuration={animationDuration}\n withoutAnimation={withoutAnimation}\n >\n {children}\n </StyledFloatingAnimation>\n </StyledFloatingWrapper>\n ),\n [\n animationDuration,\n checkAnimationStatus,\n children,\n floatingStyles,\n innerRef,\n isOpen,\n withoutAnimation,\n xstyledProps,\n ],\n );\n if (isOpen || isAnimating) {\n if (withoutPortal === true) return contentJSX;\n if (!withoutPortal) return <>{createPortal(contentJSX, portalDOMContainer || document.body)}</>;\n }\n return null;\n};\n\nFloatingWrapper.displayName = DSFloatingWrapperName;\nconst FloatingWrapperWithSchema = describe(FloatingWrapper);\nFloatingWrapperWithSchema.propTypes = DSFloatingWrapperPropTypes as unknown as ValidationMap<DSFloatingWrapperT.Props>;\nexport { FloatingWrapper, FloatingWrapperWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiCf;AAjCR,mBAAiE;AACjE,uBAA6B;AAC7B,8BAA6C;AAC7C,oBAA+D;AAC/D,mCAAoE;AACpE,gCAAmC;AACnC,uBAAsC;AAEtC,MAAM,kBAAiE,CAAC,UAAU;AAChF,QAAM,EAAE,kBAAkB,aAAa,QAAI,8CAAmB,KAAK;AACnE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS,EAAE,oBAAoB,eAAe,mBAAmB,iBAAiB;AAAA,EACpF,IAAI;AACJ,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAS,KAAK;AACpD,8BAAU,MAAM;AACd,QAAI,UAAU,CAAC,kBAAkB;AAC/B,qBAAe,IAAI;AAAA,IACrB;AAAA,EACF,GAAG,CAAC,QAAQ,gBAAgB,CAAC;AAE7B,QAAM,2BAAuB,0BAAY,MAAM;AAC7C,QAAI,CAAC,UAAU,CAAC,kBAAkB;AAChC,qBAAe,KAAK;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,QAAQ,gBAAgB,CAAC;AAE7B,QAAM,iBAAa;AAAA,IACjB,MACE,4CAAC,uCAAsB,UAAoB,OAAO,gBAAiB,GAAG,cACpE;AAAA,MAAC;AAAA;AAAA,QACC,gBAAgB;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AAAA,QAEC;AAAA;AAAA,IACH,GACF;AAAA,IAEF;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACA,MAAI,UAAU,aAAa;AACzB,QAAI,kBAAkB,KAAM,QAAO;AACnC,QAAI,CAAC,cAAe,QAAO,2EAAG,6CAAa,YAAY,sBAAsB,SAAS,IAAI,GAAE;AAAA,EAC9F;AACA,SAAO;AACT;AAEA,gBAAgB,cAAc;AAC9B,MAAM,gCAA4B,kCAAS,eAAe;AAC1D,0BAA0B,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var useFloatingWrapper_exports = {};
|
|
30
|
+
__export(useFloatingWrapper_exports, {
|
|
31
|
+
useFloatingWrapper: () => useFloatingWrapper
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(useFloatingWrapper_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
37
|
+
var import_uid = require("uid");
|
|
38
|
+
var import_react_desc_prop_types = require("../react-desc-prop-types.js");
|
|
39
|
+
const useFloatingWrapper = (propsFromUser) => {
|
|
40
|
+
const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(propsFromUser, import_react_desc_prop_types.defaultProps);
|
|
41
|
+
const xstyledProps = (0, import_ds_props_helpers.useGetXstyledProps)(propsWithDefault);
|
|
42
|
+
const instanceUid = import_react.default.useMemo(() => (0, import_uid.uid)(5), []);
|
|
43
|
+
return import_react.default.useMemo(
|
|
44
|
+
() => ({
|
|
45
|
+
propsWithDefault,
|
|
46
|
+
xstyledProps,
|
|
47
|
+
instanceUid
|
|
48
|
+
// ...eventHandlers,
|
|
49
|
+
}),
|
|
50
|
+
[
|
|
51
|
+
propsWithDefault,
|
|
52
|
+
xstyledProps,
|
|
53
|
+
instanceUid
|
|
54
|
+
// eventHandlers,
|
|
55
|
+
]
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=useFloatingWrapper.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/parts/FloatingWrapper/config/useFloatingWrapper.ts", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { type DSFloatingWrapperT, defaultProps } from '../react-desc-prop-types.js';\n\nexport interface DSFloatingWrapperCTX {\n propsWithDefault: DSFloatingWrapperT.InternalProps;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useFloatingWrapper = (propsFromUser: DSFloatingWrapperT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSFloatingWrapperT.InternalProps>(propsFromUser, defaultProps);\n // useValidateProps(propsWithDefault, DSFloatingWrapperPropTypes);\n // =============================================================================\n // XSTYLED PROPS\n // =============================================================================\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n // custom code goes here, this is an example\n const instanceUid = React.useMemo(() => uid(5), []);\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n // const eventHandlers = useEventHandlers({ propsWithDefault, instanceUid }); // <-- complex logic should be made atomics this way\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n xstyledProps,\n instanceUid,\n // ...eventHandlers,\n }),\n [\n propsWithDefault,\n xstyledProps,\n instanceUid,\n // eventHandlers,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,8BAAiE;AACjE,iBAAoB;AACpB,mCAAsD;AAQ/C,MAAM,qBAAqB,CAAC,kBAA4C;AAI7E,QAAM,uBAAmB,sDAA+D,eAAe,yCAAY;AAKnH,QAAM,mBAAe,4CAAmB,gBAAgB;AAKxD,QAAM,cAAc,aAAAA,QAAM,QAAQ,UAAM,gBAAI,CAAC,GAAG,CAAC,CAAC;AAMlD,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var useValidateProps_exports = {};
|
|
30
|
+
__export(useValidateProps_exports, {
|
|
31
|
+
useValidateProps: () => useValidateProps
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(useValidateProps_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
36
|
+
const useValidateProps = (props, propTypes) => {
|
|
37
|
+
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, propTypes, "FloatingWrapper");
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/parts/FloatingWrapper/config/useValidateProps.ts", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { type DSFloatingWrapperT } from '../react-desc-prop-types.js';\n\nexport const useValidateProps = (\n props: DSFloatingWrapperT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n useValidateTypescriptPropTypes(props, propTypes, 'FloatingWrapper');\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA+C;AAIxC,MAAM,mBAAmB,CAC9B,OACA,cACS;AACT,8DAA+B,OAAO,WAAW,iBAAiB;AACpE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var constants_exports = {};
|
|
30
|
+
__export(constants_exports, {
|
|
31
|
+
DSFloatingWrapperName: () => DSFloatingWrapperName,
|
|
32
|
+
DSFloatingWrapperSlots: () => DSFloatingWrapperSlots
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(constants_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
const DSFloatingWrapperName = "DSFloatingWrapper";
|
|
37
|
+
const DSFloatingWrapperSlots = {
|
|
38
|
+
ROOT: "root"
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/parts/FloatingWrapper/constants/index.ts", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export const DSFloatingWrapperName = 'DSFloatingWrapper';\n\nexport const DSFloatingWrapperSlots = {\n ROOT: 'root',\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,wBAAwB;AAE9B,MAAM,yBAAyB;AAAA,EACpC,MAAM;AACR;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var FloatingWrapper_exports = {};
|
|
30
|
+
__export(FloatingWrapper_exports, {
|
|
31
|
+
FloatingWrapper: () => import_FloatingWrapper.FloatingWrapper,
|
|
32
|
+
FloatingWrapperWithSchema: () => import_FloatingWrapper.FloatingWrapperWithSchema
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(FloatingWrapper_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_FloatingWrapper = require("./FloatingWrapper.js");
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/FloatingWrapper/index.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export { FloatingWrapper, FloatingWrapperWithSchema } from './FloatingWrapper.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,6BAA2D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var react_desc_prop_types_exports = {};
|
|
30
|
+
__export(react_desc_prop_types_exports, {
|
|
31
|
+
DSFloatingWrapperPropTypes: () => DSFloatingWrapperPropTypes,
|
|
32
|
+
DSFloatingWrapperPropTypesSchema: () => DSFloatingWrapperPropTypesSchema,
|
|
33
|
+
defaultProps: () => defaultProps
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
|
+
var import_constants = require("./constants/index.js");
|
|
39
|
+
const defaultProps = {
|
|
40
|
+
context: {
|
|
41
|
+
portalDOMContainer: document.body,
|
|
42
|
+
withoutPortal: false,
|
|
43
|
+
animationDuration: 300,
|
|
44
|
+
withoutAnimation: false
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const DSFloatingWrapperPropTypes = {
|
|
48
|
+
...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_constants.DSFloatingWrapperName, import_constants.DSFloatingWrapperSlots),
|
|
49
|
+
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
50
|
+
...import_ds_props_helpers.xstyledPropTypes,
|
|
51
|
+
children: import_ds_props_helpers.PropTypes.node.description("Content of the floating wrapper").isRequired,
|
|
52
|
+
innerRef: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.object, import_ds_props_helpers.PropTypes.func]).description("Ref for the floating wrapper").isRequired,
|
|
53
|
+
isOpen: import_ds_props_helpers.PropTypes.bool.description("Whether the floating wrapper is open").isRequired,
|
|
54
|
+
floatingStyles: import_ds_props_helpers.PropTypes.object.description("Style for the floating wrapper").isRequired,
|
|
55
|
+
context: import_ds_props_helpers.PropTypes.shape({
|
|
56
|
+
portalDOMContainer: import_ds_props_helpers.PropTypes.instanceOf(HTMLElement).description("DOM container for the portal"),
|
|
57
|
+
withoutPortal: import_ds_props_helpers.PropTypes.bool.description("Whether to render the floating wrapper without a portal"),
|
|
58
|
+
animationDuration: import_ds_props_helpers.PropTypes.number.description("Duration of the animation"),
|
|
59
|
+
withoutAnimation: import_ds_props_helpers.PropTypes.bool.description("Whether to render the floating wrapper without animation")
|
|
60
|
+
}).description("Context for the floating wrapper")
|
|
61
|
+
};
|
|
62
|
+
const DSFloatingWrapperPropTypesSchema = DSFloatingWrapperPropTypes;
|
|
63
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/FloatingWrapper/react-desc-prop-types.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSFloatingWrapperName, DSFloatingWrapperSlots } from './constants/index.js';\n\nexport declare namespace DSFloatingWrapperT {\n export interface RequiredProps {\n children: React.ReactNode;\n innerRef: TypescriptHelpersT.AnyRef<HTMLDivElement>;\n isOpen: boolean;\n floatingStyles: React.CSSProperties;\n }\n\n export interface DefaultProps {\n context: {\n portalDOMContainer: HTMLElement;\n withoutPortal: boolean;\n animationDuration: number;\n withoutAnimation: boolean;\n };\n }\n\n export interface OptionalProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSFloatingWrapperName, typeof DSFloatingWrapperSlots> {}\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n Omit<RequiredProps, 'children'> {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n Omit<RequiredProps, 'children'> {}\n\n export type ExampleState = '0' | '1';\n}\n\nexport const defaultProps: Partial<DSFloatingWrapperT.DefaultProps> = {\n context: {\n portalDOMContainer: document.body,\n withoutPortal: false,\n animationDuration: 300,\n withoutAnimation: false,\n },\n};\n\nexport const DSFloatingWrapperPropTypes: DSPropTypesSchema<DSFloatingWrapperT.Props> = {\n ...getPropsPerSlotPropTypes(DSFloatingWrapperName, DSFloatingWrapperSlots),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n children: PropTypes.node.description('Content of the floating wrapper').isRequired,\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('Ref for the floating wrapper')\n .isRequired,\n isOpen: PropTypes.bool.description('Whether the floating wrapper is open').isRequired,\n floatingStyles: PropTypes.object.description('Style for the floating wrapper').isRequired,\n context: PropTypes.shape({\n portalDOMContainer: PropTypes.instanceOf(HTMLElement).description('DOM container for the portal'),\n withoutPortal: PropTypes.bool.description('Whether to render the floating wrapper without a portal'),\n animationDuration: PropTypes.number.description('Duration of the animation'),\n withoutAnimation: PropTypes.bool.description('Whether to render the floating wrapper without animation'),\n }).description('Context for the floating wrapper'),\n};\n\nexport const DSFloatingWrapperPropTypesSchema =\n DSFloatingWrapperPropTypes as unknown as ValidationMap<DSFloatingWrapperT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAKO;AAEP,uBAA8D;AAuCvD,MAAM,eAAyD;AAAA,EACpE,SAAS;AAAA,IACP,oBAAoB,SAAS;AAAA,IAC7B,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,EACpB;AACF;AAEO,MAAM,6BAA0E;AAAA,EACrF,OAAG,kDAAyB,wCAAuB,uCAAsB;AAAA,EACzE,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,kCAAU,KAAK,YAAY,iCAAiC,EAAE;AAAA,EACxE,UAAU,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,IAAI,CAAC,EAAE,YAAY,8BAA8B,EACzG;AAAA,EACH,QAAQ,kCAAU,KAAK,YAAY,sCAAsC,EAAE;AAAA,EAC3E,gBAAgB,kCAAU,OAAO,YAAY,gCAAgC,EAAE;AAAA,EAC/E,SAAS,kCAAU,MAAM;AAAA,IACvB,oBAAoB,kCAAU,WAAW,WAAW,EAAE,YAAY,8BAA8B;AAAA,IAChG,eAAe,kCAAU,KAAK,YAAY,yDAAyD;AAAA,IACnG,mBAAmB,kCAAU,OAAO,YAAY,2BAA2B;AAAA,IAC3E,kBAAkB,kCAAU,KAAK,YAAY,0DAA0D;AAAA,EACzG,CAAC,EAAE,YAAY,kCAAkC;AACnD;AAEO,MAAM,mCACX;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|