@alfalab/core-components-select 17.8.2 → 17.8.3

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.
Files changed (257) hide show
  1. package/components/arrow/Component.js +1 -1
  2. package/components/arrow/index.css +6 -4
  3. package/components/base-checkmark/Component.js +1 -1
  4. package/components/base-checkmark/index.css +9 -7
  5. package/components/base-option/Component.js +1 -1
  6. package/components/base-option/index.css +21 -19
  7. package/components/base-select/Component.d.ts +8 -14
  8. package/components/base-select/Component.js +48 -75
  9. package/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.d.ts +12 -0
  10. package/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.js +19 -0
  11. package/components/base-select/components/list-desktop/list-popover-desktop.d.ts +0 -0
  12. package/components/base-select/components/list-desktop/list-popover-desktop.js +12 -0
  13. package/components/base-select/components/list-desktop/types/types.d.ts +3 -0
  14. package/components/base-select/components/list-desktop/types/types.js +2 -0
  15. package/components/base-select/components/list-mobile/helpers/get-list-bottom-sheet-mobile-props.d.ts +16 -0
  16. package/components/base-select/components/list-mobile/helpers/get-list-bottom-sheet-mobile-props.js +23 -0
  17. package/components/base-select/components/list-mobile/helpers/get-list-modal-mobile-props.d.ts +28 -0
  18. package/components/base-select/components/list-mobile/helpers/get-list-modal-mobile-props.js +22 -0
  19. package/components/base-select/components/list-mobile/helpers/index.d.ts +2 -0
  20. package/components/base-select/components/list-mobile/helpers/index.js +11 -0
  21. package/components/base-select/components/list-mobile/list-bottom-sheet-mobile.d.ts +15 -0
  22. package/components/base-select/components/list-mobile/list-bottom-sheet-mobile.js +28 -0
  23. package/components/base-select/components/list-mobile/list-mobile.d.ts +16 -0
  24. package/components/base-select/components/list-mobile/list-mobile.js +26 -0
  25. package/components/base-select/components/list-mobile/list-modal-mobile.d.ts +15 -0
  26. package/components/base-select/components/list-mobile/list-modal-mobile.js +42 -0
  27. package/components/base-select/components/list-mobile/types/types.d.ts +4 -0
  28. package/components/base-select/components/list-mobile/types/types.js +2 -0
  29. package/components/base-select/index.css +16 -14
  30. package/components/base-select/mobile.css +19 -17
  31. package/components/base-select/types/component-types.d.ts +50 -0
  32. package/components/base-select/types/component-types.js +2 -0
  33. package/components/checkmark/Component.js +1 -1
  34. package/components/checkmark/index.css +15 -13
  35. package/components/checkmark-mobile/Component.js +1 -1
  36. package/components/checkmark-mobile/index.css +9 -7
  37. package/components/field/Component.js +1 -1
  38. package/components/field/index.css +15 -13
  39. package/components/footer/Component.js +1 -1
  40. package/components/footer/index.css +9 -7
  41. package/components/optgroup/Component.js +1 -1
  42. package/components/optgroup/index.css +12 -10
  43. package/components/option/Component.js +1 -1
  44. package/components/option/index.css +24 -22
  45. package/components/options-list/Component.js +1 -1
  46. package/components/options-list/index.css +16 -14
  47. package/components/search/Component.js +1 -1
  48. package/components/search/index.css +5 -3
  49. package/components/virtual-options-list/Component.js +1 -1
  50. package/components/virtual-options-list/index.css +21 -19
  51. package/cssm/components/arrow/index.module.css +3 -1
  52. package/cssm/components/base-checkmark/index.module.css +3 -1
  53. package/cssm/components/base-option/index.module.css +6 -4
  54. package/cssm/components/base-select/Component.d.ts +8 -14
  55. package/cssm/components/base-select/Component.js +38 -60
  56. package/cssm/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.d.ts +12 -0
  57. package/cssm/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.js +19 -0
  58. package/cssm/components/base-select/components/list-desktop/list-popover-desktop.d.ts +9 -0
  59. package/cssm/components/base-select/components/list-desktop/list-popover-desktop.js +24 -0
  60. package/cssm/components/base-select/components/list-desktop/types/types.d.ts +3 -0
  61. package/cssm/components/base-select/components/list-desktop/types/types.js +2 -0
  62. package/cssm/components/base-select/components/list-mobile/helpers/get-list-bottom-sheet-mobile-props.d.ts +16 -0
  63. package/cssm/components/base-select/components/list-mobile/helpers/get-list-bottom-sheet-mobile-props.js +23 -0
  64. package/cssm/components/base-select/components/list-mobile/helpers/get-list-modal-mobile-props.d.ts +28 -0
  65. package/cssm/components/base-select/components/list-mobile/helpers/get-list-modal-mobile-props.js +22 -0
  66. package/cssm/components/base-select/components/list-mobile/helpers/index.d.ts +2 -0
  67. package/cssm/components/base-select/components/list-mobile/helpers/index.js +11 -0
  68. package/cssm/components/base-select/components/list-mobile/list-bottom-sheet-mobile.d.ts +15 -0
  69. package/cssm/components/base-select/components/list-mobile/list-bottom-sheet-mobile.js +29 -0
  70. package/cssm/components/base-select/components/list-mobile/list-mobile.d.ts +16 -0
  71. package/cssm/components/base-select/components/list-mobile/list-mobile.js +26 -0
  72. package/cssm/components/base-select/components/list-mobile/list-modal-mobile.d.ts +15 -0
  73. package/cssm/components/base-select/components/list-mobile/list-modal-mobile.js +43 -0
  74. package/cssm/components/base-select/components/list-mobile/types/types.d.ts +4 -0
  75. package/cssm/components/base-select/components/list-mobile/types/types.js +2 -0
  76. package/cssm/components/base-select/index.module.css +5 -3
  77. package/cssm/components/base-select/mobile.module.css +7 -5
  78. package/cssm/components/base-select/types/component-types.d.ts +50 -0
  79. package/cssm/components/base-select/types/component-types.js +2 -0
  80. package/cssm/components/checkmark/index.module.css +5 -3
  81. package/cssm/components/checkmark-mobile/index.module.css +3 -1
  82. package/cssm/components/field/index.module.css +3 -1
  83. package/cssm/components/footer/index.module.css +4 -2
  84. package/cssm/components/optgroup/index.module.css +6 -4
  85. package/cssm/components/option/index.module.css +5 -3
  86. package/cssm/components/options-list/index.module.css +6 -4
  87. package/cssm/components/search/index.module.css +3 -1
  88. package/cssm/components/virtual-options-list/index.module.css +6 -4
  89. package/cssm/presets/useSelectWithApply/options-list-with-apply/footer/index.module.css +5 -3
  90. package/cssm/presets/useSelectWithApply/options-list-with-apply/header/index.module.css +5 -3
  91. package/esm/components/arrow/Component.js +1 -1
  92. package/esm/components/arrow/index.css +6 -4
  93. package/esm/components/base-checkmark/Component.js +1 -1
  94. package/esm/components/base-checkmark/index.css +9 -7
  95. package/esm/components/base-option/Component.js +1 -1
  96. package/esm/components/base-option/index.css +21 -19
  97. package/esm/components/base-select/Component.d.ts +8 -14
  98. package/esm/components/base-select/Component.js +39 -66
  99. package/esm/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.d.ts +12 -0
  100. package/esm/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.js +15 -0
  101. package/esm/components/base-select/components/list-desktop/list-popover-desktop.d.ts +0 -0
  102. package/esm/components/base-select/components/list-desktop/list-popover-desktop.js +4 -0
  103. package/esm/components/base-select/components/list-desktop/types/types.d.ts +3 -0
  104. package/esm/components/base-select/components/list-desktop/types/types.js +1 -0
  105. package/esm/components/base-select/components/list-mobile/helpers/get-list-bottom-sheet-mobile-props.d.ts +16 -0
  106. package/esm/components/base-select/components/list-mobile/helpers/get-list-bottom-sheet-mobile-props.js +19 -0
  107. package/esm/components/base-select/components/list-mobile/helpers/get-list-modal-mobile-props.d.ts +28 -0
  108. package/esm/components/base-select/components/list-mobile/helpers/get-list-modal-mobile-props.js +18 -0
  109. package/esm/components/base-select/components/list-mobile/helpers/index.d.ts +2 -0
  110. package/esm/components/base-select/components/list-mobile/helpers/index.js +2 -0
  111. package/esm/components/base-select/components/list-mobile/list-bottom-sheet-mobile.d.ts +15 -0
  112. package/esm/components/base-select/components/list-mobile/list-bottom-sheet-mobile.js +20 -0
  113. package/esm/components/base-select/components/list-mobile/list-mobile.d.ts +16 -0
  114. package/esm/components/base-select/components/list-mobile/list-mobile.js +18 -0
  115. package/esm/components/base-select/components/list-mobile/list-modal-mobile.d.ts +15 -0
  116. package/esm/components/base-select/components/list-mobile/list-modal-mobile.js +32 -0
  117. package/esm/components/base-select/components/list-mobile/types/types.d.ts +4 -0
  118. package/esm/components/base-select/components/list-mobile/types/types.js +1 -0
  119. package/esm/components/base-select/index.css +16 -14
  120. package/esm/components/base-select/mobile.css +19 -17
  121. package/esm/components/base-select/types/component-types.d.ts +50 -0
  122. package/esm/components/base-select/types/component-types.js +1 -0
  123. package/esm/components/checkmark/Component.js +1 -1
  124. package/esm/components/checkmark/index.css +15 -13
  125. package/esm/components/checkmark-mobile/Component.js +1 -1
  126. package/esm/components/checkmark-mobile/index.css +9 -7
  127. package/esm/components/field/Component.js +1 -1
  128. package/esm/components/field/index.css +15 -13
  129. package/esm/components/footer/Component.js +1 -1
  130. package/esm/components/footer/index.css +9 -7
  131. package/esm/components/optgroup/Component.js +1 -1
  132. package/esm/components/optgroup/index.css +12 -10
  133. package/esm/components/option/Component.js +1 -1
  134. package/esm/components/option/index.css +24 -22
  135. package/esm/components/options-list/Component.js +1 -1
  136. package/esm/components/options-list/index.css +16 -14
  137. package/esm/components/search/Component.js +1 -1
  138. package/esm/components/search/index.css +5 -3
  139. package/esm/components/virtual-options-list/Component.js +1 -1
  140. package/esm/components/virtual-options-list/index.css +21 -19
  141. package/esm/list-popover-desktop-a16c1a9c.d.ts +9 -0
  142. package/esm/list-popover-desktop-a16c1a9c.js +16 -0
  143. package/esm/mobile/Component.mobile.js +1 -1
  144. package/esm/mobile.module-3975aa85.js +4 -0
  145. package/esm/presets/index.js +1 -1
  146. package/esm/presets/useSelectWithApply/hook.js +1 -1
  147. package/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
  148. package/esm/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
  149. package/esm/presets/useSelectWithApply/options-list-with-apply/footer/index.css +8 -6
  150. package/esm/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
  151. package/esm/presets/useSelectWithApply/options-list-with-apply/header/index.css +8 -6
  152. package/esm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  153. package/esm/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
  154. package/esm/presets/useSelectWithLoading/hook.js +1 -1
  155. package/esm/presets/useSelectWithLoading/index.css +2 -2
  156. package/esm/shared/index.js +1 -1
  157. package/list-popover-desktop-63ceae1a.d.ts +9 -0
  158. package/list-popover-desktop-63ceae1a.js +24 -0
  159. package/mobile/Component.mobile.js +1 -1
  160. package/mobile.module-f44f34a3.js +6 -0
  161. package/modern/components/arrow/Component.js +1 -1
  162. package/modern/components/arrow/index.css +6 -4
  163. package/modern/components/base-checkmark/Component.js +1 -1
  164. package/modern/components/base-checkmark/index.css +9 -7
  165. package/modern/components/base-option/Component.js +1 -1
  166. package/modern/components/base-option/index.css +21 -19
  167. package/modern/components/base-select/Component.d.ts +8 -14
  168. package/modern/components/base-select/Component.js +23 -56
  169. package/modern/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.d.ts +12 -0
  170. package/modern/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.js +15 -0
  171. package/modern/components/base-select/components/list-desktop/list-popover-desktop.d.ts +0 -0
  172. package/modern/components/base-select/components/list-desktop/list-popover-desktop.js +3 -0
  173. package/modern/components/base-select/components/list-desktop/types/types.d.ts +3 -0
  174. package/modern/components/base-select/components/list-desktop/types/types.js +1 -0
  175. package/modern/components/base-select/components/list-mobile/helpers/get-list-bottom-sheet-mobile-props.d.ts +16 -0
  176. package/modern/components/base-select/components/list-mobile/helpers/get-list-bottom-sheet-mobile-props.js +19 -0
  177. package/modern/components/base-select/components/list-mobile/helpers/get-list-modal-mobile-props.d.ts +28 -0
  178. package/modern/components/base-select/components/list-mobile/helpers/get-list-modal-mobile-props.js +18 -0
  179. package/modern/components/base-select/components/list-mobile/helpers/index.d.ts +2 -0
  180. package/modern/components/base-select/components/list-mobile/helpers/index.js +2 -0
  181. package/modern/components/base-select/components/list-mobile/list-bottom-sheet-mobile.d.ts +15 -0
  182. package/modern/components/base-select/components/list-mobile/list-bottom-sheet-mobile.js +24 -0
  183. package/modern/components/base-select/components/list-mobile/list-mobile.d.ts +16 -0
  184. package/modern/components/base-select/components/list-mobile/list-mobile.js +17 -0
  185. package/modern/components/base-select/components/list-mobile/list-modal-mobile.d.ts +15 -0
  186. package/modern/components/base-select/components/list-mobile/list-modal-mobile.js +32 -0
  187. package/modern/components/base-select/components/list-mobile/types/types.d.ts +4 -0
  188. package/modern/components/base-select/components/list-mobile/types/types.js +1 -0
  189. package/modern/components/base-select/index.css +16 -14
  190. package/modern/components/base-select/mobile.css +19 -17
  191. package/modern/components/base-select/types/component-types.d.ts +50 -0
  192. package/modern/components/base-select/types/component-types.js +1 -0
  193. package/modern/components/checkmark/Component.js +1 -1
  194. package/modern/components/checkmark/index.css +15 -13
  195. package/modern/components/checkmark-mobile/Component.js +1 -1
  196. package/modern/components/checkmark-mobile/index.css +9 -7
  197. package/modern/components/field/Component.js +1 -1
  198. package/modern/components/field/index.css +15 -13
  199. package/modern/components/footer/Component.js +1 -1
  200. package/modern/components/footer/index.css +9 -7
  201. package/modern/components/optgroup/Component.js +1 -1
  202. package/modern/components/optgroup/index.css +12 -10
  203. package/modern/components/option/Component.js +1 -1
  204. package/modern/components/option/index.css +24 -22
  205. package/modern/components/options-list/Component.js +1 -1
  206. package/modern/components/options-list/index.css +16 -14
  207. package/modern/components/search/Component.js +1 -1
  208. package/modern/components/search/index.css +5 -3
  209. package/modern/components/virtual-options-list/Component.js +1 -1
  210. package/modern/components/virtual-options-list/index.css +21 -19
  211. package/modern/list-popover-desktop-380bb61b.d.ts +9 -0
  212. package/modern/list-popover-desktop-380bb61b.js +15 -0
  213. package/modern/mobile/Component.mobile.js +1 -1
  214. package/modern/mobile.module-5f7203b5.js +4 -0
  215. package/modern/presets/index.js +1 -1
  216. package/modern/presets/useSelectWithApply/hook.js +1 -1
  217. package/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
  218. package/modern/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
  219. package/modern/presets/useSelectWithApply/options-list-with-apply/footer/index.css +8 -6
  220. package/modern/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
  221. package/modern/presets/useSelectWithApply/options-list-with-apply/header/index.css +8 -6
  222. package/modern/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  223. package/modern/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
  224. package/modern/presets/useSelectWithLoading/hook.js +1 -1
  225. package/modern/presets/useSelectWithLoading/index.css +2 -2
  226. package/modern/shared/index.js +1 -1
  227. package/package.json +6 -4
  228. package/presets/index.js +1 -1
  229. package/presets/useSelectWithApply/hook.js +1 -1
  230. package/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
  231. package/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
  232. package/presets/useSelectWithApply/options-list-with-apply/footer/index.css +8 -6
  233. package/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
  234. package/presets/useSelectWithApply/options-list-with-apply/header/index.css +8 -6
  235. package/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  236. package/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
  237. package/presets/useSelectWithLoading/hook.js +1 -1
  238. package/presets/useSelectWithLoading/index.css +2 -2
  239. package/shared/index.js +1 -1
  240. package/src/components/base-select/Component.tsx +49 -185
  241. package/src/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.tsx +24 -0
  242. package/src/components/base-select/components/list-desktop/list-popover-desktop.tsx +47 -0
  243. package/src/components/base-select/components/list-desktop/types/types.ts +3 -0
  244. package/src/components/base-select/components/list-mobile/helpers/get-list-bottom-sheet-mobile-props.tsx +32 -0
  245. package/src/components/base-select/components/list-mobile/helpers/get-list-modal-mobile-props.tsx +30 -0
  246. package/src/components/base-select/components/list-mobile/helpers/index.ts +2 -0
  247. package/src/components/base-select/components/list-mobile/list-bottom-sheet-mobile.tsx +84 -0
  248. package/src/components/base-select/components/list-mobile/list-mobile.tsx +39 -0
  249. package/src/components/base-select/components/list-mobile/list-modal-mobile.tsx +94 -0
  250. package/src/components/base-select/components/list-mobile/types/types.ts +4 -0
  251. package/src/components/base-select/types/component-types.ts +39 -0
  252. /package/esm/{hook-86063cab.d.ts → hook-74830211.d.ts} +0 -0
  253. /package/esm/{hook-86063cab.js → hook-74830211.js} +0 -0
  254. /package/{hook-777449d0.d.ts → hook-b7a5b3a9.d.ts} +0 -0
  255. /package/{hook-777449d0.js → hook-b7a5b3a9.js} +0 -0
  256. /package/modern/{hook-1c546c40.d.ts → hook-d5ca0e82.d.ts} +0 -0
  257. /package/modern/{hook-1c546c40.js → hook-d5ca0e82.js} +0 -0
