@luminati-io/uikit 6.1.4-beta.0 → 6.1.4-beta.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -40120,6 +40120,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
40120
40120
|
|
40121
40121
|
|
40122
40122
|
/*jslint react:true*/
|
40123
|
+
var _excluded = ["onClick", "hotKey"];
|
40124
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
40125
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
40123
40126
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
40124
40127
|
|
40125
40128
|
|
@@ -40158,17 +40161,35 @@ var ButtonsGroup = styled_components__WEBPACK_IMPORTED_MODULE_2___default()(_lay
|
|
40158
40161
|
displayName: "ButtonsGroup",
|
40159
40162
|
componentId: "sc-1p9nv3u-1"
|
40160
40163
|
})([""]);
|
40161
|
-
var ModalButton =
|
40162
|
-
|
40163
|
-
|
40164
|
-
|
40165
|
-
|
40166
|
-
|
40167
|
-
var
|
40168
|
-
|
40169
|
-
|
40170
|
-
|
40171
|
-
|
40164
|
+
var ModalButton = function ModalButton(_ref4) {
|
40165
|
+
var onClick = _ref4.onClick,
|
40166
|
+
hotKey = _ref4.hotKey,
|
40167
|
+
rest = _objectWithoutProperties(_ref4, _excluded);
|
40168
|
+
var icon = hotKey == 'enter' ? 'Check' : 'Close';
|
40169
|
+
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
|
40170
|
+
var _document$activeEleme;
|
40171
|
+
(_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 || _document$activeEleme.blur();
|
40172
|
+
if (!hotKey) return;
|
40173
|
+
var handle_key_press = function handle_key_press(e) {
|
40174
|
+
if (e.key.toLowerCase() == hotKey.toLowerCase()) onClick();
|
40175
|
+
};
|
40176
|
+
window.addEventListener('keydown', handle_key_press);
|
40177
|
+
return function () {
|
40178
|
+
return window.removeEventListener('keydown', handle_key_press);
|
40179
|
+
};
|
40180
|
+
}, []);
|
40181
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_button__WEBPACK_IMPORTED_MODULE_3__.Button, _extends({
|
40182
|
+
size: "sm",
|
40183
|
+
onClick: onClick,
|
40184
|
+
iconPlacement: "right",
|
40185
|
+
icon: hotKey && icon
|
40186
|
+
}, rest));
|
40187
|
+
};
|
40188
|
+
var ModalHeader = function ModalHeader(_ref5) {
|
40189
|
+
var title = _ref5.title,
|
40190
|
+
subtitle = _ref5.subtitle,
|
40191
|
+
onCancel = _ref5.onCancel,
|
40192
|
+
cancelDisabled = _ref5.cancelDisabled;
|
40172
40193
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_layout__WEBPACK_IMPORTED_MODULE_5__.Flex, {
|
40173
40194
|
align_items: "center",
|
40174
40195
|
justify_content: "space-between",
|
@@ -40184,15 +40205,15 @@ ModalHeader.propTypes = {
|
|
40184
40205
|
onCancel: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
|
40185
40206
|
cancelDisabled: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
|
40186
40207
|
};
|
40187
|
-
var ModalFooter = function ModalFooter(
|
40188
|
-
var
|
40189
|
-
okLabel =
|
40190
|
-
|
40191
|
-
cancelLabel =
|
40192
|
-
onOk =
|
40193
|
-
onCancel =
|
40194
|
-
okDisabled =
|
40195
|
-
cancelDisabled =
|
40208
|
+
var ModalFooter = function ModalFooter(_ref6) {
|
40209
|
+
var _ref6$okLabel = _ref6.okLabel,
|
40210
|
+
okLabel = _ref6$okLabel === void 0 ? 'OK' : _ref6$okLabel,
|
40211
|
+
_ref6$cancelLabel = _ref6.cancelLabel,
|
40212
|
+
cancelLabel = _ref6$cancelLabel === void 0 ? 'Cancel' : _ref6$cancelLabel,
|
40213
|
+
onOk = _ref6.onOk,
|
40214
|
+
onCancel = _ref6.onCancel,
|
40215
|
+
okDisabled = _ref6.okDisabled,
|
40216
|
+
cancelDisabled = _ref6.cancelDisabled;
|
40196
40217
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_layout__WEBPACK_IMPORTED_MODULE_5__.Flex, {
|
40197
40218
|
width: "100%",
|
40198
40219
|
justify_content: "flex-end"
|
@@ -40201,12 +40222,14 @@ var ModalFooter = function ModalFooter(_ref5) {
|
|
40201
40222
|
variant: "secondary",
|
40202
40223
|
onClick: onCancel,
|
40203
40224
|
disabled: cancelDisabled,
|
40225
|
+
hotKey: "escape",
|
40204
40226
|
"data-testid": "modal_footer_cancel_button"
|
40205
40227
|
}), onOk && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(ModalButton, {
|
40206
40228
|
text: okLabel,
|
40207
40229
|
variant: "primary",
|
40208
40230
|
onClick: onOk,
|
40209
40231
|
disabled: okDisabled,
|
40232
|
+
hotKey: "enter",
|
40210
40233
|
"data-testid": "modal_footer_ok_button"
|
40211
40234
|
})));
|
40212
40235
|
};
|
@@ -40216,7 +40239,8 @@ ModalFooter.propTypes = {
|
|
40216
40239
|
onOk: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
|
40217
40240
|
onCancel: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
|
40218
40241
|
okDisabled: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
|
40219
|
-
cancelDisabled: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
|
40242
|
+
cancelDisabled: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
|
40243
|
+
hotKey: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOf(['enter', 'escape'])
|
40220
40244
|
};
|
40221
40245
|
|
40222
40246
|
/***/ }),
|