@elliemae/ds-modal-slide 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/DSModalSlide.js +135 -111
- package/cjs/components/Footer.js +97 -77
- package/cjs/components/Header.js +65 -74
- package/cjs/components/blocks.js +52 -63
- package/cjs/index.js +17 -40
- package/esm/DSModalSlide.js +113 -75
- package/esm/components/Footer.js +82 -44
- package/esm/components/Header.js +52 -44
- package/esm/components/blocks.js +41 -36
- package/esm/index.js +3 -11
- package/package.json +7 -7
- package/types/index.d.ts +1 -1
- package/cjs/DSModalSlide.js.map +0 -7
- package/cjs/components/Footer.js.map +0 -7
- package/cjs/components/Header.js.map +0 -7
- package/cjs/components/blocks.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/esm/DSModalSlide.js.map +0 -7
- package/esm/components/Footer.js.map +0 -7
- package/esm/components/Header.js.map +0 -7
- package/esm/components/blocks.js.map +0 -7
- package/esm/index.js.map +0 -7
package/cjs/components/blocks.js
CHANGED
|
@@ -1,65 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dsClassnames = require('@elliemae/ds-classnames');
|
|
6
|
+
|
|
7
|
+
const blockName = 'modal-slide';
|
|
8
|
+
const Wrapper = dsClassnames.aggregatedClasses('div')(blockName, 'wrapper', _ref => {
|
|
9
|
+
let {
|
|
10
|
+
show,
|
|
11
|
+
centered
|
|
12
|
+
} = _ref;
|
|
13
|
+
return {
|
|
14
|
+
showing: show,
|
|
15
|
+
disappearing: !show,
|
|
16
|
+
centered
|
|
26
17
|
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var blocks_exports = {};
|
|
29
|
-
__export(blocks_exports, {
|
|
30
|
-
ActualContent: () => ActualContent,
|
|
31
|
-
BreadcrumTitle: () => BreadcrumTitle,
|
|
32
|
-
Content: () => Content,
|
|
33
|
-
Footer: () => Footer,
|
|
34
|
-
FooterWrapper: () => FooterWrapper,
|
|
35
|
-
Header: () => Header,
|
|
36
|
-
HeaderLeftSide: () => HeaderLeftSide,
|
|
37
|
-
Overlay: () => Overlay,
|
|
38
|
-
Title: () => Title,
|
|
39
|
-
Wrapper: () => Wrapper
|
|
40
18
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
19
|
+
const Overlay = dsClassnames.aggregatedClasses('div')(blockName, 'overlay', _ref2 => {
|
|
20
|
+
let {
|
|
21
|
+
show
|
|
22
|
+
} = _ref2;
|
|
23
|
+
return {
|
|
24
|
+
showing: show,
|
|
25
|
+
disappearing: !show
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
const Content = dsClassnames.aggregatedClasses('div')(blockName, 'content', _ref3 => {
|
|
29
|
+
let {
|
|
30
|
+
show
|
|
31
|
+
} = _ref3;
|
|
32
|
+
return {
|
|
33
|
+
showing: show,
|
|
34
|
+
disappearing: !show
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
const Title = dsClassnames.aggregatedClasses('div')(blockName, 'title', () => ({}));
|
|
38
|
+
const BreadcrumTitle = dsClassnames.aggregatedClasses('div')(blockName, 'breadcrum-title', () => ({}));
|
|
39
|
+
const HeaderLeftSide = dsClassnames.aggregatedClasses('div')(blockName, 'header-left-side', () => ({}));
|
|
40
|
+
const ActualContent = dsClassnames.aggregatedClasses('div')(blockName, 'actual-content', () => ({}));
|
|
41
|
+
const Header = dsClassnames.aggregatedClasses('div')(blockName, 'header', () => ({}));
|
|
42
|
+
const Footer = dsClassnames.aggregatedClasses('div')(blockName, 'footer', () => ({}));
|
|
43
|
+
const FooterWrapper = dsClassnames.aggregatedClasses('div')(blockName, 'footer-wrapper', () => ({}));
|
|
44
|
+
|
|
45
|
+
exports.ActualContent = ActualContent;
|
|
46
|
+
exports.BreadcrumTitle = BreadcrumTitle;
|
|
47
|
+
exports.Content = Content;
|
|
48
|
+
exports.Footer = Footer;
|
|
49
|
+
exports.FooterWrapper = FooterWrapper;
|
|
50
|
+
exports.Header = Header;
|
|
51
|
+
exports.HeaderLeftSide = HeaderLeftSide;
|
|
52
|
+
exports.Overlay = Overlay;
|
|
53
|
+
exports.Title = Title;
|
|
54
|
+
exports.Wrapper = Wrapper;
|
package/cjs/index.js
CHANGED
|
@@ -1,40 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var src_exports = {};
|
|
29
|
-
__export(src_exports, {
|
|
30
|
-
DSModalSlideFooterWithSchema: () => import_Footer.DSModalSlideFooterWithSchema,
|
|
31
|
-
DSModalSlideHeaderWithSchema: () => import_Header.DSModalSlideHeaderWithSchema,
|
|
32
|
-
default: () => import_DSModalSlide.default
|
|
33
|
-
});
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
__reExport(src_exports, require("./DSModalSlide"));
|
|
36
|
-
var import_DSModalSlide = require("./DSModalSlide");
|
|
37
|
-
var import_Header = require("./components/Header");
|
|
38
|
-
var import_Footer = require("./components/Footer");
|
|
39
|
-
module.exports = __toCommonJS(src_exports);
|
|
40
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var DSModalSlide = require('./DSModalSlide.js');
|
|
6
|
+
var Header = require('./components/Header.js');
|
|
7
|
+
var Footer = require('./components/Footer.js');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.DSModalSlide = DSModalSlide.DSModalSlide;
|
|
12
|
+
exports.DSModalSlideWithSchema = DSModalSlide.DSModalSlideWithSchema;
|
|
13
|
+
exports["default"] = DSModalSlide.DSModalSlide;
|
|
14
|
+
exports.DSModalSlideHeaderWithSchema = Header.DSModalSlideHeaderWithSchema;
|
|
15
|
+
exports.ModalHeader = Header["default"];
|
|
16
|
+
exports.DSModalSlideFooterWithSchema = Footer.DSModalSlideFooterWithSchema;
|
|
17
|
+
exports.ModalFooter = Footer["default"];
|
package/esm/DSModalSlide.js
CHANGED
|
@@ -1,123 +1,161 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
+
import React, { useState, useCallback, useEffect } from 'react';
|
|
4
|
+
import { PropTypes, describe } from 'react-desc';
|
|
5
|
+
import ReactDOM from 'react-dom';
|
|
6
|
+
import { useTheme } from '@elliemae/ds-system';
|
|
7
|
+
import { Grid } from '@elliemae/ds-grid';
|
|
8
|
+
import DSSeparator from '@elliemae/ds-separator';
|
|
9
|
+
import { Wrapper, Overlay, Content, ActualContent } from './components/blocks.js';
|
|
10
|
+
export { default as ModalHeader } from './components/Header.js';
|
|
11
|
+
export { default as ModalFooter } from './components/Footer.js';
|
|
12
|
+
|
|
13
|
+
var _DSSeparator, _DSSeparator2;
|
|
14
|
+
|
|
15
|
+
const DSModalSlide = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
isOpen = false,
|
|
18
|
+
children,
|
|
19
|
+
getContainer,
|
|
20
|
+
centered = false,
|
|
21
|
+
fullWidth = false,
|
|
22
|
+
header = null,
|
|
23
|
+
footer = null,
|
|
24
|
+
fadeOut = 1500,
|
|
25
|
+
fadeIn = 1500,
|
|
26
|
+
overrideHeight = false
|
|
27
|
+
} = _ref;
|
|
23
28
|
const [isMoving, setMoving] = useState(false);
|
|
24
29
|
const [show, setShow] = useState(isOpen);
|
|
25
30
|
const [width, setWidth] = useState(50);
|
|
26
31
|
const theme = useTheme();
|
|
27
|
-
const contentRows = [...header ? [theme.space.m] : [],
|
|
32
|
+
const contentRows = [...(header ? [theme.space.m] : []), '0px', 'auto', '0px', ...(footer ? [theme.space.m] : [])];
|
|
28
33
|
const updateShow = useCallback(() => {
|
|
29
|
-
if (fullWidth)
|
|
30
|
-
|
|
31
|
-
else
|
|
32
|
-
setWidth(50);
|
|
34
|
+
if (fullWidth) setWidth(100);else setWidth(50);
|
|
35
|
+
|
|
33
36
|
if (isOpen !== show) {
|
|
34
37
|
setMoving(true);
|
|
38
|
+
|
|
35
39
|
if (isOpen) {
|
|
36
40
|
setShow(isOpen);
|
|
37
41
|
}
|
|
38
42
|
}
|
|
39
43
|
}, [isOpen, fullWidth, isMoving]);
|
|
40
44
|
useEffect(updateShow, [isOpen, fullWidth]);
|
|
41
|
-
if (!show)
|
|
42
|
-
return null;
|
|
45
|
+
if (!show) return null;
|
|
43
46
|
const container = getContainer();
|
|
44
|
-
if (!container)
|
|
45
|
-
|
|
47
|
+
if (!container) return null;
|
|
48
|
+
|
|
46
49
|
const handleAnimationEnd = () => {
|
|
47
50
|
setMoving(false);
|
|
48
|
-
if (!isOpen)
|
|
49
|
-
setShow(isOpen);
|
|
51
|
+
if (!isOpen) setShow(isOpen);
|
|
50
52
|
};
|
|
51
|
-
|
|
53
|
+
|
|
54
|
+
let {
|
|
55
|
+
height
|
|
56
|
+
} = container.getBoundingClientRect();
|
|
57
|
+
|
|
52
58
|
if (overrideHeight && container.scrollHeight > height) {
|
|
53
59
|
height = container.scrollHeight;
|
|
54
60
|
}
|
|
61
|
+
|
|
55
62
|
if (!container.style.position) {
|
|
56
|
-
container.style.position =
|
|
63
|
+
container.style.position = 'relative';
|
|
57
64
|
}
|
|
58
|
-
|
|
65
|
+
|
|
66
|
+
return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/_jsx(Wrapper, {
|
|
59
67
|
classProps: {
|
|
60
68
|
show: isOpen,
|
|
61
69
|
centered
|
|
62
70
|
},
|
|
63
71
|
style: {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
'--height': height,
|
|
73
|
+
'--fade-in': fadeIn,
|
|
74
|
+
'--fade-out': fadeOut,
|
|
75
|
+
'--width': width
|
|
68
76
|
}
|
|
69
|
-
},
|
|
77
|
+
}, void 0, /*#__PURE__*/_jsx(Overlay, {
|
|
70
78
|
classProps: {
|
|
71
79
|
show: isOpen
|
|
72
80
|
}
|
|
73
|
-
},
|
|
81
|
+
}, void 0, /*#__PURE__*/_jsx(Content, {
|
|
74
82
|
onAnimationEnd: handleAnimationEnd,
|
|
75
83
|
classProps: {
|
|
76
84
|
show: isOpen
|
|
77
85
|
}
|
|
78
|
-
},
|
|
86
|
+
}, void 0, /*#__PURE__*/_jsx(Grid, {
|
|
79
87
|
style: {
|
|
80
|
-
height:
|
|
81
|
-
width:
|
|
82
|
-
maxHeight:
|
|
83
|
-
overflow:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
height: '100%',
|
|
89
|
+
width: '100%',
|
|
90
|
+
maxHeight: '100%',
|
|
91
|
+
overflow: 'hidden',
|
|
92
|
+
'-webkit-backface-visibility': 'hidden',
|
|
93
|
+
'backface-visibility': 'hidden',
|
|
94
|
+
'-webkit-transform-style': 'preserve-3d'
|
|
87
95
|
},
|
|
88
96
|
rows: contentRows,
|
|
89
97
|
"data-testid": "ds-modal-slide"
|
|
90
|
-
},
|
|
98
|
+
}, void 0, header && /*#__PURE__*/React.cloneElement(header, {
|
|
99
|
+
fullWidth
|
|
100
|
+
}), header && (_DSSeparator || (_DSSeparator = /*#__PURE__*/_jsx(DSSeparator, {
|
|
91
101
|
position: "initial",
|
|
92
102
|
type: "non-form"
|
|
93
|
-
}),
|
|
94
|
-
style: {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
},
|
|
103
|
+
}))), /*#__PURE__*/_jsx(Grid, {
|
|
104
|
+
style: {
|
|
105
|
+
overflow: 'hidden'
|
|
106
|
+
}
|
|
107
|
+
}, void 0, /*#__PURE__*/_jsx(Grid, {
|
|
108
|
+
style: {
|
|
109
|
+
overflow: 'auto'
|
|
110
|
+
}
|
|
111
|
+
}, void 0, /*#__PURE__*/_jsx(ActualContent, {}, void 0, children))), footer && (_DSSeparator2 || (_DSSeparator2 = /*#__PURE__*/_jsx(DSSeparator, {
|
|
98
112
|
position: "initial",
|
|
99
113
|
type: "non-form"
|
|
100
|
-
}), footer)))), container);
|
|
114
|
+
}))), footer)))), container);
|
|
101
115
|
};
|
|
116
|
+
|
|
102
117
|
const props = {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
118
|
+
/**
|
|
119
|
+
* If the modal slide is centered or not
|
|
120
|
+
*/
|
|
121
|
+
centered: PropTypes.bool.description('If the modal slide is centered or not'),
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* If the modal slide is visible or not
|
|
125
|
+
*/
|
|
126
|
+
isOpen: PropTypes.bool.description('If the modal slide is visible or not'),
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Main content of the modal
|
|
130
|
+
*/
|
|
131
|
+
children: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.any]).isRequired.description('Main content of the modal'),
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* If the modal slide takes the full width or not
|
|
135
|
+
*/
|
|
136
|
+
fullWidth: PropTypes.bool.description('If the modal slide takes the full width or not'),
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* If the modal slide has a header, only available for full width option
|
|
140
|
+
*/
|
|
141
|
+
header: PropTypes.element.description('If the modal slide has a header, only available for full width option'),
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Ratio of fade out
|
|
145
|
+
*/
|
|
146
|
+
fadeOut: PropTypes.number.description('Ratio of fade out'),
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Ratio of fade in
|
|
150
|
+
*/
|
|
151
|
+
fadeIn: PropTypes.number.description('Ratio of fade in'),
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Override the panel height to scroll height of the container
|
|
155
|
+
*/
|
|
156
|
+
overrideHeight: PropTypes.bool.description('Override the panel height to scroll height of the container')
|
|
111
157
|
};
|
|
112
|
-
DSModalSlide.propTypes = props;
|
|
113
158
|
const DSModalSlideWithSchema = describe(DSModalSlide);
|
|
114
159
|
DSModalSlideWithSchema.propTypes = props;
|
|
115
|
-
|
|
116
|
-
export {
|
|
117
|
-
DSModalSlide,
|
|
118
|
-
DSModalSlideWithSchema,
|
|
119
|
-
ModalFooter,
|
|
120
|
-
ModalHeader,
|
|
121
|
-
DSModalSlide_default as default
|
|
122
|
-
};
|
|
123
|
-
//# sourceMappingURL=DSModalSlide.js.map
|
|
160
|
+
|
|
161
|
+
export { DSModalSlide, DSModalSlideWithSchema, DSModalSlide as default };
|
package/esm/components/Footer.js
CHANGED
|
@@ -1,52 +1,90 @@
|
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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 { PropTypes, describe } from 'react-desc';
|
|
10
|
+
import DSButton from '@elliemae/ds-button';
|
|
11
|
+
import { FooterWrapper } from './blocks.js';
|
|
12
|
+
import { jsx, Fragment } 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
|
+
|
|
18
|
+
const ModalFooter = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
confirmLabel = 'Confirm',
|
|
21
|
+
rejectLabel = 'Cancel',
|
|
22
|
+
onConfirm,
|
|
23
|
+
onReject,
|
|
24
|
+
confirmProps = {
|
|
25
|
+
disabled: false
|
|
26
|
+
},
|
|
27
|
+
rejectProps = {
|
|
28
|
+
disabled: false
|
|
29
|
+
}
|
|
30
|
+
} = _ref;
|
|
31
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
32
|
+
children: /*#__PURE__*/_jsx(FooterWrapper, {}, void 0, !!onReject && /*#__PURE__*/jsx(DSButton, _objectSpread({
|
|
33
|
+
buttonType: "secondary",
|
|
34
|
+
className: "action-reject",
|
|
35
|
+
containerProps: {
|
|
36
|
+
'data-testid': 'modal-footer-reject-btn'
|
|
37
|
+
},
|
|
38
|
+
labelText: rejectLabel,
|
|
39
|
+
onClick: onReject
|
|
40
|
+
}, rejectProps)), !!onConfirm && /*#__PURE__*/jsx(DSButton, _objectSpread({
|
|
41
|
+
buttonType: "primary",
|
|
42
|
+
className: "action-confirm",
|
|
43
|
+
containerProps: {
|
|
44
|
+
'data-testid': 'modal-footer-confirm-btn'
|
|
45
|
+
},
|
|
46
|
+
labelText: confirmLabel,
|
|
47
|
+
onClick: onConfirm
|
|
48
|
+
}, confirmProps)))
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
|
|
32
52
|
const props = {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Confirm Label
|
|
55
|
+
*/
|
|
56
|
+
confirmLabel: PropTypes.string.description('Confirm Label'),
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Reject Label
|
|
60
|
+
*/
|
|
61
|
+
rejectLabel: PropTypes.string.description('Reject Label'),
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Callback
|
|
65
|
+
*/
|
|
66
|
+
onConfirm: PropTypes.func.description('Callback'),
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Callback
|
|
70
|
+
*/
|
|
71
|
+
onReject: PropTypes.func.description('Callback'),
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Extra DSButton props for confirm btn.
|
|
75
|
+
*/
|
|
37
76
|
confirmProps: PropTypes.shape({
|
|
38
77
|
disabled: PropTypes.bool
|
|
39
|
-
}).description(
|
|
78
|
+
}).description('Extra DSButton props for confirm btn.'),
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Extra DSButton props for reject btn.
|
|
82
|
+
*/
|
|
40
83
|
rejectProps: PropTypes.shape({
|
|
41
84
|
disabled: PropTypes.bool
|
|
42
|
-
}).description(
|
|
85
|
+
}).description('Extra DSButton props for reject btn.')
|
|
43
86
|
};
|
|
44
|
-
ModalFooter.propTypes = props;
|
|
45
87
|
const DSModalSlideFooterWithSchema = describe(ModalFooter);
|
|
46
88
|
DSModalSlideFooterWithSchema.propTypes = props;
|
|
47
|
-
|
|
48
|
-
export {
|
|
49
|
-
DSModalSlideFooterWithSchema,
|
|
50
|
-
Footer_default as default
|
|
51
|
-
};
|
|
52
|
-
//# sourceMappingURL=Footer.js.map
|
|
89
|
+
|
|
90
|
+
export { DSModalSlideFooterWithSchema, ModalFooter as default };
|