@elliemae/ds-modal 2.3.0-alpha.9 → 2.3.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/DSModal.js +186 -0
- package/cjs/constants.js +34 -0
- package/cjs/index.js +18 -0
- package/cjs/v1/DSModal.js +148 -0
- package/cjs/v1/DSModalType.js +7 -0
- package/cjs/v1/DSModalWrapper.js +166 -0
- package/cjs/v1/ModalFeedBack/ModalFeedBack.js +98 -0
- package/cjs/v2/DSModal.js +203 -0
- package/cjs/v2/blocks.js +88 -0
- package/cjs/v2/components/DecisionHeader.js +38 -0
- package/cjs/v2/components/FeedbackIcon.js +64 -0
- package/cjs/v2/components/Footer.js +66 -0
- package/cjs/v2/components/FormHeader.js +47 -0
- package/cjs/v2/components/ModalContent.js +112 -0
- package/cjs/v2/components/SelectionHeader.js +49 -0
- package/cjs/v2/components/Title.js +26 -0
- package/cjs/v2/helpers.js +45 -0
- package/esm/DSModal.js +175 -0
- package/esm/constants.js +26 -0
- package/esm/index.js +4 -0
- package/esm/v1/DSModal.js +139 -0
- package/esm/v1/DSModalType.js +3 -0
- package/esm/v1/DSModalWrapper.js +160 -0
- package/esm/v1/ModalFeedBack/ModalFeedBack.js +92 -0
- package/esm/v2/DSModal.js +192 -0
- package/esm/v2/blocks.js +77 -0
- package/esm/v2/components/DecisionHeader.js +28 -0
- package/esm/v2/components/FeedbackIcon.js +55 -0
- package/esm/v2/components/Footer.js +55 -0
- package/esm/v2/components/FormHeader.js +37 -0
- package/esm/v2/components/ModalContent.js +103 -0
- package/esm/v2/components/SelectionHeader.js +39 -0
- package/esm/v2/components/Title.js +17 -0
- package/esm/v2/helpers.js +37 -0
- package/package.json +56 -58
- package/{dist/types → types}/DSModal.d.ts +1 -1
- package/{dist/types → types}/constants.d.ts +0 -0
- package/types/index.d.ts +4 -0
- package/{dist/types → types}/v1/DSModal.d.ts +0 -0
- package/{dist/types → types}/v1/DSModalType.d.ts +0 -0
- package/{dist/types → types}/v1/ModalFeedBack/ModalFeedBack.d.ts +0 -0
- package/{dist/types → types}/v2/DSModal.d.ts +0 -0
- package/{dist/types → types}/v2/blocks.d.ts +0 -0
- package/{dist/types → types}/v2/components/DecisionHeader.d.ts +0 -0
- package/{dist/types → types}/v2/components/FeedbackIcon.d.ts +0 -0
- package/{dist/types → types}/v2/components/Footer.d.ts +0 -0
- package/{dist/types → types}/v2/components/FormHeader.d.ts +0 -0
- package/{dist/types → types}/v2/components/ModalContent.d.ts +0 -0
- package/{dist/types → types}/v2/components/SelectionHeader.d.ts +0 -0
- package/{dist/types → types}/v2/components/Title.d.ts +0 -0
- package/{dist/types → types}/v2/components/tests/DecisionHeader.test.d.ts +0 -0
- package/{dist/types → types}/v2/components/tests/FeedbackIcon.test.d.ts +0 -0
- package/{dist/types → types}/v2/components/tests/Footer.test.d.ts +0 -0
- package/{dist/types → types}/v2/components/tests/FormHeader.test.d.ts +0 -0
- package/{dist/types → types}/v2/components/tests/SelectionHeader.test.d.ts +0 -0
- package/{dist/types → types}/v2/helpers.d.ts +0 -0
- package/{dist/types → types}/v2/tests/DSModal.test.d.ts +0 -0
- package/dist/cjs/DSModal.js +0 -88
- package/dist/cjs/DSModal.js.map +0 -7
- package/dist/cjs/constants.js +0 -73
- package/dist/cjs/constants.js.map +0 -7
- package/dist/cjs/index.js +0 -43
- package/dist/cjs/index.js.map +0 -7
- package/dist/cjs/v1/DSModal.js +0 -177
- package/dist/cjs/v1/DSModal.js.map +0 -7
- package/dist/cjs/v1/DSModalType.js +0 -45
- package/dist/cjs/v1/DSModalType.js.map +0 -7
- package/dist/cjs/v1/DSModalWrapper.js +0 -129
- package/dist/cjs/v1/DSModalWrapper.js.map +0 -7
- package/dist/cjs/v1/ModalFeedBack/ModalFeedBack.js +0 -103
- package/dist/cjs/v1/ModalFeedBack/ModalFeedBack.js.map +0 -7
- package/dist/cjs/v2/DSModal.js +0 -160
- package/dist/cjs/v2/DSModal.js.map +0 -7
- package/dist/cjs/v2/blocks.js +0 -71
- package/dist/cjs/v2/blocks.js.map +0 -7
- package/dist/cjs/v2/components/DecisionHeader.js +0 -48
- package/dist/cjs/v2/components/DecisionHeader.js.map +0 -7
- package/dist/cjs/v2/components/FeedbackIcon.js +0 -73
- package/dist/cjs/v2/components/FeedbackIcon.js.map +0 -7
- package/dist/cjs/v2/components/Footer.js +0 -69
- package/dist/cjs/v2/components/Footer.js.map +0 -7
- package/dist/cjs/v2/components/FormHeader.js +0 -54
- package/dist/cjs/v2/components/FormHeader.js.map +0 -7
- package/dist/cjs/v2/components/ModalContent.js +0 -96
- package/dist/cjs/v2/components/ModalContent.js.map +0 -7
- package/dist/cjs/v2/components/SelectionHeader.js +0 -51
- package/dist/cjs/v2/components/SelectionHeader.js.map +0 -7
- package/dist/cjs/v2/components/Title.js +0 -41
- package/dist/cjs/v2/components/Title.js.map +0 -7
- package/dist/cjs/v2/helpers.js +0 -54
- package/dist/cjs/v2/helpers.js.map +0 -7
- package/dist/esm/DSModal.js +0 -59
- package/dist/esm/DSModal.js.map +0 -7
- package/dist/esm/constants.js +0 -44
- package/dist/esm/constants.js.map +0 -7
- package/dist/esm/index.js +0 -14
- package/dist/esm/index.js.map +0 -7
- package/dist/esm/v1/DSModal.js +0 -148
- package/dist/esm/v1/DSModal.js.map +0 -7
- package/dist/esm/v1/DSModalType.js +0 -16
- package/dist/esm/v1/DSModalType.js.map +0 -7
- package/dist/esm/v1/DSModalWrapper.js +0 -100
- package/dist/esm/v1/DSModalWrapper.js.map +0 -7
- package/dist/esm/v1/ModalFeedBack/ModalFeedBack.js +0 -74
- package/dist/esm/v1/ModalFeedBack/ModalFeedBack.js.map +0 -7
- package/dist/esm/v2/DSModal.js +0 -131
- package/dist/esm/v2/DSModal.js.map +0 -7
- package/dist/esm/v2/blocks.js +0 -42
- package/dist/esm/v2/blocks.js.map +0 -7
- package/dist/esm/v2/components/DecisionHeader.js +0 -19
- package/dist/esm/v2/components/DecisionHeader.js.map +0 -7
- package/dist/esm/v2/components/FeedbackIcon.js +0 -44
- package/dist/esm/v2/components/FeedbackIcon.js.map +0 -7
- package/dist/esm/v2/components/Footer.js +0 -40
- package/dist/esm/v2/components/Footer.js.map +0 -7
- package/dist/esm/v2/components/FormHeader.js +0 -25
- package/dist/esm/v2/components/FormHeader.js.map +0 -7
- package/dist/esm/v2/components/ModalContent.js +0 -73
- package/dist/esm/v2/components/ModalContent.js.map +0 -7
- package/dist/esm/v2/components/SelectionHeader.js +0 -22
- package/dist/esm/v2/components/SelectionHeader.js.map +0 -7
- package/dist/esm/v2/components/Title.js +0 -12
- package/dist/esm/v2/components/Title.js.map +0 -7
- package/dist/esm/v2/helpers.js +0 -25
- package/dist/esm/v2/helpers.js.map +0 -7
- package/dist/types/index.d.ts +0 -3
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/v1/DSModalType.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
-
"mappings": "AAAA;ACAO,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
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Component, createElement } from "react";
|
|
3
|
-
import { MODAL_TYPE } from "../constants";
|
|
4
|
-
var DSModalWrapper_default = (WrappedComponent) => {
|
|
5
|
-
class DSModalWrapper extends Component {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this.state = {
|
|
9
|
-
childready: false,
|
|
10
|
-
additionalFooterCssClass: "loading",
|
|
11
|
-
container: null,
|
|
12
|
-
actions: null,
|
|
13
|
-
height: "100%"
|
|
14
|
-
};
|
|
15
|
-
this.onHeaderHeight = (e) => {
|
|
16
|
-
this.heightHeaderFlag = true;
|
|
17
|
-
this.heightHeader = e.height || 0;
|
|
18
|
-
};
|
|
19
|
-
this.onFooterHeight = (e) => {
|
|
20
|
-
this.heightFooterFlag = true;
|
|
21
|
-
this.heightFooter = e.height || 0;
|
|
22
|
-
};
|
|
23
|
-
this.onResize = ({ bounds }) => {
|
|
24
|
-
if (this.heightFooterFlag && this.heightHeaderFlag) {
|
|
25
|
-
return this.setState({
|
|
26
|
-
height: bounds.height - this.heightFooter - this.heightHeader
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
return setTimeout(this.onResize({ bounds }), 0);
|
|
30
|
-
};
|
|
31
|
-
this.handleContainer = (node) => {
|
|
32
|
-
if (node)
|
|
33
|
-
this.setState({ container: node });
|
|
34
|
-
this.handleResize();
|
|
35
|
-
};
|
|
36
|
-
this.handleActions = (node) => {
|
|
37
|
-
if (node)
|
|
38
|
-
this.setState({ actions: node });
|
|
39
|
-
this.handleResize();
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
componentDidMount() {
|
|
43
|
-
window.addEventListener("resize", this.handleResize);
|
|
44
|
-
}
|
|
45
|
-
componentWillUnmount() {
|
|
46
|
-
window.removeEventListener("resize", this.handleResize);
|
|
47
|
-
}
|
|
48
|
-
handleResize() {
|
|
49
|
-
if (!this.state)
|
|
50
|
-
return null;
|
|
51
|
-
const { container, actions, childready } = this.state;
|
|
52
|
-
if (!childready)
|
|
53
|
-
return null;
|
|
54
|
-
this.setState({ additionalFooterCssClass: null });
|
|
55
|
-
const { clientWidth: containerWidth } = container;
|
|
56
|
-
const { clientWidth: actionsWidth } = actions;
|
|
57
|
-
if (containerWidth && actionsWidth && actionsWidth / containerWidth * 100 > 50) {
|
|
58
|
-
return this.setState({ additionalFooterCssClass: "fluid-actions" });
|
|
59
|
-
}
|
|
60
|
-
return this.setState({ additionalFooterCssClass: null });
|
|
61
|
-
}
|
|
62
|
-
verifyNodes() {
|
|
63
|
-
const { modalType } = this.props;
|
|
64
|
-
if (modalType !== MODAL_TYPE.DEFAULT) {
|
|
65
|
-
const nodesInterval = setInterval(() => {
|
|
66
|
-
const { container, actions } = this.state;
|
|
67
|
-
if (!container || !actions)
|
|
68
|
-
return null;
|
|
69
|
-
clearInterval(nodesInterval);
|
|
70
|
-
this.setState({ childready: true });
|
|
71
|
-
return this.handleResize();
|
|
72
|
-
}, 100);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
render() {
|
|
76
|
-
const { props, state } = this;
|
|
77
|
-
const { additionalFooterCssClass, height } = state;
|
|
78
|
-
return createElement(WrappedComponent, {
|
|
79
|
-
...props,
|
|
80
|
-
height,
|
|
81
|
-
onResize: this.onResize,
|
|
82
|
-
onFooterHeight: this.onFooterHeight,
|
|
83
|
-
onHeaderHeight: this.onHeaderHeight,
|
|
84
|
-
containerRef: this.handleContainer,
|
|
85
|
-
actionsRef: this.handleActions,
|
|
86
|
-
additionalFooterCssClass,
|
|
87
|
-
onAfterOpen: () => {
|
|
88
|
-
if (props.onAfterOpen)
|
|
89
|
-
props.onAfterOpen();
|
|
90
|
-
this.verifyNodes();
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return DSModalWrapper;
|
|
96
|
-
};
|
|
97
|
-
export {
|
|
98
|
-
DSModalWrapper_default as default
|
|
99
|
-
};
|
|
100
|
-
//# sourceMappingURL=DSModalWrapper.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/v1/DSModalWrapper.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { Component, createElement } from 'react';\nimport { MODAL_TYPE } from '../constants';\n\nexport default (WrappedComponent) => {\n class DSModalWrapper extends Component {\n state = {\n childready: false,\n additionalFooterCssClass: 'loading',\n container: null,\n actions: null,\n height: '100%',\n };\n\n componentDidMount() {\n window.addEventListener('resize', this.handleResize);\n }\n\n componentWillUnmount() {\n window.removeEventListener('resize', this.handleResize);\n }\n\n onHeaderHeight = (e) => {\n this.heightHeaderFlag = true;\n this.heightHeader = e.height || 0;\n };\n\n onFooterHeight = (e) => {\n this.heightFooterFlag = true;\n this.heightFooter = e.height || 0;\n };\n\n onResize = ({ bounds }) => {\n if (this.heightFooterFlag && this.heightHeaderFlag) {\n return this.setState({\n height: bounds.height - this.heightFooter - this.heightHeader,\n });\n }\n return setTimeout(this.onResize({ bounds }), 0);\n };\n\n handleContainer = (node) => {\n if (node) this.setState({ container: node });\n this.handleResize();\n };\n\n handleActions = (node) => {\n if (node) this.setState({ actions: node });\n this.handleResize();\n };\n\n /**\n * Change button width to 100% if the\n * combined width of the button (or button group) exceed 50% of the container width.\n */\n handleResize() {\n if (!this.state) return null;\n const { container, actions, childready } = this.state;\n if (!childready) return null;\n this.setState({ additionalFooterCssClass: null }); // !important reset to default state to recalculate\n const { clientWidth: containerWidth } = container;\n const { clientWidth: actionsWidth } = actions;\n // Change button width to 100% if the combined width of the button (or button group) exceed 50% of the container width.\n if (\n containerWidth &&\n actionsWidth &&\n (actionsWidth / containerWidth) * 100 > 50\n ) {\n return this.setState({ additionalFooterCssClass: 'fluid-actions' });\n }\n return this.setState({ additionalFooterCssClass: null });\n }\n\n verifyNodes() {\n const { modalType } = this.props;\n if (modalType !== MODAL_TYPE.DEFAULT) {\n const nodesInterval = setInterval(() => {\n // !important it checks when nodes are availables\n const { container, actions } = this.state;\n if (!container || !actions) return null;\n clearInterval(nodesInterval);\n this.setState({ childready: true });\n return this.handleResize();\n }, 100);\n }\n }\n\n render() {\n const { props, state } = this;\n const { additionalFooterCssClass, height } = state;\n return createElement(WrappedComponent, {\n ...props,\n height,\n onResize: this.onResize,\n onFooterHeight: this.onFooterHeight,\n onHeaderHeight: this.onHeaderHeight,\n containerRef: this.handleContainer,\n actionsRef: this.handleActions,\n additionalFooterCssClass,\n onAfterOpen: () => {\n if (props.onAfterOpen) props.onAfterOpen();\n this.verifyNodes();\n },\n });\n }\n }\n\n return DSModalWrapper;\n};\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AAEA,IAAO,yBAAQ,CAAC,qBAAqB;AACnC,+BAA6B,UAAU;AAAA,IAAvC,cAJF;AAIE;AACE,mBAAQ;AAAA,QACN,YAAY;AAAA,QACZ,0BAA0B;AAAA,QAC1B,WAAW;AAAA,QACX,SAAS;AAAA,QACT,QAAQ;AAAA;AAWV,4BAAiB,CAAC,MAAM;AACtB,aAAK,mBAAmB;AACxB,aAAK,eAAe,EAAE,UAAU;AAAA;AAGlC,4BAAiB,CAAC,MAAM;AACtB,aAAK,mBAAmB;AACxB,aAAK,eAAe,EAAE,UAAU;AAAA;AAGlC,sBAAW,CAAC,EAAE,aAAa;AACzB,YAAI,KAAK,oBAAoB,KAAK,kBAAkB;AAClD,iBAAO,KAAK,SAAS;AAAA,YACnB,QAAQ,OAAO,SAAS,KAAK,eAAe,KAAK;AAAA;AAAA;AAGrD,eAAO,WAAW,KAAK,SAAS,EAAE,WAAW;AAAA;AAG/C,6BAAkB,CAAC,SAAS;AAC1B,YAAI;AAAM,eAAK,SAAS,EAAE,WAAW;AACrC,aAAK;AAAA;AAGP,2BAAgB,CAAC,SAAS;AACxB,YAAI;AAAM,eAAK,SAAS,EAAE,SAAS;AACnC,aAAK;AAAA;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,WAAW,SAAS;AACpC,cAAM,gBAAgB,YAAY,MAAM;AAEtC,gBAAM,EAAE,WAAW,YAAY,KAAK;AACpC,cAAI,CAAC,aAAa,CAAC;AAAS,mBAAO;AACnC,wBAAc;AACd,eAAK,SAAS,EAAE,YAAY;AAC5B,iBAAO,KAAK;AAAA,WACX;AAAA;AAAA;AAAA,IAIP,SAAS;AACP,YAAM,EAAE,OAAO,UAAU;AACzB,YAAM,EAAE,0BAA0B,WAAW;AAC7C,aAAO,cAAc,kBAAkB;AAAA,WAClC;AAAA,QACH;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
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import React2 from "react";
|
|
3
|
-
import { WarningCircle, CheckmarkCircle, HelpCircle, InfoCircle } from "@elliemae/ds-icons";
|
|
4
|
-
import { convertPropToCssClassName } from "@elliemae/ds-classnames";
|
|
5
|
-
import { MODAL_TYPE } from "../../constants";
|
|
6
|
-
const feedbackIconSize = "xxl";
|
|
7
|
-
const { WARNING, ERROR, SUCCESS, HELP, INFO } = MODAL_TYPE;
|
|
8
|
-
const getModalType = (modalType, { hasError, hasWarning, hasSuccess, hasInfo, hasHelp }) => {
|
|
9
|
-
if ([WARNING, ERROR, SUCCESS, HELP, INFO].indexOf(modalType) > -1)
|
|
10
|
-
return modalType;
|
|
11
|
-
if (hasError)
|
|
12
|
-
return ERROR;
|
|
13
|
-
if (hasWarning)
|
|
14
|
-
return WARNING;
|
|
15
|
-
if (hasSuccess)
|
|
16
|
-
return SUCCESS;
|
|
17
|
-
if (hasHelp)
|
|
18
|
-
return HELP;
|
|
19
|
-
if (hasInfo)
|
|
20
|
-
return INFO;
|
|
21
|
-
return INFO;
|
|
22
|
-
};
|
|
23
|
-
const getIconType = (modalType) => {
|
|
24
|
-
switch (modalType) {
|
|
25
|
-
case WARNING:
|
|
26
|
-
case ERROR:
|
|
27
|
-
return /* @__PURE__ */ React2.createElement(WarningCircle, {
|
|
28
|
-
size: feedbackIconSize
|
|
29
|
-
});
|
|
30
|
-
case SUCCESS:
|
|
31
|
-
return /* @__PURE__ */ React2.createElement(CheckmarkCircle, {
|
|
32
|
-
size: feedbackIconSize
|
|
33
|
-
});
|
|
34
|
-
case HELP:
|
|
35
|
-
return /* @__PURE__ */ React2.createElement(HelpCircle, {
|
|
36
|
-
size: feedbackIconSize
|
|
37
|
-
});
|
|
38
|
-
case INFO:
|
|
39
|
-
return /* @__PURE__ */ React2.createElement(InfoCircle, {
|
|
40
|
-
size: feedbackIconSize
|
|
41
|
-
});
|
|
42
|
-
default:
|
|
43
|
-
return /* @__PURE__ */ React2.createElement(InfoCircle, {
|
|
44
|
-
size: feedbackIconSize
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
const ModalFeedBack = ({
|
|
49
|
-
className = "",
|
|
50
|
-
modalType = null,
|
|
51
|
-
hasError = false,
|
|
52
|
-
hasWarning = false,
|
|
53
|
-
hasSuccess = false,
|
|
54
|
-
hasInfo = false,
|
|
55
|
-
hasHelp = false
|
|
56
|
-
}) => {
|
|
57
|
-
const type = getModalType(modalType, {
|
|
58
|
-
hasError,
|
|
59
|
-
hasWarning,
|
|
60
|
-
hasSuccess,
|
|
61
|
-
hasInfo,
|
|
62
|
-
hasHelp
|
|
63
|
-
});
|
|
64
|
-
const { cssClassName } = convertPropToCssClassName("modal-feedback", className, { modalType: type });
|
|
65
|
-
const feedbackIcon = getIconType(type);
|
|
66
|
-
return /* @__PURE__ */ React2.createElement("div", {
|
|
67
|
-
className: cssClassName
|
|
68
|
-
}, feedbackIcon);
|
|
69
|
-
};
|
|
70
|
-
var ModalFeedBack_default = ModalFeedBack;
|
|
71
|
-
export {
|
|
72
|
-
ModalFeedBack_default as default
|
|
73
|
-
};
|
|
74
|
-
//# sourceMappingURL=ModalFeedBack.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/v1/ModalFeedBack/ModalFeedBack.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { WarningCircle, CheckmarkCircle, HelpCircle, InfoCircle } from '@elliemae/ds-icons';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { MODAL_TYPE } from '../../constants';\n\nconst feedbackIconSize = 'xxl';\n\nconst { WARNING, ERROR, SUCCESS, HELP, INFO } = MODAL_TYPE;\n\nconst getModalType = (modalType, { hasError, hasWarning, hasSuccess, hasInfo, hasHelp }) => {\n if ([WARNING, ERROR, SUCCESS, HELP, INFO].indexOf(modalType) > -1) return modalType;\n if (hasError) return ERROR;\n if (hasWarning) return WARNING;\n if (hasSuccess) return SUCCESS;\n if (hasHelp) return HELP;\n if (hasInfo) return INFO;\n return INFO;\n};\n\nconst getIconType = (modalType) => {\n switch (modalType) {\n case WARNING:\n case ERROR:\n return <WarningCircle size={feedbackIconSize} />;\n case SUCCESS:\n return <CheckmarkCircle size={feedbackIconSize} />;\n case HELP:\n return <HelpCircle size={feedbackIconSize} />;\n case INFO:\n return <InfoCircle size={feedbackIconSize} />;\n default:\n return <InfoCircle size={feedbackIconSize} />;\n }\n};\n\nconst ModalFeedBack = ({\n className = '',\n modalType = null,\n hasError = false,\n hasWarning = false,\n hasSuccess = false,\n hasInfo = false,\n hasHelp = false,\n}) => {\n const type = getModalType(modalType, {\n hasError,\n hasWarning,\n hasSuccess,\n hasInfo,\n hasHelp,\n });\n const { cssClassName } = convertPropToCssClassName('modal-feedback', className, { modalType: type });\n const feedbackIcon = getIconType(type);\n\n return <div className={cssClassName}>{feedbackIcon}</div>;\n};\n\nexport default ModalFeedBack;\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEA,MAAM,mBAAmB;AAEzB,MAAM,EAAE,SAAS,OAAO,SAAS,MAAM,SAAS;AAEhD,MAAM,eAAe,CAAC,WAAW,EAAE,UAAU,YAAY,YAAY,SAAS,cAAc;AAC1F,MAAI,CAAC,SAAS,OAAO,SAAS,MAAM,MAAM,QAAQ,aAAa;AAAI,WAAO;AAC1E,MAAI;AAAU,WAAO;AACrB,MAAI;AAAY,WAAO;AACvB,MAAI;AAAY,WAAO;AACvB,MAAI;AAAS,WAAO;AACpB,MAAI;AAAS,WAAO;AACpB,SAAO;AAAA;AAGT,MAAM,cAAc,CAAC,cAAc;AACjC,UAAQ;AAAA,SACD;AAAA,SACA;AACH,aAAO,qCAAC,eAAD;AAAA,QAAe,MAAM;AAAA;AAAA,SACzB;AACH,aAAO,qCAAC,iBAAD;AAAA,QAAiB,MAAM;AAAA;AAAA,SAC3B;AACH,aAAO,qCAAC,YAAD;AAAA,QAAY,MAAM;AAAA;AAAA,SACtB;AACH,aAAO,qCAAC,YAAD;AAAA,QAAY,MAAM;AAAA;AAAA;AAEzB,aAAO,qCAAC,YAAD;AAAA,QAAY,MAAM;AAAA;AAAA;AAAA;AAI/B,MAAM,gBAAgB,CAAC;AAAA,EACrB,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,aAAa;AAAA,EACb,aAAa;AAAA,EACb,UAAU;AAAA,EACV,UAAU;AAAA,MACN;AACJ,QAAM,OAAO,aAAa,WAAW;AAAA,IACnC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAEF,QAAM,EAAE,iBAAiB,0BAA0B,kBAAkB,WAAW,EAAE,WAAW;AAC7F,QAAM,eAAe,YAAY;AAEjC,SAAO,qCAAC,OAAD;AAAA,IAAK,WAAW;AAAA,KAAe;AAAA;AAGxC,IAAO,wBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/esm/v2/DSModal.js
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import React2 from "react";
|
|
3
|
-
import { PropTypes, describe } from "react-desc";
|
|
4
|
-
import ReactModal from "react-modal";
|
|
5
|
-
import { convertPropToCssClassName } from "@elliemae/ds-classnames";
|
|
6
|
-
import { MODAL_TYPE_V2 } from "../constants";
|
|
7
|
-
import { DSModalContent } from "./components/ModalContent";
|
|
8
|
-
const DSModal = ({
|
|
9
|
-
containerProps = {},
|
|
10
|
-
className = "",
|
|
11
|
-
style = {},
|
|
12
|
-
size = "default",
|
|
13
|
-
modalType = MODAL_TYPE_V2.INFORMATION,
|
|
14
|
-
modalSubType = null,
|
|
15
|
-
modalTitle = "",
|
|
16
|
-
dataTestId = "ds-modal",
|
|
17
|
-
centered = false,
|
|
18
|
-
showRejectButton = false,
|
|
19
|
-
showClose = true,
|
|
20
|
-
searchProps = {},
|
|
21
|
-
actionsRef = () => null,
|
|
22
|
-
additionalFooterCssClass,
|
|
23
|
-
overridePropsConfirmButton = {},
|
|
24
|
-
overridePropsRejectButton = {},
|
|
25
|
-
children,
|
|
26
|
-
isOpen = true,
|
|
27
|
-
onClose = () => null,
|
|
28
|
-
onAfterOpen = () => null,
|
|
29
|
-
onConfirm = () => null,
|
|
30
|
-
onReject = () => null,
|
|
31
|
-
rejectLabel = "Discard",
|
|
32
|
-
confirmLabel = "Save",
|
|
33
|
-
shouldCloseOnOverlayClick = false,
|
|
34
|
-
appElement = "#root",
|
|
35
|
-
zIndex = 10,
|
|
36
|
-
removePadding = false
|
|
37
|
-
}) => {
|
|
38
|
-
if (typeof document !== "undefined" && true && document && ReactModal.setAppElement) {
|
|
39
|
-
ReactModal.setAppElement(appElement);
|
|
40
|
-
}
|
|
41
|
-
const {
|
|
42
|
-
cssClassName,
|
|
43
|
-
classNameBlock,
|
|
44
|
-
classNameModifier
|
|
45
|
-
} = convertPropToCssClassName("modal-v2", className, { size });
|
|
46
|
-
return /* @__PURE__ */ React2.createElement(ReactModal, {
|
|
47
|
-
testId: dataTestId,
|
|
48
|
-
className: `${cssClassName} ${classNameBlock(`type-${modalType}`)}`,
|
|
49
|
-
contentLabel: modalTitle,
|
|
50
|
-
isOpen,
|
|
51
|
-
onAfterOpen,
|
|
52
|
-
onRequestClose: onClose,
|
|
53
|
-
overlayClassName: `${classNameBlock("overlay")} ${classNameModifier(centered ? "center" : "top")}`,
|
|
54
|
-
shouldCloseOnOverlayClick,
|
|
55
|
-
style: {
|
|
56
|
-
content: {
|
|
57
|
-
...style
|
|
58
|
-
},
|
|
59
|
-
overlay: {
|
|
60
|
-
zIndex
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}, /* @__PURE__ */ React2.createElement(DSModalContent, {
|
|
64
|
-
actionsRef,
|
|
65
|
-
additionalFooterCssClass,
|
|
66
|
-
confirmLabel,
|
|
67
|
-
containerProps,
|
|
68
|
-
modalSubType,
|
|
69
|
-
modalTitle,
|
|
70
|
-
modalType,
|
|
71
|
-
onClose,
|
|
72
|
-
onConfirm,
|
|
73
|
-
onReject,
|
|
74
|
-
overridePropsConfirmButton,
|
|
75
|
-
overridePropsRejectButton,
|
|
76
|
-
rejectLabel,
|
|
77
|
-
searchProps,
|
|
78
|
-
showClose,
|
|
79
|
-
showRejectButton,
|
|
80
|
-
removePadding
|
|
81
|
-
}, children));
|
|
82
|
-
};
|
|
83
|
-
const props = {
|
|
84
|
-
containerProps: PropTypes.object.description("inject props to container wrapper"),
|
|
85
|
-
className: PropTypes.string.description("css class"),
|
|
86
|
-
style: PropTypes.object.description("style object for container wrapper"),
|
|
87
|
-
modalTitle: PropTypes.string.description("modal container title"),
|
|
88
|
-
centered: PropTypes.bool.description("center container"),
|
|
89
|
-
showRejectButton: PropTypes.bool.description("show reject button"),
|
|
90
|
-
showClose: PropTypes.bool.description("show close button"),
|
|
91
|
-
searchProps: PropTypes.object.description("Props for search component"),
|
|
92
|
-
additionalFooterCssClass: PropTypes.string.description("css class for footer"),
|
|
93
|
-
overridePropsConfirmButton: PropTypes.object.description("override props confirm button"),
|
|
94
|
-
overridePropsRejectButton: PropTypes.object.description("override props reject button"),
|
|
95
|
-
isOpen: PropTypes.bool.description("controlled isOpen flag"),
|
|
96
|
-
onClose: PropTypes.func.description("close callback"),
|
|
97
|
-
onAfterOpen: PropTypes.func.description("after open callback"),
|
|
98
|
-
onConfirm: PropTypes.func.description("confirm callback"),
|
|
99
|
-
onReject: PropTypes.func.description("reject callback"),
|
|
100
|
-
rejectLabel: PropTypes.string.description("reject label"),
|
|
101
|
-
confirmLabel: PropTypes.string.description("confirm text string"),
|
|
102
|
-
size: PropTypes.oneOf([
|
|
103
|
-
"default",
|
|
104
|
-
"xx-large",
|
|
105
|
-
"x-large",
|
|
106
|
-
"large",
|
|
107
|
-
"medium",
|
|
108
|
-
"small"
|
|
109
|
-
]).description("modal container size"),
|
|
110
|
-
modalSubType: PropTypes.any.description("modal sub type"),
|
|
111
|
-
modalType: PropTypes.any.description("modal type"),
|
|
112
|
-
actionsRef: PropTypes.any.description("ref for modal footer actions"),
|
|
113
|
-
children: PropTypes.oneOfType([
|
|
114
|
-
PropTypes.element,
|
|
115
|
-
PropTypes.arrayOf([PropTypes.element])
|
|
116
|
-
]).description("modal container children"),
|
|
117
|
-
shouldCloseOnOverlayClick: PropTypes.bool.description("close on click outside container"),
|
|
118
|
-
appElement: PropTypes.string.description("App element ID to inject the modal"),
|
|
119
|
-
zIndex: PropTypes.number.description("zindex for modal container"),
|
|
120
|
-
removePadding: PropTypes.bool.description("remove modal builtin padding")
|
|
121
|
-
};
|
|
122
|
-
DSModal.propTypes = props;
|
|
123
|
-
const DSModalWithSchema = describe(DSModal);
|
|
124
|
-
DSModalWithSchema.propTypes = props;
|
|
125
|
-
var DSModal_default = DSModal;
|
|
126
|
-
export {
|
|
127
|
-
DSModalContent,
|
|
128
|
-
DSModalWithSchema,
|
|
129
|
-
DSModal_default as default
|
|
130
|
-
};
|
|
131
|
-
//# sourceMappingURL=DSModal.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/v2/DSModal.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/esm/v2/blocks.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
3
|
-
const blockName = "modal-v2";
|
|
4
|
-
const ModalHeader = aggregatedClasses("div")(blockName, "modal-header", ({ type, showClose }) => ({
|
|
5
|
-
[type]: type,
|
|
6
|
-
"with-close": showClose
|
|
7
|
-
}));
|
|
8
|
-
const ModalHeaderTopRight = aggregatedClasses("div")(blockName, "modal-header-close", ({ type }) => ({
|
|
9
|
-
[type]: type
|
|
10
|
-
}));
|
|
11
|
-
const ModalFeedback = aggregatedClasses("div")(blockName, "modal-feedback", ({ type }) => ({
|
|
12
|
-
[type]: type
|
|
13
|
-
}));
|
|
14
|
-
const ModalTitle = aggregatedClasses("h3")(blockName, "modal-title", ({ type }) => ({
|
|
15
|
-
[type]: type
|
|
16
|
-
}));
|
|
17
|
-
const ModalContent = aggregatedClasses("div")(blockName, "modal-content", ({ type, removePadding }) => ({
|
|
18
|
-
[type]: type,
|
|
19
|
-
"remove-padding": removePadding
|
|
20
|
-
}));
|
|
21
|
-
const ModalWrapper = aggregatedClasses("div")(blockName, "modal-wrapper", ({ type, removePadding }) => ({
|
|
22
|
-
[type]: type,
|
|
23
|
-
"remove-padding": removePadding
|
|
24
|
-
}));
|
|
25
|
-
const ModalFooter = aggregatedClasses("div")(blockName, "modal-footer", ({ type, additionalFooterCssClass }) => ({
|
|
26
|
-
[type]: type,
|
|
27
|
-
[additionalFooterCssClass]: additionalFooterCssClass
|
|
28
|
-
}));
|
|
29
|
-
const ModalFooterActions = aggregatedClasses("div")(blockName, "modal-footer-actions", ({ type }) => ({
|
|
30
|
-
[type]: type
|
|
31
|
-
}));
|
|
32
|
-
export {
|
|
33
|
-
ModalContent,
|
|
34
|
-
ModalFeedback,
|
|
35
|
-
ModalFooter,
|
|
36
|
-
ModalFooterActions,
|
|
37
|
-
ModalHeader,
|
|
38
|
-
ModalHeaderTopRight,
|
|
39
|
-
ModalTitle,
|
|
40
|
-
ModalWrapper
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=blocks.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/v2/blocks.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst blockName = 'modal-v2';\n\nexport const ModalHeader = aggregatedClasses('div')(blockName, 'modal-header', ({ type, showClose }) => ({\n [type]: type,\n 'with-close': showClose,\n}));\n\nexport const ModalHeaderTopRight = aggregatedClasses('div')(blockName, 'modal-header-close', ({ type }) => ({\n [type]: type,\n}));\n\nexport const ModalFeedback = aggregatedClasses('div')(blockName, 'modal-feedback', ({ type }) => ({\n [type]: type,\n}));\n\nexport const ModalTitle = aggregatedClasses('h3')(blockName, 'modal-title', ({ type }) => ({\n [type]: type,\n}));\n\nexport const ModalContent = aggregatedClasses('div')(blockName, 'modal-content', ({ type, removePadding }) => ({\n [type]: type,\n 'remove-padding': removePadding,\n}));\n\nexport const ModalWrapper = aggregatedClasses('div')(blockName, 'modal-wrapper', ({ type, removePadding }) => ({\n [type]: type,\n 'remove-padding': removePadding,\n}));\n\nexport const ModalFooter = aggregatedClasses('div')(\n blockName,\n 'modal-footer',\n ({ type, additionalFooterCssClass }) => ({\n [type]: type,\n [additionalFooterCssClass]: additionalFooterCssClass,\n }),\n);\n\nexport const ModalFooterActions = aggregatedClasses('div')(blockName, 'modal-footer-actions', ({ type }) => ({\n [type]: type,\n}));\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AAEA,MAAM,YAAY;AAEX,MAAM,cAAc,kBAAkB,OAAO,WAAW,gBAAgB,CAAC,EAAE,MAAM,gBAAiB;AAAA,GACtG,OAAO;AAAA,EACR,cAAc;AAAA;AAGT,MAAM,sBAAsB,kBAAkB,OAAO,WAAW,sBAAsB,CAAC,EAAE,WAAY;AAAA,GACzG,OAAO;AAAA;AAGH,MAAM,gBAAgB,kBAAkB,OAAO,WAAW,kBAAkB,CAAC,EAAE,WAAY;AAAA,GAC/F,OAAO;AAAA;AAGH,MAAM,aAAa,kBAAkB,MAAM,WAAW,eAAe,CAAC,EAAE,WAAY;AAAA,GACxF,OAAO;AAAA;AAGH,MAAM,eAAe,kBAAkB,OAAO,WAAW,iBAAiB,CAAC,EAAE,MAAM,oBAAqB;AAAA,GAC5G,OAAO;AAAA,EACR,kBAAkB;AAAA;AAGb,MAAM,eAAe,kBAAkB,OAAO,WAAW,iBAAiB,CAAC,EAAE,MAAM,oBAAqB;AAAA,GAC5G,OAAO;AAAA,EACR,kBAAkB;AAAA;AAGb,MAAM,cAAc,kBAAkB,OAC3C,WACA,gBACA,CAAC,EAAE,MAAM,+BAAgC;AAAA,GACtC,OAAO;AAAA,GACP,2BAA2B;AAAA;AAIzB,MAAM,qBAAqB,kBAAkB,OAAO,WAAW,wBAAwB,CAAC,EAAE,WAAY;AAAA,GAC1G,OAAO;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import React2 from "react";
|
|
3
|
-
import { Close } from "@elliemae/ds-icons";
|
|
4
|
-
import DSButton from "@elliemae/ds-button";
|
|
5
|
-
import { ModalHeader } from "../blocks";
|
|
6
|
-
const DecisionHeader = ({ onClose, showClose }) => /* @__PURE__ */ React2.createElement(ModalHeader, {
|
|
7
|
-
classProps: { type: "decision", showClose }
|
|
8
|
-
}, showClose && /* @__PURE__ */ React2.createElement(DSButton, {
|
|
9
|
-
buttonType: "link",
|
|
10
|
-
containerProps: { "data-testid": "modal-button-close" },
|
|
11
|
-
icon: /* @__PURE__ */ React2.createElement(Close, null),
|
|
12
|
-
onClick: onClose
|
|
13
|
-
}));
|
|
14
|
-
var DecisionHeader_default = DecisionHeader;
|
|
15
|
-
export {
|
|
16
|
-
DecisionHeader,
|
|
17
|
-
DecisionHeader_default as default
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=DecisionHeader.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/v2/components/DecisionHeader.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport { Close } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport { ModalHeader } from '../blocks';\n\nexport const DecisionHeader = ({ onClose, showClose }) => (\n <ModalHeader classProps={{ type: 'decision', showClose }}>\n {showClose && (\n <DSButton\n buttonType=\"link\"\n containerProps={{ 'data-testid': 'modal-button-close' }}\n icon={<Close />}\n onClick={onClose}\n />\n )}\n </ModalHeader>\n);\n\nexport default DecisionHeader;\n"],
|
|
5
|
-
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AAEO,MAAM,iBAAiB,CAAC,EAAE,SAAS,gBACxC,qCAAC,aAAD;AAAA,EAAa,YAAY,EAAE,MAAM,YAAY;AAAA,GAC1C,aACC,qCAAC,UAAD;AAAA,EACE,YAAW;AAAA,EACX,gBAAgB,EAAE,eAAe;AAAA,EACjC,MAAM,qCAAC,OAAD;AAAA,EACN,SAAS;AAAA;AAMjB,IAAO,yBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import React2 from "react";
|
|
3
|
-
import { ErrorHexegon, WarningTriangle, CheckmarkCircle, HelpCircle, InfoCircle } from "@elliemae/ds-icons";
|
|
4
|
-
import { MODAL_SUB_TYPE_V2 } from "../../constants";
|
|
5
|
-
import { ModalFeedback } from "../blocks";
|
|
6
|
-
const feedbackIconSize = "xxl";
|
|
7
|
-
const getIconType = (subtype) => {
|
|
8
|
-
switch (subtype) {
|
|
9
|
-
case MODAL_SUB_TYPE_V2.WARNING:
|
|
10
|
-
return /* @__PURE__ */ React2.createElement(WarningTriangle, {
|
|
11
|
-
"data-testid": "icon-waring",
|
|
12
|
-
size: feedbackIconSize
|
|
13
|
-
});
|
|
14
|
-
case MODAL_SUB_TYPE_V2.ERROR:
|
|
15
|
-
return /* @__PURE__ */ React2.createElement(ErrorHexegon, {
|
|
16
|
-
"data-testid": "icon-error",
|
|
17
|
-
size: feedbackIconSize
|
|
18
|
-
});
|
|
19
|
-
case MODAL_SUB_TYPE_V2.SUCCESS:
|
|
20
|
-
return /* @__PURE__ */ React2.createElement(CheckmarkCircle, {
|
|
21
|
-
"data-testid": "icon-success",
|
|
22
|
-
size: feedbackIconSize
|
|
23
|
-
});
|
|
24
|
-
case MODAL_SUB_TYPE_V2.INFORMATION:
|
|
25
|
-
return /* @__PURE__ */ React2.createElement(InfoCircle, {
|
|
26
|
-
"data-testid": "icon-information",
|
|
27
|
-
size: feedbackIconSize
|
|
28
|
-
});
|
|
29
|
-
default:
|
|
30
|
-
return /* @__PURE__ */ React2.createElement(HelpCircle, {
|
|
31
|
-
"data-testid": "icon-help",
|
|
32
|
-
size: feedbackIconSize
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
const FeedbackIcon = ({ modalSubType }) => /* @__PURE__ */ React2.createElement(ModalFeedback, {
|
|
37
|
-
classProps: { type: modalSubType }
|
|
38
|
-
}, getIconType(modalSubType));
|
|
39
|
-
var FeedbackIcon_default = FeedbackIcon;
|
|
40
|
-
export {
|
|
41
|
-
FeedbackIcon,
|
|
42
|
-
FeedbackIcon_default as default
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=FeedbackIcon.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/v2/components/FeedbackIcon.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { ErrorHexegon, WarningTriangle, CheckmarkCircle, HelpCircle, InfoCircle } from '@elliemae/ds-icons';\n\nimport { MODAL_SUB_TYPE_V2 } from '../../constants';\nimport { ModalFeedback } from '../blocks';\n\nconst feedbackIconSize = 'xxl';\n\nconst getIconType = (subtype) => {\n switch (subtype) {\n case MODAL_SUB_TYPE_V2.WARNING:\n return <WarningTriangle data-testid=\"icon-waring\" size={feedbackIconSize} />;\n case MODAL_SUB_TYPE_V2.ERROR:\n return <ErrorHexegon data-testid=\"icon-error\" size={feedbackIconSize} />;\n case MODAL_SUB_TYPE_V2.SUCCESS:\n return <CheckmarkCircle data-testid=\"icon-success\" size={feedbackIconSize} />;\n case MODAL_SUB_TYPE_V2.INFORMATION:\n return <InfoCircle data-testid=\"icon-information\" size={feedbackIconSize} />;\n default:\n return <HelpCircle data-testid=\"icon-help\" size={feedbackIconSize} />;\n }\n};\n\nexport const FeedbackIcon = ({ modalSubType }) => (\n <ModalFeedback classProps={{ type: modalSubType }}>{getIconType(modalSubType)}</ModalFeedback>\n);\n\nexport default FeedbackIcon;\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AAEA;AACA;AAEA,MAAM,mBAAmB;AAEzB,MAAM,cAAc,CAAC,YAAY;AAC/B,UAAQ;AAAA,SACD,kBAAkB;AACrB,aAAO,qCAAC,iBAAD;AAAA,QAAiB,eAAY;AAAA,QAAc,MAAM;AAAA;AAAA,SACrD,kBAAkB;AACrB,aAAO,qCAAC,cAAD;AAAA,QAAc,eAAY;AAAA,QAAa,MAAM;AAAA;AAAA,SACjD,kBAAkB;AACrB,aAAO,qCAAC,iBAAD;AAAA,QAAiB,eAAY;AAAA,QAAe,MAAM;AAAA;AAAA,SACtD,kBAAkB;AACrB,aAAO,qCAAC,YAAD;AAAA,QAAY,eAAY;AAAA,QAAmB,MAAM;AAAA;AAAA;AAExD,aAAO,qCAAC,YAAD;AAAA,QAAY,eAAY;AAAA,QAAY,MAAM;AAAA;AAAA;AAAA;AAIhD,MAAM,eAAe,CAAC,EAAE,mBAC7B,qCAAC,eAAD;AAAA,EAAe,YAAY,EAAE,MAAM;AAAA,GAAiB,YAAY;AAGlE,IAAO,uBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import React2 from "react";
|
|
3
|
-
import DSButton from "@elliemae/ds-button";
|
|
4
|
-
import { ModalFooter, ModalFooterActions } from "../blocks";
|
|
5
|
-
const Footer = ({
|
|
6
|
-
additionalFooterCssClass,
|
|
7
|
-
actionsRef,
|
|
8
|
-
rejectLabel,
|
|
9
|
-
onReject,
|
|
10
|
-
overridePropsRejectButton,
|
|
11
|
-
confirmLabel,
|
|
12
|
-
onConfirm,
|
|
13
|
-
overridePropsConfirmButton,
|
|
14
|
-
showRejectButton
|
|
15
|
-
}) => /* @__PURE__ */ React2.createElement(ModalFooter, {
|
|
16
|
-
classProps: { additionalFooterCssClass },
|
|
17
|
-
"data-testid": "modal-footer-wrapper"
|
|
18
|
-
}, /* @__PURE__ */ React2.createElement(ModalFooterActions, {
|
|
19
|
-
ref: actionsRef
|
|
20
|
-
}, showRejectButton === true && /* @__PURE__ */ React2.createElement(DSButton, {
|
|
21
|
-
buttonType: "secondary",
|
|
22
|
-
className: "action-reject",
|
|
23
|
-
containerProps: { "data-testid": "modal-footer-reject-btn" },
|
|
24
|
-
labelText: rejectLabel,
|
|
25
|
-
onClick: onReject,
|
|
26
|
-
...overridePropsRejectButton
|
|
27
|
-
}), /* @__PURE__ */ React2.createElement(DSButton, {
|
|
28
|
-
buttonType: "primary",
|
|
29
|
-
className: "action-confirm",
|
|
30
|
-
containerProps: { "data-testid": "modal-footer-confirm-btn" },
|
|
31
|
-
labelText: confirmLabel,
|
|
32
|
-
onClick: onConfirm,
|
|
33
|
-
...overridePropsConfirmButton
|
|
34
|
-
})));
|
|
35
|
-
var Footer_default = Footer;
|
|
36
|
-
export {
|
|
37
|
-
Footer,
|
|
38
|
-
Footer_default as default
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=Footer.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/v2/components/Footer.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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"],
|
|
5
|
-
"mappings": "AAAA;ACCA;AACA;AACA;AAEO,MAAM,SAAS,CAAC;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MAEA,qCAAC,aAAD;AAAA,EAAa,YAAY,EAAE;AAAA,EAA4B,eAAY;AAAA,GACjE,qCAAC,oBAAD;AAAA,EAAoB,KAAK;AAAA,GACtB,qBAAqB,QACpB,qCAAC,UAAD;AAAA,EACE,YAAW;AAAA,EACX,WAAU;AAAA,EACV,gBAAgB,EAAE,eAAe;AAAA,EACjC,WAAW;AAAA,EACX,SAAS;AAAA,KACL;AAAA,IAGR,qCAAC,UAAD;AAAA,EACE,YAAW;AAAA,EACX,WAAU;AAAA,EACV,gBAAgB,EAAE,eAAe;AAAA,EACjC,WAAW;AAAA,EACX,SAAS;AAAA,KACL;AAAA;AAMZ,IAAO,iBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import React2 from "react";
|
|
3
|
-
import { Close } from "@elliemae/ds-icons";
|
|
4
|
-
import DSButton from "@elliemae/ds-button";
|
|
5
|
-
import { ModalHeader, ModalHeaderTopRight } from "../blocks";
|
|
6
|
-
import { Title } from "./Title";
|
|
7
|
-
const FormHeader = ({ showClose, modalTitle, modalType, onClose }) => /* @__PURE__ */ React2.createElement(ModalHeader, {
|
|
8
|
-
classProps: { type: "selection" }
|
|
9
|
-
}, /* @__PURE__ */ React2.createElement(Title, {
|
|
10
|
-
modalTitle,
|
|
11
|
-
modalType
|
|
12
|
-
}), /* @__PURE__ */ React2.createElement(ModalHeaderTopRight, {
|
|
13
|
-
classProps: { type: "form" }
|
|
14
|
-
}, showClose && /* @__PURE__ */ React2.createElement(DSButton, {
|
|
15
|
-
buttonType: "link",
|
|
16
|
-
containerProps: { "data-testid": "modal-close-btn" },
|
|
17
|
-
icon: /* @__PURE__ */ React2.createElement(Close, null),
|
|
18
|
-
onClick: onClose
|
|
19
|
-
})));
|
|
20
|
-
var FormHeader_default = FormHeader;
|
|
21
|
-
export {
|
|
22
|
-
FormHeader,
|
|
23
|
-
FormHeader_default as default
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=FormHeader.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/v2/components/FormHeader.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport { Close } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport { ModalHeader, ModalHeaderTopRight } from '../blocks';\nimport { Title } from './Title';\n\nexport const FormHeader = ({ showClose, modalTitle, modalType, onClose }) => (\n <ModalHeader classProps={{ type: 'selection' }}>\n <Title modalTitle={modalTitle} modalType={modalType} />\n <ModalHeaderTopRight classProps={{ type: 'form' }}>\n {showClose && (\n <DSButton\n buttonType=\"link\"\n containerProps={{ 'data-testid': 'modal-close-btn' }}\n icon={<Close />}\n onClick={onClose}\n />\n )}\n </ModalHeaderTopRight>\n </ModalHeader>\n);\n\nexport default FormHeader;\n"],
|
|
5
|
-
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AAEO,MAAM,aAAa,CAAC,EAAE,WAAW,YAAY,WAAW,cAC7D,qCAAC,aAAD;AAAA,EAAa,YAAY,EAAE,MAAM;AAAA,GAC/B,qCAAC,OAAD;AAAA,EAAO;AAAA,EAAwB;AAAA,IAC/B,qCAAC,qBAAD;AAAA,EAAqB,YAAY,EAAE,MAAM;AAAA,GACtC,aACC,qCAAC,UAAD;AAAA,EACE,YAAW;AAAA,EACX,gBAAgB,EAAE,eAAe;AAAA,EACjC,MAAM,qCAAC,OAAD;AAAA,EACN,SAAS;AAAA;AAOnB,IAAO,qBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|