@elliemae/ds-modal 3.0.0-next.1 → 3.0.0-next.5
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 +111 -0
- package/dist/cjs/DSModal.js.map +7 -0
- package/dist/cjs/constants.js +73 -0
- package/dist/cjs/constants.js.map +7 -0
- package/dist/cjs/index.js +43 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/v1/DSModal.js +185 -0
- package/dist/cjs/v1/DSModal.js.map +7 -0
- package/dist/cjs/v1/DSModalType.js +45 -0
- package/dist/cjs/v1/DSModalType.js.map +7 -0
- package/dist/cjs/v1/DSModalWrapper.js +145 -0
- package/dist/cjs/v1/DSModalWrapper.js.map +7 -0
- package/dist/cjs/v1/ModalFeedBack/ModalFeedBack.js +103 -0
- package/dist/cjs/v1/ModalFeedBack/ModalFeedBack.js.map +7 -0
- package/dist/cjs/v2/DSModal.js +172 -0
- package/dist/cjs/v2/DSModal.js.map +7 -0
- package/dist/cjs/v2/blocks.js +71 -0
- package/dist/cjs/v2/blocks.js.map +7 -0
- package/dist/cjs/v2/components/DecisionHeader.js +48 -0
- package/dist/cjs/v2/components/DecisionHeader.js.map +7 -0
- package/dist/cjs/v2/components/FeedbackIcon.js +73 -0
- package/dist/cjs/v2/components/FeedbackIcon.js.map +7 -0
- package/dist/cjs/v2/components/Footer.js +81 -0
- package/dist/cjs/v2/components/Footer.js.map +7 -0
- package/dist/cjs/v2/components/FormHeader.js +54 -0
- package/dist/cjs/v2/components/FormHeader.js.map +7 -0
- package/dist/cjs/v2/components/ModalContent.js +108 -0
- package/dist/cjs/v2/components/ModalContent.js.map +7 -0
- package/dist/cjs/v2/components/SelectionHeader.js +63 -0
- package/dist/cjs/v2/components/SelectionHeader.js.map +7 -0
- package/dist/cjs/v2/components/Title.js +41 -0
- package/dist/cjs/v2/components/Title.js.map +7 -0
- package/dist/cjs/v2/helpers.js +54 -0
- package/dist/cjs/v2/helpers.js.map +7 -0
- package/dist/esm/DSModal.js +84 -0
- package/dist/esm/DSModal.js.map +7 -0
- package/dist/esm/constants.js +44 -0
- package/dist/esm/constants.js.map +7 -0
- package/dist/esm/index.js +14 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/v1/DSModal.js +158 -0
- package/dist/esm/v1/DSModal.js.map +7 -0
- package/dist/esm/v1/DSModalType.js +16 -0
- package/dist/esm/v1/DSModalType.js.map +7 -0
- package/dist/esm/v1/DSModalWrapper.js +118 -0
- package/dist/esm/v1/DSModalWrapper.js.map +7 -0
- package/dist/esm/v1/ModalFeedBack/ModalFeedBack.js +74 -0
- package/dist/esm/v1/ModalFeedBack/ModalFeedBack.js.map +7 -0
- package/dist/esm/v2/DSModal.js +145 -0
- package/dist/esm/v2/DSModal.js.map +7 -0
- package/dist/esm/v2/blocks.js +42 -0
- package/dist/esm/v2/blocks.js.map +7 -0
- package/dist/esm/v2/components/DecisionHeader.js +19 -0
- package/dist/esm/v2/components/DecisionHeader.js.map +7 -0
- package/dist/esm/v2/components/FeedbackIcon.js +44 -0
- package/dist/esm/v2/components/FeedbackIcon.js.map +7 -0
- package/dist/esm/v2/components/Footer.js +54 -0
- package/dist/esm/v2/components/Footer.js.map +7 -0
- package/dist/esm/v2/components/FormHeader.js +25 -0
- package/dist/esm/v2/components/FormHeader.js.map +7 -0
- package/dist/esm/v2/components/ModalContent.js +87 -0
- package/dist/esm/v2/components/ModalContent.js.map +7 -0
- package/dist/esm/v2/components/SelectionHeader.js +36 -0
- package/dist/esm/v2/components/SelectionHeader.js.map +7 -0
- package/dist/esm/v2/components/Title.js +12 -0
- package/dist/esm/v2/components/Title.js.map +7 -0
- package/dist/esm/v2/helpers.js +25 -0
- package/dist/esm/v2/helpers.js.map +7 -0
- package/package.json +64 -55
- package/cjs/DSModal.js +0 -186
- package/cjs/constants.js +0 -34
- package/cjs/index.js +0 -18
- package/cjs/v1/DSModal.js +0 -148
- package/cjs/v1/DSModalType.js +0 -7
- package/cjs/v1/DSModalWrapper.js +0 -166
- package/cjs/v1/ModalFeedBack/ModalFeedBack.js +0 -98
- package/cjs/v2/DSModal.js +0 -203
- package/cjs/v2/blocks.js +0 -88
- package/cjs/v2/components/DecisionHeader.js +0 -38
- package/cjs/v2/components/FeedbackIcon.js +0 -64
- package/cjs/v2/components/Footer.js +0 -66
- package/cjs/v2/components/FormHeader.js +0 -47
- package/cjs/v2/components/ModalContent.js +0 -112
- package/cjs/v2/components/SelectionHeader.js +0 -49
- package/cjs/v2/components/Title.js +0 -26
- package/cjs/v2/helpers.js +0 -45
- package/esm/DSModal.js +0 -175
- package/esm/constants.js +0 -26
- package/esm/index.js +0 -4
- package/esm/v1/DSModal.js +0 -139
- package/esm/v1/DSModalType.js +0 -3
- package/esm/v1/DSModalWrapper.js +0 -160
- package/esm/v1/ModalFeedBack/ModalFeedBack.js +0 -92
- package/esm/v2/DSModal.js +0 -192
- package/esm/v2/blocks.js +0 -77
- package/esm/v2/components/DecisionHeader.js +0 -28
- package/esm/v2/components/FeedbackIcon.js +0 -55
- package/esm/v2/components/Footer.js +0 -55
- package/esm/v2/components/FormHeader.js +0 -37
- package/esm/v2/components/ModalContent.js +0 -103
- package/esm/v2/components/SelectionHeader.js +0 -39
- package/esm/v2/components/Title.js +0 -17
- package/esm/v2/helpers.js +0 -37
- package/types/DSModal.d.ts +0 -14
- package/types/constants.d.ts +0 -25
- package/types/index.d.ts +0 -4
- package/types/v1/DSModal.d.ts +0 -143
- package/types/v1/DSModalType.d.ts +0 -1
- package/types/v1/ModalFeedBack/ModalFeedBack.d.ts +0 -11
- package/types/v2/DSModal.d.ts +0 -260
- package/types/v2/blocks.d.ts +0 -9
- package/types/v2/components/DecisionHeader.d.ts +0 -6
- package/types/v2/components/FeedbackIcon.d.ts +0 -5
- package/types/v2/components/Footer.d.ts +0 -13
- package/types/v2/components/FormHeader.d.ts +0 -8
- package/types/v2/components/ModalContent.d.ts +0 -21
- package/types/v2/components/SelectionHeader.d.ts +0 -8
- package/types/v2/components/Title.d.ts +0 -6
- package/types/v2/components/tests/DecisionHeader.test.d.ts +0 -1
- package/types/v2/components/tests/FeedbackIcon.test.d.ts +0 -1
- package/types/v2/components/tests/Footer.test.d.ts +0 -1
- package/types/v2/components/tests/FormHeader.test.d.ts +0 -1
- package/types/v2/components/tests/SelectionHeader.test.d.ts +0 -1
- package/types/v2/helpers.d.ts +0 -16
- package/types/v2/tests/DSModal.test.d.ts +0 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
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
|
+
};
|
|
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
|
+
};
|
|
34
|
+
var __export = (target, all) => {
|
|
35
|
+
for (var name in all)
|
|
36
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
37
|
+
};
|
|
38
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
39
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
40
|
+
for (let key of __getOwnPropNames(module2))
|
|
41
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
42
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
43
|
+
}
|
|
44
|
+
return target;
|
|
45
|
+
};
|
|
46
|
+
var __toESM = (module2, isNodeMode) => {
|
|
47
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
48
|
+
};
|
|
49
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
50
|
+
return (module2, temp) => {
|
|
51
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
52
|
+
};
|
|
53
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
54
|
+
var DSModal_exports = {};
|
|
55
|
+
__export(DSModal_exports, {
|
|
56
|
+
DSModal: () => DSModal,
|
|
57
|
+
DSModalContent: () => import_DSModal2.DSModalContent,
|
|
58
|
+
default: () => DSModal_default
|
|
59
|
+
});
|
|
60
|
+
var React = __toESM(require("react"));
|
|
61
|
+
var import_react = __toESM(require("react"));
|
|
62
|
+
var import_prop_types = __toESM(require("prop-types"));
|
|
63
|
+
var import_constants = require("./constants");
|
|
64
|
+
var import_DSModal = __toESM(require("./v1/DSModal"));
|
|
65
|
+
var import_DSModal2 = __toESM(require("./v2/DSModal"));
|
|
66
|
+
var import_prop_types2 = require("@elliemae/ds-shared/prop-types");
|
|
67
|
+
const DSModal = (_a) => {
|
|
68
|
+
var _b = _a, { version = 1 } = _b, rest = __objRest(_b, ["version"]);
|
|
69
|
+
if (version === 2)
|
|
70
|
+
return /* @__PURE__ */ import_react.default.createElement(import_DSModal2.default, __spreadValues({}, rest));
|
|
71
|
+
return /* @__PURE__ */ import_react.default.createElement(import_DSModal.default, __spreadValues({}, rest));
|
|
72
|
+
};
|
|
73
|
+
DSModal.propTypes = {
|
|
74
|
+
version: import_prop_types.default.oneOf([1, 2])
|
|
75
|
+
};
|
|
76
|
+
import_DSModal.default.propTypes = {
|
|
77
|
+
version: import_prop_types.default.oneOf([1, 2]),
|
|
78
|
+
className: import_prop_types.default.string,
|
|
79
|
+
additionalFooterCssClass: import_prop_types.default.string,
|
|
80
|
+
style: import_prop_types.default.objectOf(import_prop_types.default.string),
|
|
81
|
+
iconCloseSize: import_prop_types.default.oneOf(import_prop_types2.iconSizes),
|
|
82
|
+
modalType: import_prop_types.default.oneOf(import_constants.modalTypes),
|
|
83
|
+
showHeader: import_prop_types.default.bool,
|
|
84
|
+
showFooter: import_prop_types.default.bool,
|
|
85
|
+
children: import_prop_types.default.element.isRequired,
|
|
86
|
+
centered: import_prop_types.default.bool,
|
|
87
|
+
confirmLabel: import_prop_types.default.string,
|
|
88
|
+
modalTitle: import_prop_types.default.string,
|
|
89
|
+
size: import_prop_types.default.oneOf(import_prop_types2.sizes),
|
|
90
|
+
isOpen: import_prop_types.default.bool,
|
|
91
|
+
onClose: import_prop_types.default.func,
|
|
92
|
+
onAfterOpen: import_prop_types.default.func,
|
|
93
|
+
onConfirm: import_prop_types.default.func,
|
|
94
|
+
onReject: import_prop_types.default.func,
|
|
95
|
+
rejectLabel: import_prop_types.default.string,
|
|
96
|
+
shouldCloseOnOverlayClick: import_prop_types.default.bool,
|
|
97
|
+
hasError: import_prop_types.default.bool,
|
|
98
|
+
hasWarning: import_prop_types.default.bool,
|
|
99
|
+
hasSuccess: import_prop_types.default.bool,
|
|
100
|
+
hasInfo: import_prop_types.default.bool,
|
|
101
|
+
hasHelp: import_prop_types.default.bool,
|
|
102
|
+
actionsRef: import_prop_types.default.func,
|
|
103
|
+
appElement: import_prop_types.default.string,
|
|
104
|
+
overridePropsConfirmButton: import_prop_types.default.objectOf(import_prop_types.default.shape({})),
|
|
105
|
+
overridePropsRejectButton: import_prop_types.default.objectOf(import_prop_types.default.string),
|
|
106
|
+
showConfirmButton: import_prop_types.default.bool,
|
|
107
|
+
customCloseComponent: import_prop_types.default.element
|
|
108
|
+
};
|
|
109
|
+
var DSModal_default = DSModal;
|
|
110
|
+
module.exports = __toCommonJS(DSModal_exports);
|
|
111
|
+
//# sourceMappingURL=DSModal.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSModal.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { modalTypes } from './constants';\nimport DSModalV1 from './v1/DSModal';\nimport DSModalV2, { DSModalContent } from './v2/DSModal';\nimport { sizes, iconSizes } from '@elliemae/ds-shared/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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var constants_exports = {};
|
|
29
|
+
__export(constants_exports, {
|
|
30
|
+
MODAL_SUB_TYPE_V2: () => MODAL_SUB_TYPE_V2,
|
|
31
|
+
MODAL_TYPE: () => MODAL_TYPE,
|
|
32
|
+
MODAL_TYPE_V2: () => MODAL_TYPE_V2,
|
|
33
|
+
default: () => constants_default,
|
|
34
|
+
modalTypes: () => modalTypes
|
|
35
|
+
});
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
const MODAL_TYPE = {
|
|
38
|
+
DEFAULT: "default",
|
|
39
|
+
ALERT: "alert",
|
|
40
|
+
CONFIRM: "confirm",
|
|
41
|
+
NOTIFICATION: "notification",
|
|
42
|
+
WARNING: "warning",
|
|
43
|
+
ERROR: "error",
|
|
44
|
+
SUCCESS: "success",
|
|
45
|
+
HELP: "help",
|
|
46
|
+
INFO: "info"
|
|
47
|
+
};
|
|
48
|
+
const modalTypes = [
|
|
49
|
+
MODAL_TYPE.DEFAULT,
|
|
50
|
+
MODAL_TYPE.ALERT,
|
|
51
|
+
MODAL_TYPE.CONFIRM,
|
|
52
|
+
MODAL_TYPE.NOTIFICATION,
|
|
53
|
+
MODAL_TYPE.WARNING,
|
|
54
|
+
MODAL_TYPE.ERROR,
|
|
55
|
+
MODAL_TYPE.SUCCESS,
|
|
56
|
+
MODAL_TYPE.HELP,
|
|
57
|
+
MODAL_TYPE.INFO
|
|
58
|
+
];
|
|
59
|
+
const MODAL_TYPE_V2 = {
|
|
60
|
+
INFORMATION: "information",
|
|
61
|
+
DECISION: "decision",
|
|
62
|
+
SELECTION: "selection",
|
|
63
|
+
FORM: "form"
|
|
64
|
+
};
|
|
65
|
+
const MODAL_SUB_TYPE_V2 = {
|
|
66
|
+
SUCCESS: "success",
|
|
67
|
+
WARNING: "warning",
|
|
68
|
+
ERROR: "error",
|
|
69
|
+
INFORMATION: "information"
|
|
70
|
+
};
|
|
71
|
+
var constants_default = MODAL_TYPE;
|
|
72
|
+
module.exports = __toCommonJS(constants_exports);
|
|
73
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/constants.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;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;AAAA;AAGD,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;AAAA;AAGN,MAAM,gBAAgB;AAAA,EAC3B,aAAa;AAAA,EACb,UAAU;AAAA,EACV,WAAW;AAAA,EACX,MAAM;AAAA;AAGD,MAAM,oBAAoB;AAAA,EAC/B,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AAAA;AAGf,IAAO,oBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var src_exports = {};
|
|
29
|
+
__export(src_exports, {
|
|
30
|
+
DSModal: () => import_DSModal.DSModal,
|
|
31
|
+
DSModalWithSchema: () => import_DSModal2.DSModalWithSchema,
|
|
32
|
+
MODAL_SUB_TYPE_V2: () => import_constants.MODAL_SUB_TYPE_V2,
|
|
33
|
+
MODAL_TYPE: () => import_constants.MODAL_TYPE,
|
|
34
|
+
MODAL_TYPE_V2: () => import_constants.MODAL_TYPE_V2,
|
|
35
|
+
default: () => import_DSModal.DSModal,
|
|
36
|
+
modalTypes: () => import_constants.modalTypes
|
|
37
|
+
});
|
|
38
|
+
var React = __toESM(require("react"));
|
|
39
|
+
var import_DSModal = require("./DSModal");
|
|
40
|
+
var import_constants = require("./constants");
|
|
41
|
+
var import_DSModal2 = require("./v2/DSModal");
|
|
42
|
+
module.exports = __toCommonJS(src_exports);
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export { DSModal, DSModal as default } from './DSModal';\nexport { MODAL_TYPE, modalTypes, MODAL_TYPE_V2, MODAL_SUB_TYPE_V2 } from './constants';\nexport { DSModalWithSchema } from './v2/DSModal';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,qBAA4C;AAC5C,uBAAyE;AACzE,sBAAkC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
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
|
+
};
|
|
21
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
22
|
+
var __export = (target, all) => {
|
|
23
|
+
for (var name in all)
|
|
24
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
25
|
+
};
|
|
26
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
27
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
28
|
+
for (let key of __getOwnPropNames(module2))
|
|
29
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
30
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
31
|
+
}
|
|
32
|
+
return target;
|
|
33
|
+
};
|
|
34
|
+
var __toESM = (module2, isNodeMode) => {
|
|
35
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
36
|
+
};
|
|
37
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
38
|
+
return (module2, temp) => {
|
|
39
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
40
|
+
};
|
|
41
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
42
|
+
var DSModal_exports = {};
|
|
43
|
+
__export(DSModal_exports, {
|
|
44
|
+
default: () => DSModal_default
|
|
45
|
+
});
|
|
46
|
+
var React = __toESM(require("react"));
|
|
47
|
+
var import_react = __toESM(require("react"));
|
|
48
|
+
var import_prop_types = __toESM(require("prop-types"));
|
|
49
|
+
var import_react_modal = __toESM(require("react-modal"));
|
|
50
|
+
var import_ds_classnames = require("@elliemae/ds-classnames");
|
|
51
|
+
var import_ds_icon = require("@elliemae/ds-icon");
|
|
52
|
+
var import_ds_icons = require("@elliemae/ds-icons");
|
|
53
|
+
var import_ds_button = __toESM(require("@elliemae/ds-button"));
|
|
54
|
+
var import_constants = __toESM(require("../constants"));
|
|
55
|
+
var import_ModalFeedBack = __toESM(require("./ModalFeedBack/ModalFeedBack"));
|
|
56
|
+
var import_prop_types2 = require("@elliemae/ds-shared/prop-types");
|
|
57
|
+
const DSModal = ({
|
|
58
|
+
containerProps = {},
|
|
59
|
+
className = "",
|
|
60
|
+
dataTestId = "ds-modal",
|
|
61
|
+
additionalFooterCssClass = "",
|
|
62
|
+
style = {},
|
|
63
|
+
iconCloseSize = import_ds_icon.DSIconSizes.S,
|
|
64
|
+
modalType = import_constants.default.DEFAULT,
|
|
65
|
+
showHeader = true,
|
|
66
|
+
showFooter = true,
|
|
67
|
+
children,
|
|
68
|
+
centered = true,
|
|
69
|
+
confirmLabel = "Accept",
|
|
70
|
+
modalTitle = "",
|
|
71
|
+
size = "medium",
|
|
72
|
+
isOpen = false,
|
|
73
|
+
onClose = () => null,
|
|
74
|
+
onAfterOpen = () => null,
|
|
75
|
+
onConfirm = () => null,
|
|
76
|
+
onReject = () => null,
|
|
77
|
+
rejectLabel = "Cancel",
|
|
78
|
+
shouldCloseOnOverlayClick = false,
|
|
79
|
+
hasError = false,
|
|
80
|
+
hasWarning = false,
|
|
81
|
+
hasSuccess = false,
|
|
82
|
+
hasInfo = false,
|
|
83
|
+
hasHelp = false,
|
|
84
|
+
actionsRef = () => null,
|
|
85
|
+
appElement = "#root",
|
|
86
|
+
overridePropsConfirmButton = {},
|
|
87
|
+
overridePropsRejectButton = {},
|
|
88
|
+
zIndex = 10
|
|
89
|
+
}) => {
|
|
90
|
+
typeof document !== "undefined" && document && import_react_modal.default.setAppElement && import_react_modal.default.setAppElement(appElement);
|
|
91
|
+
const { cssClassName, classNameElement, classNameBlock, classNameModifier, classNameBlockModifier } = (0, import_ds_classnames.convertPropToCssClassName)("modal", className, {
|
|
92
|
+
hasError,
|
|
93
|
+
hasWarning,
|
|
94
|
+
hasSuccess,
|
|
95
|
+
modalType,
|
|
96
|
+
size
|
|
97
|
+
});
|
|
98
|
+
const { WARNING, ERROR, SUCCESS, HELP, INFO } = import_constants.default;
|
|
99
|
+
const isAFeedbackType = [WARNING, ERROR, SUCCESS, HELP, INFO].indexOf(modalType) > -1;
|
|
100
|
+
const showFeedBack = isAFeedbackType || hasError || hasWarning || hasSuccess || hasInfo || hasHelp;
|
|
101
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react_modal.default, {
|
|
102
|
+
testId: dataTestId,
|
|
103
|
+
className: cssClassName,
|
|
104
|
+
contentLabel: modalTitle,
|
|
105
|
+
isOpen,
|
|
106
|
+
onAfterOpen,
|
|
107
|
+
onRequestClose: onClose,
|
|
108
|
+
overlayClassName: `${classNameBlock("overlay")} ${classNameModifier(centered && "center")}`,
|
|
109
|
+
shouldCloseOnOverlayClick,
|
|
110
|
+
style: {
|
|
111
|
+
content: __spreadValues({}, style),
|
|
112
|
+
overlay: {
|
|
113
|
+
zIndex
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}, /* @__PURE__ */ import_react.default.createElement("div", __spreadValues({}, containerProps), showHeader && /* @__PURE__ */ import_react.default.createElement("div", {
|
|
117
|
+
className: classNameBlock("modal-header")
|
|
118
|
+
}, /* @__PURE__ */ import_react.default.createElement("div", {
|
|
119
|
+
className: classNameElement("title", "modal-header")
|
|
120
|
+
}, modalTitle), /* @__PURE__ */ import_react.default.createElement("div", {
|
|
121
|
+
className: classNameElement("icon", "modal-header")
|
|
122
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_ds_button.default, {
|
|
123
|
+
buttonType: "link",
|
|
124
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_ds_icons.Close, null),
|
|
125
|
+
onClick: onClose,
|
|
126
|
+
size: iconCloseSize
|
|
127
|
+
}))), /* @__PURE__ */ import_react.default.createElement("div", {
|
|
128
|
+
className: classNameElement("body")
|
|
129
|
+
}, showFeedBack && /* @__PURE__ */ import_react.default.createElement(import_ModalFeedBack.default, {
|
|
130
|
+
hasError,
|
|
131
|
+
hasHelp,
|
|
132
|
+
hasInfo,
|
|
133
|
+
hasSuccess,
|
|
134
|
+
hasWarning,
|
|
135
|
+
modalType
|
|
136
|
+
}), children), showFooter && !isAFeedbackType && /* @__PURE__ */ import_react.default.createElement("div", {
|
|
137
|
+
className: `${classNameBlock("modal-footer")} ${additionalFooterCssClass ? classNameBlockModifier(additionalFooterCssClass, "modal-footer") : ""}`
|
|
138
|
+
}, /* @__PURE__ */ import_react.default.createElement("div", {
|
|
139
|
+
ref: actionsRef,
|
|
140
|
+
className: classNameBlock("modal-footer-actions")
|
|
141
|
+
}, modalType === import_constants.default.CONFIRM && /* @__PURE__ */ import_react.default.createElement(import_ds_button.default, __spreadValues({
|
|
142
|
+
buttonType: "secondary",
|
|
143
|
+
className: `${classNameElement("button-action")} ${classNameModifier("reject", "button-action")} `,
|
|
144
|
+
labelText: rejectLabel,
|
|
145
|
+
onClick: onReject
|
|
146
|
+
}, overridePropsRejectButton)), /* @__PURE__ */ import_react.default.createElement(import_ds_button.default, __spreadValues({
|
|
147
|
+
buttonType: "primary",
|
|
148
|
+
className: `${classNameElement("button-action")} ${classNameModifier("confirm", "button-action")} `,
|
|
149
|
+
labelText: confirmLabel,
|
|
150
|
+
onClick: onConfirm
|
|
151
|
+
}, overridePropsConfirmButton))))));
|
|
152
|
+
};
|
|
153
|
+
DSModal.propTypes = {
|
|
154
|
+
className: import_prop_types.default.string,
|
|
155
|
+
additionalFooterCssClass: import_prop_types.default.string,
|
|
156
|
+
style: import_prop_types.default.shape({}),
|
|
157
|
+
iconCloseSize: import_prop_types.default.oneOf(import_prop_types2.iconSizes),
|
|
158
|
+
modalType: import_prop_types.default.oneOf(import_constants.modalTypes),
|
|
159
|
+
showHeader: import_prop_types.default.bool,
|
|
160
|
+
showFooter: import_prop_types.default.bool,
|
|
161
|
+
children: import_prop_types.default.oneOfType([import_prop_types.default.element, import_prop_types.default.string, import_prop_types.default.any]).isRequired,
|
|
162
|
+
centered: import_prop_types.default.bool,
|
|
163
|
+
confirmLabel: import_prop_types.default.string,
|
|
164
|
+
modalTitle: import_prop_types.default.string,
|
|
165
|
+
size: import_prop_types.default.oneOf(import_prop_types2.sizes),
|
|
166
|
+
isOpen: import_prop_types.default.bool,
|
|
167
|
+
onClose: import_prop_types.default.func,
|
|
168
|
+
onAfterOpen: import_prop_types.default.func,
|
|
169
|
+
onConfirm: import_prop_types.default.func,
|
|
170
|
+
onReject: import_prop_types.default.func,
|
|
171
|
+
rejectLabel: import_prop_types.default.string,
|
|
172
|
+
shouldCloseOnOverlayClick: import_prop_types.default.bool,
|
|
173
|
+
hasError: import_prop_types.default.bool,
|
|
174
|
+
hasWarning: import_prop_types.default.bool,
|
|
175
|
+
hasSuccess: import_prop_types.default.bool,
|
|
176
|
+
hasInfo: import_prop_types.default.bool,
|
|
177
|
+
hasHelp: import_prop_types.default.bool,
|
|
178
|
+
actionsRef: import_prop_types.default.func,
|
|
179
|
+
appElement: import_prop_types.default.string,
|
|
180
|
+
overridePropsConfirmButton: import_prop_types.default.shape({}),
|
|
181
|
+
overridePropsRejectButton: import_prop_types.default.shape({})
|
|
182
|
+
};
|
|
183
|
+
var DSModal_default = DSModal;
|
|
184
|
+
module.exports = __toCommonJS(DSModal_exports);
|
|
185
|
+
//# sourceMappingURL=DSModal.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/v1/DSModal.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport ReactModal from 'react-modal';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { DSIconSizes } from '@elliemae/ds-icon';\nimport { Close } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport MODAL_TYPE, { modalTypes } from '../constants';\nimport ModalFeedBack from './ModalFeedBack/ModalFeedBack';\nimport { sizes, iconSizes } from '@elliemae/ds-shared/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": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var DSModalType_exports = {};
|
|
29
|
+
__export(DSModalType_exports, {
|
|
30
|
+
modalTypes: () => modalTypes
|
|
31
|
+
});
|
|
32
|
+
var React = __toESM(require("react"));
|
|
33
|
+
const modalTypes = [
|
|
34
|
+
MODAL_TYPE.DEFAULT,
|
|
35
|
+
MODAL_TYPE.ALERT,
|
|
36
|
+
MODAL_TYPE.CONFIRM,
|
|
37
|
+
MODAL_TYPE.NOTIFICATION,
|
|
38
|
+
MODAL_TYPE.WARNING,
|
|
39
|
+
MODAL_TYPE.ERROR,
|
|
40
|
+
MODAL_TYPE.SUCCESS,
|
|
41
|
+
MODAL_TYPE.HELP,
|
|
42
|
+
MODAL_TYPE.INFO
|
|
43
|
+
];
|
|
44
|
+
module.exports = __toCommonJS(DSModalType_exports);
|
|
45
|
+
//# sourceMappingURL=DSModalType.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/v1/DSModalType.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;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;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|