@salutejs/plasma-new-hope 0.113.1-canary.1325.10178064945.0 → 0.114.0-canary.1326.10178816804.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. package/cjs/components/DatePicker/RangeDate/RangeDate.js +14 -2
  2. package/cjs/components/DatePicker/RangeDate/RangeDate.js.map +1 -1
  3. package/cjs/components/DatePicker/SingleDate/SingleDate.js +14 -2
  4. package/cjs/components/DatePicker/SingleDate/SingleDate.js.map +1 -1
  5. package/cjs/components/DatePicker/hooks/useKeyboardNavigation.js +30 -0
  6. package/cjs/components/DatePicker/hooks/useKeyboardNavigation.js.map +1 -0
  7. package/cjs/components/Modal/hooks/useModal.js +15 -0
  8. package/cjs/components/Modal/hooks/useModal.js.map +1 -1
  9. package/cjs/components/Popup/PopupContext.js +8 -23
  10. package/cjs/components/Popup/PopupContext.js.map +1 -1
  11. package/cjs/components/Popup/hooks/usePopup.js +0 -5
  12. package/cjs/components/Popup/hooks/usePopup.js.map +1 -1
  13. package/emotion/cjs/components/DatePicker/RangeDate/RangeDate.js +14 -2
  14. package/emotion/cjs/components/DatePicker/SingleDate/SingleDate.js +14 -2
  15. package/emotion/cjs/components/DatePicker/hooks/useKeyboardNavigation.js +32 -0
  16. package/emotion/cjs/components/Modal/hooks/useModal.js +15 -0
  17. package/emotion/cjs/components/Popup/PopupContext.js +8 -23
  18. package/emotion/cjs/components/Popup/hooks/usePopup.js +0 -5
  19. package/emotion/es/components/DatePicker/RangeDate/RangeDate.js +14 -2
  20. package/emotion/es/components/DatePicker/SingleDate/SingleDate.js +15 -3
  21. package/emotion/es/components/DatePicker/hooks/useKeyboardNavigation.js +26 -0
  22. package/emotion/es/components/Modal/hooks/useModal.js +17 -2
  23. package/emotion/es/components/Popup/PopupContext.js +9 -24
  24. package/emotion/es/components/Popup/hooks/usePopup.js +0 -5
  25. package/es/components/DatePicker/RangeDate/RangeDate.js +14 -2
  26. package/es/components/DatePicker/RangeDate/RangeDate.js.map +1 -1
  27. package/es/components/DatePicker/SingleDate/SingleDate.js +15 -3
  28. package/es/components/DatePicker/SingleDate/SingleDate.js.map +1 -1
  29. package/es/components/DatePicker/hooks/useKeyboardNavigation.js +25 -0
  30. package/es/components/DatePicker/hooks/useKeyboardNavigation.js.map +1 -0
  31. package/es/components/Modal/hooks/useModal.js +17 -2
  32. package/es/components/Modal/hooks/useModal.js.map +1 -1
  33. package/es/components/Popup/PopupContext.js +9 -24
  34. package/es/components/Popup/PopupContext.js.map +1 -1
  35. package/es/components/Popup/hooks/usePopup.js +0 -5
  36. package/es/components/Popup/hooks/usePopup.js.map +1 -1
  37. package/package.json +2 -2
  38. package/styled-components/cjs/components/DatePicker/RangeDate/RangeDate.js +14 -2
  39. package/styled-components/cjs/components/DatePicker/SingleDate/SingleDate.js +14 -2
  40. package/styled-components/cjs/components/DatePicker/hooks/useKeyboardNavigation.js +32 -0
  41. package/styled-components/cjs/components/Modal/hooks/useModal.js +15 -0
  42. package/styled-components/cjs/components/Popup/PopupContext.js +8 -23
  43. package/styled-components/cjs/components/Popup/hooks/usePopup.js +0 -5
  44. package/styled-components/es/components/DatePicker/RangeDate/RangeDate.js +14 -2
  45. package/styled-components/es/components/DatePicker/SingleDate/SingleDate.js +15 -3
  46. package/styled-components/es/components/DatePicker/hooks/useKeyboardNavigation.js +26 -0
  47. package/styled-components/es/components/Modal/hooks/useModal.js +17 -2
  48. package/styled-components/es/components/Popup/PopupContext.js +9 -24
  49. package/styled-components/es/components/Popup/hooks/usePopup.js +0 -5
  50. package/types/components/DatePicker/RangeDate/RangeDate.d.ts.map +1 -1
  51. package/types/components/DatePicker/SingleDate/SingleDate.d.ts.map +1 -1
  52. package/types/components/DatePicker/hooks/useKeyboardNavigation.d.ts +13 -0
  53. package/types/components/DatePicker/hooks/useKeyboardNavigation.d.ts.map +1 -0
  54. package/types/components/Modal/hooks/useModal.d.ts +1 -1
  55. package/types/components/Modal/hooks/useModal.d.ts.map +1 -1
  56. package/types/components/Popup/PopupContext.d.ts.map +1 -1
  57. package/types/components/Popup/hooks/usePopup.d.ts.map +1 -1
@@ -11,6 +11,7 @@ var _dateHelper = /*#__PURE__*/require("../utils/dateHelper");
11
11
  var _useDatePicker2 = /*#__PURE__*/require("../hooks/useDatePicker");
12
12
  var _DatePicker = /*#__PURE__*/require("../DatePicker.tokens");
13
13
  var _DatePickerBase = /*#__PURE__*/require("../DatePickerBase.styles");
14
+ var _useKeyboardNavigation = /*#__PURE__*/require("../hooks/useKeyboardNavigation");
14
15
  var _base = /*#__PURE__*/require("./variations/_size/base");
15
16
  var _base2 = /*#__PURE__*/require("./variations/_view/base");
16
17
  var _base3 = /*#__PURE__*/require("./variations/_disabled/base");
