@elliemae/ds-modal 3.0.0-alpha.0 → 3.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSModal.js +30 -7
- package/dist/cjs/DSModal.js.map +1 -1
- package/dist/cjs/v1/DSModal.js +21 -13
- package/dist/cjs/v1/DSModal.js.map +1 -1
- package/dist/cjs/v1/DSModalWrapper.js +19 -3
- package/dist/cjs/v1/DSModalWrapper.js.map +1 -1
- package/dist/cjs/v2/DSModal.js +15 -3
- package/dist/cjs/v2/DSModal.js.map +1 -1
- package/dist/cjs/v2/components/Footer.js +19 -7
- package/dist/cjs/v2/components/Footer.js.map +1 -1
- package/dist/cjs/v2/components/ModalContent.js +15 -3
- package/dist/cjs/v2/components/ModalContent.js.map +1 -1
- package/dist/cjs/v2/components/SelectionHeader.js +15 -3
- package/dist/cjs/v2/components/SelectionHeader.js.map +1 -1
- package/dist/esm/DSModal.js +32 -7
- package/dist/esm/DSModal.js.map +1 -1
- package/dist/esm/v1/DSModal.js +23 -13
- package/dist/esm/v1/DSModal.js.map +1 -1
- package/dist/esm/v1/DSModalWrapper.js +21 -3
- package/dist/esm/v1/DSModalWrapper.js.map +1 -1
- package/dist/esm/v2/DSModal.js +17 -3
- package/dist/esm/v2/DSModal.js.map +1 -1
- package/dist/esm/v2/components/Footer.js +21 -7
- package/dist/esm/v2/components/Footer.js.map +1 -1
- package/dist/esm/v2/components/ModalContent.js +17 -3
- package/dist/esm/v2/components/ModalContent.js.map +1 -1
- package/dist/esm/v2/components/SelectionHeader.js +17 -3
- package/dist/esm/v2/components/SelectionHeader.js.map +1 -1
- package/package.json +9 -8
- package/dist/types/DSModal.d.ts +0 -14
- package/dist/types/constants.d.ts +0 -25
- package/dist/types/index.d.ts +0 -3
- package/dist/types/v1/DSModal.d.ts +0 -143
- package/dist/types/v1/DSModalType.d.ts +0 -1
- package/dist/types/v1/ModalFeedBack/ModalFeedBack.d.ts +0 -11
- package/dist/types/v2/DSModal.d.ts +0 -231
- package/dist/types/v2/blocks.d.ts +0 -9
- package/dist/types/v2/components/DecisionHeader.d.ts +0 -6
- package/dist/types/v2/components/FeedbackIcon.d.ts +0 -5
- package/dist/types/v2/components/Footer.d.ts +0 -13
- package/dist/types/v2/components/FormHeader.d.ts +0 -8
- package/dist/types/v2/components/ModalContent.d.ts +0 -21
- package/dist/types/v2/components/SelectionHeader.d.ts +0 -8
- package/dist/types/v2/components/Title.d.ts +0 -6
- package/dist/types/v2/components/tests/DecisionHeader.test.d.ts +0 -1
- package/dist/types/v2/components/tests/FeedbackIcon.test.d.ts +0 -1
- package/dist/types/v2/components/tests/Footer.test.d.ts +0 -1
- package/dist/types/v2/components/tests/FormHeader.test.d.ts +0 -1
- package/dist/types/v2/components/tests/SelectionHeader.test.d.ts +0 -1
- package/dist/types/v2/helpers.d.ts +0 -16
- package/dist/types/v2/tests/DSModal.test.d.ts +0 -1
package/dist/cjs/DSModal.js
CHANGED
|
@@ -2,9 +2,35 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
7
21
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
22
|
+
var __objRest = (source, exclude) => {
|
|
23
|
+
var target = {};
|
|
24
|
+
for (var prop in source)
|
|
25
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
26
|
+
target[prop] = source[prop];
|
|
27
|
+
if (source != null && __getOwnPropSymbols)
|
|
28
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
29
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
30
|
+
target[prop] = source[prop];
|
|
31
|
+
}
|
|
32
|
+
return target;
|
|
33
|
+
};
|
|
8
34
|
var __export = (target, all) => {
|
|
9
35
|
for (var name in all)
|
|
10
36
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -38,14 +64,11 @@ var import_constants = require("./constants");
|
|
|
38
64
|
var import_DSModal = __toESM(require("./v1/DSModal"));
|
|
39
65
|
var import_DSModal2 = __toESM(require("./v2/DSModal"));
|
|
40
66
|
var import_prop_types2 = require("@elliemae/ds-shared/prop-types");
|
|
41
|
-
const DSModal = (
|
|
67
|
+
const DSModal = (_a) => {
|
|
68
|
+
var _b = _a, { version = 1 } = _b, rest = __objRest(_b, ["version"]);
|
|
42
69
|
if (version === 2)
|
|
43
|
-
return /* @__PURE__ */ import_react.default.createElement(import_DSModal2.default, {
|
|
44
|
-
|
|
45
|
-
});
|
|
46
|
-
return /* @__PURE__ */ import_react.default.createElement(import_DSModal.default, {
|
|
47
|
-
...rest
|
|
48
|
-
});
|
|
70
|
+
return /* @__PURE__ */ import_react.default.createElement(import_DSModal2.default, __spreadValues({}, rest));
|
|
71
|
+
return /* @__PURE__ */ import_react.default.createElement(import_DSModal.default, __spreadValues({}, rest));
|
|
49
72
|
};
|
|
50
73
|
DSModal.propTypes = {
|
|
51
74
|
version: import_prop_types.default.oneOf([1, 2])
|
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';\nimport DSModalV1 from './v1/DSModal';\nimport DSModalV2, { DSModalContent } from './v2/DSModal';\nimport { sizes, iconSizes } from '@elliemae/ds-shared/prop-types';\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": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,wBAAsB;AACtB,uBAA2B;AAC3B,qBAAsB;AACtB,sBAA0C;AAC1C,yBAAiC;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
|
@@ -2,8 +2,22 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
7
21
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
22
|
var __export = (target, all) => {
|
|
9
23
|
for (var name in all)
|
|
@@ -94,16 +108,12 @@ const DSModal = ({
|
|
|
94
108
|
overlayClassName: `${classNameBlock("overlay")} ${classNameModifier(centered && "center")}`,
|
|
95
109
|
shouldCloseOnOverlayClick,
|
|
96
110
|
style: {
|
|
97
|
-
content: {
|
|
98
|
-
...style
|
|
99
|
-
},
|
|
111
|
+
content: __spreadValues({}, style),
|
|
100
112
|
overlay: {
|
|
101
113
|
zIndex
|
|
102
114
|
}
|
|
103
115
|
}
|
|
104
|
-
}, /* @__PURE__ */ import_react.default.createElement("div", {
|
|
105
|
-
...containerProps
|
|
106
|
-
}, showHeader && /* @__PURE__ */ import_react.default.createElement("div", {
|
|
116
|
+
}, /* @__PURE__ */ import_react.default.createElement("div", __spreadValues({}, containerProps), showHeader && /* @__PURE__ */ import_react.default.createElement("div", {
|
|
107
117
|
className: classNameBlock("modal-header")
|
|
108
118
|
}, /* @__PURE__ */ import_react.default.createElement("div", {
|
|
109
119
|
className: classNameElement("title", "modal-header")
|
|
@@ -128,19 +138,17 @@ const DSModal = ({
|
|
|
128
138
|
}, /* @__PURE__ */ import_react.default.createElement("div", {
|
|
129
139
|
ref: actionsRef,
|
|
130
140
|
className: classNameBlock("modal-footer-actions")
|
|
131
|
-
}, modalType === import_constants.default.CONFIRM && /* @__PURE__ */ import_react.default.createElement(import_ds_button.default, {
|
|
141
|
+
}, modalType === import_constants.default.CONFIRM && /* @__PURE__ */ import_react.default.createElement(import_ds_button.default, __spreadValues({
|
|
132
142
|
buttonType: "secondary",
|
|
133
143
|
className: `${classNameElement("button-action")} ${classNameModifier("reject", "button-action")} `,
|
|
134
144
|
labelText: rejectLabel,
|
|
135
|
-
onClick: onReject
|
|
136
|
-
|
|
137
|
-
}), /* @__PURE__ */ import_react.default.createElement(import_ds_button.default, {
|
|
145
|
+
onClick: onReject
|
|
146
|
+
}, overridePropsRejectButton)), /* @__PURE__ */ import_react.default.createElement(import_ds_button.default, __spreadValues({
|
|
138
147
|
buttonType: "primary",
|
|
139
148
|
className: `${classNameElement("button-action")} ${classNameModifier("confirm", "button-action")} `,
|
|
140
149
|
labelText: confirmLabel,
|
|
141
|
-
onClick: onConfirm
|
|
142
|
-
|
|
143
|
-
})))));
|
|
150
|
+
onClick: onConfirm
|
|
151
|
+
}, overridePropsConfirmButton))))));
|
|
144
152
|
};
|
|
145
153
|
DSModal.propTypes = {
|
|
146
154
|
className: import_prop_types.default.string,
|
|
@@ -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';\nimport ModalFeedBack from './ModalFeedBack/ModalFeedBack';\nimport { sizes, iconSizes } from '@elliemae/ds-shared/prop-types';\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": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
7
24
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
25
|
var __export = (target, all) => {
|
|
9
26
|
for (var name in all)
|
|
@@ -106,8 +123,7 @@ var DSModalWrapper_default = (WrappedComponent) => {
|
|
|
106
123
|
render() {
|
|
107
124
|
const { props, state } = this;
|
|
108
125
|
const { additionalFooterCssClass, height } = state;
|
|
109
|
-
return (0, import_react.createElement)(WrappedComponent, {
|
|
110
|
-
...props,
|
|
126
|
+
return (0, import_react.createElement)(WrappedComponent, __spreadProps(__spreadValues({}, props), {
|
|
111
127
|
height,
|
|
112
128
|
onResize: this.onResize,
|
|
113
129
|
onFooterHeight: this.onFooterHeight,
|
|
@@ -120,7 +136,7 @@ var DSModalWrapper_default = (WrappedComponent) => {
|
|
|
120
136
|
props.onAfterOpen();
|
|
121
137
|
this.verifyNodes();
|
|
122
138
|
}
|
|
123
|
-
});
|
|
139
|
+
}));
|
|
124
140
|
}
|
|
125
141
|
}
|
|
126
142
|
return DSModalWrapper;
|
|
@@ -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';\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": "
|
|
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;AAAA;AAAA,IAlCP,oBAAoB;AAClB,aAAO,iBAAiB,UAAU,KAAK;AAAA;AAAA,IAGzC,uBAAuB;AACrB,aAAO,oBAAoB,UAAU,KAAK;AAAA;AAAA,IAoC5C,eAAe;AACb,UAAI,CAAC,KAAK;AAAO,eAAO;AACxB,YAAM,EAAE,WAAW,SAAS,eAAe,KAAK;AAChD,UAAI,CAAC;AAAY,eAAO;AACxB,WAAK,SAAS,EAAE,0BAA0B;AAC1C,YAAM,EAAE,aAAa,mBAAmB;AACxC,YAAM,EAAE,aAAa,iBAAiB;AAEtC,UACE,kBACA,gBACC,eAAe,iBAAkB,MAAM,IACxC;AACA,eAAO,KAAK,SAAS,EAAE,0BAA0B;AAAA;AAEnD,aAAO,KAAK,SAAS,EAAE,0BAA0B;AAAA;AAAA,IAGnD,cAAc;AACZ,YAAM,EAAE,cAAc,KAAK;AAC3B,UAAI,cAAc,4BAAW,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,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/cjs/v2/DSModal.js
CHANGED
|
@@ -2,8 +2,22 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
7
21
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
22
|
var __export = (target, all) => {
|
|
9
23
|
for (var name in all)
|
|
@@ -86,9 +100,7 @@ const DSModal = ({
|
|
|
86
100
|
overlayClassName: `${classNameBlock("overlay")} ${classNameModifier(centered ? "center" : "top")}`,
|
|
87
101
|
shouldCloseOnOverlayClick,
|
|
88
102
|
style: {
|
|
89
|
-
content: {
|
|
90
|
-
...style
|
|
91
|
-
},
|
|
103
|
+
content: __spreadValues({}, style),
|
|
92
104
|
overlay: {
|
|
93
105
|
zIndex
|
|
94
106
|
}
|
|
@@ -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 from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport ReactModal from 'react-modal';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { MODAL_TYPE_V2 } from '../constants';\nimport { DSModalContent } from './components/ModalContent';\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 = 10,\n removePadding = false,\n}) => {\n if (\n typeof document !== 'undefined' &&\n process.env.NODE_ENV !== 'test' &&\n document &&\n ReactModal.setAppElement\n ) {\n ReactModal.setAppElement(appElement);\n }\n\n const {\n cssClassName,\n classNameBlock,\n classNameModifier,\n } = convertPropToCssClassName('modal-v2', className, { size });\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(\n centered ? 'center' : 'top',\n )}`}\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,\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(\n 'inject props to container wrapper',\n ),\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(\n 'css class for footer',\n ),\n /** override props confirm button */\n overridePropsConfirmButton: PropTypes.object.description(\n 'override props confirm button',\n ),\n /** override props reject button */\n overridePropsRejectButton: PropTypes.object.description(\n 'override props reject button',\n ),\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([\n 'default',\n 'xx-large',\n 'x-large',\n 'large',\n 'medium',\n 'small',\n ]).description('modal container size'),\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([\n PropTypes.element,\n PropTypes.arrayOf([PropTypes.element]),\n ]).description('modal container children'),\n /** close on click outside container */\n shouldCloseOnOverlayClick: PropTypes.bool.description(\n 'close on click outside container',\n ),\n /*\n App element ID to inject the modal\n */\n appElement: PropTypes.string.description(\n 'App element ID to inject the modal',\n ),\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;\n\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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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,8 +2,22 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
7
21
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
22
|
var __export = (target, all) => {
|
|
9
23
|
for (var name in all)
|
|
@@ -49,21 +63,19 @@ const Footer = ({
|
|
|
49
63
|
"data-testid": "modal-footer-wrapper"
|
|
50
64
|
}, /* @__PURE__ */ import_react.default.createElement(import_blocks.ModalFooterActions, {
|
|
51
65
|
ref: actionsRef
|
|
52
|
-
}, showRejectButton === true && /* @__PURE__ */ import_react.default.createElement(import_ds_button.default, {
|
|
66
|
+
}, showRejectButton === true && /* @__PURE__ */ import_react.default.createElement(import_ds_button.default, __spreadValues({
|
|
53
67
|
buttonType: "secondary",
|
|
54
68
|
className: "action-reject",
|
|
55
69
|
containerProps: { "data-testid": "modal-footer-reject-btn" },
|
|
56
70
|
labelText: rejectLabel,
|
|
57
|
-
onClick: onReject
|
|
58
|
-
|
|
59
|
-
}), /* @__PURE__ */ import_react.default.createElement(import_ds_button.default, {
|
|
71
|
+
onClick: onReject
|
|
72
|
+
}, overridePropsRejectButton)), /* @__PURE__ */ import_react.default.createElement(import_ds_button.default, __spreadValues({
|
|
60
73
|
buttonType: "primary",
|
|
61
74
|
className: "action-confirm",
|
|
62
75
|
containerProps: { "data-testid": "modal-footer-confirm-btn" },
|
|
63
76
|
labelText: confirmLabel,
|
|
64
|
-
onClick: onConfirm
|
|
65
|
-
|
|
66
|
-
})));
|
|
77
|
+
onClick: onConfirm
|
|
78
|
+
}, overridePropsConfirmButton))));
|
|
67
79
|
var Footer_default = Footer;
|
|
68
80
|
module.exports = __toCommonJS(Footer_exports);
|
|
69
81
|
//# sourceMappingURL=Footer.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/v2/components/Footer.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport DSButton from '@elliemae/ds-button';\nimport { ModalFooter, ModalFooterActions } from '../blocks';\n\nexport const Footer = ({\n additionalFooterCssClass,\n actionsRef,\n rejectLabel,\n onReject,\n overridePropsRejectButton,\n confirmLabel,\n onConfirm,\n overridePropsConfirmButton,\n showRejectButton,\n}) => (\n <ModalFooter classProps={{ additionalFooterCssClass }} data-testid=\"modal-footer-wrapper\">\n <ModalFooterActions ref={actionsRef}>\n {showRejectButton === true && (\n <DSButton\n buttonType=\"secondary\"\n className=\"action-reject\"\n containerProps={{ 'data-testid': 'modal-footer-reject-btn' }}\n labelText={rejectLabel}\n onClick={onReject}\n {...overridePropsRejectButton}\n />\n )}\n <DSButton\n buttonType=\"primary\"\n className=\"action-confirm\"\n containerProps={{ 'data-testid': 'modal-footer-confirm-btn' }}\n labelText={confirmLabel}\n onClick={onConfirm}\n {...overridePropsConfirmButton}\n />\n </ModalFooterActions>\n </ModalFooter>\n);\n\nexport default Footer;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,uBAAqB;AACrB,oBAAgD;AAEzC,MAAM,SAAS,CAAC;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MAEA,mDAAC,2BAAD;AAAA,EAAa,YAAY,EAAE;AAAA,EAA4B,eAAY;AAAA,GACjE,mDAAC,kCAAD;AAAA,EAAoB,KAAK;AAAA,GACtB,qBAAqB,QACpB,mDAAC,0BAAD;AAAA,EACE,YAAW;AAAA,EACX,WAAU;AAAA,EACV,gBAAgB,EAAE,eAAe;AAAA,EACjC,WAAW;AAAA,EACX,SAAS;AAAA,GACL,6BAGR,mDAAC,0BAAD;AAAA,EACE,YAAW;AAAA,EACX,WAAU;AAAA,EACV,gBAAgB,EAAE,eAAe;AAAA,EACjC,WAAW;AAAA,EACX,SAAS;AAAA,GACL;AAMZ,IAAO,iBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,8 +2,22 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
7
21
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
22
|
var __export = (target, all) => {
|
|
9
23
|
for (var name in all)
|
|
@@ -59,9 +73,7 @@ const DSModalContent = ({
|
|
|
59
73
|
rejectLabel = "Discard",
|
|
60
74
|
confirmLabel = "Save",
|
|
61
75
|
removePadding = false
|
|
62
|
-
}) => /* @__PURE__ */ import_react.default.createElement(import_blocks.ModalWrapper, {
|
|
63
|
-
...containerProps
|
|
64
|
-
}, (0, import_helpers.showForm)({ modalType, modalSubType }) && /* @__PURE__ */ import_react.default.createElement(import_FormHeader.FormHeader, {
|
|
76
|
+
}) => /* @__PURE__ */ import_react.default.createElement(import_blocks.ModalWrapper, __spreadValues({}, containerProps), (0, import_helpers.showForm)({ modalType, modalSubType }) && /* @__PURE__ */ import_react.default.createElement(import_FormHeader.FormHeader, {
|
|
65
77
|
modalTitle,
|
|
66
78
|
modalType,
|
|
67
79
|
onClose,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/v2/components/ModalContent.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { MODAL_TYPE_V2 } from '../../constants';\nimport { SelectionHeader } from './SelectionHeader';\nimport { DecisionHeader } from './DecisionHeader';\nimport { FormHeader } from './FormHeader';\nimport { FeedbackIcon } from './FeedbackIcon';\nimport { Footer } from './Footer';\nimport { Title } from './Title';\nimport {\n showDecision,\n showFeedBack,\n showFooter,\n showSelection,\n showForm,\n} from '../helpers';\nimport { ModalContent, ModalWrapper } from '../blocks';\n\nexport const DSModalContent = ({\n containerProps = {},\n //\n modalType = MODAL_TYPE_V2.INFORMATION,\n modalSubType = null,\n modalTitle = '',\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 onClose = () => null,\n onConfirm = () => null,\n onReject = () => null,\n rejectLabel = 'Discard',\n confirmLabel = 'Save',\n removePadding = false,\n}) => (\n <ModalWrapper {...containerProps}>\n {showForm({ modalType, modalSubType }) && (\n <FormHeader\n modalTitle={modalTitle}\n modalType={modalType}\n onClose={onClose}\n showClose={showClose}\n />\n )}\n {showSelection({ modalType, modalSubType }) && (\n <SelectionHeader\n modalTitle={modalTitle}\n modalType={modalType}\n searchProps={searchProps}\n showClose={showClose}\n />\n )}\n {showDecision({ modalType, modalSubType }) && (\n <DecisionHeader onClose={onClose} showClose={showClose} />\n )}\n {showFeedBack({ modalType, modalSubType }) && (\n <FeedbackIcon modalSubType={modalSubType} />\n )}\n {showDecision({ modalType, modalSubType }) && (\n <Title modalTitle={modalTitle} modalType={modalType} />\n )}\n <ModalContent classProps={{ type: modalType, removePadding }}>\n {children}\n </ModalContent>\n {showFooter({ modalType, modalSubType }) && (\n <Footer\n actionsRef={actionsRef}\n additionalFooterCssClass={additionalFooterCssClass}\n confirmLabel={confirmLabel}\n onConfirm={onConfirm}\n onReject={onReject}\n overridePropsConfirmButton={overridePropsConfirmButton}\n overridePropsRejectButton={overridePropsRejectButton}\n rejectLabel={rejectLabel}\n showRejectButton={showRejectButton}\n />\n )}\n </ModalWrapper>\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,uBAA8B;AAC9B,6BAAgC;AAChC,4BAA+B;AAC/B,wBAA2B;AAC3B,0BAA6B;AAC7B,oBAAuB;AACvB,mBAAsB;AACtB,qBAMO;AACP,oBAA2C;AAEpC,MAAM,iBAAiB,CAAC;AAAA,EAC7B,iBAAiB;AAAA,EAEjB,YAAY,+BAAc;AAAA,EAC1B,eAAe;AAAA,EACf,aAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,YAAY;AAAA,EACZ,cAAc;AAAA,EAEd,aAAa,MAAM;AAAA,EACnB;AAAA,EACA,6BAA6B;AAAA,EAC7B,4BAA4B;AAAA,EAE5B;AAAA,EACA,UAAU,MAAM;AAAA,EAChB,YAAY,MAAM;AAAA,EAClB,WAAW,MAAM;AAAA,EACjB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,gBAAgB;AAAA,MAEhB,mDAAC,4BAAD,mBAAkB,iBACf,6BAAS,EAAE,WAAW,mBACrB,mDAAC,8BAAD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,IAGH,kCAAc,EAAE,WAAW,mBAC1B,mDAAC,wCAAD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,IAGH,iCAAa,EAAE,WAAW,mBACzB,mDAAC,sCAAD;AAAA,EAAgB;AAAA,EAAkB;AAAA,IAEnC,iCAAa,EAAE,WAAW,mBACzB,mDAAC,kCAAD;AAAA,EAAc;AAAA,IAEf,iCAAa,EAAE,WAAW,mBACzB,mDAAC,oBAAD;AAAA,EAAO;AAAA,EAAwB;AAAA,IAEjC,mDAAC,4BAAD;AAAA,EAAc,YAAY,EAAE,MAAM,WAAW;AAAA,GAC1C,WAEF,+BAAW,EAAE,WAAW,mBACvB,mDAAC,sBAAD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,8 +2,22 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
7
21
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
22
|
var __export = (target, all) => {
|
|
9
23
|
for (var name in all)
|
|
@@ -43,9 +57,7 @@ const SelectionHeader = ({ searchProps = {}, modalTitle, modalType, showClose })
|
|
|
43
57
|
}), showClose && /* @__PURE__ */ import_react.default.createElement(import_blocks.ModalHeaderTopRight, {
|
|
44
58
|
classProps: { type: "selection" },
|
|
45
59
|
"data-testid": "modal-search-box"
|
|
46
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_ds_form.DSSearchBox, {
|
|
47
|
-
...searchProps
|
|
48
|
-
})));
|
|
60
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_ds_form.DSSearchBox, __spreadValues({}, searchProps))));
|
|
49
61
|
var SelectionHeader_default = SelectionHeader;
|
|
50
62
|
module.exports = __toCommonJS(SelectionHeader_exports);
|
|
51
63
|
//# sourceMappingURL=SelectionHeader.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/v2/components/SelectionHeader.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { DSSearchBox } from '@elliemae/ds-form';\nimport { ModalHeader, ModalHeaderTopRight } from '../blocks';\nimport { Title } from './Title';\n\nexport const SelectionHeader = ({ searchProps = {}, modalTitle, modalType, showClose }) => (\n <ModalHeader classProps={{ type: 'selection' }}>\n <Title modalTitle={modalTitle} modalType={modalType} />\n {showClose && (\n <ModalHeaderTopRight classProps={{ type: 'selection' }} data-testid=\"modal-search-box\">\n <DSSearchBox {...searchProps} />\n </ModalHeaderTopRight>\n )}\n </ModalHeader>\n);\n\nexport default SelectionHeader;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,qBAA4B;AAC5B,oBAAiD;AACjD,mBAAsB;AAEf,MAAM,kBAAkB,CAAC,EAAE,cAAc,IAAI,YAAY,WAAW,gBACzE,mDAAC,2BAAD;AAAA,EAAa,YAAY,EAAE,MAAM;AAAA,GAC/B,mDAAC,oBAAD;AAAA,EAAO;AAAA,EAAwB;AAAA,IAC9B,aACC,mDAAC,mCAAD;AAAA,EAAqB,YAAY,EAAE,MAAM;AAAA,EAAe,eAAY;AAAA,GAClE,mDAAC,4BAAD,mBAAiB;AAMzB,IAAO,0BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/DSModal.js
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
var __objRest = (source, exclude) => {
|
|
18
|
+
var target = {};
|
|
19
|
+
for (var prop in source)
|
|
20
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
21
|
+
target[prop] = source[prop];
|
|
22
|
+
if (source != null && __getOwnPropSymbols)
|
|
23
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
24
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
};
|
|
1
29
|
import * as React from "react";
|
|
2
30
|
import React2 from "react";
|
|
3
31
|
import PropTypes from "prop-types";
|
|
@@ -5,14 +33,11 @@ import { modalTypes } from "./constants";
|
|
|
5
33
|
import DSModalV1 from "./v1/DSModal";
|
|
6
34
|
import DSModalV2, { DSModalContent } from "./v2/DSModal";
|
|
7
35
|
import { sizes, iconSizes } from "@elliemae/ds-shared/prop-types";
|
|
8
|
-
const DSModal = (
|
|
36
|
+
const DSModal = (_a) => {
|
|
37
|
+
var _b = _a, { version = 1 } = _b, rest = __objRest(_b, ["version"]);
|
|
9
38
|
if (version === 2)
|
|
10
|
-
return /* @__PURE__ */ React2.createElement(DSModalV2, {
|
|
11
|
-
|
|
12
|
-
});
|
|
13
|
-
return /* @__PURE__ */ React2.createElement(DSModalV1, {
|
|
14
|
-
...rest
|
|
15
|
-
});
|
|
39
|
+
return /* @__PURE__ */ React2.createElement(DSModalV2, __spreadValues({}, rest));
|
|
40
|
+
return /* @__PURE__ */ React2.createElement(DSModalV1, __spreadValues({}, rest));
|
|
16
41
|
};
|
|
17
42
|
DSModal.propTypes = {
|
|
18
43
|
version: PropTypes.oneOf([1, 2])
|
package/dist/esm/DSModal.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSModal.tsx"],
|
|
4
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/prop-types';\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
|
-
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,UAAU,CAAC,
|
|
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
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
1
17
|
import * as React from "react";
|
|
2
18
|
import React2 from "react";
|
|
3
19
|
import PropTypes from "prop-types";
|
|
@@ -63,16 +79,12 @@ const DSModal = ({
|
|
|
63
79
|
overlayClassName: `${classNameBlock("overlay")} ${classNameModifier(centered && "center")}`,
|
|
64
80
|
shouldCloseOnOverlayClick,
|
|
65
81
|
style: {
|
|
66
|
-
content: {
|
|
67
|
-
...style
|
|
68
|
-
},
|
|
82
|
+
content: __spreadValues({}, style),
|
|
69
83
|
overlay: {
|
|
70
84
|
zIndex
|
|
71
85
|
}
|
|
72
86
|
}
|
|
73
|
-
}, /* @__PURE__ */ React2.createElement("div", {
|
|
74
|
-
...containerProps
|
|
75
|
-
}, showHeader && /* @__PURE__ */ React2.createElement("div", {
|
|
87
|
+
}, /* @__PURE__ */ React2.createElement("div", __spreadValues({}, containerProps), showHeader && /* @__PURE__ */ React2.createElement("div", {
|
|
76
88
|
className: classNameBlock("modal-header")
|
|
77
89
|
}, /* @__PURE__ */ React2.createElement("div", {
|
|
78
90
|
className: classNameElement("title", "modal-header")
|
|
@@ -97,19 +109,17 @@ const DSModal = ({
|
|
|
97
109
|
}, /* @__PURE__ */ React2.createElement("div", {
|
|
98
110
|
ref: actionsRef,
|
|
99
111
|
className: classNameBlock("modal-footer-actions")
|
|
100
|
-
}, modalType === MODAL_TYPE.CONFIRM && /* @__PURE__ */ React2.createElement(DSButton, {
|
|
112
|
+
}, modalType === MODAL_TYPE.CONFIRM && /* @__PURE__ */ React2.createElement(DSButton, __spreadValues({
|
|
101
113
|
buttonType: "secondary",
|
|
102
114
|
className: `${classNameElement("button-action")} ${classNameModifier("reject", "button-action")} `,
|
|
103
115
|
labelText: rejectLabel,
|
|
104
|
-
onClick: onReject
|
|
105
|
-
|
|
106
|
-
}), /* @__PURE__ */ React2.createElement(DSButton, {
|
|
116
|
+
onClick: onReject
|
|
117
|
+
}, overridePropsRejectButton)), /* @__PURE__ */ React2.createElement(DSButton, __spreadValues({
|
|
107
118
|
buttonType: "primary",
|
|
108
119
|
className: `${classNameElement("button-action")} ${classNameModifier("confirm", "button-action")} `,
|
|
109
120
|
labelText: confirmLabel,
|
|
110
|
-
onClick: onConfirm
|
|
111
|
-
|
|
112
|
-
})))));
|
|
121
|
+
onClick: onConfirm
|
|
122
|
+
}, overridePropsConfirmButton))))));
|
|
113
123
|
};
|
|
114
124
|
DSModal.propTypes = {
|
|
115
125
|
className: PropTypes.string,
|