intelicoreact 1.2.17 → 1.2.19
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/Atomic/FormElements/InputDateRange/InputDateRange.scss +4 -0
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +1 -1
- package/dist/Atomic/UI/Modal/Modal.js +34 -8
- package/dist/Atomic/UI/Modal/ModalMobile.scss +48 -0
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +3 -1
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +5 -2
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +110 -0
- package/dist/Atomic/UI/ModalBackup/Modal.js +174 -0
- package/dist/Atomic/UI/ModalBackup/Modal.scss +333 -0
- package/dist/Atomic/UI/ModalBackup/ModalHOC.js +51 -0
- package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +24 -0
- package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +41 -0
- package/package.json +1 -1
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
--line-height: 20px;
|
|
10
10
|
--border-radius: 3px;
|
|
11
11
|
|
|
12
|
+
position: relative;
|
|
13
|
+
z-index: 1;
|
|
14
|
+
|
|
12
15
|
/* position: relative;
|
|
13
16
|
width: 335px;
|
|
14
17
|
//height: calc(var(--input-height) + var(--label-line-height));
|
|
@@ -76,6 +79,7 @@
|
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
&_focused {
|
|
82
|
+
z-index: 2;
|
|
79
83
|
.date-range-input__static-part {
|
|
80
84
|
border: 1px solid blue;
|
|
81
85
|
filter: drop-shadow(0 0 4px rgb(93 120 255 / 50%));
|
|
@@ -61,7 +61,7 @@ var RadioGroupWithInput = function RadioGroupWithInput(_ref) {
|
|
|
61
61
|
className: (0, _classnames.default)('radio-group-input', className, "radio-group-input--".concat(direction), {
|
|
62
62
|
'radio-group-input--disabled': disabled
|
|
63
63
|
})
|
|
64
|
-
}, options.map(function (item) {
|
|
64
|
+
}, options === null || options === void 0 ? void 0 : options.map(function (item) {
|
|
65
65
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
66
66
|
key: item.id,
|
|
67
67
|
className: (0, _classnames.default)('radio-group-input-item', "radio-group-input-item-".concat(item.id))
|
|
@@ -15,16 +15,18 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
15
15
|
|
|
16
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
17
|
|
|
18
|
-
var _reactFeather = require("react-feather");
|
|
19
|
-
|
|
20
18
|
var _Button = _interopRequireDefault(require("../Button/Button"));
|
|
21
19
|
|
|
22
|
-
require("./Modal.scss");
|
|
23
|
-
|
|
24
20
|
var _ModalFooter = _interopRequireDefault(require("./partials/ModalFooter"));
|
|
25
21
|
|
|
26
22
|
var _ModalTitle = _interopRequireDefault(require("./partials/ModalTitle"));
|
|
27
23
|
|
|
24
|
+
var _useMobileModal2 = _interopRequireDefault(require("./partials/useMobileModal"));
|
|
25
|
+
|
|
26
|
+
require("./Modal.scss");
|
|
27
|
+
|
|
28
|
+
require("./ModalMobile.scss");
|
|
29
|
+
|
|
28
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
31
|
|
|
30
32
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -87,6 +89,15 @@ var Modal = function Modal(_ref2) {
|
|
|
87
89
|
leftContentOfFooter = _ref2.leftContentOfFooter,
|
|
88
90
|
testId = _ref2.testId,
|
|
89
91
|
noHeaderCloseBtn = _ref2.noHeaderCloseBtn;
|
|
92
|
+
|
|
93
|
+
var _useMobileModal = (0, _useMobileModal2.default)(),
|
|
94
|
+
modalMobileHeaderRef = _useMobileModal.modalMobileHeaderRef,
|
|
95
|
+
modalMobileBodyRef = _useMobileModal.modalMobileBodyRef,
|
|
96
|
+
modalMobileFooterRef = _useMobileModal.modalMobileFooterRef,
|
|
97
|
+
MODALS_LOGIC = _useMobileModal.MODALS_LOGIC,
|
|
98
|
+
renderModal = _useMobileModal.renderModal,
|
|
99
|
+
isMobile = _useMobileModal.isMobile;
|
|
100
|
+
|
|
90
101
|
if (!isOpen) return null;
|
|
91
102
|
var handle = {
|
|
92
103
|
confirm: function confirm() {
|
|
@@ -122,12 +133,21 @@ var Modal = function Modal(_ref2) {
|
|
|
122
133
|
"data-testid": 'modal-closeOverlay',
|
|
123
134
|
className: isOpen ? 'modal-overlay' : 'hidden',
|
|
124
135
|
onClick: closeModal
|
|
125
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
136
|
+
}), renderModal( /*#__PURE__*/_react.default.createElement("div", {
|
|
126
137
|
style: {
|
|
127
138
|
width: size
|
|
128
139
|
},
|
|
129
|
-
className: (0, _classnames.default)(className,
|
|
140
|
+
className: (0, _classnames.default)(className, {
|
|
141
|
+
'modal': isOpen,
|
|
142
|
+
'modal-mobile': isOpen && isMobile,
|
|
143
|
+
'hidden': !isOpen
|
|
144
|
+
})
|
|
130
145
|
}, !noHeader && /*#__PURE__*/_react.default.createElement(_ModalTitle.default, {
|
|
146
|
+
wrapperRef: modalMobileHeaderRef,
|
|
147
|
+
className: (0, _classnames.default)({
|
|
148
|
+
'modal__header--hidden': MODALS_LOGIC.IS_HEADER_HIDDEN,
|
|
149
|
+
'modal__header--sticky': !MODALS_LOGIC.IS_HEADER_HIDDEN && MODALS_LOGIC.IS_HEADER_STICKY
|
|
150
|
+
}),
|
|
131
151
|
variant: variant,
|
|
132
152
|
isForced: forced,
|
|
133
153
|
onClose: handle.decline,
|
|
@@ -137,11 +157,17 @@ var Modal = function Modal(_ref2) {
|
|
|
137
157
|
title: title,
|
|
138
158
|
onlyTitle: onlyTitle
|
|
139
159
|
}))), /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, atributesForModalBody, {
|
|
160
|
+
ref: modalMobileBodyRef,
|
|
140
161
|
className: (0, _classnames.default)('modal__body', {
|
|
141
162
|
'modal__body--no-footer': noFooter
|
|
142
163
|
})
|
|
143
164
|
}), children), !noFooter && /*#__PURE__*/_react.default.createElement(_ModalFooter.default, {
|
|
144
|
-
|
|
165
|
+
wrapperRef: modalMobileFooterRef,
|
|
166
|
+
className: (0, _classnames.default)({
|
|
167
|
+
'modal__footer--hidden': MODALS_LOGIC.IS_FOOTER_HIDDEN,
|
|
168
|
+
'modal__footer--sticky': !MODALS_LOGIC.IS_FOOTER_HIDDEN && MODALS_LOGIC.IS_FOOTER_STICKY,
|
|
169
|
+
'modal__footer_with-left-content': leftContentOfFooter
|
|
170
|
+
})
|
|
145
171
|
}, leftContentOfFooter, /*#__PURE__*/_react.default.createElement("div", {
|
|
146
172
|
className: "modal__buttons-block"
|
|
147
173
|
}, !noCloseBtn && /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
@@ -167,7 +193,7 @@ var Modal = function Modal(_ref2) {
|
|
|
167
193
|
disabled: confirmBtnDisable,
|
|
168
194
|
icon: confirmBtnIcon,
|
|
169
195
|
isIconRight: isConfirmBtnIconPositionRight
|
|
170
|
-
})))));
|
|
196
|
+
}))))));
|
|
171
197
|
};
|
|
172
198
|
|
|
173
199
|
var _default = Modal;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
@media only screen and (max-width:767px) {
|
|
2
|
+
.modal-mobile-container {
|
|
3
|
+
max-height: 100dvh;
|
|
4
|
+
max-width: 100dvw;
|
|
5
|
+
position: relative;
|
|
6
|
+
top: 0;
|
|
7
|
+
overflow-y: auto;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
border-radius: 16px 16px 0 0;
|
|
10
|
+
|
|
11
|
+
.modal {
|
|
12
|
+
margin-top: 16px!important;
|
|
13
|
+
max-height: unset!important;
|
|
14
|
+
max-width: 100vw;
|
|
15
|
+
border-radius: 16px 16px 0 0;
|
|
16
|
+
|
|
17
|
+
&__header,
|
|
18
|
+
&__footer {
|
|
19
|
+
left: 0;
|
|
20
|
+
width: 100%;
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
z-index: 2;
|
|
23
|
+
|
|
24
|
+
&--hidden {
|
|
25
|
+
position: relative;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&--sticky {
|
|
29
|
+
position: sticky;
|
|
30
|
+
box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.15);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&__header {
|
|
35
|
+
top: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&__body,
|
|
39
|
+
&__footer {
|
|
40
|
+
border-radius: 0!important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&__footer {
|
|
44
|
+
bottom: 0;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -14,8 +14,10 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
14
14
|
var ModalFooter = function ModalFooter(_ref) {
|
|
15
15
|
var _ref$className = _ref.className,
|
|
16
16
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
17
|
-
children = _ref.children
|
|
17
|
+
children = _ref.children,
|
|
18
|
+
wrapperRef = _ref.wrapperRef;
|
|
18
19
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
20
|
+
ref: wrapperRef,
|
|
19
21
|
className: (0, _classnames.default)('modal__footer', className)
|
|
20
22
|
}, children);
|
|
21
23
|
};
|
|
@@ -21,9 +21,12 @@ var ModalTitle = function ModalTitle(_ref) {
|
|
|
21
21
|
children = _ref.children,
|
|
22
22
|
isForced = _ref.isForced,
|
|
23
23
|
onClose = _ref.onClose,
|
|
24
|
-
noHeaderCloseBtn = _ref.noHeaderCloseBtn
|
|
24
|
+
noHeaderCloseBtn = _ref.noHeaderCloseBtn,
|
|
25
|
+
className = _ref.className,
|
|
26
|
+
wrapperRef = _ref.wrapperRef;
|
|
25
27
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
26
|
-
|
|
28
|
+
ref: wrapperRef,
|
|
29
|
+
className: (0, _classnames.default)('modal__header', className, (0, _defineProperty2.default)({}, "modal__header-".concat(variant), variant))
|
|
27
30
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
28
31
|
className: (0, _classnames.default)('modal__header-title', (0, _defineProperty2.default)({}, "modal__header-".concat(variant, "-title"), variant))
|
|
29
32
|
}, children), !isForced && /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = useMobileModal;
|
|
11
|
+
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
|
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
|
|
18
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
+
|
|
20
|
+
var SCROLL_DIRECTION = {
|
|
21
|
+
UP: 'up',
|
|
22
|
+
DOWN: 'down'
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
function useMobileModal() {
|
|
26
|
+
var _modalMobileContainer, _modalMobileContainer2, _modalMobileHeaderRef, _modalMobileHeaderRef2, _modalMobileFooterRef, _modalMobileFooterRef2, _modalMobileFooterRef3, _modalMobileFooterRef4, _modalMobileBodyRef$c, _modalMobileBodyRef$c2;
|
|
27
|
+
|
|
28
|
+
var _useState = (0, _react.useState)(false),
|
|
29
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
30
|
+
isMobile = _useState2[0],
|
|
31
|
+
setIsMobile = _useState2[1];
|
|
32
|
+
|
|
33
|
+
var modalMobileContainerRef = (0, _react.useRef)(null);
|
|
34
|
+
var modalMobileHeaderRef = (0, _react.useRef)(null);
|
|
35
|
+
var modalMobileFooterRef = (0, _react.useRef)(null);
|
|
36
|
+
var modalMobileBodyRef = (0, _react.useRef)(null);
|
|
37
|
+
|
|
38
|
+
var _useState3 = (0, _react.useState)(0),
|
|
39
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
40
|
+
scrollTop = _useState4[0],
|
|
41
|
+
setScrollTop = _useState4[1];
|
|
42
|
+
|
|
43
|
+
var _useState5 = (0, _react.useState)(0),
|
|
44
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
45
|
+
scrollTopPrev = _useState6[0],
|
|
46
|
+
setScrollTopPrev = _useState6[1];
|
|
47
|
+
|
|
48
|
+
var _useState7 = (0, _react.useState)(SCROLL_DIRECTION.UP),
|
|
49
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
50
|
+
scrollDirection = _useState8[0],
|
|
51
|
+
setScrollDirection = _useState8[1];
|
|
52
|
+
|
|
53
|
+
var modalMobileContainerHeight = modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : (_modalMobileContainer = modalMobileContainerRef.current) === null || _modalMobileContainer === void 0 ? void 0 : (_modalMobileContainer2 = _modalMobileContainer.getBoundingClientRect()) === null || _modalMobileContainer2 === void 0 ? void 0 : _modalMobileContainer2.height;
|
|
54
|
+
var headerTop = modalMobileHeaderRef === null || modalMobileHeaderRef === void 0 ? void 0 : (_modalMobileHeaderRef = modalMobileHeaderRef.current) === null || _modalMobileHeaderRef === void 0 ? void 0 : (_modalMobileHeaderRef2 = _modalMobileHeaderRef.getBoundingClientRect()) === null || _modalMobileHeaderRef2 === void 0 ? void 0 : _modalMobileHeaderRef2.top;
|
|
55
|
+
var footerBottom = modalMobileContainerHeight - (modalMobileFooterRef === null || modalMobileFooterRef === void 0 ? void 0 : (_modalMobileFooterRef = modalMobileFooterRef.current) === null || _modalMobileFooterRef === void 0 ? void 0 : (_modalMobileFooterRef2 = _modalMobileFooterRef.getBoundingClientRect()) === null || _modalMobileFooterRef2 === void 0 ? void 0 : _modalMobileFooterRef2.bottom);
|
|
56
|
+
var footerHeight = modalMobileFooterRef === null || modalMobileFooterRef === void 0 ? void 0 : (_modalMobileFooterRef3 = modalMobileFooterRef.current) === null || _modalMobileFooterRef3 === void 0 ? void 0 : (_modalMobileFooterRef4 = _modalMobileFooterRef3.getBoundingClientRect()) === null || _modalMobileFooterRef4 === void 0 ? void 0 : _modalMobileFooterRef4.height;
|
|
57
|
+
var bodyTop = modalMobileBodyRef === null || modalMobileBodyRef === void 0 ? void 0 : (_modalMobileBodyRef$c = modalMobileBodyRef.current) === null || _modalMobileBodyRef$c === void 0 ? void 0 : (_modalMobileBodyRef$c2 = _modalMobileBodyRef$c.getBoundingClientRect()) === null || _modalMobileBodyRef$c2 === void 0 ? void 0 : _modalMobileBodyRef$c2.top;
|
|
58
|
+
/* MODALS LOGIC | BEGIN */
|
|
59
|
+
// Detect Mobile
|
|
60
|
+
|
|
61
|
+
(0, _react.useEffect)(function () {
|
|
62
|
+
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) setIsMobile(true);
|
|
63
|
+
}, [navigator.userAgent]); // Count ScrollTop
|
|
64
|
+
|
|
65
|
+
(0, _react.useEffect)(function () {
|
|
66
|
+
var el = modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : modalMobileContainerRef.current;
|
|
67
|
+
|
|
68
|
+
if (el) {
|
|
69
|
+
el.addEventListener('scroll', function () {
|
|
70
|
+
setScrollTop(function (scrollTop) {
|
|
71
|
+
if (scrollTop !== el.scrollTop) setScrollTopPrev(scrollTop);
|
|
72
|
+
return el.scrollTop;
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}, [modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : modalMobileContainerRef.current]); // Count ScrollDirection
|
|
77
|
+
|
|
78
|
+
(0, _react.useEffect)(function () {
|
|
79
|
+
setScrollDirection(scrollTop < scrollTopPrev ? SCROLL_DIRECTION.UP : SCROLL_DIRECTION.DOWN);
|
|
80
|
+
}, [scrollTop, scrollTopPrev]);
|
|
81
|
+
var MODALS_LOGIC = {
|
|
82
|
+
IS_HEADER_HIDDEN: !isMobile ? false : footerBottom * -1 <= footerHeight || scrollDirection === SCROLL_DIRECTION.DOWN,
|
|
83
|
+
IS_HEADER_STICKY: !isMobile ? false : headerTop <= 0,
|
|
84
|
+
IS_FOOTER_HIDDEN: !isMobile ? false : bodyTop > 0 || scrollDirection === SCROLL_DIRECTION.UP,
|
|
85
|
+
IS_FOOTER_STICKY: !isMobile ? false : footerBottom <= 0
|
|
86
|
+
};
|
|
87
|
+
/* MODALS LOGIC | END */
|
|
88
|
+
|
|
89
|
+
var renderMobileModal = function renderMobileModal(modal) {
|
|
90
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
91
|
+
className: "modal-mobile-container",
|
|
92
|
+
ref: modalMobileContainerRef
|
|
93
|
+
}, modal);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
var renderModal = function renderModal(modal) {
|
|
97
|
+
return isMobile ? renderMobileModal(modal) : modal;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
modalMobileContainerRef: modalMobileContainerRef,
|
|
102
|
+
modalMobileHeaderRef: modalMobileHeaderRef,
|
|
103
|
+
modalMobileBodyRef: modalMobileBodyRef,
|
|
104
|
+
modalMobileFooterRef: modalMobileFooterRef,
|
|
105
|
+
MODALS_LOGIC: MODALS_LOGIC,
|
|
106
|
+
SCROLL_DIRECTION: SCROLL_DIRECTION,
|
|
107
|
+
renderModal: renderModal,
|
|
108
|
+
isMobile: isMobile
|
|
109
|
+
};
|
|
110
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.renderModalTitle = exports.default = exports.KEY_CODE = void 0;
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
|
|
16
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
|
+
|
|
18
|
+
var _reactFeather = require("react-feather");
|
|
19
|
+
|
|
20
|
+
var _Button = _interopRequireDefault(require("../Button/Button"));
|
|
21
|
+
|
|
22
|
+
require("./Modal.scss");
|
|
23
|
+
|
|
24
|
+
var _ModalFooter = _interopRequireDefault(require("./partials/ModalFooter"));
|
|
25
|
+
|
|
26
|
+
var _ModalTitle = _interopRequireDefault(require("./partials/ModalTitle"));
|
|
27
|
+
|
|
28
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
|
+
|
|
30
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
|
+
|
|
32
|
+
var KEY_CODE = Object.freeze({
|
|
33
|
+
ENTER: 13,
|
|
34
|
+
ESC: 27
|
|
35
|
+
});
|
|
36
|
+
exports.KEY_CODE = KEY_CODE;
|
|
37
|
+
|
|
38
|
+
var renderModalTitle = function renderModalTitle(_ref) {
|
|
39
|
+
var mode = _ref.mode,
|
|
40
|
+
title = _ref.title,
|
|
41
|
+
onlyTitle = _ref.onlyTitle;
|
|
42
|
+
if (mode && mode !== 'default' && !onlyTitle) return "".concat(mode[0].toUpperCase() + mode.slice(1), " ").concat(title);
|
|
43
|
+
return title;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
exports.renderModalTitle = renderModalTitle;
|
|
47
|
+
|
|
48
|
+
var Modal = function Modal(_ref2) {
|
|
49
|
+
var _ref2$zIndex = _ref2.zIndex,
|
|
50
|
+
zIndex = _ref2$zIndex === void 0 ? 100 : _ref2$zIndex,
|
|
51
|
+
isOpen = _ref2.isOpen,
|
|
52
|
+
onConfirm = _ref2.onConfirm,
|
|
53
|
+
onDecline = _ref2.onDecline,
|
|
54
|
+
closeModal = _ref2.closeModal,
|
|
55
|
+
children = _ref2.children,
|
|
56
|
+
className = _ref2.className,
|
|
57
|
+
title = _ref2.title,
|
|
58
|
+
variant = _ref2.variant,
|
|
59
|
+
onlyTitle = _ref2.onlyTitle,
|
|
60
|
+
mode = _ref2.mode,
|
|
61
|
+
size = _ref2.size,
|
|
62
|
+
_ref2$atributesForMod = _ref2.atributesForModalBody,
|
|
63
|
+
atributesForModalBody = _ref2$atributesForMod === void 0 ? {} : _ref2$atributesForMod,
|
|
64
|
+
confirmBtnClassName = _ref2.confirmBtnClassName,
|
|
65
|
+
confirmBtnLabel = _ref2.confirmBtnLabel,
|
|
66
|
+
_ref2$confirmBtnVaria = _ref2.confirmBtnVariant,
|
|
67
|
+
confirmBtnVariant = _ref2$confirmBtnVaria === void 0 ? 'primary' : _ref2$confirmBtnVaria,
|
|
68
|
+
confirmBtnDisable = _ref2.confirmBtnDisable,
|
|
69
|
+
confirmBtnIcon = _ref2.confirmBtnIcon,
|
|
70
|
+
isConfirmBtnIconPositionRight = _ref2.isConfirmBtnIconPositionRight,
|
|
71
|
+
noConfirmBtn = _ref2.noConfirmBtn,
|
|
72
|
+
noCloseBtn = _ref2.noCloseBtn,
|
|
73
|
+
noFooter = _ref2.noFooter,
|
|
74
|
+
noHeader = _ref2.noHeader,
|
|
75
|
+
closeBtnClassName = _ref2.closeBtnClassName,
|
|
76
|
+
closeBtnText = _ref2.closeBtnText,
|
|
77
|
+
closeBtnVariant = _ref2.closeBtnVariant,
|
|
78
|
+
closeBtnDisable = _ref2.closeBtnDisable,
|
|
79
|
+
closeBtnIcon = _ref2.closeBtnIcon,
|
|
80
|
+
forced = _ref2.forced,
|
|
81
|
+
btnClassNames = _ref2.btnClassNames,
|
|
82
|
+
isCloseBtnIconPositionRight = _ref2.isCloseBtnIconPositionRight,
|
|
83
|
+
_ref2$submitOnEnter = _ref2.submitOnEnter,
|
|
84
|
+
submitOnEnter = _ref2$submitOnEnter === void 0 ? false : _ref2$submitOnEnter,
|
|
85
|
+
_ref2$closeOnEsc = _ref2.closeOnEsc,
|
|
86
|
+
closeOnEsc = _ref2$closeOnEsc === void 0 ? false : _ref2$closeOnEsc,
|
|
87
|
+
leftContentOfFooter = _ref2.leftContentOfFooter,
|
|
88
|
+
testId = _ref2.testId,
|
|
89
|
+
noHeaderCloseBtn = _ref2.noHeaderCloseBtn;
|
|
90
|
+
if (!isOpen) return null;
|
|
91
|
+
var handle = {
|
|
92
|
+
confirm: function confirm() {
|
|
93
|
+
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
94
|
+
},
|
|
95
|
+
decline: function decline() {
|
|
96
|
+
//? closeModal используется для ESC и оверлея, давно хотелось иметь возможность разделить
|
|
97
|
+
//? Теперь можно не передавать closeModal, а для cancel-кнопки передать отдельный обработчик
|
|
98
|
+
if (typeof onDecline === 'function') onDecline();else closeModal === null || closeModal === void 0 ? void 0 : closeModal();
|
|
99
|
+
},
|
|
100
|
+
pressEnter: function pressEnter(event) {
|
|
101
|
+
if (event.keyCode === KEY_CODE.ENTER && !event.repeat) handle.confirm();
|
|
102
|
+
},
|
|
103
|
+
pressEsc: function pressEsc() {
|
|
104
|
+
if (event.keyCode === KEY_CODE.ESC && !event.repeat) closeModal === null || closeModal === void 0 ? void 0 : closeModal();
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
(0, _react.useEffect)(function () {
|
|
108
|
+
if (submitOnEnter) document.addEventListener('keyup', handle.pressEnter);
|
|
109
|
+
if (closeOnEsc) document.addEventListener('keyup', handle.pressEsc);
|
|
110
|
+
return function () {
|
|
111
|
+
document.removeEventListener('keyup', handle.pressEnter);
|
|
112
|
+
document.removeEventListener('keyup', handle.pressEsc);
|
|
113
|
+
};
|
|
114
|
+
}, [submitOnEnter, closeOnEsc]);
|
|
115
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
116
|
+
style: {
|
|
117
|
+
zIndex: zIndex
|
|
118
|
+
},
|
|
119
|
+
"data-testid": testId,
|
|
120
|
+
className: "modal-box j5"
|
|
121
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
122
|
+
"data-testid": 'modal-closeOverlay',
|
|
123
|
+
className: isOpen ? 'modal-overlay' : 'hidden',
|
|
124
|
+
onClick: closeModal
|
|
125
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
126
|
+
style: {
|
|
127
|
+
width: size
|
|
128
|
+
},
|
|
129
|
+
className: (0, _classnames.default)(className, "".concat(isOpen ? 'modal' : 'hidden'))
|
|
130
|
+
}, !noHeader && /*#__PURE__*/_react.default.createElement(_ModalTitle.default, {
|
|
131
|
+
variant: variant,
|
|
132
|
+
isForced: forced,
|
|
133
|
+
onClose: handle.decline,
|
|
134
|
+
noHeaderCloseBtn: noHeaderCloseBtn
|
|
135
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, renderModalTitle({
|
|
136
|
+
mode: mode,
|
|
137
|
+
title: title,
|
|
138
|
+
onlyTitle: onlyTitle
|
|
139
|
+
}))), /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, atributesForModalBody, {
|
|
140
|
+
className: (0, _classnames.default)('modal__body', {
|
|
141
|
+
'modal__body--no-footer': noFooter
|
|
142
|
+
})
|
|
143
|
+
}), children), !noFooter && /*#__PURE__*/_react.default.createElement(_ModalFooter.default, {
|
|
144
|
+
className: leftContentOfFooter ? 'modal__footer_with-left-content' : ''
|
|
145
|
+
}, leftContentOfFooter, /*#__PURE__*/_react.default.createElement("div", {
|
|
146
|
+
className: "modal__buttons-block"
|
|
147
|
+
}, !noCloseBtn && /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
148
|
+
testId: "modal",
|
|
149
|
+
className: (0, _classnames.default)(closeBtnClassName, btnClassNames),
|
|
150
|
+
variant: closeBtnVariant || 'dark-outline',
|
|
151
|
+
onClick: function onClick() {
|
|
152
|
+
return handle.decline();
|
|
153
|
+
},
|
|
154
|
+
label: closeBtnText || 'Cancel',
|
|
155
|
+
disabled: closeBtnDisable,
|
|
156
|
+
icon: closeBtnIcon,
|
|
157
|
+
isIconRight: isCloseBtnIconPositionRight,
|
|
158
|
+
tabIndex: 1
|
|
159
|
+
}), !noConfirmBtn && /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
160
|
+
testId: "modal",
|
|
161
|
+
onClick: function onClick() {
|
|
162
|
+
return handle.confirm();
|
|
163
|
+
},
|
|
164
|
+
label: confirmBtnLabel || (mode === null || mode === void 0 ? void 0 : mode[0].toUpperCase()) + (mode === null || mode === void 0 ? void 0 : mode.slice(1)) || 'Apply',
|
|
165
|
+
className: (0, _classnames.default)('ml5', confirmBtnClassName, btnClassNames),
|
|
166
|
+
variant: confirmBtnVariant,
|
|
167
|
+
disabled: confirmBtnDisable,
|
|
168
|
+
icon: confirmBtnIcon,
|
|
169
|
+
isIconRight: isConfirmBtnIconPositionRight
|
|
170
|
+
})))));
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
var _default = Modal;
|
|
174
|
+
exports.default = _default;
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
@import "../../../scss/_vars";
|
|
2
|
+
@import "../../../scss/mixins";
|
|
3
|
+
|
|
4
|
+
.modal-overlay {
|
|
5
|
+
position: fixed;
|
|
6
|
+
z-index: 4;
|
|
7
|
+
top: 0;
|
|
8
|
+
left: 0;
|
|
9
|
+
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
|
|
13
|
+
transition: opacity 0.2s ease;
|
|
14
|
+
|
|
15
|
+
opacity: 0.5;
|
|
16
|
+
background-color: black;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.modal {
|
|
20
|
+
--modal-min-height: 300px;
|
|
21
|
+
--max-height: calc(100% - 30px);
|
|
22
|
+
|
|
23
|
+
position: relative;
|
|
24
|
+
z-index: 5;
|
|
25
|
+
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
|
|
29
|
+
width: 600px;
|
|
30
|
+
min-height: var(--modal-min-height);
|
|
31
|
+
max-height: var(--max-height);
|
|
32
|
+
margin: 0 10px;
|
|
33
|
+
|
|
34
|
+
border-radius: 6px;
|
|
35
|
+
background-color: #FFF;
|
|
36
|
+
box-shadow: 0 20px 20px rgb(0 0 0 / 20%);
|
|
37
|
+
|
|
38
|
+
&__header {
|
|
39
|
+
position: relative;
|
|
40
|
+
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: space-between;
|
|
44
|
+
|
|
45
|
+
padding: 10px 15px;
|
|
46
|
+
|
|
47
|
+
border-bottom: 1px solid #E2E5EC;
|
|
48
|
+
border-top-left-radius: 4px;
|
|
49
|
+
border-top-right-radius: 4px;
|
|
50
|
+
background-color: #F7FAFC;
|
|
51
|
+
|
|
52
|
+
&-primary {
|
|
53
|
+
background-color: $color--primary;
|
|
54
|
+
|
|
55
|
+
&-title {
|
|
56
|
+
color: #ffffff;
|
|
57
|
+
|
|
58
|
+
font-size: 16px;
|
|
59
|
+
font-weight: 400;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&-title {
|
|
64
|
+
color: $color--primary;
|
|
65
|
+
|
|
66
|
+
font-size: 16px;
|
|
67
|
+
font-weight: normal;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&__body {
|
|
72
|
+
box-sizing: border-box;
|
|
73
|
+
overflow-y: auto;
|
|
74
|
+
|
|
75
|
+
flex-grow: 1;
|
|
76
|
+
padding: 15px;
|
|
77
|
+
|
|
78
|
+
border-bottom-right-radius: 4px;
|
|
79
|
+
border-bottom-left-radius: 4px;
|
|
80
|
+
background-color: #F7FAFC;
|
|
81
|
+
&:first-of-type {
|
|
82
|
+
border-top-right-radius: 4px;
|
|
83
|
+
border-top-left-radius: 4px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@include custom-scroll2;
|
|
87
|
+
|
|
88
|
+
&--no-footer {
|
|
89
|
+
padding: 15px;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&__footer {
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
justify-content: flex-end;
|
|
97
|
+
|
|
98
|
+
padding: 7.5px 15px;
|
|
99
|
+
|
|
100
|
+
border-top: 1px solid #E2E5EC;
|
|
101
|
+
border-bottom-right-radius: 4px;
|
|
102
|
+
border-bottom-left-radius: 4px;
|
|
103
|
+
background-color: #F7FAFC;
|
|
104
|
+
|
|
105
|
+
&_with-left-content {
|
|
106
|
+
justify-content: space-between;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&--inbody {
|
|
110
|
+
position: absolute;
|
|
111
|
+
bottom: 0;
|
|
112
|
+
left: 0;
|
|
113
|
+
|
|
114
|
+
width: calc(100% - 30px);
|
|
115
|
+
|
|
116
|
+
background-color: #FFFF;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&__buttons-block {
|
|
121
|
+
display: flex;
|
|
122
|
+
align-items: center;
|
|
123
|
+
flex-flow: row nowrap;
|
|
124
|
+
justify-content: flex-start;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.modal__footer--noborder {
|
|
129
|
+
border-top: none;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.modal-box {
|
|
133
|
+
position: fixed;
|
|
134
|
+
z-index: 100;
|
|
135
|
+
top: 0;
|
|
136
|
+
right: 0;
|
|
137
|
+
bottom: 0;
|
|
138
|
+
left: 0;
|
|
139
|
+
|
|
140
|
+
animation-name: fadeIn;
|
|
141
|
+
animation-duration: 0.25s;
|
|
142
|
+
animation-timing-function: ease;
|
|
143
|
+
animation-fill-mode: forwards;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@keyframes fadeIn {
|
|
147
|
+
from {
|
|
148
|
+
opacity: 0;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
to {
|
|
152
|
+
opacity: 1;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.consumer-info-modal {
|
|
157
|
+
overflow-x: auto;
|
|
158
|
+
|
|
159
|
+
.button-fin {
|
|
160
|
+
background-color: #FFFF;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.modal__body {
|
|
164
|
+
min-height: 200px;
|
|
165
|
+
padding: 0 15px;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.modal-close-icon-box {
|
|
170
|
+
position: absolute;
|
|
171
|
+
top: 0;
|
|
172
|
+
right: 0;
|
|
173
|
+
|
|
174
|
+
display: flex;
|
|
175
|
+
align-items: center;
|
|
176
|
+
justify-content: center;
|
|
177
|
+
|
|
178
|
+
width: 40px;
|
|
179
|
+
height: 38px;
|
|
180
|
+
height: 100%;
|
|
181
|
+
|
|
182
|
+
cursor: pointer;
|
|
183
|
+
|
|
184
|
+
color: #1E1E2D;
|
|
185
|
+
//background-color: inherit;
|
|
186
|
+
border-top-right-radius: 5px;
|
|
187
|
+
background: transparent;
|
|
188
|
+
|
|
189
|
+
&:hover {
|
|
190
|
+
background-color: #E2E5EC;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
&-primary {
|
|
194
|
+
color: #1E1E2D;
|
|
195
|
+
|
|
196
|
+
&:hover {
|
|
197
|
+
opacity: 1;
|
|
198
|
+
background-color: #5162D4;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
&-merchant {
|
|
203
|
+
color: #1E1E2D;
|
|
204
|
+
|
|
205
|
+
&:hover {
|
|
206
|
+
opacity: 1;
|
|
207
|
+
background-color: #5162D4;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.modal-close-icon {
|
|
213
|
+
width: 20px;
|
|
214
|
+
min-width: 20px;
|
|
215
|
+
height: 20px;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.modal-text-card {
|
|
219
|
+
padding: 15px 0;
|
|
220
|
+
|
|
221
|
+
text-align: left;
|
|
222
|
+
white-space: normal;
|
|
223
|
+
|
|
224
|
+
font-size: 13px;
|
|
225
|
+
font-weight: 400;
|
|
226
|
+
line-height: 20px;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.prompt-text-card {
|
|
230
|
+
padding: 0;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.included-selector-modal {
|
|
234
|
+
&--box {
|
|
235
|
+
overflow-x: auto;
|
|
236
|
+
|
|
237
|
+
max-height: calc(100% - 32px);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
&__th {
|
|
241
|
+
&--id {
|
|
242
|
+
width: 1%;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
&__td {
|
|
247
|
+
&--id {
|
|
248
|
+
color: #9AA0B9;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.simple-table {
|
|
253
|
+
overflow-x: unset;
|
|
254
|
+
|
|
255
|
+
min-height: 400px;
|
|
256
|
+
max-height: 500px;
|
|
257
|
+
|
|
258
|
+
thead {
|
|
259
|
+
background-color: unset;
|
|
260
|
+
|
|
261
|
+
th {
|
|
262
|
+
padding: 10px 15px;
|
|
263
|
+
|
|
264
|
+
border-right: 1px solid #E2E5EC;
|
|
265
|
+
|
|
266
|
+
font-weight: 400;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
th:first-child,
|
|
270
|
+
th:last-child {
|
|
271
|
+
border: none;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
tbody {
|
|
276
|
+
tr:first-child {
|
|
277
|
+
position: relative;
|
|
278
|
+
|
|
279
|
+
&::after {
|
|
280
|
+
position: absolute;
|
|
281
|
+
top: 0;
|
|
282
|
+
left: 0;
|
|
283
|
+
|
|
284
|
+
width: 100%;
|
|
285
|
+
height: 8px;
|
|
286
|
+
|
|
287
|
+
content: "";
|
|
288
|
+
|
|
289
|
+
background: linear-gradient(180deg, rgb(0 0 0 / 15.2%) 0%, rgb(0 0 0 / 0%) 100%);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
tr:last-child {
|
|
294
|
+
border-bottom: none;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
td {
|
|
299
|
+
padding: 2.25px 15px;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.tr-as-selector:hover td {
|
|
303
|
+
background-color: #FFEDC8;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.reports-settings-modal-box {
|
|
309
|
+
.modal__body {
|
|
310
|
+
padding: 0;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.confirm-modal {
|
|
315
|
+
border-radius: 4px;
|
|
316
|
+
|
|
317
|
+
.modal {
|
|
318
|
+
&__header-title {
|
|
319
|
+
font-size: 13px;
|
|
320
|
+
font-weight: 700;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
&__body {
|
|
324
|
+
.modal-text-card {
|
|
325
|
+
padding: 0;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
&__footer {
|
|
330
|
+
background-color: #FFFF;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _reactFeather = require("react-feather");
|
|
15
|
+
|
|
16
|
+
require("./Modal.scss");
|
|
17
|
+
|
|
18
|
+
var _Modal2 = require("./Modal");
|
|
19
|
+
|
|
20
|
+
var _ModalTitle = _interopRequireDefault(require("./partials/ModalTitle"));
|
|
21
|
+
|
|
22
|
+
var Modal = function Modal(_ref) {
|
|
23
|
+
var _ref$zIndex = _ref.zIndex,
|
|
24
|
+
zIndex = _ref$zIndex === void 0 ? 100 : _ref$zIndex,
|
|
25
|
+
isOpen = _ref.isOpen,
|
|
26
|
+
closeModal = _ref.closeModal,
|
|
27
|
+
children = _ref.children,
|
|
28
|
+
className = _ref.className,
|
|
29
|
+
size = _ref.size,
|
|
30
|
+
testId = _ref.testId;
|
|
31
|
+
if (!isOpen) return null;
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
33
|
+
style: {
|
|
34
|
+
zIndex: zIndex
|
|
35
|
+
},
|
|
36
|
+
"data-testid": testId,
|
|
37
|
+
className: "modal-box j5"
|
|
38
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
39
|
+
"data-testid": 'modal-closeOverlay',
|
|
40
|
+
className: "modal-overlay",
|
|
41
|
+
onClick: closeModal
|
|
42
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
43
|
+
style: {
|
|
44
|
+
width: size
|
|
45
|
+
},
|
|
46
|
+
className: (0, _classnames.default)(className, 'modal')
|
|
47
|
+
}, children));
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
var _default = Modal;
|
|
51
|
+
exports.default = _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var ModalFooter = function ModalFooter(_ref) {
|
|
15
|
+
var _ref$className = _ref.className,
|
|
16
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
17
|
+
children = _ref.children;
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
19
|
+
className: (0, _classnames.default)('modal__footer', className)
|
|
20
|
+
}, children);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var _default = ModalFooter;
|
|
24
|
+
exports.default = _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
16
|
+
var _reactFeather = require("react-feather");
|
|
17
|
+
|
|
18
|
+
var ModalTitle = function ModalTitle(_ref) {
|
|
19
|
+
var _ref$variant = _ref.variant,
|
|
20
|
+
variant = _ref$variant === void 0 ? 'primary' : _ref$variant,
|
|
21
|
+
children = _ref.children,
|
|
22
|
+
isForced = _ref.isForced,
|
|
23
|
+
onClose = _ref.onClose,
|
|
24
|
+
noHeaderCloseBtn = _ref.noHeaderCloseBtn;
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
26
|
+
className: (0, _classnames.default)('modal__header', (0, _defineProperty2.default)({}, "modal__header-".concat(variant), variant))
|
|
27
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
28
|
+
className: (0, _classnames.default)('modal__header-title', (0, _defineProperty2.default)({}, "modal__header-".concat(variant, "-title"), variant))
|
|
29
|
+
}, children), !isForced && /*#__PURE__*/_react.default.createElement("div", {
|
|
30
|
+
"data-testid": 'modal--button-closeCross',
|
|
31
|
+
onClick: onClose,
|
|
32
|
+
className: (0, _classnames.default)('modal-close-icon-box', {
|
|
33
|
+
'modal-close-icon-box-primary': variant === 'primary'
|
|
34
|
+
})
|
|
35
|
+
}, !noHeaderCloseBtn && /*#__PURE__*/_react.default.createElement(_reactFeather.X, {
|
|
36
|
+
className: "modal-close-icon"
|
|
37
|
+
})));
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
var _default = ModalTitle;
|
|
41
|
+
exports.default = _default;
|