@elliemae/ds-modal 3.0.0-next.2 → 3.0.0-next.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSModal.js +111 -0
- package/dist/cjs/DSModal.js.map +7 -0
- package/dist/cjs/constants.js +73 -0
- package/dist/cjs/constants.js.map +7 -0
- package/dist/cjs/index.js +43 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/v1/DSModal.js +185 -0
- package/dist/cjs/v1/DSModal.js.map +7 -0
- package/dist/cjs/v1/DSModalType.js +45 -0
- package/dist/cjs/v1/DSModalType.js.map +7 -0
- package/dist/cjs/v1/DSModalWrapper.js +145 -0
- package/dist/cjs/v1/DSModalWrapper.js.map +7 -0
- package/dist/cjs/v1/ModalFeedBack/ModalFeedBack.js +103 -0
- package/dist/cjs/v1/ModalFeedBack/ModalFeedBack.js.map +7 -0
- package/dist/cjs/v2/DSModal.js +172 -0
- package/dist/cjs/v2/DSModal.js.map +7 -0
- package/dist/cjs/v2/blocks.js +71 -0
- package/dist/cjs/v2/blocks.js.map +7 -0
- package/dist/cjs/v2/components/DecisionHeader.js +48 -0
- package/dist/cjs/v2/components/DecisionHeader.js.map +7 -0
- package/dist/cjs/v2/components/FeedbackIcon.js +73 -0
- package/dist/cjs/v2/components/FeedbackIcon.js.map +7 -0
- package/dist/cjs/v2/components/Footer.js +81 -0
- package/dist/cjs/v2/components/Footer.js.map +7 -0
- package/dist/cjs/v2/components/FormHeader.js +54 -0
- package/dist/cjs/v2/components/FormHeader.js.map +7 -0
- package/dist/cjs/v2/components/ModalContent.js +108 -0
- package/dist/cjs/v2/components/ModalContent.js.map +7 -0
- package/dist/cjs/v2/components/SelectionHeader.js +63 -0
- package/dist/cjs/v2/components/SelectionHeader.js.map +7 -0
- package/dist/cjs/v2/components/Title.js +41 -0
- package/dist/cjs/v2/components/Title.js.map +7 -0
- package/dist/cjs/v2/helpers.js +54 -0
- package/dist/cjs/v2/helpers.js.map +7 -0
- package/dist/esm/DSModal.js +84 -0
- package/dist/esm/DSModal.js.map +7 -0
- package/dist/esm/constants.js +44 -0
- package/dist/esm/constants.js.map +7 -0
- package/dist/esm/index.js +14 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/v1/DSModal.js +158 -0
- package/dist/esm/v1/DSModal.js.map +7 -0
- package/dist/esm/v1/DSModalType.js +16 -0
- package/dist/esm/v1/DSModalType.js.map +7 -0
- package/dist/esm/v1/DSModalWrapper.js +118 -0
- package/dist/esm/v1/DSModalWrapper.js.map +7 -0
- package/dist/esm/v1/ModalFeedBack/ModalFeedBack.js +74 -0
- package/dist/esm/v1/ModalFeedBack/ModalFeedBack.js.map +7 -0
- package/dist/esm/v2/DSModal.js +145 -0
- package/dist/esm/v2/DSModal.js.map +7 -0
- package/dist/esm/v2/blocks.js +42 -0
- package/dist/esm/v2/blocks.js.map +7 -0
- package/dist/esm/v2/components/DecisionHeader.js +19 -0
- package/dist/esm/v2/components/DecisionHeader.js.map +7 -0
- package/dist/esm/v2/components/FeedbackIcon.js +44 -0
- package/dist/esm/v2/components/FeedbackIcon.js.map +7 -0
- package/dist/esm/v2/components/Footer.js +54 -0
- package/dist/esm/v2/components/Footer.js.map +7 -0
- package/dist/esm/v2/components/FormHeader.js +25 -0
- package/dist/esm/v2/components/FormHeader.js.map +7 -0
- package/dist/esm/v2/components/ModalContent.js +87 -0
- package/dist/esm/v2/components/ModalContent.js.map +7 -0
- package/dist/esm/v2/components/SelectionHeader.js +36 -0
- package/dist/esm/v2/components/SelectionHeader.js.map +7 -0
- package/dist/esm/v2/components/Title.js +12 -0
- package/dist/esm/v2/components/Title.js.map +7 -0
- package/dist/esm/v2/helpers.js +25 -0
- package/dist/esm/v2/helpers.js.map +7 -0
- package/package.json +64 -55
- package/cjs/DSModal.js +0 -186
- package/cjs/constants.js +0 -34
- package/cjs/index.js +0 -18
- package/cjs/v1/DSModal.js +0 -148
- package/cjs/v1/DSModalType.js +0 -7
- package/cjs/v1/DSModalWrapper.js +0 -166
- package/cjs/v1/ModalFeedBack/ModalFeedBack.js +0 -98
- package/cjs/v2/DSModal.js +0 -203
- package/cjs/v2/blocks.js +0 -88
- package/cjs/v2/components/DecisionHeader.js +0 -38
- package/cjs/v2/components/FeedbackIcon.js +0 -64
- package/cjs/v2/components/Footer.js +0 -66
- package/cjs/v2/components/FormHeader.js +0 -47
- package/cjs/v2/components/ModalContent.js +0 -112
- package/cjs/v2/components/SelectionHeader.js +0 -49
- package/cjs/v2/components/Title.js +0 -26
- package/cjs/v2/helpers.js +0 -45
- package/esm/DSModal.js +0 -175
- package/esm/constants.js +0 -26
- package/esm/index.js +0 -4
- package/esm/v1/DSModal.js +0 -139
- package/esm/v1/DSModalType.js +0 -3
- package/esm/v1/DSModalWrapper.js +0 -160
- package/esm/v1/ModalFeedBack/ModalFeedBack.js +0 -92
- package/esm/v2/DSModal.js +0 -192
- package/esm/v2/blocks.js +0 -77
- package/esm/v2/components/DecisionHeader.js +0 -28
- package/esm/v2/components/FeedbackIcon.js +0 -55
- package/esm/v2/components/Footer.js +0 -55
- package/esm/v2/components/FormHeader.js +0 -37
- package/esm/v2/components/ModalContent.js +0 -103
- package/esm/v2/components/SelectionHeader.js +0 -39
- package/esm/v2/components/Title.js +0 -17
- package/esm/v2/helpers.js +0 -37
- package/types/DSModal.d.ts +0 -14
- package/types/constants.d.ts +0 -25
- package/types/index.d.ts +0 -4
- package/types/v1/DSModal.d.ts +0 -143
- package/types/v1/DSModalType.d.ts +0 -1
- package/types/v1/ModalFeedBack/ModalFeedBack.d.ts +0 -11
- package/types/v2/DSModal.d.ts +0 -260
- package/types/v2/blocks.d.ts +0 -9
- package/types/v2/components/DecisionHeader.d.ts +0 -6
- package/types/v2/components/FeedbackIcon.d.ts +0 -5
- package/types/v2/components/Footer.d.ts +0 -13
- package/types/v2/components/FormHeader.d.ts +0 -8
- package/types/v2/components/ModalContent.d.ts +0 -21
- package/types/v2/components/SelectionHeader.d.ts +0 -8
- package/types/v2/components/Title.d.ts +0 -6
- package/types/v2/components/tests/DecisionHeader.test.d.ts +0 -1
- package/types/v2/components/tests/FeedbackIcon.test.d.ts +0 -1
- package/types/v2/components/tests/Footer.test.d.ts +0 -1
- package/types/v2/components/tests/FormHeader.test.d.ts +0 -1
- package/types/v2/components/tests/SelectionHeader.test.d.ts +0 -1
- package/types/v2/helpers.d.ts +0 -16
- package/types/v2/tests/DSModal.test.d.ts +0 -1
|
@@ -1,55 +0,0 @@
|
|
|
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 => {
|
|
11
|
-
switch (subtype) {
|
|
12
|
-
case MODAL_SUB_TYPE_V2.WARNING:
|
|
13
|
-
return _WarningTriangle || (_WarningTriangle = /*#__PURE__*/_jsx(WarningTriangle, {
|
|
14
|
-
"data-testid": "icon-waring",
|
|
15
|
-
size: feedbackIconSize
|
|
16
|
-
}));
|
|
17
|
-
|
|
18
|
-
case MODAL_SUB_TYPE_V2.ERROR:
|
|
19
|
-
return _ErrorHexegon || (_ErrorHexegon = /*#__PURE__*/_jsx(ErrorHexegon, {
|
|
20
|
-
"data-testid": "icon-error",
|
|
21
|
-
size: feedbackIconSize
|
|
22
|
-
}));
|
|
23
|
-
|
|
24
|
-
case MODAL_SUB_TYPE_V2.SUCCESS:
|
|
25
|
-
return _CheckmarkCircle || (_CheckmarkCircle = /*#__PURE__*/_jsx(CheckmarkCircle, {
|
|
26
|
-
"data-testid": "icon-success",
|
|
27
|
-
size: feedbackIconSize
|
|
28
|
-
}));
|
|
29
|
-
|
|
30
|
-
case MODAL_SUB_TYPE_V2.INFORMATION:
|
|
31
|
-
return _InfoCircle || (_InfoCircle = /*#__PURE__*/_jsx(InfoCircle, {
|
|
32
|
-
"data-testid": "icon-information",
|
|
33
|
-
size: feedbackIconSize
|
|
34
|
-
}));
|
|
35
|
-
|
|
36
|
-
default:
|
|
37
|
-
return _HelpCircle || (_HelpCircle = /*#__PURE__*/_jsx(HelpCircle, {
|
|
38
|
-
"data-testid": "icon-help",
|
|
39
|
-
size: feedbackIconSize
|
|
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));
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export { FeedbackIcon, FeedbackIcon as default };
|
|
@@ -1,55 +0,0 @@
|
|
|
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
|
-
}));
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export { Footer, Footer as default };
|
|
@@ -1,37 +0,0 @@
|
|
|
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
|
-
})));
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export { FormHeader, FormHeader as default };
|
|
@@ -1,103 +0,0 @@
|
|
|
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
|
-
}));
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export { DSModalContent };
|
|
@@ -1,39 +0,0 @@
|
|
|
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))));
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export { SelectionHeader, SelectionHeader as default };
|
|
@@ -1,17 +0,0 @@
|
|
|
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);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export { Title, Title as default };
|
package/esm/v2/helpers.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { MODAL_TYPE_V2, MODAL_SUB_TYPE_V2 } from '../constants.js';
|
|
2
|
-
|
|
3
|
-
function showDecision(_ref) {
|
|
4
|
-
let {
|
|
5
|
-
modalType
|
|
6
|
-
} = _ref;
|
|
7
|
-
return [MODAL_TYPE_V2.INFORMATION, MODAL_TYPE_V2.DECISION].indexOf(modalType) > -1;
|
|
8
|
-
}
|
|
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;
|
|
17
|
-
}
|
|
18
|
-
function showFooter(_ref3) {
|
|
19
|
-
let {
|
|
20
|
-
modalType
|
|
21
|
-
} = _ref3;
|
|
22
|
-
return modalType !== MODAL_TYPE_V2.INFORMATION;
|
|
23
|
-
}
|
|
24
|
-
function showSelection(_ref4) {
|
|
25
|
-
let {
|
|
26
|
-
modalType
|
|
27
|
-
} = _ref4;
|
|
28
|
-
return modalType === MODAL_TYPE_V2.SELECTION;
|
|
29
|
-
}
|
|
30
|
-
function showForm(_ref5) {
|
|
31
|
-
let {
|
|
32
|
-
modalType
|
|
33
|
-
} = _ref5;
|
|
34
|
-
return modalType === MODAL_TYPE_V2.FORM;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export { showDecision, showFeedBack, showFooter, showForm, showSelection };
|
package/types/DSModal.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { DSModalContent } from './v2/DSModal';
|
|
4
|
-
declare const DSModal: {
|
|
5
|
-
({ version, ...rest }: {
|
|
6
|
-
[x: string]: any;
|
|
7
|
-
version?: number | undefined;
|
|
8
|
-
}): JSX.Element;
|
|
9
|
-
propTypes: {
|
|
10
|
-
version: PropTypes.Requireable<number>;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export { DSModalContent };
|
|
14
|
-
export default DSModal;
|
package/types/constants.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare const MODAL_TYPE: {
|
|
2
|
-
DEFAULT: string;
|
|
3
|
-
ALERT: string;
|
|
4
|
-
CONFIRM: string;
|
|
5
|
-
NOTIFICATION: string;
|
|
6
|
-
WARNING: string;
|
|
7
|
-
ERROR: string;
|
|
8
|
-
SUCCESS: string;
|
|
9
|
-
HELP: string;
|
|
10
|
-
INFO: string;
|
|
11
|
-
};
|
|
12
|
-
export declare const modalTypes: string[];
|
|
13
|
-
export declare const MODAL_TYPE_V2: {
|
|
14
|
-
INFORMATION: string;
|
|
15
|
-
DECISION: string;
|
|
16
|
-
SELECTION: string;
|
|
17
|
-
FORM: string;
|
|
18
|
-
};
|
|
19
|
-
export declare const MODAL_SUB_TYPE_V2: {
|
|
20
|
-
SUCCESS: string;
|
|
21
|
-
WARNING: string;
|
|
22
|
-
ERROR: string;
|
|
23
|
-
INFORMATION: string;
|
|
24
|
-
};
|
|
25
|
-
export default MODAL_TYPE;
|
package/types/index.d.ts
DELETED
package/types/v1/DSModal.d.ts
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
declare const DSModal: {
|
|
4
|
-
({ containerProps, className, dataTestId, additionalFooterCssClass, style, iconCloseSize, modalType, showHeader, showFooter, children, centered, confirmLabel, modalTitle, size, isOpen, onClose, onAfterOpen, onConfirm, onReject, rejectLabel, shouldCloseOnOverlayClick, hasError, hasWarning, hasSuccess, hasInfo, hasHelp, actionsRef, appElement, overridePropsConfirmButton, overridePropsRejectButton, zIndex, }: {
|
|
5
|
-
containerProps?: {} | undefined;
|
|
6
|
-
className?: string | undefined;
|
|
7
|
-
dataTestId?: string | undefined;
|
|
8
|
-
additionalFooterCssClass?: string | undefined;
|
|
9
|
-
style?: {} | undefined;
|
|
10
|
-
iconCloseSize?: string | undefined;
|
|
11
|
-
modalType?: string | undefined;
|
|
12
|
-
showHeader?: boolean | undefined;
|
|
13
|
-
showFooter?: boolean | undefined;
|
|
14
|
-
children: any;
|
|
15
|
-
centered?: boolean | undefined;
|
|
16
|
-
confirmLabel?: string | undefined;
|
|
17
|
-
modalTitle?: string | undefined;
|
|
18
|
-
size?: string | undefined;
|
|
19
|
-
isOpen?: boolean | undefined;
|
|
20
|
-
onClose?: (() => null) | undefined;
|
|
21
|
-
onAfterOpen?: (() => null) | undefined;
|
|
22
|
-
onConfirm?: (() => null) | undefined;
|
|
23
|
-
onReject?: (() => null) | undefined;
|
|
24
|
-
rejectLabel?: string | undefined;
|
|
25
|
-
shouldCloseOnOverlayClick?: boolean | undefined;
|
|
26
|
-
hasError?: boolean | undefined;
|
|
27
|
-
hasWarning?: boolean | undefined;
|
|
28
|
-
hasSuccess?: boolean | undefined;
|
|
29
|
-
hasInfo?: boolean | undefined;
|
|
30
|
-
hasHelp?: boolean | undefined;
|
|
31
|
-
actionsRef?: (() => null) | undefined;
|
|
32
|
-
appElement?: string | undefined;
|
|
33
|
-
overridePropsConfirmButton?: {} | undefined;
|
|
34
|
-
overridePropsRejectButton?: {} | undefined;
|
|
35
|
-
zIndex?: number | undefined;
|
|
36
|
-
}): JSX.Element;
|
|
37
|
-
propTypes: {
|
|
38
|
-
className: PropTypes.Requireable<string>;
|
|
39
|
-
/**
|
|
40
|
-
* Add an additional css class to the footer
|
|
41
|
-
*/
|
|
42
|
-
additionalFooterCssClass: PropTypes.Requireable<string>;
|
|
43
|
-
/**
|
|
44
|
-
* Set style for the modal
|
|
45
|
-
*/
|
|
46
|
-
style: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
47
|
-
/**
|
|
48
|
-
* Select size for the close icon
|
|
49
|
-
*/
|
|
50
|
-
iconCloseSize: PropTypes.Requireable<unknown>;
|
|
51
|
-
/**
|
|
52
|
-
* ['default', 'alert', 'confirm', 'notification', 'warning', 'error', 'success', 'help', 'info']
|
|
53
|
-
*/
|
|
54
|
-
modalType: PropTypes.Requireable<string>;
|
|
55
|
-
/**
|
|
56
|
-
* Show the header or not
|
|
57
|
-
*/
|
|
58
|
-
showHeader: PropTypes.Requireable<boolean>;
|
|
59
|
-
/**
|
|
60
|
-
* Show the footer or not
|
|
61
|
-
*/
|
|
62
|
-
showFooter: PropTypes.Requireable<boolean>;
|
|
63
|
-
/**
|
|
64
|
-
* Main content of the modal
|
|
65
|
-
*/
|
|
66
|
-
children: PropTypes.Validator<any>;
|
|
67
|
-
/**
|
|
68
|
-
* Content is centered or not
|
|
69
|
-
*/
|
|
70
|
-
centered: PropTypes.Requireable<boolean>;
|
|
71
|
-
/**
|
|
72
|
-
* Text to be added in the confirm button
|
|
73
|
-
*/
|
|
74
|
-
confirmLabel: PropTypes.Requireable<string>;
|
|
75
|
-
/**
|
|
76
|
-
* Text to be added in the modal title
|
|
77
|
-
*/
|
|
78
|
-
modalTitle: PropTypes.Requireable<string>;
|
|
79
|
-
/**
|
|
80
|
-
* Text to be added in the modal title
|
|
81
|
-
*/
|
|
82
|
-
size: PropTypes.Requireable<unknown>;
|
|
83
|
-
/**
|
|
84
|
-
* Modal is open or not
|
|
85
|
-
*/
|
|
86
|
-
isOpen: PropTypes.Requireable<boolean>;
|
|
87
|
-
/**
|
|
88
|
-
* Allows a function to be triggered once the modal is closed
|
|
89
|
-
*/
|
|
90
|
-
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
91
|
-
/**
|
|
92
|
-
* Allows a function to be triggered once the modal is opened
|
|
93
|
-
*/
|
|
94
|
-
onAfterOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
95
|
-
/**
|
|
96
|
-
* Allows a function to be triggered once the modal open is confirmed
|
|
97
|
-
*/
|
|
98
|
-
onConfirm: PropTypes.Requireable<(...args: any[]) => any>;
|
|
99
|
-
/**
|
|
100
|
-
* Allows a function to be triggered once the modal open is rejected
|
|
101
|
-
*/
|
|
102
|
-
onReject: PropTypes.Requireable<(...args: any[]) => any>;
|
|
103
|
-
/**
|
|
104
|
-
* Text to be added in the reject button
|
|
105
|
-
*/
|
|
106
|
-
rejectLabel: PropTypes.Requireable<string>;
|
|
107
|
-
/**
|
|
108
|
-
* If modal should close on overlay click
|
|
109
|
-
*/
|
|
110
|
-
shouldCloseOnOverlayClick: PropTypes.Requireable<boolean>;
|
|
111
|
-
/**
|
|
112
|
-
* Modal has error or not
|
|
113
|
-
*/
|
|
114
|
-
hasError: PropTypes.Requireable<boolean>;
|
|
115
|
-
/**
|
|
116
|
-
* Modal has warning or not
|
|
117
|
-
*/
|
|
118
|
-
hasWarning: PropTypes.Requireable<boolean>;
|
|
119
|
-
/**
|
|
120
|
-
* Modal has success or not
|
|
121
|
-
*/
|
|
122
|
-
hasSuccess: PropTypes.Requireable<boolean>;
|
|
123
|
-
/**
|
|
124
|
-
* Modal has info or not
|
|
125
|
-
*/
|
|
126
|
-
hasInfo: PropTypes.Requireable<boolean>;
|
|
127
|
-
/**
|
|
128
|
-
* Modal has help or not
|
|
129
|
-
*/
|
|
130
|
-
hasHelp: PropTypes.Requireable<boolean>;
|
|
131
|
-
actionsRef: PropTypes.Requireable<(...args: any[]) => any>;
|
|
132
|
-
appElement: PropTypes.Requireable<string>;
|
|
133
|
-
/**
|
|
134
|
-
* Customized props for the confirm button
|
|
135
|
-
*/
|
|
136
|
-
overridePropsConfirmButton: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
137
|
-
/**
|
|
138
|
-
* Customized props for the reject button
|
|
139
|
-
*/
|
|
140
|
-
overridePropsRejectButton: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
141
|
-
};
|
|
142
|
-
};
|
|
143
|
-
export default DSModal;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const modalTypes: any[];
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare const ModalFeedBack: ({ className, modalType, hasError, hasWarning, hasSuccess, hasInfo, hasHelp, }: {
|
|
3
|
-
className?: string | undefined;
|
|
4
|
-
modalType?: null | undefined;
|
|
5
|
-
hasError?: boolean | undefined;
|
|
6
|
-
hasWarning?: boolean | undefined;
|
|
7
|
-
hasSuccess?: boolean | undefined;
|
|
8
|
-
hasInfo?: boolean | undefined;
|
|
9
|
-
hasHelp?: boolean | undefined;
|
|
10
|
-
}) => JSX.Element;
|
|
11
|
-
export default ModalFeedBack;
|