@elliemae/ds-modal-slide 3.16.0-next.2 → 3.16.0-next.3
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/DSModalSlide.js +11 -11
- package/dist/cjs/DSModalSlide.js.map +2 -2
- package/dist/cjs/components/Footer.js +10 -10
- package/dist/cjs/components/Footer.js.map +2 -2
- package/dist/cjs/components/Header.js +6 -6
- package/dist/cjs/components/Header.js.map +2 -2
- package/dist/esm/DSModalSlide.js +1 -1
- package/dist/esm/DSModalSlide.js.map +1 -1
- package/dist/esm/components/Footer.js +1 -1
- package/dist/esm/components/Footer.js.map +1 -1
- package/dist/esm/components/Header.js +1 -1
- package/dist/esm/components/Header.js.map +1 -1
- package/dist/types/DSModalSlide.d.ts +9 -9
- package/dist/types/components/Footer.d.ts +7 -7
- package/dist/types/components/Header.d.ts +5 -5
- package/package.json +10 -9
package/dist/cjs/DSModalSlide.js
CHANGED
|
@@ -34,7 +34,7 @@ module.exports = __toCommonJS(DSModalSlide_exports);
|
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
|
-
var
|
|
37
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
38
|
var import_lodash = require("lodash");
|
|
39
39
|
var import_react_dom = __toESM(require("react-dom"));
|
|
40
40
|
var import_ds_system = require("@elliemae/ds-system");
|
|
@@ -71,7 +71,7 @@ const DSModalSlide = (props2) => {
|
|
|
71
71
|
const [height, setHeight] = (0, import_react.useState)("100%");
|
|
72
72
|
const theme = (0, import_ds_system.useTheme)();
|
|
73
73
|
const contentRows = [...header ? ["auto", "1px"] : [], "1fr", ...footer ? ["1px", theme.space.m] : []];
|
|
74
|
-
const globalAttrs = (0,
|
|
74
|
+
const globalAttrs = (0, import_ds_props_helpers.useGetGlobalAttributes)(props2);
|
|
75
75
|
const updateShow = (0, import_react.useCallback)(() => {
|
|
76
76
|
if (fullWidth)
|
|
77
77
|
setWidth(100);
|
|
@@ -175,20 +175,20 @@ const DSModalSlide = (props2) => {
|
|
|
175
175
|
);
|
|
176
176
|
};
|
|
177
177
|
const props = {
|
|
178
|
-
centered:
|
|
179
|
-
isOpen:
|
|
180
|
-
children:
|
|
178
|
+
centered: import_ds_props_helpers.PropTypes.bool.description("If the modal slide is centered or not"),
|
|
179
|
+
isOpen: import_ds_props_helpers.PropTypes.bool.description("If the modal slide is visible or not"),
|
|
180
|
+
children: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.element, import_ds_props_helpers.PropTypes.string, import_ds_props_helpers.PropTypes.any]).isRequired.description(
|
|
181
181
|
"Main content of the modal"
|
|
182
182
|
),
|
|
183
|
-
fullWidth:
|
|
184
|
-
header:
|
|
185
|
-
fadeOut:
|
|
186
|
-
fadeIn:
|
|
187
|
-
overrideHeight:
|
|
183
|
+
fullWidth: import_ds_props_helpers.PropTypes.bool.description("If the modal slide takes the full width or not"),
|
|
184
|
+
header: import_ds_props_helpers.PropTypes.element.description("If the modal slide has a header, only available for full width option"),
|
|
185
|
+
fadeOut: import_ds_props_helpers.PropTypes.number.description("Ratio of fade out"),
|
|
186
|
+
fadeIn: import_ds_props_helpers.PropTypes.number.description("Ratio of fade in"),
|
|
187
|
+
overrideHeight: import_ds_props_helpers.PropTypes.bool.description("Override the panel height to scroll height of the container")
|
|
188
188
|
};
|
|
189
189
|
DSModalSlide.propTypes = props;
|
|
190
190
|
DSModalSlide.displayName = "DSModalSlide";
|
|
191
|
-
const DSModalSlideWithSchema = (0,
|
|
191
|
+
const DSModalSlideWithSchema = (0, import_ds_props_helpers.describe)(DSModalSlide);
|
|
192
192
|
DSModalSlideWithSchema.propTypes = props;
|
|
193
193
|
var DSModalSlide_default = DSModalSlide;
|
|
194
194
|
//# sourceMappingURL=DSModalSlide.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSModalSlide.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport React, { useState, useEffect, useCallback, useMemo } from 'react';\nimport { PropTypes, describe, useGetGlobalAttributes } from '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,mCAAAA;AAAA,EAAA,iCAAAC;AAAA,EAAA;AAAA;AAAA;ACAA,YAAuB;ADmHb;AAjHV,mBAAiE;AACjE,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport React, { useState, useEffect, useCallback, useMemo } from 'react';\nimport { PropTypes, describe, useGetGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { debounce } from 'lodash';\nimport ReactDOM from 'react-dom';\nimport { useTheme, styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport DSSeparator from '@elliemae/ds-separator';\nimport { Wrapper, Overlay, Content, ActualContent } from './components/blocks';\nimport ModalHeader from './components/Header';\nimport ModalFooter from './components/Footer';\n\nconst StyledWrapper = styled(Grid)`\n overflow: auto;\n &:focus,\n &:focus-visible {\n outline: 1px solid ${({ theme }) => theme.colors.brand['600']};\n outline-offset: -1px;\n }\n`;\n// eslint-disable-next-line complexity\nconst DSModalSlide = (props) => {\n const {\n isOpen = false,\n children,\n getContainer,\n centered = false,\n fullWidth = false,\n header = null,\n footer = null,\n fadeOut = 1500,\n fadeIn = 1500,\n overrideHeight = false,\n innerRef = null,\n } = props;\n const [isMoving, setMoving] = useState(false);\n const [show, setShow] = useState(isOpen);\n const [width, setWidth] = useState(50);\n const [height, setHeight] = useState('100%');\n const theme = useTheme();\n const contentRows = [...(header ? ['auto', '1px'] : []), '1fr', ...(footer ? ['1px', theme.space.m] : [])];\n const globalAttrs = useGetGlobalAttributes(props);\n const updateShow = useCallback(() => {\n if (fullWidth) setWidth(100);\n else setWidth(50);\n if (isOpen !== show) {\n setMoving(true);\n if (isOpen) {\n setShow(isOpen);\n }\n }\n }, [isOpen, fullWidth, isMoving]);\n\n useEffect(updateShow, [isOpen, fullWidth]);\n\n const container = getContainer();\n\n const handleHeight = useCallback(() => {\n const newHeight =\n overrideHeight && container.scrollHeight > container.getBoundingClientRect().height\n ? container.scrollHeight\n : container.getBoundingClientRect().height;\n setHeight(newHeight);\n }, [container, overrideHeight]);\n\n const onChangeParent = useMemo(() => debounce(handleHeight, 300), [handleHeight]);\n\n useEffect(() => {\n const resizeObserver = new ResizeObserver(() => onChangeParent());\n if (container) {\n resizeObserver.observe(container);\n if (!container.style.position) {\n container.style.position = 'relative';\n }\n onChangeParent();\n }\n return () => {\n if (container) resizeObserver.unobserve(container);\n };\n }, [container, onChangeParent]);\n\n if (!show) return null;\n if (!container) return null;\n\n const handleAnimationEnd = () => {\n setMoving(false);\n if (!isOpen) setShow(isOpen);\n };\n\n return ReactDOM.createPortal(\n <Wrapper\n {...globalAttrs}\n classProps={{\n show: isOpen,\n centered,\n }}\n style={{\n '--height': height,\n '--fade-in': fadeIn,\n '--fade-out': fadeOut,\n '--width': width,\n }}\n >\n <Overlay\n classProps={{\n show: isOpen,\n }}\n >\n <Content\n onAnimationEnd={handleAnimationEnd}\n classProps={{\n show: isOpen,\n }}\n >\n <Grid\n style={{\n height: '100%',\n width: '100%',\n maxHeight: '100%',\n overflow: 'hidden',\n '-webkit-backface-visibility': 'hidden',\n 'backface-visibility': 'hidden',\n '-webkit-transform-style': 'preserve-3d',\n }}\n rows={contentRows}\n data-testid=\"ds-modal-slide\"\n >\n {header && React.cloneElement(header, { fullWidth })}\n {header && <DSSeparator position=\"initial\" type=\"non-form\" />}\n <Grid style={{ overflow: 'hidden' }}>\n <StyledWrapper ref={innerRef} tabIndex={0} role=\"contentinfo\">\n <ActualContent>{children}</ActualContent>\n </StyledWrapper>\n </Grid>\n {footer && <DSSeparator position=\"initial\" type=\"non-form\" />}\n {footer}\n </Grid>\n </Content>\n </Overlay>\n </Wrapper>,\n container,\n );\n};\n\nconst props = {\n /**\n * If the modal slide is centered or not\n */\n centered: PropTypes.bool.description('If the modal slide is centered or not'),\n /**\n * If the modal slide is visible or not\n */\n isOpen: PropTypes.bool.description('If the modal slide is visible or not'),\n /**\n * Main content of the modal\n */\n children: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.any]).isRequired.description(\n 'Main content of the modal',\n ),\n /**\n * If the modal slide takes the full width or not\n */\n fullWidth: PropTypes.bool.description('If the modal slide takes the full width or not'),\n /**\n * If the modal slide has a header, only available for full width option\n */\n header: PropTypes.element.description('If the modal slide has a header, only available for full width option'),\n /**\n * Ratio of fade out\n */\n fadeOut: PropTypes.number.description('Ratio of fade out'),\n /**\n * Ratio of fade in\n */\n fadeIn: PropTypes.number.description('Ratio of fade in'),\n /**\n * Override the panel height to scroll height of the container\n */\n overrideHeight: PropTypes.bool.description('Override the panel height to scroll height of the container'),\n};\n\nDSModalSlide.propTypes = props;\nDSModalSlide.displayName = 'DSModalSlide';\nconst DSModalSlideWithSchema = describe(DSModalSlide);\nDSModalSlideWithSchema.propTypes = props;\n\nexport { ModalHeader, ModalFooter, DSModalSlide, DSModalSlideWithSchema };\n\nexport default DSModalSlide;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,mCAAAA;AAAA,EAAA,iCAAAC;AAAA,EAAA;AAAA;AAAA;ACAA,YAAuB;ADmHb;AAjHV,mBAAiE;AACjE,8BAA4D;AAC5D,oBAAyB;AACzB,uBAAqB;AACrB,uBAAiC;AACjC,qBAAqB;AACrB,0BAAwB;AACxB,oBAAyD;AACzD,oBAAwB;AACxB,oBAAwB;AAExB,MAAM,oBAAgB,yBAAO,mBAAI;AAAA;AAAA;AAAA;AAAA,yBAIR,CAAC,EA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AAAA,sBAClD,UAAU,4CAAC,oBAAAC,SAAA,EAAY,UAAS,WAAU,MAAK,YAAW;AAAA,sBAC3D,4CAAC,uBAAK,OAAO,EAAE,UAAU,SAAS,GAChC,sDAAC,iBAAc,KAAK,UAAU,UAAU,GAAG,MAAK,eAC9C,sDAAC,+BAAe,UAAS,GAC3B,GACF;AAAA,sBACC,UAAU,4CAAC,oBAAAA,SAAA,EAAY,UAAS,WAAU,MAAK,YAAW;AAAA,sBAC1D;AAAA;AAAA;AAAA,gBACH;AAAA;AAAA,YACF;AAAA;AAAA,QACF;AAAA;AAAA,IACF;AAAA,IACA;AAAA,EACF;AACF;AAEA,MAAM,QAAQ;AAAA,EAIZ,UAAU,kCAAU,KAAK,YAAY,uCAAuC;AAAA,EAI5E,QAAQ,kCAAU,KAAK,YAAY,sCAAsC;AAAA,EAIzE,UAAU,kCAAU,UAAU,CAAC,kCAAU,SAAS,kCAAU,QAAQ,kCAAU,GAAG,CAAC,EAAE,WAAW;AAAA,IAC7F;AAAA,EACF;AAAA,EAIA,WAAW,kCAAU,KAAK,YAAY,gDAAgD;AAAA,EAItF,QAAQ,kCAAU,QAAQ,YAAY,uEAAuE;AAAA,EAI7G,SAAS,kCAAU,OAAO,YAAY,mBAAmB;AAAA,EAIzD,QAAQ,kCAAU,OAAO,YAAY,kBAAkB;AAAA,EAIvD,gBAAgB,kCAAU,KAAK,YAAY,6DAA6D;AAC1G;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,6BAAyB,kCAAS,YAAY;AACpD,uBAAuB,YAAY;AAInC,IAAO,uBAAQ;",
|
|
6
6
|
"names": ["ModalFooter", "ModalHeader", "props", "ReactDOM", "React", "DSSeparator"]
|
|
7
7
|
}
|
|
@@ -30,7 +30,7 @@ __export(Footer_exports, {
|
|
|
30
30
|
module.exports = __toCommonJS(Footer_exports);
|
|
31
31
|
var React = __toESM(require("react"));
|
|
32
32
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
-
var
|
|
33
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
34
34
|
var import_ds_button = __toESM(require("@elliemae/ds-button"));
|
|
35
35
|
var import_blocks = require("./blocks");
|
|
36
36
|
const ModalFooter = ({
|
|
@@ -69,20 +69,20 @@ const ModalFooter = ({
|
|
|
69
69
|
)
|
|
70
70
|
] }) });
|
|
71
71
|
const props = {
|
|
72
|
-
confirmLabel:
|
|
73
|
-
rejectLabel:
|
|
74
|
-
onConfirm:
|
|
75
|
-
onReject:
|
|
76
|
-
confirmProps:
|
|
77
|
-
disabled:
|
|
72
|
+
confirmLabel: import_ds_props_helpers.PropTypes.string.description("Confirm Label"),
|
|
73
|
+
rejectLabel: import_ds_props_helpers.PropTypes.string.description("Reject Label"),
|
|
74
|
+
onConfirm: import_ds_props_helpers.PropTypes.func.description("Callback"),
|
|
75
|
+
onReject: import_ds_props_helpers.PropTypes.func.description("Callback"),
|
|
76
|
+
confirmProps: import_ds_props_helpers.PropTypes.shape({
|
|
77
|
+
disabled: import_ds_props_helpers.PropTypes.bool
|
|
78
78
|
}).description("Extra DSButton props for confirm btn."),
|
|
79
|
-
rejectProps:
|
|
80
|
-
disabled:
|
|
79
|
+
rejectProps: import_ds_props_helpers.PropTypes.shape({
|
|
80
|
+
disabled: import_ds_props_helpers.PropTypes.bool
|
|
81
81
|
}).description("Extra DSButton props for reject btn.")
|
|
82
82
|
};
|
|
83
83
|
ModalFooter.propTypes = props;
|
|
84
84
|
ModalFooter.displayName = "ModalFooter";
|
|
85
|
-
const DSModalSlideFooterWithSchema = (0,
|
|
85
|
+
const DSModalSlideFooterWithSchema = (0, import_ds_props_helpers.describe)(ModalFooter);
|
|
86
86
|
DSModalSlideFooterWithSchema.propTypes = props;
|
|
87
87
|
var Footer_default = ModalFooter;
|
|
88
88
|
//# sourceMappingURL=Footer.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/Footer.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiBrB;AAhBF,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport DSButton from '@elliemae/ds-button';\nimport { FooterWrapper } from './blocks';\n\nconst ModalFooter = ({\n confirmLabel = 'Confirm',\n rejectLabel = 'Cancel',\n onConfirm,\n onReject,\n confirmProps = {\n disabled: false,\n },\n rejectProps = {\n disabled: false,\n },\n}) => (\n <>\n <FooterWrapper>\n {!!onReject && (\n <DSButton\n buttonType=\"secondary\"\n className=\"action-reject\"\n containerProps={{ 'data-testid': 'modal-footer-reject-btn' }}\n labelText={rejectLabel}\n onClick={onReject}\n {...rejectProps}\n />\n )}\n {!!onConfirm && (\n <DSButton\n buttonType=\"primary\"\n className=\"action-confirm\"\n containerProps={{ 'data-testid': 'modal-footer-confirm-btn' }}\n labelText={confirmLabel}\n onClick={onConfirm}\n {...confirmProps}\n />\n )}\n </FooterWrapper>\n </>\n);\n\nconst props = {\n /**\n * Confirm Label\n */\n confirmLabel: PropTypes.string.description('Confirm Label'),\n /**\n * Reject Label\n */\n rejectLabel: PropTypes.string.description('Reject Label'),\n /**\n * Callback\n */\n onConfirm: PropTypes.func.description('Callback'),\n /**\n * Callback\n */\n onReject: PropTypes.func.description('Callback'),\n /**\n * Extra DSButton props for confirm btn.\n */\n confirmProps: PropTypes.shape({\n disabled: PropTypes.bool,\n }).description('Extra DSButton props for confirm btn.'),\n /**\n * Extra DSButton props for reject btn.\n */\n rejectProps: PropTypes.shape({\n disabled: PropTypes.bool,\n }).description('Extra DSButton props for reject btn.'),\n};\n\nModalFooter.propTypes = props;\nModalFooter.displayName = 'ModalFooter';\nconst DSModalSlideFooterWithSchema = describe(ModalFooter);\nDSModalSlideFooterWithSchema.propTypes = props;\n\nexport { DSModalSlideFooterWithSchema };\n\nexport default ModalFooter;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiBrB;AAhBF,8BAAoC;AACpC,uBAAqB;AACrB,oBAA8B;AAE9B,MAAM,cAAc,CAAC;AAAA,EACnB,eAAe;AAAA,EACf,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA,eAAe;AAAA,IACb,UAAU;AAAA,EACZ;AAAA,EACA,cAAc;AAAA,IACZ,UAAU;AAAA,EACZ;AACF,MACE,2EACE,uDAAC,+BACE;AAAA,GAAC,CAAC,YACD;AAAA,IAAC,iBAAAA;AAAA,IAAA;AAAA,MACC,YAAW;AAAA,MACX,WAAU;AAAA,MACV,gBAAgB,EAAE,eAAe,0BAA0B;AAAA,MAC3D,WAAW;AAAA,MACX,SAAS;AAAA,MACR,GAAG;AAAA;AAAA,EACN;AAAA,EAED,CAAC,CAAC,aACD;AAAA,IAAC,iBAAAA;AAAA,IAAA;AAAA,MACC,YAAW;AAAA,MACX,WAAU;AAAA,MACV,gBAAgB,EAAE,eAAe,2BAA2B;AAAA,MAC5D,WAAW;AAAA,MACX,SAAS;AAAA,MACR,GAAG;AAAA;AAAA,EACN;AAAA,GAEJ,GACF;AAGF,MAAM,QAAQ;AAAA,EAIZ,cAAc,kCAAU,OAAO,YAAY,eAAe;AAAA,EAI1D,aAAa,kCAAU,OAAO,YAAY,cAAc;AAAA,EAIxD,WAAW,kCAAU,KAAK,YAAY,UAAU;AAAA,EAIhD,UAAU,kCAAU,KAAK,YAAY,UAAU;AAAA,EAI/C,cAAc,kCAAU,MAAM;AAAA,IAC5B,UAAU,kCAAU;AAAA,EACtB,CAAC,EAAE,YAAY,uCAAuC;AAAA,EAItD,aAAa,kCAAU,MAAM;AAAA,IAC3B,UAAU,kCAAU;AAAA,EACtB,CAAC,EAAE,YAAY,sCAAsC;AACvD;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,mCAA+B,kCAAS,WAAW;AACzD,6BAA6B,YAAY;AAIzC,IAAO,iBAAQ;",
|
|
6
6
|
"names": ["DSButton"]
|
|
7
7
|
}
|
|
@@ -30,7 +30,7 @@ __export(Header_exports, {
|
|
|
30
30
|
module.exports = __toCommonJS(Header_exports);
|
|
31
31
|
var React = __toESM(require("react"));
|
|
32
32
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
-
var
|
|
33
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
34
34
|
var import_ds_system = require("@elliemae/ds-system");
|
|
35
35
|
var import_ds_separator = __toESM(require("@elliemae/ds-separator"));
|
|
36
36
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
@@ -67,14 +67,14 @@ const StyledCloseButton = (0, import_ds_system.styled)(import_ds_button.default)
|
|
|
67
67
|
margin: ${(props2) => props2.theme.space.xs};
|
|
68
68
|
`;
|
|
69
69
|
const props = {
|
|
70
|
-
onClose:
|
|
71
|
-
toolbar:
|
|
72
|
-
title:
|
|
73
|
-
innerRef:
|
|
70
|
+
onClose: import_ds_props_helpers.PropTypes.func.description("on modal close callback"),
|
|
71
|
+
toolbar: import_ds_props_helpers.PropTypes.node.description("modal toolbar comoponent"),
|
|
72
|
+
title: import_ds_props_helpers.PropTypes.string.description("modal title"),
|
|
73
|
+
innerRef: import_ds_props_helpers.PropTypes.func.description("button close ref ")
|
|
74
74
|
};
|
|
75
75
|
ModalHeader.propTypes = props;
|
|
76
76
|
ModalHeader.displayName = "ModalHeader";
|
|
77
|
-
const DSModalSlideHeaderWithSchema = (0,
|
|
77
|
+
const DSModalSlideHeaderWithSchema = (0, import_ds_props_helpers.describe)(ModalHeader);
|
|
78
78
|
DSModalSlideHeaderWithSchema.propTypes = props;
|
|
79
79
|
var Header_default = ModalHeader;
|
|
80
80
|
//# sourceMappingURL=Header.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/Header.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADSrB;AARF,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport { styled } from '@elliemae/ds-system';\nimport DSSeparator from '@elliemae/ds-separator';\nimport { Close } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport { Header, HeaderLeftSide, Title } from './blocks';\n\nconst ModalHeader = ({ innerRef = null, title: headerTitle = '', onClose = () => null, toolbar = null }) => (\n <HeaderWrapper>\n <HeaderLeftSide>\n <Header>\n <Title>{headerTitle}</Title>\n </Header>\n </HeaderLeftSide>\n {toolbar}\n {toolbar && <StyledSeparator position=\"initial\" margin=\"none\" orientation=\"vertical\" type=\"non-form\" />}\n <StyledCloseButton\n data-testid=\"modal-slider-header-close\"\n aria-label=\"Close modal slide\"\n buttonType=\"text\"\n icon={<Close aria-label=\"Close modal slide\" size=\"s\" />}\n onClick={onClose}\n innerRef={innerRef}\n />\n </HeaderWrapper>\n);\n\nconst HeaderWrapper = styled.div`\n display: flex;\n justify-content: space-between;\n width: 100%;\n align-items: center;\n height: 48px;\n overflow: hidden;\n`;\n\nconst StyledSeparator = styled(DSSeparator)`\n padding: ${(props) => props.theme.space.xs} 0;\n`;\n\nconst StyledCloseButton = styled(DSButton)`\n margin: ${(props) => props.theme.space.xs};\n`;\n\nconst props = {\n /** on modal close callback */\n onClose: PropTypes.func.description('on modal close callback'),\n /** modal toolbar component */\n toolbar: PropTypes.node.description('modal toolbar comoponent'),\n /** modal title */\n title: PropTypes.string.description('modal title'),\n innerRef: PropTypes.func.description('button close ref '),\n};\n\nModalHeader.propTypes = props;\nModalHeader.displayName = 'ModalHeader';\nconst DSModalSlideHeaderWithSchema = describe(ModalHeader);\nDSModalSlideHeaderWithSchema.propTypes = props;\n\nexport { DSModalSlideHeaderWithSchema };\n\nexport default ModalHeader;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADSrB;AARF,8BAAoC;AACpC,uBAAuB;AACvB,0BAAwB;AACxB,sBAAsB;AACtB,uBAAqB;AACrB,oBAA8C;AAE9C,MAAM,cAAc,CAAC,EAAE,WAAW,MAAM,OAAO,cAAc,IAAI,UAAU,MAAM,MAAM,UAAU,KAAK,MACpG,6CAAC,iBACC;AAAA,8CAAC,gCACC,sDAAC,wBACC,sDAAC,uBAAO,uBAAY,GACtB,GACF;AAAA,EACC;AAAA,EACA,WAAW,4CAAC,mBAAgB,UAAS,WAAU,QAAO,QAAO,aAAY,YAAW,MAAK,YAAW;AAAA,EACrG;AAAA,IAAC;AAAA;AAAA,MACC,eAAY;AAAA,MACZ,cAAW;AAAA,MACX,YAAW;AAAA,MACX,MAAM,4CAAC,yBAAM,cAAW,qBAAoB,MAAK,KAAI;AAAA,MACrD,SAAS;AAAA,MACT;AAAA;AAAA,EACF;AAAA,GACF;AAGF,MAAM,gBAAgB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS7B,MAAM,sBAAkB,yBAAO,oBAAAA,OAAW;AAAA,aAC7B,CAACC,WAAUA,OAAM,MAAM,MAAM;AAAA;AAG1C,MAAM,wBAAoB,yBAAO,iBAAAC,OAAQ;AAAA,YAC7B,CAACD,WAAUA,OAAM,MAAM,MAAM;AAAA;AAGzC,MAAM,QAAQ;AAAA,EAEZ,SAAS,kCAAU,KAAK,YAAY,yBAAyB;AAAA,EAE7D,SAAS,kCAAU,KAAK,YAAY,0BAA0B;AAAA,EAE9D,OAAO,kCAAU,OAAO,YAAY,aAAa;AAAA,EACjD,UAAU,kCAAU,KAAK,YAAY,mBAAmB;AAC1D;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,mCAA+B,kCAAS,WAAW;AACzD,6BAA6B,YAAY;AAIzC,IAAO,iBAAQ;",
|
|
6
6
|
"names": ["DSSeparator", "props", "DSButton"]
|
|
7
7
|
}
|
package/dist/esm/DSModalSlide.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React2, { useState, useEffect, useCallback, useMemo } from "react";
|
|
4
|
-
import { PropTypes, describe, useGetGlobalAttributes } from "@elliemae/ds-
|
|
4
|
+
import { PropTypes, describe, useGetGlobalAttributes } from "@elliemae/ds-props-helpers";
|
|
5
5
|
import { debounce } from "lodash";
|
|
6
6
|
import ReactDOM from "react-dom";
|
|
7
7
|
import { useTheme, styled } from "@elliemae/ds-system";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSModalSlide.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport React, { useState, useEffect, useCallback, useMemo } from 'react';\nimport { PropTypes, describe, useGetGlobalAttributes } from '@elliemae/ds-
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport React, { useState, useEffect, useCallback, useMemo } from 'react';\nimport { PropTypes, describe, useGetGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { debounce } from 'lodash';\nimport ReactDOM from 'react-dom';\nimport { useTheme, styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport DSSeparator from '@elliemae/ds-separator';\nimport { Wrapper, Overlay, Content, ActualContent } from './components/blocks';\nimport ModalHeader from './components/Header';\nimport ModalFooter from './components/Footer';\n\nconst StyledWrapper = styled(Grid)`\n overflow: auto;\n &:focus,\n &:focus-visible {\n outline: 1px solid ${({ theme }) => theme.colors.brand['600']};\n outline-offset: -1px;\n }\n`;\n// eslint-disable-next-line complexity\nconst DSModalSlide = (props) => {\n const {\n isOpen = false,\n children,\n getContainer,\n centered = false,\n fullWidth = false,\n header = null,\n footer = null,\n fadeOut = 1500,\n fadeIn = 1500,\n overrideHeight = false,\n innerRef = null,\n } = props;\n const [isMoving, setMoving] = useState(false);\n const [show, setShow] = useState(isOpen);\n const [width, setWidth] = useState(50);\n const [height, setHeight] = useState('100%');\n const theme = useTheme();\n const contentRows = [...(header ? ['auto', '1px'] : []), '1fr', ...(footer ? ['1px', theme.space.m] : [])];\n const globalAttrs = useGetGlobalAttributes(props);\n const updateShow = useCallback(() => {\n if (fullWidth) setWidth(100);\n else setWidth(50);\n if (isOpen !== show) {\n setMoving(true);\n if (isOpen) {\n setShow(isOpen);\n }\n }\n }, [isOpen, fullWidth, isMoving]);\n\n useEffect(updateShow, [isOpen, fullWidth]);\n\n const container = getContainer();\n\n const handleHeight = useCallback(() => {\n const newHeight =\n overrideHeight && container.scrollHeight > container.getBoundingClientRect().height\n ? container.scrollHeight\n : container.getBoundingClientRect().height;\n setHeight(newHeight);\n }, [container, overrideHeight]);\n\n const onChangeParent = useMemo(() => debounce(handleHeight, 300), [handleHeight]);\n\n useEffect(() => {\n const resizeObserver = new ResizeObserver(() => onChangeParent());\n if (container) {\n resizeObserver.observe(container);\n if (!container.style.position) {\n container.style.position = 'relative';\n }\n onChangeParent();\n }\n return () => {\n if (container) resizeObserver.unobserve(container);\n };\n }, [container, onChangeParent]);\n\n if (!show) return null;\n if (!container) return null;\n\n const handleAnimationEnd = () => {\n setMoving(false);\n if (!isOpen) setShow(isOpen);\n };\n\n return ReactDOM.createPortal(\n <Wrapper\n {...globalAttrs}\n classProps={{\n show: isOpen,\n centered,\n }}\n style={{\n '--height': height,\n '--fade-in': fadeIn,\n '--fade-out': fadeOut,\n '--width': width,\n }}\n >\n <Overlay\n classProps={{\n show: isOpen,\n }}\n >\n <Content\n onAnimationEnd={handleAnimationEnd}\n classProps={{\n show: isOpen,\n }}\n >\n <Grid\n style={{\n height: '100%',\n width: '100%',\n maxHeight: '100%',\n overflow: 'hidden',\n '-webkit-backface-visibility': 'hidden',\n 'backface-visibility': 'hidden',\n '-webkit-transform-style': 'preserve-3d',\n }}\n rows={contentRows}\n data-testid=\"ds-modal-slide\"\n >\n {header && React.cloneElement(header, { fullWidth })}\n {header && <DSSeparator position=\"initial\" type=\"non-form\" />}\n <Grid style={{ overflow: 'hidden' }}>\n <StyledWrapper ref={innerRef} tabIndex={0} role=\"contentinfo\">\n <ActualContent>{children}</ActualContent>\n </StyledWrapper>\n </Grid>\n {footer && <DSSeparator position=\"initial\" type=\"non-form\" />}\n {footer}\n </Grid>\n </Content>\n </Overlay>\n </Wrapper>,\n container,\n );\n};\n\nconst props = {\n /**\n * If the modal slide is centered or not\n */\n centered: PropTypes.bool.description('If the modal slide is centered or not'),\n /**\n * If the modal slide is visible or not\n */\n isOpen: PropTypes.bool.description('If the modal slide is visible or not'),\n /**\n * Main content of the modal\n */\n children: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.any]).isRequired.description(\n 'Main content of the modal',\n ),\n /**\n * If the modal slide takes the full width or not\n */\n fullWidth: PropTypes.bool.description('If the modal slide takes the full width or not'),\n /**\n * If the modal slide has a header, only available for full width option\n */\n header: PropTypes.element.description('If the modal slide has a header, only available for full width option'),\n /**\n * Ratio of fade out\n */\n fadeOut: PropTypes.number.description('Ratio of fade out'),\n /**\n * Ratio of fade in\n */\n fadeIn: PropTypes.number.description('Ratio of fade in'),\n /**\n * Override the panel height to scroll height of the container\n */\n overrideHeight: PropTypes.bool.description('Override the panel height to scroll height of the container'),\n};\n\nDSModalSlide.propTypes = props;\nDSModalSlide.displayName = 'DSModalSlide';\nconst DSModalSlideWithSchema = describe(DSModalSlide);\nDSModalSlideWithSchema.propTypes = props;\n\nexport { ModalHeader, ModalFooter, DSModalSlide, DSModalSlideWithSchema };\n\nexport default DSModalSlide;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACmHb,SAca,KAdb;AAjHV,OAAOA,UAAS,UAAU,WAAW,aAAa,eAAe;AACjE,SAAS,WAAW,UAAU,8BAA8B;AAC5D,SAAS,gBAAgB;AACzB,OAAO,cAAc;AACrB,SAAS,UAAU,cAAc;AACjC,SAAS,YAAY;AACrB,OAAO,iBAAiB;AACxB,SAAS,SAAS,SAAS,SAAS,qBAAqB;AACzD,OAAO,iBAAiB;AACxB,OAAO,iBAAiB;AAExB,MAAM,gBAAgB,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA,yBAIR,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAK3D,MAAM,eAAe,CAACC,WAAU;AAC9B,QAAM;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,SAAS;AAAA,IACT,UAAU;AAAA,IACV,SAAS;AAAA,IACT,iBAAiB;AAAA,IACjB,WAAW;AAAA,EACb,IAAIA;AACJ,QAAM,CAAC,UAAU,SAAS,IAAI,SAAS,KAAK;AAC5C,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,MAAM;AACvC,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,EAAE;AACrC,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,MAAM;AAC3C,QAAM,QAAQ,SAAS;AACvB,QAAM,cAAc,CAAC,GAAI,SAAS,CAAC,QAAQ,KAAK,IAAI,CAAC,GAAI,OAAO,GAAI,SAAS,CAAC,OA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,EAItF,QAAQ,UAAU,QAAQ,YAAY,uEAAuE;AAAA,EAI7G,SAAS,UAAU,OAAO,YAAY,mBAAmB;AAAA,EAIzD,QAAQ,UAAU,OAAO,YAAY,kBAAkB;AAAA,EAIvD,gBAAgB,UAAU,KAAK,YAAY,6DAA6D;AAC1G;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,yBAAyB,SAAS,YAAY;AACpD,uBAAuB,YAAY;AAInC,IAAO,uBAAQ;",
|
|
6
6
|
"names": ["React", "props"]
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { PropTypes, describe } from "@elliemae/ds-
|
|
3
|
+
import { PropTypes, describe } from "@elliemae/ds-props-helpers";
|
|
4
4
|
import DSButton from "@elliemae/ds-button";
|
|
5
5
|
import { FooterWrapper } from "./blocks";
|
|
6
6
|
const ModalFooter = ({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/Footer.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport DSButton from '@elliemae/ds-button';\nimport { FooterWrapper } from './blocks';\n\nconst ModalFooter = ({\n confirmLabel = 'Confirm',\n rejectLabel = 'Cancel',\n onConfirm,\n onReject,\n confirmProps = {\n disabled: false,\n },\n rejectProps = {\n disabled: false,\n },\n}) => (\n <>\n <FooterWrapper>\n {!!onReject && (\n <DSButton\n buttonType=\"secondary\"\n className=\"action-reject\"\n containerProps={{ 'data-testid': 'modal-footer-reject-btn' }}\n labelText={rejectLabel}\n onClick={onReject}\n {...rejectProps}\n />\n )}\n {!!onConfirm && (\n <DSButton\n buttonType=\"primary\"\n className=\"action-confirm\"\n containerProps={{ 'data-testid': 'modal-footer-confirm-btn' }}\n labelText={confirmLabel}\n onClick={onConfirm}\n {...confirmProps}\n />\n )}\n </FooterWrapper>\n </>\n);\n\nconst props = {\n /**\n * Confirm Label\n */\n confirmLabel: PropTypes.string.description('Confirm Label'),\n /**\n * Reject Label\n */\n rejectLabel: PropTypes.string.description('Reject Label'),\n /**\n * Callback\n */\n onConfirm: PropTypes.func.description('Callback'),\n /**\n * Callback\n */\n onReject: PropTypes.func.description('Callback'),\n /**\n * Extra DSButton props for confirm btn.\n */\n confirmProps: PropTypes.shape({\n disabled: PropTypes.bool,\n }).description('Extra DSButton props for confirm btn.'),\n /**\n * Extra DSButton props for reject btn.\n */\n rejectProps: PropTypes.shape({\n disabled: PropTypes.bool,\n }).description('Extra DSButton props for reject btn.'),\n};\n\nModalFooter.propTypes = props;\nModalFooter.displayName = 'ModalFooter';\nconst DSModalSlideFooterWithSchema = describe(ModalFooter);\nDSModalSlideFooterWithSchema.propTypes = props;\n\nexport { DSModalSlideFooterWithSchema };\n\nexport default ModalFooter;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACiBrB,mBAGM,KAFJ,YADF;AAhBF,SAAS,WAAW,gBAAgB;AACpC,OAAO,cAAc;AACrB,SAAS,qBAAqB;AAE9B,MAAM,cAAc,CAAC;AAAA,EACnB,eAAe;AAAA,EACf,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA,eAAe;AAAA,IACb,UAAU;AAAA,EACZ;AAAA,EACA,cAAc;AAAA,IACZ,UAAU;AAAA,EACZ;AACF,MACE,gCACE,+BAAC,iBACE;AAAA,GAAC,CAAC,YACD;AAAA,IAAC;AAAA;AAAA,MACC,YAAW;AAAA,MACX,WAAU;AAAA,MACV,gBAAgB,EAAE,eAAe,0BAA0B;AAAA,MAC3D,WAAW;AAAA,MACX,SAAS;AAAA,MACR,GAAG;AAAA;AAAA,EACN;AAAA,EAED,CAAC,CAAC,aACD;AAAA,IAAC;AAAA;AAAA,MACC,YAAW;AAAA,MACX,WAAU;AAAA,MACV,gBAAgB,EAAE,eAAe,2BAA2B;AAAA,MAC5D,WAAW;AAAA,MACX,SAAS;AAAA,MACR,GAAG;AAAA;AAAA,EACN;AAAA,GAEJ,GACF;AAGF,MAAM,QAAQ;AAAA,EAIZ,cAAc,UAAU,OAAO,YAAY,eAAe;AAAA,EAI1D,aAAa,UAAU,OAAO,YAAY,cAAc;AAAA,EAIxD,WAAW,UAAU,KAAK,YAAY,UAAU;AAAA,EAIhD,UAAU,UAAU,KAAK,YAAY,UAAU;AAAA,EAI/C,cAAc,UAAU,MAAM;AAAA,IAC5B,UAAU,UAAU;AAAA,EACtB,CAAC,EAAE,YAAY,uCAAuC;AAAA,EAItD,aAAa,UAAU,MAAM;AAAA,IAC3B,UAAU,UAAU;AAAA,EACtB,CAAC,EAAE,YAAY,sCAAsC;AACvD;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,+BAA+B,SAAS,WAAW;AACzD,6BAA6B,YAAY;AAIzC,IAAO,iBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { PropTypes, describe } from "@elliemae/ds-
|
|
3
|
+
import { PropTypes, describe } from "@elliemae/ds-props-helpers";
|
|
4
4
|
import { styled } from "@elliemae/ds-system";
|
|
5
5
|
import DSSeparator from "@elliemae/ds-separator";
|
|
6
6
|
import { Close } from "@elliemae/ds-icons";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/Header.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport { styled } from '@elliemae/ds-system';\nimport DSSeparator from '@elliemae/ds-separator';\nimport { Close } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport { Header, HeaderLeftSide, Title } from './blocks';\n\nconst ModalHeader = ({ innerRef = null, title: headerTitle = '', onClose = () => null, toolbar = null }) => (\n <HeaderWrapper>\n <HeaderLeftSide>\n <Header>\n <Title>{headerTitle}</Title>\n </Header>\n </HeaderLeftSide>\n {toolbar}\n {toolbar && <StyledSeparator position=\"initial\" margin=\"none\" orientation=\"vertical\" type=\"non-form\" />}\n <StyledCloseButton\n data-testid=\"modal-slider-header-close\"\n aria-label=\"Close modal slide\"\n buttonType=\"text\"\n icon={<Close aria-label=\"Close modal slide\" size=\"s\" />}\n onClick={onClose}\n innerRef={innerRef}\n />\n </HeaderWrapper>\n);\n\nconst HeaderWrapper = styled.div`\n display: flex;\n justify-content: space-between;\n width: 100%;\n align-items: center;\n height: 48px;\n overflow: hidden;\n`;\n\nconst StyledSeparator = styled(DSSeparator)`\n padding: ${(props) => props.theme.space.xs} 0;\n`;\n\nconst StyledCloseButton = styled(DSButton)`\n margin: ${(props) => props.theme.space.xs};\n`;\n\nconst props = {\n /** on modal close callback */\n onClose: PropTypes.func.description('on modal close callback'),\n /** modal toolbar component */\n toolbar: PropTypes.node.description('modal toolbar comoponent'),\n /** modal title */\n title: PropTypes.string.description('modal title'),\n innerRef: PropTypes.func.description('button close ref '),\n};\n\nModalHeader.propTypes = props;\nModalHeader.displayName = 'ModalHeader';\nconst DSModalSlideHeaderWithSchema = describe(ModalHeader);\nDSModalSlideHeaderWithSchema.propTypes = props;\n\nexport { DSModalSlideHeaderWithSchema };\n\nexport default ModalHeader;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY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7,38 @@ declare const DSModalSlide: {
|
|
|
7
7
|
/**
|
|
8
8
|
* If the modal slide is centered or not
|
|
9
9
|
*/
|
|
10
|
-
centered: import("@elliemae/ds-
|
|
10
|
+
centered: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
11
11
|
/**
|
|
12
12
|
* If the modal slide is visible or not
|
|
13
13
|
*/
|
|
14
|
-
isOpen: import("@elliemae/ds-
|
|
14
|
+
isOpen: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
15
15
|
/**
|
|
16
16
|
* Main content of the modal
|
|
17
17
|
*/
|
|
18
|
-
children: import("@elliemae/ds-
|
|
18
|
+
children: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
19
19
|
/**
|
|
20
20
|
* If the modal slide takes the full width or not
|
|
21
21
|
*/
|
|
22
|
-
fullWidth: import("@elliemae/ds-
|
|
22
|
+
fullWidth: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
23
23
|
/**
|
|
24
24
|
* If the modal slide has a header, only available for full width option
|
|
25
25
|
*/
|
|
26
|
-
header: import("@elliemae/ds-
|
|
26
|
+
header: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
27
27
|
/**
|
|
28
28
|
* Ratio of fade out
|
|
29
29
|
*/
|
|
30
|
-
fadeOut: import("@elliemae/ds-
|
|
30
|
+
fadeOut: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
31
31
|
/**
|
|
32
32
|
* Ratio of fade in
|
|
33
33
|
*/
|
|
34
|
-
fadeIn: import("@elliemae/ds-
|
|
34
|
+
fadeIn: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
35
35
|
/**
|
|
36
36
|
* Override the panel height to scroll height of the container
|
|
37
37
|
*/
|
|
38
|
-
overrideHeight: import("@elliemae/ds-
|
|
38
|
+
overrideHeight: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
39
39
|
};
|
|
40
40
|
displayName: string;
|
|
41
41
|
};
|
|
42
|
-
declare const DSModalSlideWithSchema: import("@elliemae/ds-
|
|
42
|
+
declare const DSModalSlideWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").DocumentedReactComponent<any>;
|
|
43
43
|
export { ModalHeader, ModalFooter, DSModalSlide, DSModalSlideWithSchema };
|
|
44
44
|
export default DSModalSlide;
|
|
@@ -15,31 +15,31 @@ declare const ModalFooter: {
|
|
|
15
15
|
/**
|
|
16
16
|
* Confirm Label
|
|
17
17
|
*/
|
|
18
|
-
confirmLabel: import("@elliemae/ds-
|
|
18
|
+
confirmLabel: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
19
19
|
/**
|
|
20
20
|
* Reject Label
|
|
21
21
|
*/
|
|
22
|
-
rejectLabel: import("@elliemae/ds-
|
|
22
|
+
rejectLabel: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
23
23
|
/**
|
|
24
24
|
* Callback
|
|
25
25
|
*/
|
|
26
|
-
onConfirm: import("@elliemae/ds-
|
|
26
|
+
onConfirm: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
27
27
|
/**
|
|
28
28
|
* Callback
|
|
29
29
|
*/
|
|
30
|
-
onReject: import("@elliemae/ds-
|
|
30
|
+
onReject: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
31
31
|
/**
|
|
32
32
|
* Extra DSButton props for confirm btn.
|
|
33
33
|
*/
|
|
34
|
-
confirmProps: import("@elliemae/ds-
|
|
34
|
+
confirmProps: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
35
35
|
/**
|
|
36
36
|
* Extra DSButton props for reject btn.
|
|
37
37
|
*/
|
|
38
|
-
rejectProps: import("@elliemae/ds-
|
|
38
|
+
rejectProps: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
39
39
|
};
|
|
40
40
|
displayName: string;
|
|
41
41
|
};
|
|
42
|
-
declare const DSModalSlideFooterWithSchema: import("@elliemae/ds-
|
|
42
|
+
declare const DSModalSlideFooterWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").DocumentedReactComponent<{
|
|
43
43
|
confirmLabel?: string | undefined;
|
|
44
44
|
rejectLabel?: string | undefined;
|
|
45
45
|
onConfirm: any;
|
|
@@ -7,16 +7,16 @@ declare const ModalHeader: {
|
|
|
7
7
|
}): JSX.Element;
|
|
8
8
|
propTypes: {
|
|
9
9
|
/** on modal close callback */
|
|
10
|
-
onClose: import("@elliemae/ds-
|
|
10
|
+
onClose: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
11
11
|
/** modal toolbar component */
|
|
12
|
-
toolbar: import("@elliemae/ds-
|
|
12
|
+
toolbar: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
13
13
|
/** modal title */
|
|
14
|
-
title: import("@elliemae/ds-
|
|
15
|
-
innerRef: import("@elliemae/ds-
|
|
14
|
+
title: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
15
|
+
innerRef: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
16
16
|
};
|
|
17
17
|
displayName: string;
|
|
18
18
|
};
|
|
19
|
-
declare const DSModalSlideHeaderWithSchema: import("@elliemae/ds-
|
|
19
|
+
declare const DSModalSlideHeaderWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").DocumentedReactComponent<{
|
|
20
20
|
innerRef?: null | undefined;
|
|
21
21
|
title?: string | undefined;
|
|
22
22
|
onClose?: (() => null) | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-modal-slide",
|
|
3
|
-
"version": "3.16.0-next.
|
|
3
|
+
"version": "3.16.0-next.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Modal Slide",
|
|
6
6
|
"files": [
|
|
@@ -51,13 +51,14 @@
|
|
|
51
51
|
"indent": 4
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@elliemae/ds-button": "3.16.0-next.
|
|
55
|
-
"@elliemae/ds-classnames": "3.16.0-next.
|
|
56
|
-
"@elliemae/ds-grid": "3.16.0-next.
|
|
57
|
-
"@elliemae/ds-icons": "3.16.0-next.
|
|
58
|
-
"@elliemae/ds-
|
|
59
|
-
"@elliemae/ds-
|
|
60
|
-
"@elliemae/ds-
|
|
54
|
+
"@elliemae/ds-button": "3.16.0-next.3",
|
|
55
|
+
"@elliemae/ds-classnames": "3.16.0-next.3",
|
|
56
|
+
"@elliemae/ds-grid": "3.16.0-next.3",
|
|
57
|
+
"@elliemae/ds-icons": "3.16.0-next.3",
|
|
58
|
+
"@elliemae/ds-props-helpers": "3.16.0-next.3",
|
|
59
|
+
"@elliemae/ds-separator": "3.16.0-next.3",
|
|
60
|
+
"@elliemae/ds-system": "3.16.0-next.3",
|
|
61
|
+
"@elliemae/ds-utilities": "3.16.0-next.3"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
64
|
"@testing-library/react": "~12.1.3",
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
"eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../.eslintrc.js' src/",
|
|
81
82
|
"dts": "node ../../scripts/dts.mjs",
|
|
82
83
|
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
|
|
83
|
-
"dev:build": "pnpm --filter {.}... build
|
|
84
|
+
"dev:build": "pnpm --filter {.}... build",
|
|
84
85
|
"dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
|
|
85
86
|
"checkDeps": "npx -yes ../ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
|
|
86
87
|
}
|