@elliemae/ds-modal 3.16.0-next.11 → 3.16.0-next.13
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 +85 -0
- package/dist/cjs/DSModal.js.map +1 -1
- package/dist/cjs/constants.js +4 -0
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/v1/DSModal.js +79 -0
- package/dist/cjs/v1/DSModal.js.map +1 -1
- package/dist/cjs/v1/DSModalType.js +4 -0
- package/dist/cjs/v1/DSModalType.js.map +1 -1
- package/dist/cjs/v1/DSModalWrapper.js +8 -0
- package/dist/cjs/v1/DSModalWrapper.js.map +1 -1
- package/dist/cjs/v1/ModalFeedBack/ModalFeedBack.js +4 -0
- package/dist/cjs/v1/ModalFeedBack/ModalFeedBack.js.map +1 -1
- package/dist/cjs/v2/DSModal.js +39 -0
- package/dist/cjs/v2/DSModal.js.map +1 -1
- package/dist/cjs/v2/blocks.js +4 -0
- package/dist/cjs/v2/blocks.js.map +1 -1
- package/dist/cjs/v2/components/DecisionHeader.js +4 -0
- package/dist/cjs/v2/components/DecisionHeader.js.map +1 -1
- package/dist/cjs/v2/components/FeedbackIcon.js +4 -0
- package/dist/cjs/v2/components/FeedbackIcon.js.map +1 -1
- package/dist/cjs/v2/components/Footer.js +4 -0
- package/dist/cjs/v2/components/Footer.js.map +1 -1
- package/dist/cjs/v2/components/FormHeader.js +4 -0
- package/dist/cjs/v2/components/FormHeader.js.map +1 -1
- package/dist/cjs/v2/components/ModalContent.js +7 -0
- package/dist/cjs/v2/components/ModalContent.js.map +1 -1
- package/dist/cjs/v2/components/SelectionHeader.js +4 -0
- package/dist/cjs/v2/components/SelectionHeader.js.map +1 -1
- package/dist/cjs/v2/components/Title.js +4 -0
- package/dist/cjs/v2/components/Title.js.map +1 -1
- package/dist/cjs/v2/helpers.js +4 -0
- package/dist/cjs/v2/helpers.js.map +1 -1
- package/dist/esm/DSModal.js +81 -0
- package/dist/esm/DSModal.js.map +1 -1
- package/dist/esm/v1/DSModal.js +75 -0
- package/dist/esm/v1/DSModal.js.map +1 -1
- package/dist/esm/v1/DSModalWrapper.js +4 -0
- package/dist/esm/v1/DSModalWrapper.js.map +1 -1
- package/dist/esm/v2/DSModal.js +35 -0
- package/dist/esm/v2/DSModal.js.map +1 -1
- package/dist/esm/v2/blocks.js.map +1 -1
- package/dist/esm/v2/components/ModalContent.js +3 -0
- package/dist/esm/v2/components/ModalContent.js.map +1 -1
- package/package.json +12 -12
package/dist/cjs/DSModal.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -49,34 +53,115 @@ DSModal.propTypes = {
|
|
|
49
53
|
import_DSModal.default.propTypes = {
|
|
50
54
|
version: import_prop_types.default.oneOf([1, 2]),
|
|
51
55
|
className: import_prop_types.default.string,
|
|
56
|
+
/**
|
|
57
|
+
* Add an additional css class to the footer
|
|
58
|
+
*/
|
|
52
59
|
additionalFooterCssClass: import_prop_types.default.string,
|
|
60
|
+
/**
|
|
61
|
+
* Set style for the modal
|
|
62
|
+
*/
|
|
53
63
|
style: import_prop_types.default.objectOf(import_prop_types.default.string),
|
|
64
|
+
/**
|
|
65
|
+
* Select size for the close icon
|
|
66
|
+
*/
|
|
54
67
|
iconCloseSize: import_prop_types.default.oneOf(import_ds_shared.iconSizes),
|
|
68
|
+
/**
|
|
69
|
+
* ['default', 'alert', 'confirm', 'notification', 'warning', 'error', 'success', 'help', 'info']
|
|
70
|
+
*/
|
|
55
71
|
modalType: import_prop_types.default.oneOf(import_constants.modalTypes),
|
|
72
|
+
/**
|
|
73
|
+
* Show the header or not
|
|
74
|
+
*/
|
|
56
75
|
showHeader: import_prop_types.default.bool,
|
|
76
|
+
/**
|
|
77
|
+
* Show the footer or not
|
|
78
|
+
*/
|
|
57
79
|
showFooter: import_prop_types.default.bool,
|
|
80
|
+
/**
|
|
81
|
+
* Main content of the modal
|
|
82
|
+
*/
|
|
58
83
|
children: import_prop_types.default.element.isRequired,
|
|
84
|
+
/**
|
|
85
|
+
* Content is centered or not
|
|
86
|
+
*/
|
|
59
87
|
centered: import_prop_types.default.bool,
|
|
88
|
+
/**
|
|
89
|
+
* Text to be added in the confirm button
|
|
90
|
+
*/
|
|
60
91
|
confirmLabel: import_prop_types.default.string,
|
|
92
|
+
/**
|
|
93
|
+
* Text to be added in the modal title
|
|
94
|
+
*/
|
|
61
95
|
modalTitle: import_prop_types.default.string,
|
|
96
|
+
/**
|
|
97
|
+
* Text to be added in the modal title
|
|
98
|
+
*/
|
|
62
99
|
size: import_prop_types.default.oneOf(import_ds_shared.sizes),
|
|
100
|
+
/**
|
|
101
|
+
* Modal is open or not
|
|
102
|
+
*/
|
|
63
103
|
isOpen: import_prop_types.default.bool,
|
|
104
|
+
/**
|
|
105
|
+
* Allows a function to be triggered once the modal is closed
|
|
106
|
+
*/
|
|
64
107
|
onClose: import_prop_types.default.func,
|
|
108
|
+
/**
|
|
109
|
+
* Allows a function to be triggered once the modal is opened
|
|
110
|
+
*/
|
|
65
111
|
onAfterOpen: import_prop_types.default.func,
|
|
112
|
+
/**
|
|
113
|
+
* Allows a function to be triggered once the modal open is confirmed
|
|
114
|
+
*/
|
|
66
115
|
onConfirm: import_prop_types.default.func,
|
|
116
|
+
/**
|
|
117
|
+
* Allows a function to be triggered once the modal open is rejected
|
|
118
|
+
*/
|
|
67
119
|
onReject: import_prop_types.default.func,
|
|
120
|
+
/**
|
|
121
|
+
* Text to be added in the reject button
|
|
122
|
+
*/
|
|
68
123
|
rejectLabel: import_prop_types.default.string,
|
|
124
|
+
/**
|
|
125
|
+
* If modal should close on overlay click
|
|
126
|
+
*/
|
|
69
127
|
shouldCloseOnOverlayClick: import_prop_types.default.bool,
|
|
128
|
+
/**
|
|
129
|
+
* Modal has error or not
|
|
130
|
+
*/
|
|
70
131
|
hasError: import_prop_types.default.bool,
|
|
132
|
+
/**
|
|
133
|
+
* Modal has warning or not
|
|
134
|
+
*/
|
|
71
135
|
hasWarning: import_prop_types.default.bool,
|
|
136
|
+
/**
|
|
137
|
+
* Modal has success or not
|
|
138
|
+
*/
|
|
72
139
|
hasSuccess: import_prop_types.default.bool,
|
|
140
|
+
/**
|
|
141
|
+
* Modal has info or not
|
|
142
|
+
*/
|
|
73
143
|
hasInfo: import_prop_types.default.bool,
|
|
144
|
+
/**
|
|
145
|
+
* Modal has help or not
|
|
146
|
+
*/
|
|
74
147
|
hasHelp: import_prop_types.default.bool,
|
|
75
148
|
actionsRef: import_prop_types.default.func,
|
|
76
149
|
appElement: import_prop_types.default.string,
|
|
150
|
+
/**
|
|
151
|
+
* Customized props for the confirm button
|
|
152
|
+
*/
|
|
77
153
|
overridePropsConfirmButton: import_prop_types.default.objectOf(import_prop_types.default.shape({})),
|
|
154
|
+
/**
|
|
155
|
+
* Customized props for the reject button
|
|
156
|
+
*/
|
|
78
157
|
overridePropsRejectButton: import_prop_types.default.objectOf(import_prop_types.default.string),
|
|
158
|
+
/**
|
|
159
|
+
* Show confirm button
|
|
160
|
+
*/
|
|
79
161
|
showConfirmButton: import_prop_types.default.bool,
|
|
162
|
+
/**
|
|
163
|
+
* Show confirm button
|
|
164
|
+
*/
|
|
80
165
|
customCloseComponent: import_prop_types.default.element
|
|
81
166
|
};
|
|
82
167
|
var DSModal_default = DSModal;
|
package/dist/cjs/DSModal.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSModal.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { modalTypes } from './constants.js';\nimport DSModalV1 from './v1/DSModal.js';\nimport DSModalV2, { DSModalContent } from './v2/DSModal.js';\nimport { sizes, iconSizes } from '@elliemae/ds-shared';\nimport { useDeprecateComponent } from '@elliemae/ds-utilities';\n\nconst DSModal = ({ version = 1, ...rest }) => {\n useDeprecateComponent({ componentName: 'ds-modal', version: 'TBD Date: 2023 Q3' });\n\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": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADYK;AAV5B,wBAAsB;AACtB,uBAA2B;AAC3B,qBAAsB;AACtB,IAAAA,kBAA0C;AAC1C,uBAAiC;AACjC,0BAAsC;AAEtC,MAAM,UAAU,CAAC,EAAE,UAAU,GAAG,GAAG,KAAK,MAAM;AAC5C,iDAAsB,EAAE,eAAe,YAAY,SAAS,oBAAoB,CAAC;AAEjF,MAAI,YAAY;AAAG,WAAO,4CAAC,gBAAAC,SAAA,EAAW,GAAG,MAAM;AAC/C,SAAO,4CA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B,2BAA2B,kBAAAA,QAAU;AAAA;AAAA;AAAA;AAAA,EAIrC,UAAU,kBAAAA,QAAU;AAAA;AAAA;AAAA;AAAA,EAIpB,YAAY,kBAAAA,QAAU;AAAA;AAAA;AAAA;AAAA,EAItB,YAAY,kBAAAA,QAAU;AAAA;AAAA;AAAA;AAAA,EAItB,SAAS,kBAAAA,QAAU;AAAA;AAAA;AAAA;AAAA,EAInB,SAAS,kBAAAA,QAAU;AAAA,EACnB,YAAY,kBAAAA,QAAU;AAAA,EACtB,YAAY,kBAAAA,QAAU;AAAA;AAAA;AAAA;AAAA,EAItB,4BAA4B,kBAAAA,QAAU,SAAS,kBAAAA,QAAU,MAAM,CAAC,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA,EAIlE,2BAA2B,kBAAAA,QAAU,SAAS,kBAAAA,QAAU,MAAM;AAAA;AAAA;AAAA;AAAA,EAI9D,mBAAmB,kBAAAA,QAAU;AAAA;AAAA;AAAA;AAAA,EAI7B,sBAAsB,kBAAAA,QAAU;AAClC;AAEA,IAAO,kBAAQ;",
|
|
6
6
|
"names": ["import_DSModal", "DSModalV2", "DSModalV1", "PropTypes"]
|
|
7
7
|
}
|
package/dist/cjs/constants.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/constants.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export const MODAL_TYPE = {\n DEFAULT: 'default',\n ALERT: 'alert',\n CONFIRM: 'confirm',\n NOTIFICATION: 'notification',\n WARNING: 'warning',\n ERROR: 'error',\n SUCCESS: 'success',\n HELP: 'help',\n INFO: 'info',\n};\n\nexport const modalTypes = [\n MODAL_TYPE.DEFAULT,\n MODAL_TYPE.ALERT,\n MODAL_TYPE.CONFIRM,\n MODAL_TYPE.NOTIFICATION,\n MODAL_TYPE.WARNING,\n MODAL_TYPE.ERROR,\n MODAL_TYPE.SUCCESS,\n MODAL_TYPE.HELP,\n MODAL_TYPE.INFO,\n];\n\nexport const MODAL_TYPE_V2 = {\n INFORMATION: 'information',\n DECISION: 'decision',\n SELECTION: 'selection',\n FORM: 'form',\n};\n\nexport const MODAL_SUB_TYPE_V2 = {\n SUCCESS: 'success',\n WARNING: 'warning',\n ERROR: 'error',\n INFORMATION: 'information',\n};\n\nexport default MODAL_TYPE;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,aAAa;AAAA,EACxB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,cAAc;AAAA,EACd,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AACR;AAEO,MAAM,aAAa;AAAA,EACxB,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AACb;AAEO,MAAM,gBAAgB;AAAA,EAC3B,aAAa;AAAA,EACb,UAAU;AAAA,EACV,WAAW;AAAA,EACX,MAAM;AACR;AAEO,MAAM,oBAAoB;AAAA,EAC/B,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AACf;AAEA,IAAO,oBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export { DSModal, DSModal as default } from './DSModal.js';\nexport { MODAL_TYPE, modalTypes, MODAL_TYPE_V2, MODAL_SUB_TYPE_V2 } from './constants.js';\nexport { DSModalWithSchema } from './v2/DSModal.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,qBAA4C;AAC5C,uBAAyE;AACzE,IAAAA,kBAAkC;",
|
|
6
6
|
"names": ["import_DSModal"]
|
|
7
7
|
}
|
package/dist/cjs/v1/DSModal.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -154,32 +158,107 @@ const DSModal = ({
|
|
|
154
158
|
};
|
|
155
159
|
DSModal.propTypes = {
|
|
156
160
|
className: import_prop_types.default.string,
|
|
161
|
+
/**
|
|
162
|
+
* Add an additional css class to the footer
|
|
163
|
+
*/
|
|
157
164
|
additionalFooterCssClass: import_prop_types.default.string,
|
|
165
|
+
/**
|
|
166
|
+
* Set style for the modal
|
|
167
|
+
*/
|
|
158
168
|
style: import_prop_types.default.shape({}),
|
|
169
|
+
/**
|
|
170
|
+
* Select size for the close icon
|
|
171
|
+
*/
|
|
159
172
|
iconCloseSize: import_prop_types.default.oneOf(import_ds_shared.iconSizes),
|
|
173
|
+
/**
|
|
174
|
+
* ['default', 'alert', 'confirm', 'notification', 'warning', 'error', 'success', 'help', 'info']
|
|
175
|
+
*/
|
|
160
176
|
modalType: import_prop_types.default.oneOf(import_constants.modalTypes),
|
|
177
|
+
/**
|
|
178
|
+
* Show the header or not
|
|
179
|
+
*/
|
|
161
180
|
showHeader: import_prop_types.default.bool,
|
|
181
|
+
/**
|
|
182
|
+
* Show the footer or not
|
|
183
|
+
*/
|
|
162
184
|
showFooter: import_prop_types.default.bool,
|
|
185
|
+
/**
|
|
186
|
+
* Main content of the modal
|
|
187
|
+
*/
|
|
163
188
|
children: import_prop_types.default.oneOfType([import_prop_types.default.element, import_prop_types.default.string, import_prop_types.default.any]).isRequired,
|
|
189
|
+
/**
|
|
190
|
+
* Content is centered or not
|
|
191
|
+
*/
|
|
164
192
|
centered: import_prop_types.default.bool,
|
|
193
|
+
/**
|
|
194
|
+
* Text to be added in the confirm button
|
|
195
|
+
*/
|
|
165
196
|
confirmLabel: import_prop_types.default.string,
|
|
197
|
+
/**
|
|
198
|
+
* Text to be added in the modal title
|
|
199
|
+
*/
|
|
166
200
|
modalTitle: import_prop_types.default.string,
|
|
201
|
+
/**
|
|
202
|
+
* Text to be added in the modal title
|
|
203
|
+
*/
|
|
167
204
|
size: import_prop_types.default.oneOf(import_ds_shared.sizes),
|
|
205
|
+
/**
|
|
206
|
+
* Modal is open or not
|
|
207
|
+
*/
|
|
168
208
|
isOpen: import_prop_types.default.bool,
|
|
209
|
+
/**
|
|
210
|
+
* Allows a function to be triggered once the modal is closed
|
|
211
|
+
*/
|
|
169
212
|
onClose: import_prop_types.default.func,
|
|
213
|
+
/**
|
|
214
|
+
* Allows a function to be triggered once the modal is opened
|
|
215
|
+
*/
|
|
170
216
|
onAfterOpen: import_prop_types.default.func,
|
|
217
|
+
/**
|
|
218
|
+
* Allows a function to be triggered once the modal open is confirmed
|
|
219
|
+
*/
|
|
171
220
|
onConfirm: import_prop_types.default.func,
|
|
221
|
+
/**
|
|
222
|
+
* Allows a function to be triggered once the modal open is rejected
|
|
223
|
+
*/
|
|
172
224
|
onReject: import_prop_types.default.func,
|
|
225
|
+
/**
|
|
226
|
+
* Text to be added in the reject button
|
|
227
|
+
*/
|
|
173
228
|
rejectLabel: import_prop_types.default.string,
|
|
229
|
+
/**
|
|
230
|
+
* If modal should close on overlay click
|
|
231
|
+
*/
|
|
174
232
|
shouldCloseOnOverlayClick: import_prop_types.default.bool,
|
|
233
|
+
/**
|
|
234
|
+
* Modal has error or not
|
|
235
|
+
*/
|
|
175
236
|
hasError: import_prop_types.default.bool,
|
|
237
|
+
/**
|
|
238
|
+
* Modal has warning or not
|
|
239
|
+
*/
|
|
176
240
|
hasWarning: import_prop_types.default.bool,
|
|
241
|
+
/**
|
|
242
|
+
* Modal has success or not
|
|
243
|
+
*/
|
|
177
244
|
hasSuccess: import_prop_types.default.bool,
|
|
245
|
+
/**
|
|
246
|
+
* Modal has info or not
|
|
247
|
+
*/
|
|
178
248
|
hasInfo: import_prop_types.default.bool,
|
|
249
|
+
/**
|
|
250
|
+
* Modal has help or not
|
|
251
|
+
*/
|
|
179
252
|
hasHelp: import_prop_types.default.bool,
|
|
180
253
|
actionsRef: import_prop_types.default.func,
|
|
181
254
|
appElement: import_prop_types.default.string,
|
|
255
|
+
/**
|
|
256
|
+
* Customized props for the confirm button
|
|
257
|
+
*/
|
|
182
258
|
overridePropsConfirmButton: import_prop_types.default.shape({}),
|
|
259
|
+
/**
|
|
260
|
+
* Customized props for the reject button
|
|
261
|
+
*/
|
|
183
262
|
overridePropsRejectButton: import_prop_types.default.shape({})
|
|
184
263
|
};
|
|
185
264
|
var DSModal_default = DSModal;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/v1/DSModal.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
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.js';\nimport ModalFeedBack from './ModalFeedBack/ModalFeedBack.js';\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": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkFb;AAhFV,wBAAsB;AACtB,yBAAuB;AACvB,2BAA0C;AAC1C,qBAA4B;AAC5B,sBAAsB;AACtB,uBAAqB;AACrB,uBAAuC;AACvC,2BAA0B;AAC1B,uBAAiC;AAEjC,MAAM,UAAU,CAAC;AAAA,EACf,iBAAiB,CAAC;AAAA,EAClB,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,2BAA2B;AAAA,EAC3B,QAAQ,CAAC;AAAA,EACT,gBAAgB,2BAAY;AAAA,EAC5B,YAAY,iBAAAA,QAAW;AAAA,EACvB,aAAa;AAAA,EACb,aAAa;AAAA,EACb;AAAA,EACA,WAAW;AAAA,EACX,eAAe;AAAA,EACf,aAAa;AAAA,EACb,OAAO;AAAA,EACP,SAA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B,YAAY,kBAAAA,QAAU;AAAA,EACtB,YAAY,kBAAAA,QAAU;AAAA;AAAA;AAAA;AAAA,EAItB,4BAA4B,kBAAAA,QAAU,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA,EAI9C,2BAA2B,kBAAAA,QAAU,MAAM,CAAC,CAAC;AAC/C;AAEA,IAAO,kBAAQ;",
|
|
6
6
|
"names": ["MODAL_TYPE", "ReactModal", "DSButton", "ModalFeedBack", "PropTypes"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/v1/DSModalType.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export const modalTypes = [\n MODAL_TYPE.DEFAULT,\n MODAL_TYPE.ALERT,\n MODAL_TYPE.CONFIRM,\n MODAL_TYPE.NOTIFICATION,\n MODAL_TYPE.WARNING,\n MODAL_TYPE.ERROR,\n MODAL_TYPE.SUCCESS,\n MODAL_TYPE.HELP,\n MODAL_TYPE.INFO,\n];\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,aAAa;AAAA,EACxB,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AACb;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -67,6 +71,10 @@ var DSModalWrapper_default = (WrappedComponent) => {
|
|
|
67
71
|
this.setState({ actions: node });
|
|
68
72
|
this.handleResize();
|
|
69
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* Change button width to 100% if the
|
|
76
|
+
* combined width of the button (or button group) exceed 50% of the container width.
|
|
77
|
+
*/
|
|
70
78
|
this.handleResize = () => {
|
|
71
79
|
if (!this.state)
|
|
72
80
|
return null;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/v1/DSModalWrapper.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { Component, createElement } from 'react';\nimport { MODAL_TYPE } from '../constants.js';\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 (containerWidth && actionsWidth && (actionsWidth / containerWidth) * 100 > 50) {\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": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAyC;AACzC,uBAA2B;AAE3B,IAAO,yBAAQ,CAAC,qBAAqB;AACnC,QAAM,uBAAuB,uBAAU;AAAA,IAAvC;AAAA;AACE,mBAAQ;AAAA,QACN,YAAY;AAAA,QACZ,0BAA0B;AAAA,QAC1B,WAAW;AAAA,QACX,SAAS;AAAA,QACT,QAAQ;AAAA,MACV;AAUA,4BAAiB,CAAC,MAAM;AACtB,aAAK,mBAAmB;AACxB,aAAK,eAAe,EAAE,UAAU;AAAA,MAClC;AAEA,4BAAiB,CAAC,MAAM;AACtB,aAAK,mBAAmB;AACxB,aAAK,eAAe,EAAE,UAAU;AAAA,MAClC;AAEA,sBAAW,CAAC,EAAE,OAAO,MAAM;AACzB,YAAI,KAAK,oBAAoB,KAAK,kBAAkB;AAClD,iBAAO,KAAK,SAAS;AAAA,YACnB,QAAQ,OAAO,SAAS,KAAK,eAAe,KAAK;AAAA,UACnD,CAAC;AAAA,QACH;AACA,eAAO,WAAW,KAAK,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC;AAAA,MAChD;AAEA,6BAAkB,CAAC,SAAS;AAC1B,YAAI;AAAM,eAAK,SAAS,EAAE,WAAW,KAAK,CAAC;AAC3C,aAAK,aAAa;AAAA,MACpB;AAEA,2BAAgB,CAAC,SAAS;AACxB,YAAI;AAAM,eAAK,SAAS,EAAE,SAAS,KAAK,CAAC;AACzC,aAAK,aAAa;AAAA,MACpB;AAMA;AAAA;AAAA;AAAA;AAAA,0BAAe,MAAM;AACnB,YAAI,CAAC,KAAK;AAAO,iBAAO;AACxB,cAAM,EAAE,WAAW,SAAS,WAAW,IAAI,KAAK;AAChD,YAAI,CAAC;AA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T;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/v1/ModalFeedBack/ModalFeedBack.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { WarningCircle, CheckmarkCircle, HelpCircle, InfoCircle } from '@elliemae/ds-icons';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { MODAL_TYPE } from '../../constants.js';\n\nconst feedbackIconSize = 'xxl';\n\nconst { WARNING, ERROR, SUCCESS, HELP, INFO } = MODAL_TYPE;\n\nconst getModalType = (modalType, { hasError, hasWarning, hasSuccess, hasInfo, hasHelp }) => {\n if ([WARNING, ERROR, SUCCESS, HELP, INFO].indexOf(modalType) > -1) return modalType;\n if (hasError) return ERROR;\n if (hasWarning) return WARNING;\n if (hasSuccess) return SUCCESS;\n if (hasHelp) return HELP;\n if (hasInfo) return INFO;\n return INFO;\n};\n\nconst getIconType = (modalType) => {\n switch (modalType) {\n case WARNING:\n case ERROR:\n return <WarningCircle size={feedbackIconSize} />;\n case SUCCESS:\n return <CheckmarkCircle size={feedbackIconSize} />;\n case HELP:\n return <HelpCircle size={feedbackIconSize} />;\n case INFO:\n return <InfoCircle size={feedbackIconSize} />;\n default:\n return <InfoCircle size={feedbackIconSize} />;\n }\n};\n\nconst ModalFeedBack = ({\n className = '',\n modalType = null,\n hasError = false,\n hasWarning = false,\n hasSuccess = false,\n hasInfo = false,\n hasHelp = false,\n}) => {\n const type = getModalType(modalType, {\n hasError,\n hasWarning,\n hasSuccess,\n hasInfo,\n hasHelp,\n });\n const { cssClassName } = convertPropToCssClassName('modal-feedback', className, { modalType: type });\n const feedbackIcon = getIconType(type);\n\n return <div className={cssClassName}>{feedbackIcon}</div>;\n};\n\nexport default ModalFeedBack;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADuBV;AAtBb,sBAAuE;AACvE,2BAA0C;AAC1C,uBAA2B;AAE3B,MAAM,mBAAmB;AAEzB,MAAM,EAAE,SAAS,OAAO,SAAS,MAAM,KAAK,IAAI;AAEhD,MAAM,eAAe,CAAC,WAAW,EAAE,UAAU,YAAY,YAAY,SAAS,QAAQ,MAAM;AAC1F,MAAI,CAAC,SAAS,OAAO,SAAS,MAAM,IAAI,EAAE,QAAQ,SAAS,IAAI;AAAI,WAAO;AAC1E,MAAI;AAAU,WAAO;AACrB,MAAI;AAAY,WAAO;AACvB,MAAI;AAAY,WAAO;AACvB,MAAI;AAAS,WAAO;AACpB,MAAI;AAAS,WAAO;AACpB,SAAO;AACT;AAEA,MAAM,cAAc,CAAC,cAAc;AACjC,UAAQ,WAAW;AAAA,IACjB,KAAK;AAAA,IACL,KAAK;AACH,aAAO,4CAAC,iCAAc,MAAM,kBAAkB;AAAA,IAChD,KAAK;AACH,aAAO,4CAAC,mCAAgB,MAAM,kBAAkB;AAAA,IAClD,KAAK;AACH,aAAO,4CAAC,8BAAW,MAAM,kBAAkB;AAAA,IAC7C,KAAK;AACH,aAAO,4CAAC,8BAAW,MAAM,kBAAkB;AAAA,IAC7C;AACE,aAAO,4CAAC,8BAAW,MAAM,kBAAkB;AAAA,EAC/C;AACF;AAEA,MAAM,gBAAgB,CAAC;AAAA,EACrB,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,aAAa;AAAA,EACb,aAAa;AAAA,EACb,UAAU;AAAA,EACV,UAAU;AACZ,MAAM;AACJ,QAAM,OAAO,aAAa,WAAW;AAAA,IACnC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,EAAE,aAAa,QAAI,gDAA0B,kBAAkB,WAAW,EAAE,WAAW,KAAK,CAAC;AACnG,QAAM,eAAe,YAAY,IAAI;AAErC,SAAO,4CAAC,SAAI,WAAW,cAAe,wBAAa;AACrD;AAEA,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/v2/DSModal.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -43,6 +47,7 @@ const DSModal = ({
|
|
|
43
47
|
className = "",
|
|
44
48
|
style = {},
|
|
45
49
|
size = "default",
|
|
50
|
+
//
|
|
46
51
|
modalType = import_constants.MODAL_TYPE_V2.INFORMATION,
|
|
47
52
|
modalSubType = null,
|
|
48
53
|
modalTitle = "",
|
|
@@ -51,10 +56,12 @@ const DSModal = ({
|
|
|
51
56
|
showRejectButton = false,
|
|
52
57
|
showClose = true,
|
|
53
58
|
searchProps = {},
|
|
59
|
+
// override
|
|
54
60
|
actionsRef = () => null,
|
|
55
61
|
additionalFooterCssClass,
|
|
56
62
|
overridePropsConfirmButton = {},
|
|
57
63
|
overridePropsRejectButton = {},
|
|
64
|
+
// react modal
|
|
58
65
|
children,
|
|
59
66
|
isOpen = true,
|
|
60
67
|
onClose = () => null,
|
|
@@ -91,6 +98,7 @@ const DSModal = ({
|
|
|
91
98
|
...style
|
|
92
99
|
},
|
|
93
100
|
overlay: {
|
|
101
|
+
// position: 'absolute', https://jira.elliemae.io/browse/PUI-1471, the overlay should be positioned based on the browser window rather positioned absolute to its parent
|
|
94
102
|
zIndex: zIndex ?? theme.zIndex.dialog
|
|
95
103
|
}
|
|
96
104
|
},
|
|
@@ -121,36 +129,67 @@ const DSModal = ({
|
|
|
121
129
|
);
|
|
122
130
|
};
|
|
123
131
|
const props = {
|
|
132
|
+
/** inject props to container wrapper */
|
|
124
133
|
containerProps: import_ds_props_helpers.PropTypes.object.description("inject props to container wrapper"),
|
|
134
|
+
/** css class */
|
|
125
135
|
className: import_ds_props_helpers.PropTypes.string.description("css class"),
|
|
136
|
+
/** style object for container wrapper */
|
|
126
137
|
style: import_ds_props_helpers.PropTypes.object.description("style object for container wrapper"),
|
|
138
|
+
/** modal container title */
|
|
127
139
|
modalTitle: import_ds_props_helpers.PropTypes.string.description("modal container title"),
|
|
140
|
+
/** center container */
|
|
128
141
|
centered: import_ds_props_helpers.PropTypes.bool.description("center container"),
|
|
142
|
+
/** show reject button */
|
|
129
143
|
showRejectButton: import_ds_props_helpers.PropTypes.bool.description("show reject button"),
|
|
144
|
+
/** show close button */
|
|
130
145
|
showClose: import_ds_props_helpers.PropTypes.bool.description("show close button"),
|
|
146
|
+
/*
|
|
147
|
+
Props for search component
|
|
148
|
+
*/
|
|
131
149
|
searchProps: import_ds_props_helpers.PropTypes.object.description("Props for search component"),
|
|
150
|
+
/** css class for footer */
|
|
132
151
|
additionalFooterCssClass: import_ds_props_helpers.PropTypes.string.description("css class for footer"),
|
|
152
|
+
/** override props confirm button */
|
|
133
153
|
overridePropsConfirmButton: import_ds_props_helpers.PropTypes.object.description("override props confirm button"),
|
|
154
|
+
/** override props reject button */
|
|
134
155
|
overridePropsRejectButton: import_ds_props_helpers.PropTypes.object.description("override props reject button"),
|
|
156
|
+
/** controlled isOpen flag */
|
|
135
157
|
isOpen: import_ds_props_helpers.PropTypes.bool.description("controlled isOpen flag"),
|
|
158
|
+
/** close callback */
|
|
136
159
|
onClose: import_ds_props_helpers.PropTypes.func.description("close callback"),
|
|
160
|
+
/** after open callback */
|
|
137
161
|
onAfterOpen: import_ds_props_helpers.PropTypes.func.description("after open callback"),
|
|
162
|
+
/** confirm callback */
|
|
138
163
|
onConfirm: import_ds_props_helpers.PropTypes.func.description("confirm callback"),
|
|
164
|
+
/** reject callback */
|
|
139
165
|
onReject: import_ds_props_helpers.PropTypes.func.description("reject callback"),
|
|
166
|
+
/** reject label */
|
|
140
167
|
rejectLabel: import_ds_props_helpers.PropTypes.string.description("reject label"),
|
|
168
|
+
/** confirm text string */
|
|
141
169
|
confirmLabel: import_ds_props_helpers.PropTypes.string.description("confirm text string"),
|
|
170
|
+
/** modal container size */
|
|
142
171
|
size: import_ds_props_helpers.PropTypes.oneOf(["default", "xx-large", "x-large", "large", "medium", "small"]).description(
|
|
143
172
|
"modal container size"
|
|
144
173
|
),
|
|
174
|
+
/** modal sub type */
|
|
145
175
|
modalSubType: import_ds_props_helpers.PropTypes.any.description("modal sub type"),
|
|
176
|
+
/** modal type */
|
|
146
177
|
modalType: import_ds_props_helpers.PropTypes.any.description("modal type"),
|
|
178
|
+
/** ref for modal footer actions */
|
|
147
179
|
actionsRef: import_ds_props_helpers.PropTypes.any.description("ref for modal footer actions"),
|
|
180
|
+
/** modal container children */
|
|
148
181
|
children: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.element, import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.element)]).description(
|
|
149
182
|
"modal container children"
|
|
150
183
|
),
|
|
184
|
+
/** close on click outside container */
|
|
151
185
|
shouldCloseOnOverlayClick: import_ds_props_helpers.PropTypes.bool.description("close on click outside container"),
|
|
186
|
+
/*
|
|
187
|
+
App element ID to inject the modal
|
|
188
|
+
*/
|
|
152
189
|
appElement: import_ds_props_helpers.PropTypes.string.description("App element ID to inject the modal"),
|
|
190
|
+
/** zindex for modal container */
|
|
153
191
|
zIndex: import_ds_props_helpers.PropTypes.number.description("zindex for modal container"),
|
|
192
|
+
/** remove modal builtin padding */
|
|
154
193
|
removePadding: import_ds_props_helpers.PropTypes.bool.description("remove modal builtin padding")
|
|
155
194
|
};
|
|
156
195
|
DSModal.propTypes = props;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/v2/DSModal.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useContext } from 'react';\nimport { ThemeContext } from '@elliemae/ds-system';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport ReactModal from 'react-modal';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { MODAL_TYPE_V2 } from '../constants.js';\nimport { DSModalContent } from './components/ModalContent.js';\n\nconst DSModal = ({\n containerProps = {},\n className = '',\n style = {},\n size = 'default',\n //\n modalType = MODAL_TYPE_V2.INFORMATION,\n modalSubType = null,\n modalTitle = '',\n dataTestId = 'ds-modal',\n centered = false,\n showRejectButton = false,\n showClose = true,\n searchProps = {},\n // override\n actionsRef = () => null,\n additionalFooterCssClass,\n overridePropsConfirmButton = {},\n overridePropsRejectButton = {},\n // react modal\n children,\n isOpen = true,\n onClose = () => null,\n onAfterOpen = () => null,\n onConfirm = () => null,\n onReject = () => null,\n rejectLabel = 'Discard',\n confirmLabel = 'Save',\n shouldCloseOnOverlayClick = false,\n appElement = '#root',\n zIndex,\n removePadding = false,\n}) => {\n if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && document && ReactModal.setAppElement) {\n ReactModal.setAppElement(appElement);\n }\n\n const { cssClassName, classNameBlock, classNameModifier } = convertPropToCssClassName('modal-v2', className, {\n size,\n });\n\n const theme = useContext(ThemeContext);\n\n return (\n <ReactModal\n testId={dataTestId}\n className={`${cssClassName} ${classNameBlock(`type-${modalType}`)}`}\n contentLabel={modalTitle}\n isOpen={isOpen}\n onAfterOpen={onAfterOpen}\n onRequestClose={onClose}\n overlayClassName={`${classNameBlock('overlay')} ${classNameModifier(centered ? 'center' : 'top')}`}\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\n style={{\n content: {\n ...style,\n },\n overlay: {\n // position: 'absolute', https://jira.elliemae.io/browse/PUI-1471, the overlay should be positioned based on the browser window rather positioned absolute to its parent\n zIndex: zIndex ?? theme.zIndex.dialog,\n },\n }}\n >\n <DSModalContent\n actionsRef={actionsRef}\n additionalFooterCssClass={additionalFooterCssClass}\n confirmLabel={confirmLabel}\n containerProps={containerProps}\n modalSubType={modalSubType}\n modalTitle={modalTitle}\n modalType={modalType}\n onClose={onClose}\n onConfirm={onConfirm}\n onReject={onReject}\n overridePropsConfirmButton={overridePropsConfirmButton}\n overridePropsRejectButton={overridePropsRejectButton}\n rejectLabel={rejectLabel}\n searchProps={searchProps}\n showClose={showClose}\n showRejectButton={showRejectButton}\n removePadding={removePadding}\n >\n {children}\n </DSModalContent>\n </ReactModal>\n );\n};\n\nconst props = {\n /** inject props to container wrapper */\n containerProps: PropTypes.object.description('inject props to container wrapper'),\n /** css class */\n className: PropTypes.string.description('css class'),\n /** style object for container wrapper */\n style: PropTypes.object.description('style object for container wrapper'),\n /** modal container title */\n modalTitle: PropTypes.string.description('modal container title'),\n /** center container */\n centered: PropTypes.bool.description('center container'),\n /** show reject button */\n showRejectButton: PropTypes.bool.description('show reject button'),\n /** show close button */\n showClose: PropTypes.bool.description('show close button'),\n /*\n Props for search component\n */\n searchProps: PropTypes.object.description('Props for search component'),\n /** css class for footer */\n additionalFooterCssClass: PropTypes.string.description('css class for footer'),\n /** override props confirm button */\n overridePropsConfirmButton: PropTypes.object.description('override props confirm button'),\n /** override props reject button */\n overridePropsRejectButton: PropTypes.object.description('override props reject button'),\n /** controlled isOpen flag */\n isOpen: PropTypes.bool.description('controlled isOpen flag'),\n /** close callback */\n onClose: PropTypes.func.description('close callback'),\n /** after open callback */\n onAfterOpen: PropTypes.func.description('after open callback'),\n /** confirm callback */\n onConfirm: PropTypes.func.description('confirm callback'),\n /** reject callback */\n onReject: PropTypes.func.description('reject callback'),\n /** reject label */\n rejectLabel: PropTypes.string.description('reject label'),\n /** confirm text string */\n confirmLabel: PropTypes.string.description('confirm text string'),\n /** modal container size */\n size: PropTypes.oneOf(['default', 'xx-large', 'x-large', 'large', 'medium', 'small']).description(\n 'modal container size',\n ),\n /** modal sub type */\n modalSubType: PropTypes.any.description('modal sub type'),\n /** modal type */\n modalType: PropTypes.any.description('modal type'),\n /** ref for modal footer actions */\n actionsRef: PropTypes.any.description('ref for modal footer actions'),\n /** modal container children */\n children: PropTypes.oneOfType([PropTypes.element, PropTypes.arrayOf(PropTypes.element)]).description(\n 'modal container children',\n ),\n /** close on click outside container */\n shouldCloseOnOverlayClick: PropTypes.bool.description('close on click outside container'),\n /*\n App element ID to inject the modal\n */\n appElement: PropTypes.string.description('App element ID to inject the modal'),\n /** zindex for modal container */\n zIndex: PropTypes.number.description('zindex for modal container'),\n /** remove modal builtin padding */\n removePadding: PropTypes.bool.description('remove modal builtin padding'),\n};\n\nDSModal.propTypes = props;\nDSModal.displayName = 'DSModal';\nconst DSModalWithSchema = describe(DSModal);\nDSModalWithSchema.propTypes = props;\n\nexport { DSModalContent, DSModalWithSchema };\nexport default DSModal;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;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KAAK,YAAY,qBAAqB;AAAA;AAAA,EAE7D,WAAW,kCAAU,KAAK,YAAY,kBAAkB;AAAA;AAAA,EAExD,UAAU,kCAAU,KAAK,YAAY,iBAAiB;AAAA;AAAA,EAEtD,aAAa,kCAAU,OAAO,YAAY,cAAc;AAAA;AAAA,EAExD,cAAc,kCAAU,OAAO,YAAY,qBAAqB;AAAA;AAAA,EAEhE,MAAM,kCAAU,MAAM,CAAC,WAAW,YAAY,WAAW,SAAS,UAAU,OAAO,CAAC,EAAE;AAAA,IACpF;AAAA,EACF;AAAA;AAAA,EAEA,cAAc,kCAAU,IAAI,YAAY,gBAAgB;AAAA;AAAA,EAExD,WAAW,kCAAU,IAAI,YAAY,YAAY;AAAA;AAAA,EAEjD,YAAY,kCAAU,IAAI,YAAY,8BAA8B;AAAA;AAAA,EAEpE,UAAU,kCAAU,UAAU,CAAC,kCAAU,SAAS,kCAAU,QAAQ,kCAAU,OAAO,CAAC,CAAC,EAAE;AAAA,IACvF;AAAA,EACF;AAAA;AAAA,EAEA,2BAA2B,kCAAU,KAAK,YAAY,kCAAkC;AAAA;AAAA;AAAA;AAAA,EAIxF,YAAY,kCAAU,OAAO,YAAY,oCAAoC;AAAA;AAAA,EAE7E,QAAQ,kCAAU,OAAO,YAAY,4BAA4B;AAAA;AAAA,EAEjE,eAAe,kCAAU,KAAK,YAAY,8BAA8B;AAC1E;AAEA,QAAQ,YAAY;AACpB,QAAQ,cAAc;AACtB,MAAM,wBAAoB,kCAAS,OAAO;AAC1C,kBAAkB,YAAY;AAG9B,IAAO,kBAAQ;",
|
|
6
6
|
"names": ["ReactModal"]
|
|
7
7
|
}
|
package/dist/cjs/v2/blocks.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/v2/blocks.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst blockName = 'modal-v2';\n\nexport const ModalHeader = aggregatedClasses('div')(blockName, 'modal-header', ({ type, showClose }) => ({\n [type]: type,\n 'with-close': showClose,\n}));\n\nexport const ModalHeaderTopRight = aggregatedClasses('div')(blockName, 'modal-header-close', ({ type }) => ({\n [type]: type,\n}));\n\nexport const ModalFeedback = aggregatedClasses('div')(blockName, 'modal-feedback', ({ type }) => ({\n [type]: type,\n}));\n\nexport const ModalTitle = aggregatedClasses('h3')(blockName, 'modal-title', ({ type }) => ({\n [type]: type,\n}));\n\nexport const ModalContent = aggregatedClasses('div')(blockName, 'modal-content', ({ type, removePadding }) => ({\n [type]: type,\n 'remove-padding': removePadding,\n}));\n\nexport const ModalWrapper = aggregatedClasses('div')(blockName, 'modal-wrapper', ({ type, removePadding }) => ({\n [type]: type,\n 'remove-padding': removePadding,\n}));\n\nexport const ModalFooter = aggregatedClasses('div')(\n blockName,\n 'modal-footer',\n ({ type, additionalFooterCssClass }) => ({\n [type]: type,\n [additionalFooterCssClass]: additionalFooterCssClass,\n }),\n);\n\nexport const ModalFooterActions = aggregatedClasses('div')(blockName, 'modal-footer-actions', ({ type }) => ({\n [type]: type,\n}));\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;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