@@ -119,6 +120,11 @@ var datePickerRoot = exports.datePickerRoot = function datePickerRoot(Root) {
119
120
  handleToggle = _useDatePicker.handleToggle,
120
121
  handleChangeValue = _useDatePicker.handleChangeValue,
121
122
  handleCommitDate = _useDatePicker.handleCommitDate;
123
+ var _useKeyNavigation = (0, _useKeyboardNavigation.useKeyNavigation)({
124
+ isCalendarOpen: isInnerOpen,
125
+ onToggle: handleToggle
126
+ }),
127
+ onKeyDown = _useKeyNavigation.onKeyDown;
122
128
  var DatePickerInput = /*#__PURE__*/_react["default"].createElement(_SingleDate.StyledInput, _extends({
123
129
  ref: inputRef,
124
130
  className: (0, _utils.cx)(datePickerErrorClass, datePickerSuccessClass),
@@ -136,11 +142,17 @@ var datePickerRoot = exports.datePickerRoot = function datePickerRoot(Root) {
136
142
  return handleCommitDate(date, true, false);
137
143
  },
138
144
  onFocus: onFocus,
139
- onBlur: onBlur
145
+ onBlur: onBlur,
146
+ onKeyDown: onKeyDown
140
147
  }, innerLabelPlacement && {
141
148
  label: label,
142
149
  labelPlacement: labelPlacement
143
150
  }));
151
+ (0, _react.useEffect)(function () {
152
+ setIsInnerOpen(function (prevOpen) {
153
+ return prevOpen !== isOpen && isOpen;
154
+ });
155
+ }, [isOpen]);
144
156
  return /*#__PURE__*/_react["default"].createElement(Root, _extends({
145
157
  view: view,
146
158
  size: size,
@@ -149,7 +161,7 @@ var datePickerRoot = exports.datePickerRoot = function datePickerRoot(Root) {
149
161
  readOnly: !disabled && readOnly,
150
162
  ref: ref
151
163
  }, rest), !innerLabelPlacement && label && /*#__PURE__*/_react["default"].createElement(_SingleDate.StyledLabel, null, label), /*#__PURE__*/_react["default"].createElement(_SingleDate.StyledPopover, {
152
- isOpen: isOpen || isInnerOpen,
164
+ isOpen: isInnerOpen,
153
165
  usePortal: false,
154
166
  onToggle: handleToggle,
155
167
  offset: offset,
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useKeyNavigation = exports.keys = void 0;
7
+ var keys = exports.keys = {
8
+ Space: 'Space'
9
+ };
10
+ var useKeyNavigation = exports.useKeyNavigation = function useKeyNavigation(_ref) {
11
+ var isCalendarOpen = _ref.isCalendarOpen,
12
+ onToggle = _ref.onToggle;
13
+ var onKeyDown = function onKeyDown(event) {
14
+ switch (event.code) {
15
+ case keys.Space:
16
+ {
17
+ if (!isCalendarOpen) {
18
+ event.preventDefault();
19
+ onToggle(true, event);
20
+ }
21
+ break;
22
+ }
23
+ default:
24
+ {
25
+ break;
26
+ }
27
+ }
28
+ };
29
+ return {
30
+ onKeyDown: onKeyDown
31
+ };
32
+ };
@@ -16,12 +16,14 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
16
16
  var ESCAPE_KEYCODE = 27;
17
17
  var useModal = exports.useModal = function useModal(_ref) {
18
18
  var id = _ref.id,
19
+ isOpen = _ref.isOpen,
19
20
  popupInfo = _ref.popupInfo,
20
21
  onEscKeyDown = _ref.onEscKeyDown,
21
22
  onClose = _ref.onClose,
22
23
  _ref$closeOnEsc = _ref.closeOnEsc,
23
24
  closeOnEsc = _ref$closeOnEsc === void 0 ? true : _ref$closeOnEsc;
24
25
  var popupController = (0, _Popup.usePopupContext)();
26
+ var overflow = (0, _react.useRef)(document.body.style.overflowY);
25
27
 
26
28
  // При ESC закрывает текущее окно, если это возможно
27
29
  var onKeyDown = (0, _react.useCallback)(function (event) {
@@ -44,6 +46,19 @@ var useModal = exports.useModal = function useModal(_ref) {
44
46
  window.removeEventListener('keydown', onKeyDown);
45
47
  };
46
48
  }, [onClose, onEscKeyDown, popupController.items, closeOnEsc]);
49
+
50
+ // linaria не поддерживает динамический global
51
+ (0, _react.useEffect)(function () {
52
+ if (isOpen) {
53
+ overflow.current = document.body.style.overflowY;
54
+ document.body.style.overflowY = 'hidden';
55
+ }
56
+ }, [isOpen]);
57
+ (0, _react.useEffect)(function () {
58
+ if (!isOpen && !(0, _ModalContext.hasModals)(popupController.items)) {
59
+ document.body.style.overflowY = overflow.current;
60
+ }
61
+ }, [isOpen, overflow.current, popupController.items]);
47
62
  var modalInfo = _objectSpread({
48
63
  id: id,
49
64
  info: {
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.usePopupContext = exports.PopupProvider = exports.POPUP_PORTAL_ID = void 0;
8
8
  var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
9
- var _ModalContext = /*#__PURE__*/require("../Modal/ModalContext");
10
9
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
11
10
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
12
11
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
@@ -35,36 +34,22 @@ var usePopupContext = exports.usePopupContext = function usePopupContext() {
35
34
  };
36
35
  var PopupProvider = exports.PopupProvider = function PopupProvider(_ref) {
37
36
  var children = _ref.children;
38
- var prevBodyOverflowY = (0, _react.useRef)(document.body.style.overflowY);
39
37
  var _useState = (0, _react.useState)([]),
40
38
  _useState2 = _slicedToArray(_useState, 2),
41
39
  items = _useState2[0],
42
40
  setItems = _useState2[1];
43
41
  var register = function register(info) {
44
- setItems(function (prevItems) {
45
- var _info$info;
46
- if ((_info$info = info.info) !== null && _info$info !== void 0 && _info$info.isModal && !(0, _ModalContext.hasModals)(prevItems)) {
47
- prevBodyOverflowY.current = document.body.style.overflowY;
48
- document.body.style.overflowY = 'hidden';
49
- }
50
- return [].concat(_toConsumableArray(prevItems), [info]);
51
- });
42
+ setItems([].concat(_toConsumableArray(items), [info]));
52
43
  };
53
44
  var unregister = function unregister(id) {
54
- setItems(function (prevItems) {
55
- var index = prevItems.findIndex(function (item) {
56
- return id === item.id;
57
- });
58
- if (index === -1) {
59
- return prevItems;
60
- }
61
- var prevHasModals = (0, _ModalContext.hasModals)(prevItems);
62
- prevItems.splice(index, 1);
63
- if (prevHasModals && !(0, _ModalContext.hasModals)(prevItems)) {
64
- document.body.style.overflowY = prevBodyOverflowY.current;
65
- }
66
- return prevItems;
45
+ var index = items.findIndex(function (item) {
46
+ return id === item.id;
67
47
  });
48
+ if (index === -1) {
49
+ return;
50
+ }
51
+ items.splice(index, 1);
52
+ setItems(_toConsumableArray(items));
68
53
  };
69
54
  var context = {
70
55
  items: items,
@@ -81,11 +81,6 @@ var usePopup = exports.usePopup = function usePopup(_ref) {
81
81
  popupController.unregister(id);
82
82
  setVisible(false);
83
83
  }, [isOpen, isVisible, animationInfo]);
84
- (0, _react.useEffect)(function () {
85
- return function () {
86
- popupController.unregister(id);
87
- };
88
- }, [id]);
89
84
  return {
90
85
  isVisible: isVisible,
91
86
  setVisible: setVisible,
@@ -13,6 +13,7 @@ import { cx } from '../../../utils';
13
13
  import { formatCalendarValue, formatInputValue, getDateFormatDelimiter } from '../utils/dateHelper';
14
14
  import { useDatePicker } from '../hooks/useDatePicker';
15
15
  import { classes } from '../DatePicker.tokens';
16
+ import { useKeyNavigation } from '../hooks/useKeyboardNavigation';
16
17
  import { base as sizeCSS } from './variations/_size/base';
17
18
  import { base as viewCSS } from './variations/_view/base';
18
19
  import { base as disabledCSS } from './variations/_disabled/base';
@@ -172,6 +173,11 @@ export var datePickerRangeRoot = function datePickerRangeRoot(Root) {
172
173
  }
173
174
  setIsInnerOpen(isCalendarOpen);
174
175
  };
176
+ var _useKeyNavigation = useKeyNavigation({
177
+ isCalendarOpen: isInnerOpen,
178
+ onToggle: handleToggle
179
+ }),
180
+ onKeyDown = _useKeyNavigation.onKeyDown;
175
181
  var RangeComponent = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledRange, {
176
182
  ref: rangeRef,
177
183
  dividerIcon: dividerIcon,
@@ -215,13 +221,19 @@ export var datePickerRangeRoot = function datePickerRangeRoot(Root) {
215
221
  onFocusFirstTextfield: onFocusFirstTextfield,
216
222
  onFocusSecondTextfield: onFocusSecondTextfield,
217
223
  onBlurFirstTextfield: onBlurFirstTextfield,
218
- onBlurSecondTextfield: onBlurSecondTextfield
224
+ onBlurSecondTextfield: onBlurSecondTextfield,
225
+ onKeyDown: onKeyDown
219
226
  }));
220
227
  useEffect(function () {
221
228
  var _rangeRef$current5, _rangeRef$current6;
222
229
  setFirstInputRef((_rangeRef$current5 = rangeRef.current) === null || _rangeRef$current5 === void 0 ? void 0 : _rangeRef$current5.firstTextField());
223
230
  setSecondInputRef((_rangeRef$current6 = rangeRef.current) === null || _rangeRef$current6 === void 0 ? void 0 : _rangeRef$current6.secondTextField());
224
231
  }, [rangeRef.current]);
232
+ useEffect(function () {
233
+ setIsInnerOpen(function (prevOpen) {
234
+ return prevOpen !== isOpen && isOpen;
235
+ });
236
+ }, [isOpen]);
225
237
  return /*#__PURE__*/React.createElement(Root, _extends({
226
238
  ref: rootRef,
227
239
  view: view,
@@ -232,7 +244,7 @@ export var datePickerRangeRoot = function datePickerRangeRoot(Root) {
232
244
  }, rest), label && /*#__PURE__*/React.createElement(StyledLabel, null, label), /*#__PURE__*/React.createElement(RangeDatePopover, {
233
245
  calendarValue: [calendarFirstValue, calendarSecondValue],
234
246
  target: RangeComponent,
235
- isOpen: isOpen || isInnerOpen,
247
+ isOpen: isInnerOpen,
236
248
  includeEdgeDates: includeEdgeDates,
237
249
  eventList: eventList,
238
250
  disabledList: disabledList,
@@ -8,12 +8,13 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
8
8
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
9
9
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
10
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
- import React, { forwardRef, useCallback, useRef, useState } from 'react';
11
+ import React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
12
12
  import { cx, getPlacements } from '../../../utils';
13
13
  import { formatCalendarValue, formatInputValue, getDateFormatDelimiter } from '../utils/dateHelper';
14
14
  import { useDatePicker } from '../hooks/useDatePicker';
15
15
  import { classes } from '../DatePicker.tokens';
16
16
  import { StyledCalendar } from '../DatePickerBase.styles';
17
+ import { useKeyNavigation } from '../hooks/useKeyboardNavigation';
17
18
  import { base as sizeCSS } from './variations/_size/base';
18
19
  import { base as viewCSS } from './variations/_view/base';
19
20
  import { base as disabledCSS } from './variations/_disabled/base';
@@ -110,6 +111,11 @@ export var datePickerRoot = function datePickerRoot(Root) {
110
111
  handleToggle = _useDatePicker.handleToggle,
111
112
  handleChangeValue = _useDatePicker.handleChangeValue,
112
113
  handleCommitDate = _useDatePicker.handleCommitDate;
114
+ var _useKeyNavigation = useKeyNavigation({
115
+ isCalendarOpen: isInnerOpen,
116
+ onToggle: handleToggle
117
+ }),
118
+ onKeyDown = _useKeyNavigation.onKeyDown;
113
119
  var DatePickerInput = /*#__PURE__*/React.createElement(StyledInput, _extends({
114
120
  ref: inputRef,
115
121
  className: cx(datePickerErrorClass, datePickerSuccessClass),
@@ -127,11 +133,17 @@ export var datePickerRoot = function datePickerRoot(Root) {
127
133
  return handleCommitDate(date, true, false);
128
134
  },
129
135
  onFocus: onFocus,
130
- onBlur: onBlur
136
+ onBlur: onBlur,
137
+ onKeyDown: onKeyDown
131
138
  }, innerLabelPlacement && {
132
139
  label: label,
133
140
  labelPlacement: labelPlacement
134
141
  }));
142
+ useEffect(function () {
143
+ setIsInnerOpen(function (prevOpen) {
144
+ return prevOpen !== isOpen && isOpen;
145
+ });
146
+ }, [isOpen]);
135
147
  return /*#__PURE__*/React.createElement(Root, _extends({
136
148
  view: view,
137
149
  size: size,
@@ -140,7 +152,7 @@ export var datePickerRoot = function datePickerRoot(Root) {
140
152
  readOnly: !disabled && readOnly,
141
153
  ref: ref
142
154
  }, rest), !innerLabelPlacement && label && /*#__PURE__*/React.createElement(StyledLabel, null, label), /*#__PURE__*/React.createElement(StyledPopover, {
143
- isOpen: isOpen || isInnerOpen,
155
+ isOpen: isInnerOpen,
144
156
  usePortal: false,
145
157
  onToggle: handleToggle,
146
158
  offset: offset,
@@ -0,0 +1,26 @@
1
+ export var keys = {
2
+ Space: 'Space'
3
+ };
4
+ export var useKeyNavigation = function useKeyNavigation(_ref) {
5
+ var isCalendarOpen = _ref.isCalendarOpen,
6
+ onToggle = _ref.onToggle;
7
+ var onKeyDown = function onKeyDown(event) {
8
+ switch (event.code) {
9
+ case keys.Space:
10
+ {
11
+ if (!isCalendarOpen) {
12
+ event.preventDefault();
13
+ onToggle(true, event);
14
+ }
15
+ break;
16
+ }
17
+ default:
18
+ {
19
+ break;
20
+ }
21
+ }
22
+ };
23
+ return {
24
+ onKeyDown: onKeyDown
25
+ };
26
+ };
@@ -4,18 +4,20 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- import { useCallback, useEffect } from 'react';
8
- import { getIdLastModal } from '../ModalContext';
7
+ import { useCallback, useEffect, useRef } from 'react';
8
+ import { getIdLastModal, hasModals } from '../ModalContext';
9
9
  import { usePopupContext } from '../../Popup';
10
10
  var ESCAPE_KEYCODE = 27;
11
11
  export var useModal = function useModal(_ref) {
12
12
  var id = _ref.id,
13
+ isOpen = _ref.isOpen,
13
14
  popupInfo = _ref.popupInfo,
14
15
  onEscKeyDown = _ref.onEscKeyDown,
15
16
  onClose = _ref.onClose,
16
17
  _ref$closeOnEsc = _ref.closeOnEsc,
17
18
  closeOnEsc = _ref$closeOnEsc === void 0 ? true : _ref$closeOnEsc;
18
19
  var popupController = usePopupContext();
20
+ var overflow = useRef(document.body.style.overflowY);
19
21
 
20
22
  // При ESC закрывает текущее окно, если это возможно
21
23
  var onKeyDown = useCallback(function (event) {
@@ -38,6 +40,19 @@ export var useModal = function useModal(_ref) {
38
40
  window.removeEventListener('keydown', onKeyDown);
39
41
  };
40
42
  }, [onClose, onEscKeyDown, popupController.items, closeOnEsc]);
43
+
44
+ // linaria не поддерживает динамический global
45
+ useEffect(function () {
46
+ if (isOpen) {
47
+ overflow.current = document.body.style.overflowY;
48
+ document.body.style.overflowY = 'hidden';
49
+ }
50
+ }, [isOpen]);
51
+ useEffect(function () {
52
+ if (!isOpen && !hasModals(popupController.items)) {
53
+ document.body.style.overflowY = overflow.current;
54
+ }
55
+ }, [isOpen, overflow.current, popupController.items]);
41
56
  var modalInfo = _objectSpread({
42
57
  id: id,
43
58
  info: {
@@ -8,8 +8,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
8
8
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
9
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
- import React, { createContext, useEffect, useState, useContext, useRef } from 'react';
12
- import { hasModals } from '../Modal/ModalContext';
11
+ import React, { createContext, useEffect, useState, useContext } from 'react';
13
12
  export var POPUP_PORTAL_ID = 'plasma-popup-root';
14
13
  var items = [];
15
14
  var PopupContext = /*#__PURE__*/createContext({
@@ -26,36 +25,22 @@ export var usePopupContext = function usePopupContext() {
26
25
  };
27
26
  export var PopupProvider = function PopupProvider(_ref) {
28
27
  var children = _ref.children;
29
- var prevBodyOverflowY = useRef(document.body.style.overflowY);
30
28
  var _useState = useState([]),
31
29
  _useState2 = _slicedToArray(_useState, 2),
32
30
  items = _useState2[0],
33
31
  setItems = _useState2[1];
34
32
  var register = function register(info) {
35
- setItems(function (prevItems) {
36
- var _info$info;
37
- if ((_info$info = info.info) !== null && _info$info !== void 0 && _info$info.isModal && !hasModals(prevItems)) {
38
- prevBodyOverflowY.current = document.body.style.overflowY;
39
- document.body.style.overflowY = 'hidden';
40
- }
41
- return [].concat(_toConsumableArray(prevItems), [info]);
42
- });
33
+ setItems([].concat(_toConsumableArray(items), [info]));
43
34
  };
44
35
  var unregister = function unregister(id) {
45
- setItems(function (prevItems) {
46
- var index = prevItems.findIndex(function (item) {
47
- return id === item.id;
48
- });
49
- if (index === -1) {
50
- return prevItems;
51
- }
52
- var prevHasModals = hasModals(prevItems);
53
- prevItems.splice(index, 1);
54
- if (prevHasModals && !hasModals(prevItems)) {
55
- document.body.style.overflowY = prevBodyOverflowY.current;
56
- }
57
- return prevItems;
36
+ var index = items.findIndex(function (item) {
37
+ return id === item.id;
58
38
  });
39
+ if (index === -1) {
40
+ return;
41
+ }
42
+ items.splice(index, 1);
43
+ setItems(_toConsumableArray(items));
59
44
  };
60
45
  var context = {
61
46
  items: items,
@@ -76,11 +76,6 @@ export var usePopup = function usePopup(_ref) {
76
76
  popupController.unregister(id);
77
77
  setVisible(false);
78
78
  }, [isOpen, isVisible, animationInfo]);
79
- useEffect(function () {
80
- return function () {
81
- popupController.unregister(id);
82
- };
83
- }, [id]);
84
79
  return {
85
80
  isVisible: isVisible,
86
81
  setVisible: setVisible,
@@ -4,6 +4,7 @@ import { cx } from '../../../utils/index.js';
4
4
  import { formatCalendarValue, formatInputValue, getDateFormatDelimiter } from '../utils/dateHelper.js';
5
5
  import { useDatePicker } from '../hooks/useDatePicker.js';
6
6
  import { classes } from '../DatePicker.tokens.js';
7
+ import { useKeyNavigation } from '../hooks/useKeyboardNavigation.js';
7
8
  import { base as base$2 } from './variations/_size/base.js';
8
9
  import { base as base$1 } from './variations/_view/base.js';
9
10
  import { base as base$3 } from './variations/_disabled/base.js';
@@ -165,6 +166,11 @@ var datePickerRangeRoot = function datePickerRangeRoot(Root) {
165
166
  }
166
167
  setIsInnerOpen(isCalendarOpen);
167
168
  };
169
+ var _useKeyNavigation = useKeyNavigation({
170
+ isCalendarOpen: isInnerOpen,
171
+ onToggle: handleToggle
172
+ }),
173
+ onKeyDown = _useKeyNavigation.onKeyDown;
168
174
  var RangeComponent = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledRange, {
169
175
  ref: rangeRef,
170
176
  dividerIcon: dividerIcon,
@@ -208,13 +214,19 @@ var datePickerRangeRoot = function datePickerRangeRoot(Root) {
208
214
  onFocusFirstTextfield: onFocusFirstTextfield,
209
215
  onFocusSecondTextfield: onFocusSecondTextfield,
210
216
  onBlurFirstTextfield: onBlurFirstTextfield,
211
- onBlurSecondTextfield: onBlurSecondTextfield
217
+ onBlurSecondTextfield: onBlurSecondTextfield,
218
+ onKeyDown: onKeyDown
212
219
  }));
213
220
  useEffect(function () {
214
221
  var _rangeRef$current5, _rangeRef$current6;
215
222
  setFirstInputRef((_rangeRef$current5 = rangeRef.current) === null || _rangeRef$current5 === void 0 ? void 0 : _rangeRef$current5.firstTextField());
216
223
  setSecondInputRef((_rangeRef$current6 = rangeRef.current) === null || _rangeRef$current6 === void 0 ? void 0 : _rangeRef$current6.secondTextField());
217
224
  }, [rangeRef.current]);
225
+ useEffect(function () {
226
+ setIsInnerOpen(function (prevOpen) {
227
+ return prevOpen !== isOpen && isOpen;
228
+ });
229
+ }, [isOpen]);
218
230
  return /*#__PURE__*/React.createElement(Root, _extends({
219
231
  ref: rootRef,
220
232
  view: view,
@@ -225,7 +237,7 @@ var datePickerRangeRoot = function datePickerRangeRoot(Root) {
225
237
  }, rest), label && /*#__PURE__*/React.createElement(StyledLabel, null, label), /*#__PURE__*/React.createElement(RangeDatePopover, {
226
238
  calendarValue: [calendarFirstValue, calendarSecondValue],
227
239
  target: RangeComponent,
228
- isOpen: isOpen || isInnerOpen,
240
+ isOpen: isInnerOpen,
229
241
  includeEdgeDates: includeEdgeDates,
230
242
  eventList: eventList,
231
243
  disabledList: disabledList,
@@ -1 +1 @@
1
- {"version":3,"file":"RangeDate.js","sources":["../../../../src/components/DatePicker/RangeDate/RangeDate.tsx"],"sourcesContent":["import React, {\n MutableRefObject,\n SyntheticEvent,\n createRef,\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport type { RootProps } from '../../../engines';\nimport { cx } from '../../../utils';\nimport { formatCalendarValue, formatInputValue, getDateFormatDelimiter } from '../utils/dateHelper';\nimport { useDatePicker } from '../hooks/useDatePicker';\nimport type { RangeInputRefs } from '../../Range/Range.types';\nimport { classes } from '../DatePicker.tokens';\n\nimport type { DatePickerRangeProps } from './RangeDate.types';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as readOnlyCSS } from './variations/_readonly/base';\nimport { LeftHelper, StyledLabel, StyledRange, base } from './RangeDate.styles';\nimport { RangeDatePopover } from './RangeDatePopover/RangeDatePopover';\n\nexport const datePickerRangeRoot = (\n Root: RootProps<HTMLDivElement, Omit<DatePickerRangeProps, 'isOpen' | 'defaultValue' | 'onChangeValue'>>,\n) =>\n forwardRef<RangeInputRefs, DatePickerRangeProps>(\n (\n {\n className,\n\n isDoubleCalendar = false,\n isOpen = false,\n\n label,\n leftHelper,\n contentLeft,\n contentRight,\n view,\n size,\n readOnly = false,\n disabled = false,\n\n dividerVariant = 'dash',\n dividerIcon,\n\n defaultFirstDate = '',\n defaultSecondDate = '',\n firstValueError,\n secondValueError,\n firstValueSuccess,\n secondValueSuccess,\n firstPlaceholder,\n secondPlaceholder,\n firstTextfieldContentLeft,\n firstTextfieldContentRight,\n secondTextfieldContentLeft,\n secondTextfieldContentRight,\n firstTextfieldTextBefore,\n secondTextfieldTextBefore,\n firstTextfieldTextAfter,\n secondTextfieldTextAfter,\n\n format = 'DD.MM.YYYY',\n maskWithFormat,\n min,\n max,\n includeEdgeDates = false,\n eventList,\n disabledList,\n eventMonthList,\n disabledMonthList,\n eventQuarterList,\n disabledQuarterList,\n eventYearList,\n disabledYearList,\n type = 'Days',\n\n placement = ['top', 'bottom'],\n closeOnOverlayClick = true,\n closeOnEsc = true,\n offset,\n\n onToggle,\n\n onChangeFirstValue,\n onChangeSecondValue,\n\n onCommitFirstDate,\n onCommitSecondDate,\n\n onFocusFirstTextfield,\n onFocusSecondTextfield,\n onBlurFirstTextfield,\n onBlurSecondTextfield,\n\n ...rest\n },\n ref,\n ) => {\n const rangeRef = ref && 'current' in ref ? ref : createRef<RangeInputRefs>();\n const rootRef = useRef<HTMLDivElement | null>(null);\n\n const [firstInputRef, setFirstInputRef] = useState<MutableRefObject<HTMLInputElement | null> | undefined>(\n rangeRef?.current?.firstTextField(),\n );\n const [secondInputRef, setSecondInputRef] = useState<MutableRefObject<HTMLInputElement | null> | undefined>(\n rangeRef?.current?.secondTextField(),\n );\n const [isInnerOpen, setIsInnerOpen] = useState(isOpen);\n\n const [calendarFirstValue, setCalendarFirstValue] = useState(formatCalendarValue(defaultFirstDate, format));\n const [inputFirstValue, setInputFirstValue] = useState(formatInputValue(defaultFirstDate, format));\n\n const [calendarSecondValue, setCalendarSecondValue] = useState(\n formatCalendarValue(defaultSecondDate, format),\n );\n const [inputSecondValue, setInputSecondValue] = useState(formatInputValue(defaultSecondDate, format));\n\n const dateFormatDelimiter = useCallback(() => getDateFormatDelimiter(format), [format]);\n\n const {\n handleChangeValue: handleChangeFirstValue,\n handleCommitDate: handleCommitFirstDate,\n } = useDatePicker({\n currentValue: inputFirstValue,\n setInputValue: setInputFirstValue,\n setCalendarValue: setCalendarFirstValue,\n setIsInnerOpen,\n dateFormatDelimiter,\n format,\n disabled,\n readOnly,\n maskWithFormat,\n valueError: firstValueError,\n valueSuccess: firstValueSuccess,\n inputRef: firstInputRef,\n onChangeValue: onChangeFirstValue,\n onCommitDate: onCommitFirstDate,\n });\n\n const {\n handleChangeValue: handleChangeSecondValue,\n handleCommitDate: handleCommitSecondDate,\n } = useDatePicker({\n currentValue: inputSecondValue,\n setInputValue: setInputSecondValue,\n setCalendarValue: setCalendarSecondValue,\n setIsInnerOpen,\n dateFormatDelimiter,\n format,\n disabled,\n readOnly,\n maskWithFormat,\n valueError: secondValueError,\n valueSuccess: secondValueSuccess,\n inputRef: secondInputRef,\n onChangeValue: onChangeSecondValue,\n onCommitDate: onCommitSecondDate,\n });\n\n const handleToggle = (opened: boolean, event: SyntheticEvent | Event) => {\n if (disabled || readOnly) {\n return;\n }\n\n const isCalendarOpen =\n firstInputRef?.current?.contains((event.target as Node) || null) ||\n secondInputRef?.current?.contains((event.target as Node) || null)\n ? true\n : opened;\n\n if (onToggle) {\n return onToggle(isCalendarOpen, event);\n }\n\n setIsInnerOpen(isCalendarOpen);\n };\n\n const RangeComponent = (\n <>\n {/* TODO https://github.com/salute-developers/plasma/issues/1227\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n //@ts-ignore */}\n <StyledRange\n ref={rangeRef}\n dividerIcon={dividerIcon}\n dividerVariant={dividerVariant}\n disabled={disabled}\n readOnly={!disabled && readOnly}\n firstPlaceholder={firstPlaceholder}\n secondPlaceholder={secondPlaceholder}\n contentLeft={contentLeft}\n contentRight={contentRight}\n firstTextfieldTextBefore={firstTextfieldTextBefore}\n secondTextfieldTextBefore={secondTextfieldTextBefore}\n firstTextfieldTextAfter={firstTextfieldTextAfter}\n secondTextfieldTextAfter={secondTextfieldTextAfter}\n firstTextfieldContentLeft={firstTextfieldContentLeft}\n firstTextfieldContentRight={firstTextfieldContentRight}\n secondTextfieldContentLeft={secondTextfieldContentLeft}\n secondTextfieldContentRight={secondTextfieldContentRight}\n firstValue={inputFirstValue}\n secondValue={inputSecondValue}\n firstValueError={firstValueError}\n secondValueError={secondValueError}\n firstValueSuccess={firstValueSuccess}\n secondValueSuccess={secondValueSuccess}\n onChangeFirstValue={handleChangeFirstValue}\n onChangeSecondValue={handleChangeSecondValue}\n onSearchFirstValue={(_, date) => {\n handleCommitFirstDate(String(date), true, false);\n if (!calendarSecondValue || secondValueError) {\n rangeRef?.current?.secondTextField()?.current?.focus();\n }\n }}\n onSearchSecondValue={(_, date) => {\n handleCommitSecondDate(String(date), true, false);\n if (!calendarFirstValue || firstValueError) {\n rangeRef?.current?.firstTextField()?.current?.focus();\n }\n }}\n onFocusFirstTextfield={onFocusFirstTextfield}\n onFocusSecondTextfield={onFocusSecondTextfield}\n onBlurFirstTextfield={onBlurFirstTextfield}\n onBlurSecondTextfield={onBlurSecondTextfield}\n />\n </>\n );\n\n useEffect(() => {\n setFirstInputRef(rangeRef.current?.firstTextField());\n setSecondInputRef(rangeRef.current?.secondTextField());\n }, [rangeRef.current]);\n\n return (\n <Root\n ref={rootRef}\n view={view}\n size={size}\n className={cx(classes.datePickerRoot, className)}\n disabled={disabled}\n readOnly={!disabled && readOnly}\n {...rest}\n >\n {label && <StyledLabel>{label}</StyledLabel>}\n <RangeDatePopover\n calendarValue={[calendarFirstValue, calendarSecondValue]}\n target={RangeComponent}\n isOpen={isOpen || isInnerOpen}\n includeEdgeDates={includeEdgeDates}\n eventList={eventList}\n disabledList={disabledList}\n eventMonthList={eventMonthList}\n disabledMonthList={disabledMonthList}\n eventQuarterList={eventQuarterList}\n disabledQuarterList={disabledQuarterList}\n eventYearList={eventYearList}\n disabledYearList={disabledYearList}\n min={min}\n max={max}\n placement={placement}\n closeOnOverlayClick={closeOnOverlayClick}\n closeOnEsc={closeOnEsc}\n offset={offset}\n type={type}\n onToggle={handleToggle}\n isDoubleCalendar={isDoubleCalendar}\n onChangeStartOfRange={(firstDate, dateInfo) => {\n handleCommitFirstDate(firstDate, false, true, dateInfo);\n handleCommitSecondDate('');\n }}\n onChangeValue={([firstDate, secondDate], dateInfo) => {\n firstDate && handleCommitFirstDate(firstDate, false, true, dateInfo);\n secondDate && handleCommitSecondDate(secondDate, false, true, dateInfo);\n if (firstDate && secondDate && !firstValueError && !secondValueError) {\n setIsInnerOpen(false);\n }\n }}\n />\n {leftHelper && <LeftHelper>{leftHelper}</LeftHelper>}\n </Root>\n );\n },\n );\n\nexport const datePickerRangeConfig = {\n name: 'DatePickerRange',\n tag: 'div',\n layout: datePickerRangeRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n readOnly: {\n css: readOnlyCSS,\n attrs: true,\n },\n },\n defaults: {\n size: 'm',\n view: 'default',\n },\n};\n"],"names":["datePickerRangeRoot","Root","forwardRef","_ref","ref","_rangeRef$current","_rangeRef$current2","className","_ref$isDoubleCalendar","isDoubleCalendar","_ref$isOpen","isOpen","label","leftHelper","contentLeft","contentRight","view","size","_ref$readOnly","readOnly","_ref$disabled","disabled","_ref$dividerVariant","dividerVariant","dividerIcon","_ref$defaultFirstDate","defaultFirstDate","_ref$defaultSecondDat","defaultSecondDate","firstValueError","secondValueError","firstValueSuccess","secondValueSuccess","firstPlaceholder","secondPlaceholder","firstTextfieldContentLeft","firstTextfieldContentRight","secondTextfieldContentLeft","secondTextfieldContentRight","firstTextfieldTextBefore","secondTextfieldTextBefore","firstTextfieldTextAfter","secondTextfieldTextAfter","_ref$format","format","maskWithFormat","min","max","_ref$includeEdgeDates","includeEdgeDates","eventList","disabledList","eventMonthList","disabledMonthList","eventQuarterList","disabledQuarterList","eventYearList","disabledYearList","_ref$type","type","_ref$placement","placement","_ref$closeOnOverlayCl","closeOnOverlayClick","_ref$closeOnEsc","closeOnEsc","offset","onToggle","onChangeFirstValue","onChangeSecondValue","onCommitFirstDate","onCommitSecondDate","onFocusFirstTextfield","onFocusSecondTextfield","onBlurFirstTextfield","onBlurSecondTextfield","rest","_objectWithoutProperties","_excluded","rangeRef","createRef","rootRef","useRef","_useState","useState","current","firstTextField","_useState2","_slicedToArray","firstInputRef","setFirstInputRef","_useState3","secondTextField","_useState4","secondInputRef","setSecondInputRef","_useState5","_useState6","isInnerOpen","setIsInnerOpen","_useState7","formatCalendarValue","_useState8","calendarFirstValue","setCalendarFirstValue","_useState9","formatInputValue","_useState10","inputFirstValue","setInputFirstValue","_useState11","_useState12","calendarSecondValue","setCalendarSecondValue","_useState13","_useState14","inputSecondValue","setInputSecondValue","dateFormatDelimiter","useCallback","getDateFormatDelimiter","_useDatePicker","useDatePicker","currentValue","setInputValue","setCalendarValue","valueError","valueSuccess","inputRef","onChangeValue","onCommitDate","handleChangeFirstValue","handleChangeValue","handleCommitFirstDate","handleCommitDate","_useDatePicker2","handleChangeSecondValue","handleCommitSecondDate","handleToggle","opened","event","_firstInputRef$curren","_secondInputRef$curre","isCalendarOpen","contains","target","RangeComponent","React","createElement","Fragment","StyledRange","firstValue","secondValue","onSearchFirstValue","_","date","String","_rangeRef$current3","focus","onSearchSecondValue","_rangeRef$current4","useEffect","_rangeRef$current5","_rangeRef$current6","_extends","cx","classes","datePickerRoot","StyledLabel","RangeDatePopover","calendarValue","onChangeStartOfRange","firstDate","dateInfo","_ref2","_ref3","secondDate","LeftHelper","datePickerRangeConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","disabledCSS","attrs","readOnlyCSS","defaults"],"mappings":";;;;;;;;;;;;;;IA0BaA,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAC5BC,IAAwG,EAAA;AAAA,EAAA,oBAExGC,UAAU,CACN,UAAAC,IAAA,EAuEIC,GAAG,EACF;IAAA,IAAAC,iBAAA,EAAAC,kBAAA,CAAA;AAAA,IAAA,IAtEGC,SAAS,GAAAJ,IAAA,CAATI,SAAS;MAAAC,qBAAA,GAAAL,IAAA,CAETM,gBAAgB;AAAhBA,MAAAA,gBAAgB,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,q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ACVC,EAAAA,MAAM,EAAErL,mBAAmB;AAC3BsL,EAAAA,IAAI,EAAJA,IAAI;AACJC,EAAAA,UAAU,EAAE;AACRvK,IAAAA,IAAI,EAAE;AACFwK,MAAAA,GAAG,EAAEC,MAAAA;KACR;AACDxK,IAAAA,IAAI,EAAE;AACFuK,MAAAA,GAAG,EAAEE,MAAAA;KACR;AACDrK,IAAAA,QAAQ,EAAE;AACNmK,MAAAA,GAAG,EAAEG,MAAW;AAChBC,MAAAA,KAAK,EAAE,IAAA;KACV;AACDzK,IAAAA,QAAQ,EAAE;AACNqK,MAAAA,GAAG,EAAEK,MAAW;AAChBD,MAAAA,KAAK,EAAE,IAAA;AACX,KAAA;GACH;AACDE,EAAAA,QAAQ,EAAE;AACN7K,IAAAA,IAAI,EAAE,GAAG;AACTD,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;"}
1
+ {"version":3,"file":"RangeDate.js","sources":["../../../../src/components/DatePicker/RangeDate/RangeDate.tsx"],"sourcesContent":["import React, {\n MutableRefObject,\n SyntheticEvent,\n createRef,\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport type { RootProps } from '../../../engines';\nimport { cx } from '../../../utils';\nimport { formatCalendarValue, formatInputValue, getDateFormatDelimiter } from '../utils/dateHelper';\nimport { useDatePicker } from '../hooks/useDatePicker';\nimport type { RangeInputRefs } from '../../Range/Range.types';\nimport { classes } from '../DatePicker.tokens';\nimport { useKeyNavigation } from '../hooks/useKeyboardNavigation';\n\nimport type { DatePickerRangeProps } from './RangeDate.types';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as readOnlyCSS } from './variations/_readonly/base';\nimport { LeftHelper, StyledLabel, StyledRange, base } from './RangeDate.styles';\nimport { RangeDatePopover } from './RangeDatePopover/RangeDatePopover';\n\nexport const datePickerRangeRoot = (\n Root: RootProps<HTMLDivElement, Omit<DatePickerRangeProps, 'isOpen' | 'defaultValue' | 'onChangeValue'>>,\n) =>\n forwardRef<RangeInputRefs, DatePickerRangeProps>(\n (\n {\n className,\n\n isDoubleCalendar = false,\n isOpen = false,\n\n label,\n leftHelper,\n contentLeft,\n contentRight,\n view,\n size,\n readOnly = false,\n disabled = false,\n\n dividerVariant = 'dash',\n dividerIcon,\n\n defaultFirstDate = '',\n defaultSecondDate = '',\n firstValueError,\n secondValueError,\n firstValueSuccess,\n secondValueSuccess,\n firstPlaceholder,\n secondPlaceholder,\n firstTextfieldContentLeft,\n firstTextfieldContentRight,\n secondTextfieldContentLeft,\n secondTextfieldContentRight,\n firstTextfieldTextBefore,\n secondTextfieldTextBefore,\n firstTextfieldTextAfter,\n secondTextfieldTextAfter,\n\n format = 'DD.MM.YYYY',\n maskWithFormat,\n min,\n max,\n includeEdgeDates = false,\n eventList,\n disabledList,\n eventMonthList,\n disabledMonthList,\n eventQuarterList,\n disabledQuarterList,\n eventYearList,\n disabledYearList,\n type = 'Days',\n\n placement = ['top', 'bottom'],\n closeOnOverlayClick = true,\n closeOnEsc = true,\n offset,\n\n onToggle,\n\n onChangeFirstValue,\n onChangeSecondValue,\n\n onCommitFirstDate,\n onCommitSecondDate,\n\n onFocusFirstTextfield,\n onFocusSecondTextfield,\n onBlurFirstTextfield,\n onBlurSecondTextfield,\n\n ...rest\n },\n ref,\n ) => {\n const rangeRef = ref && 'current' in ref ? ref : createRef<RangeInputRefs>();\n const rootRef = useRef<HTMLDivElement | null>(null);\n\n const [firstInputRef, setFirstInputRef] = useState<MutableRefObject<HTMLInputElement | null> | undefined>(\n rangeRef?.current?.firstTextField(),\n );\n const [secondInputRef, setSecondInputRef] = useState<MutableRefObject<HTMLInputElement | null> | undefined>(\n rangeRef?.current?.secondTextField(),\n );\n const [isInnerOpen, setIsInnerOpen] = useState(isOpen);\n\n const [calendarFirstValue, setCalendarFirstValue] = useState(formatCalendarValue(defaultFirstDate, format));\n const [inputFirstValue, setInputFirstValue] = useState(formatInputValue(defaultFirstDate, format));\n\n const [calendarSecondValue, setCalendarSecondValue] = useState(\n formatCalendarValue(defaultSecondDate, format),\n );\n const [inputSecondValue, setInputSecondValue] = useState(formatInputValue(defaultSecondDate, format));\n\n const dateFormatDelimiter = useCallback(() => getDateFormatDelimiter(format), [format]);\n\n const {\n handleChangeValue: handleChangeFirstValue,\n handleCommitDate: handleCommitFirstDate,\n } = useDatePicker({\n currentValue: inputFirstValue,\n setInputValue: setInputFirstValue,\n setCalendarValue: setCalendarFirstValue,\n setIsInnerOpen,\n dateFormatDelimiter,\n format,\n disabled,\n readOnly,\n maskWithFormat,\n valueError: firstValueError,\n valueSuccess: firstValueSuccess,\n inputRef: firstInputRef,\n onChangeValue: onChangeFirstValue,\n onCommitDate: onCommitFirstDate,\n });\n\n const {\n handleChangeValue: handleChangeSecondValue,\n handleCommitDate: handleCommitSecondDate,\n } = useDatePicker({\n currentValue: inputSecondValue,\n setInputValue: setInputSecondValue,\n setCalendarValue: setCalendarSecondValue,\n setIsInnerOpen,\n dateFormatDelimiter,\n format,\n disabled,\n readOnly,\n maskWithFormat,\n valueError: secondValueError,\n valueSuccess: secondValueSuccess,\n inputRef: secondInputRef,\n onChangeValue: onChangeSecondValue,\n onCommitDate: onCommitSecondDate,\n });\n\n const handleToggle = (opened: boolean, event: SyntheticEvent | Event) => {\n if (disabled || readOnly) {\n return;\n }\n\n const isCalendarOpen =\n firstInputRef?.current?.contains((event.target as Node) || null) ||\n secondInputRef?.current?.contains((event.target as Node) || null)\n ? true\n : opened;\n\n if (onToggle) {\n return onToggle(isCalendarOpen, event);\n }\n\n setIsInnerOpen(isCalendarOpen);\n };\n\n const { onKeyDown } = useKeyNavigation({\n isCalendarOpen: isInnerOpen,\n onToggle: handleToggle,\n });\n\n const RangeComponent = (\n <>\n {/* TODO https://github.com/salute-developers/plasma/issues/1227\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n //@ts-ignore */}\n <StyledRange\n ref={rangeRef}\n dividerIcon={dividerIcon}\n dividerVariant={dividerVariant}\n disabled={disabled}\n readOnly={!disabled && readOnly}\n firstPlaceholder={firstPlaceholder}\n secondPlaceholder={secondPlaceholder}\n contentLeft={contentLeft}\n contentRight={contentRight}\n firstTextfieldTextBefore={firstTextfieldTextBefore}\n secondTextfieldTextBefore={secondTextfieldTextBefore}\n firstTextfieldTextAfter={firstTextfieldTextAfter}\n secondTextfieldTextAfter={secondTextfieldTextAfter}\n firstTextfieldContentLeft={firstTextfieldContentLeft}\n firstTextfieldContentRight={firstTextfieldContentRight}\n secondTextfieldContentLeft={secondTextfieldContentLeft}\n secondTextfieldContentRight={secondTextfieldContentRight}\n firstValue={inputFirstValue}\n secondValue={inputSecondValue}\n firstValueError={firstValueError}\n secondValueError={secondValueError}\n firstValueSuccess={firstValueSuccess}\n secondValueSuccess={secondValueSuccess}\n onChangeFirstValue={handleChangeFirstValue}\n onChangeSecondValue={handleChangeSecondValue}\n onSearchFirstValue={(_, date) => {\n handleCommitFirstDate(String(date), true, false);\n if (!calendarSecondValue || secondValueError) {\n rangeRef?.current?.secondTextField()?.current?.focus();\n }\n }}\n onSearchSecondValue={(_, date) => {\n handleCommitSecondDate(String(date), true, false);\n if (!calendarFirstValue || firstValueError) {\n rangeRef?.current?.firstTextField()?.current?.focus();\n }\n }}\n onFocusFirstTextfield={onFocusFirstTextfield}\n onFocusSecondTextfield={onFocusSecondTextfield}\n onBlurFirstTextfield={onBlurFirstTextfield}\n onBlurSecondTextfield={onBlurSecondTextfield}\n onKeyDown={onKeyDown}\n />\n </>\n );\n\n useEffect(() => {\n setFirstInputRef(rangeRef.current?.firstTextField());\n setSecondInputRef(rangeRef.current?.secondTextField());\n }, [rangeRef.current]);\n\n useEffect(() => {\n setIsInnerOpen((prevOpen) => prevOpen !== isOpen && isOpen);\n }, [isOpen]);\n\n return (\n <Root\n ref={rootRef}\n view={view}\n size={size}\n className={cx(classes.datePickerRoot, className)}\n disabled={disabled}\n readOnly={!disabled && readOnly}\n {...rest}\n >\n {label && <StyledLabel>{label}</StyledLabel>}\n <RangeDatePopover\n calendarValue={[calendarFirstValue, calendarSecondValue]}\n target={RangeComponent}\n isOpen={isInnerOpen}\n includeEdgeDates={includeEdgeDates}\n eventList={eventList}\n disabledList={disabledList}\n eventMonthList={eventMonthList}\n disabledMonthList={disabledMonthList}\n eventQuarterList={eventQuarterList}\n disabledQuarterList={disabledQuarterList}\n eventYearList={eventYearList}\n disabledYearList={disabledYearList}\n min={min}\n max={max}\n placement={placement}\n closeOnOverlayClick={closeOnOverlayClick}\n closeOnEsc={closeOnEsc}\n offset={offset}\n type={type}\n onToggle={handleToggle}\n isDoubleCalendar={isDoubleCalendar}\n onChangeStartOfRange={(firstDate, dateInfo) => {\n handleCommitFirstDate(firstDate, false, true, dateInfo);\n handleCommitSecondDate('');\n }}\n onChangeValue={([firstDate, secondDate], dateInfo) => {\n firstDate && handleCommitFirstDate(firstDate, false, true, dateInfo);\n secondDate && handleCommitSecondDate(secondDate, false, true, dateInfo);\n if (firstDate && secondDate && !firstValueError && !secondValueError) {\n setIsInnerOpen(false);\n }\n }}\n />\n {leftHelper && <LeftHelper>{leftHelper}</LeftHelper>}\n </Root>\n );\n },\n );\n\nexport const datePickerRangeConfig = {\n name: 'DatePickerRange',\n tag: 'div',\n layout: datePickerRangeRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n readOnly: {\n css: readOnlyCSS,\n attrs: true,\n },\n },\n defaults: {\n size: 'm',\n view: 'default',\n },\n};\n"],"names":["datePickerRangeRoot","Root","forwardRef","_ref","ref","_rangeRef$current","_rangeRef$current2","className","_ref$isDoubleCalendar","isDoubleCalendar","_ref$isOpen","isOpen","label","leftHelper","contentLeft","contentRight","view","size","_ref$readOnly","readOnly","_ref$disabled","disabled","_ref$dividerVariant","dividerVariant","dividerIcon","_ref$defaultFirstDate","defaultFirstDate","_ref$defaultSecondDat","defaultSecondDate","firstValueError","secondValueError","firstValueSuccess","secondValueSuccess","firstPlaceholder","secondPlaceholder","firstTextfieldContentLeft","firstTextfieldContentRight","secondTextfieldContentLeft","secondTextfieldContentRight","firstTextfieldTextBefore","secondTextfieldTextBefore","firstTextfieldTextAfter","secondTextfieldTextAfter","_ref$format","format","maskWithFormat","min","max","_ref$includeEdgeDates","includeEdgeDates","eventList","disabledList","eventMonthList","disabledMonthList","eventQuarterList","disabledQuarterList","eventYearList","disabledYearList","_ref$type","type","_ref$placement","placement","_ref$closeOnOverlayCl","closeOnOverlayClick","_ref$closeOnEsc","closeOnEsc","offset","onToggle","onChangeFirstValue","onChangeSecondValue","onCommitFirstDate","onCommitSecondDate","onFocusFirstTextfield","onFocusSecondTextfield","onBlurFirstTextfield","onBlurSecondTextfield","rest","_objectWithoutProperties","_excluded","rangeRef","createRef","rootRef","useRef","_useState","useState","current","firstTextField","_useState2","_slicedToArray","firstInputRef","setFirstInputRef","_useState3","secondTextField","_useState4","secondInputRef","setSecondInputRef","_useState5","_useState6","isInnerOpen","setIsInnerOpen","_useState7","formatCalendarValue","_useState8","calendarFirstValue","setCalendarFirstValue","_useState9","formatInputValue","_useState10","inputFirstValue","setInputFirstValue","_useState11","_useState12","calendarSecondValue","setCalendarSecondValue","_useState13","_useState14","inputSecondValue","setInputSecondValue","dateFormatDelimiter","useCallback","getDateFormatDelimiter","_useDatePicker","useDatePicker","currentValue","setInputValue","setCalendarValue","valueError","valueSuccess","inputRef","onChangeValue","onCommitDate","handleChangeFirstValue","handleChangeValue","handleCommitFirstDate","handleCommitDate","_useDatePicker2","handleChangeSecondValue","handleCommitSecondDate","handleToggle","opened","event","_firstInputRef$curren","_secondInputRef$curre","isCalendarOpen","contains","target","_useKeyNavigation","useKeyNavigation","onKeyDown","RangeComponent","React","createElement","Fragment","StyledRange","firstValue","secondValue","onSearchFirstValue","_","date","String","_rangeRef$current3","focus","onSearchSecondValue","_rangeRef$current4","useEffect","_rangeRef$current5","_rangeRef$current6","prevOpen","_extends","cx","classes","datePickerRoot","StyledLabel","RangeDatePopover","calendarValue","onChangeStartOfRange","firstDate","dateInfo","_ref2","_ref3","secondDate","LeftHelper","datePickerRangeConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","disabledCSS","attrs","readOnlyCSS","defaults"],"mappings":";;;;;;;;;;;;;;;IA2BaA,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAC5BC,IAAwG,EAAA;AAAA,EAAA,oBAExGC,UAAU,CACN,UAAAC,IAAA,EAuEIC,GAAG,EACF;IAAA,IAAAC,iBAAA,EAAAC,kBAAA,CAAA;AAAA,IAAA,IAtEGC,SAAS,GAAAJ,IAAA,CAATI,SAAS;MAAAC,qBAAA,GAAAL,IAAA,CAETM,gBAAgB;AAAhBA,MAAAA,gBAAgB,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,qBAAA;MAAAE,WAAA,GAAAP,IAAA,CACxBQ,MAAM;AAANA,MAAAA,MAAM,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,WAAA;MAEdE,KAAK,GAAAT,IAAA,CAALS,KAAK;MACLC,UAAU,GAAAV,IAAA,CAAVU,UAAU;MACVC,WAAW,GAAAX,IAAA,CAAXW,WAAW;MACXC,YAAY,GAAAZ,IAAA,CAAZY,YAAY;MACZC,IAAI,GAAAb,IAAA,CAAJa,IAAI;MACJC,IAAI,GAAAd,IAAA,CAAJc,IAAI;MAAAC,aAAA,GAAAf,IAAA,CACJgB,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,aAAA;MAAAE,aAAA,GAAAjB,IAAA,CAChBkB,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,aAAA;MAAAE,mBAAA,GAAAnB,IAAA,CAEhBoB,cAAc;AAAdA,MAAAA,cAAc,GAAAD,mBAAA,KAAG,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