@salutejs/plasma-new-hope 0.340.0-canary.2305.18873573377.0 → 0.340.0-canary.2314.19038910206.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.css +19 -0
 - package/cjs/components/Combobox/ComboboxNew/Combobox.js +78 -15
 - package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
 - package/cjs/components/Combobox/ComboboxNew/Combobox.tokens.js +2 -0
 - package/cjs/components/Combobox/ComboboxNew/Combobox.tokens.js.map +1 -1
 - package/cjs/components/Combobox/ComboboxNew/hooks/getPathMaps.js +8 -2
 - package/cjs/components/Combobox/ComboboxNew/hooks/getPathMaps.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 +135 -0
 - package/cjs/components/Combobox/ComboboxNew/reducers/treePathReducer.js.map +1 -0
 - package/cjs/components/Combobox/ComboboxNew/ui/TreeList/TreeList.css +57 -0
 - package/cjs/components/Combobox/ComboboxNew/ui/TreeList/TreeList.js +96 -0
 - package/cjs/components/Combobox/ComboboxNew/ui/TreeList/TreeList.js.map +1 -0
 - package/cjs/components/Combobox/ComboboxNew/ui/TreeList/TreeList.styles.js +30 -0
 - package/cjs/components/Combobox/ComboboxNew/ui/TreeList/TreeList.styles.js.map +1 -0
 - package/cjs/components/Combobox/ComboboxNew/ui/TreeList/TreeList.styles_1auklgl.css +2 -0
 - package/cjs/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.css +54 -0
 - package/cjs/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.js +144 -0
 - package/cjs/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.js.map +1 -0
 - package/cjs/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.styles.js +205 -0
 - package/cjs/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.styles.js.map +1 -0
 - package/cjs/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.styles_7nhjnm.css +15 -0
 - 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.css +19 -0
 - 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 +66 -13
 - package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.tokens.js +2 -0
 - package/emotion/cjs/components/Combobox/ComboboxNew/hooks/getPathMaps.js +35 -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/index.js +1 -0
 - package/emotion/cjs/components/Combobox/ComboboxNew/reducers/treePathReducer.js +152 -0
 - package/emotion/cjs/components/Combobox/ComboboxNew/ui/TreeList/TreeList.js +130 -0
 - package/emotion/cjs/components/Combobox/ComboboxNew/ui/TreeList/TreeList.styles.js +36 -0
 - package/emotion/cjs/components/Combobox/ComboboxNew/ui/TreeList/TreeList.types.js +4 -0
 - package/emotion/cjs/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.js +192 -0
 - package/emotion/cjs/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.styles.js +183 -0
 - package/emotion/cjs/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.types.js +4 -0
 - package/emotion/cjs/components/Combobox/ComboboxNew/ui/index.js +1 -0
 - 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/examples/components/Combobox/Combobox.config.js +15 -15
 - package/emotion/cjs/utils/index.js +4 -0
 - package/emotion/cjs/utils/isArraysEqual.js +15 -0
 - package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +68 -15
 - package/emotion/es/components/Combobox/ComboboxNew/Combobox.tokens.js +2 -0
 - package/emotion/es/components/Combobox/ComboboxNew/hooks/getPathMaps.js +35 -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/index.js +1 -0
 - package/emotion/es/components/Combobox/ComboboxNew/reducers/treePathReducer.js +135 -0
 - package/emotion/es/components/Combobox/ComboboxNew/ui/TreeList/TreeList.js +79 -0
 - package/emotion/es/components/Combobox/ComboboxNew/ui/TreeList/TreeList.styles.js +13 -0
 - package/emotion/es/components/Combobox/ComboboxNew/ui/TreeList/TreeList.types.js +1 -0
 - package/emotion/es/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.js +141 -0
 - package/emotion/es/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.styles.js +119 -0
 - package/emotion/es/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.types.js +1 -0
 - package/emotion/es/components/Combobox/ComboboxNew/ui/index.js +1 -0
 - 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/examples/components/Combobox/Combobox.config.js +15 -15
 - package/emotion/es/utils/index.js +1 -0
 - package/emotion/es/utils/isArraysEqual.js +5 -0
 - package/es/components/Combobox/ComboboxNew/Combobox.css +19 -0
 - package/es/components/Combobox/ComboboxNew/Combobox.js +79 -16
 - package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
 - package/es/components/Combobox/ComboboxNew/Combobox.tokens.js +2 -0
 - package/es/components/Combobox/ComboboxNew/Combobox.tokens.js.map +1 -1
 - package/es/components/Combobox/ComboboxNew/hooks/getPathMaps.js +8 -2
 - package/es/components/Combobox/ComboboxNew/hooks/getPathMaps.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 +130 -0
 - package/es/components/Combobox/ComboboxNew/reducers/treePathReducer.js.map +1 -0
 - package/es/components/Combobox/ComboboxNew/ui/TreeList/TreeList.css +57 -0
 - package/es/components/Combobox/ComboboxNew/ui/TreeList/TreeList.js +88 -0
 - package/es/components/Combobox/ComboboxNew/ui/TreeList/TreeList.js.map +1 -0
 - package/es/components/Combobox/ComboboxNew/ui/TreeList/TreeList.styles.js +25 -0
 - package/es/components/Combobox/ComboboxNew/ui/TreeList/TreeList.styles.js.map +1 -0
 - package/es/components/Combobox/ComboboxNew/ui/TreeList/TreeList.styles_1auklgl.css +2 -0
 - package/es/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.css +54 -0
 - package/es/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.js +136 -0
 - package/es/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.js.map +1 -0
 - package/es/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.styles.js +187 -0
 - package/es/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.styles.js.map +1 -0
 - package/es/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.styles_7nhjnm.css +15 -0
 - 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.css +19 -0
 - 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 +4 -4
 - package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +66 -13
 - package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.tokens.js +2 -0
 - package/styled-components/cjs/components/Combobox/ComboboxNew/hooks/getPathMaps.js +35 -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/index.js +1 -0
 - package/styled-components/cjs/components/Combobox/ComboboxNew/reducers/treePathReducer.js +152 -0
 - package/styled-components/cjs/components/Combobox/ComboboxNew/ui/TreeList/TreeList.js +130 -0
 - package/styled-components/cjs/components/Combobox/ComboboxNew/ui/TreeList/TreeList.styles.js +50 -0
 - package/styled-components/cjs/components/Combobox/ComboboxNew/ui/TreeList/TreeList.types.js +4 -0
 - package/styled-components/cjs/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.js +192 -0
 - package/styled-components/cjs/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.styles.js +296 -0
 - package/styled-components/cjs/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.types.js +4 -0
 - package/styled-components/cjs/components/Combobox/ComboboxNew/ui/index.js +1 -0
 - 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/examples/components/Combobox/Combobox.config.js +12 -4
 - 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 +68 -15
 - package/styled-components/es/components/Combobox/ComboboxNew/Combobox.tokens.js +2 -0
 - package/styled-components/es/components/Combobox/ComboboxNew/hooks/getPathMaps.js +35 -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/index.js +1 -0
 - package/styled-components/es/components/Combobox/ComboboxNew/reducers/treePathReducer.js +135 -0
 - package/styled-components/es/components/Combobox/ComboboxNew/ui/TreeList/TreeList.js +79 -0
 - package/styled-components/es/components/Combobox/ComboboxNew/ui/TreeList/TreeList.styles.js +27 -0
 - package/styled-components/es/components/Combobox/ComboboxNew/ui/TreeList/TreeList.types.js +1 -0
 - package/styled-components/es/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.js +141 -0
 - package/styled-components/es/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.styles.js +232 -0
 - package/styled-components/es/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.types.js +1 -0
 - package/styled-components/es/components/Combobox/ComboboxNew/ui/index.js +1 -0
 - 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.config.js +12 -4
 - 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/Combobox.tokens.d.ts +2 -0
 - package/types/components/Combobox/ComboboxNew/Combobox.tokens.d.ts.map +1 -1
 - package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts +17 -3
 - package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts.map +1 -1
 - package/types/components/Combobox/ComboboxNew/hooks/getPathMaps.d.ts +2 -1
 - package/types/components/Combobox/ComboboxNew/hooks/getPathMaps.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/index.d.ts +1 -0
 - package/types/components/Combobox/ComboboxNew/reducers/index.d.ts.map +1 -1
 - package/types/components/Combobox/ComboboxNew/reducers/treePathReducer.d.ts +24 -0
 - package/types/components/Combobox/ComboboxNew/reducers/treePathReducer.d.ts.map +1 -0
 - package/types/components/Combobox/ComboboxNew/ui/TreeList/TreeList.d.ts +4 -0
 - package/types/components/Combobox/ComboboxNew/ui/TreeList/TreeList.d.ts.map +1 -0
 - package/types/components/Combobox/ComboboxNew/ui/TreeList/TreeList.styles.d.ts +6 -0
 - package/types/components/Combobox/ComboboxNew/ui/TreeList/TreeList.styles.d.ts.map +1 -0
 - package/types/components/Combobox/ComboboxNew/ui/TreeList/TreeList.types.d.ts +11 -0
 - package/types/components/Combobox/ComboboxNew/ui/TreeList/TreeList.types.d.ts.map +1 -0
 - package/types/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.d.ts +4 -0
 - package/types/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.d.ts.map +1 -0
 - package/types/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.styles.d.ts +62 -0
 - package/types/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.styles.d.ts.map +1 -0
 - package/types/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.types.d.ts +6 -0
 - package/types/components/Combobox/ComboboxNew/ui/TreeList/ui/Item/Item.types.d.ts.map +1 -0
 - package/types/components/Combobox/ComboboxNew/ui/index.d.ts +1 -0
 - package/types/components/Combobox/ComboboxNew/ui/index.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 -9
 - package/types/components/Select/ui/TreeList/ui/Item/Item.types.d.ts.map +1 -1
 - package/types/examples/components/Combobox/Combobox.config.d.ts.map +1 -1
 - package/types/examples/components/Combobox/Combobox.d.ts +48 -0
 - package/types/examples/components/Combobox/Combobox.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
 
