@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
|
@@ -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 _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
8
|
import 'react';
|
|
@@ -15,81 +20,84 @@ import { jsxs } from 'react/jsx-runtime';
|
|
|
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
|
-
const DSModalContent =
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
+
}));
|
|
101
|
+
};
|
|
94
102
|
|
|
95
103
|
export { DSModalContent };
|
|
@@ -1,7 +1,12 @@
|
|
|
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 _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
8
|
import 'react';
|
|
4
|
-
import DSSearchBox from '@elliemae/ds-
|
|
9
|
+
import { DSSearchBox } from '@elliemae/ds-form';
|
|
5
10
|
import { ModalHeader, ModalHeaderTopRight } from '../blocks.js';
|
|
6
11
|
import { Title } from './Title.js';
|
|
7
12
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -9,23 +14,26 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
9
14
|
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; }
|
|
10
15
|
|
|
11
16
|
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; }
|
|
12
|
-
const SelectionHeader =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
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))));
|
|
37
|
+
};
|
|
30
38
|
|
|
31
39
|
export { SelectionHeader, SelectionHeader as default };
|
|
@@ -2,13 +2,16 @@ import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
|
2
2
|
import 'react';
|
|
3
3
|
import { ModalTitle } from '../blocks.js';
|
|
4
4
|
|
|
5
|
-
const Title =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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);
|
|
15
|
+
};
|
|
13
16
|
|
|
14
17
|
export { Title, Title as default };
|
package/esm/v2/helpers.js
CHANGED
|
@@ -1,31 +1,36 @@
|
|
|
1
1
|
import { MODAL_TYPE_V2, MODAL_SUB_TYPE_V2 } from '../constants.js';
|
|
2
2
|
|
|
3
|
-
function showDecision({
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
function showDecision(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
modalType
|
|
6
|
+
} = _ref;
|
|
6
7
|
return [MODAL_TYPE_V2.INFORMATION, MODAL_TYPE_V2.DECISION].indexOf(modalType) > -1;
|
|
7
8
|
}
|
|
8
|
-
function showFeedBack({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
function showFeedBack(_ref2) {
|
|
10
|
+
let {
|
|
11
|
+
modalType,
|
|
12
|
+
modalSubType
|
|
13
|
+
} = _ref2;
|
|
12
14
|
return showDecision({
|
|
13
15
|
modalType
|
|
14
16
|
}) && Object.values(MODAL_SUB_TYPE_V2).indexOf(modalSubType) > -1;
|
|
15
17
|
}
|
|
16
|
-
function showFooter({
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
function showFooter(_ref3) {
|
|
19
|
+
let {
|
|
20
|
+
modalType
|
|
21
|
+
} = _ref3;
|
|
19
22
|
return modalType !== MODAL_TYPE_V2.INFORMATION;
|
|
20
23
|
}
|
|
21
|
-
function showSelection({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
function showSelection(_ref4) {
|
|
25
|
+
let {
|
|
26
|
+
modalType
|
|
27
|
+
} = _ref4;
|
|
24
28
|
return modalType === MODAL_TYPE_V2.SELECTION;
|
|
25
29
|
}
|
|
26
|
-
function showForm({
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
function showForm(_ref5) {
|
|
31
|
+
let {
|
|
32
|
+
modalType
|
|
33
|
+
} = _ref5;
|
|
29
34
|
return modalType === MODAL_TYPE_V2.FORM;
|
|
30
35
|
}
|
|
31
36
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-modal",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-rc.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Modal",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -96,10 +96,13 @@
|
|
|
96
96
|
"build": "node ../../scripts/build/build.js"
|
|
97
97
|
},
|
|
98
98
|
"dependencies": {
|
|
99
|
-
"@elliemae/ds-basic": "2.0.0-
|
|
100
|
-
"@elliemae/ds-classnames": "2.0.0-
|
|
99
|
+
"@elliemae/ds-basic": "2.0.0-rc.2",
|
|
100
|
+
"@elliemae/ds-classnames": "2.0.0-rc.2",
|
|
101
|
+
"@elliemae/ds-icons": "2.0.0-rc.2",
|
|
102
|
+
"@elliemae/ds-modal": "2.0.0-rc.2",
|
|
103
|
+
"@elliemae/ds-system": "2.0.0-rc.2",
|
|
101
104
|
"prop-types": "~15.7.2",
|
|
102
|
-
"react-
|
|
105
|
+
"react-desc": "~4.1.3",
|
|
103
106
|
"react-modal": "~3.12.1"
|
|
104
107
|
},
|
|
105
108
|
"peerDependencies": {
|
package/types/v1/DSModal.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ declare const DSModal: {
|
|
|
7
7
|
dataTestId?: string | undefined;
|
|
8
8
|
additionalFooterCssClass?: string | undefined;
|
|
9
9
|
style?: {} | undefined;
|
|
10
|
-
iconCloseSize?:
|
|
10
|
+
iconCloseSize?: string | undefined;
|
|
11
11
|
modalType?: string | undefined;
|
|
12
12
|
showHeader?: boolean | undefined;
|
|
13
13
|
showFooter?: boolean | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const SelectionHeader: ({ searchProps, modalTitle, modalType, showClose
|
|
2
|
+
export declare const SelectionHeader: ({ searchProps, modalTitle, modalType, showClose }: {
|
|
3
3
|
searchProps?: {} | undefined;
|
|
4
4
|
modalTitle: any;
|
|
5
5
|
modalType: any;
|