@salutejs/plasma-new-hope 0.340.0-canary.2314.18974837629.0 → 0.340.0-canary.2314.19043398713.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/Combobox/ComboboxNew/Combobox.js +20 -4
 - package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
 - package/cjs/components/Combobox/ComboboxNew/hooks/useKeyboardNavigation.js +319 -1
 - package/cjs/components/Combobox/ComboboxNew/hooks/useKeyboardNavigation.js.map +1 -1
 - package/cjs/components/Combobox/ComboboxNew/reducers/focusedPathReducer.js +7 -0
 - package/cjs/components/Combobox/ComboboxNew/reducers/focusedPathReducer.js.map +1 -1
 - package/cjs/components/Combobox/ComboboxNew/reducers/treePathReducer.js +14 -2
 - package/cjs/components/Combobox/ComboboxNew/reducers/treePathReducer.js.map +1 -1
 - package/cjs/components/Combobox/ComboboxNew/ui/TreeList/TreeList.js +3 -3
 - package/cjs/components/Combobox/ComboboxNew/ui/TreeList/TreeList.js.map +1 -1
 - package/cjs/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.js +22 -5
 - package/cjs/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.js.map +1 -1
 - package/cjs/components/Select/Select.js +2 -1
 - package/cjs/components/Select/Select.js.map +1 -1
 - package/cjs/components/Select/hooks/useKeyboardNavigation.js +127 -38
 - package/cjs/components/Select/hooks/useKeyboardNavigation.js.map +1 -1
 - package/cjs/components/Select/reducers/focusedPathReducer.js +7 -0
 - package/cjs/components/Select/reducers/focusedPathReducer.js.map +1 -1
 - package/cjs/components/Select/reducers/treePathReducer.js +12 -0
 - package/cjs/components/Select/reducers/treePathReducer.js.map +1 -1
 - package/cjs/components/Select/ui/TreeList/TreeList.js +3 -3
 - package/cjs/components/Select/ui/TreeList/TreeList.js.map +1 -1
 - package/cjs/components/Select/ui/TreeList/ui/Item/Item.js +22 -5
 - package/cjs/components/Select/ui/TreeList/ui/Item/Item.js.map +1 -1
 - package/cjs/index.js +2 -0
 - package/cjs/index.js.map +1 -1
 - package/cjs/utils/index.js.map +1 -1
 - package/cjs/utils/isArraysEqual.js +12 -0
 - package/cjs/utils/isArraysEqual.js.map +1 -0
 - package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +16 -3
 - package/emotion/cjs/components/Combobox/ComboboxNew/hooks/useKeyboardNavigation.js +312 -0
 - package/emotion/cjs/components/Combobox/ComboboxNew/reducers/focusedPathReducer.js +7 -0
 - package/emotion/cjs/components/Combobox/ComboboxNew/reducers/treePathReducer.js +14 -2
 - package/emotion/cjs/components/Combobox/ComboboxNew/ui/TreeList/TreeList.js +7 -3
 - package/emotion/cjs/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.js +49 -5
 - package/emotion/cjs/components/Select/Select.js +2 -1
 - package/emotion/cjs/components/Select/hooks/useKeyboardNavigation.js +156 -44
 - package/emotion/cjs/components/Select/reducers/focusedPathReducer.js +7 -0
 - package/emotion/cjs/components/Select/reducers/treePathReducer.js +12 -0
 - package/emotion/cjs/components/Select/ui/TreeList/TreeList.js +7 -3
 - package/emotion/cjs/components/Select/ui/TreeList/ui/Item/Item.js +49 -5
 - package/emotion/cjs/utils/index.js +4 -0
 - package/emotion/cjs/utils/isArraysEqual.js +15 -0
 - package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +16 -3
 - package/emotion/es/components/Combobox/ComboboxNew/hooks/useKeyboardNavigation.js +313 -0
 - package/emotion/es/components/Combobox/ComboboxNew/reducers/focusedPathReducer.js +7 -0
 - package/emotion/es/components/Combobox/ComboboxNew/reducers/treePathReducer.js +14 -2
 - package/emotion/es/components/Combobox/ComboboxNew/ui/TreeList/TreeList.js +7 -3
 - package/emotion/es/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.js +50 -6
 - package/emotion/es/components/Select/Select.js +2 -1
 - package/emotion/es/components/Select/hooks/useKeyboardNavigation.js +157 -44
 - package/emotion/es/components/Select/reducers/focusedPathReducer.js +7 -0
 - package/emotion/es/components/Select/reducers/treePathReducer.js +12 -0
 - package/emotion/es/components/Select/ui/TreeList/TreeList.js +7 -3
 - package/emotion/es/components/Select/ui/TreeList/ui/Item/Item.js +50 -6
 - package/emotion/es/utils/index.js +1 -0
 - package/emotion/es/utils/isArraysEqual.js +5 -0
 - package/es/components/Combobox/ComboboxNew/Combobox.js +20 -4
 - package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
 - package/es/components/Combobox/ComboboxNew/hooks/useKeyboardNavigation.js +319 -1
 - package/es/components/Combobox/ComboboxNew/hooks/useKeyboardNavigation.js.map +1 -1
 - package/es/components/Combobox/ComboboxNew/reducers/focusedPathReducer.js +7 -0
 - package/es/components/Combobox/ComboboxNew/reducers/focusedPathReducer.js.map +1 -1
 - package/es/components/Combobox/ComboboxNew/reducers/treePathReducer.js +14 -2
 - package/es/components/Combobox/ComboboxNew/reducers/treePathReducer.js.map +1 -1
 - package/es/components/Combobox/ComboboxNew/ui/TreeList/TreeList.js +3 -3
 - package/es/components/Combobox/ComboboxNew/ui/TreeList/TreeList.js.map +1 -1
 - package/es/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.js +23 -6
 - package/es/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.js.map +1 -1
 - package/es/components/Select/Select.js +2 -1
 - package/es/components/Select/Select.js.map +1 -1
 - package/es/components/Select/hooks/useKeyboardNavigation.js +127 -38
 - package/es/components/Select/hooks/useKeyboardNavigation.js.map +1 -1
 - package/es/components/Select/reducers/focusedPathReducer.js +7 -0
 - package/es/components/Select/reducers/focusedPathReducer.js.map +1 -1
 - package/es/components/Select/reducers/treePathReducer.js +12 -0
 - package/es/components/Select/reducers/treePathReducer.js.map +1 -1
 - package/es/components/Select/ui/TreeList/TreeList.js +3 -3
 - package/es/components/Select/ui/TreeList/TreeList.js.map +1 -1
 - package/es/components/Select/ui/TreeList/ui/Item/Item.js +23 -6
 - package/es/components/Select/ui/TreeList/ui/Item/Item.js.map +1 -1
 - package/es/index.js +1 -0
 - package/es/index.js.map +1 -1
 - package/es/utils/index.js.map +1 -1
 - package/es/utils/isArraysEqual.js +8 -0
 - package/es/utils/isArraysEqual.js.map +1 -0
 - package/package.json +2 -2
 - package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +16 -3
 - package/styled-components/cjs/components/Combobox/ComboboxNew/hooks/useKeyboardNavigation.js +312 -0
 - package/styled-components/cjs/components/Combobox/ComboboxNew/reducers/focusedPathReducer.js +7 -0
 - package/styled-components/cjs/components/Combobox/ComboboxNew/reducers/treePathReducer.js +14 -2
 - package/styled-components/cjs/components/Combobox/ComboboxNew/ui/TreeList/TreeList.js +7 -3
 - package/styled-components/cjs/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.js +49 -5
 - package/styled-components/cjs/components/Select/Select.js +2 -1
 - package/styled-components/cjs/components/Select/hooks/useKeyboardNavigation.js +156 -44
 - package/styled-components/cjs/components/Select/reducers/focusedPathReducer.js +7 -0
 - package/styled-components/cjs/components/Select/reducers/treePathReducer.js +12 -0
 - package/styled-components/cjs/components/Select/ui/TreeList/TreeList.js +7 -3
 - package/styled-components/cjs/components/Select/ui/TreeList/ui/Item/Item.js +49 -5
 - package/styled-components/cjs/utils/index.js +4 -0
 - package/styled-components/cjs/utils/isArraysEqual.js +15 -0
 - package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +16 -3
 - package/styled-components/es/components/Combobox/ComboboxNew/hooks/useKeyboardNavigation.js +313 -0
 - package/styled-components/es/components/Combobox/ComboboxNew/reducers/focusedPathReducer.js +7 -0
 - package/styled-components/es/components/Combobox/ComboboxNew/reducers/treePathReducer.js +14 -2
 - package/styled-components/es/components/Combobox/ComboboxNew/ui/TreeList/TreeList.js +7 -3
 - package/styled-components/es/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.js +50 -6
 - package/styled-components/es/components/Select/Select.js +2 -1
 - package/styled-components/es/components/Select/hooks/useKeyboardNavigation.js +157 -44
 - package/styled-components/es/components/Select/reducers/focusedPathReducer.js +7 -0
 - package/styled-components/es/components/Select/reducers/treePathReducer.js +12 -0
 - package/styled-components/es/components/Select/ui/TreeList/TreeList.js +7 -3
 - package/styled-components/es/components/Select/ui/TreeList/ui/Item/Item.js +50 -6
 - package/styled-components/es/examples/components/Combobox/Combobox.js +0 -7
 - package/styled-components/es/utils/index.js +1 -0
 - package/styled-components/es/utils/isArraysEqual.js +5 -0
 - package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
 - package/types/components/Combobox/ComboboxNew/hooks/useKeyboardNavigation.d.ts +7 -2
 - package/types/components/Combobox/ComboboxNew/hooks/useKeyboardNavigation.d.ts.map +1 -1
 - package/types/components/Combobox/ComboboxNew/reducers/focusedPathReducer.d.ts +3 -0
 - package/types/components/Combobox/ComboboxNew/reducers/focusedPathReducer.d.ts.map +1 -1
 - package/types/components/Combobox/ComboboxNew/reducers/treePathReducer.d.ts +6 -0
 - package/types/components/Combobox/ComboboxNew/reducers/treePathReducer.d.ts.map +1 -1
 - package/types/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.d.ts.map +1 -1
 - package/types/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.types.d.ts +1 -1
 - package/types/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.types.d.ts.map +1 -1
 - package/types/components/Select/Select.d.ts.map +1 -1
 - package/types/components/Select/hooks/useKeyboardNavigation.d.ts +2 -1
 - package/types/components/Select/hooks/useKeyboardNavigation.d.ts.map +1 -1
 - package/types/components/Select/reducers/focusedPathReducer.d.ts +3 -0
 - package/types/components/Select/reducers/focusedPathReducer.d.ts.map +1 -1
 - package/types/components/Select/reducers/treePathReducer.d.ts +6 -0
 - package/types/components/Select/reducers/treePathReducer.d.ts.map +1 -1
 - package/types/components/Select/ui/TreeList/ui/Item/Item.d.ts.map +1 -1
 - package/types/components/Select/ui/TreeList/ui/Item/Item.types.d.ts +1 -1
 - package/types/components/Select/ui/TreeList/ui/Item/Item.types.d.ts.map +1 -1
 - package/types/utils/index.d.ts +1 -0
 - package/types/utils/index.d.ts.map +1 -1
 - package/types/utils/isArraysEqual.d.ts +2 -0
 - package/types/utils/isArraysEqual.d.ts.map +1 -0
 
| 
         @@ -2,6 +2,7 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            Object.defineProperty(exports, '__esModule', { value: true });
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
      
 5 
     | 
    
         
            +
            var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
         
     | 
| 
       5 
6 
     | 
    
         
             
            var treePathReducer = require('../reducers/treePathReducer.js');
         
     | 
| 
       6 
7 
     | 
    
         | 