| 
         @@ -1,4 +1,30 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            function _array_like_to_array(arr, len) {
         
     | 
| 
      
 2 
     | 
    
         
            +
                if (len == null || len > arr.length) len = arr.length;
         
     | 
| 
      
 3 
     | 
    
         
            +
                for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
         
     | 
| 
      
 4 
     | 
    
         
            +
                return arr2;
         
     | 
| 
      
 5 
     | 
    
         
            +
            }
         
     | 
| 
      
 6 
     | 
    
         
            +
            function _array_without_holes(arr) {
         
     | 
| 
      
 7 
     | 
    
         
            +
                if (Array.isArray(arr)) return _array_like_to_array(arr);
         
     | 
| 
      
 8 
     | 
    
         
            +
            }
         
     | 
| 
      
 9 
     | 
    
         
            +
            function _iterable_to_array(iter) {
         
     | 
| 
      
 10 
     | 
    
         
            +
                if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
         
     | 
| 
      
 11 
     | 
    
         
            +
            }
         
     | 
| 
      
 12 
     | 
    
         
            +
            function _non_iterable_spread() {
         
     | 
| 
      
 13 
     | 
    
         
            +
                throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
         
     | 
| 
      
 14 
     | 
    
         
            +
            }
         
     | 
| 
      
 15 
     | 
    
         
            +
            function _to_consumable_array(arr) {
         
     | 
| 
      
 16 
     | 
    
         
            +
                return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
         
     | 
| 
      
 17 
     | 
    
         
            +
            }
         
     | 
| 
      
 18 
     | 
    
         
            +
            function _unsupported_iterable_to_array(o, minLen) {
         
     | 
| 
      
 19 
     | 
    
         
            +
                if (!o) return;
         
     | 
| 
      
 20 
     | 
    
         
            +
                if (typeof o === "string") return _array_like_to_array(o, minLen);
         
     | 
| 
      
 21 
     | 
    
         
            +
                var n = Object.prototype.toString.call(o).slice(8, -1);
         
     | 
| 
      
 22 
     | 
    
         
            +
                if (n === "Object" && o.constructor) n = o.constructor.name;
         
     | 
| 
      
 23 
     | 
    
         
            +
                if (n === "Map" || n === "Set") return Array.from(n);
         
     | 
| 
      
 24 
     | 
    
         
            +
                if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
         
     | 
| 
      
 25 
     | 
    
         
            +
            }
         
     | 
| 
       1 
26 
     | 
    
         
             
            import { isEmpty } from "../../../../utils";
         
     | 
| 
      
 27 
     | 
    
         
            +
            import { keyExists } from "../../../Select/reducers";
         
     | 
| 
       2 
28 
     | 
    
         
             
            var JUMP_SIZE = 10;
         
     | 
| 
       3 
29 
     | 
    
         
             
            export var keys = {
         
     | 
| 
       4 
30 
     | 
    
         
             
                Enter: 'Enter',
         
     | 
| 
         @@ -21,7 +47,53 @@ export var getItemByFocused = function(focusedPath, focusedToValueMap) { 
     | 
|
| 
       21 
47 
     | 
    
         
             
                }, '').replace(/^(\/)/, '');
         
     | 
| 
       22 
48 
     | 
    
         
             
                return focusedToValueMap.get(focusedPathAsString);
         
     | 
| 
       23 
49 
     | 
    
         
             
            };
         
     | 
| 
      
 50 
     | 
    
         
            +
            // #TODO: подумать над идеей выноса логики фокуса непосредственно в focusedPathReducer.
         
     | 
| 
       24 
51 
     | 
    
         
             
            export var useKeyNavigation = function(param) {
         
     | 
| 
      
 52 
     | 
    
         
            +
                var focusedPath = param.focusedPath, dispatchFocusedPath = param.dispatchFocusedPath, path = param.path, dispatchPath = param.dispatchPath, pathMap = param.pathMap, focusedToValueMap = param.focusedToValueMap, handleListToggle = param.handleListToggle, handlePressDown = param.handlePressDown, setTextValue = param.setTextValue, multiple = param.multiple, value = param.value, textValue = param.textValue, valueToItemMap = param.valueToItemMap, treePath = param.treePath, dispatchTreePath = param.dispatchTreePath, treeView = param.treeView, valueToPathMap = param.valueToPathMap, items = param.items;
         
     | 
| 
      
 53 
     | 
    
         
            +
                if (treeView) {
         
     | 
| 
      
 54 
     | 
    
         
            +
                    return keyboardNavigationTree({
         
     | 
| 
      
 55 
     | 
    
         
            +
                        focusedPath: focusedPath,
         
     | 
| 
      
 56 
     | 
    
         
            +
                        dispatchFocusedPath: dispatchFocusedPath,
         
     | 
| 
      
 57 
     | 
    
         
            +
                        path: path,
         
     | 
| 
      
 58 
     | 
    
         
            +
                        dispatchPath: dispatchPath,
         
     | 
| 
      
 59 
     | 
    
         
            +
                        pathMap: pathMap,
         
     | 
| 
      
 60 
     | 
    
         
            +
                        focusedToValueMap: focusedToValueMap,
         
     | 
| 
      
 61 
     | 
    
         
            +
                        handleListToggle: handleListToggle,
         
     | 
| 
      
 62 
     | 
    
         
            +
                        handlePressDown: handlePressDown,
         
     | 
| 
      
 63 
     | 
    
         
            +
                        setTextValue: setTextValue,
         
     | 
| 
      
 64 
     | 
    
         
            +
                        multiple: multiple,
         
     | 
| 
      
 65 
     | 
    
         
            +
                        value: value,
         
     | 
| 
      
 66 
     | 
    
         
            +
                        textValue: textValue,
         
     | 
| 
      
 67 
     | 
    
         
            +
                        valueToItemMap: valueToItemMap,
         
     | 
| 
      
 68 
     | 
    
         
            +
                        treePath: treePath,
         
     | 
| 
      
 69 
     | 
    
         
            +
                        dispatchTreePath: dispatchTreePath,
         
     | 
| 
      
 70 
     | 
    
         
            +
                        treeView: treeView,
         
     | 
| 
      
 71 
     | 
    
         
            +
                        valueToPathMap: valueToPathMap,
         
     | 
| 
      
 72 
     | 
    
         
            +
                        items: items
         
     | 
| 
      
 73 
     | 
    
         
            +
                    });
         
     | 
| 
      
 74 
     | 
    
         
            +
                }
         
     | 
| 
      
 75 
     | 
    
         
            +
                return keyboardNavigationDefault({
         
     | 
| 
      
 76 
     | 
    
         
            +
                    focusedPath: focusedPath,
         
     | 
| 
      
 77 
     | 
    
         
            +
                    dispatchFocusedPath: dispatchFocusedPath,
         
     | 
| 
      
 78 
     | 
    
         
            +
                    path: path,
         
     | 
| 
      
 79 
     | 
    
         
            +
                    dispatchPath: dispatchPath,
         
     | 
| 
      
 80 
     | 
    
         
            +
                    pathMap: pathMap,
         
     | 
| 
      
 81 
     | 
    
         
            +
                    focusedToValueMap: focusedToValueMap,
         
     | 
| 
      
 82 
     | 
    
         
            +
                    handleListToggle: handleListToggle,
         
     | 
| 
      
 83 
     | 
    
         
            +
                    handlePressDown: handlePressDown,
         
     | 
| 
      
 84 
     | 
    
         
            +
                    setTextValue: setTextValue,
         
     | 
| 
      
 85 
     | 
    
         
            +
                    multiple: multiple,
         
     | 
| 
      
 86 
     | 
    
         
            +
                    value: value,
         
     | 
| 
      
 87 
     | 
    
         
            +
                    textValue: textValue,
         
     | 
| 
      
 88 
     | 
    
         
            +
                    valueToItemMap: valueToItemMap,
         
     | 
| 
      
 89 
     | 
    
         
            +
                    treePath: treePath,
         
     | 
| 
      
 90 
     | 
    
         
            +
                    dispatchTreePath: dispatchTreePath,
         
     | 
| 
      
 91 
     | 
    
         
            +
                    treeView: treeView,
         
     | 
| 
      
 92 
     | 
    
         
            +
                    valueToPathMap: valueToPathMap,
         
     | 
| 
      
 93 
     | 
    
         
            +
                    items: items
         
     | 
| 
      
 94 
     | 
    
         
            +
                });
         
     | 
| 
      
 95 
     | 
    
         
            +
            };
         
     | 