@@ -1,4 +1,4 @@
1
- /* hash: 4g3b6 */
1
+ /* hash: 195ep */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-modal-bg-primary: #fff;
@@ -16,10 +16,12 @@
16
16
 
17
17
  /* Hard up */
18
18
  } :root {
19
- } :root {
20
- --gap-s: 12px;
21
- --gap-m: 16px;
22
- --gap-l: 20px;
19
+ } :root { /* deprecated */ /* deprecated */ /* deprecated */
20
+ --gap-s: 12px; /* deprecated */ /* deprecated */
21
+ --gap-m: 16px; /* deprecated */
22
+ --gap-l: 20px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
23
+
24
+ /* новые значения, используйте их */
23
25
  } :root {
24
26
  } :root {
25
27
  --disabled-cursor: not-allowed;
@@ -43,7 +45,7 @@
43
45
  /* checkmark */
44
46
 
45
47
  /* optgroup */
46
- } .select__option_w2gcg {
48
+ } .select__option_1lyt9 {
47
49
  font-size: 16px;
48
50
  line-height: 20px;
49
51
  font-weight: 400;
@@ -57,36 +59,36 @@
57
59
  position: relative;
58
60
  cursor: pointer;
59
61
  min-height: var(--size-s-height)
60
- } .select__option_w2gcg:not(.select__disabled_w2gcg):active {
62
+ } .select__option_1lyt9:not(.select__disabled_1lyt9):active {
61
63
  background: var(--select-option-active-background);
62
64
  color: var(--select-option-active-color);
63
- } .select__option_w2gcg.select__checkmarkBefore_w2gcg {
65
+ } .select__option_1lyt9.select__checkmarkBefore_1lyt9 {
64
66
  padding: 0 0 0 var(--gap-s)
65
- } .select__option_w2gcg.select__checkmarkBefore_w2gcg.select__mobile_w2gcg {
67
+ } .select__option_1lyt9.select__checkmarkBefore_1lyt9.select__mobile_1lyt9 {
66
68
  padding-left: var(--gap-m);
67
- } .select__option_w2gcg.select__checkmarkAfter_w2gcg.select__checkmarkAfter_w2gcg {
69
+ } .select__option_1lyt9.select__checkmarkAfter_1lyt9.select__checkmarkAfter_1lyt9 {
68
70
  padding: 0 var(--gap-s) 0 0
69
- } .select__option_w2gcg.select__checkmarkAfter_w2gcg.select__checkmarkAfter_w2gcg.select__mobile_w2gcg {
71
+ } .select__option_1lyt9.select__checkmarkAfter_1lyt9.select__checkmarkAfter_1lyt9.select__mobile_1lyt9 {
70
72
  padding-right: var(--gap-l);
71
- } .select__option_w2gcg.select__textContent_w2gcg {
73
+ } .select__option_1lyt9.select__textContent_1lyt9 {
72
74
  padding: var(--gap-s)
73
- } .select__option_w2gcg.select__textContent_w2gcg.select__mobile_w2gcg {
75
+ } .select__option_1lyt9.select__textContent_1lyt9.select__mobile_1lyt9 {
74
76
  padding: var(--gap-m) var(--gap-l) var(--gap-m) var(--gap-m);
75
- } .select__selected_w2gcg {
77
+ } .select__selected_1lyt9 {
76
78
  background: var(--select-option-selected-background);
77
79
  color: var(--select-option-selected-color);
78
80
  cursor: default;
79
- } .select__highlighted_w2gcg {
81
+ } .select__highlighted_1lyt9 {
80
82
  background: var(--select-option-hover-background);
81
83
  color: var(--select-option-hover-color);
82
- } .select__disabled_w2gcg {
84
+ } .select__disabled_1lyt9 {
83
85
  cursor: var(--disabled-cursor);
84
86
  background: var(--select-option-disabled-background);
85
87
  color: var(--select-option-disabled-color);
86
- } .select__checkmarkBeforeContent_w2gcg {
88
+ } .select__checkmarkBeforeContent_1lyt9 {
87
89
  margin-right: var(--gap-s);
88
- } .select__checkmarkAfterContent_w2gcg {
90
+ } .select__checkmarkAfterContent_1lyt9 {
89
91
  margin-left: var(--gap-s);
90
- } .select__content_w2gcg {
92
+ } .select__content_1lyt9 {
91
93
  flex: 1;
92
94
  }