| 
       7 
8 
     | 
    
         
             
            var JUMP_SIZE = 10;
         
     | 
| 
         @@ -26,6 +27,7 @@ var getItemByFocused = function getItemByFocused(focusedPath, focusedToValueMap) 
     | 
|
| 
       26 
27 
     | 
    
         
             
              }, '').replace(/^(\/)/, '');
         
     | 
| 
       27 
28 
     | 
    
         
             
              return focusedToValueMap.get(focusedPathAsString);
         
     | 
| 
       28 
29 
     | 
    
         
             
            };
         
     | 
| 
      
 30 
     | 
    
         
            +
            // #TODO: подумать над идеей выноса логики фокуса непосредственно в focusedPathReducer.
         
     | 
| 
       29 
31 
     | 
    
         
             
            var useKeyNavigation = function useKeyNavigation(_ref) {
         
     | 
| 
       30 
32 
     | 
    
         
             
              var focusedPath = _ref.focusedPath,
         
     | 
| 
       31 
33 
     | 
    
         
             
                dispatchFocusedPath = _ref.dispatchFocusedPath,
         
     | 
| 
         @@ -38,7 +40,8 @@ var useKeyNavigation = function useKeyNavigation(_ref) { 
     | 
|
| 
       38 
40 
     | 
    
         
             
                treePath = _ref.treePath,
         
     | 
| 
       39 
41 
     | 
    
         
             
                dispatchTreePath = _ref.dispatchTreePath,
         
     | 
| 
       40 
42 
     | 
    
         
             
                treeView = _ref.treeView,
         
     | 
| 
       41 
     | 
    
         
            -
                valueToPathMap = _ref.valueToPathMap 
     | 
| 
      
 43 
     | 
    
         
            +
                valueToPathMap = _ref.valueToPathMap,
         
     | 
| 
      
 44 
     | 
    
         
            +
                items = _ref.items;
         
     | 
| 
       42 
45 
     | 
    
         
             
              if (treeView) {
         
     | 
| 
       43 
46 
     | 
    
         
             
                return keyboardNavigationTree({
         
     | 
| 
       44 
47 
     | 
    
         
             
                  focusedPath: focusedPath,
         
     | 
| 
         @@ -52,7 +55,8 @@ var useKeyNavigation = function useKeyNavigation(_ref) { 
     | 
|
| 
       52 
55 
     | 
    
         
             
                  treePath: treePath,
         
     | 
| 
       53 
56 
     | 
    
         
             
                  dispatchTreePath: dispatchTreePath,
         
     | 
| 
       54 
57 
     | 
    
         
             
                  treeView: treeView,
         
     | 
| 
       55 
     | 
    
         
            -
                  valueToPathMap: valueToPathMap
         
     | 
| 
      
 58 
     | 
    
         
            +
                  valueToPathMap: valueToPathMap,
         
     | 
| 
      
 59 
     | 
    
         
            +
                  items: items
         
     | 
| 
       56 
60 
     | 
    
         
             
                });
         
     | 
| 
       57 
61 
     | 
    
         
             
              }
         
     | 
| 
       58 
62 
     | 
    
         
             
              return keyboardNavigationDefault({
         
     | 
| 
         @@ -67,7 +71,8 @@ var useKeyNavigation = function useKeyNavigation(_ref) { 
     | 
|
| 
       67 
71 
     | 
    
         
             
                treePath: treePath,
         
     | 
| 
       68 
72 
     | 
    
         
             
                dispatchTreePath: dispatchTreePath,
         
     | 
| 
       69 
73 
     | 
    
         
             
                treeView: treeView,
         
     | 
| 
       70 
     | 
    
         
            -
                valueToPathMap: valueToPathMap
         
     | 
| 
      
 74 
     | 
    
         
            +
                valueToPathMap: valueToPathMap,
         
     | 
| 
      
 75 
     | 
    
         
            +
                items: items
         
     | 
| 
       71 
76 
     | 
    
         
             
              });
         
     | 
| 
       72 
77 
     | 
    
         
             
            };
         
     | 
| 
       73 
78 
     | 
    
         
             
            var keyboardNavigationDefault = function keyboardNavigationDefault(_ref2) {
         
     | 
| 
         @@ -350,22 +355,76 @@ var keyboardNavigationTree = function keyboardNavigationTree(_ref3) { 
     | 
|
| 
       350 
355 
     | 
    
         
             
                handlePressDown = _ref3.handlePressDown,
         
     | 
| 
       351 
356 
     | 
    
         
             
                treePath = _ref3.treePath,
         
     | 
| 
       352 
357 
     | 
    
         
             
                dispatchTreePath = _ref3.dispatchTreePath,
         
     | 
| 
       353 
     | 
    
         
            -
                valueToPathMap = _ref3.valueToPathMap 
     | 
| 
       354 
     | 
    
         
            -
             
     | 
| 
      
 358 
     | 
    
         
            +
                valueToPathMap = _ref3.valueToPathMap,
         
     | 
| 
      
 359 
     | 
    
         
            +
                items = _ref3.items;
         
     | 
| 
       355 
360 
     | 
    
         
             
              var currentItem = getItemByFocused(focusedPath, focusedToValueMap);
         
     | 
| 
      
 361 
     | 
    
         
            +
              var currentIndex = (focusedPath === null || focusedPath === void 0 ? void 0 : focusedPath[focusedPath.length - 1]) || 0;
         
     | 
| 
       356 
362 
     | 
    
         
             
              var currentLength = (currentItem === null || currentItem === void 0 || (_currentItem$parent = currentItem.parent) === null || _currentItem$parent === void 0 || (_currentItem$parent = _currentItem$parent.items) === null || _currentItem$parent === void 0 ? void 0 : _currentItem$parent.length) || pathMap.get('root') || 0;
         
     | 
| 
      
 363 
     | 
    
         
            +
              var isValidFocus = function isValidFocus(focusCandidate) {
         
     | 
| 
      
 364 
     | 
    
         
            +
                if (!Array.isArray(items) || !Array.isArray(focusCandidate)) return false;
         
     | 
| 
      
 365 
     | 
    
         
            +
                var currentLevel = items;
         
     | 
| 
      
 366 
     | 
    
         
            +
                var _iterator = _rollupPluginBabelHelpers.createForOfIteratorHelper(focusCandidate),
         
     | 
| 
      
 367 
     | 
    
         
            +
                  _step;
         
     | 
| 
      
 368 
     | 
    
         
            +
                try {
         
     | 
| 
      
 369 
     | 
    
         
            +
                  for (_iterator.s(); !(_step = _iterator.n()).done;) {
         
     | 
| 
      
 370 
     | 
    
         
            +
                    var index = _step.value;
         
     | 
| 
      
 371 
     | 
    
         
            +
                    if (!Array.isArray(currentLevel) || index >= currentLevel.length) {
         
     | 
| 
      
 372 
     | 
    
         
            +
                      return false;
         
     | 
| 
      
 373 
     | 
    
         
            +
                    }
         
     | 
| 
      
 374 
     | 
    
         
            +
                    var node = currentLevel[index];
         
     | 
| 
      
 375 
     | 
    
         
            +
                    currentLevel = node.items || [];
         
     | 
| 
      
 376 
     | 
    
         
            +
                  }
         
     | 
| 
      
 377 
     | 
    
         
            +
                } catch (err) {
         
     | 
| 
      
 378 
     | 
    
         
            +
                  _iterator.e(err);
         
     | 
| 
      
 379 
     | 
    
         
            +
                } finally {
         
     | 
| 
      
 380 
     | 
    
         
            +
                  _iterator.f();
         
     | 
| 
      
 381 
     | 
    
         
            +
                }
         
     | 
| 
      
 382 
     | 
    
         
            +
                return true;
         
     | 
| 
      
 383 
     | 
    
         
            +
              };
         
     | 
| 
       357 
384 
     | 
    
         
             
              var onKeyDown = function onKeyDown(event) {
         
     | 
| 
       358 
385 
     | 
    
         
             
                switch (event.code) {
         
     | 
| 
       359 
386 
     | 
    
         
             
                  case keys.ArrowUp:
         
     | 
| 
       360 
387 
     | 
    
         
             
                    {
         
     | 
| 
      
 388 
     | 
    
         
            +
                      /**
         
     | 
| 
      
 389 
     | 
    
         
            +
                       * Если список открыт и фокус уже установлен на каком-либо элементе.
         
     | 
| 
      
 390 
     | 
    
         
            +
                       * */
         
     | 
| 
       361 
391 
     | 
    
         
             
                      if (focusedPath.length) {
         
     | 
| 
      
 392 
     | 
    
         
            +
                        /**
         
     | 
| 
      
 393 
     | 
    
         
            +
                         * Если это не первый элемент, то нужно вначале найти элемент для фокуса.
         
     | 
| 
      
 394 
     | 
    
         
            +
                         * Т.к. если верхний элемент раскрыт, то и перемещаться нужно не на него,
         
     | 
| 
      
 395 
     | 
    
         
            +
                         * а на его самый нижний дочерний элемент.
         
     | 
| 
      
 396 
     | 
    
         
            +
                         * */
         
     | 
| 
       362 
397 
     | 
    
         
             
                        if (currentIndex > 0) {
         
     | 
| 
      
 398 
     | 
    
         
            +
                          var nextFocus = [].concat(_rollupPluginBabelHelpers.toConsumableArray(focusedPath.slice(0, -1)), [currentIndex - 1]);
         
     | 
| 
      
 399 
     | 
    
         
            +
                          while (nextFocus) {
         
     | 
| 
      
 400 
     | 
    
         
            +
                            var focusedPathAsString = nextFocus.reduce(function (acc, n) {
         
     | 
| 
      
 401 
     | 
    
         
            +
                              return "".concat(acc, "/").concat(n);
         
     | 
| 
      
 402 
     | 
    
         
            +
                            }, '').replace(/^(\/)/, '');
         
     | 
| 
      
 403 
     | 
    
         
            +
                            var item = focusedToValueMap.get(focusedPathAsString);
         
     | 
| 
      
 404 
     | 
    
         
            +
                            var isLevelOpened = treePathReducer.keyExists(treePath, valueToPathMap.get(item.value.toString()) || []);
         
     | 
| 
      
 405 
     | 
    
         
            +
                            if (isLevelOpened) {
         
     | 
| 
      
 406 
     | 
    
         
            +
                              var _item$items;
         
     | 
| 
      
 407 
     | 
    
         
            +
                              nextFocus = [].concat(_rollupPluginBabelHelpers.toConsumableArray(nextFocus), [((item === null || item === void 0 || (_item$items = item.items) === null || _item$items === void 0 ? void 0 : _item$items.length) || 0) - 1]);
         
     | 
| 
      
 408 
     | 
    
         
            +
                            } else {
         
     | 
| 
      
 409 
     | 
    
         
            +
                              break;
         
     | 
| 
      
 410 
     | 
    
         
            +
                            }
         
     | 
| 
      
 411 
     | 
    
         
            +
                          }
         
     | 
| 
       363 
412 
     | 
    
         
             
                          dispatchFocusedPath({
         
     | 
| 
       364 
     | 
    
         
            -
                            type: ' 
     | 
| 
       365 
     | 
    
         
            -
                            value:  
     | 
| 
      
 413 
     | 
    
         
            +
                            type: 'set_focus',
         
     | 
| 
      
 414 
     | 
    
         
            +
                            value: nextFocus
         
     | 
| 
      
 415 
     | 
    
         
            +
                          });
         
     | 
| 
      
 416 
     | 
    
         
            +
                        } else {
         
     | 
| 
      
 417 
     | 
    
         
            +
                          /**
         
     | 
| 
      
 418 
     | 
    
         
            +
                           * Если элемент первый, то нужно лишь подняться к его родителю.
         
     | 
| 
      
 419 
     | 
    
         
            +
                           * */
         
     | 
| 
      
 420 
     | 
    
         
            +
                          dispatchFocusedPath({
         
     | 
| 
      
 421 
     | 
    
         
            +
                            type: 'return_prev_focus'
         
     | 
| 
       366 
422 
     | 
    
         
             
                          });
         
     | 
| 
       367 
423 
     | 
    
         
             
                        }
         
     | 
| 
       368 
424 
     | 
    
         
             
                      } else {
         
     | 
| 
      
 425 
     | 
    
         
            +
                        /**
         
     | 
| 
      
 426 
     | 
    
         
            +
                         * Если список закрыт, то нужно его открыть и установить фокус на первый элемент.
         
     | 
| 
      
 427 
     | 
    
         
            +
                         * */
         
     | 
| 
       369 
428 
     | 
    
         
             
                        dispatchPath({
         
     | 
| 
       370 
429 
     | 
    
         
             
                          type: 'opened_first_level'
         
     | 
| 
       371 
430 
     | 
    
         
             
                        });
         
     | 
| 
         @@ -378,14 +437,66 @@ var keyboardNavigationTree = function keyboardNavigationTree(_ref3) { 
     | 
|
| 
       378 
437 
     | 
    
         
             
                    }
         
     | 
| 
       379 
438 
     | 
    
         
             
                  case keys.ArrowDown:
         
     | 
| 
       380 
439 
     | 
    
         
             
                    {
         
     | 
| 
      
 440 
     | 
    
         
            +
                      /**
         
     | 
| 
      
 441 
     | 
    
         
            +
                       * Если список открыт и фокус уже установлен на каком-либо элементе.
         
     | 
| 
      
 442 
     | 
    
         
            +
                       * */
         
     | 
| 
       381 
443 
     | 
    
         
             
                      if (focusedPath.length) {
         
     | 
| 
      
 444 
     | 
    
         
            +
                        /**
         
     | 
| 
      
 445 
     | 
    
         
            +
                         * Заходим сюда если у элемента есть другие вложенные элементы.
         
     | 
| 
      
 446 
     | 
    
         
            +
                         * */
         
     | 
| 
      
 447 
     | 
    
         
            +
                        if (currentItem !== null && currentItem !== void 0 && currentItem.items && currentItem !== null && currentItem !== void 0 && currentItem.items.length) {
         
     | 
| 
      
 448 
     | 
    
         
            +
                          var isCurrentLevelOpened = treePathReducer.keyExists(treePath, valueToPathMap.get(currentItem.value.toString()) || []);
         
     | 
| 
      
 449 
     | 
    
         
            +
             
     | 
| 
      
 450 
     | 
    
         
            +
                          /**
         
     | 
| 
      
 451 
     | 
    
         
            +
                           * Если у этого элемента открыт его дочерний список,
         
     | 
| 
      
 452 
     | 
    
         
            +
                           * то устанавливаем фокус на первый элемент из этого списка
         
     | 
| 
      
 453 
     | 
    
         
            +
                           * и сразу же выходим из обработчика события.
         
     | 
| 
      
 454 
     | 
    
         
            +
                           * */
         
     | 
| 
      
 455 
     | 
    
         
            +
                          if (isCurrentLevelOpened) {
         
     | 
| 
      
 456 
     | 
    
         
            +
                            dispatchFocusedPath({
         
     | 
| 
      
 457 
     | 
    
         
            +
                              type: 'add_focus',
         
     | 
| 
      
 458 
     | 
    
         
            +
                              value: 0
         
     | 
| 
      
 459 
     | 
    
         
            +
                            });
         
     | 
| 
      
 460 
     | 
    
         
            +
                            break;
         
     | 
| 
      
 461 
     | 
    
         
            +
                          }
         
     | 
| 
      
 462 
     | 
    
         
            +
                        }
         
     | 
| 
      
 463 
     | 
    
         
            +
             
     | 
| 
      
 464 
     | 
    
         
            +
                        /**
         
     | 
| 
      
 465 
     | 
    
         
            +
                         * Если мы еще не достигли конца списка, то движемся к следующему элементу.
         
     | 
| 
      
 466 
     | 
    
         
            +
                         * */
         
     | 
| 
       382 
467 
     | 
    
         
             
                        if (currentIndex + 1 < currentLength) {
         
     | 
| 
       383 
468 
     | 
    
         
             
                          dispatchFocusedPath({
         
     | 
| 
       384 
469 
     | 
    
         
             
                            type: 'change_last_focus',
         
     | 
| 
       385 
470 
     | 
    
         
             
                            value: currentIndex + 1
         
     | 
| 
       386 
471 
     | 
    
         
             
                          });
         
     | 
| 
      
 472 
     | 
    
         
            +
                        } else {
         
     | 
| 
      
 473 
     | 
    
         
            +
                          /**
         
     | 
| 
      
 474 
     | 
    
         
            +
                           * Если же достигли последнего элемента на текущем уровне, то нужно определить,
         
     | 
| 
      
 475 
     | 
    
         
            +
                           * на какой из элементов ниже мы перейдем.
         
     | 
| 
      
 476 
     | 
    
         
            +
                           * Переход фокуса отсюда может быть только на уровни выше, при чем сразу на несколько.
         
     | 
| 
      
 477 
     | 
    
         
            +
                           * */
         
     | 
| 
      
 478 
     | 
    
         
            +
                          var focusCandidate = _rollupPluginBabelHelpers.toConsumableArray(focusedPath);
         
     | 
| 
      
 479 
     | 
    
         
            +
                          var _nextFocus = null;
         
     | 
| 
      
 480 
     | 
    
         
            +
                          while (focusCandidate.length > 1) {
         
     | 
| 
      
 481 
     | 
    
         
            +
                            focusCandidate = [].concat(_rollupPluginBabelHelpers.toConsumableArray(focusCandidate.slice(0, -2)), [(focusCandidate.at(-2) || 0) + 1]);
         
     | 
| 
      
 482 
     | 
    
         
            +
                            if (isValidFocus(focusCandidate)) {
         
     | 
| 
      
 483 
     | 
    
         
            +
                              _nextFocus = focusCandidate;
         
     | 
| 
      
 484 
     | 
    
         
            +
                              break;
         
     | 
| 
      
 485 
     | 
    
         
            +
                            }
         
     | 
| 
      
 486 
     | 
    
         
            +
                          }
         
     | 
| 
      
 487 
     | 
    
         
            +
                          if (_nextFocus) {
         
     | 
| 
      
 488 
     | 
    
         
            +
                            dispatchFocusedPath({
         
     | 
| 
      
 489 
     | 
    
         
            +
                              type: 'set_focus',
         
     | 
| 
      
 490 
     | 
    
         
            +
                              value: _nextFocus
         
     | 
| 
      
 491 
     | 
    
         
            +
                            });
         
     | 
| 
      
 492 
     | 
    
         
            +
                          } else {
         
     | 
| 
      
 493 
     | 
    
         
            +
                            break;
         
     | 
| 
      
 494 
     | 
    
         
            +
                          }
         
     | 
| 
       387 
495 
     | 
    
         
             
                        }
         
     | 
| 
       388 
496 
     | 
    
         
             
                      } else {
         
     | 
| 
      
 497 
     | 
    
         
            +
                        /**
         
     | 
| 
      
 498 
     | 
    
         
            +
                         * Если список закрыт, то нужно его открыть и установить фокус на первый элемент.
         
     | 
| 
      
 499 
     | 
    
         
            +
                         * */
         
     | 
| 
       389 
500 
     | 
    
         
             
                        dispatchPath({
         
     | 
| 
       390 
501 
     | 
    
         
             
                          type: 'opened_first_level'
         
     | 
| 
       391 
502 
     | 
    
         
             
                        });
         
     | 
| 
         @@ -400,19 +511,10 @@ var keyboardNavigationTree = function keyboardNavigationTree(_ref3) { 
     | 
|
| 
       400 
511 
     | 
    
         
             
                    {
         
     | 
| 
       401 
512 
     | 
    
         
             
                      if (path[0]) {
         
     | 
| 
       402 
513 
     | 
    
         
             
                        if (focusedPath.length) {
         
     | 
| 
       403 
     | 
    
         
            -
                           
     | 
| 
       404 
     | 
    
         
            -
             
     | 
| 
       405 
     | 
    
         
            -
                             
     | 
| 
       406 
     | 
    
         
            -
             
     | 
| 
       407 
     | 
    
         
            -
                              value: valueToPathMap.get((currentItem === null || currentItem === void 0 ? void 0 : currentItem.value.toString()) || '') || []
         
     | 
| 
       408 
     | 
    
         
            -
                            });
         
     | 
| 
       409 
     | 
    
         
            -
                          } else if (focusedPath.length === 1) {
         
     | 
| 
       410 
     | 
    
         
            -
                            handleListToggle(false);
         
     | 
| 
       411 
     | 
    
         
            -
                          } else {
         
     | 
| 
       412 
     | 
    
         
            -
                            dispatchFocusedPath({
         
     | 
| 
       413 
     | 
    
         
            -
                              type: 'return_prev_focus'
         
     | 
| 
       414 
     | 
    
         
            -
                            });
         
     | 
| 
       415 
     | 
    
         
            -
                          }
         
     | 
| 
      
 514 
     | 
    
         
            +
                          dispatchTreePath({
         
     | 
| 
      
 515 
     | 
    
         
            +
                            type: 'close_level',
         
     | 
| 
      
 516 
     | 
    
         
            +
                            value: valueToPathMap.get((currentItem === null || currentItem === void 0 ? void 0 : currentItem.value.toString()) || '') || []
         
     | 
| 
      
 517 
     | 
    
         
            +
                          });
         
     | 
| 
       416 
518 
     | 
    
         
             
                        }
         
     | 
| 
       417 
519 
     | 
    
         
             
                      }
         
     | 
| 
       418 
520 
     | 
    
         
             
                      break;
         
     | 
| 
         @@ -420,26 +522,13 @@ var keyboardNavigationTree = function keyboardNavigationTree(_ref3) { 
     | 
|
| 
       420 
522 
     | 
    
         
             
                  case keys.ArrowRight:
         
     | 
| 
       421 
523 
     | 
    
         
             
                    {
         
     | 
| 
       422 
524 
     | 
    
         
             
                      if (path[0]) {
         
     | 
| 
       423 
     | 
    
         
            -
                        if (!focusedPath.length) {
         
     | 
| 
       424 
     | 
    
         
            -
                          break;
         
     | 
| 
       425 
     | 
    
         
            -
                        }
         
     | 
| 
       426 
     | 
    
         
            -
                        if (currentItem !== null && currentItem !== void 0 && currentItem.disabled || currentItem !== null && currentItem !== void 0 && currentItem.isDisabled) {
         
     | 
| 
      
 525 
     | 
    
         
            +
                        if (!focusedPath.length || currentItem !== null && currentItem !== void 0 && currentItem.disabled || currentItem !== null && currentItem !== void 0 && currentItem.isDisabled || !(currentItem !== null && currentItem !== void 0 && currentItem.items)) {
         
     | 
| 
       427 
526 
     | 
    
         
             
                          break;
         
     | 
| 
       428 
527 
     | 
    
         
             
                        }
         
     | 
| 
       429 
     | 
    
         
            -
                         
     | 
| 
       430 
     | 
    
         
            -
                           
     | 
| 
       431 
     | 
    
         
            -
                           
     | 
| 
       432 
     | 
    
         
            -
             
     | 
| 
       433 
     | 
    
         
            -
                              type: 'add_focus',
         
     | 
| 
       434 
     | 
    
         
            -
                              value: 0
         
     | 
| 
       435 
     | 
    
         
            -
                            });
         
     | 
| 
       436 
     | 
    
         
            -
                          } else {
         
     | 
| 
       437 
     | 
    
         
            -
                            dispatchTreePath({
         
     | 
| 
       438 
     | 
    
         
            -
                              type: 'toggled_level',
         
     | 
| 
       439 
     | 
    
         
            -
                              value: valueToPathMap.get(currentItem.value.toString()) || []
         
     | 
| 
       440 
     | 
    
         
            -
                            });
         
     | 
| 
       441 
     | 
    
         
            -
                          }
         
     | 
| 
       442 
     | 
    
         
            -
                        }
         
     | 
| 
      
 528 
     | 
    
         
            +
                        dispatchTreePath({
         
     | 
| 
      
 529 
     | 
    
         
            +
                          type: 'open_level',
         
     | 
| 
      
 530 
     | 
    
         
            +
                          value: valueToPathMap.get(currentItem.value.toString()) || []
         
     | 
| 
      
 531 
     | 
    
         
            +
                        });
         
     | 
| 
       443 
532 
     | 
    
         
             
                      }
         
     | 
| 
       444 
533 
     | 
    
         
             
                      break;
         
     | 
| 
       445 
534 
     | 
    
         
             
                    }
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"file":"useKeyboardNavigation.js","sources":["../../../../src/components/Select/hooks/useKeyboardNavigation.ts"],"sourcesContent":["import type { KeyboardEvent, Dispatch } from 'react';\nimport React from 'react';\n\nimport { keyExists } from '../reducers/treePathReducer';\nimport { PathAction, PathState, FocusedPathAction, FocusedPathState, TreePathAction, TreePathState } from '../reducers';\nimport type { MergedDropdownNodeTransformed } from '../ui/Inner/ui/Item/Item.types';\n\nimport { PathMapType, FocusedToValueMapType } from './usePathMaps';\n\nconst JUMP_SIZE = 10;\n\nexport const keys = {\n    Enter: 'Enter',\n    Space: 'Space',\n    Tab: 'Tab',\n    Escape: 'Escape',\n    Backspace: 'Backspace',\n    ArrowLeft: 'ArrowLeft',\n    ArrowRight: 'ArrowRight',\n    ArrowUp: 'ArrowUp',\n    ArrowDown: 'ArrowDown',\n    Home: 'Home',\n    End: 'End',\n    PageUp: 'PageUp',\n    PageDown: 'PageDown',\n};\n\nexport const getItemByFocused = (focusedPath: FocusedPathState, focusedToValueMap: FocusedToValueMapType) => {\n    const focusedPathAsString = focusedPath.reduce((acc, n) => `${acc}/${n}`, '').replace(/^(\\/)/, '');\n\n    return focusedToValueMap.get(focusedPathAsString);\n};\n\ntype Props = {\n    focusedPath: FocusedPathState;\n    dispatchFocusedPath: Dispatch<FocusedPathAction>;\n    path: PathState;\n    dispatchPath: Dispatch<PathAction>;\n    pathMap: PathMapType;\n    focusedToValueMap: FocusedToValueMapType;\n    handleListToggle: (opened: boolean) => void;\n    handlePressDown: (item: MergedDropdownNodeTransformed, e?: React.MouseEvent<HTMLElement>) => void;\n    treePath: TreePathState;\n    dispatchTreePath: Dispatch<TreePathAction>;\n    treeView: boolean;\n    valueToPathMap: Map<string, string[]>;\n};\n\ntype ReturnedProps = {\n    onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;\n};\n\nexport const useKeyNavigation = ({\n    focusedPath,\n    dispatchFocusedPath,\n    path,\n    dispatchPath,\n    pathMap,\n    focusedToValueMap,\n    handleListToggle,\n    handlePressDown,\n    treePath,\n    dispatchTreePath,\n    treeView,\n    valueToPathMap,\n}: Props): ReturnedProps => {\n    if (treeView) {\n        return keyboardNavigationTree({\n            focusedPath,\n            dispatchFocusedPath,\n            path,\n            dispatchPath,\n            pathMap,\n            focusedToValueMap,\n            handleListToggle,\n            handlePressDown,\n            treePath,\n            dispatchTreePath,\n            treeView,\n            valueToPathMap,\n        });\n    }\n\n    return keyboardNavigationDefault({\n        focusedPath,\n        dispatchFocusedPath,\n        path,\n        dispatchPath,\n        pathMap,\n        focusedToValueMap,\n        handleListToggle,\n        handlePressDown,\n        treePath,\n        dispatchTreePath,\n        treeView,\n        valueToPathMap,\n    });\n};\n\nconst keyboardNavigationDefault = ({\n    focusedPath,\n    dispatchFocusedPath,\n    path,\n    dispatchPath,\n    pathMap,\n    focusedToValueMap,\n    handleListToggle,\n    handlePressDown,\n}: Props): ReturnedProps => {\n    const currentIndex: number = focusedPath?.[focusedPath.length - 1] || 0;\n    const currentLength: number = pathMap.get(path?.[focusedPath.length - 1]) || 0;\n\n    const onKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n        switch (event.code) {\n            case keys.ArrowUp: {\n                if (focusedPath.length) {\n                    if (currentIndex > 0) {\n                        if (path.length > focusedPath.length) {\n                            dispatchPath({ type: 'removed_last_level' });\n                        }\n\n                        dispatchFocusedPath({ type: 'change_last_focus', value: currentIndex - 1 });\n                    }\n                } else {\n                    dispatchPath({ type: 'opened_first_level' });\n                    dispatchFocusedPath({ type: 'set_initial_focus' });\n                    handleListToggle(true);\n                }\n\n                break;\n            }\n\n            case keys.ArrowDown: {\n                if (focusedPath.length) {\n                    if (currentIndex + 1 < currentLength) {\n                        if (path.length > focusedPath.length) {\n                            dispatchPath({ type: 'removed_last_level' });\n                        }\n\n                        dispatchFocusedPath({ type: 'change_last_focus', value: currentIndex + 1 });\n                    }\n                } else {\n                    dispatchPath({ type: 'opened_first_level' });\n                    dispatchFocusedPath({ type: 'set_initial_focus' });\n                    handleListToggle(true);\n                }\n\n                break;\n            }\n\n            case keys.ArrowLeft: {\n                if (path[0]) {\n                    if (focusedPath.length) {\n                        if (path.length > focusedPath.length) {\n                            dispatchPath({ type: 'removed_last_level' });\n                        } else {\n                            dispatchFocusedPath({ type: 'return_prev_focus' });\n                        }\n                    }\n\n                    if (path.length === 1) {\n                        handleListToggle(false);\n                    }\n                }\n\n                break;\n            }\n\n            case keys.ArrowRight: {\n                if (path[0]) {\n                    if (!focusedPath.length) {\n                        break;\n                    }\n\n                    const currentItem = getItemByFocused(focusedPath, focusedToValueMap);\n\n                    if (currentItem?.disabled || currentItem?.isDisabled) {\n                        break;\n                    }\n\n                    if (currentItem?.items) {\n                        if (path.length > focusedPath.length) {\n                            dispatchFocusedPath({ type: 'add_focus', value: 0 });\n                        } else {\n                            dispatchPath({ type: 'added_next_level', value: currentItem.value.toString() });\n                        }\n                    }\n                }\n\n                break;\n            }\n\n            case keys.Space: {\n                event.preventDefault();\n\n                const currentItem = getItemByFocused(focusedPath, focusedToValueMap);\n\n                if (!path[0]) {\n                    dispatchPath({ type: 'opened_first_level' });\n                    dispatchFocusedPath({ type: 'set_initial_focus' });\n                    break;\n                }\n\n                if (!currentItem || currentItem?.disabled || currentItem?.isDisabled) {\n                    break;\n                }\n\n                handlePressDown(currentItem);\n\n                break;\n            }\n\n            case keys.Enter: {\n                event.preventDefault();\n\n                const currentItem = getItemByFocused(focusedPath, focusedToValueMap)!;\n\n                if (currentItem?.disabled || currentItem?.isDisabled) {\n                    break;\n                }\n\n                if (!path[0]) {\n                    dispatchPath({ type: 'opened_first_level' });\n                    dispatchFocusedPath({ type: 'set_initial_focus' });\n                    break;\n                }\n\n                if (currentItem?.items) {\n                    if (path.length > focusedPath.length) {\n                        dispatchFocusedPath({ type: 'add_focus', value: 0 });\n                    } else {\n                        dispatchPath({ type: 'added_next_level', value: currentItem.value.toString() });\n                    }\n\n                    break;\n                }\n\n                handlePressDown(currentItem);\n\n                break;\n            }\n\n            case keys.Tab:\n            case keys.Escape: {\n                if (path[0]) {\n                    handleListToggle(false);\n                }\n\n                break;\n            }\n\n            case keys.Home: {\n                if (path[0]) {\n                    if (path.length > focusedPath.length) {\n                        dispatchPath({ type: 'removed_last_level' });\n                    }\n\n                    dispatchFocusedPath({ type: 'change_last_focus', value: 0 });\n                } else {\n                    dispatchPath({ type: 'opened_first_level' });\n                    dispatchFocusedPath({ type: 'set_initial_focus' });\n\n                    handleListToggle(true);\n                }\n\n                break;\n            }\n\n            case keys.End: {\n                if (path[0]) {\n                    if (path.length > focusedPath.length) {\n                        dispatchPath({ type: 'removed_last_level' });\n                    }\n\n                    dispatchFocusedPath({ type: 'change_last_focus', value: currentLength - 1 });\n                } else {\n                    dispatchPath({ type: 'opened_first_level' });\n                    dispatchFocusedPath({ type: 'change_last_focus', value: (pathMap.get('root') || 0) - 1 });\n\n                    handleListToggle(true);\n                }\n\n                break;\n            }\n\n            case keys.PageUp: {\n                if (!path[0]) {\n                    break;\n                }\n\n                if (path.length > focusedPath.length) {\n                    dispatchPath({ type: 'removed_last_level' });\n                }\n\n                if (currentIndex <= JUMP_SIZE) {\n                    dispatchFocusedPath({ type: 'change_last_focus', value: 0 });\n                } else {\n                    dispatchFocusedPath({ type: 'change_last_focus', value: currentIndex - JUMP_SIZE });\n                }\n\n                break;\n            }\n\n            case keys.PageDown: {\n                if (!path[0]) {\n                    break;\n                }\n\n                if (path.length > focusedPath.length) {\n                    dispatchPath({ type: 'removed_last_level' });\n                }\n\n                if (currentLength - currentIndex <= JUMP_SIZE) {\n                    dispatchFocusedPath({ type: 'change_last_focus', value: currentLength - 1 });\n                } else {\n                    dispatchFocusedPath({ type: 'change_last_focus', value: currentIndex + JUMP_SIZE });\n                }\n\n                break;\n            }\n\n            default: {\n                break;\n            }\n        }\n    };\n\n    return { onKeyDown };\n};\n\nconst keyboardNavigationTree = ({\n    focusedPath,\n    dispatchFocusedPath,\n    path,\n    dispatchPath,\n    pathMap,\n    focusedToValueMap,\n    handleListToggle,\n    handlePressDown,\n    treePath,\n    dispatchTreePath,\n    valueToPathMap,\n}: Props): ReturnedProps => {\n    const currentIndex: number = focusedPath?.[focusedPath.length - 1] || 0;\n    const currentItem = getItemByFocused(focusedPath, focusedToValueMap);\n    const currentLength: number = currentItem?.parent?.items?.length || pathMap.get('root') || 0;\n\n    const onKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n        switch (event.code) {\n            case keys.ArrowUp: {\n                if (focusedPath.length) {\n                    if (currentIndex > 0) {\n                        dispatchFocusedPath({ type: 'change_last_focus', value: currentIndex - 1 });\n                    }\n                } else {\n                    dispatchPath({ type: 'opened_first_level' });\n                    dispatchFocusedPath({ type: 'set_initial_focus' });\n                    handleListToggle(true);\n                }\n\n                break;\n            }\n\n            case keys.ArrowDown: {\n                if (focusedPath.length) {\n                    if (currentIndex + 1 < currentLength) {\n                        dispatchFocusedPath({ type: 'change_last_focus', value: currentIndex + 1 });\n                    }\n                } else {\n                    dispatchPath({ type: 'opened_first_level' });\n                    dispatchFocusedPath({ type: 'set_initial_focus' });\n                    handleListToggle(true);\n                }\n\n                break;\n            }\n\n            case keys.ArrowLeft: {\n                if (path[0]) {\n                    if (focusedPath.length) {\n                        const isCurrentLevelOpened = keyExists(\n                            treePath,\n                            valueToPathMap.get(currentItem?.value.toString() || '') || [],\n                        );\n\n                        if (isCurrentLevelOpened) {\n                            dispatchTreePath({\n                                type: 'toggled_level',\n                                value: valueToPathMap.get(currentItem?.value.toString() || '') || [],\n                            });\n                        } else if (focusedPath.length === 1) {\n                            handleListToggle(false);\n                        } else {\n                            dispatchFocusedPath({ type: 'return_prev_focus' });\n                        }\n                    }\n                }\n\n                break;\n            }\n\n            case keys.ArrowRight: {\n                if (path[0]) {\n                    if (!focusedPath.length) {\n                        break;\n                    }\n\n                    if (currentItem?.disabled || currentItem?.isDisabled) {\n                        break;\n                    }\n\n                    if (currentItem?.items) {\n                        const isCurrentLevelOpened = keyExists(\n                            treePath,\n                            valueToPathMap.get(currentItem.value.toString()) || [],\n                        );\n\n                        if (isCurrentLevelOpened) {\n                            dispatchFocusedPath({ type: 'add_focus', value: 0 });\n                        } else {\n                            dispatchTreePath({\n                                type: 'toggled_level',\n                                value: valueToPathMap.get(currentItem.value.toString()) || [],\n                            });\n                        }\n                    }\n                }\n\n                break;\n            }\n\n            case keys.Space:\n            case keys.Enter: {\n                event.preventDefault();\n\n                if (!path[0]) {\n                    dispatchPath({ type: 'opened_first_level' });\n                    dispatchFocusedPath({ type: 'set_initial_focus' });\n                    break;\n                }\n\n                if (!currentItem || currentItem?.disabled || currentItem?.isDisabled) {\n                    break;\n                }\n\n                handlePressDown(currentItem);\n\n                break;\n            }\n\n            case keys.Tab:\n            case keys.Escape: {\n                if (path[0]) {\n                    handleListToggle(false);\n                }\n\n                break;\n            }\n\n            default: {\n                break;\n            }\n        }\n    };\n\n    return { onKeyDown };\n};\n"],"names":["JUMP_SIZE","keys","Enter","Space","Tab","Escape","Backspace","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown","getItemByFocused","focusedPath","focusedToValueMap","focusedPathAsString","reduce","acc","n","concat","replace","get","useKeyNavigation","_ref","dispatchFocusedPath","path","dispatchPath","pathMap","handleListToggle","handlePressDown","treePath","dispatchTreePath","treeView","valueToPathMap","keyboardNavigationTree","keyboardNavigationDefault","_ref2","currentIndex","length","currentLength","onKeyDown","event","code","type","value","currentItem","disabled","isDisabled","items","toString","preventDefault","_ref3","_currentItem$parent","parent","isCurrentLevelOpened","keyExists"],"mappings":";;;;;;AASA,IAAMA,SAAS,GAAG,EA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cAAAA,IAAI,EAAE,oBAAA;AAAqB,aAAC,CAAC,CAAA;AAC5CnB,YAAAA,mBAAmB,CAAC;AAAEmB,cAAAA,IAAI,EAAE,mBAAA;AAAoB,aAAC,CAAC,CAAA;AAClD,YAAA,MAAA;AACJ,WAAA;AAEA,UAAA,IAAI,CAACE,WAAW,IAAIA,WAAW,KAAXA,IAAAA,IAAAA,WAAW,eAAXA,WAAW,CAAEC,QAAQ,IAAID,WAAW,KAAXA,IAAAA,IAAAA,WAAW,eAAXA,WAAW,CAAEE,UAAU,EAAE;AAClE,YAAA,MAAA;AACJ,WAAA;UAEAlB,eAAe,CAACgB,WAAW,CAAC,CAAA;AAE5B,UAAA,MAAA;AACJ,SAAA;MAEA,KAAK/C,IAAI,CAACG,GAAG,CAAA;MACb,KAAKH,IAAI,CAACI,MAAM;AAAE,QAAA;AACd,UAAA,IAAIuB,IAAI,CAAC,CAAC,CAAC,EAAE;YACTG,gBAAgB,CAAC,KAAK,CAAC,CAAA;AAC3B,WAAA;AAEA,UAAA,MAAA;AACJ,SAAA;AAKJ,KAAA;GACH,CAAA;EAED,OAAO;AAAEY,IAAAA,SAAS,EAATA,SAAAA;GAAW,CAAA;AACxB,CAAC;;;;;;"}
         
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"file":"useKeyboardNavigation.js","sources":["../../../../src/components/Select/hooks/useKeyboardNavigation.ts"],"sourcesContent":["import type { KeyboardEvent, Dispatch } from 'react';\nimport React from 'react';\n\nimport { keyExists } from '../reducers/treePathReducer';\nimport { PathAction, PathState, FocusedPathAction, FocusedPathState, TreePathAction, TreePathState } from '../reducers';\nimport type { MergedDropdownNodeTransformed } from '../ui/Inner/ui/Item/Item.types';\n\nimport { PathMapType, FocusedToValueMapType } from './usePathMaps';\n\nconst JUMP_SIZE = 10;\n\nexport const keys = {\n    Enter: 'Enter',\n    Space: 'Space',\n    Tab: 'Tab',\n    Escape: 'Escape',\n    Backspace: 'Backspace',\n    ArrowLeft: 'ArrowLeft',\n    ArrowRight: 'ArrowRight',\n    ArrowUp: 'ArrowUp',\n    ArrowDown: 'ArrowDown',\n    Home: 'Home',\n    End: 'End',\n    PageUp: 'PageUp',\n    PageDown: 'PageDown',\n};\n\nexport const getItemByFocused = (focusedPath: FocusedPathState, focusedToValueMap: FocusedToValueMapType) => {\n    const focusedPathAsString = focusedPath.reduce((acc, n) => `${acc}/${n}`, '').replace(/^(\\/)/, '');\n\n    return focusedToValueMap.get(focusedPathAsString);\n};\n\ntype Props = {\n    focusedPath: FocusedPathState;\n    dispatchFocusedPath: Dispatch<FocusedPathAction>;\n    path: PathState;\n    dispatchPath: Dispatch<PathAction>;\n    pathMap: PathMapType;\n    focusedToValueMap: FocusedToValueMapType;\n    handleListToggle: (opened: boolean) => void;\n    handlePressDown: (item: MergedDropdownNodeTransformed, e?: React.MouseEvent<HTMLElement>) => void;\n    treePath: TreePathState;\n    dispatchTreePath: Dispatch<TreePathAction>;\n    treeView: boolean;\n    valueToPathMap: Map<string, string[]>;\n    items: MergedDropdownNodeTransformed[];\n};\n\ntype ReturnedProps = {\n    onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;\n};\n\n// #TODO: подумать над идеей выноса логики фокуса непосредственно в focusedPathReducer.\nexport const useKeyNavigation = ({\n    focusedPath,\n    dispatchFocusedPath,\n    path,\n    dispatchPath,\n    pathMap,\n    focusedToValueMap,\n    handleListToggle,\n    handlePressDown,\n    treePath,\n    dispatchTreePath,\n    treeView,\n    valueToPathMap,\n    items,\n}: Props): ReturnedProps => {\n    if (treeView) {\n        return keyboardNavigationTree({\n            focusedPath,\n            dispatchFocusedPath,\n            path,\n            dispatchPath,\n            pathMap,\n            focusedToValueMap,\n            handleListToggle,\n            handlePressDown,\n            treePath,\n            dispatchTreePath,\n            treeView,\n            valueToPathMap,\n            items,\n        });\n    }\n\n    return keyboardNavigationDefault({\n        focusedPath,\n        dispatchFocusedPath,\n        path,\n        dispatchPath,\n        pathMap,\n        focusedToValueMap,\n        handleListToggle,\n        handlePressDown,\n        treePath,\n        dispatchTreePath,\n        treeView,\n        valueToPathMap,\n        items,\n    });\n};\n\nconst keyboardNavigationDefault = ({\n    focusedPath,\n    dispatchFocusedPath,\n    path,\n    dispatchPath,\n    pathMap,\n    focusedToValueMap,\n    handleListToggle,\n    handlePressDown,\n}: Props): ReturnedProps => {\n    const currentIndex: number = focusedPath?.[focusedPath.length - 1] || 0;\n    const currentLength: number = pathMap.get(path?.[focusedPath.length - 1]) || 0;\n\n    const onKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n        switch (event.code) {\n            case keys.ArrowUp: {\n                if (focusedPath.length) {\n                    if (currentIndex > 0) {\n                        if (path.length > focusedPath.length) {\n                            dispatchPath({ type: 'removed_last_level' });\n                        }\n\n                        dispatchFocusedPath({ type: 'change_last_focus', value: currentIndex - 1 });\n                    }\n                } else {\n                    dispatchPath({ type: 'opened_first_level' });\n                    dispatchFocusedPath({ type: 'set_initial_focus' });\n                    handleListToggle(true);\n                }\n\n                break;\n            }\n\n            case keys.ArrowDown: {\n                if (focusedPath.length) {\n                    if (currentIndex + 1 < currentLength) {\n                        if (path.length > focusedPath.length) {\n                            dispatchPath({ type: 'removed_last_level' });\n                        }\n\n                        dispatchFocusedPath({ type: 'change_last_focus', value: currentIndex + 1 });\n                    }\n                } else {\n                    dispatchPath({ type: 'opened_first_level' });\n                    dispatchFocusedPath({ type: 'set_initial_focus' });\n                    handleListToggle(true);\n                }\n\n                break;\n            }\n\n            case keys.ArrowLeft: {\n                if (path[0]) {\n                    if (focusedPath.length) {\n                        if (path.length > focusedPath.length) {\n                            dispatchPath({ type: 'removed_last_level' });\n                        } else {\n                            dispatchFocusedPath({ type: 'return_prev_focus' });\n                        }\n                    }\n\n                    if (path.length === 1) {\n                        handleListToggle(false);\n                    }\n                }\n\n                break;\n            }\n\n            case keys.ArrowRight: {\n                if (path[0]) {\n                    if (!focusedPath.length) {\n                        break;\n                    }\n\n                    const currentItem = getItemByFocused(focusedPath, focusedToValueMap);\n\n                    if (currentItem?.disabled || currentItem?.isDisabled) {\n                        break;\n                    }\n\n                    if (currentItem?.items) {\n                        if (path.length > focusedPath.length) {\n                            dispatchFocusedPath({ type: 'add_focus', value: 0 });\n                        } else {\n                            dispatchPath({ type: 'added_next_level', value: currentItem.value.toString() });\n                        }\n                    }\n                }\n\n                break;\n            }\n\n            case keys.Space: {\n                event.preventDefault();\n\n                const currentItem = getItemByFocused(focusedPath, focusedToValueMap);\n\n                if (!path[0]) {\n                    dispatchPath({ type: 'opened_first_level' });\n                    dispatchFocusedPath({ type: 'set_initial_focus' });\n                    break;\n                }\n\n                if (!currentItem || currentItem?.disabled || currentItem?.isDisabled) {\n                    break;\n                }\n\n                handlePressDown(currentItem);\n\n                break;\n            }\n\n            case keys.Enter: {\n                event.preventDefault();\n\n                const currentItem = getItemByFocused(focusedPath, focusedToValueMap)!;\n\n                if (currentItem?.disabled || currentItem?.isDisabled) {\n                    break;\n                }\n\n                if (!path[0]) {\n                    dispatchPath({ type: 'opened_first_level' });\n                    dispatchFocusedPath({ type: 'set_initial_focus' });\n                    break;\n                }\n\n                if (currentItem?.items) {\n                    if (path.length > focusedPath.length) {\n                        dispatchFocusedPath({ type: 'add_focus', value: 0 });\n                    } else {\n                        dispatchPath({ type: 'added_next_level', value: currentItem.value.toString() });\n                    }\n\n                    break;\n                }\n\n                handlePressDown(currentItem);\n\n                break;\n            }\n\n            case keys.Tab:\n            case keys.Escape: {\n                if (path[0]) {\n                    handleListToggle(false);\n                }\n\n                break;\n            }\n\n            case keys.Home: {\n                if (path[0]) {\n                    if (path.length > focusedPath.length) {\n                        dispatchPath({ type: 'removed_last_level' });\n                    }\n\n                    dispatchFocusedPath({ type: 'change_last_focus', value: 0 });\n                } else {\n                    dispatchPath({ type: 'opened_first_level' });\n                    dispatchFocusedPath({ type: 'set_initial_focus' });\n\n                    handleListToggle(true);\n                }\n\n                break;\n            }\n\n            case keys.End: {\n                if (path[0]) {\n                    if (path.length > focusedPath.length) {\n                        dispatchPath({ type: 'removed_last_level' });\n                    }\n\n                    dispatchFocusedPath({ type: 'change_last_focus', value: currentLength - 1 });\n                } else {\n                    dispatchPath({ type: 'opened_first_level' });\n                    dispatchFocusedPath({ type: 'change_last_focus', value: (pathMap.get('root') || 0) - 1 });\n\n                    handleListToggle(true);\n                }\n\n                break;\n            }\n\n            case keys.PageUp: {\n                if (!path[0]) {\n                    break;\n                }\n\n                if (path.length > focusedPath.length) {\n                    dispatchPath({ type: 'removed_last_level' });\n                }\n\n                if (currentIndex <= JUMP_SIZE) {\n                    dispatchFocusedPath({ type: 'change_last_focus', value: 0 });\n                } else {\n                    dispatchFocusedPath({ type: 'change_last_focus', value: currentIndex - JUMP_SIZE });\n                }\n\n                break;\n            }\n\n            case keys.PageDown: {\n                if (!path[0]) {\n                    break;\n                }\n\n                if (path.length > focusedPath.length) {\n                    dispatchPath({ type: 'removed_last_level' });\n                }\n\n                if (currentLength - currentIndex <= JUMP_SIZE) {\n                    dispatchFocusedPath({ type: 'change_last_focus', value: currentLength - 1 });\n                } else {\n                    dispatchFocusedPath({ type: 'change_last_focus', value: currentIndex + JUMP_SIZE });\n                }\n\n                break;\n            }\n\n            default: {\n                break;\n            }\n        }\n    };\n\n    return { onKeyDown };\n};\n\nconst keyboardNavigationTree = ({\n    focusedPath,\n    dispatchFocusedPath,\n    path,\n    dispatchPath,\n    pathMap,\n    focusedToValueMap,\n    handleListToggle,\n    handlePressDown,\n    treePath,\n    dispatchTreePath,\n    valueToPathMap,\n    items,\n}: Props): ReturnedProps => {\n    const currentItem = getItemByFocused(focusedPath, focusedToValueMap);\n    const currentIndex: number = focusedPath?.[focusedPath.length - 1] || 0;\n    const currentLength: number = currentItem?.parent?.items?.length || pathMap.get('root') || 0;\n\n    const isValidFocus = (focusCandidate: FocusedPathState) => {\n        if (!Array.isArray(items) || !Array.isArray(focusCandidate)) return false;\n\n        let currentLevel = items;\n\n        for (const index of focusCandidate) {\n            if (!Array.isArray(currentLevel) || index >= currentLevel.length) {\n                return false;\n            }\n\n            const node = currentLevel[index];\n\n            currentLevel = node.items || [];\n        }\n\n        return true;\n    };\n\n    const onKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n        switch (event.code) {\n            case keys.ArrowUp: {\n                /**\n                 * Если список открыт и фокус уже установлен на каком-либо элементе.\n                 * */\n                if (focusedPath.length) {\n                    /**\n                     * Если это не первый элемент, то нужно вначале найти элемент для фокуса.\n                     * Т.к. если верхний элемент раскрыт, то и перемещаться нужно не на него,\n                     * а на его самый нижний дочерний элемент.\n                     * */\n                    if (currentIndex > 0) {\n                        let nextFocus = [...focusedPath.slice(0, -1), currentIndex - 1];\n\n                        while (nextFocus) {\n                            const focusedPathAsString = nextFocus\n                                .reduce((acc, n) => `${acc}/${n}`, '')\n                                .replace(/^(\\/)/, '');\n\n                            const item = focusedToValueMap.get(focusedPathAsString)!;\n\n                            const isLevelOpened = keyExists(treePath, valueToPathMap.get(item!.value.toString()) || []);\n\n                            if (isLevelOpened) {\n                                nextFocus = [...nextFocus, (item?.items?.length || 0) - 1];\n                            } else {\n                                break;\n                            }\n                        }\n\n                        dispatchFocusedPath({ type: 'set_focus', value: nextFocus });\n                    } else {\n                        /**\n                         * Если элемент первый, то нужно лишь подняться к его родителю.\n                         * */\n                        dispatchFocusedPath({ type: 'return_prev_focus' });\n                    }\n                } else {\n                    /**\n                     * Если список закрыт, то нужно его открыть и установить фокус на первый элемент.\n                     * */\n                    dispatchPath({ type: 'opened_first_level' });\n                    dispatchFocusedPath({ type: 'set_initial_focus' });\n                    handleListToggle(true);\n                }\n\n                break;\n            }\n\n            case keys.ArrowDown: {\n                /**\n                 * Если список открыт и фокус уже установлен на каком-либо элементе.\n                 * */\n                if (focusedPath.length) {\n                    /**\n                     * Заходим сюда если у элемента есть другие вложенные элементы.\n                     * */\n                    if (currentItem?.items && currentItem?.items.length) {\n                        const isCurrentLevelOpened = keyExists(\n                            treePath,\n                            valueToPathMap.get(currentItem.value.toString()) || [],\n                        );\n\n                        /**\n                         * Если у этого элемента открыт его дочерний список,\n                         * то устанавливаем фокус на первый элемент из этого списка\n                         * и сразу же выходим из обработчика события.\n                         * */\n                        if (isCurrentLevelOpened) {\n                            dispatchFocusedPath({ type: 'add_focus', value: 0 });\n                            break;\n                        }\n                    }\n\n                    /**\n                     * Если мы еще не достигли конца списка, то движемся к следующему элементу.\n                     * */\n                    if (currentIndex + 1 < currentLength) {\n                        dispatchFocusedPath({ type: 'change_last_focus', value: currentIndex + 1 });\n                    } else {\n                        /**\n                         * Если же достигли последнего элемента на текущем уровне, то нужно определить,\n                         * на какой из элементов ниже мы перейдем.\n                         * Переход фокуса отсюда может быть только на уровни выше, при чем сразу на несколько.\n                         * */\n                        let focusCandidate = [...focusedPath];\n                        let nextFocus = null;\n\n                        while (focusCandidate.length > 1) {\n                            focusCandidate = [...focusCandidate.slice(0, -2), (focusCandidate.at(-2) || 0) + 1];\n\n                            if (isValidFocus(focusCandidate)) {\n                                nextFocus = focusCandidate;\n                                break;\n                            }\n                        }\n\n                        if (nextFocus) {\n                            dispatchFocusedPath({ type: 'set_focus', value: nextFocus });\n                        } else {\n                            break;\n                        }\n                    }\n                } else {\n                    /**\n                     * Если список закрыт, то нужно его открыть и установить фокус на первый элемент.\n                     * */\n                    dispatchPath({ type: 'opened_first_level' });\n                    dispatchFocusedPath({ type: 'set_initial_focus' });\n                    handleListToggle(true);\n                }\n\n                break;\n            }\n\n            case keys.ArrowLeft: {\n                if (path[0]) {\n                    if (focusedPath.length) {\n                        dispatchTreePath({\n                            type: 'close_level',\n                            value: valueToPathMap.get(currentItem?.value.toString() || '') || [],\n                        });\n                    }\n                }\n\n                break;\n            }\n\n            case keys.ArrowRight: {\n                if (path[0]) {\n                    if (\n                        !focusedPath.length ||\n                        currentItem?.disabled ||\n                        currentItem?.isDisabled ||\n                        !currentItem?.items\n                    ) {\n                        break;\n                    }\n\n                    dispatchTreePath({\n                        type: 'open_level',\n                        value: valueToPathMap.get(currentItem.value.toString()) || [],\n                    });\n                }\n\n                break;\n            }\n\n            case keys.Space:\n            case keys.Enter: {\n                event.preventDefault();\n\n                if (!path[0]) {\n                    dispatchPath({ type: 'opened_first_level' });\n                    dispatchFocusedPath({ type: 'set_initial_focus' });\n                    break;\n                }\n\n                if (!currentItem || currentItem?.disabled || currentItem?.isDisabled) {\n                    break;\n                }\n\n                handlePressDown(currentItem);\n\n                break;\n            }\n\n            case keys.Tab:\n            case keys.Escape: {\n                if (path[0]) {\n                    handleListToggle(false);\n                }\n\n                break;\n            }\n\n            default: {\n                break;\n            }\n        }\n    };\n\n    return { onKeyDown };\n};\n"],"names":["JUMP_SIZE","keys","Enter","Space","Tab","Escape","Backspace","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown","getItemByFocused","focusedPath","focusedToValueMap","focusedPathAsString","reduce","acc","n","concat","replace","get","useKeyNavigation","_ref","dispatchFocusedPath","path","dispatchPath","pathMap","handleListToggle","handlePressDown","treePath","dispatchTreePath","treeView","valueToPathMap","items","keyboardNavigationTree","keyboardNavigationDefault","_ref2","currentIndex","length","currentLength","onKeyDown","event","code","type","value","currentItem","disabled","isDisabled","toString","preventDefault","_ref3","_currentItem$parent","parent","isValidFocus","focusCandidate","Array","isArray","currentLevel","_iterator","_createForOfIteratorHelper","_step","s","done","index","node","err","e","f","nextFocus","_toConsumableArray","slice","item","isLevelOpened","keyExists","_item$items","isCurrentLevelOpened","at"],"mappings":";;;;;;;AASA,IAAMA,SAAS,GAAG,EAAE,CAAA;AAEb,IAAMC,IAAI,GAAG;AAChBC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,SAAS,EAAE,WAAW;AACtBC,EAAAA,SAAS,EAAE,WAAW;AACtBC,EAAAA,UAAU,EAAE,YAAY;AACxBC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,SAAS,E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A,KAAK,EAAEZ,cAAc,CAACZ,GAAG,CAACyB,WAAW,CAACD,KAAK,CAACI,QAAQ,EAAE,CAAC,IAAI,EAAA;AAC/D,aAAC,CAAC,CAAA;AACN,WAAA;AAEA,UAAA,MAAA;AACJ,SAAA;MAEA,KAAKnD,IAAI,CAACE,KAAK,CAAA;MACf,KAAKF,IAAI,CAACC,KAAK;AAAE,QAAA;UACb2C,KAAK,CAACQ,cAAc,EAAE,CAAA;AAEtB,UAAA,IAAI,CAACzB,IAAI,CAAC,CAAC,CAAC,EAAE;AACVC,YAAAA,YAAY,CAAC;AAAEkB,cAAAA,IAAI,EAAE,oBAAA;AAAqB,aAAC,CAAC,CAAA;AAC5CpB,YAAAA,mBAAmB,CAAC;AAAEoB,cAAAA,IAAI,EAAE,mBAAA;AAAoB,aAAC,CAAC,CAAA;AAClD,YAAA,MAAA;AACJ,WAAA;AAEA,UAAA,IAAI,CAACE,WAAW,IAAIA,WAAW,KAAXA,IAAAA,IAAAA,WAAW,eAAXA,WAAW,CAAEC,QAAQ,IAAID,WAAW,KAAXA,IAAAA,IAAAA,WAAW,eAAXA,WAAW,CAAEE,UAAU,EAAE;AAClE,YAAA,MAAA;AACJ,WAAA;UAEAnB,eAAe,CAACiB,WAAW,CAAC,CAAA;AAE5B,UAAA,MAAA;AACJ,SAAA;MAEA,KAAKhD,IAAI,CAACG,GAAG,CAAA;MACb,KAAKH,IAAI,CAACI,MAAM;AAAE,QAAA;AACd,UAAA,IAAIuB,IAAI,CAAC,CAAC,CAAC,EAAE;YACTG,gBAAgB,CAAC,KAAK,CAAC,CAAA;AAC3B,WAAA;AAEA,UAAA,MAAA;AACJ,SAAA;AAKJ,KAAA;GACH,CAAA;EAED,OAAO;AAAEa,IAAAA,SAAS,EAATA,SAAAA;GAAW,CAAA;AACxB,CAAC;;;;;;"}
         
     | 
| 
         @@ -10,6 +10,10 @@ function focusedPathReducer(state, action) { 
     | 
|
| 
       10 
10 
     | 
    
         
             
                  {
         
     | 
| 
       11 
11 
     | 
    
         
             
                    return [];
         
     | 
| 
       12 
12 
     | 
    
         
             
                  }
         
     | 
| 
      
 13 
     | 
    
         
            +
                case 'set_focus':
         
     | 
| 
      
 14 
     | 
    
         
            +
                  {
         
     | 
| 
      
 15 
     | 
    
         
            +
                    return action.value;
         
     | 
| 
      
 16 
     | 
    
         
            +
                  }
         
     | 
| 
       13 
17 
     | 
    
         
             
                case 'set_initial_focus':
         
     | 
| 
       14 
18 
     | 
    
         
             
                  {
         
     | 
| 
       15 
19 
     | 
    
         
             
                    return [0];
         
     | 
| 
         @@ -24,6 +28,9 @@ function focusedPathReducer(state, action) { 
     | 
|
| 
       24 
28 
     | 
    
         
             
                  }
         
     | 
| 
       25 
29 
     | 
    
         
             
                case 'return_prev_focus':
         
     | 
| 
       26 
30 
     | 
    
         
             
                  {
         
     | 
| 
      
 31 
     | 
    
         
            +
                    if (state.length === 1) {
         
     | 
| 
      
 32 
     | 
    
         
            +
                      return state;
         
     | 
| 
      
 33 
     | 
    
         
            +
                    }
         
     | 
| 
       27 
34 
     | 
    
         
             
                    return state.slice(0, -1);
         
     | 
| 
       28 
35 
     | 
    
         
             
                  }
         
     | 
| 
       29 
36 
     | 
    
         
             
                default:
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"file":"focusedPathReducer.js","sources":["../../../../src/components/Select/reducers/focusedPathReducer.ts"],"sourcesContent":["export type FocusedPathState = Array<number>;\n\nexport type FocusedPathAction =\n    | { type: 'reset' }\n    | { type: 'set_initial_focus' }\n    | { type: 'change_last_focus'; value: number }\n    | { type: 'add_focus'; value: number }\n    | { type: 'return_prev_focus' };\n\nexport function focusedPathReducer(state: FocusedPathState, action: FocusedPathAction): FocusedPathState {\n    switch (action.type) {\n        case 'reset': {\n            return [];\n        }\n\n        case 'set_initial_focus': {\n            return [0];\n        }\n\n        case 'change_last_focus': {\n            return [...state.slice(0, -1), action.value];\n        }\n\n        case 'add_focus': {\n            return [...state, action.value];\n        }\n\n        case 'return_prev_focus': {\n            return state.slice(0, -1);\n        }\n\n        default: {\n            return state;\n        }\n    }\n}\n"],"names":["focusedPathReducer","state","action","type","concat","_toConsumableArray","slice"," 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"file":"focusedPathReducer.js","sources":["../../../../src/components/Select/reducers/focusedPathReducer.ts"],"sourcesContent":["export type FocusedPathState = Array<number>;\n\nexport type FocusedPathAction =\n    | { type: 'reset' }\n    | { type: 'set_focus'; value: FocusedPathState }\n    | { type: 'set_initial_focus' }\n    | { type: 'change_last_focus'; value: number }\n    | { type: 'add_focus'; value: number }\n    | { type: 'return_prev_focus' };\n\nexport function focusedPathReducer(state: FocusedPathState, action: FocusedPathAction): FocusedPathState {\n    switch (action.type) {\n        case 'reset': {\n            return [];\n        }\n\n        case 'set_focus': {\n            return action.value;\n        }\n\n        case 'set_initial_focus': {\n            return [0];\n        }\n\n        case 'change_last_focus': {\n            return [...state.slice(0, -1), action.value];\n        }\n\n        case 'add_focus': {\n            return [...state, action.value];\n        }\n\n        case 'return_prev_focus': {\n            if (state.length === 1) {\n                return state;\n            }\n\n            return state.slice(0, -1);\n        }\n\n        default: {\n            return state;\n        }\n    }\n}\n"],"names":["focusedPathReducer","state","action","type","value","concat","_toConsumableArray","slice","length"],"mappings":";;;;;;AAUO,SAASA,kBAAkBA,CAACC,KAAuB,EAAEC,MAAyB,EAAoB;EACrG,QAAQA,MAAM,CAACC,IAAI;AACf,IAAA,KAAK,OAAO;AAAE,MAAA;AACV,QAAA,OAAO,EAAE,CAAA;AACb,OAAA;AAEA,IAAA,KAAK,WAAW;AAAE,MAAA;QACd,OAAOD,MAAM,CAACE,KAAK,CAAA;AACvB,OAAA;AAEA,IAAA,KAAK,mBAAmB;AAAE,MAAA;QACtB,OAAO,CAAC,CAAC,CAAC,CAAA;AACd,OAAA;AAEA,IAAA,KAAK,mBAAmB;AAAE,MAAA;AACtB,QAAA,OAAA,EAAA,CAAAC,MAAA,CAAAC,2CAAA,CAAWL,KAAK,CAACM,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAEL,EAAAA,CAAAA,MAAM,CAACE,KAAK,CAAA,CAAA,CAAA;AAC/C,OAAA;AAEA,IAAA,KAAK,WAAW;AAAE,MAAA;QACd,OAAAC,EAAAA,CAAAA,MAAA,CAAAC,2CAAA,CAAWL,KAAK,CAAEC,EAAAA,CAAAA,MAAM,CAACE,KAAK,CAAA,CAAA,CAAA;AAClC,OAAA;AAEA,IAAA,KAAK,mBAAmB;AAAE,MAAA;AACtB,QAAA,IAAIH,KAAK,CAACO,MAAM,KAAK,CAAC,EAAE;AACpB,UAAA,OAAOP,KAAK,CAAA;AAChB,SAAA;QAEA,OAAOA,KAAK,CAACM,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAC7B,OAAA;AAEA,IAAA;AAAS,MAAA;AACL,QAAA,OAAON,KAAK,CAAA;AAChB,OAAA;AACJ,GAAA;AACJ;;;;"}
         
     | 
| 
         @@ -75,6 +75,18 @@ function treePathReducer(state, action) { 
     | 
|
| 
       75 
75 
     | 
    
         
             
                    }
         
     | 
| 
       76 
76 
     | 
    
         
             
                    return stateCopy;
         
     | 
| 
       77 
77 
     | 
    
         
             
                  }
         
     | 
| 
      
 78 
     | 
    
         
            +
                case 'open_level':
         
     | 
| 
      
 79 
     | 
    
         
            +
                  {
         
     | 
| 
      
 80 
     | 
    
         
            +
                    var _stateCopy = deepCopy.deepCopy(state);
         
     | 
| 
      
 81 
     | 
    
         
            +
                    createObjectAtPath(_stateCopy, action.value);
         
     | 
| 
      
 82 
     | 
    
         
            +
                    return _stateCopy;
         
     | 
| 
      
 83 
     | 
    
         
            +
                  }
         
     | 
| 
      
 84 
     | 
    
         
            +
                case 'close_level':
         
     | 
| 
      
 85 
     | 
    
         
            +
                  {
         
     | 
| 
      
 86 
     | 
    
         
            +
                    var _stateCopy2 = deepCopy.deepCopy(state);
         
     | 
| 
      
 87 
     | 
    
         
            +
                    removeObjectAtPath(_stateCopy2, action.value);
         
     | 
| 
      
 88 
     | 
    
         
            +
                    return _stateCopy2;
         
     | 
| 
      
 89 
     | 
    
         
            +
                  }
         
     | 
| 
       78 
90 
     | 
    
         
             
                default:
         
     | 
| 
       79 
91 
     | 
    
         
             
                  {
         
     | 
| 
       80 
92 
     | 
    
         
             
                    return state;
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"file":"treePathReducer.js","sources":["../../../../src/components/Select/reducers/treePathReducer.ts"],"sourcesContent":["import { deepCopy } from 'src/utils';\n\ntype NestedTreePath = {\n    [key: string]: {} | NestedTreePath;\n};\n\nexport type TreePathState = NestedTreePath;\n\nexport type TreePathAction  
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"file":"treePathReducer.js","sources":["../../../../src/components/Select/reducers/treePathReducer.ts"],"sourcesContent":["import { deepCopy } from 'src/utils';\n\ntype NestedTreePath = {\n    [key: string]: {} | NestedTreePath;\n};\n\nexport type TreePathState = NestedTreePath;\n\nexport type TreePathAction =\n    | { type: 'reset' }\n    | { type: 'toggled_level'; value: string[] }\n    | { type: 'open_level'; value: string[] }\n    | { type: 'close_level'; value: string[] };\n\n// Утилита для поиска ключа в объекте по пути.\nexport const keyExists = (obj: NestedTreePath, path: string[]) => {\n    if (typeof obj !== 'object' || obj === null || !Array.isArray(path)) {\n        return false;\n    }\n\n    let current = obj;\n\n    for (let i = 0; i < path.length; i++) {\n        const key = path[i];\n\n        if (current === null || typeof current !== 'object' || !(key in current)) {\n            return false;\n        }\n\n        current = current[key];\n    }\n\n    return true;\n};\n\nfunction createObjectAtPath(obj: NestedTreePath, path: string[]) {\n    if (typeof obj !== 'object' || obj === null) {\n        return;\n    }\n\n    let current = obj;\n\n    for (let i = 0; i < path.length; i++) {\n        const key = path[i];\n\n        if (i === path.length - 1) {\n            current[key] = {};\n            break;\n        }\n\n        if (current[key] === undefined || current[key] === null) {\n            current[key] = {};\n        }\n\n        current = current[key];\n    }\n\n    return obj;\n}\n\nfunction removeObjectAtPath(obj: NestedTreePath, path: string[]) {\n    if (path.length === 0) {\n        return obj;\n    }\n\n    let current = obj;\n\n    for (let i = 0; i < path.length; i++) {\n        const key = path[i];\n\n        if (current === null || typeof current !== 'object' || !(key in current)) {\n            return obj;\n        }\n\n        if (i === path.length - 1) {\n            delete current[key];\n            break;\n        }\n\n        current = current[key];\n    }\n\n    return obj;\n}\n\nexport function treePathReducer(state: TreePathState, action: TreePathAction): TreePathState {\n    switch (action.type) {\n        case 'reset': {\n            return {};\n        }\n\n        case 'toggled_level': {\n            const stateCopy = deepCopy(state);\n\n            const isTargetLevelOpened = keyExists(stateCopy, action.value);\n\n            if (isTargetLevelOpened) {\n                // нужно закрыть текущий уровень\n                removeObjectAtPath(stateCopy, action.value);\n            } else {\n                // нужно открыть требуемый уровень\n                createObjectAtPath(stateCopy, action.value);\n            }\n\n            return stateCopy;\n        }\n\n        case 'open_level': {\n            const stateCopy = deepCopy(state);\n\n            createObjectAtPath(stateCopy, action.value);\n\n            return stateCopy;\n        }\n\n        case 'close_level': {\n            const stateCopy = deepCopy(state);\n\n            removeObjectAtPath(stateCopy, action.value);\n\n            return stateCopy;\n        }\n\n        default: {\n            return state;\n        }\n    }\n}\n"],"names":["keyExists","obj","path","_typeof","Array","isArray","current","i","length","key","createObjectAtPath","undefined","removeObjectAtPath","treePathReducer","state","action","type","stateCopy","deepCopy","isTargetLevelOpened","value"],"mappings":";;;;;;;AAcA;AACO,IAAMA,SAAS,GAAG,SAAZA,SAASA,CAAIC,GAAmB,EAAEC,IAAc,EAAK;AAC9D,EAAA,IAAIC,gCAAA,CAAOF,GAAG,CAAK,KAAA,QAAQ,IAAIA,GAAG,KAAK,IAAI,IAAI,CAACG,KAAK,CAACC,OAAO,CAACH,IAAI,CAAC,EAAE;AACjE,IAAA,OAAO,KAAK,CAAA;AAChB,GAAA;EAEA,IAAII,OAAO,GAAGL,GAAG,CAAA;AAE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CAACK,SAAS,EAAEF,MAAM,CAACK,KAAK,CAAC,CAAA;AAC/C,SAAC,MAAM;AACH;AACAV,UAAAA,kBAAkB,CAACO,SAAS,EAAEF,MAAM,CAACK,KAAK,CAAC,CAAA;AAC/C,SAAA;AAEA,QAAA,OAAOH,SAAS,CAAA;AACpB,OAAA;AAEA,IAAA,KAAK,YAAY;AAAE,MAAA;AACf,QAAA,IAAMA,UAAS,GAAGC,iBAAQ,CAACJ,KAAK,CAAC,CAAA;AAEjCJ,QAAAA,kBAAkB,CAACO,UAAS,EAAEF,MAAM,CAACK,KAAK,CAAC,CAAA;AAE3C,QAAA,OAAOH,UAAS,CAAA;AACpB,OAAA;AAEA,IAAA,KAAK,aAAa;AAAE,MAAA;AAChB,QAAA,IAAMA,WAAS,GAAGC,iBAAQ,CAACJ,KAAK,CAAC,CAAA;AAEjCF,QAAAA,kBAAkB,CAACK,WAAS,EAAEF,MAAM,CAACK,KAAK,CAAC,CAAA;AAE3C,QAAA,OAAOH,WAAS,CAAA;AACpB,OAAA;AAEA,IAAA;AAAS,MAAA;AACL,QAAA,OAAOH,KAAK,CAAA;AAChB,OAAA;AACJ,GAAA;AACJ;;;;;"}
         
     | 
| 
         @@ -34,8 +34,8 @@ var TreeList = function TreeList(_ref) { 
     | 
|
| 
       34 
34 
     | 
    
         
             
              }, beforeList, items === null || items === void 0 ? void 0 : items.map(function (item, index) {
         
     | 
| 
       35 
35 
     | 
    
         
             
                return /*#__PURE__*/React__default.default.createElement(Item.Item, {
         
     | 
| 
       36 
36 
     | 
    
         
             
                  key: index,
         
     | 
| 
       37 
     | 
    
         
            -
                   
     | 
| 
       38 
     | 
    
         
            -
                   
     | 
| 
      
 37 
     | 
    
         
            +
                  item: item,
         
     | 
| 
      
 38 
     | 
    
         
            +
                  pathToItem: [index]
         
     | 
| 
       39 
39 
     | 
    
         
             
                });
         
     | 
| 
       40 
40 
     | 
    
         
             
              }), afterList));
         
     | 
| 
       41 
41 
     | 
    
         
             
            };
         
     | 
| 
         @@ -87,7 +87,7 @@ var VirtualTreeList = function VirtualTreeList(_ref2) { 
     | 
|
| 
       87 
87 
     | 
    
         
             
                  ref: virtualizer.measureElement
         
     | 
| 
       88 
88 
     | 
    
         
             
                }, /*#__PURE__*/React__default.default.createElement(Item.Item, {
         
     | 
| 
       89 
89 
     | 
    
         
             
                  item: items[virtualRow.index],
         
     | 
| 
       90 
     | 
    
         
            -
                   
     | 
| 
      
 90 
     | 
    
         
            +
                  pathToItem: [virtualRow.index]
         
     | 
| 
       91 
91 
     | 
    
         
             
                }));
         
     | 
| 
       92 
92 
     | 
    
         
             
              })))), afterList);
         
     | 
