@elliemae/ds-modal 2.2.0-alpha.4 → 3.0.0-next.2
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 +184 -86
- package/cjs/constants.js +28 -67
- package/cjs/index.js +18 -39
- package/cjs/v1/DSModal.js +130 -159
- package/cjs/v1/DSModalType.js +7 -45
- package/cjs/v1/DSModalWrapper.js +113 -76
- package/cjs/v1/ModalFeedBack/ModalFeedBack.js +72 -77
- package/cjs/v2/DSModal.js +186 -143
- package/cjs/v2/blocks.js +86 -69
- package/cjs/v2/components/DecisionHeader.js +37 -47
- package/cjs/v2/components/FeedbackIcon.js +50 -59
- package/cjs/v2/components/Footer.js +65 -68
- package/cjs/v2/components/FormHeader.js +46 -53
- package/cjs/v2/components/ModalContent.js +111 -95
- package/cjs/v2/components/SelectionHeader.js +48 -50
- package/cjs/v2/components/Title.js +25 -40
- package/cjs/v2/helpers.js +40 -49
- package/esm/DSModal.js +142 -26
- package/esm/constants.js +20 -38
- package/esm/index.js +4 -10
- package/esm/v1/DSModal.js +121 -130
- package/esm/v1/DSModalType.js +3 -16
- package/esm/v1/DSModalWrapper.js +105 -45
- package/esm/v1/ModalFeedBack/ModalFeedBack.js +66 -48
- package/esm/v2/DSModal.js +173 -112
- package/esm/v2/blocks.js +77 -42
- package/esm/v2/components/DecisionHeader.js +27 -18
- package/esm/v2/components/FeedbackIcon.js +36 -25
- package/esm/v2/components/Footer.js +54 -39
- package/esm/v2/components/FormHeader.js +36 -24
- package/esm/v2/components/ModalContent.js +102 -72
- package/esm/v2/components/SelectionHeader.js +38 -21
- package/esm/v2/components/Title.js +16 -11
- package/esm/v2/helpers.js +28 -16
- package/package.json +8 -8
- package/types/DSModal.d.ts +1 -1
- package/cjs/DSModal.js.map +0 -7
- package/cjs/constants.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/v1/DSModal.js.map +0 -7
- package/cjs/v1/DSModalType.js.map +0 -7
- package/cjs/v1/DSModalWrapper.js.map +0 -7
- package/cjs/v1/ModalFeedBack/ModalFeedBack.js.map +0 -7
- package/cjs/v2/DSModal.js.map +0 -7
- package/cjs/v2/blocks.js.map +0 -7
- package/cjs/v2/components/DecisionHeader.js.map +0 -7
- package/cjs/v2/components/FeedbackIcon.js.map +0 -7
- package/cjs/v2/components/Footer.js.map +0 -7
- package/cjs/v2/components/FormHeader.js.map +0 -7
- package/cjs/v2/components/ModalContent.js.map +0 -7
- package/cjs/v2/components/SelectionHeader.js.map +0 -7
- package/cjs/v2/components/Title.js.map +0 -7
- package/cjs/v2/helpers.js.map +0 -7
- package/esm/DSModal.js.map +0 -7
- package/esm/constants.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/v1/DSModal.js.map +0 -7
- package/esm/v1/DSModalType.js.map +0 -7
- package/esm/v1/DSModalWrapper.js.map +0 -7
- package/esm/v1/ModalFeedBack/ModalFeedBack.js.map +0 -7
- package/esm/v2/DSModal.js.map +0 -7
- package/esm/v2/blocks.js.map +0 -7
- package/esm/v2/components/DecisionHeader.js.map +0 -7
- package/esm/v2/components/FeedbackIcon.js.map +0 -7
- package/esm/v2/components/Footer.js.map +0 -7
- package/esm/v2/components/FormHeader.js.map +0 -7
- package/esm/v2/components/ModalContent.js.map +0 -7
- package/esm/v2/components/SelectionHeader.js.map +0 -7
- package/esm/v2/components/Title.js.map +0 -7
- package/esm/v2/helpers.js.map +0 -7
|
@@ -1,44 +1,55 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { MODAL_SUB_TYPE_V2 } from
|
|
5
|
-
import { ModalFeedback } from
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
3
|
+
import { HelpCircle, InfoCircle, CheckmarkCircle, ErrorHexegon, WarningTriangle } from '@elliemae/ds-icons';
|
|
4
|
+
import { MODAL_SUB_TYPE_V2 } from '../../constants.js';
|
|
5
|
+
import { ModalFeedback } from '../blocks.js';
|
|
6
|
+
|
|
7
|
+
var _WarningTriangle, _ErrorHexegon, _CheckmarkCircle, _InfoCircle, _HelpCircle;
|
|
8
|
+
const feedbackIconSize = 'xxl';
|
|
9
|
+
|
|
10
|
+
const getIconType = subtype => {
|
|
8
11
|
switch (subtype) {
|
|
9
12
|
case MODAL_SUB_TYPE_V2.WARNING:
|
|
10
|
-
return
|
|
13
|
+
return _WarningTriangle || (_WarningTriangle = /*#__PURE__*/_jsx(WarningTriangle, {
|
|
11
14
|
"data-testid": "icon-waring",
|
|
12
15
|
size: feedbackIconSize
|
|
13
|
-
});
|
|
16
|
+
}));
|
|
17
|
+
|
|
14
18
|
case MODAL_SUB_TYPE_V2.ERROR:
|
|
15
|
-
return
|
|
19
|
+
return _ErrorHexegon || (_ErrorHexegon = /*#__PURE__*/_jsx(ErrorHexegon, {
|
|
16
20
|
"data-testid": "icon-error",
|
|
17
21
|
size: feedbackIconSize
|
|
18
|
-
});
|
|
22
|
+
}));
|
|
23
|
+
|
|
19
24
|
case MODAL_SUB_TYPE_V2.SUCCESS:
|
|
20
|
-
return
|
|
25
|
+
return _CheckmarkCircle || (_CheckmarkCircle = /*#__PURE__*/_jsx(CheckmarkCircle, {
|
|
21
26
|
"data-testid": "icon-success",
|
|
22
27
|
size: feedbackIconSize
|
|
23
|
-
});
|
|
28
|
+
}));
|
|
29
|
+
|
|
24
30
|
case MODAL_SUB_TYPE_V2.INFORMATION:
|
|
25
|
-
return
|
|
31
|
+
return _InfoCircle || (_InfoCircle = /*#__PURE__*/_jsx(InfoCircle, {
|
|
26
32
|
"data-testid": "icon-information",
|
|
27
33
|
size: feedbackIconSize
|
|
28
|
-
});
|
|
34
|
+
}));
|
|
35
|
+
|
|
29
36
|
default:
|
|
30
|
-
return
|
|
37
|
+
return _HelpCircle || (_HelpCircle = /*#__PURE__*/_jsx(HelpCircle, {
|
|
31
38
|
"data-testid": "icon-help",
|
|
32
39
|
size: feedbackIconSize
|
|
33
|
-
});
|
|
40
|
+
}));
|
|
34
41
|
}
|
|
35
42
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
|
|
44
|
+
const FeedbackIcon = _ref => {
|
|
45
|
+
let {
|
|
46
|
+
modalSubType
|
|
47
|
+
} = _ref;
|
|
48
|
+
return /*#__PURE__*/_jsx(ModalFeedback, {
|
|
49
|
+
classProps: {
|
|
50
|
+
type: modalSubType
|
|
51
|
+
}
|
|
52
|
+
}, void 0, getIconType(modalSubType));
|
|
43
53
|
};
|
|
44
|
-
|
|
54
|
+
|
|
55
|
+
export { FeedbackIcon, FeedbackIcon as default };
|
|
@@ -1,40 +1,55 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
7
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
8
|
+
import 'react';
|
|
9
|
+
import DSButton from '@elliemae/ds-button';
|
|
10
|
+
import { ModalFooter, ModalFooterActions } from '../blocks.js';
|
|
11
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
12
|
+
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
+
|
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
+
const Footer = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
additionalFooterCssClass,
|
|
19
|
+
actionsRef,
|
|
20
|
+
rejectLabel,
|
|
21
|
+
onReject,
|
|
22
|
+
overridePropsRejectButton,
|
|
23
|
+
confirmLabel,
|
|
24
|
+
onConfirm,
|
|
25
|
+
overridePropsConfirmButton,
|
|
26
|
+
showRejectButton
|
|
27
|
+
} = _ref;
|
|
28
|
+
return /*#__PURE__*/_jsx(ModalFooter, {
|
|
29
|
+
classProps: {
|
|
30
|
+
additionalFooterCssClass
|
|
31
|
+
},
|
|
32
|
+
"data-testid": "modal-footer-wrapper"
|
|
33
|
+
}, void 0, /*#__PURE__*/jsxs(ModalFooterActions, {
|
|
34
|
+
ref: actionsRef,
|
|
35
|
+
children: [showRejectButton === true && /*#__PURE__*/jsx(DSButton, _objectSpread({
|
|
36
|
+
buttonType: "secondary",
|
|
37
|
+
className: "action-reject",
|
|
38
|
+
containerProps: {
|
|
39
|
+
'data-testid': 'modal-footer-reject-btn'
|
|
40
|
+
},
|
|
41
|
+
labelText: rejectLabel,
|
|
42
|
+
onClick: onReject
|
|
43
|
+
}, overridePropsRejectButton)), /*#__PURE__*/jsx(DSButton, _objectSpread({
|
|
44
|
+
buttonType: "primary",
|
|
45
|
+
className: "action-confirm",
|
|
46
|
+
containerProps: {
|
|
47
|
+
'data-testid': 'modal-footer-confirm-btn'
|
|
48
|
+
},
|
|
49
|
+
labelText: confirmLabel,
|
|
50
|
+
onClick: onConfirm
|
|
51
|
+
}, overridePropsConfirmButton))]
|
|
52
|
+
}));
|
|
39
53
|
};
|
|
40
|
-
|
|
54
|
+
|
|
55
|
+
export { Footer, Footer as default };
|
|
@@ -1,25 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { Close } from
|
|
4
|
-
import DSButton from
|
|
5
|
-
import { ModalHeader, ModalHeaderTopRight } from
|
|
6
|
-
import { Title } from
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
3
|
+
import { Close } from '@elliemae/ds-icons';
|
|
4
|
+
import DSButton from '@elliemae/ds-button';
|
|
5
|
+
import { ModalHeader, ModalHeaderTopRight } from '../blocks.js';
|
|
6
|
+
import { Title } from './Title.js';
|
|
7
|
+
|
|
8
|
+
var _Close;
|
|
9
|
+
const FormHeader = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
showClose,
|
|
12
|
+
modalTitle,
|
|
13
|
+
modalType,
|
|
14
|
+
onClose
|
|
15
|
+
} = _ref;
|
|
16
|
+
return /*#__PURE__*/_jsx(ModalHeader, {
|
|
17
|
+
classProps: {
|
|
18
|
+
type: 'selection'
|
|
19
|
+
}
|
|
20
|
+
}, void 0, /*#__PURE__*/_jsx(Title, {
|
|
21
|
+
modalTitle: modalTitle,
|
|
22
|
+
modalType: modalType
|
|
23
|
+
}), /*#__PURE__*/_jsx(ModalHeaderTopRight, {
|
|
24
|
+
classProps: {
|
|
25
|
+
type: 'form'
|
|
26
|
+
}
|
|
27
|
+
}, void 0, showClose && /*#__PURE__*/_jsx(DSButton, {
|
|
28
|
+
buttonType: "link",
|
|
29
|
+
containerProps: {
|
|
30
|
+
'data-testid': 'modal-close-btn'
|
|
31
|
+
},
|
|
32
|
+
icon: _Close || (_Close = /*#__PURE__*/_jsx(Close, {})),
|
|
33
|
+
onClick: onClose
|
|
34
|
+
})));
|
|
24
35
|
};
|
|
25
|
-
|
|
36
|
+
|
|
37
|
+
export { FormHeader, FormHeader as default };
|
|
@@ -1,73 +1,103 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} from
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
|
+
import 'react';
|
|
9
|
+
import { MODAL_TYPE_V2 } from '../../constants.js';
|
|
10
|
+
import { SelectionHeader } from './SelectionHeader.js';
|
|
11
|
+
import { DecisionHeader } from './DecisionHeader.js';
|
|
12
|
+
import { FormHeader } from './FormHeader.js';
|
|
13
|
+
import { FeedbackIcon } from './FeedbackIcon.js';
|
|
14
|
+
import { Footer } from './Footer.js';
|
|
15
|
+
import { Title } from './Title.js';
|
|
16
|
+
import { showForm, showSelection, showDecision, showFeedBack, showFooter } from '../helpers.js';
|
|
17
|
+
import { ModalWrapper, ModalContent } from '../blocks.js';
|
|
18
|
+
import { jsxs } from 'react/jsx-runtime';
|
|
19
|
+
|
|
20
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
+
|
|
22
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
+
const DSModalContent = _ref => {
|
|
24
|
+
let {
|
|
25
|
+
containerProps = {},
|
|
26
|
+
//
|
|
27
|
+
modalType = MODAL_TYPE_V2.INFORMATION,
|
|
28
|
+
modalSubType = null,
|
|
29
|
+
modalTitle = '',
|
|
30
|
+
showRejectButton = false,
|
|
31
|
+
showClose = true,
|
|
32
|
+
searchProps = {},
|
|
33
|
+
// override
|
|
34
|
+
actionsRef = () => null,
|
|
35
|
+
additionalFooterCssClass,
|
|
36
|
+
overridePropsConfirmButton = {},
|
|
37
|
+
overridePropsRejectButton = {},
|
|
38
|
+
// react modal
|
|
39
|
+
children,
|
|
40
|
+
onClose = () => null,
|
|
41
|
+
onConfirm = () => null,
|
|
42
|
+
onReject = () => null,
|
|
43
|
+
rejectLabel = 'Discard',
|
|
44
|
+
confirmLabel = 'Save',
|
|
45
|
+
removePadding = false
|
|
46
|
+
} = _ref;
|
|
47
|
+
return /*#__PURE__*/jsxs(ModalWrapper, _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
48
|
+
children: [showForm({
|
|
49
|
+
modalType,
|
|
50
|
+
modalSubType
|
|
51
|
+
}) && /*#__PURE__*/_jsx(FormHeader, {
|
|
52
|
+
modalTitle: modalTitle,
|
|
53
|
+
modalType: modalType,
|
|
54
|
+
onClose: onClose,
|
|
55
|
+
showClose: showClose
|
|
56
|
+
}), showSelection({
|
|
57
|
+
modalType,
|
|
58
|
+
modalSubType
|
|
59
|
+
}) && /*#__PURE__*/_jsx(SelectionHeader, {
|
|
60
|
+
modalTitle: modalTitle,
|
|
61
|
+
modalType: modalType,
|
|
62
|
+
searchProps: searchProps,
|
|
63
|
+
showClose: showClose
|
|
64
|
+
}), showDecision({
|
|
65
|
+
modalType,
|
|
66
|
+
modalSubType
|
|
67
|
+
}) && /*#__PURE__*/_jsx(DecisionHeader, {
|
|
68
|
+
onClose: onClose,
|
|
69
|
+
showClose: showClose
|
|
70
|
+
}), showFeedBack({
|
|
71
|
+
modalType,
|
|
72
|
+
modalSubType
|
|
73
|
+
}) && /*#__PURE__*/_jsx(FeedbackIcon, {
|
|
74
|
+
modalSubType: modalSubType
|
|
75
|
+
}), showDecision({
|
|
76
|
+
modalType,
|
|
77
|
+
modalSubType
|
|
78
|
+
}) && /*#__PURE__*/_jsx(Title, {
|
|
79
|
+
modalTitle: modalTitle,
|
|
80
|
+
modalType: modalType
|
|
81
|
+
}), /*#__PURE__*/_jsx(ModalContent, {
|
|
82
|
+
classProps: {
|
|
83
|
+
type: modalType,
|
|
84
|
+
removePadding
|
|
85
|
+
}
|
|
86
|
+
}, void 0, children), showFooter({
|
|
87
|
+
modalType,
|
|
88
|
+
modalSubType
|
|
89
|
+
}) && /*#__PURE__*/_jsx(Footer, {
|
|
90
|
+
actionsRef: actionsRef,
|
|
91
|
+
additionalFooterCssClass: additionalFooterCssClass,
|
|
92
|
+
confirmLabel: confirmLabel,
|
|
93
|
+
onConfirm: onConfirm,
|
|
94
|
+
onReject: onReject,
|
|
95
|
+
overridePropsConfirmButton: overridePropsConfirmButton,
|
|
96
|
+
overridePropsRejectButton: overridePropsRejectButton,
|
|
97
|
+
rejectLabel: rejectLabel,
|
|
98
|
+
showRejectButton: showRejectButton
|
|
99
|
+
})]
|
|
100
|
+
}));
|
|
72
101
|
};
|
|
73
|
-
|
|
102
|
+
|
|
103
|
+
export { DSModalContent };
|
|
@@ -1,22 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
})));
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
|
+
import 'react';
|
|
9
|
+
import { DSSearchBox } from '@elliemae/ds-form';
|
|
10
|
+
import { ModalHeader, ModalHeaderTopRight } from '../blocks.js';
|
|
11
|
+
import { Title } from './Title.js';
|
|
12
|
+
import { jsx } from 'react/jsx-runtime';
|
|
13
|
+
|
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
+
|
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
|
+
const SelectionHeader = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
searchProps = {},
|
|
20
|
+
modalTitle,
|
|
21
|
+
modalType,
|
|
22
|
+
showClose
|
|
23
|
+
} = _ref;
|
|
24
|
+
return /*#__PURE__*/_jsx(ModalHeader, {
|
|
25
|
+
classProps: {
|
|
26
|
+
type: 'selection'
|
|
27
|
+
}
|
|
28
|
+
}, void 0, /*#__PURE__*/_jsx(Title, {
|
|
29
|
+
modalTitle: modalTitle,
|
|
30
|
+
modalType: modalType
|
|
31
|
+
}), showClose && /*#__PURE__*/_jsx(ModalHeaderTopRight, {
|
|
32
|
+
classProps: {
|
|
33
|
+
type: 'selection'
|
|
34
|
+
},
|
|
35
|
+
"data-testid": "modal-search-box"
|
|
36
|
+
}, void 0, /*#__PURE__*/jsx(DSSearchBox, _objectSpread({}, searchProps))));
|
|
21
37
|
};
|
|
22
|
-
|
|
38
|
+
|
|
39
|
+
export { SelectionHeader, SelectionHeader as default };
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { ModalTitle } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
3
|
+
import { ModalTitle } from '../blocks.js';
|
|
4
|
+
|
|
5
|
+
const Title = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
modalTitle,
|
|
8
|
+
modalType
|
|
9
|
+
} = _ref;
|
|
10
|
+
return /*#__PURE__*/_jsx(ModalTitle, {
|
|
11
|
+
classProps: {
|
|
12
|
+
type: modalType
|
|
13
|
+
}
|
|
14
|
+
}, void 0, modalTitle);
|
|
11
15
|
};
|
|
12
|
-
|
|
16
|
+
|
|
17
|
+
export { Title, Title as default };
|
package/esm/v2/helpers.js
CHANGED
|
@@ -1,25 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
function showDecision(
|
|
1
|
+
import { MODAL_TYPE_V2, MODAL_SUB_TYPE_V2 } from '../constants.js';
|
|
2
|
+
|
|
3
|
+
function showDecision(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
modalType
|
|
6
|
+
} = _ref;
|
|
4
7
|
return [MODAL_TYPE_V2.INFORMATION, MODAL_TYPE_V2.DECISION].indexOf(modalType) > -1;
|
|
5
8
|
}
|
|
6
|
-
function showFeedBack(
|
|
7
|
-
|
|
9
|
+
function showFeedBack(_ref2) {
|
|
10
|
+
let {
|
|
11
|
+
modalType,
|
|
12
|
+
modalSubType
|
|
13
|
+
} = _ref2;
|
|
14
|
+
return showDecision({
|
|
15
|
+
modalType
|
|
16
|
+
}) && Object.values(MODAL_SUB_TYPE_V2).indexOf(modalSubType) > -1;
|
|
8
17
|
}
|
|
9
|
-
function showFooter(
|
|
18
|
+
function showFooter(_ref3) {
|
|
19
|
+
let {
|
|
20
|
+
modalType
|
|
21
|
+
} = _ref3;
|
|
10
22
|
return modalType !== MODAL_TYPE_V2.INFORMATION;
|
|
11
23
|
}
|
|
12
|
-
function showSelection(
|
|
24
|
+
function showSelection(_ref4) {
|
|
25
|
+
let {
|
|
26
|
+
modalType
|
|
27
|
+
} = _ref4;
|
|
13
28
|
return modalType === MODAL_TYPE_V2.SELECTION;
|
|
14
29
|
}
|
|
15
|
-
function showForm(
|
|
30
|
+
function showForm(_ref5) {
|
|
31
|
+
let {
|
|
32
|
+
modalType
|
|
33
|
+
} = _ref5;
|
|
16
34
|
return modalType === MODAL_TYPE_V2.FORM;
|
|
17
35
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
showFeedBack,
|
|
21
|
-
showFooter,
|
|
22
|
-
showForm,
|
|
23
|
-
showSelection
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=helpers.js.map
|
|
36
|
+
|
|
37
|
+
export { showDecision, showFeedBack, showFooter, showForm, showSelection };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-modal",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-next.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Modal",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -96,13 +96,13 @@
|
|
|
96
96
|
"build": "node ../../scripts/build/build.js"
|
|
97
97
|
},
|
|
98
98
|
"dependencies": {
|
|
99
|
-
"@elliemae/ds-button": "
|
|
100
|
-
"@elliemae/ds-classnames": "
|
|
101
|
-
"@elliemae/ds-form": "
|
|
102
|
-
"@elliemae/ds-icon": "
|
|
103
|
-
"@elliemae/ds-icons": "
|
|
104
|
-
"@elliemae/ds-shared": "
|
|
105
|
-
"@elliemae/ds-system": "
|
|
99
|
+
"@elliemae/ds-button": "3.0.0-next.2",
|
|
100
|
+
"@elliemae/ds-classnames": "3.0.0-next.2",
|
|
101
|
+
"@elliemae/ds-form": "3.0.0-next.2",
|
|
102
|
+
"@elliemae/ds-icon": "3.0.0-next.2",
|
|
103
|
+
"@elliemae/ds-icons": "3.0.0-next.2",
|
|
104
|
+
"@elliemae/ds-shared": "3.0.0-next.2",
|
|
105
|
+
"@elliemae/ds-system": "3.0.0-next.2",
|
|
106
106
|
"prop-types": "~15.7.2",
|
|
107
107
|
"react-desc": "~4.1.3",
|
|
108
108
|
"react-modal": "~3.12.1"
|
package/types/DSModal.d.ts
CHANGED
package/cjs/DSModal.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
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,EAAE,UAAU,MAAM,WAAW;AAC5C,MAAI,YAAY;AAAG,WAAO,mDAAC,yBAAD;AAAA,SAAe;AAAA;AACzC,SAAO,mDAAC,wBAAD;AAAA,OAAe;AAAA;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
|
-
}
|
package/cjs/constants.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
package/cjs/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export * from './DSModal';\nexport * from './constants';\nexport { DSModalWithSchema } from './v2/DSModal';\n\nexport { default } from './DSModal';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc;AACd,wBAAc;AACd,qBAAkC;AAElC,sBAAwB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|