| 
      
 96 
     | 
    
         
            +
            var keyboardNavigationDefault = function(param) {
         
     | 
| 
       25 
97 
     | 
    
         
             
                var focusedPath = param.focusedPath, dispatchFocusedPath = param.dispatchFocusedPath, path = param.path, dispatchPath = param.dispatchPath, pathMap = param.pathMap, focusedToValueMap = param.focusedToValueMap, handleListToggle = param.handleListToggle, handlePressDown = param.handlePressDown, setTextValue = param.setTextValue, multiple = param.multiple, value = param.value, textValue = param.textValue, valueToItemMap = param.valueToItemMap;
         
     | 
| 
       26 
98 
     | 
    
         
             
                var currentIndex = (focusedPath === null || focusedPath === void 0 ? void 0 : focusedPath[focusedPath.length - 1]) || 0;
         
     | 
| 
       27 
99 
     | 
    
         
             
                var currentLength = pathMap.get(path === null || path === void 0 ? void 0 : path[focusedPath.length - 1]) || 0;
         
     | 
| 
         @@ -280,3 +352,244 @@ export var useKeyNavigation = function(param) { 
     | 
|
| 
       280 
352 
     | 
    
         
             
                    onKeyDown: onKeyDown
         
     | 
| 
       281 
353 
     | 
    
         
             
                };
         
     | 
| 
       282 
354 
     | 
    
         
             
            };
         
     | 