@@ -1,20 +1,14 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
- import { FC } from "react";
4
- import { BottomSheetProps } from "@alfalab/core-components-bottom-sheet";
5
- import { ModalMobileProps } from "@alfalab/core-components-modal/mobile";
6
- import { ModalContentProps, ModalFooterProps, ModalHeaderProps } from "@alfalab/core-components-modal/shared";
7
- import { PopoverProps } from "@alfalab/core-components-popover";
8
- import { AdditionalMobileProps, BaseSelectProps, BottomSheetSelectMobileProps, ModalSelectMobileProps } from "../../typings";
9
- declare const BaseSelect: React.ForwardRefExoticComponent<BaseSelectProps & AdditionalMobileProps & BottomSheetSelectMobileProps & ModalSelectMobileProps & {
3
+ declare const BaseSelect: React.ForwardRefExoticComponent<import("../../typings").BaseSelectProps & import("../../typings").AdditionalMobileProps & import("../../typings").BottomSheetSelectMobileProps & import("../../typings").ModalSelectMobileProps & {
10
4
  isBottomSheet?: boolean | undefined;
11
- view: 'desktop' | 'mobile';
12
- Popover?: React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLDivElement>> | undefined;
13
- BottomSheet?: React.ForwardRefExoticComponent<BottomSheetProps & React.RefAttributes<HTMLDivElement>> | undefined;
14
- ModalMobile?: (React.ForwardRefExoticComponent<ModalMobileProps & React.RefAttributes<HTMLDivElement>> & {
15
- Header: FC<ModalHeaderProps>;
16
- Footer: FC<ModalFooterProps>;
17
- Content: FC<ModalContentProps>;
5
+ view: "mobile" | "desktop";
6
+ Popover?: React.ForwardRefExoticComponent<import("@alfalab/core-components-popover").PopoverProps & React.RefAttributes<HTMLDivElement>> | undefined;
7
+ BottomSheet?: React.ForwardRefExoticComponent<import("@alfalab/core-components-bottom-sheet").BottomSheetProps & React.RefAttributes<HTMLDivElement>> | undefined;
8
+ ModalMobile?: (React.ForwardRefExoticComponent<import("./types/component-types").ModalMobileProps & React.RefAttributes<HTMLDivElement>> & {
9
+ Header: React.FC<import("@alfalab/core-components-modal/shared").ModalHeaderProps>;
10
+ Footer: React.FC<import("@alfalab/core-components-modal/shared").ModalFooterProps>;
11
+ Content: React.FC<import("./types/component-types").ContentProps>;
18
12
  }) | undefined;
19
13
  } & React.RefAttributes<unknown>>;
20
14
  export { BaseSelect };
@@ -9,22 +9,23 @@ import { fnUtils, getDataTestId } from '@alfalab/core-components-shared/esm';
9
9
  import { useLayoutEffect_SAFE_FOR_SSR } from '@alfalab/hooks';
10
10
  import { defaultAccessor, defaultFilterFn, defaultGroupAccessor, processOptions, isGroup } from '../../utils.js';
11
11
  import { NativeSelect } from '../native-select/Component.js';
12
-
13
- var styles = {"component":"select__component_e6vg1","popoverInner":"select__popoverInner_e6vg1","optionsListWrapper":"select__optionsListWrapper_e6vg1","optionsListBorder":"select__optionsListBorder_e6vg1","nativeSelect":"select__nativeSelect_e6vg1","block":"select__block_e6vg1","emptySearchPlaceholder":"select__emptySearchPlaceholder_e6vg1","search":"select__search_e6vg1"};
14
- require('./index.css')
15
-
16
- var mobileStyles = {"sheet":"select__sheet_594wa","sheetContent":"select__sheetContent_594wa","modalContent":"select__modalContent_594wa","sheetContainer":"select__sheetContainer_594wa","optionsListWrapper":"select__optionsListWrapper_594wa","optionsList":"select__optionsList_594wa","scrollbar":"select__scrollbar_594wa","search":"select__search_594wa","option":"select__option_594wa","optionGroup":"select__optionGroup_594wa"};
17
- require('./mobile.css')
12
+ import { getListPopoverDesktopProps } from './components/list-desktop/helpers/get-list-popover-desktop-props.js';
13
+ import { s as styles, L as ListPopoverDesktop } from '../../list-popover-desktop-a16c1a9c.js';
14
+ import { getListModalMobileProps } from './components/list-mobile/helpers/get-list-modal-mobile-props.js';
15
+ import { getListBottomSheetMobileProps } from './components/list-mobile/helpers/get-list-bottom-sheet-mobile-props.js';
16
+ import { ListMobile } from './components/list-mobile/list-mobile.js';
17
+ import { m as mobileStyles } from '../../mobile.module-3975aa85.js';
18
18
 
19
19
  var itemToString = function (option) { return (option ? option.key : ''); };
20
20
  var isItemDisabled = function (option) { return Boolean(option === null || option === void 0 ? void 0 : option.disabled); };
21
21
  var BaseSelect = forwardRef(
22
22
  // TODO: 😭
23
23
  // eslint-disable-next-line complexity
24
- function (_a, ref) {
25
- var _b;
26
- var _c, _d;
27
- var dataTestId = _a.dataTestId, className = _a.className, fieldClassName = _a.fieldClassName, optionGroupClassName = _a.optionGroupClassName, optionsListClassName = _a.optionsListClassName, optionClassName = _a.optionClassName, popperClassName = _a.popperClassName, options = _a.options, _e = _a.autocomplete, autocomplete = _e === void 0 ? false : _e, _f = _a.multiple, multiple = _f === void 0 ? false : _f, _g = _a.allowUnselect, allowUnselect = _g === void 0 ? false : _g, _h = _a.disabled, disabled = _h === void 0 ? false : _h, _j = _a.closeOnSelect, closeOnSelect = _j === void 0 ? !multiple : _j, _k = _a.circularNavigation, circularNavigation = _k === void 0 ? false : _k, _l = _a.nativeSelect, nativeSelect = _l === void 0 ? false : _l, _m = _a.defaultOpen, defaultOpen = _m === void 0 ? false : _m, openProp = _a.open, _o = _a.popoverPosition, popoverPosition = _o === void 0 ? 'bottom-start' : _o, _p = _a.preventFlip, preventFlip = _p === void 0 ? true : _p, _q = _a.optionsListWidth, optionsListWidth = _q === void 0 ? 'content' : _q, name = _a.name, id = _a.id, selected = _a.selected, _r = _a.size, size = _r === void 0 ? 48 : _r, _s = _a.optionsSize, optionsSize = _s === void 0 ? size : _s, error = _a.error, hint = _a.hint, block = _a.block, label = _a.label, labelView = _a.labelView, placeholder = _a.placeholder, _t = _a.fieldProps, fieldProps = _t === void 0 ? {} : _t, _u = _a.optionsListProps, optionsListProps = _u === void 0 ? {} : _u, _v = _a.optionProps, optionProps = _v === void 0 ? {} : _v, _w = _a.searchProps, searchProps = _w === void 0 ? {} : _w, _x = _a.showSearch, showSearch = _x === void 0 ? false : _x, valueRenderer = _a.valueRenderer, onChange = _a.onChange, onOpen = _a.onOpen, onFocus = _a.onFocus, onBlur = _a.onBlur, onScroll = _a.onScroll, Arrow = _a.Arrow, _y = _a.Field, Field = _y === void 0 ? function () { return null; } : _y, _z = _a.OptionsList, OptionsList = _z === void 0 ? function () { return null; } : _z, _0 = _a.Optgroup, Optgroup = _0 === void 0 ? function () { return null; } : _0, _1 = _a.Option, Option = _1 === void 0 ? function () { return null; } : _1, _2 = _a.Search, Search = _2 === void 0 ? function () { return null; } : _2, updatePopover = _a.updatePopover, zIndexPopover = _a.zIndexPopover, _3 = _a.showEmptyOptionsList, showEmptyOptionsList = _3 === void 0 ? false : _3, visibleOptions = _a.visibleOptions, view = _a.view, _4 = _a.isBottomSheet, isBottomSheet = _4 === void 0 ? true : _4, footer = _a.footer, swipeable = _a.swipeable, modalProps = _a.modalProps, popoverProps = _a.popoverProps, modalFooterProps = _a.modalFooterProps, modalHeaderProps = _a.modalHeaderProps, bottomSheetProps = _a.bottomSheetProps, Popover = _a.Popover, ModalMobile = _a.ModalMobile, BottomSheet = _a.BottomSheet, limitDynamicOptionGroupSize = _a.limitDynamicOptionGroupSize;
24
+ function (props, ref) {
25
+ var _a;
26
+ var _b, _c;
27
+ var dataTestId = props.dataTestId, className = props.className, fieldClassName = props.fieldClassName, optionGroupClassName = props.optionGroupClassName, optionsListClassName = props.optionsListClassName, optionClassName = props.optionClassName, options = props.options, _d = props.autocomplete, autocomplete = _d === void 0 ? false : _d, _e = props.multiple, multiple = _e === void 0 ? false : _e, _f = props.allowUnselect, allowUnselect = _f === void 0 ? false : _f, _g = props.disabled, disabled = _g === void 0 ? false : _g, _h = props.closeOnSelect, closeOnSelect = _h === void 0 ? !multiple : _h, _j = props.circularNavigation, circularNavigation = _j === void 0 ? false : _j, _k = props.nativeSelect, nativeSelect = _k === void 0 ? false : _k, _l = props.defaultOpen, defaultOpen = _l === void 0 ? false : _l, openProp = props.open, _m = props.optionsListWidth, optionsListWidth = _m === void 0 ? 'content' : _m, name = props.name, id = props.id, selected = props.selected, _o = props.size, size = _o === void 0 ? 48 : _o, _p = props.optionsSize, optionsSize = _p === void 0 ? size : _p, error = props.error, hint = props.hint, block = props.block, label = props.label, labelView = props.labelView, placeholder = props.placeholder, _q = props.fieldProps, fieldProps = _q === void 0 ? {} : _q, _r = props.optionsListProps, optionsListProps = _r === void 0 ? {} : _r, _s = props.optionProps, optionProps = _s === void 0 ? {} : _s, _t = props.searchProps, searchProps = _t === void 0 ? {} : _t, _u = props.showSearch, showSearch = _u === void 0 ? false : _u, valueRenderer = props.valueRenderer, onChange = props.onChange, onOpen = props.onOpen, onFocus = props.onFocus, onBlur = props.onBlur, onScroll = props.onScroll, Arrow = props.Arrow, _v = props.Field, Field = _v === void 0 ? function () { return null; } : _v, _w = props.OptionsList, OptionsList = _w === void 0 ? function () { return null; } : _w, _x = props.Optgroup, Optgroup = _x === void 0 ? function () { return null; } : _x, _y = props.Option, Option = _y === void 0 ? function () { return null; } : _y, _z = props.Search, Search = _z === void 0 ? function () { return null; } : _z, _0 = props.showEmptyOptionsList, showEmptyOptionsList = _0 === void 0 ? false : _0, visibleOptions = props.visibleOptions, view = props.view, _1 = props.isBottomSheet, isBottomSheet = _1 === void 0 ? true : _1, modalProps = props.modalProps, bottomSheetProps = props.bottomSheetProps, limitDynamicOptionGroupSize = props.limitDynamicOptionGroupSize;
28
+ var shouldSearchBlurRef = useRef(true);
28
29
  var rootRef = useRef(null);
29
30
  var fieldRef = useRef(null);
30
31
  var listRef = useRef(null);
@@ -32,15 +33,15 @@ function (_a, ref) {
32
33
  var searchRef = useRef(null);
33
34
  var scrollableContainerRef = useRef(null);
34
35
  var onOpenRef = useRef(onOpen);
35
- var _5 = React.useState(''), searchState = _5[0], setSearchState = _5[1];
36
- var _6 = typeof (searchProps === null || searchProps === void 0 ? void 0 : searchProps.value) === 'string'
36
+ var _2 = React.useState(''), searchState = _2[0], setSearchState = _2[1];
37
+ var _3 = typeof (searchProps === null || searchProps === void 0 ? void 0 : searchProps.value) === 'string'
37
38
  ? [searchProps.value, searchProps.onChange]
38
- : [searchState, setSearchState], search = _6[0], setSearch = _6[1];
39
+ : [searchState, setSearchState], search = _3[0], setSearch = _3[1];
39
40
  var accessor = searchProps.accessor || defaultAccessor;
40
41
  var filterFn = searchProps.filterFn || defaultFilterFn;
41
- var filterGroup = (_c = searchProps.filterGroup) !== null && _c !== void 0 ? _c : false;
42
- var groupAccessor = (_d = searchProps.groupAccessor) !== null && _d !== void 0 ? _d : defaultGroupAccessor;
43
- var _7 = useMemo(function () {
42
+ var filterGroup = (_b = searchProps.filterGroup) !== null && _b !== void 0 ? _b : false;
43
+ var groupAccessor = (_c = searchProps.groupAccessor) !== null && _c !== void 0 ? _c : defaultGroupAccessor;
44
+ var _4 = useMemo(function () {
44
45
  return processOptions(options, selected, function (option) {
45
46
  if (isGroup(option)) {
46
47
  var groupAccessorValue = groupAccessor(option);
@@ -49,7 +50,7 @@ function (_a, ref) {
49
50
  }
50
51
  return filterFn(accessor(option), search);
51
52
  }, filterGroup);
52
- }, [options, selected, filterFn, accessor, search, filterGroup, groupAccessor]), filteredOptions = _7.filteredOptions, flatOptions = _7.flatOptions, selectedOptions = _7.selectedOptions;
53
+ }, [options, selected, filterFn, accessor, search, filterGroup, groupAccessor]), filteredOptions = _4.filteredOptions, flatOptions = _4.flatOptions, selectedOptions = _4.selectedOptions;
53
54
  var scrollIntoView = function (node) {
54
55
  if (!node || view === 'mobile')
55
56
  return;
@@ -92,8 +93,8 @@ function (_a, ref) {
92
93
  useMultipleSelectionProps.selectedItems = selectedOptions;
93
94
  }
94
95
  onOpenRef.current = onOpen;
95
- var _8 = useMultipleSelection(useMultipleSelectionProps), selectedItems = _8.selectedItems, addSelectedItem = _8.addSelectedItem, setSelectedItems = _8.setSelectedItems, removeSelectedItem = _8.removeSelectedItem, getDropdownProps = _8.getDropdownProps;
96
- var _9 = useCombobox({
96
+ var _5 = useMultipleSelection(useMultipleSelectionProps), selectedItems = _5.selectedItems, addSelectedItem = _5.addSelectedItem, setSelectedItems = _5.setSelectedItems, removeSelectedItem = _5.removeSelectedItem, getDropdownProps = _5.getDropdownProps;
97
+ var _6 = useCombobox({
97
98
  id: id,
98
99
  isOpen: openProp,
99
100
  items: flatOptions,
@@ -174,7 +175,7 @@ function (_a, ref) {
174
175
  return changes;
175
176
  }
176
177
  },
177
- }), open = _9.isOpen, getMenuProps = _9.getMenuProps, getInputProps = _9.getInputProps, getItemProps = _9.getItemProps, getLabelProps = _9.getLabelProps, highlightedIndex = _9.highlightedIndex, toggleMenu = _9.toggleMenu, openMenu = _9.openMenu, closeMenu = _9.closeMenu, setHighlightedIndex = _9.setHighlightedIndex;
178
+ }), open = _6.isOpen, getMenuProps = _6.getMenuProps, getInputProps = _6.getInputProps, getItemProps = _6.getItemProps, getLabelProps = _6.getLabelProps, highlightedIndex = _6.highlightedIndex, toggleMenu = _6.toggleMenu, openMenu = _6.openMenu, closeMenu = _6.closeMenu, setHighlightedIndex = _6.setHighlightedIndex;
178
179
  useEffect(function () {
179
180
  /*
180
181
  * При изменении openProp, состояние внутри downshift в useEnhancedReducer не меняется, поэтому меняем его таким способом
@@ -190,7 +191,7 @@ function (_a, ref) {
190
191
  }
191
192
  }, [openProp, openMenu, closeMenu]);
192
193
  var inputProps = getInputProps(getDropdownProps({ ref: mergeRefs([ref, fieldRef]) }));
193
- var _10 = getMenuProps({ ref: listRef }, { suppressRefError: true }), menuRef = _10.ref, menuProps = __rest(_10, ["ref"]);
194
+ var _7 = getMenuProps({ ref: listRef }, { suppressRefError: true }), menuRef = _7.ref, menuProps = __rest(_7, ["ref"]);
194
195
  var handleEntered = function (node, isAppearing) {
195
196
  var _a, _b, _c, _d, _e;
196
197
  if (showSearch)
@@ -268,6 +269,15 @@ function (_a, ref) {
268
269
  index: index,
269
270
  item: option,
270
271
  onMouseDown: function (event) { return event.preventDefault(); },
272
+ onClick: function () {
273
+ var _a, _b;
274
+ if (view === 'mobile' || !showSearch || multiple)
275
+ return;
276
+ shouldSearchBlurRef.current = false;
277
+ (_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.blur();
278
+ shouldSearchBlurRef.current = true;
279
+ (_b = fieldRef.current) === null || _b === void 0 ? void 0 : _b.focus();
280
+ },
271
281
  }), multiple: multiple, index: index, option: option, size: optionsSize, disabled: option.disabled, highlighted: index === highlightedIndex, selected: selectedItems.some(function (_a) {
272
282
  var key = _a.key;
273
283
  return key === option.key;
@@ -338,6 +348,8 @@ function (_a, ref) {
338
348
  };
339
349
  var handleBlur = function (event) {
340
350
  var _a, _b;
351
+ if (!shouldSearchBlurRef.current)
352
+ return;
341
353
  (_b = (_a = searchProps.componentProps) === null || _a === void 0 ? void 0 : _a.onBlur) === null || _b === void 0 ? void 0 : _b.call(_a, event);
342
354
  handleFieldBlur(event);
343
355
  };
@@ -346,7 +358,7 @@ function (_a, ref) {
346
358
  _a[mobileStyles.search] = view === 'mobile',
347
359
  _a)), ref: mergeRefs([searchRef, ((_c = searchProps === null || searchProps === void 0 ? void 0 : searchProps.componentProps) === null || _c === void 0 ? void 0 : _c.ref) || null]) })));
348
360
  };
349
- var _11 = optionsListProps, header = _11.header, emptyPlaceholder = _11.emptyPlaceholder;
361
+ var _8 = optionsListProps, header = _8.header, emptyPlaceholder = _8.emptyPlaceholder;
350
362
  var renderOptionsListHeader = function () {
351
363
  if (header || (view === 'desktop' && showSearch)) {
352
364
  return (React.createElement(React.Fragment, null,
@@ -375,47 +387,7 @@ function (_a, ref) {
375
387
  _c)), emptyPlaceholder: renderEmptyPlaceholder(), onScroll: onScroll, search: search, multiple: multiple, limitDynamicOptionGroupSize: limitDynamicOptionGroupSize })),
376
388
  view === 'desktop' && React.createElement("div", { className: styles.optionsListBorder })));
377
389
  };
378
- var renderInPopover = function () {
379
- if (!nativeSelect && Popover) {
380
- return (React.createElement(Popover, __assign({}, popoverProps, { open: open, withTransition: false, anchorElement: fieldRef.current, position: popoverPosition, preventFlip: preventFlip, popperClassName: cn(styles.popoverInner, popperClassName), update: updatePopover, zIndex: zIndexPopover }), renderOptionsList()));
381
- }
382
- return null;
383
- };
384
- var renderInBottomSheet = function () {
385
- if (!nativeSelect && BottomSheet) {
386
- return (React.createElement(BottomSheet, __assign({ dataTestId: getDataTestId(dataTestId, 'bottom-sheet'), open: open, className: mobileStyles.sheet, contentClassName: mobileStyles.sheetContent, containerClassName: mobileStyles.sheetContainer, title: label || placeholder, actionButton: footer, stickyHeader: true, hasCloser: true, swipeable: swipeable, initialHeight: showSearch ? 'full' : 'default' }, bottomSheetProps, { sheetContainerRef: menuRef, scrollableContainerRef: scrollableContainerRef, onClose: function () {
387
- var _a;
388
- closeMenu();
389
- (_a = bottomSheetProps === null || bottomSheetProps === void 0 ? void 0 : bottomSheetProps.onClose) === null || _a === void 0 ? void 0 : _a.call(bottomSheetProps);
390
- }, transitionProps: __assign(__assign({}, bottomSheetProps === null || bottomSheetProps === void 0 ? void 0 : bottomSheetProps.transitionProps), { onEntered: handleEntered }), bottomAddons: React.createElement(React.Fragment, null,
391
- renderSearch(),
392
- flatOptions.length > 0 && (bottomSheetProps === null || bottomSheetProps === void 0 ? void 0 : bottomSheetProps.bottomAddons)), containerProps: __assign(__assign({}, bottomSheetProps === null || bottomSheetProps === void 0 ? void 0 : bottomSheetProps.containerProps), { onScroll: onScroll }) }), renderOptionsList()));
393
- }
394
- return null;
395
- };
396
- var renderInModalMobile = function () {
397
- if (!nativeSelect && ModalMobile) {
398
- return (React.createElement(ModalMobile, __assign({ dataTestId: getDataTestId(dataTestId, 'modal'), open: open, hasCloser: true }, modalProps, { componentRef: menuRef, onClose: function () {
399
- var _a;
400
- var args = [];
401
- for (var _i = 0; _i < arguments.length; _i++) {
402
- args[_i] = arguments[_i];
403
- }
404
- closeMenu();
405
- (_a = modalProps === null || modalProps === void 0 ? void 0 : modalProps.onClose) === null || _a === void 0 ? void 0 : _a.call.apply(_a, __spreadArray([modalProps], args, false));
406
- }, contentClassName: cn(mobileStyles.sheetContent, modalProps === null || modalProps === void 0 ? void 0 : modalProps.contentClassName), ref: mergeRefs([
407
- scrollableContainerRef,
408
- modalProps === null || modalProps === void 0 ? void 0 : modalProps.ref,
409
- ]), wrapperProps: __assign(__assign({}, modalProps === null || modalProps === void 0 ? void 0 : modalProps.wrapperProps), { onScroll: onScroll }), transitionProps: __assign(__assign({}, modalProps === null || modalProps === void 0 ? void 0 : modalProps.transitionProps), { onEntered: handleEntered }) }),
410
- React.createElement(ModalMobile.Header, __assign({ hasCloser: true, sticky: true }, modalHeaderProps, { title: undefined, bottomAddons: React.createElement(React.Fragment, null,
411
- renderSearch(),
412
- flatOptions.length > 0 && (modalHeaderProps === null || modalHeaderProps === void 0 ? void 0 : modalHeaderProps.bottomAddons)) }), (modalHeaderProps === null || modalHeaderProps === void 0 ? void 0 : modalHeaderProps.title) || label || placeholder),
413
- React.createElement(ModalMobile.Content, { flex: true, className: mobileStyles.modalContent }, renderOptionsList()),
414
- (modalFooterProps === null || modalFooterProps === void 0 ? void 0 : modalFooterProps.children) && React.createElement(ModalMobile.Footer, __assign({}, modalFooterProps))));
415
- }
416
- return null;
417
- };
418
- return (React.createElement("div", __assign({}, (disabled && { 'aria-disabled': true }), { "aria-expanded": inputProps['aria-expanded'], "aria-haspopup": 'listbox', role: inputProps.role, className: cn(styles.component, (_b = {}, _b[styles.block] = block, _b), className), ref: rootRef, onKeyDown: disabled ? undefined : handleFieldKeyDown, tabIndex: -1, "data-test-id": getDataTestId(dataTestId) }),
390
+ return (React.createElement("div", __assign({}, (disabled && { 'aria-disabled': true }), { "aria-expanded": inputProps['aria-expanded'], "aria-haspopup": 'listbox', role: inputProps.role, className: cn(styles.component, (_a = {}, _a[styles.block] = block, _a), className), ref: rootRef, onKeyDown: disabled ? undefined : handleFieldKeyDown, tabIndex: -1, "data-test-id": getDataTestId(dataTestId) }),
419
391
  nativeSelect && renderNativeSelect(),
420
392
  React.createElement(Field, __assign({ selectedMultiple: selectedItems, selected: selectedItems[0], setSelectedItems: setSelectedItems, toggleMenu: toggleMenu, multiple: multiple, open: open, disabled: disabled, size: size, placeholder: placeholder, label: label && React.createElement("span", __assign({}, getLabelProps()), label), labelView: labelView, Arrow: Arrow && React.createElement(Arrow, { open: open }), error: error, hint: hint, valueRenderer: valueRenderer, className: fieldClassName, innerProps: {
421
393
  onBlur: handleFieldBlur,
@@ -431,9 +403,10 @@ function (_a, ref) {
431
403
  : undefined,
432
404
  }, dataTestId: getDataTestId(dataTestId, 'field') }, fieldProps)),
433
405
  name && !nativeSelect && renderValue(),
434
- view === 'desktop' && renderInPopover(),
435
- view === 'mobile' && isBottomSheet && renderInBottomSheet(),
436
- view === 'mobile' && !isBottomSheet && renderInModalMobile()));
406
+ view === 'desktop' && !nativeSelect && (React.createElement(ListPopoverDesktop, __assign({}, getListPopoverDesktopProps(props), { open: open, fieldRef: fieldRef, renderOptionsList: renderOptionsList }))),
407
+ view === 'mobile' && (React.createElement(ListMobile, { baseProps: isBottomSheet
408
+ ? getListBottomSheetMobileProps(props)
409
+ : getListModalMobileProps(props), open: open, menuRef: menuRef, scrollableContainerRef: scrollableContainerRef, flatOptions: flatOptions, renderOptionsList: renderOptionsList, renderSearch: renderSearch, closeMenu: closeMenu, handleEntered: handleEntered }))));
437
410
  });
438
411
 
439
412
  export { BaseSelect };
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { ComponentProps } from "../../../types/component-types";
3
+ declare const getListPopoverDesktopProps: (props: ComponentProps) => {
4
+ Popover: import("react").ForwardRefExoticComponent<import("@alfalab/core-components-popover").PopoverProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
5
+ popoverProps: Omit<import("@alfalab/core-components-popover").PopoverProps, "className" | "dataTestId" | "anchorElement" | "position" | "preventFlip" | "open" | "update" | "zIndex"> | undefined;
6
+ popoverPosition: import("@alfalab/core-components-popover").Position;
7
+ preventFlip: boolean;
8
+ popperClassName: string | undefined;
9
+ updatePopover: import("react").MutableRefObject<(() => void) | undefined> | undefined;
10
+ zIndexPopover: number | undefined;
11
+ };
12
+ export { getListPopoverDesktopProps };
@@ -0,0 +1,15 @@
1
+ // отделяем необходимые пропсы для передачи в компонент
2
+ var getListPopoverDesktopProps = function (props) {
3
+ var Popover = props.Popover, popoverProps = props.popoverProps, _a = props.popoverPosition, popoverPosition = _a === void 0 ? 'bottom-start' : _a, _b = props.preventFlip, preventFlip = _b === void 0 ? true : _b, popperClassName = props.popperClassName, updatePopover = props.updatePopover, zIndexPopover = props.zIndexPopover;
4
+ return {
5
+ Popover: Popover,
6
+ popoverProps: popoverProps,
7
+ popoverPosition: popoverPosition,
8
+ preventFlip: preventFlip,
9
+ popperClassName: popperClassName,
10
+ updatePopover: updatePopover,
11
+ zIndexPopover: zIndexPopover,
12
+ };
13
+ };
14
+
15
+ export { getListPopoverDesktopProps };
@@ -0,0 +1,4 @@
1
+ import 'tslib';
2
+ import 'react';
3
+ import 'classnames';
4
+ export { L as ListPopoverDesktop } from '../../../../list-popover-desktop-a16c1a9c.js';
@@ -0,0 +1,3 @@
1
+ import { getListPopoverDesktopProps } from "../helpers/get-list-popover-desktop-props";
2
+ type ListPopoverDesktopRestProps = ReturnType<typeof getListPopoverDesktopProps>;
3
+ export { ListPopoverDesktopRestProps };
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { ComponentProps } from "../../../types/component-types";
3
+ declare const getListBottomSheetMobileProps: (props: ComponentProps) => {
4
+ BottomSheet: import("react").ForwardRefExoticComponent<import("@alfalab/core-components-bottom-sheet").BottomSheetProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
5
+ dataTestId: string | undefined;
6
+ label: import("react").ReactNode;
7
+ placeholder: string | undefined;
8
+ footer: import("react").ReactNode;
9
+ swipeable: boolean | undefined;
10
+ showSearch: boolean | undefined;
11
+ bottomSheetProps: Partial<import("@alfalab/core-components-bottom-sheet").BottomSheetProps> | undefined;
12
+ isBottomSheet: boolean;
13
+ nativeSelect: boolean;
14
+ onScroll: ((event: import("react").MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
15
+ };
16
+ export { getListBottomSheetMobileProps };
@@ -0,0 +1,19 @@
1
+ // отделяем необходимые пропсы для передачи в компонент
2
+ var getListBottomSheetMobileProps = function (props) {
3
+ var BottomSheet = props.BottomSheet, dataTestId = props.dataTestId, label = props.label, placeholder = props.placeholder, footer = props.footer, swipeable = props.swipeable, showSearch = props.showSearch, bottomSheetProps = props.bottomSheetProps, _a = props.isBottomSheet, isBottomSheet = _a === void 0 ? true : _a, _b = props.nativeSelect, nativeSelect = _b === void 0 ? false : _b, onScroll = props.onScroll;
4
+ return {
5
+ BottomSheet: BottomSheet,
6
+ dataTestId: dataTestId,
7
+ label: label,
8
+ placeholder: placeholder,
9
+ footer: footer,
10
+ swipeable: swipeable,
11
+ showSearch: showSearch,
12
+ bottomSheetProps: bottomSheetProps,
13
+ isBottomSheet: isBottomSheet,
14
+ nativeSelect: nativeSelect,
15
+ onScroll: onScroll,
16
+ };
17
+ };
18
+
19
+ export { getListBottomSheetMobileProps };
@@ -0,0 +1,28 @@
1
+ /// <reference types="react" />
2
+ import { ComponentProps } from "../../../types/component-types";
3
+ declare const getListModalMobileProps: (props: ComponentProps) => {
4
+ ModalMobile: (import("react").ForwardRefExoticComponent<import("../../../types/component-types").ModalMobileProps & import("react").RefAttributes<HTMLDivElement>> & {
5
+ Header: import("react").FC<import("@alfalab/core-components-modal/shared").ModalHeaderProps>;
6
+ Footer: import("react").FC<import("@alfalab/core-components-modal/shared").ModalFooterProps>;
7
+ Content: import("react").FC<import("../../../types/component-types").ContentProps>;
8
+ }) | undefined;
9
+ dataTestId: string | undefined;
10
+ modalProps: Partial<import("@alfalab/core-components-base-modal").BaseModalProps & {
11
+ size?: "s" | "m" | "l" | "xl" | 500 | "fullscreen" | 600 | 800 | 1140 | undefined;
12
+ fullscreen?: boolean | undefined;
13
+ fixedPosition?: boolean | undefined;
14
+ hasCloser?: boolean | undefined;
15
+ iOSLock?: boolean | undefined;
16
+ } & {
17
+ breakpoint?: number | undefined;
18
+ defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
19
+ } & import("react").RefAttributes<HTMLDivElement>> | undefined;
20
+ modalHeaderProps: Partial<import("@alfalab/core-components-modal/shared").ModalHeaderProps> | undefined;
21
+ modalFooterProps: Partial<import("@alfalab/core-components-modal/shared").ModalFooterProps> | undefined;
22
+ label: import("react").ReactNode;
23
+ placeholder: string | undefined;
24
+ isBottomSheet: boolean;
25
+ nativeSelect: boolean;
26
+ onScroll: ((event: import("react").MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
27
+ };
28
+ export { getListModalMobileProps };
@@ -0,0 +1,18 @@
1
+ // отделяем необходимые пропсы для передачи в компонент
2
+ var getListModalMobileProps = function (props) {
3
+ var ModalMobile = props.ModalMobile, dataTestId = props.dataTestId, modalProps = props.modalProps, modalHeaderProps = props.modalHeaderProps, modalFooterProps = props.modalFooterProps, label = props.label, placeholder = props.placeholder, _a = props.isBottomSheet, isBottomSheet = _a === void 0 ? true : _a, _b = props.nativeSelect, nativeSelect = _b === void 0 ? false : _b, onScroll = props.onScroll;
4
+ return {
5
+ ModalMobile: ModalMobile,
6
+ dataTestId: dataTestId,
7
+ modalProps: modalProps,
8
+ modalHeaderProps: modalHeaderProps,
9
+ modalFooterProps: modalFooterProps,
10
+ label: label,
11
+ placeholder: placeholder,
12
+ isBottomSheet: isBottomSheet,
13
+ nativeSelect: nativeSelect,
14
+ onScroll: onScroll,
15
+ };
16
+ };
17
+
18
+ export { getListModalMobileProps };
@@ -0,0 +1,2 @@
1
+ export { getListModalMobileProps } from "./get-list-modal-mobile-props";
2
+ export { getListBottomSheetMobileProps } from "./get-list-bottom-sheet-mobile-props";
@@ -0,0 +1,2 @@
1
+ export { getListModalMobileProps } from './get-list-modal-mobile-props.js';
2
+ export { getListBottomSheetMobileProps } from './get-list-bottom-sheet-mobile-props.js';
@@ -0,0 +1,15 @@
1
+ import { FC, ReactNode, RefObject } from 'react';
2
+ import { OptionShape } from "../../../../typings";
3
+ import { ListBottomSheetMobileRestProps } from "./types/types";
4
+ type ListMobileProps = {
5
+ open: boolean;
6
+ menuRef: RefObject<HTMLDivElement>;
7
+ scrollableContainerRef: RefObject<HTMLDivElement>;
8
+ flatOptions: OptionShape[];
9
+ closeMenu: () => void;
10
+ handleEntered: (node: HTMLElement, isAppearing: boolean) => void;
11
+ renderSearch: () => ReactNode;
12
+ renderOptionsList: () => ReactNode;
13
+ } & ListBottomSheetMobileRestProps;
14
+ declare const ListBottomSheetMobile: FC<ListMobileProps>;
15
+ export { ListBottomSheetMobile };
@@ -0,0 +1,20 @@
1
+ import { __assign } from 'tslib';
2
+ import React from 'react';
3
+ import { getDataTestId } from '@alfalab/core-components-shared/esm';
4
+ import { m as mobileStyles } from '../../../../mobile.module-3975aa85.js';
5
+
6
+ var ListBottomSheetMobile = function (props) {
7
+ var BottomSheet = props.BottomSheet, dataTestId = props.dataTestId, open = props.open, label = props.label, placeholder = props.placeholder, footer = props.footer, swipeable = props.swipeable, showSearch = props.showSearch, bottomSheetProps = props.bottomSheetProps, menuRef = props.menuRef, scrollableContainerRef = props.scrollableContainerRef, onScroll = props.onScroll, flatOptions = props.flatOptions, closeMenu = props.closeMenu, handleEntered = props.handleEntered, renderSearch = props.renderSearch, renderOptionsList = props.renderOptionsList;
8
+ if (BottomSheet) {
9
+ return (React.createElement(BottomSheet, __assign({ dataTestId: getDataTestId(dataTestId, 'bottom-sheet'), open: open, className: mobileStyles.sheet, contentClassName: mobileStyles.sheetContent, containerClassName: mobileStyles.sheetContainer, title: label || placeholder, actionButton: footer, stickyHeader: true, hasCloser: true, swipeable: swipeable, initialHeight: showSearch ? 'full' : 'default' }, bottomSheetProps, { sheetContainerRef: menuRef, scrollableContainerRef: scrollableContainerRef, onClose: function () {
10
+ var _a;
11
+ closeMenu();
12
+ (_a = bottomSheetProps === null || bottomSheetProps === void 0 ? void 0 : bottomSheetProps.onClose) === null || _a === void 0 ? void 0 : _a.call(bottomSheetProps);
13
+ }, transitionProps: __assign(__assign({}, bottomSheetProps === null || bottomSheetProps === void 0 ? void 0 : bottomSheetProps.transitionProps), { onEntered: handleEntered }), bottomAddons: React.createElement(React.Fragment, null,
14
+ renderSearch(),
15
+ flatOptions.length > 0 && (bottomSheetProps === null || bottomSheetProps === void 0 ? void 0 : bottomSheetProps.bottomAddons)), containerProps: __assign(__assign({}, bottomSheetProps === null || bottomSheetProps === void 0 ? void 0 : bottomSheetProps.containerProps), { onScroll: onScroll }) }), renderOptionsList()));
16
+ }
17
+ return null;
18
+ };
19
+
20
+ export { ListBottomSheetMobile };
@@ -0,0 +1,16 @@
1
+ import { FC, ReactNode, RefObject } from 'react';
2
+ import { OptionShape } from "../../../../typings";
3
+ import { ListBottomSheetMobileRestProps, ListModalMobileRestProps } from "./types/types";
4
+ type ListMobileProps = {
5
+ baseProps: ListBottomSheetMobileRestProps | ListModalMobileRestProps;
6
+ open: boolean;
7
+ menuRef: RefObject<HTMLDivElement>;
8
+ scrollableContainerRef: RefObject<HTMLDivElement>;
9
+ flatOptions: OptionShape[];
10
+ closeMenu: () => void;
11
+ handleEntered: (node: HTMLElement, isAppearing: boolean) => void;
12
+ renderSearch: () => ReactNode;
13
+ renderOptionsList: () => ReactNode;
14
+ };
15
+ declare const ListMobile: FC<ListMobileProps>;
16
+ export { ListMobile };
@@ -0,0 +1,18 @@
1
+ import { __rest, __assign } from 'tslib';
2
+ import React from 'react';
3
+ import { ListBottomSheetMobile } from './list-bottom-sheet-mobile.js';
4
+ import { ListModalMobile } from './list-modal-mobile.js';
5
+
6
+ var ListMobile = function (props) {
7
+ var baseProps = props.baseProps, restProps = __rest(props, ["baseProps"]);
8
+ var isBottomSheet = baseProps.isBottomSheet, nativeSelect = baseProps.nativeSelect;
9
+ if (isBottomSheet && !nativeSelect) {
10
+ return (React.createElement(ListBottomSheetMobile, __assign({}, baseProps, restProps)));
11
+ }
12
+ if (!isBottomSheet && !nativeSelect) {
13
+ return React.createElement(ListModalMobile, __assign({}, baseProps, restProps));
14
+ }
15
+ return null;
16
+ };
17
+
18
+ export { ListMobile };
@@ -0,0 +1,15 @@
1
+ import { FC, ReactNode, RefObject } from 'react';
2
+ import { OptionShape } from "../../../../typings";
3
+ import { ListModalMobileRestProps } from "./types/types";
4
+ type ListModalMobileProps = {
5
+ open: boolean;
6
+ menuRef: RefObject<HTMLDivElement>;
7
+ scrollableContainerRef: RefObject<HTMLDivElement>;
8
+ flatOptions: OptionShape[];
9
+ closeMenu: () => void;
10
+ handleEntered: (node: HTMLElement, isAppearing: boolean) => void;
11
+ renderSearch: () => ReactNode;
12
+ renderOptionsList: () => ReactNode;
13
+ } & ListModalMobileRestProps;
14
+ declare const ListModalMobile: FC<ListModalMobileProps>;
15
+ export { ListModalMobile };
@@ -0,0 +1,32 @@
1
+ import { __assign, __spreadArray } from 'tslib';
2
+ import React from 'react';
3
+ import mergeRefs from 'react-merge-refs';
4
+ import cn from 'classnames';
5
+ import { getDataTestId } from '@alfalab/core-components-shared/esm';
6
+ import { m as mobileStyles } from '../../../../mobile.module-3975aa85.js';
7
+
8
+ var ListModalMobile = function (props) {
9
+ var ModalMobile = props.ModalMobile, dataTestId = props.dataTestId, open = props.open, modalProps = props.modalProps, modalHeaderProps = props.modalHeaderProps, modalFooterProps = props.modalFooterProps, menuRef = props.menuRef, scrollableContainerRef = props.scrollableContainerRef, label = props.label, placeholder = props.placeholder, onScroll = props.onScroll, flatOptions = props.flatOptions, closeMenu = props.closeMenu, handleEntered = props.handleEntered, renderSearch = props.renderSearch, renderOptionsList = props.renderOptionsList;
10
+ if (ModalMobile) {
11
+ return (React.createElement(ModalMobile, __assign({ dataTestId: getDataTestId(dataTestId, 'modal'), open: open, hasCloser: true }, modalProps, { componentRef: menuRef, onClose: function () {
12
+ var _a;
13
+ var args = [];
14
+ for (var _i = 0; _i < arguments.length; _i++) {
15
+ args[_i] = arguments[_i];
16
+ }
17
+ closeMenu();
18
+ (_a = modalProps === null || modalProps === void 0 ? void 0 : modalProps.onClose) === null || _a === void 0 ? void 0 : _a.call.apply(_a, __spreadArray([modalProps], args, false));
19
+ }, contentClassName: cn(mobileStyles.sheetContent, modalProps === null || modalProps === void 0 ? void 0 : modalProps.contentClassName), ref: mergeRefs([
20
+ scrollableContainerRef,
21
+ modalProps === null || modalProps === void 0 ? void 0 : modalProps.ref,
22
+ ]), wrapperProps: __assign(__assign({}, modalProps === null || modalProps === void 0 ? void 0 : modalProps.wrapperProps), { onScroll: onScroll }), transitionProps: __assign(__assign({}, modalProps === null || modalProps === void 0 ? void 0 : modalProps.transitionProps), { onEntered: handleEntered }) }),
23
+ React.createElement(ModalMobile.Header, __assign({ hasCloser: true, sticky: true }, modalHeaderProps, { title: undefined, bottomAddons: React.createElement(React.Fragment, null,
24
+ renderSearch(),
25
+ flatOptions.length > 0 && (modalHeaderProps === null || modalHeaderProps === void 0 ? void 0 : modalHeaderProps.bottomAddons)) }), (modalHeaderProps === null || modalHeaderProps === void 0 ? void 0 : modalHeaderProps.title) || label || placeholder),
26
+ React.createElement(ModalMobile.Content, { flex: true, className: mobileStyles.modalContent }, renderOptionsList()),
27
+ (modalFooterProps === null || modalFooterProps === void 0 ? void 0 : modalFooterProps.children) && React.createElement(ModalMobile.Footer, __assign({}, modalFooterProps))));
28
+ }
29
+ return null;
30
+ };
31
+
32
+ export { ListModalMobile };
@@ -0,0 +1,4 @@
1
+ import { getListBottomSheetMobileProps, getListModalMobileProps } from "../helpers/index";
2
+ type ListBottomSheetMobileRestProps = ReturnType<typeof getListBottomSheetMobileProps>;
3
+ type ListModalMobileRestProps = ReturnType<typeof getListModalMobileProps>;
4
+ export { ListBottomSheetMobileRestProps, ListModalMobileRestProps };