@elliemae/ds-modal 2.0.0-next.7 → 2.0.0-rc.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 +5 -0
- package/cjs/v1/DSModal.js +44 -39
- package/cjs/v1/DSModalWrapper.js +12 -5
- package/cjs/v1/ModalFeedBack/ModalFeedBack.js +24 -29
- package/cjs/v2/DSModal.js +40 -33
- package/cjs/v2/blocks.js +72 -48
- package/cjs/v2/components/DecisionHeader.js +21 -19
- package/cjs/v2/components/FeedbackIcon.js +16 -22
- package/cjs/v2/components/Footer.js +43 -35
- package/cjs/v2/components/FormHeader.js +30 -28
- package/cjs/v2/components/ModalContent.js +84 -76
- package/cjs/v2/components/SelectionHeader.js +27 -20
- package/cjs/v2/components/Title.js +11 -8
- package/cjs/v2/helpers.js +21 -16
- package/esm/DSModal.js +5 -0
- package/esm/v1/DSModal.js +44 -38
- package/esm/v1/DSModalWrapper.js +12 -5
- package/esm/v1/ModalFeedBack/ModalFeedBack.js +19 -20
- package/esm/v2/DSModal.js +40 -33
- package/esm/v2/blocks.js +72 -48
- package/esm/v2/components/DecisionHeader.js +21 -18
- package/esm/v2/components/FeedbackIcon.js +11 -12
- package/esm/v2/components/Footer.js +43 -35
- package/esm/v2/components/FormHeader.js +30 -27
- package/esm/v2/components/ModalContent.js +84 -76
- package/esm/v2/components/SelectionHeader.js +27 -19
- package/esm/v2/components/Title.js +11 -8
- package/esm/v2/helpers.js +21 -16
- package/package.json +7 -4
- package/types/v1/DSModal.d.ts +1 -1
- package/types/v2/components/SelectionHeader.d.ts +1 -1
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
5
10
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
11
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
12
|
require('react');
|
|
8
|
-
var DSButton = require('@elliemae/ds-
|
|
13
|
+
var DSButton = require('@elliemae/ds-button');
|
|
9
14
|
var blocks = require('../blocks.js');
|
|
10
15
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
16
|
|
|
@@ -18,41 +23,44 @@ var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
|
18
23
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
19
24
|
|
|
20
25
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
21
|
-
const Footer =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}, void 0, /*#__PURE__*/jsxRuntime.jsxs(blocks.ModalFooterActions, {
|
|
37
|
-
ref: actionsRef,
|
|
38
|
-
children: [showRejectButton === true && /*#__PURE__*/jsxRuntime.jsx(DSButton__default["default"], _objectSpread({
|
|
39
|
-
buttonType: "secondary",
|
|
40
|
-
className: "action-reject",
|
|
41
|
-
containerProps: {
|
|
42
|
-
'data-testid': 'modal-footer-reject-btn'
|
|
26
|
+
const Footer = _ref => {
|
|
27
|
+
let {
|
|
28
|
+
additionalFooterCssClass,
|
|
29
|
+
actionsRef,
|
|
30
|
+
rejectLabel,
|
|
31
|
+
onReject,
|
|
32
|
+
overridePropsRejectButton,
|
|
33
|
+
confirmLabel,
|
|
34
|
+
onConfirm,
|
|
35
|
+
overridePropsConfirmButton,
|
|
36
|
+
showRejectButton
|
|
37
|
+
} = _ref;
|
|
38
|
+
return /*#__PURE__*/_jsx__default["default"](blocks.ModalFooter, {
|
|
39
|
+
classProps: {
|
|
40
|
+
additionalFooterCssClass
|
|
43
41
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}))
|
|
42
|
+
"data-testid": "modal-footer-wrapper"
|
|
43
|
+
}, void 0, /*#__PURE__*/jsxRuntime.jsxs(blocks.ModalFooterActions, {
|
|
44
|
+
ref: actionsRef,
|
|
45
|
+
children: [showRejectButton === true && /*#__PURE__*/jsxRuntime.jsx(DSButton__default["default"], _objectSpread({
|
|
46
|
+
buttonType: "secondary",
|
|
47
|
+
className: "action-reject",
|
|
48
|
+
containerProps: {
|
|
49
|
+
'data-testid': 'modal-footer-reject-btn'
|
|
50
|
+
},
|
|
51
|
+
labelText: rejectLabel,
|
|
52
|
+
onClick: onReject
|
|
53
|
+
}, overridePropsRejectButton)), /*#__PURE__*/jsxRuntime.jsx(DSButton__default["default"], _objectSpread({
|
|
54
|
+
buttonType: "primary",
|
|
55
|
+
className: "action-confirm",
|
|
56
|
+
containerProps: {
|
|
57
|
+
'data-testid': 'modal-footer-confirm-btn'
|
|
58
|
+
},
|
|
59
|
+
labelText: confirmLabel,
|
|
60
|
+
onClick: onConfirm
|
|
61
|
+
}, overridePropsConfirmButton))]
|
|
62
|
+
}));
|
|
63
|
+
};
|
|
56
64
|
|
|
57
65
|
exports.Footer = Footer;
|
|
58
66
|
exports["default"] = Footer;
|
|
@@ -4,42 +4,44 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
6
|
require('react');
|
|
7
|
-
var
|
|
8
|
-
var DSButton = require('@elliemae/ds-
|
|
7
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
8
|
+
var DSButton = require('@elliemae/ds-button');
|
|
9
9
|
var blocks = require('../blocks.js');
|
|
10
10
|
var Title = require('./Title.js');
|
|
11
11
|
|
|
12
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
13
|
|
|
14
14
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
15
|
-
var CloseIcon__default = /*#__PURE__*/_interopDefaultLegacy(CloseIcon);
|
|
16
15
|
var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
17
16
|
|
|
18
|
-
var
|
|
19
|
-
const FormHeader =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}))
|
|
17
|
+
var _Close;
|
|
18
|
+
const FormHeader = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
showClose,
|
|
21
|
+
modalTitle,
|
|
22
|
+
modalType,
|
|
23
|
+
onClose
|
|
24
|
+
} = _ref;
|
|
25
|
+
return /*#__PURE__*/_jsx__default["default"](blocks.ModalHeader, {
|
|
26
|
+
classProps: {
|
|
27
|
+
type: 'selection'
|
|
28
|
+
}
|
|
29
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](Title.Title, {
|
|
30
|
+
modalTitle: modalTitle,
|
|
31
|
+
modalType: modalType
|
|
32
|
+
}), /*#__PURE__*/_jsx__default["default"](blocks.ModalHeaderTopRight, {
|
|
33
|
+
classProps: {
|
|
34
|
+
type: 'form'
|
|
35
|
+
}
|
|
36
|
+
}, void 0, showClose && /*#__PURE__*/_jsx__default["default"](DSButton__default["default"], {
|
|
37
|
+
buttonType: "link",
|
|
38
|
+
containerProps: {
|
|
39
|
+
'data-testid': 'modal-close-btn'
|
|
40
|
+
},
|
|
41
|
+
icon: _Close || (_Close = /*#__PURE__*/_jsx__default["default"](dsIcons.Close, {})),
|
|
42
|
+
onClick: onClose
|
|
43
|
+
})));
|
|
44
|
+
};
|
|
43
45
|
|
|
44
46
|
exports.FormHeader = FormHeader;
|
|
45
47
|
exports["default"] = FormHeader;
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
5
10
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
11
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
7
12
|
require('react');
|
|
@@ -24,81 +29,84 @@ var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
|
24
29
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
25
30
|
|
|
26
31
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
27
|
-
const DSModalContent =
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
32
|
+
const DSModalContent = _ref => {
|
|
33
|
+
let {
|
|
34
|
+
containerProps = {},
|
|
35
|
+
//
|
|
36
|
+
modalType = constants.MODAL_TYPE_V2.INFORMATION,
|
|
37
|
+
modalSubType = null,
|
|
38
|
+
modalTitle = '',
|
|
39
|
+
showRejectButton = false,
|
|
40
|
+
showClose = true,
|
|
41
|
+
searchProps = {},
|
|
42
|
+
// override
|
|
43
|
+
actionsRef = () => null,
|
|
44
|
+
additionalFooterCssClass,
|
|
45
|
+
overridePropsConfirmButton = {},
|
|
46
|
+
overridePropsRejectButton = {},
|
|
47
|
+
// react modal
|
|
48
|
+
children,
|
|
49
|
+
onClose = () => null,
|
|
50
|
+
onConfirm = () => null,
|
|
51
|
+
onReject = () => null,
|
|
52
|
+
rejectLabel = 'Discard',
|
|
53
|
+
confirmLabel = 'Save',
|
|
54
|
+
removePadding = false
|
|
55
|
+
} = _ref;
|
|
56
|
+
return /*#__PURE__*/jsxRuntime.jsxs(blocks.ModalWrapper, _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
57
|
+
children: [helpers.showForm({
|
|
58
|
+
modalType,
|
|
59
|
+
modalSubType
|
|
60
|
+
}) && /*#__PURE__*/_jsx__default["default"](FormHeader.FormHeader, {
|
|
61
|
+
modalTitle: modalTitle,
|
|
62
|
+
modalType: modalType,
|
|
63
|
+
onClose: onClose,
|
|
64
|
+
showClose: showClose
|
|
65
|
+
}), helpers.showSelection({
|
|
66
|
+
modalType,
|
|
67
|
+
modalSubType
|
|
68
|
+
}) && /*#__PURE__*/_jsx__default["default"](SelectionHeader.SelectionHeader, {
|
|
69
|
+
modalTitle: modalTitle,
|
|
70
|
+
modalType: modalType,
|
|
71
|
+
searchProps: searchProps,
|
|
72
|
+
showClose: showClose
|
|
73
|
+
}), helpers.showDecision({
|
|
74
|
+
modalType,
|
|
75
|
+
modalSubType
|
|
76
|
+
}) && /*#__PURE__*/_jsx__default["default"](DecisionHeader.DecisionHeader, {
|
|
77
|
+
onClose: onClose,
|
|
78
|
+
showClose: showClose
|
|
79
|
+
}), helpers.showFeedBack({
|
|
80
|
+
modalType,
|
|
81
|
+
modalSubType
|
|
82
|
+
}) && /*#__PURE__*/_jsx__default["default"](FeedbackIcon.FeedbackIcon, {
|
|
83
|
+
modalSubType: modalSubType
|
|
84
|
+
}), helpers.showDecision({
|
|
85
|
+
modalType,
|
|
86
|
+
modalSubType
|
|
87
|
+
}) && /*#__PURE__*/_jsx__default["default"](Title.Title, {
|
|
88
|
+
modalTitle: modalTitle,
|
|
89
|
+
modalType: modalType
|
|
90
|
+
}), /*#__PURE__*/_jsx__default["default"](blocks.ModalContent, {
|
|
91
|
+
classProps: {
|
|
92
|
+
type: modalType,
|
|
93
|
+
removePadding
|
|
94
|
+
}
|
|
95
|
+
}, void 0, children), helpers.showFooter({
|
|
96
|
+
modalType,
|
|
97
|
+
modalSubType
|
|
98
|
+
}) && /*#__PURE__*/_jsx__default["default"](Footer.Footer, {
|
|
99
|
+
actionsRef: actionsRef,
|
|
100
|
+
additionalFooterCssClass: additionalFooterCssClass,
|
|
101
|
+
confirmLabel: confirmLabel,
|
|
102
|
+
onConfirm: onConfirm,
|
|
103
|
+
onReject: onReject,
|
|
104
|
+
overridePropsConfirmButton: overridePropsConfirmButton,
|
|
105
|
+
overridePropsRejectButton: overridePropsRejectButton,
|
|
106
|
+
rejectLabel: rejectLabel,
|
|
107
|
+
showRejectButton: showRejectButton
|
|
108
|
+
})]
|
|
109
|
+
}));
|
|
110
|
+
};
|
|
103
111
|
|
|
104
112
|
exports.DSModalContent = DSModalContent;
|
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
5
10
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
11
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
7
12
|
require('react');
|
|
8
|
-
var
|
|
13
|
+
var dsForm = require('@elliemae/ds-form');
|
|
9
14
|
var blocks = require('../blocks.js');
|
|
10
15
|
var Title = require('./Title.js');
|
|
11
16
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -14,29 +19,31 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
14
19
|
|
|
15
20
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
16
21
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
17
|
-
var DSSearchBox__default = /*#__PURE__*/_interopDefaultLegacy(DSSearchBox);
|
|
18
22
|
|
|
19
23
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
20
24
|
|
|
21
25
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
22
|
-
const SelectionHeader =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
},
|
|
26
|
+
const SelectionHeader = _ref => {
|
|
27
|
+
let {
|
|
28
|
+
searchProps = {},
|
|
29
|
+
modalTitle,
|
|
30
|
+
modalType,
|
|
31
|
+
showClose
|
|
32
|
+
} = _ref;
|
|
33
|
+
return /*#__PURE__*/_jsx__default["default"](blocks.ModalHeader, {
|
|
34
|
+
classProps: {
|
|
35
|
+
type: 'selection'
|
|
36
|
+
}
|
|
37
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](Title.Title, {
|
|
38
|
+
modalTitle: modalTitle,
|
|
39
|
+
modalType: modalType
|
|
40
|
+
}), showClose && /*#__PURE__*/_jsx__default["default"](blocks.ModalHeaderTopRight, {
|
|
41
|
+
classProps: {
|
|
42
|
+
type: 'selection'
|
|
43
|
+
},
|
|
44
|
+
"data-testid": "modal-search-box"
|
|
45
|
+
}, void 0, /*#__PURE__*/jsxRuntime.jsx(dsForm.DSSearchBox, _objectSpread({}, searchProps))));
|
|
46
|
+
};
|
|
40
47
|
|
|
41
48
|
exports.SelectionHeader = SelectionHeader;
|
|
42
49
|
exports["default"] = SelectionHeader;
|
|
@@ -10,14 +10,17 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
|
|
11
11
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
12
12
|
|
|
13
|
-
const Title =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
const Title = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
modalTitle,
|
|
16
|
+
modalType
|
|
17
|
+
} = _ref;
|
|
18
|
+
return /*#__PURE__*/_jsx__default["default"](blocks.ModalTitle, {
|
|
19
|
+
classProps: {
|
|
20
|
+
type: modalType
|
|
21
|
+
}
|
|
22
|
+
}, void 0, modalTitle);
|
|
23
|
+
};
|
|
21
24
|
|
|
22
25
|
exports.Title = Title;
|
|
23
26
|
exports["default"] = Title;
|
package/cjs/v2/helpers.js
CHANGED
|
@@ -4,32 +4,37 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var constants = require('../constants.js');
|
|
6
6
|
|
|
7
|
-
function showDecision({
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
function showDecision(_ref) {
|
|
8
|
+
let {
|
|
9
|
+
modalType
|
|
10
|
+
} = _ref;
|
|
10
11
|
return [constants.MODAL_TYPE_V2.INFORMATION, constants.MODAL_TYPE_V2.DECISION].indexOf(modalType) > -1;
|
|
11
12
|
}
|
|
12
|
-
function showFeedBack({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
function showFeedBack(_ref2) {
|
|
14
|
+
let {
|
|
15
|
+
modalType,
|
|
16
|
+
modalSubType
|
|
17
|
+
} = _ref2;
|
|
16
18
|
return showDecision({
|
|
17
19
|
modalType
|
|
18
20
|
}) && Object.values(constants.MODAL_SUB_TYPE_V2).indexOf(modalSubType) > -1;
|
|
19
21
|
}
|
|
20
|
-
function showFooter({
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
function showFooter(_ref3) {
|
|
23
|
+
let {
|
|
24
|
+
modalType
|
|
25
|
+
} = _ref3;
|
|
23
26
|
return modalType !== constants.MODAL_TYPE_V2.INFORMATION;
|
|
24
27
|
}
|
|
25
|
-
function showSelection({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
function showSelection(_ref4) {
|
|
29
|
+
let {
|
|
30
|
+
modalType
|
|
31
|
+
} = _ref4;
|
|
28
32
|
return modalType === constants.MODAL_TYPE_V2.SELECTION;
|
|
29
33
|
}
|
|
30
|
-
function showForm({
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
function showForm(_ref5) {
|
|
35
|
+
let {
|
|
36
|
+
modalType
|
|
37
|
+
} = _ref5;
|
|
33
38
|
return modalType === constants.MODAL_TYPE_V2.FORM;
|
|
34
39
|
}
|
|
35
40
|
|
package/esm/DSModal.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
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';
|
|
1
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
7
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
3
8
|
import 'react';
|
package/esm/v1/DSModal.js
CHANGED
|
@@ -1,54 +1,60 @@
|
|
|
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';
|
|
1
6
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
7
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
8
|
import 'react';
|
|
4
9
|
import ReactModal from 'react-modal';
|
|
5
10
|
import { convertPropToCssClassName } from '@elliemae/ds-classnames';
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import DSButton from '@elliemae/ds-
|
|
11
|
+
import { DSIconSizes } from '@elliemae/ds-icon';
|
|
12
|
+
import { Close } from '@elliemae/ds-icons';
|
|
13
|
+
import DSButton from '@elliemae/ds-button';
|
|
9
14
|
import { MODAL_TYPE } from '../constants.js';
|
|
10
15
|
import ModalFeedBack from './ModalFeedBack/ModalFeedBack.js';
|
|
11
16
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
12
17
|
|
|
13
|
-
var
|
|
18
|
+
var _Close;
|
|
14
19
|
|
|
15
20
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
16
21
|
|
|
17
22
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
18
23
|
|
|
19
|
-
const DSModal =
|
|
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
|
-
|
|
24
|
+
const DSModal = _ref => {
|
|
25
|
+
let {
|
|
26
|
+
containerProps = {},
|
|
27
|
+
className = '',
|
|
28
|
+
dataTestId = 'ds-modal',
|
|
29
|
+
additionalFooterCssClass = '',
|
|
30
|
+
style = {},
|
|
31
|
+
iconCloseSize = DSIconSizes.S,
|
|
32
|
+
modalType = MODAL_TYPE.DEFAULT,
|
|
33
|
+
showHeader = true,
|
|
34
|
+
showFooter = true,
|
|
35
|
+
children,
|
|
36
|
+
centered = true,
|
|
37
|
+
confirmLabel = 'Accept',
|
|
38
|
+
modalTitle = '',
|
|
39
|
+
size = 'medium',
|
|
40
|
+
isOpen = false,
|
|
41
|
+
onClose = () => null,
|
|
42
|
+
onAfterOpen = () => null,
|
|
43
|
+
onConfirm = () => null,
|
|
44
|
+
onReject = () => null,
|
|
45
|
+
rejectLabel = 'Cancel',
|
|
46
|
+
shouldCloseOnOverlayClick = false,
|
|
47
|
+
hasError = false,
|
|
48
|
+
hasWarning = false,
|
|
49
|
+
hasSuccess = false,
|
|
50
|
+
hasInfo = false,
|
|
51
|
+
hasHelp = false,
|
|
52
|
+
actionsRef = () => null,
|
|
53
|
+
appElement = '#root',
|
|
54
|
+
overridePropsConfirmButton = {},
|
|
55
|
+
overridePropsRejectButton = {},
|
|
56
|
+
zIndex = 10
|
|
57
|
+
} = _ref;
|
|
52
58
|
// http://reactcommunity.org/react-modal/accessibility/ https://github.com/reactjs/react-modal#examples
|
|
53
59
|
typeof document !== 'undefined' && document && ReactModal.setAppElement && ReactModal.setAppElement(appElement); // eslint-disable-line
|
|
54
60
|
|
|
@@ -98,7 +104,7 @@ const DSModal = ({
|
|
|
98
104
|
className: classNameElement('icon', 'modal-header')
|
|
99
105
|
}, void 0, /*#__PURE__*/_jsx(DSButton, {
|
|
100
106
|
buttonType: "link",
|
|
101
|
-
icon:
|
|
107
|
+
icon: _Close || (_Close = /*#__PURE__*/_jsx(Close, {})),
|
|
102
108
|
onClick: onClose,
|
|
103
109
|
size: iconCloseSize
|
|
104
110
|
}))), /*#__PURE__*/_jsx("div", {
|
package/esm/v1/DSModalWrapper.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
2
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
6
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
7
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
3
8
|
import { Component, createElement } from 'react';
|
|
4
9
|
import { MODAL_TYPE } from '../constants.js';
|
|
5
10
|
|
|
@@ -8,8 +13,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
8
13
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
9
14
|
var DSModalWrapper = (WrappedComponent => {
|
|
10
15
|
class DSModalWrapper extends Component {
|
|
11
|
-
constructor(
|
|
12
|
-
super(...
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
13
18
|
|
|
14
19
|
_defineProperty(this, "state", {
|
|
15
20
|
childready: false,
|
|
@@ -29,9 +34,11 @@ var DSModalWrapper = (WrappedComponent => {
|
|
|
29
34
|
this.heightFooter = e.height || 0;
|
|
30
35
|
});
|
|
31
36
|
|
|
32
|
-
_defineProperty(this, "onResize",
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
_defineProperty(this, "onResize", _ref => {
|
|
38
|
+
let {
|
|
39
|
+
bounds
|
|
40
|
+
} = _ref;
|
|
41
|
+
|
|
35
42
|
if (this.heightFooterFlag && this.heightHeaderFlag) {
|
|
36
43
|
return this.setState({
|
|
37
44
|
height: bounds.height - this.heightFooter - this.heightHeader
|