| 
      
 355 
     | 
    
         
            +
            var keyboardNavigationTree = function(param) {
         
     | 
| 
      
 356 
     | 
    
         
            +
                var focusedPath = param.focusedPath, dispatchFocusedPath = param.dispatchFocusedPath, path = param.path, dispatchPath = param.dispatchPath, pathMap = param.pathMap, focusedToValueMap = param.focusedToValueMap, handleListToggle = param.handleListToggle, handlePressDown = param.handlePressDown, setTextValue = param.setTextValue, multiple = param.multiple, value = param.value, textValue = param.textValue, valueToItemMap = param.valueToItemMap, treePath = param.treePath, dispatchTreePath = param.dispatchTreePath, valueToPathMap = param.valueToPathMap, items = param.items;
         
     | 
| 
      
 357 
     | 
    
         
            +
                var _currentItem_parent_items, _currentItem_parent;
         
     | 
| 
      
 358 
     | 
    
         
            +
                var currentItem = getItemByFocused(focusedPath, focusedToValueMap);
         
     | 
| 
      
 359 
     | 
    
         
            +
                var currentIndex = (focusedPath === null || focusedPath === void 0 ? void 0 : focusedPath[focusedPath.length - 1]) || 0;
         
     | 
| 
      
 360 
     | 
    
         
            +
                var currentLength = (currentItem === null || currentItem === void 0 ? void 0 : (_currentItem_parent = currentItem.parent) === null || _currentItem_parent === void 0 ? void 0 : (_currentItem_parent_items = _currentItem_parent.items) === null || _currentItem_parent_items === void 0 ? void 0 : _currentItem_parent_items.length) || pathMap.get('root') || 0;
         
     | 
| 
      
 361 
     | 
    
         
            +
                var isValidFocus = function(focusCandidate) {
         
     | 
| 
      
 362 
     | 
    
         
            +
                    if (!Array.isArray(items) || !Array.isArray(focusCandidate)) return false;
         
     | 
| 
      
 363 
     | 
    
         
            +
                    var currentLevel = items;
         
     | 
| 
      
 364 
     | 
    
         
            +
                    var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
         
     | 
| 
      
 365 
     | 
    
         
            +
                    try {
         
     | 
| 
      
 366 
     | 
    
         
            +
                        for(var _iterator = focusCandidate[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
         
     | 
| 
      
 367 
     | 
    
         
            +
                            var index = _step.value;
         
     | 
| 
      
 368 
     | 
    
         
            +
                            if (!Array.isArray(currentLevel) || index >= currentLevel.length) {
         
     | 
| 
      
 369 
     | 
    
         
            +
                                return false;
         
     | 
| 
      
 370 
     | 
    
         
            +
                            }
         
     | 
| 
      
 371 
     | 
    
         
            +
                            var node = currentLevel[index];
         
     | 
| 
      
 372 
     | 
    
         
            +
                            currentLevel = node.items || [];
         
     | 
| 
      
 373 
     | 
    
         
            +
                        }
         
     | 
| 
      
 374 
     | 
    
         
            +
                    } catch (err) {
         
     | 
| 
      
 375 
     | 
    
         
            +
                        _didIteratorError = true;
         
     | 
| 
      
 376 
     | 
    
         
            +
                        _iteratorError = err;
         
     | 
| 
      
 377 
     | 
    
         
            +
                    } finally{
         
     | 
| 
      
 378 
     | 
    
         
            +
                        try {
         
     | 
| 
      
 379 
     | 
    
         
            +
                            if (!_iteratorNormalCompletion && _iterator.return != null) {
         
     | 
| 
      
 380 
     | 
    
         
            +
                                _iterator.return();
         
     | 
| 
      
 381 
     | 
    
         
            +
                            }
         
     | 
| 
      
 382 
     | 
    
         
            +
                        } finally{
         
     | 
| 
      
 383 
     | 
    
         
            +
                            if (_didIteratorError) {
         
     | 
| 
      
 384 
     | 
    
         
            +
                                throw _iteratorError;
         
     | 
| 
      
 385 
     | 
    
         
            +
                            }
         
     | 
| 
      
 386 
     | 
    
         
            +
                        }
         
     | 
| 
      
 387 
     | 
    
         
            +
                    }
         
     | 
| 
      
 388 
     | 
    
         
            +
                    return true;
         
     | 
| 
      
 389 
     | 
    
         
            +
                };
         
     | 
| 
      
 390 
     | 
    
         
            +
                var onKeyDown = function(event) {
         
     | 
| 
      
 391 
     | 
    
         
            +
                    switch(event.code){
         
     | 
| 
      
 392 
     | 
    
         
            +
                        case keys.ArrowUp:
         
     | 
| 
      
 393 
     | 
    
         
            +
                            {
         
     | 
| 
      
 394 
     | 
    
         
            +
                                if (path[0]) {
         
     | 
| 
      
 395 
     | 
    
         
            +
                                    event.stopPropagation();
         
     | 
| 
      
 396 
     | 
    
         
            +
                                    event.preventDefault();
         
     | 
| 
      
 397 
     | 
    
         
            +
                                }
         
     | 
| 
      
 398 
     | 
    
         
            +
                                /**
         
     | 
| 
      
 399 
     | 
    
         
            +
                             * Если список открыт и фокус уже установлен на каком-либо элементе.
         
     | 
| 
      
 400 
     | 
    
         
            +
                             * */ if (focusedPath.length) {
         
     | 
| 
      
 401 
     | 
    
         
            +
                                    /**
         
     | 
| 
      
 402 
     | 
    
         
            +
                                 * Если это не первый элемент, то нужно вначале найти элемент для фокуса.
         
     | 
| 
      
 403 
     | 
    
         
            +
                                 * Т.к. если верхний элемент раскрыт, то и перемещаться нужно не на него,
         
     | 
| 
      
 404 
     | 
    
         
            +
                                 * а на его самый нижний дочерний элемент.
         
     | 
| 
      
 405 
     | 
    
         
            +
                                 * */ if (currentIndex > 0) {
         
     | 
| 
      
 406 
     | 
    
         
            +
                                        var nextFocus = _to_consumable_array(focusedPath.slice(0, -1)).concat([
         
     | 
| 
      
 407 
     | 
    
         
            +
                                            currentIndex - 1
         
     | 
| 
      
 408 
     | 
    
         
            +
                                        ]);
         
     | 
| 
      
 409 
     | 
    
         
            +
                                        for(var i = 0; i <= focusedPath.length; i++){
         
     | 
| 
      
 410 
     | 
    
         
            +
                                            var focusedPathAsString = nextFocus.reduce(function(acc, n) {
         
     | 
| 
      
 411 
     | 
    
         
            +
                                                return "".concat(acc, "/").concat(n);
         
     | 
| 
      
 412 
     | 
    
         
            +
                                            }, '').replace(/^(\/)/, '');
         
     | 
| 
      
 413 
     | 
    
         
            +
                                            var item = focusedToValueMap.get(focusedPathAsString);
         
     | 
| 
      
 414 
     | 
    
         
            +
                                            var isLevelOpened = keyExists(treePath, valueToPathMap.get(item === null || item === void 0 ? void 0 : item.value.toString()) || []);
         
     | 
| 
      
 415 
     | 
    
         
            +
                                            if (isLevelOpened) {
         
     | 
| 
      
 416 
     | 
    
         
            +
                                                var _item_items;
         
     | 
| 
      
 417 
     | 
    
         
            +
                                                nextFocus = _to_consumable_array(nextFocus).concat([
         
     | 
| 
      
 418 
     | 
    
         
            +
                                                    ((item === null || item === void 0 ? void 0 : (_item_items = item.items) === null || _item_items === void 0 ? void 0 : _item_items.length) || 0) - 1
         
     | 
| 
      
 419 
     | 
    
         
            +
                                                ]);
         
     | 
| 
      
 420 
     | 
    
         
            +
                                            } else {
         
     | 
| 
      
 421 
     | 
    
         
            +
                                                break;
         
     | 
| 
      
 422 
     | 
    
         
            +
                                            }
         
     | 
| 
      
 423 
     | 
    
         
            +
                                        }
         
     | 
| 
      
 424 
     | 
    
         
            +
                                        dispatchFocusedPath({
         
     | 
| 
      
 425 
     | 
    
         
            +
                                            type: 'set_focus',
         
     | 
| 
      
 426 
     | 
    
         
            +
                                            value: nextFocus
         
     | 
| 
      
 427 
     | 
    
         
            +
                                        });
         
     | 
| 
      
 428 
     | 
    
         
            +
                                    } else {
         
     | 
| 
      
 429 
     | 
    
         
            +
                                        /**
         
     | 
| 
      
 430 
     | 
    
         
            +
                                     * Если элемент первый, то нужно лишь подняться к его родителю.
         
     | 
| 
      
 431 
     | 
    
         
            +
                                     * */ dispatchFocusedPath({
         
     | 
| 
      
 432 
     | 
    
         
            +
                                            type: 'return_prev_focus'
         
     | 
| 
      
 433 
     | 
    
         
            +
                                        });
         
     | 
| 
      
 434 
     | 
    
         
            +
                                    }
         
     | 
| 
      
 435 
     | 
    
         
            +
                                } else {
         
     | 
| 
      
 436 
     | 
    
         
            +
                                    /**
         
     | 
| 
      
 437 
     | 
    
         
            +
                                 * Если список закрыт, то нужно его открыть и установить фокус на первый элемент.
         
     | 
| 
      
 438 
     | 
    
         
            +
                                 * */ dispatchPath({
         
     | 
| 
      
 439 
     | 
    
         
            +
                                        type: 'opened_first_level'
         
     | 
| 
      
 440 
     | 
    
         
            +
                                    });
         
     | 
| 
      
 441 
     | 
    
         
            +
                                    dispatchFocusedPath({
         
     | 
| 
      
 442 
     | 
    
         
            +
                                        type: 'set_initial_focus'
         
     | 
| 
      
 443 
     | 
    
         
            +
                                    });
         
     | 
| 
      
 444 
     | 
    
         
            +
                                    handleListToggle(true);
         
     | 
| 
      
 445 
     | 
    
         
            +
                                }
         
     | 
| 
      
 446 
     | 
    
         
            +
                                break;
         
     | 
| 
      
 447 
     | 
    
         
            +
                            }
         
     | 
| 
      
 448 
     | 
    
         
            +
                        case keys.ArrowDown:
         
     | 
| 
      
 449 
     | 
    
         
            +
                            {
         
     | 
| 
      
 450 
     | 
    
         
            +
                                if (path[0]) {
         
     | 
| 
      
 451 
     | 
    
         
            +
                                    event.stopPropagation();
         
     | 
| 
      
 452 
     | 
    
         
            +
                                    event.preventDefault();
         
     | 
| 
      
 453 
     | 
    
         
            +
                                }
         
     | 
| 
      
 454 
     | 
    
         
            +
                                /**
         
     | 
| 
      
 455 
     | 
    
         
            +
                             * Если список открыт и фокус уже установлен на каком-либо элементе.
         
     | 
| 
      
 456 
     | 
    
         
            +
                             * */ if (focusedPath.length) {
         
     | 
| 
      
 457 
     | 
    
         
            +
                                    /**
         
     | 
| 
      
 458 
     | 
    
         
            +
                                 * Заходим сюда если у элемента есть другие вложенные элементы.
         
     | 
| 
      
 459 
     | 
    
         
            +
                                 * */ if ((currentItem === null || currentItem === void 0 ? void 0 : currentItem.items) && (currentItem === null || currentItem === void 0 ? void 0 : currentItem.items.length)) {
         
     | 
| 
      
 460 
     | 
    
         
            +
                                        var isCurrentLevelOpened = keyExists(treePath, valueToPathMap.get(currentItem.value.toString()) || []);
         
     | 
| 
      
 461 
     | 
    
         
            +
                                        /**
         
     | 
| 
      
 462 
     | 
    
         
            +
                                     * Если у этого элемента открыт его дочерний список,
         
     | 
| 
      
 463 
     | 
    
         
            +
                                     * то устанавливаем фокус на первый элемент из этого списка
         
     | 
| 
      
 464 
     | 
    
         
            +
                                     * и сразу же выходим из обработчика события.
         
     | 
| 
      
 465 
     | 
    
         
            +
                                     * */ if (isCurrentLevelOpened) {
         
     | 
| 
      
 466 
     | 
    
         
            +
                                            dispatchFocusedPath({
         
     | 
| 
      
 467 
     | 
    
         
            +
                                                type: 'add_focus',
         
     | 
| 
      
 468 
     | 
    
         
            +
                                                value: 0
         
     | 
| 
      
 469 
     | 
    
         
            +
                                            });
         
     | 
| 
      
 470 
     | 
    
         
            +
                                            break;
         
     | 
| 
      
 471 
     | 
    
         
            +
                                        }
         
     | 
| 
      
 472 
     | 
    
         
            +
                                    }
         
     | 
| 
      
 473 
     | 
    
         
            +
                                    /**
         
     | 
| 
      
 474 
     | 
    
         
            +
                                 * Если мы еще не достигли конца списка, то движемся к следующему элементу.
         
     | 
| 
      
 475 
     | 
    
         
            +
                                 * */ if (currentIndex + 1 < currentLength) {
         
     | 
| 
      
 476 
     | 
    
         
            +
                                        dispatchFocusedPath({
         
     | 
| 
      
 477 
     | 
    
         
            +
                                            type: 'change_last_focus',
         
     | 
| 
      
 478 
     | 
    
         
            +
                                            value: currentIndex + 1
         
     | 
| 
      
 479 
     | 
    
         
            +
                                        });
         
     | 
| 
      
 480 
     | 
    
         
            +
                                    } else {
         
     | 
| 
      
 481 
     | 
    
         
            +
                                        /**
         
     | 
| 
      
 482 
     | 
    
         
            +
                                     * Если же достигли последнего элемента на текущем уровне, то нужно определить,
         
     | 
| 
      
 483 
     | 
    
         
            +
                                     * на какой из элементов ниже мы перейдем.
         
     | 
| 
      
 484 
     | 
    
         
            +
                                     * Переход фокуса отсюда может быть только на уровни выше, при чем сразу на несколько.
         
     | 
| 
      
 485 
     | 
    
         
            +
                                     * */ var focusCandidate = _to_consumable_array(focusedPath);
         
     | 
| 
      
 486 
     | 
    
         
            +
                                        var nextFocus1 = null;
         
     | 
| 
      
 487 
     | 
    
         
            +
                                        while(focusCandidate.length > 1){
         
     | 
| 
      
 488 
     | 
    
         
            +
                                            focusCandidate = _to_consumable_array(focusCandidate.slice(0, -2)).concat([
         
     | 
| 
      
 489 
     | 
    
         
            +
                                                (focusCandidate.at(-2) || 0) + 1
         
     | 
| 
      
 490 
     | 
    
         
            +
                                            ]);
         
     | 
| 
      
 491 
     | 
    
         
            +
                                            if (isValidFocus(focusCandidate)) {
         
     | 
| 
      
 492 
     | 
    
         
            +
                                                nextFocus1 = focusCandidate;
         
     | 
| 
      
 493 
     | 
    
         
            +
                                                break;
         
     | 
| 
      
 494 
     | 
    
         
            +
                                            }
         
     | 
| 
      
 495 
     | 
    
         
            +
                                        }
         
     | 
| 
      
 496 
     | 
    
         
            +
                                        if (nextFocus1) {
         
     | 
| 
      
 497 
     | 
    
         
            +
                                            dispatchFocusedPath({
         
     | 
| 
      
 498 
     | 
    
         
            +
                                                type: 'set_focus',
         
     | 
| 
      
 499 
     | 
    
         
            +
                                                value: nextFocus1
         
     | 
| 
      
 500 
     | 
    
         
            +
                                            });
         
     | 
| 
      
 501 
     | 
    
         
            +
                                        } else {
         
     | 
| 
      
 502 
     | 
    
         
            +
                                            break;
         
     | 
| 
      
 503 
     | 
    
         
            +
                                        }
         
     | 
| 
      
 504 
     | 
    
         
            +
                                    }
         
     | 
| 
      
 505 
     | 
    
         
            +
                                } else {
         
     | 
| 
      
 506 
     | 
    
         
            +
                                    /**
         
     | 
| 
      
 507 
     | 
    
         
            +
                                 * Если список закрыт, то нужно его открыть и установить фокус на первый элемент.
         
     | 
| 
      
 508 
     | 
    
         
            +
                                 * */ dispatchPath({
         
     | 
| 
      
 509 
     | 
    
         
            +
                                        type: 'opened_first_level'
         
     | 
| 
      
 510 
     | 
    
         
            +
                                    });
         
     | 
| 
      
 511 
     | 
    
         
            +
                                    dispatchFocusedPath({
         
     | 
| 
      
 512 
     | 
    
         
            +
                                        type: 'set_initial_focus'
         
     | 
| 
      
 513 
     | 
    
         
            +
                                    });
         
     | 
| 
      
 514 
     | 
    
         
            +
                                    handleListToggle(true);
         
     | 
| 
      
 515 
     | 
    
         
            +
                                }
         
     | 
| 
      
 516 
     | 
    
         
            +
                                break;
         
     | 
| 
      
 517 
     | 
    
         
            +
                            }
         
     | 
| 
      
 518 
     | 
    
         
            +
                        case keys.ArrowLeft:
         
     | 
| 
      
 519 
     | 
    
         
            +
                            {
         
     | 
| 
      
 520 
     | 
    
         
            +
                                if (path[0]) {
         
     | 
| 
      
 521 
     | 
    
         
            +
                                    event.stopPropagation();
         
     | 
| 
      
 522 
     | 
    
         
            +
                                    event.preventDefault();
         
     | 
| 
      
 523 
     | 
    
         
            +
                                    if (focusedPath.length) {
         
     | 
| 
      
 524 
     | 
    
         
            +
                                        dispatchTreePath({
         
     | 
| 
      
 525 
     | 
    
         
            +
                                            type: 'close_level',
         
     | 
| 
      
 526 
     | 
    
         
            +
                                            value: valueToPathMap.get((currentItem === null || currentItem === void 0 ? void 0 : currentItem.value.toString()) || '') || []
         
     | 
| 
      
 527 
     | 
    
         
            +
                                        });
         
     | 
| 
      
 528 
     | 
    
         
            +
                                    }
         
     | 
| 
      
 529 
     | 
    
         
            +
                                }
         
     | 
| 
      
 530 
     | 
    
         
            +
                                break;
         
     | 
| 
      
 531 
     | 
    
         
            +
                            }
         
     | 
| 
      
 532 
     | 
    
         
            +
                        case keys.ArrowRight:
         
     | 
| 
      
 533 
     | 
    
         
            +
                            {
         
     | 
| 
      
 534 
     | 
    
         
            +
                                if (path[0]) {
         
     | 
| 
      
 535 
     | 
    
         
            +
                                    event.stopPropagation();
         
     | 
| 
      
 536 
     | 
    
         
            +
                                    event.preventDefault();
         
     | 
| 
      
 537 
     | 
    
         
            +
                                    if (!focusedPath.length || (currentItem === null || currentItem === void 0 ? void 0 : currentItem.disabled) || !(currentItem === null || currentItem === void 0 ? void 0 : currentItem.items)) {
         
     | 
| 
      
 538 
     | 
    
         
            +
                                        break;
         
     | 
| 
      
 539 
     | 
    
         
            +
                                    }
         
     | 
| 
      
 540 
     | 
    
         
            +
                                    dispatchTreePath({
         
     | 
| 
      
 541 
     | 
    
         
            +
                                        type: 'open_level',
         
     | 
| 
      
 542 
     | 
    
         
            +
                                        value: valueToPathMap.get(currentItem.value.toString()) || []
         
     | 
| 
      
 543 
     | 
    
         
            +
                                    });
         
     | 
| 
      
 544 
     | 
    
         
            +
                                }
         
     | 
| 
      
 545 
     | 
    
         
            +
                                break;
         
     | 
| 
      
 546 
     | 
    
         
            +
                            }
         
     | 
| 
      
 547 
     | 
    
         
            +
                        case keys.Enter:
         
     | 
| 
      
 548 
     | 
    
         
            +
                            {
         
     | 
| 
      
 549 
     | 
    
         
            +
                                event.preventDefault();
         
     | 
| 
      
 550 
     | 
    
         
            +
                                if (!currentItem || (currentItem === null || currentItem === void 0 ? void 0 : currentItem.disabled)) {
         
     | 
| 
      
 551 
     | 
    
         
            +
                                    break;
         
     | 
| 
      
 552 
     | 
    
         
            +
                                }
         
     | 
| 
      
 553 
     | 
    
         
            +
                                if (!path[0]) {
         
     | 
| 
      
 554 
     | 
    
         
            +
                                    dispatchPath({
         
     | 
| 
      
 555 
     | 
    
         
            +
                                        type: 'opened_first_level'
         
     | 
| 
      
 556 
     | 
    
         
            +
                                    });
         
     | 
| 
      
 557 
     | 
    
         
            +
                                    dispatchFocusedPath({
         
     | 
| 
      
 558 
     | 
    
         
            +
                                        type: 'set_initial_focus'
         
     | 
| 
      
 559 
     | 
    
         
            +
                                    });
         
     | 
| 
      
 560 
     | 
    
         
            +
                                    break;
         
     | 
| 
      
 561 
     | 
    
         
            +
                                }
         
     | 
| 
      
 562 
     | 
    
         
            +
                                handlePressDown(currentItem);
         
     | 
| 
      
 563 
     | 
    
         
            +
                                break;
         
     | 
| 
      
 564 
     | 
    
         
            +
                            }
         
     | 
| 
      
 565 
     | 
    
         
            +
                        case keys.Tab:
         
     | 
| 
      
 566 
     | 
    
         
            +
                        case keys.Escape:
         
     | 
| 
      
 567 
     | 
    
         
            +
                            {
         
     | 
| 
      
 568 
     | 
    
         
            +
                                if (path[0]) {
         
     | 
| 
      
 569 
     | 
    
         
            +
                                    handleListToggle(false);
         
     | 
| 
      
 570 
     | 
    
         
            +
                                }
         
     | 
| 
      
 571 
     | 
    
         
            +
                                if (multiple) {
         
     | 
| 
      
 572 
     | 
    
         
            +
                                    setTextValue('');
         
     | 
| 
      
 573 
     | 
    
         
            +
                                } else if (textValue !== value) {
         
     | 
| 
      
 574 
     | 
    
         
            +
                                    // Проверяем, отличается ли значение в инпуте от выбранного value после нажатия Tab/Enter.
         
     | 
| 
      
 575 
     | 
    
         
            +
                                    // Если изменилось, то возвращаем label выбранного айтема.
         
     | 
| 
      
 576 
     | 
    
         
            +
                                    // Если нет выбранного элемента, то стираем значение инпута.
         
     | 
| 
      
 577 
     | 
    
         
            +
                                    if (isEmpty(value)) {
         
     | 
| 
      
 578 
     | 
    
         
            +
                                        setTextValue('');
         
     | 
| 
      
 579 
     | 
    
         
            +
                                    } else {
         
     | 
| 
      
 580 
     | 
    
         
            +
                                        var _valueToItemMap_get;
         
     | 
| 
      
 581 
     | 
    
         
            +
                                        setTextValue(((_valueToItemMap_get = valueToItemMap.get(value)) === null || _valueToItemMap_get === void 0 ? void 0 : _valueToItemMap_get.label) || '');
         
     | 
| 
      
 582 
     | 
    
         
            +
                                    }
         
     | 
| 
      
 583 
     | 
    
         
            +
                                }
         
     | 
| 
      
 584 
     | 
    
         
            +
                                break;
         
     | 
| 
      
 585 
     | 
    
         
            +
                            }
         
     | 
| 
      
 586 
     | 
    
         
            +
                        default:
         
     | 
| 
      
 587 
     | 
    
         
            +
                            {
         
     | 
| 
      
 588 
     | 
    
         
            +
                                break;
         
     | 
| 
      
 589 
     | 
    
         
            +
                            }
         
     | 
| 
      
 590 
     | 
    
         
            +
                    }
         
     | 
| 
      
 591 
     | 
    
         
            +
                };
         
     | 
| 
      
 592 
     | 
    
         
            +
                return {
         
     | 
| 
      
 593 
     | 
    
         
            +
                    onKeyDown: onKeyDown
         
     | 
| 
      
 594 
     | 
    
         
            +
                };
         
     | 
| 
      
 595 
     | 
    
         
            +
            };
         
     | 
| 
         @@ -29,6 +29,10 @@ export function focusedPathReducer(state, action) { 
     | 
|
| 
       29 
29 
     | 
    
         
             
                        {
         
     | 
| 
       30 
30 
     | 
    
         
             
                            return [];
         
     | 
| 
       31 
31 
     | 
    
         
             
                        }
         
     | 
| 
      
 32 
     | 
    
         
            +
                    case 'set_focus':
         
     | 
| 
      
 33 
     | 
    
         
            +
                        {
         
     | 
| 
      
 34 
     | 
    
         
            +
                            return action.value;
         
     | 
| 
      
 35 
     | 
    
         
            +
                        }
         
     | 
| 
       32 
36 
     | 
    
         
             
                    case 'set_initial_focus':
         
     | 
| 
       33 
37 
     | 
    
         
             
                        {
         
     | 
| 
       34 
38 
     | 
    
         
             
                            return [
         
     | 
| 
         @@ -49,6 +53,9 @@ export function focusedPathReducer(state, action) { 
     | 
|
| 
       49 
53 
     | 
    
         
             
                        }
         
     | 
| 
       50 
54 
     | 
    
         
             
                    case 'return_prev_focus':
         
     | 
| 
       51 
55 
     | 
    
         
             
                        {
         
     | 
| 
      
 56 
     | 
    
         
            +
                            if (state.length === 1) {
         
     | 
| 
      
 57 
     | 
    
         
            +
                                return state;
         
     | 
| 
      
 58 
     | 
    
         
            +
                            }
         
     | 
| 
       52 
59 
     | 
    
         
             
                            return state.slice(0, -1);
         
     | 
| 
       53 
60 
     | 
    
         
             
                        }
         
     | 
| 
       54 
61 
     | 
    
         
             
                    default:
         
     | 
| 
         @@ -0,0 +1,135 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            function _type_of(obj) {
         
     | 
| 
      
 2 
     | 
    
         
            +
                "@swc/helpers - typeof";
         
     | 
| 
      
 3 
     | 
    
         
            +
                return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
         
     | 
| 
      
 4 
     | 
    
         
            +
            }
         
     | 
| 
      
 5 
     | 
    
         
            +
            import { deepCopy } from "../../../../utils";
         
     | 
| 
      
 6 
     | 
    
         
            +
            // Утилита для поиска ключа в объекте по пути.
         
     | 
| 
      
 7 
     | 
    
         
            +
            export var keyExists = function(obj, path) {
         
     | 
| 
      
 8 
     | 
    
         
            +
                if ((typeof obj === "undefined" ? "undefined" : _type_of(obj)) !== 'object' || obj === null || !Array.isArray(path)) {
         
     | 
| 
      
 9 
     | 
    
         
            +
                    return false;
         
     | 
| 
      
 10 
     | 
    
         
            +
                }
         
     | 
| 
      
 11 
     | 
    
         
            +
                var current = obj;
         
     | 
| 
      
 12 
     | 
    
         
            +
                for(var i = 0; i < path.length; i++){
         
     | 
| 
      
 13 
     | 
    
         
            +
                    var key = path[i];
         
     | 
| 
      
 14 
     | 
    
         
            +
                    if (current === null || (typeof current === "undefined" ? "undefined" : _type_of(current)) !== 'object' || !(key in current)) {
         
     | 
| 
      
 15 
     | 
    
         
            +
                        return false;
         
     | 
| 
      
 16 
     | 
    
         
            +
                    }
         
     | 
| 
      
 17 
     | 
    
         
            +
                    current = current[key];
         
     | 
| 
      
 18 
     | 
    
         
            +
                }
         
     | 
| 
      
 19 
     | 
    
         
            +
                return true;
         
     | 
| 
      
 20 
     | 
    
         
            +
            };
         
     | 
| 
      
 21 
     | 
    
         
            +
            function createObjectAtPath(obj, path) {
         
     | 
| 
      
 22 
     | 
    
         
            +
                if ((typeof obj === "undefined" ? "undefined" : _type_of(obj)) !== 'object' || obj === null) {
         
     | 
| 
      
 23 
     | 
    
         
            +
                    return;
         
     | 
| 
      
 24 
     | 
    
         
            +
                }
         
     | 
| 
      
 25 
     | 
    
         
            +
                var current = obj;
         
     | 
| 
      
 26 
     | 
    
         
            +
                for(var i = 0; i < path.length; i++){
         
     | 
| 
      
 27 
     | 
    
         
            +
                    var key = path[i];
         
     | 
| 
      
 28 
     | 
    
         
            +
                    if (i === path.length - 1) {
         
     | 
| 
      
 29 
     | 
    
         
            +
                        current[key] = {};
         
     | 
| 
      
 30 
     | 
    
         
            +
                        break;
         
     | 
| 
      
 31 
     | 
    
         
            +
                    }
         
     | 
| 
      
 32 
     | 
    
         
            +
                    if (current[key] === undefined || current[key] === null) {
         
     | 
| 
      
 33 
     | 
    
         
            +
                        current[key] = {};
         
     | 
| 
      
 34 
     | 
    
         
            +
                    }
         
     | 
| 
      
 35 
     | 
    
         
            +
                    current = current[key];
         
     | 
| 
      
 36 
     | 
    
         
            +
                }
         
     | 
| 
      
 37 
     | 
    
         
            +
                return obj;
         
     | 
| 
      
 38 
     | 
    
         
            +
            }
         
     | 
| 
      
 39 
     | 
    
         
            +
            function removeObjectAtPath(obj, path) {
         
     | 
| 
      
 40 
     | 
    
         
            +
                if (path.length === 0) {
         
     | 
| 
      
 41 
     | 
    
         
            +
                    return obj;
         
     | 
| 
      
 42 
     | 
    
         
            +
                }
         
     | 
| 
      
 43 
     | 
    
         
            +
                var current = obj;
         
     | 
| 
      
 44 
     | 
    
         
            +
                for(var i = 0; i < path.length; i++){
         
     | 
| 
      
 45 
     | 
    
         
            +
                    var key = path[i];
         
     | 
| 
      
 46 
     | 
    
         
            +
                    if (current === null || (typeof current === "undefined" ? "undefined" : _type_of(current)) !== 'object' || !(key in current)) {
         
     | 
| 
      
 47 
     | 
    
         
            +
                        return obj;
         
     | 
| 
      
 48 
     | 
    
         
            +
                    }
         
     | 
| 
      
 49 
     | 
    
         
            +
                    if (i === path.length - 1) {
         
     | 
| 
      
 50 
     | 
    
         
            +
                        delete current[key];
         
     | 
| 
      
 51 
     | 
    
         
            +
                        break;
         
     | 
| 
      
 52 
     | 
    
         
            +
                    }
         
     | 
| 
      
 53 
     | 
    
         
            +
                    current = current[key];
         
     | 
| 
      
 54 
     | 
    
         
            +
                }
         
     | 
| 
      
 55 
     | 
    
         
            +
                return obj;
         
     | 
| 
      
 56 
     | 
    
         
            +
            }
         
     | 
| 
      
 57 
     | 
    
         
            +
            // Утилита, которая получает на вход список отфильтрованных элементов
         
     | 
| 
      
 58 
     | 
    
         
            +
            // и возвращает объект путей раскрытых элементов дерева.
         
     | 
| 
      
 59 
     | 
    
         
            +
            function generateNestedTreePathFromFilteredItems(items) {
         
     | 
| 
      
 60 
     | 
    
         
            +
                var result = {};
         
     | 
| 
      
 61 
     | 
    
         
            +
                var buildTree = function(currentItems, currentLevel) {
         
     | 
| 
      
 62 
     | 
    
         
            +
                    if (!currentItems || !Array.isArray(currentItems)) return;
         
     | 
| 
      
 63 
     | 
    
         
            +
                    var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
         
     | 
| 
      
 64 
     | 
    
         
            +
                    try {
         
     | 
| 
      
 65 
     | 
    
         
            +
                        for(var _iterator = currentItems[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
         
     | 
| 
      
 66 
     | 
    
         
            +
                            var item = _step.value;
         
     | 
| 
      
 67 
     | 
    
         
            +
                            if ((item === null || item === void 0 ? void 0 : item.value) && (item === null || item === void 0 ? void 0 : item.items)) {
         
     | 
| 
      
 68 
     | 
    
         
            +
                                // Создаем новый уровень для текущего значения
         
     | 
| 
      
 69 
     | 
    
         
            +
                                currentLevel[item === null || item === void 0 ? void 0 : item.value] = {};
         
     | 
| 
      
 70 
     | 
    
         
            +
                                // Рекурсивно обрабатываем дочерние элементы
         
     | 
| 
      
 71 
     | 
    
         
            +
                                if ((item === null || item === void 0 ? void 0 : item.items) && (item === null || item === void 0 ? void 0 : item.items.length) > 0) {
         
     | 
| 
      
 72 
     | 
    
         
            +
                                    buildTree(item === null || item === void 0 ? void 0 : item.items, currentLevel[item === null || item === void 0 ? void 0 : item.value]);
         
     | 
| 
      
 73 
     | 
    
         
            +
                                }
         
     | 
| 
      
 74 
     | 
    
         
            +
                            }
         
     | 
| 
      
 75 
     | 
    
         
            +
                        }
         
     | 
| 
      
 76 
     | 
    
         
            +
                    } catch (err) {
         
     | 
| 
      
 77 
     | 
    
         
            +
                        _didIteratorError = true;
         
     | 
| 
      
 78 
     | 
    
         
            +
                        _iteratorError = err;
         
     | 
| 
      
 79 
     | 
    
         
            +
                    } finally{
         
     | 
| 
      
 80 
     | 
    
         
            +
                        try {
         
     | 
| 
      
 81 
     | 
    
         
            +
                            if (!_iteratorNormalCompletion && _iterator.return != null) {
         
     | 
| 
      
 82 
     | 
    
         
            +
                                _iterator.return();
         
     | 
| 
      
 83 
     | 
    
         
            +
                            }
         
     | 
| 
      
 84 
     | 
    
         
            +
                        } finally{
         
     | 
| 
      
 85 
     | 
    
         
            +
                            if (_didIteratorError) {
         
     | 
| 
      
 86 
     | 
    
         
            +
                                throw _iteratorError;
         
     | 
| 
      
 87 
     | 
    
         
            +
                            }
         
     | 
| 
      
 88 
     | 
    
         
            +
                        }
         
     | 
| 
      
 89 
     | 
    
         
            +
                    }
         
     | 
| 
      
 90 
     | 
    
         
            +
                };
         
     | 
| 
      
 91 
     | 
    
         
            +
                buildTree(items, result);
         
     | 
| 
      
 92 
     | 
    
         
            +
                return result;
         
     | 
| 
      
 93 
     | 
    
         
            +
            }
         
     | 
| 
      
 94 
     | 
    
         
            +
            export function treePathReducer(state, action) {
         
     | 
| 
      
 95 
     | 
    
         
            +
                switch(action.type){
         
     | 
| 
      
 96 
     | 
    
         
            +
                    case 'reset':
         
     | 
| 
      
 97 
     | 
    
         
            +
                        {
         
     | 
| 
      
 98 
     | 
    
         
            +
                            return {};
         
     | 
| 
      
 99 
     | 
    
         
            +
                        }
         
     | 
| 
      
 100 
     | 
    
         
            +
                    case 'toggled_level':
         
     | 
| 
      
 101 
     | 
    
         
            +
                        {
         
     | 
| 
      
 102 
     | 
    
         
            +
                            var stateCopy = deepCopy(state);
         
     | 
| 
      
 103 
     | 
    
         
            +
                            var isTargetLevelOpened = keyExists(stateCopy, action.value);
         
     | 
| 
      
 104 
     | 
    
         
            +
                            if (isTargetLevelOpened) {
         
     | 
| 
      
 105 
     | 
    
         
            +
                                // нужно закрыть текущий уровень
         
     | 
| 
      
 106 
     | 
    
         
            +
                                removeObjectAtPath(stateCopy, action.value);
         
     | 
| 
      
 107 
     | 
    
         
            +
                            } else {
         
     | 
| 
      
 108 
     | 
    
         
            +
                                // нужно открыть требуемый уровень
         
     | 
| 
      
 109 
     | 
    
         
            +
                                createObjectAtPath(stateCopy, action.value);
         
     | 
| 
      
 110 
     | 
    
         
            +
                            }
         
     | 
| 
      
 111 
     | 
    
         
            +
                            return stateCopy;
         
     | 
| 
      
 112 
     | 
    
         
            +
                        }
         
     | 
| 
      
 113 
     | 
    
         
            +
                    case 'expand_all':
         
     | 
| 
      
 114 
     | 
    
         
            +
                        {
         
     | 
| 
      
 115 
     | 
    
         
            +
                            var filteredItem = action.value;
         
     | 
| 
      
 116 
     | 
    
         
            +
                            return generateNestedTreePathFromFilteredItems(filteredItem);
         
     | 
| 
      
 117 
     | 
    
         
            +
                        }
         
     | 
| 
      
 118 
     | 
    
         
            +
                    case 'open_level':
         
     | 
| 
      
 119 
     | 
    
         
            +
                        {
         
     | 
| 
      
 120 
     | 
    
         
            +
                            var stateCopy1 = deepCopy(state);
         
     | 
| 
      
 121 
     | 
    
         
            +
                            createObjectAtPath(stateCopy1, action.value);
         
     | 
| 
      
 122 
     | 
    
         
            +
                            return stateCopy1;
         
     | 
| 
      
 123 
     | 
    
         
            +
                        }
         
     | 
| 
      
 124 
     | 
    
         
            +
                    case 'close_level':
         
     | 
| 
      
 125 
     | 
    
         
            +
                        {
         
     | 
| 
      
 126 
     | 
    
         
            +
                            var stateCopy2 = deepCopy(state);
         
     | 
| 
      
 127 
     | 
    
         
            +
                            removeObjectAtPath(stateCopy2, action.value);
         
     | 
| 
      
 128 
     | 
    
         
            +
                            return stateCopy2;
         
     | 
| 
      
 129 
     | 
    
         
            +
                        }
         
     | 
| 
      
 130 
     | 
    
         
            +
                    default:
         
     | 
| 
      
 131 
     | 
    
         
            +
                        {
         
     | 
| 
      
 132 
     | 
    
         
            +
                            return state;
         
     | 
| 
      
 133 
     | 
    
         
            +
                        }
         
     | 
| 
      
 134 
     | 
    
         
            +
                }
         
     | 
| 
      
 135 
     | 
    
         
            +
            }
         
     | 
| 
         @@ -0,0 +1,79 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import React, { useRef } from "react";
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { useVirtualizer } from "@tanstack/react-virtual";
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { getHeightAsNumber } from "../../../../../utils";
         
     | 
| 
      
 4 
     | 
    
         
            +
            import { Item } from "./ui/Item/Item";
         
     | 
| 
      
 5 
     | 
    
         
            +
            import { ListWrapper, ScrollContainer } from "./TreeList.styles";
         
     | 
| 
      
 6 
     | 
    
         
            +
            export var TreeList = function(param) {
         
     | 
| 
      
 7 
     | 
    
         
            +
                var items = param.items, listMaxHeight = param.listMaxHeight, onScroll = param.onScroll, virtual = param.virtual, beforeList = param.beforeList, afterList = param.afterList;
         
     | 
| 
      
 8 
     | 
    
         
            +
                if (virtual) {
         
     | 
| 
      
 9 
     | 
    
         
            +
                    return /*#__PURE__*/ React.createElement(VirtualTreeList, {
         
     | 
| 
      
 10 
     | 
    
         
            +
                        items: items,
         
     | 
| 
      
 11 
     | 
    
         
            +
                        listMaxHeight: listMaxHeight,
         
     | 
| 
      
 12 
     | 
    
         
            +
                        onScroll: onScroll,
         
     | 
| 
      
 13 
     | 
    
         
            +
                        beforeList: beforeList,
         
     | 
| 
      
 14 
     | 
    
         
            +
                        afterList: afterList
         
     | 
| 
      
 15 
     | 
    
         
            +
                    });
         
     | 
| 
      
 16 
     | 
    
         
            +
                }
         
     | 
| 
      
 17 
     | 
    
         
            +
                return /*#__PURE__*/ React.createElement(ListWrapper, null, /*#__PURE__*/ React.createElement(ScrollContainer, {
         
     | 
| 
      
 18 
     | 
    
         
            +
                    listMaxHeight: listMaxHeight,
         
     | 
| 
      
 19 
     | 
    
         
            +
                    onScroll: onScroll
         
     | 
| 
      
 20 
     | 
    
         
            +
                }, beforeList, items === null || items === void 0 ? void 0 : items.map(function(item, index) {
         
     | 
| 
      
 21 
     | 
    
         
            +
                    return /*#__PURE__*/ React.createElement(Item, {
         
     | 
| 
      
 22 
     | 
    
         
            +
                        key: index,
         
     | 
| 
      
 23 
     | 
    
         
            +
                        item: item,
         
     | 
| 
      
 24 
     | 
    
         
            +
                        pathToItem: [
         
     | 
| 
      
 25 
     | 
    
         
            +
                            index
         
     | 
| 
      
 26 
     | 
    
         
            +
                        ]
         
     | 
| 
      
 27 
     | 
    
         
            +
                    });
         
     | 
| 
      
 28 
     | 
    
         
            +
                }), afterList));
         
     | 
| 
      
 29 
     | 
    
         
            +
            };
         
     | 
| 
      
 30 
     | 
    
         
            +
            var VirtualTreeList = function(param) {
         
     | 
| 
      
 31 
     | 
    
         
            +
                var _param_items = param.items, items = _param_items === void 0 ? [] : _param_items, listMaxHeight = param.listMaxHeight, onScroll = param.onScroll, beforeList = param.beforeList, afterList = param.afterList;
         
     | 
| 
      
 32 
     | 
    
         
            +
                var _virtualItems_;
         
     | 
| 
      
 33 
     | 
    
         
            +
                var parentRef = useRef(null);
         
     | 
| 
      
 34 
     | 
    
         
            +
                var virtualizer = useVirtualizer({
         
     | 
| 
      
 35 
     | 
    
         
            +
                    count: items.length,
         
     | 
| 
      
 36 
     | 
    
         
            +
                    getScrollElement: function() {
         
     | 
| 
      
 37 
     | 
    
         
            +
                        return parentRef.current;
         
     | 
| 
      
 38 
     | 
    
         
            +
                    },
         
     | 
| 
      
 39 
     | 
    
         
            +
                    estimateSize: function() {
         
     | 
| 
      
 40 
     | 
    
         
            +
                        return 48;
         
     | 
| 
      
 41 
     | 
    
         
            +
                    }
         
     | 
| 
      
 42 
     | 
    
         
            +
                });
         
     | 
| 
      
 43 
     | 
    
         
            +
                var virtualItems = virtualizer.getVirtualItems();
         
     | 
| 
      
 44 
     | 
    
         
            +
                var _virtualItems__start;
         
     | 
| 
      
 45 
     | 
    
         
            +
                return /*#__PURE__*/ React.createElement(ListWrapper, null, beforeList, /*#__PURE__*/ React.createElement("div", {
         
     | 
| 
      
 46 
     | 
    
         
            +
                    ref: parentRef,
         
     | 
| 
      
 47 
     | 
    
         
            +
                    style: {
         
     | 
| 
      
 48 
     | 
    
         
            +
                        height: 'auto',
         
     | 
| 
      
 49 
     | 
    
         
            +
                        maxHeight: getHeightAsNumber(listMaxHeight),
         
     | 
| 
      
 50 
     | 
    
         
            +
                        overflowY: 'auto'
         
     | 
| 
      
 51 
     | 
    
         
            +
                    },
         
     | 
| 
      
 52 
     | 
    
         
            +
                    onScroll: onScroll
         
     | 
| 
      
 53 
     | 
    
         
            +
                }, /*#__PURE__*/ React.createElement("div", {
         
     | 
| 
      
 54 
     | 
    
         
            +
                    style: {
         
     | 
| 
      
 55 
     | 
    
         
            +
                        height: virtualizer.getTotalSize(),
         
     | 
| 
      
 56 
     | 
    
         
            +
                        width: '100%',
         
     | 
| 
      
 57 
     | 
    
         
            +
                        position: 'relative'
         
     | 
| 
      
 58 
     | 
    
         
            +
                    }
         
     | 
| 
      
 59 
     | 
    
         
            +
                }, /*#__PURE__*/ React.createElement("div", {
         
     | 
| 
      
 60 
     | 
    
         
            +
                    style: {
         
     | 
| 
      
 61 
     | 
    
         
            +
                        position: 'absolute',
         
     | 
| 
      
 62 
     | 
    
         
            +
                        top: 0,
         
     | 
| 
      
 63 
     | 
    
         
            +
                        left: 0,
         
     | 
| 
      
 64 
     | 
    
         
            +
                        width: '100%',
         
     | 
| 
      
 65 
     | 
    
         
            +
                        transform: "translateY(".concat((_virtualItems__start = (_virtualItems_ = virtualItems[0]) === null || _virtualItems_ === void 0 ? void 0 : _virtualItems_.start) !== null && _virtualItems__start !== void 0 ? _virtualItems__start : 0, "px)")
         
     | 
| 
      
 66 
     | 
    
         
            +
                    }
         
     | 
| 
      
 67 
     | 
    
         
            +
                }, virtualItems.map(function(virtualRow) {
         
     | 
| 
      
 68 
     | 
    
         
            +
                    return /*#__PURE__*/ React.createElement("div", {
         
     | 
| 
      
 69 
     | 
    
         
            +
                        key: virtualRow.key,
         
     | 
| 
      
 70 
     | 
    
         
            +
                        "data-index": virtualRow.index,
         
     | 
| 
      
 71 
     | 
    
         
            +
                        ref: virtualizer.measureElement
         
     | 
| 
      
 72 
     | 
    
         
            +
                    }, /*#__PURE__*/ React.createElement(Item, {
         
     | 
| 
      
 73 
     | 
    
         
            +
                        item: items[virtualRow.index],
         
     | 
| 
      
 74 
     | 
    
         
            +
                        pathToItem: [
         
     | 
| 
      
 75 
     | 
    
         
            +
                            virtualRow.index
         
     | 
| 
      
 76 
     | 
    
         
            +
                        ]
         
     | 
| 
      
 77 
     | 
    
         
            +
                    }));
         
     | 
| 
      
 78 
     | 
    
         
            +
                })))), afterList);
         
     | 
| 
      
 79 
     | 
    
         
            +
            };
         
     | 
| 
         @@ -0,0 +1,27 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import styled from "styled-components";
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { constants, tokens } from "../../Combobox.tokens";
         
     | 
| 
      
 3 
     | 
    
         
            +
            export var ListWrapper = styled.div.withConfig({
         
     | 
| 
      
 4 
     | 
    
         
            +
                displayName: "TreeList.styles__ListWrapper",
         
     | 
| 
      
 5 
     | 
    
         
            +
                componentId: "sc-1116f9b8-0"
         
     | 
| 
      
 6 
     | 
    
         
            +
            })([
         
     | 
| 
      
 7 
     | 
    
         
            +
                "width:100%;padding:calc(var(",
         
     | 
| 
      
 8 
     | 
    
         
            +
                ") + var(",
         
     | 
| 
      
 9 
     | 
    
         
            +
                ",0rem));border-radius:var(",
         
     | 
| 
      
 10 
     | 
    
         
            +
                ");box-sizing:border-box;background:var(",
         
     | 
| 
      
 11 
     | 
    
         
            +
                ");box-shadow:",
         
     | 
| 
      
 12 
     | 
    
         
            +
                ",inset 0 0 0 var(",
         
     | 
| 
      
 13 
     | 
    
         
            +
                ",0rem) var(",
         
     | 
| 
      
 14 
     | 
    
         
            +
                ",transparent);"
         
     | 
| 
      
 15 
     | 
    
         
            +
            ], tokens.padding, tokens.dropdownBorderWidth, tokens.borderRadius, constants.background, constants.boxShadow, tokens.dropdownBorderWidth, tokens.dropdownBorderColor);
         
     | 
| 
      
 16 
     | 
    
         
            +
            export var ScrollContainer = styled.div.withConfig({
         
     | 
| 
      
 17 
     | 
    
         
            +
                displayName: "TreeList.styles__ScrollContainer",
         
     | 
| 
      
 18 
     | 
    
         
            +
                componentId: "sc-1116f9b8-1"
         
     | 
| 
      
 19 
     | 
    
         
            +
            })([
         
     | 
| 
      
 20 
     | 
    
         
            +
                "max-height:",
         
     | 
| 
      
 21 
     | 
    
         
            +
                ";overflow-x:hidden;overflow-y:auto;border-radius:calc(var(",
         
     | 
| 
      
 22 
     | 
    
         
            +
                ") - 0.125rem - var(",
         
     | 
| 
      
 23 
     | 
    
         
            +
                ",0rem));"
         
     | 
| 
      
 24 
     | 
    
         
            +
            ], function(param) {
         
     | 
| 
      
 25 
     | 
    
         
            +
                var listMaxHeight = param.listMaxHeight;
         
     | 
| 
      
 26 
     | 
    
         
            +
                return listMaxHeight || 'auto';
         
     | 
| 
      
 27 
     | 
    
         
            +
            }, tokens.borderRadius, tokens.dropdownBorderWidth);
         
     | 
| 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            export { };
         
     |