intelicoreact 1.1.76 → 1.1.77
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.
|
@@ -50,6 +50,7 @@ var Modal = function Modal(_ref2) {
|
|
|
50
50
|
zIndex = _ref2$zIndex === void 0 ? 100 : _ref2$zIndex,
|
|
51
51
|
isOpen = _ref2.isOpen,
|
|
52
52
|
onConfirm = _ref2.onConfirm,
|
|
53
|
+
onDecline = _ref2.onDecline,
|
|
53
54
|
closeModal = _ref2.closeModal,
|
|
54
55
|
children = _ref2.children,
|
|
55
56
|
className = _ref2.className,
|
|
@@ -91,6 +92,11 @@ var Modal = function Modal(_ref2) {
|
|
|
91
92
|
confirm: function confirm() {
|
|
92
93
|
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
93
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
|
+
},
|
|
94
100
|
pressEnter: function pressEnter(event) {
|
|
95
101
|
if (event.keyCode === KEY_CODE.ENTER && !event.repeat) handle.confirm();
|
|
96
102
|
},
|
|
@@ -142,7 +148,9 @@ var Modal = function Modal(_ref2) {
|
|
|
142
148
|
testId: "modal",
|
|
143
149
|
className: (0, _classnames.default)(closeBtnClassName, btnClassNames),
|
|
144
150
|
variant: closeBtnVariant || 'dark-outline',
|
|
145
|
-
onClick:
|
|
151
|
+
onClick: function onClick() {
|
|
152
|
+
return handle.decline();
|
|
153
|
+
},
|
|
146
154
|
label: closeBtnText || 'Cancel',
|
|
147
155
|
disabled: closeBtnDisable,
|
|
148
156
|
icon: closeBtnIcon,
|