| 
       93 
93 
     | 
    
         
             
            };
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"file":"TreeList.js","sources":["../../../../../src/components/Select/ui/TreeList/TreeList.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport { useVirtualizer } from '@tanstack/react-virtual';\nimport { getHeightAsNumber } from 'src/utils';\n\nimport { Props } from './TreeList.types';\nimport { Item } from './ui/Item/Item';\nimport { ListWrapper, ScrollContainer } from './TreeList.styles';\n\nexport const TreeList: React.FC<Props> = ({ items, listMaxHeight, onScroll, virtual, beforeList, afterList }) => {\n    if (virtual) {\n        return (\n            <VirtualTreeList\n                items={items}\n                listMaxHeight={listMaxHeight}\n                onScroll={onScroll}\n                beforeList={beforeList}\n                afterList={afterList}\n            />\n        );\n    }\n\n    return (\n        <ListWrapper>\n            <ScrollContainer listMaxHeight={listMaxHeight} onScroll={onScroll}>\n                {beforeList}\n\n                {items?.map((item, index) => {\n                    return <Item key={index}  
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"file":"TreeList.js","sources":["../../../../../src/components/Select/ui/TreeList/TreeList.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport { useVirtualizer } from '@tanstack/react-virtual';\nimport { getHeightAsNumber } from 'src/utils';\n\nimport { Props } from './TreeList.types';\nimport { Item } from './ui/Item/Item';\nimport { ListWrapper, ScrollContainer } from './TreeList.styles';\n\nexport const TreeList: React.FC<Props> = ({ items, listMaxHeight, onScroll, virtual, beforeList, afterList }) => {\n    if (virtual) {\n        return (\n            <VirtualTreeList\n                items={items}\n                listMaxHeight={listMaxHeight}\n                onScroll={onScroll}\n                beforeList={beforeList}\n                afterList={afterList}\n            />\n        );\n    }\n\n    return (\n        <ListWrapper>\n            <ScrollContainer listMaxHeight={listMaxHeight} onScroll={onScroll}>\n                {beforeList}\n\n                {items?.map((item, index) => {\n                    return <Item key={index} item={item} pathToItem={[index]} />;\n                })}\n\n                {afterList}\n            </ScrollContainer>\n        </ListWrapper>\n    );\n};\n\nconst VirtualTreeList: React.FC<Props> = ({ items = [], listMaxHeight, onScroll, beforeList, afterList }) => {\n    const parentRef = useRef<HTMLDivElement>(null);\n\n    const virtualizer = useVirtualizer({\n        count: items.length,\n        getScrollElement: () => parentRef.current,\n        estimateSize: () => 48,\n    });\n\n    const virtualItems = virtualizer.getVirtualItems();\n\n    return (\n        <ListWrapper>\n            {beforeList}\n\n            <div\n                ref={parentRef}\n                style={{\n                    height: 'auto',\n                    maxHeight: getHeightAsNumber(listMaxHeight),\n                    overflowY: 'auto',\n                }}\n                onScroll={onScroll}\n            >\n                <div\n                    style={{\n                        height: virtualizer.getTotalSize(),\n                        width: '100%',\n                        position: 'relative',\n                    }}\n                >\n                    <div\n                        style={{\n                            position: 'absolute',\n                            top: 0,\n                            left: 0,\n                            width: '100%',\n                            transform: `translateY(${virtualItems[0]?.start ?? 0}px)`,\n                        }}\n                    >\n                        {virtualItems.map((virtualRow) => (\n                            <div\n                                key={virtualRow.key as React.Key}\n                                data-index={virtualRow.index}\n                                ref={virtualizer.measureElement}\n                            >\n                                <Item item={items[virtualRow.index]} pathToItem={[virtualRow.index]} />\n                            </div>\n                        ))}\n                    </div>\n                </div>\n            </div>\n\n            {afterList}\n        </ListWrapper>\n    );\n};\n"],"names":["TreeList","_ref","items","listMaxHeight","onScroll","virtual","beforeList","afterList","React","createElement","VirtualTreeList","ListWrapper","ScrollContainer","map","item","index","Item","key","pathToItem","_ref2","_virtualItems$0$start","_virtualItems$","_ref2$items","parentRef","useRef","virtualizer","useVirtualizer","count","length","getScrollElement","current","estimateSize","virtualItems","getVirtualItems","ref","style","height","maxHeight","getHeightAsNumber","overflowY","getTotalSize","width","position","top","left","transform","concat","start","virtualRow","measureElement"],"mappings":";;;;;;;;;;;;;;IAQaA,QAAyB,GAAG,SAA5BA,QAAyBA,CAAAC,IAAA,EAA2E;AAAA,EAAA,IAArEC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,aAAa,GAAAF,IAAA,CAAbE,aAAa;IAAEC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IAAEC,OAAO,GAAAJ,IAAA,CAAPI,OAAO;IAAEC,UAAU,GAAAL,IAAA,CAAVK,UAAU;IAAEC,SAAS,GAAAN,IAAA,CAATM,SAAS,CAAA;AACtG,EAAA,IAAIF,OAAO,EAAE;AACT,IAAA,oBACIG,sBAAA,CAAAC,aAAA,CAACC,eAAe,EAAA;AACZR,MAAAA,KAAK,EAAEA,KAAM;AACbC,MAAAA,aAAa,EAAEA,aAAc;AAC7BC,MAAAA,QAAQ,EAAEA,QAAS;AACnBE,MAAAA,UAAU,EAAEA,UAAW;AACvBC,MAAAA,SAAS,EAAEA,SAAAA;AAAU,KACxB,CAAC,CAAA;AAEV,GAAA;EAEA,oBACIC,sBAAA,CAAAC,aAAA,CAACE,2BAAW,qBACRH,sBAAA,CAAAC,aAAA,CAACG,+BAAe,EAAA;AAACT,IAAAA,aAAa,EAAEA,aAAc;AAACC,IAAAA,QAAQ,EAAEA,QAAAA;AAAS,GAAA,EAC7DE,UAAU,EAEVJ,KAAK,KAAA,IAAA,IAALA,KAAK,KAALA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,KAAK,CAAEW,GAAG,CAAC,UAACC,IAAI,EAAEC,KAAK,EAAK;AACzB,IAAA,oBA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