@elliemae/ds-modal 3.0.0-next.14 → 3.0.0-next.15
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/DSModal.js +3 -3
- package/dist/cjs/DSModal.js.map +2 -2
- package/dist/cjs/v1/DSModal.js +3 -3
- package/dist/cjs/v1/DSModal.js.map +2 -2
- package/dist/cjs/v1/DSModalWrapper.js +14 -14
- package/dist/cjs/v1/DSModalWrapper.js.map +2 -2
- package/dist/esm/DSModal.js +1 -1
- package/dist/esm/DSModal.js.map +1 -1
- package/dist/esm/v1/DSModal.js +1 -1
- package/dist/esm/v1/DSModal.js.map +1 -1
- package/dist/esm/v1/DSModalWrapper.js +14 -14
- package/dist/esm/v1/DSModalWrapper.js.map +2 -2
- package/package.json +8 -8
package/dist/cjs/DSModal.js
CHANGED
|
@@ -63,7 +63,7 @@ var import_prop_types = __toESM(require("prop-types"));
|
|
|
63
63
|
var import_constants = require("./constants");
|
|
64
64
|
var import_DSModal = __toESM(require("./v1/DSModal"));
|
|
65
65
|
var import_DSModal2 = __toESM(require("./v2/DSModal"));
|
|
66
|
-
var
|
|
66
|
+
var import_ds_shared = require("@elliemae/ds-shared");
|
|
67
67
|
const DSModal = (_a) => {
|
|
68
68
|
var _b = _a, { version = 1 } = _b, rest = __objRest(_b, ["version"]);
|
|
69
69
|
if (version === 2)
|
|
@@ -78,7 +78,7 @@ import_DSModal.default.propTypes = {
|
|
|
78
78
|
className: import_prop_types.default.string,
|
|
79
79
|
additionalFooterCssClass: import_prop_types.default.string,
|
|
80
80
|
style: import_prop_types.default.objectOf(import_prop_types.default.string),
|
|
81
|
-
iconCloseSize: import_prop_types.default.oneOf(
|
|
81
|
+
iconCloseSize: import_prop_types.default.oneOf(import_ds_shared.iconSizes),
|
|
82
82
|
modalType: import_prop_types.default.oneOf(import_constants.modalTypes),
|
|
83
83
|
showHeader: import_prop_types.default.bool,
|
|
84
84
|
showFooter: import_prop_types.default.bool,
|
|
@@ -86,7 +86,7 @@ import_DSModal.default.propTypes = {
|
|
|
86
86
|
centered: import_prop_types.default.bool,
|
|
87
87
|
confirmLabel: import_prop_types.default.string,
|
|
88
88
|
modalTitle: import_prop_types.default.string,
|
|
89
|
-
size: import_prop_types.default.oneOf(
|
|
89
|
+
size: import_prop_types.default.oneOf(import_ds_shared.sizes),
|
|
90
90
|
isOpen: import_prop_types.default.bool,
|
|
91
91
|
onClose: import_prop_types.default.func,
|
|
92
92
|
onAfterOpen: import_prop_types.default.func,
|
package/dist/cjs/DSModal.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSModal.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { modalTypes } from './constants';\nimport DSModalV1 from './v1/DSModal';\nimport DSModalV2, { DSModalContent } from './v2/DSModal';\nimport { sizes, iconSizes } from '@elliemae/ds-shared
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,wBAAsB;AACtB,uBAA2B;AAC3B,qBAAsB;AACtB,sBAA0C;AAC1C,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { modalTypes } from './constants';\nimport DSModalV1 from './v1/DSModal';\nimport DSModalV2, { DSModalContent } from './v2/DSModal';\nimport { sizes, iconSizes } from '@elliemae/ds-shared';\n\nconst DSModal = ({ version = 1, ...rest }) => {\n if (version === 2) return <DSModalV2 {...rest} />;\n return <DSModalV1 {...rest} />;\n};\n\nDSModal.propTypes = {\n version: PropTypes.oneOf([1, 2]),\n};\n\nDSModalV1.propTypes = {\n version: PropTypes.oneOf([1, 2]),\n className: PropTypes.string,\n /**\n * Add an additional css class to the footer\n */\n additionalFooterCssClass: PropTypes.string,\n /**\n * Set style for the modal\n */\n style: PropTypes.objectOf(PropTypes.string),\n /**\n * Select size for the close icon\n */\n iconCloseSize: PropTypes.oneOf(iconSizes),\n /**\n * ['default', 'alert', 'confirm', 'notification', 'warning', 'error', 'success', 'help', 'info']\n */\n modalType: PropTypes.oneOf(modalTypes),\n /**\n * Show the header or not\n */\n showHeader: PropTypes.bool,\n /**\n * Show the footer or not\n */\n showFooter: PropTypes.bool,\n /**\n * Main content of the modal\n */\n children: PropTypes.element.isRequired,\n /**\n * Content is centered or not\n */\n centered: PropTypes.bool,\n /**\n * Text to be added in the confirm button\n */\n confirmLabel: PropTypes.string,\n /**\n * Text to be added in the modal title\n */\n modalTitle: PropTypes.string,\n /**\n * Text to be added in the modal title\n */\n size: PropTypes.oneOf(sizes),\n /**\n * Modal is open or not\n */\n isOpen: PropTypes.bool,\n /**\n * Allows a function to be triggered once the modal is closed\n */\n onClose: PropTypes.func,\n /**\n * Allows a function to be triggered once the modal is opened\n */\n onAfterOpen: PropTypes.func,\n /**\n * Allows a function to be triggered once the modal open is confirmed\n */\n onConfirm: PropTypes.func,\n /**\n * Allows a function to be triggered once the modal open is rejected\n */\n onReject: PropTypes.func,\n /**\n * Text to be added in the reject button\n */\n rejectLabel: PropTypes.string,\n /**\n * If modal should close on overlay click\n */\n shouldCloseOnOverlayClick: PropTypes.bool,\n /**\n * Modal has error or not\n */\n hasError: PropTypes.bool,\n /**\n * Modal has warning or not\n */\n hasWarning: PropTypes.bool,\n /**\n * Modal has success or not\n */\n hasSuccess: PropTypes.bool,\n /**\n * Modal has info or not\n */\n hasInfo: PropTypes.bool,\n /**\n * Modal has help or not\n */\n hasHelp: PropTypes.bool,\n actionsRef: PropTypes.func,\n appElement: PropTypes.string,\n /**\n * Customized props for the confirm button\n */\n overridePropsConfirmButton: PropTypes.objectOf(PropTypes.shape({})),\n /**\n * Customized props for the reject button\n */\n overridePropsRejectButton: PropTypes.objectOf(PropTypes.string),\n /**\n * Show confirm button\n */\n showConfirmButton: PropTypes.bool,\n /**\n * Show confirm button\n */\n customCloseComponent: PropTypes.element,\n};\nexport { DSModalContent, DSModal };\nexport default DSModal;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,wBAAsB;AACtB,uBAA2B;AAC3B,qBAAsB;AACtB,sBAA0C;AAC1C,uBAAiC;AAEjC,MAAM,UAAU,CAAC,OAA6B;AAA7B,eAAE,YAAU,MAAZ,IAAkB,iBAAlB,IAAkB,CAAhB;AACjB,MAAI,YAAY;AAAG,WAAO,mDAAC,yBAAD,mBAAe;AACzC,SAAO,mDAAC,wBAAD,mBAAe;AAAA;AAGxB,QAAQ,YAAY;AAAA,EAClB,SAAS,0BAAU,MAAM,CAAC,GAAG;AAAA;AAG/B,uBAAU,YAAY;AAAA,EACpB,SAAS,0BAAU,MAAM,CAAC,GAAG;AAAA,EAC7B,WAAW,0BAAU;AAAA,EAIrB,0BAA0B,0BAAU;AAAA,EAIpC,OAAO,0BAAU,SAAS,0BAAU;AAAA,EAIpC,eAAe,0BAAU,MAAM;AAAA,EAI/B,WAAW,0BAAU,MAAM;AAAA,EAI3B,YAAY,0BAAU;AAAA,EAItB,YAAY,0BAAU;AAAA,EAItB,UAAU,0BAAU,QAAQ;AAAA,EAI5B,UAAU,0BAAU;AAAA,EAIpB,cAAc,0BAAU;AAAA,EAIxB,YAAY,0BAAU;AAAA,EAItB,MAAM,0BAAU,MAAM;AAAA,EAItB,QAAQ,0BAAU;AAAA,EAIlB,SAAS,0BAAU;AAAA,EAInB,aAAa,0BAAU;AAAA,EAIvB,WAAW,0BAAU;AAAA,EAIrB,UAAU,0BAAU;AAAA,EAIpB,aAAa,0BAAU;AAAA,EAIvB,2BAA2B,0BAAU;AAAA,EAIrC,UAAU,0BAAU;AAAA,EAIpB,YAAY,0BAAU;AAAA,EAItB,YAAY,0BAAU;AAAA,EAItB,SAAS,0BAAU;AAAA,EAInB,SAAS,0BAAU;AAAA,EACnB,YAAY,0BAAU;AAAA,EACtB,YAAY,0BAAU;AAAA,EAItB,4BAA4B,0BAAU,SAAS,0BAAU,MAAM;AAAA,EAI/D,2BAA2B,0BAAU,SAAS,0BAAU;AAAA,EAIxD,mBAAmB,0BAAU;AAAA,EAI7B,sBAAsB,0BAAU;AAAA;AAGlC,IAAO,kBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/v1/DSModal.js
CHANGED
|
@@ -53,7 +53,7 @@ var import_ds_icons = require("@elliemae/ds-icons");
|
|
|
53
53
|
var import_ds_button = __toESM(require("@elliemae/ds-button"));
|
|
54
54
|
var import_constants = __toESM(require("../constants"));
|
|
55
55
|
var import_ModalFeedBack = __toESM(require("./ModalFeedBack/ModalFeedBack"));
|
|
56
|
-
var
|
|
56
|
+
var import_ds_shared = require("@elliemae/ds-shared");
|
|
57
57
|
const DSModal = ({
|
|
58
58
|
containerProps = {},
|
|
59
59
|
className = "",
|
|
@@ -154,7 +154,7 @@ DSModal.propTypes = {
|
|
|
154
154
|
className: import_prop_types.default.string,
|
|
155
155
|
additionalFooterCssClass: import_prop_types.default.string,
|
|
156
156
|
style: import_prop_types.default.shape({}),
|
|
157
|
-
iconCloseSize: import_prop_types.default.oneOf(
|
|
157
|
+
iconCloseSize: import_prop_types.default.oneOf(import_ds_shared.iconSizes),
|
|
158
158
|
modalType: import_prop_types.default.oneOf(import_constants.modalTypes),
|
|
159
159
|
showHeader: import_prop_types.default.bool,
|
|
160
160
|
showFooter: import_prop_types.default.bool,
|
|
@@ -162,7 +162,7 @@ DSModal.propTypes = {
|
|
|
162
162
|
centered: import_prop_types.default.bool,
|
|
163
163
|
confirmLabel: import_prop_types.default.string,
|
|
164
164
|
modalTitle: import_prop_types.default.string,
|
|
165
|
-
size: import_prop_types.default.oneOf(
|
|
165
|
+
size: import_prop_types.default.oneOf(import_ds_shared.sizes),
|
|
166
166
|
isOpen: import_prop_types.default.bool,
|
|
167
167
|
onClose: import_prop_types.default.func,
|
|
168
168
|
onAfterOpen: import_prop_types.default.func,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/v1/DSModal.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport ReactModal from 'react-modal';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { DSIconSizes } from '@elliemae/ds-icon';\nimport { Close } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport MODAL_TYPE, { modalTypes } from '../constants';\nimport ModalFeedBack from './ModalFeedBack/ModalFeedBack';\nimport { sizes, iconSizes } from '@elliemae/ds-shared
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,wBAAsB;AACtB,yBAAuB;AACvB,2BAA0C;AAC1C,qBAA4B;AAC5B,sBAAsB;AACtB,uBAAqB;AACrB,uBAAuC;AACvC,2BAA0B;AAC1B,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport ReactModal from 'react-modal';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { DSIconSizes } from '@elliemae/ds-icon';\nimport { Close } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport MODAL_TYPE, { modalTypes } from '../constants';\nimport ModalFeedBack from './ModalFeedBack/ModalFeedBack';\nimport { sizes, iconSizes } from '@elliemae/ds-shared';\n\nconst DSModal = ({\n containerProps = {},\n className = '',\n dataTestId = 'ds-modal',\n additionalFooterCssClass = '',\n style = {},\n iconCloseSize = DSIconSizes.S,\n modalType = MODAL_TYPE.DEFAULT,\n showHeader = true,\n showFooter = true,\n children,\n centered = true,\n confirmLabel = 'Accept',\n modalTitle = '',\n size = 'medium',\n isOpen = false,\n onClose = () => null,\n onAfterOpen = () => null,\n onConfirm = () => null,\n onReject = () => null,\n rejectLabel = 'Cancel',\n shouldCloseOnOverlayClick = false,\n hasError = false,\n hasWarning = false,\n hasSuccess = false,\n hasInfo = false,\n hasHelp = false,\n actionsRef = () => null,\n appElement = '#root',\n overridePropsConfirmButton = {},\n overridePropsRejectButton = {},\n zIndex = 10,\n}) => {\n // http://reactcommunity.org/react-modal/accessibility/ https://github.com/reactjs/react-modal#examples\n typeof document !== 'undefined' && document && ReactModal.setAppElement && ReactModal.setAppElement(appElement); // eslint-disable-line\n const { cssClassName, classNameElement, classNameBlock, classNameModifier, classNameBlockModifier } =\n convertPropToCssClassName('modal', className, {\n hasError,\n hasWarning,\n hasSuccess,\n modalType,\n size,\n });\n\n const { WARNING, ERROR, SUCCESS, HELP, INFO } = MODAL_TYPE;\n\n const isAFeedbackType = [WARNING, ERROR, SUCCESS, HELP, INFO].indexOf(modalType) > -1;\n const showFeedBack = isAFeedbackType || hasError || hasWarning || hasSuccess || hasInfo || hasHelp;\n\n return (\n <ReactModal\n testId={dataTestId}\n className={cssClassName}\n contentLabel={modalTitle}\n isOpen={isOpen}\n onAfterOpen={onAfterOpen}\n onRequestClose={onClose}\n overlayClassName={`${classNameBlock('overlay')} ${classNameModifier(centered && 'center')}`}\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\n style={{\n content: {\n ...style,\n },\n overlay: {\n zIndex,\n },\n }}\n >\n <div {...containerProps}>\n {showHeader && (\n <div className={classNameBlock('modal-header')}>\n <div className={classNameElement('title', 'modal-header')}>{modalTitle}</div>\n <div className={classNameElement('icon', 'modal-header')}>\n <DSButton buttonType=\"link\" icon={<Close />} onClick={onClose} size={iconCloseSize} />\n </div>\n </div>\n )}\n <div className={classNameElement('body')}>\n {showFeedBack && (\n <ModalFeedBack\n hasError={hasError}\n hasHelp={hasHelp}\n hasInfo={hasInfo}\n hasSuccess={hasSuccess}\n hasWarning={hasWarning}\n modalType={modalType}\n />\n )}\n {children}\n </div>\n {showFooter && !isAFeedbackType && (\n <div\n className={`${classNameBlock('modal-footer')} ${\n additionalFooterCssClass ? classNameBlockModifier(additionalFooterCssClass, 'modal-footer') : ''\n }`}\n >\n <div ref={actionsRef} className={classNameBlock('modal-footer-actions')}>\n {modalType === MODAL_TYPE.CONFIRM && (\n <DSButton\n buttonType=\"secondary\"\n className={`${classNameElement('button-action')} ${classNameModifier('reject', 'button-action')} `}\n labelText={rejectLabel}\n onClick={onReject}\n {...overridePropsRejectButton}\n />\n )}\n <DSButton\n buttonType=\"primary\"\n className={`${classNameElement('button-action')} ${classNameModifier('confirm', 'button-action')} `}\n labelText={confirmLabel}\n onClick={onConfirm}\n {...overridePropsConfirmButton}\n />\n </div>\n </div>\n )}\n </div>\n </ReactModal>\n );\n};\n\nDSModal.propTypes = {\n className: PropTypes.string,\n /**\n * Add an additional css class to the footer\n */\n additionalFooterCssClass: PropTypes.string,\n /**\n * Set style for the modal\n */\n style: PropTypes.shape({}),\n /**\n * Select size for the close icon\n */\n iconCloseSize: PropTypes.oneOf(iconSizes),\n /**\n * ['default', 'alert', 'confirm', 'notification', 'warning', 'error', 'success', 'help', 'info']\n */\n modalType: PropTypes.oneOf(modalTypes),\n /**\n * Show the header or not\n */\n showHeader: PropTypes.bool,\n /**\n * Show the footer or not\n */\n showFooter: PropTypes.bool,\n /**\n * Main content of the modal\n */\n children: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.any]).isRequired,\n /**\n * Content is centered or not\n */\n centered: PropTypes.bool,\n /**\n * Text to be added in the confirm button\n */\n confirmLabel: PropTypes.string,\n /**\n * Text to be added in the modal title\n */\n modalTitle: PropTypes.string,\n /**\n * Text to be added in the modal title\n */\n size: PropTypes.oneOf(sizes),\n /**\n * Modal is open or not\n */\n isOpen: PropTypes.bool,\n /**\n * Allows a function to be triggered once the modal is closed\n */\n onClose: PropTypes.func,\n /**\n * Allows a function to be triggered once the modal is opened\n */\n onAfterOpen: PropTypes.func,\n /**\n * Allows a function to be triggered once the modal open is confirmed\n */\n onConfirm: PropTypes.func,\n /**\n * Allows a function to be triggered once the modal open is rejected\n */\n onReject: PropTypes.func,\n /**\n * Text to be added in the reject button\n */\n rejectLabel: PropTypes.string,\n /**\n * If modal should close on overlay click\n */\n shouldCloseOnOverlayClick: PropTypes.bool,\n /**\n * Modal has error or not\n */\n hasError: PropTypes.bool,\n /**\n * Modal has warning or not\n */\n hasWarning: PropTypes.bool,\n /**\n * Modal has success or not\n */\n hasSuccess: PropTypes.bool,\n /**\n * Modal has info or not\n */\n hasInfo: PropTypes.bool,\n /**\n * Modal has help or not\n */\n hasHelp: PropTypes.bool,\n actionsRef: PropTypes.func,\n appElement: PropTypes.string,\n /**\n * Customized props for the confirm button\n */\n overridePropsConfirmButton: PropTypes.shape({}),\n /**\n * Customized props for the reject button\n */\n overridePropsRejectButton: PropTypes.shape({}),\n};\n\nexport default DSModal;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,wBAAsB;AACtB,yBAAuB;AACvB,2BAA0C;AAC1C,qBAA4B;AAC5B,sBAAsB;AACtB,uBAAqB;AACrB,uBAAuC;AACvC,2BAA0B;AAC1B,uBAAiC;AAEjC,MAAM,UAAU,CAAC;AAAA,EACf,iBAAiB;AAAA,EACjB,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,2BAA2B;AAAA,EAC3B,QAAQ;AAAA,EACR,gBAAgB,2BAAY;AAA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,0BAAU;AAAA,EAItB,MAAM,0BAAU,MAAM;AAAA,EAItB,QAAQ,0BAAU;AAAA,EAIlB,SAAS,0BAAU;AAAA,EAInB,aAAa,0BAAU;AAAA,EAIvB,WAAW,0BAAU;AAAA,EAIrB,UAAU,0BAAU;AAAA,EAIpB,aAAa,0BAAU;AAAA,EAIvB,2BAA2B,0BAAU;AAAA,EAIrC,UAAU,0BAAU;AAAA,EAIpB,YAAY,0BAAU;AAAA,EAItB,YAAY,0BAAU;AAAA,EAItB,SAAS,0BAAU;AAAA,EAInB,SAAS,0BAAU;AAAA,EACnB,YAAY,0BAAU;AAAA,EACtB,YAAY,0BAAU;AAAA,EAItB,4BAA4B,0BAAU,MAAM;AAAA,EAI5C,2BAA2B,0BAAU,MAAM;AAAA;AAG7C,IAAO,kBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -86,6 +86,20 @@ var DSModalWrapper_default = (WrappedComponent) => {
|
|
|
86
86
|
this.setState({ actions: node });
|
|
87
87
|
this.handleResize();
|
|
88
88
|
};
|
|
89
|
+
this.handleResize = () => {
|
|
90
|
+
if (!this.state)
|
|
91
|
+
return null;
|
|
92
|
+
const { container, actions, childready } = this.state;
|
|
93
|
+
if (!childready)
|
|
94
|
+
return null;
|
|
95
|
+
this.setState({ additionalFooterCssClass: null });
|
|
96
|
+
const { clientWidth: containerWidth } = container;
|
|
97
|
+
const { clientWidth: actionsWidth } = actions;
|
|
98
|
+
if (containerWidth && actionsWidth && actionsWidth / containerWidth * 100 > 50) {
|
|
99
|
+
return this.setState({ additionalFooterCssClass: "fluid-actions" });
|
|
100
|
+
}
|
|
101
|
+
return this.setState({ additionalFooterCssClass: null });
|
|
102
|
+
};
|
|
89
103
|
}
|
|
90
104
|
componentDidMount() {
|
|
91
105
|
window.addEventListener("resize", this.handleResize);
|
|
@@ -93,20 +107,6 @@ var DSModalWrapper_default = (WrappedComponent) => {
|
|
|
93
107
|
componentWillUnmount() {
|
|
94
108
|
window.removeEventListener("resize", this.handleResize);
|
|
95
109
|
}
|
|
96
|
-
handleResize() {
|
|
97
|
-
if (!this.state)
|
|
98
|
-
return null;
|
|
99
|
-
const { container, actions, childready } = this.state;
|
|
100
|
-
if (!childready)
|
|
101
|
-
return null;
|
|
102
|
-
this.setState({ additionalFooterCssClass: null });
|
|
103
|
-
const { clientWidth: containerWidth } = container;
|
|
104
|
-
const { clientWidth: actionsWidth } = actions;
|
|
105
|
-
if (containerWidth && actionsWidth && actionsWidth / containerWidth * 100 > 50) {
|
|
106
|
-
return this.setState({ additionalFooterCssClass: "fluid-actions" });
|
|
107
|
-
}
|
|
108
|
-
return this.setState({ additionalFooterCssClass: null });
|
|
109
|
-
}
|
|
110
110
|
verifyNodes() {
|
|
111
111
|
const { modalType } = this.props;
|
|
112
112
|
if (modalType !== import_constants.MODAL_TYPE.DEFAULT) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/v1/DSModalWrapper.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { Component, createElement } from 'react';\nimport { MODAL_TYPE } from '../constants';\n\nexport default (WrappedComponent) => {\n class DSModalWrapper extends Component {\n state = {\n childready: false,\n additionalFooterCssClass: 'loading',\n container: null,\n actions: null,\n height: '100%',\n };\n\n componentDidMount() {\n window.addEventListener('resize', this.handleResize);\n }\n\n componentWillUnmount() {\n window.removeEventListener('resize', this.handleResize);\n }\n\n onHeaderHeight = (e) => {\n this.heightHeaderFlag = true;\n this.heightHeader = e.height || 0;\n };\n\n onFooterHeight = (e) => {\n this.heightFooterFlag = true;\n this.heightFooter = e.height || 0;\n };\n\n onResize = ({ bounds }) => {\n if (this.heightFooterFlag && this.heightHeaderFlag) {\n return this.setState({\n height: bounds.height - this.heightFooter - this.heightHeader,\n });\n }\n return setTimeout(this.onResize({ bounds }), 0);\n };\n\n handleContainer = (node) => {\n if (node) this.setState({ container: node });\n this.handleResize();\n };\n\n handleActions = (node) => {\n if (node) this.setState({ actions: node });\n this.handleResize();\n };\n\n /**\n * Change button width to 100% if the\n * combined width of the button (or button group) exceed 50% of the container width.\n */\n handleResize() {\n if (!this.state) return null;\n const { container, actions, childready } = this.state;\n if (!childready) return null;\n this.setState({ additionalFooterCssClass: null }); // !important reset to default state to recalculate\n const { clientWidth: containerWidth } = container;\n const { clientWidth: actionsWidth } = actions;\n // Change button width to 100% if the combined width of the button (or button group) exceed 50% of the container width.\n if (\n containerWidth &&\n actionsWidth &&\n (actionsWidth / containerWidth) * 100 > 50\n ) {\n return this.setState({ additionalFooterCssClass: 'fluid-actions' });\n }\n return this.setState({ additionalFooterCssClass: null });\n }\n\n verifyNodes() {\n const { modalType } = this.props;\n if (modalType !== MODAL_TYPE.DEFAULT) {\n const nodesInterval = setInterval(() => {\n // !important it checks when nodes are availables\n const { container, actions } = this.state;\n if (!container || !actions) return null;\n clearInterval(nodesInterval);\n this.setState({ childready: true });\n return this.handleResize();\n }, 100);\n }\n }\n\n render() {\n const { props, state } = this;\n const { additionalFooterCssClass, height } = state;\n return createElement(WrappedComponent, {\n ...props,\n height,\n onResize: this.onResize,\n onFooterHeight: this.onFooterHeight,\n onHeaderHeight: this.onHeaderHeight,\n containerRef: this.handleContainer,\n actionsRef: this.handleActions,\n additionalFooterCssClass,\n onAfterOpen: () => {\n if (props.onAfterOpen) props.onAfterOpen();\n this.verifyNodes();\n },\n });\n }\n }\n\n return DSModalWrapper;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAyC;AACzC,uBAA2B;AAE3B,IAAO,yBAAQ,CAAC,qBAAqB;AACnC,+BAA6B,uBAAU;AAAA,IAAvC,cAJF;AAIE;AACE,mBAAQ;AAAA,QACN,YAAY;AAAA,QACZ,0BAA0B;AAAA,QAC1B,WAAW;AAAA,QACX,SAAS;AAAA,QACT,QAAQ;AAAA;AAWV,4BAAiB,CAAC,MAAM;AACtB,aAAK,mBAAmB;AACxB,aAAK,eAAe,EAAE,UAAU;AAAA;AAGlC,4BAAiB,CAAC,MAAM;AACtB,aAAK,mBAAmB;AACxB,aAAK,eAAe,EAAE,UAAU;AAAA;AAGlC,sBAAW,CAAC,EAAE,aAAa;AACzB,YAAI,KAAK,oBAAoB,KAAK,kBAAkB;AAClD,iBAAO,KAAK,SAAS;AAAA,YACnB,QAAQ,OAAO,SAAS,KAAK,eAAe,KAAK;AAAA;AAAA;AAGrD,eAAO,WAAW,KAAK,SAAS,EAAE,WAAW;AAAA;AAG/C,6BAAkB,CAAC,SAAS;AAC1B,YAAI;AAAM,eAAK,SAAS,EAAE,WAAW;AACrC,aAAK;AAAA;AAGP,2BAAgB,CAAC,SAAS;AACxB,YAAI;AAAM,eAAK,SAAS,EAAE,SAAS;AACnC,aAAK;AAAA;
|
|
4
|
+
"sourcesContent": ["import { Component, createElement } from 'react';\nimport { MODAL_TYPE } from '../constants';\n\nexport default (WrappedComponent) => {\n class DSModalWrapper extends Component {\n state = {\n childready: false,\n additionalFooterCssClass: 'loading',\n container: null,\n actions: null,\n height: '100%',\n };\n\n componentDidMount() {\n window.addEventListener('resize', this.handleResize);\n }\n\n componentWillUnmount() {\n window.removeEventListener('resize', this.handleResize);\n }\n\n onHeaderHeight = (e) => {\n this.heightHeaderFlag = true;\n this.heightHeader = e.height || 0;\n };\n\n onFooterHeight = (e) => {\n this.heightFooterFlag = true;\n this.heightFooter = e.height || 0;\n };\n\n onResize = ({ bounds }) => {\n if (this.heightFooterFlag && this.heightHeaderFlag) {\n return this.setState({\n height: bounds.height - this.heightFooter - this.heightHeader,\n });\n }\n return setTimeout(this.onResize({ bounds }), 0);\n };\n\n handleContainer = (node) => {\n if (node) this.setState({ container: node });\n this.handleResize();\n };\n\n handleActions = (node) => {\n if (node) this.setState({ actions: node });\n this.handleResize();\n };\n\n /**\n * Change button width to 100% if the\n * combined width of the button (or button group) exceed 50% of the container width.\n */\n handleResize = () => {\n if (!this.state) return null;\n const { container, actions, childready } = this.state;\n if (!childready) return null;\n this.setState({ additionalFooterCssClass: null }); // !important reset to default state to recalculate\n const { clientWidth: containerWidth } = container;\n const { clientWidth: actionsWidth } = actions;\n // Change button width to 100% if the combined width of the button (or button group) exceed 50% of the container width.\n if (\n containerWidth &&\n actionsWidth &&\n (actionsWidth / containerWidth) * 100 > 50\n ) {\n return this.setState({ additionalFooterCssClass: 'fluid-actions' });\n }\n return this.setState({ additionalFooterCssClass: null });\n }\n\n verifyNodes() {\n const { modalType } = this.props;\n if (modalType !== MODAL_TYPE.DEFAULT) {\n const nodesInterval = setInterval(() => {\n // !important it checks when nodes are availables\n const { container, actions } = this.state;\n if (!container || !actions) return null;\n clearInterval(nodesInterval);\n this.setState({ childready: true });\n return this.handleResize();\n }, 100);\n }\n }\n\n render() {\n const { props, state } = this;\n const { additionalFooterCssClass, height } = state;\n return createElement(WrappedComponent, {\n ...props,\n height,\n onResize: this.onResize,\n onFooterHeight: this.onFooterHeight,\n onHeaderHeight: this.onHeaderHeight,\n containerRef: this.handleContainer,\n actionsRef: this.handleActions,\n additionalFooterCssClass,\n onAfterOpen: () => {\n if (props.onAfterOpen) props.onAfterOpen();\n this.verifyNodes();\n },\n });\n }\n }\n\n return DSModalWrapper;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAyC;AACzC,uBAA2B;AAE3B,IAAO,yBAAQ,CAAC,qBAAqB;AACnC,+BAA6B,uBAAU;AAAA,IAAvC,cAJF;AAIE;AACE,mBAAQ;AAAA,QACN,YAAY;AAAA,QACZ,0BAA0B;AAAA,QAC1B,WAAW;AAAA,QACX,SAAS;AAAA,QACT,QAAQ;AAAA;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;AAAS,mBAAO;AACnC,wBAAc;AACd,eAAK,SAAS,EAAE,YAAY;AAC5B,iBAAO,KAAK;AAAA,WACX;AAAA;AAAA;AAAA,IAIP,SAAS;AACP,YAAM,EAAE,OAAO,UAAU;AACzB,YAAM,EAAE,0BAA0B,WAAW;AAC7C,aAAO,gCAAc,kBAAkB,iCAClC,QADkC;AAAA,QAErC;AAAA,QACA,UAAU,KAAK;AAAA,QACf,gBAAgB,KAAK;AAAA,QACrB,gBAAgB,KAAK;AAAA,QACrB,cAAc,KAAK;AAAA,QACnB,YAAY,KAAK;AAAA,QACjB;AAAA,QACA,aAAa,MAAM;AACjB,cAAI,MAAM;AAAa,kBAAM;AAC7B,eAAK;AAAA;AAAA;AAAA;AAAA;AAMb,SAAO;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/DSModal.js
CHANGED
|
@@ -32,7 +32,7 @@ import PropTypes from "prop-types";
|
|
|
32
32
|
import { modalTypes } from "./constants";
|
|
33
33
|
import DSModalV1 from "./v1/DSModal";
|
|
34
34
|
import DSModalV2, { DSModalContent } from "./v2/DSModal";
|
|
35
|
-
import { sizes, iconSizes } from "@elliemae/ds-shared
|
|
35
|
+
import { sizes, iconSizes } from "@elliemae/ds-shared";
|
|
36
36
|
const DSModal = (_a) => {
|
|
37
37
|
var _b = _a, { version = 1 } = _b, rest = __objRest(_b, ["version"]);
|
|
38
38
|
if (version === 2)
|
package/dist/esm/DSModal.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSModal.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { modalTypes } from './constants';\nimport DSModalV1 from './v1/DSModal';\nimport DSModalV2, { DSModalContent } from './v2/DSModal';\nimport { sizes, iconSizes } from '@elliemae/ds-shared
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { modalTypes } from './constants';\nimport DSModalV1 from './v1/DSModal';\nimport DSModalV2, { DSModalContent } from './v2/DSModal';\nimport { sizes, iconSizes } from '@elliemae/ds-shared';\n\nconst DSModal = ({ version = 1, ...rest }) => {\n if (version === 2) return <DSModalV2 {...rest} />;\n return <DSModalV1 {...rest} />;\n};\n\nDSModal.propTypes = {\n version: PropTypes.oneOf([1, 2]),\n};\n\nDSModalV1.propTypes = {\n version: PropTypes.oneOf([1, 2]),\n className: PropTypes.string,\n /**\n * Add an additional css class to the footer\n */\n additionalFooterCssClass: PropTypes.string,\n /**\n * Set style for the modal\n */\n style: PropTypes.objectOf(PropTypes.string),\n /**\n * Select size for the close icon\n */\n iconCloseSize: PropTypes.oneOf(iconSizes),\n /**\n * ['default', 'alert', 'confirm', 'notification', 'warning', 'error', 'success', 'help', 'info']\n */\n modalType: PropTypes.oneOf(modalTypes),\n /**\n * Show the header or not\n */\n showHeader: PropTypes.bool,\n /**\n * Show the footer or not\n */\n showFooter: PropTypes.bool,\n /**\n * Main content of the modal\n */\n children: PropTypes.element.isRequired,\n /**\n * Content is centered or not\n */\n centered: PropTypes.bool,\n /**\n * Text to be added in the confirm button\n */\n confirmLabel: PropTypes.string,\n /**\n * Text to be added in the modal title\n */\n modalTitle: PropTypes.string,\n /**\n * Text to be added in the modal title\n */\n size: PropTypes.oneOf(sizes),\n /**\n * Modal is open or not\n */\n isOpen: PropTypes.bool,\n /**\n * Allows a function to be triggered once the modal is closed\n */\n onClose: PropTypes.func,\n /**\n * Allows a function to be triggered once the modal is opened\n */\n onAfterOpen: PropTypes.func,\n /**\n * Allows a function to be triggered once the modal open is confirmed\n */\n onConfirm: PropTypes.func,\n /**\n * Allows a function to be triggered once the modal open is rejected\n */\n onReject: PropTypes.func,\n /**\n * Text to be added in the reject button\n */\n rejectLabel: PropTypes.string,\n /**\n * If modal should close on overlay click\n */\n shouldCloseOnOverlayClick: PropTypes.bool,\n /**\n * Modal has error or not\n */\n hasError: PropTypes.bool,\n /**\n * Modal has warning or not\n */\n hasWarning: PropTypes.bool,\n /**\n * Modal has success or not\n */\n hasSuccess: PropTypes.bool,\n /**\n * Modal has info or not\n */\n hasInfo: PropTypes.bool,\n /**\n * Modal has help or not\n */\n hasHelp: PropTypes.bool,\n actionsRef: PropTypes.func,\n appElement: PropTypes.string,\n /**\n * Customized props for the confirm button\n */\n overridePropsConfirmButton: PropTypes.objectOf(PropTypes.shape({})),\n /**\n * Customized props for the reject button\n */\n overridePropsRejectButton: PropTypes.objectOf(PropTypes.string),\n /**\n * Show confirm button\n */\n showConfirmButton: PropTypes.bool,\n /**\n * Show confirm button\n */\n customCloseComponent: PropTypes.element,\n};\nexport { DSModalContent, DSModal };\nexport default DSModal;\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,UAAU,CAAC,OAA6B;AAA7B,eAAE,YAAU,MAAZ,IAAkB,iBAAlB,IAAkB,CAAhB;AACjB,MAAI,YAAY;AAAG,WAAO,qCAAC,WAAD,mBAAe;AACzC,SAAO,qCAAC,WAAD,mBAAe;AAAA;AAGxB,QAAQ,YAAY;AAAA,EAClB,SAAS,UAAU,MAAM,CAAC,GAAG;AAAA;AAG/B,UAAU,YAAY;AAAA,EACpB,SAAS,UAAU,MAAM,CAAC,GAAG;AAAA,EAC7B,WAAW,UAAU;AAAA,EAIrB,0BAA0B,UAAU;AAAA,EAIpC,OAAO,UAAU,SAAS,UAAU;AAAA,EAIpC,eAAe,UAAU,MAAM;AAAA,EAI/B,WAAW,UAAU,MAAM;AAAA,EAI3B,YAAY,UAAU;AAAA,EAItB,YAAY,UAAU;AAAA,EAItB,UAAU,UAAU,QAAQ;AAAA,EAI5B,UAAU,UAAU;AAAA,EAIpB,cAAc,UAAU;AAAA,EAIxB,YAAY,UAAU;AAAA,EAItB,MAAM,UAAU,MAAM;AAAA,EAItB,QAAQ,UAAU;AAAA,EAIlB,SAAS,UAAU;AAAA,EAInB,aAAa,UAAU;AAAA,EAIvB,WAAW,UAAU;AAAA,EAIrB,UAAU,UAAU;AAAA,EAIpB,aAAa,UAAU;AAAA,EAIvB,2BAA2B,UAAU;AAAA,EAIrC,UAAU,UAAU;AAAA,EAIpB,YAAY,UAAU;AAAA,EAItB,YAAY,UAAU;AAAA,EAItB,SAAS,UAAU;AAAA,EAInB,SAAS,UAAU;AAAA,EACnB,YAAY,UAAU;AAAA,EACtB,YAAY,UAAU;AAAA,EAItB,4BAA4B,UAAU,SAAS,UAAU,MAAM;AAAA,EAI/D,2BAA2B,UAAU,SAAS,UAAU;AAAA,EAIxD,mBAAmB,UAAU;AAAA,EAI7B,sBAAsB,UAAU;AAAA;AAGlC,IAAO,kBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/v1/DSModal.js
CHANGED
|
@@ -24,7 +24,7 @@ import { Close } from "@elliemae/ds-icons";
|
|
|
24
24
|
import DSButton from "@elliemae/ds-button";
|
|
25
25
|
import MODAL_TYPE, { modalTypes } from "../constants";
|
|
26
26
|
import ModalFeedBack from "./ModalFeedBack/ModalFeedBack";
|
|
27
|
-
import { sizes, iconSizes } from "@elliemae/ds-shared
|
|
27
|
+
import { sizes, iconSizes } from "@elliemae/ds-shared";
|
|
28
28
|
const DSModal = ({
|
|
29
29
|
containerProps = {},
|
|
30
30
|
className = "",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/v1/DSModal.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport ReactModal from 'react-modal';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { DSIconSizes } from '@elliemae/ds-icon';\nimport { Close } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport MODAL_TYPE, { modalTypes } from '../constants';\nimport ModalFeedBack from './ModalFeedBack/ModalFeedBack';\nimport { sizes, iconSizes } from '@elliemae/ds-shared
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport ReactModal from 'react-modal';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { DSIconSizes } from '@elliemae/ds-icon';\nimport { Close } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport MODAL_TYPE, { modalTypes } from '../constants';\nimport ModalFeedBack from './ModalFeedBack/ModalFeedBack';\nimport { sizes, iconSizes } from '@elliemae/ds-shared';\n\nconst DSModal = ({\n containerProps = {},\n className = '',\n dataTestId = 'ds-modal',\n additionalFooterCssClass = '',\n style = {},\n iconCloseSize = DSIconSizes.S,\n modalType = MODAL_TYPE.DEFAULT,\n showHeader = true,\n showFooter = true,\n children,\n centered = true,\n confirmLabel = 'Accept',\n modalTitle = '',\n size = 'medium',\n isOpen = false,\n onClose = () => null,\n onAfterOpen = () => null,\n onConfirm = () => null,\n onReject = () => null,\n rejectLabel = 'Cancel',\n shouldCloseOnOverlayClick = false,\n hasError = false,\n hasWarning = false,\n hasSuccess = false,\n hasInfo = false,\n hasHelp = false,\n actionsRef = () => null,\n appElement = '#root',\n overridePropsConfirmButton = {},\n overridePropsRejectButton = {},\n zIndex = 10,\n}) => {\n // http://reactcommunity.org/react-modal/accessibility/ https://github.com/reactjs/react-modal#examples\n typeof document !== 'undefined' && document && ReactModal.setAppElement && ReactModal.setAppElement(appElement); // eslint-disable-line\n const { cssClassName, classNameElement, classNameBlock, classNameModifier, classNameBlockModifier } =\n convertPropToCssClassName('modal', className, {\n hasError,\n hasWarning,\n hasSuccess,\n modalType,\n size,\n });\n\n const { WARNING, ERROR, SUCCESS, HELP, INFO } = MODAL_TYPE;\n\n const isAFeedbackType = [WARNING, ERROR, SUCCESS, HELP, INFO].indexOf(modalType) > -1;\n const showFeedBack = isAFeedbackType || hasError || hasWarning || hasSuccess || hasInfo || hasHelp;\n\n return (\n <ReactModal\n testId={dataTestId}\n className={cssClassName}\n contentLabel={modalTitle}\n isOpen={isOpen}\n onAfterOpen={onAfterOpen}\n onRequestClose={onClose}\n overlayClassName={`${classNameBlock('overlay')} ${classNameModifier(centered && 'center')}`}\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\n style={{\n content: {\n ...style,\n },\n overlay: {\n zIndex,\n },\n }}\n >\n <div {...containerProps}>\n {showHeader && (\n <div className={classNameBlock('modal-header')}>\n <div className={classNameElement('title', 'modal-header')}>{modalTitle}</div>\n <div className={classNameElement('icon', 'modal-header')}>\n <DSButton buttonType=\"link\" icon={<Close />} onClick={onClose} size={iconCloseSize} />\n </div>\n </div>\n )}\n <div className={classNameElement('body')}>\n {showFeedBack && (\n <ModalFeedBack\n hasError={hasError}\n hasHelp={hasHelp}\n hasInfo={hasInfo}\n hasSuccess={hasSuccess}\n hasWarning={hasWarning}\n modalType={modalType}\n />\n )}\n {children}\n </div>\n {showFooter && !isAFeedbackType && (\n <div\n className={`${classNameBlock('modal-footer')} ${\n additionalFooterCssClass ? classNameBlockModifier(additionalFooterCssClass, 'modal-footer') : ''\n }`}\n >\n <div ref={actionsRef} className={classNameBlock('modal-footer-actions')}>\n {modalType === MODAL_TYPE.CONFIRM && (\n <DSButton\n buttonType=\"secondary\"\n className={`${classNameElement('button-action')} ${classNameModifier('reject', 'button-action')} `}\n labelText={rejectLabel}\n onClick={onReject}\n {...overridePropsRejectButton}\n />\n )}\n <DSButton\n buttonType=\"primary\"\n className={`${classNameElement('button-action')} ${classNameModifier('confirm', 'button-action')} `}\n labelText={confirmLabel}\n onClick={onConfirm}\n {...overridePropsConfirmButton}\n />\n </div>\n </div>\n )}\n </div>\n </ReactModal>\n );\n};\n\nDSModal.propTypes = {\n className: PropTypes.string,\n /**\n * Add an additional css class to the footer\n */\n additionalFooterCssClass: PropTypes.string,\n /**\n * Set style for the modal\n */\n style: PropTypes.shape({}),\n /**\n * Select size for the close icon\n */\n iconCloseSize: PropTypes.oneOf(iconSizes),\n /**\n * ['default', 'alert', 'confirm', 'notification', 'warning', 'error', 'success', 'help', 'info']\n */\n modalType: PropTypes.oneOf(modalTypes),\n /**\n * Show the header or not\n */\n showHeader: PropTypes.bool,\n /**\n * Show the footer or not\n */\n showFooter: PropTypes.bool,\n /**\n * Main content of the modal\n */\n children: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.any]).isRequired,\n /**\n * Content is centered or not\n */\n centered: PropTypes.bool,\n /**\n * Text to be added in the confirm button\n */\n confirmLabel: PropTypes.string,\n /**\n * Text to be added in the modal title\n */\n modalTitle: PropTypes.string,\n /**\n * Text to be added in the modal title\n */\n size: PropTypes.oneOf(sizes),\n /**\n * Modal is open or not\n */\n isOpen: PropTypes.bool,\n /**\n * Allows a function to be triggered once the modal is closed\n */\n onClose: PropTypes.func,\n /**\n * Allows a function to be triggered once the modal is opened\n */\n onAfterOpen: PropTypes.func,\n /**\n * Allows a function to be triggered once the modal open is confirmed\n */\n onConfirm: PropTypes.func,\n /**\n * Allows a function to be triggered once the modal open is rejected\n */\n onReject: PropTypes.func,\n /**\n * Text to be added in the reject button\n */\n rejectLabel: PropTypes.string,\n /**\n * If modal should close on overlay click\n */\n shouldCloseOnOverlayClick: PropTypes.bool,\n /**\n * Modal has error or not\n */\n hasError: PropTypes.bool,\n /**\n * Modal has warning or not\n */\n hasWarning: PropTypes.bool,\n /**\n * Modal has success or not\n */\n hasSuccess: PropTypes.bool,\n /**\n * Modal has info or not\n */\n hasInfo: PropTypes.bool,\n /**\n * Modal has help or not\n */\n hasHelp: PropTypes.bool,\n actionsRef: PropTypes.func,\n appElement: PropTypes.string,\n /**\n * Customized props for the confirm button\n */\n overridePropsConfirmButton: PropTypes.shape({}),\n /**\n * Customized props for the reject button\n */\n overridePropsRejectButton: PropTypes.shape({}),\n};\n\nexport default DSModal;\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,UAAU,CAAC;AAAA,EACf,iBAAiB;AAAA,EACjB,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,2BAA2B;AAAA,EAC3B,QAAQ;AAAA,EACR,gBAAgB,YAAY;AAAA,EAC5B,YAAY,WAAW;AAAA,EACvB,aAAa;AAAA,EACb,aAAa;AAAA,EACb;AAAA,EACA,WAAW;AAAA,EACX,eAAe;AAAA,EACf,aAAa;AAAA,EACb,OAAO;AAAA,EACP,SAAS;AAAA,EACT,UAAU,MAAM;AAAA,EAChB,cAAc,MAAM;AAAA,EACpB,YAAY,MAAM;AAAA,EAClB,WAAW,MAAM;AAAA,EACjB,cAAc;AAAA,EACd,4BAA4B;AAAA,EAC5B,WAAW;AAAA,EACX,aAAa;AAAA,EACb,aAAa;AAAA,EACb,UAAU;AAAA,EACV,UAAU;AAAA,EACV,aAAa,MAAM;AAAA,EACnB,aAAa;AAAA,EACb,6BAA6B;AAAA,EAC7B,4BAA4B;AAAA,EAC5B,SAAS;AAAA,MACL;AAEJ,SAAO,aAAa,eAAe,YAAY,WAAW,iBAAiB,WAAW,cAAc;AACpG,QAAM,EAAE,cAAc,kBAAkB,gBAAgB,mBAAmB,2BACzE,0BAA0B,SAAS,WAAW;AAAA,IAC5C;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGJ,QAAM,EAAE,SAAS,OAAO,SAAS,MAAM,SAAS;AAEhD,QAAM,kBAAkB,CAAC,SAAS,OAAO,SAAS,MAAM,MAAM,QAAQ,aAAa;AACnF,QAAM,eAAe,mBAAmB,YAAY,cAAc,cAAc,WAAW;AAE3F,SACE,qCAAC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AAA,EAClB,WAAW,UAAU;AAAA,EAIrB,0BAA0B,UAAU;AAAA,EAIpC,OAAO,UAAU,MAAM;AAAA,EAIvB,eAAe,UAAU,MAAM;AAAA,EAI/B,WAAW,UAAU,MAAM;AAAA,EAI3B,YAAY,UAAU;AAAA,EAItB,YAAY,UAAU;AAAA,EAItB,UAAU,UAAU,UAAU,CAAC,UAAU,SAAS,UAAU,QAAQ,UAAU,MAAM;AAAA,EAIpF,UAAU,UAAU;AAAA,EAIpB,cAAc,UAAU;AAAA,EAIxB,YAAY,UAAU;AAAA,EAItB,MAAM,UAAU,MAAM;AAAA,EAItB,QAAQ,UAAU;AAAA,EAIlB,SAAS,UAAU;AAAA,EAInB,aAAa,UAAU;AAAA,EAIvB,WAAW,UAAU;AAAA,EAIrB,UAAU,UAAU;AAAA,EAIpB,aAAa,UAAU;AAAA,EAIvB,2BAA2B,UAAU;AAAA,EAIrC,UAAU,UAAU;AAAA,EAIpB,YAAY,UAAU;AAAA,EAItB,YAAY,UAAU;AAAA,EAItB,SAAS,UAAU;AAAA,EAInB,SAAS,UAAU;AAAA,EACnB,YAAY,UAAU;AAAA,EACtB,YAAY,UAAU;AAAA,EAItB,4BAA4B,UAAU,MAAM;AAAA,EAI5C,2BAA2B,UAAU,MAAM;AAAA;AAG7C,IAAO,kBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -57,6 +57,20 @@ var DSModalWrapper_default = (WrappedComponent) => {
|
|
|
57
57
|
this.setState({ actions: node });
|
|
58
58
|
this.handleResize();
|
|
59
59
|
};
|
|
60
|
+
this.handleResize = () => {
|
|
61
|
+
if (!this.state)
|
|
62
|
+
return null;
|
|
63
|
+
const { container, actions, childready } = this.state;
|
|
64
|
+
if (!childready)
|
|
65
|
+
return null;
|
|
66
|
+
this.setState({ additionalFooterCssClass: null });
|
|
67
|
+
const { clientWidth: containerWidth } = container;
|
|
68
|
+
const { clientWidth: actionsWidth } = actions;
|
|
69
|
+
if (containerWidth && actionsWidth && actionsWidth / containerWidth * 100 > 50) {
|
|
70
|
+
return this.setState({ additionalFooterCssClass: "fluid-actions" });
|
|
71
|
+
}
|
|
72
|
+
return this.setState({ additionalFooterCssClass: null });
|
|
73
|
+
};
|
|
60
74
|
}
|
|
61
75
|
componentDidMount() {
|
|
62
76
|
window.addEventListener("resize", this.handleResize);
|
|
@@ -64,20 +78,6 @@ var DSModalWrapper_default = (WrappedComponent) => {
|
|
|
64
78
|
componentWillUnmount() {
|
|
65
79
|
window.removeEventListener("resize", this.handleResize);
|
|
66
80
|
}
|
|
67
|
-
handleResize() {
|
|
68
|
-
if (!this.state)
|
|
69
|
-
return null;
|
|
70
|
-
const { container, actions, childready } = this.state;
|
|
71
|
-
if (!childready)
|
|
72
|
-
return null;
|
|
73
|
-
this.setState({ additionalFooterCssClass: null });
|
|
74
|
-
const { clientWidth: containerWidth } = container;
|
|
75
|
-
const { clientWidth: actionsWidth } = actions;
|
|
76
|
-
if (containerWidth && actionsWidth && actionsWidth / containerWidth * 100 > 50) {
|
|
77
|
-
return this.setState({ additionalFooterCssClass: "fluid-actions" });
|
|
78
|
-
}
|
|
79
|
-
return this.setState({ additionalFooterCssClass: null });
|
|
80
|
-
}
|
|
81
81
|
verifyNodes() {
|
|
82
82
|
const { modalType } = this.props;
|
|
83
83
|
if (modalType !== MODAL_TYPE.DEFAULT) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/v1/DSModalWrapper.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { Component, createElement } from 'react';\nimport { MODAL_TYPE } from '../constants';\n\nexport default (WrappedComponent) => {\n class DSModalWrapper extends Component {\n state = {\n childready: false,\n additionalFooterCssClass: 'loading',\n container: null,\n actions: null,\n height: '100%',\n };\n\n componentDidMount() {\n window.addEventListener('resize', this.handleResize);\n }\n\n componentWillUnmount() {\n window.removeEventListener('resize', this.handleResize);\n }\n\n onHeaderHeight = (e) => {\n this.heightHeaderFlag = true;\n this.heightHeader = e.height || 0;\n };\n\n onFooterHeight = (e) => {\n this.heightFooterFlag = true;\n this.heightFooter = e.height || 0;\n };\n\n onResize = ({ bounds }) => {\n if (this.heightFooterFlag && this.heightHeaderFlag) {\n return this.setState({\n height: bounds.height - this.heightFooter - this.heightHeader,\n });\n }\n return setTimeout(this.onResize({ bounds }), 0);\n };\n\n handleContainer = (node) => {\n if (node) this.setState({ container: node });\n this.handleResize();\n };\n\n handleActions = (node) => {\n if (node) this.setState({ actions: node });\n this.handleResize();\n };\n\n /**\n * Change button width to 100% if the\n * combined width of the button (or button group) exceed 50% of the container width.\n */\n handleResize() {\n if (!this.state) return null;\n const { container, actions, childready } = this.state;\n if (!childready) return null;\n this.setState({ additionalFooterCssClass: null }); // !important reset to default state to recalculate\n const { clientWidth: containerWidth } = container;\n const { clientWidth: actionsWidth } = actions;\n // Change button width to 100% if the combined width of the button (or button group) exceed 50% of the container width.\n if (\n containerWidth &&\n actionsWidth &&\n (actionsWidth / containerWidth) * 100 > 50\n ) {\n return this.setState({ additionalFooterCssClass: 'fluid-actions' });\n }\n return this.setState({ additionalFooterCssClass: null });\n }\n\n verifyNodes() {\n const { modalType } = this.props;\n if (modalType !== MODAL_TYPE.DEFAULT) {\n const nodesInterval = setInterval(() => {\n // !important it checks when nodes are availables\n const { container, actions } = this.state;\n if (!container || !actions) return null;\n clearInterval(nodesInterval);\n this.setState({ childready: true });\n return this.handleResize();\n }, 100);\n }\n }\n\n render() {\n const { props, state } = this;\n const { additionalFooterCssClass, height } = state;\n return createElement(WrappedComponent, {\n ...props,\n height,\n onResize: this.onResize,\n onFooterHeight: this.onFooterHeight,\n onHeaderHeight: this.onHeaderHeight,\n containerRef: this.handleContainer,\n actionsRef: this.handleActions,\n additionalFooterCssClass,\n onAfterOpen: () => {\n if (props.onAfterOpen) props.onAfterOpen();\n this.verifyNodes();\n },\n });\n }\n }\n\n return DSModalWrapper;\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AAEA,IAAO,yBAAQ,CAAC,qBAAqB;AACnC,+BAA6B,UAAU;AAAA,IAAvC,cAJF;AAIE;AACE,mBAAQ;AAAA,QACN,YAAY;AAAA,QACZ,0BAA0B;AAAA,QAC1B,WAAW;AAAA,QACX,SAAS;AAAA,QACT,QAAQ;AAAA;AAWV,4BAAiB,CAAC,MAAM;AACtB,aAAK,mBAAmB;AACxB,aAAK,eAAe,EAAE,UAAU;AAAA;AAGlC,4BAAiB,CAAC,MAAM;AACtB,aAAK,mBAAmB;AACxB,aAAK,eAAe,EAAE,UAAU;AAAA;AAGlC,sBAAW,CAAC,EAAE,aAAa;AACzB,YAAI,KAAK,oBAAoB,KAAK,kBAAkB;AAClD,iBAAO,KAAK,SAAS;AAAA,YACnB,QAAQ,OAAO,SAAS,KAAK,eAAe,KAAK;AAAA;AAAA;AAGrD,eAAO,WAAW,KAAK,SAAS,EAAE,WAAW;AAAA;AAG/C,6BAAkB,CAAC,SAAS;AAC1B,YAAI;AAAM,eAAK,SAAS,EAAE,WAAW;AACrC,aAAK;AAAA;AAGP,2BAAgB,CAAC,SAAS;AACxB,YAAI;AAAM,eAAK,SAAS,EAAE,SAAS;AACnC,aAAK;AAAA;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { Component, createElement } from 'react';\nimport { MODAL_TYPE } from '../constants';\n\nexport default (WrappedComponent) => {\n class DSModalWrapper extends Component {\n state = {\n childready: false,\n additionalFooterCssClass: 'loading',\n container: null,\n actions: null,\n height: '100%',\n };\n\n componentDidMount() {\n window.addEventListener('resize', this.handleResize);\n }\n\n componentWillUnmount() {\n window.removeEventListener('resize', this.handleResize);\n }\n\n onHeaderHeight = (e) => {\n this.heightHeaderFlag = true;\n this.heightHeader = e.height || 0;\n };\n\n onFooterHeight = (e) => {\n this.heightFooterFlag = true;\n this.heightFooter = e.height || 0;\n };\n\n onResize = ({ bounds }) => {\n if (this.heightFooterFlag && this.heightHeaderFlag) {\n return this.setState({\n height: bounds.height - this.heightFooter - this.heightHeader,\n });\n }\n return setTimeout(this.onResize({ bounds }), 0);\n };\n\n handleContainer = (node) => {\n if (node) this.setState({ container: node });\n this.handleResize();\n };\n\n handleActions = (node) => {\n if (node) this.setState({ actions: node });\n this.handleResize();\n };\n\n /**\n * Change button width to 100% if the\n * combined width of the button (or button group) exceed 50% of the container width.\n */\n handleResize = () => {\n if (!this.state) return null;\n const { container, actions, childready } = this.state;\n if (!childready) return null;\n this.setState({ additionalFooterCssClass: null }); // !important reset to default state to recalculate\n const { clientWidth: containerWidth } = container;\n const { clientWidth: actionsWidth } = actions;\n // Change button width to 100% if the combined width of the button (or button group) exceed 50% of the container width.\n if (\n containerWidth &&\n actionsWidth &&\n (actionsWidth / containerWidth) * 100 > 50\n ) {\n return this.setState({ additionalFooterCssClass: 'fluid-actions' });\n }\n return this.setState({ additionalFooterCssClass: null });\n }\n\n verifyNodes() {\n const { modalType } = this.props;\n if (modalType !== MODAL_TYPE.DEFAULT) {\n const nodesInterval = setInterval(() => {\n // !important it checks when nodes are availables\n const { container, actions } = this.state;\n if (!container || !actions) return null;\n clearInterval(nodesInterval);\n this.setState({ childready: true });\n return this.handleResize();\n }, 100);\n }\n }\n\n render() {\n const { props, state } = this;\n const { additionalFooterCssClass, height } = state;\n return createElement(WrappedComponent, {\n ...props,\n height,\n onResize: this.onResize,\n onFooterHeight: this.onFooterHeight,\n onHeaderHeight: this.onHeaderHeight,\n containerRef: this.handleContainer,\n actionsRef: this.handleActions,\n additionalFooterCssClass,\n onAfterOpen: () => {\n if (props.onAfterOpen) props.onAfterOpen();\n this.verifyNodes();\n },\n });\n }\n }\n\n return DSModalWrapper;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AAEA,IAAO,yBAAQ,CAAC,qBAAqB;AACnC,+BAA6B,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Ac,KAAK;AAC3B,UAAI,cAAc,WAAW,SAAS;AACpC,cAAM,gBAAgB,YAAY,MAAM;AAEtC,gBAAM,EAAE,WAAW,YAAY,KAAK;AACpC,cAAI,CAAC,aAAa,CAAC;AAAS,mBAAO;AACnC,wBAAc;AACd,eAAK,SAAS,EAAE,YAAY;AAC5B,iBAAO,KAAK;AAAA,WACX;AAAA;AAAA;AAAA,IAIP,SAAS;AACP,YAAM,EAAE,OAAO,UAAU;AACzB,YAAM,EAAE,0BAA0B,WAAW;AAC7C,aAAO,cAAc,kBAAkB,iCAClC,QADkC;AAAA,QAErC;AAAA,QACA,UAAU,KAAK;AAAA,QACf,gBAAgB,KAAK;AAAA,QACrB,gBAAgB,KAAK;AAAA,QACrB,cAAc,KAAK;AAAA,QACnB,YAAY,KAAK;AAAA,QACjB;AAAA,QACA,aAAa,MAAM;AACjB,cAAI,MAAM;AAAa,kBAAM;AAC7B,eAAK;AAAA;AAAA;AAAA;AAAA;AAMb,SAAO;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-modal",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.15",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Modal",
|
|
6
6
|
"files": [
|
|
@@ -99,13 +99,13 @@
|
|
|
99
99
|
"indent": 4
|
|
100
100
|
},
|
|
101
101
|
"dependencies": {
|
|
102
|
-
"@elliemae/ds-button": "3.0.0-next.
|
|
103
|
-
"@elliemae/ds-classnames": "3.0.0-next.
|
|
104
|
-
"@elliemae/ds-form": "3.0.0-next.
|
|
105
|
-
"@elliemae/ds-icon": "3.0.0-next.
|
|
106
|
-
"@elliemae/ds-icons": "3.0.0-next.
|
|
107
|
-
"@elliemae/ds-shared": "3.0.0-next.
|
|
108
|
-
"@elliemae/ds-system": "3.0.0-next.
|
|
102
|
+
"@elliemae/ds-button": "3.0.0-next.15",
|
|
103
|
+
"@elliemae/ds-classnames": "3.0.0-next.15",
|
|
104
|
+
"@elliemae/ds-form": "3.0.0-next.15",
|
|
105
|
+
"@elliemae/ds-icon": "3.0.0-next.15",
|
|
106
|
+
"@elliemae/ds-icons": "3.0.0-next.15",
|
|
107
|
+
"@elliemae/ds-shared": "3.0.0-next.15",
|
|
108
|
+
"@elliemae/ds-system": "3.0.0-next.15",
|
|
109
109
|
"prop-types": "~15.8.1",
|
|
110
110
|
"react-desc": "~4.1.3",
|
|
111
111
|
"react-modal": "~3.12.1"
|