@alfalab/core-components-select 14.0.4 → 14.1.1

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 (218) hide show
  1. package/{Component-d7aff1fb.js → Component-bc321a4f.js} +3 -2
  2. package/Component.js +2 -1
  3. package/Component.responsive.js +4 -3
  4. package/components/arrow/Component.js +1 -1
  5. package/components/arrow/index.css +3 -3
  6. package/components/base-checkmark/Component.js +1 -1
  7. package/components/base-checkmark/index.css +4 -4
  8. package/components/base-option/Component.js +1 -1
  9. package/components/base-option/index.css +13 -13
  10. package/components/base-select/Component.js +2 -2
  11. package/components/base-select/index.css +8 -8
  12. package/components/base-select/index.js +1 -1
  13. package/components/base-select-mobile/Component.js +3 -2
  14. package/components/base-select-mobile/footer/Component.js +1 -1
  15. package/components/base-select-mobile/footer/index.css +5 -5
  16. package/components/base-select-mobile/index.css +10 -10
  17. package/components/base-select-mobile/index.js +2 -1
  18. package/components/checkmark/Component.js +1 -1
  19. package/components/checkmark/index.css +10 -10
  20. package/components/checkmark-mobile/Component.js +1 -1
  21. package/components/checkmark-mobile/index.css +6 -6
  22. package/components/field/Component.js +1 -1
  23. package/components/field/index.css +9 -9
  24. package/components/index.js +4 -3
  25. package/components/optgroup/Component.js +1 -1
  26. package/components/optgroup/index.css +6 -6
  27. package/components/option/Component.js +1 -1
  28. package/components/option/index.css +20 -20
  29. package/components/options-list/Component.js +3 -2
  30. package/components/options-list/index.css +9 -9
  31. package/components/options-list/index.js +1 -0
  32. package/components/select-mobile/Component.js +4 -3
  33. package/components/select-mobile/index.d.ts +1 -1
  34. package/components/select-mobile/index.js +4 -3
  35. package/components/select-modal-mobile/Component.js +4 -3
  36. package/components/select-modal-mobile/index.d.ts +1 -1
  37. package/components/select-modal-mobile/index.js +4 -3
  38. package/components/virtual-options-list/Component.js +3 -2
  39. package/components/virtual-options-list/index.css +15 -15
  40. package/components/virtual-options-list/index.js +1 -0
  41. package/consts.d.ts +2 -0
  42. package/consts.js +7 -0
  43. package/cssm/{Component-d168a54e.js → Component-f86f43e3.js} +2 -1
  44. package/cssm/Component.js +1 -0
  45. package/cssm/Component.responsive.js +2 -1
  46. package/cssm/components/base-select-mobile/Component.js +1 -0
  47. package/cssm/components/base-select-mobile/index.js +1 -0
  48. package/cssm/components/index.js +2 -1
  49. package/cssm/components/options-list/Component.js +2 -1
  50. package/cssm/components/options-list/index.js +1 -0
  51. package/cssm/components/select-mobile/Component.js +2 -1
  52. package/cssm/components/select-mobile/index.d.ts +1 -1
  53. package/cssm/components/select-mobile/index.js +2 -1
  54. package/cssm/components/select-modal-mobile/Component.js +2 -1
  55. package/cssm/components/select-modal-mobile/index.d.ts +1 -1
  56. package/cssm/components/select-modal-mobile/index.js +2 -1
  57. package/cssm/components/virtual-options-list/Component.js +2 -1
  58. package/cssm/components/virtual-options-list/index.js +1 -0
  59. package/cssm/consts.d.ts +2 -0
  60. package/cssm/consts.js +7 -0
  61. package/cssm/hook-4b555174.d.ts +3 -1
  62. package/cssm/index.js +2 -1
  63. package/cssm/presets/index.js +2 -1
  64. package/cssm/presets/useSelectWithApply/hook.js +2 -1
  65. package/cssm/presets/useSelectWithApply/options-list-with-apply/Component.js +2 -1
  66. package/cssm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  67. package/cssm/presets/useSelectWithApply/options-list-with-apply/index.js +2 -1
  68. package/cssm/responsive.js +2 -1
  69. package/cssm/utils.js +7 -3
  70. package/esm/{Component-9ca76807.js → Component-9c34d6d9.js} +3 -2
  71. package/esm/Component.js +2 -1
  72. package/esm/Component.responsive.js +4 -3
  73. package/esm/components/arrow/Component.js +1 -1
  74. package/esm/components/arrow/index.css +3 -3
  75. package/esm/components/base-checkmark/Component.js +1 -1
  76. package/esm/components/base-checkmark/index.css +4 -4
  77. package/esm/components/base-option/Component.js +1 -1
  78. package/esm/components/base-option/index.css +13 -13
  79. package/esm/components/base-select/Component.js +2 -2
  80. package/esm/components/base-select/index.css +8 -8
  81. package/esm/components/base-select/index.js +1 -1
  82. package/esm/components/base-select-mobile/Component.js +3 -2
  83. package/esm/components/base-select-mobile/footer/Component.js +1 -1
  84. package/esm/components/base-select-mobile/footer/index.css +5 -5
  85. package/esm/components/base-select-mobile/index.css +10 -10
  86. package/esm/components/base-select-mobile/index.js +2 -1
  87. package/esm/components/checkmark/Component.js +1 -1
  88. package/esm/components/checkmark/index.css +10 -10
  89. package/esm/components/checkmark-mobile/Component.js +1 -1
  90. package/esm/components/checkmark-mobile/index.css +6 -6
  91. package/esm/components/field/Component.js +1 -1
  92. package/esm/components/field/index.css +9 -9
  93. package/esm/components/index.js +4 -3
  94. package/esm/components/optgroup/Component.js +1 -1
  95. package/esm/components/optgroup/index.css +6 -6
  96. package/esm/components/option/Component.js +1 -1
  97. package/esm/components/option/index.css +20 -20
  98. package/esm/components/options-list/Component.js +3 -2
  99. package/esm/components/options-list/index.css +9 -9
  100. package/esm/components/options-list/index.js +1 -0
  101. package/esm/components/select-mobile/Component.js +4 -3
  102. package/esm/components/select-mobile/index.d.ts +1 -1
  103. package/esm/components/select-mobile/index.js +4 -3
  104. package/esm/components/select-modal-mobile/Component.js +4 -3
  105. package/esm/components/select-modal-mobile/index.d.ts +1 -1
  106. package/esm/components/select-modal-mobile/index.js +4 -3
  107. package/esm/components/virtual-options-list/Component.js +3 -2
  108. package/esm/components/virtual-options-list/index.css +15 -15
  109. package/esm/components/virtual-options-list/index.js +1 -0
  110. package/esm/consts.d.ts +2 -0
  111. package/esm/consts.js +3 -0
  112. package/esm/hook-4b555174.d.ts +3 -1
  113. package/esm/index-3885b0d7.d.ts +1 -1
  114. package/esm/index.js +4 -3
  115. package/esm/presets/index.js +4 -3
  116. package/esm/presets/useLazyLoading/hook.js +2 -2
  117. package/esm/presets/useLazyLoading/index.css +2 -2
  118. package/esm/presets/useSelectWithApply/hook.js +4 -3
  119. package/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +4 -3
  120. package/esm/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
  121. package/esm/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -3
  122. package/esm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  123. package/esm/presets/useSelectWithApply/options-list-with-apply/index.js +4 -3
  124. package/esm/presets/useSelectWithLoading/hook.js +1 -1
  125. package/esm/presets/useSelectWithLoading/index.css +2 -2
  126. package/esm/responsive.js +4 -3
  127. package/esm/utils.js +7 -3
  128. package/hook-4b555174.d.ts +3 -1
  129. package/index-3885b0d7.d.ts +1 -1
  130. package/index.js +4 -3
  131. package/modern/{Component-c3c5c3d4.js → Component-2b8439ea.js} +3 -2
  132. package/modern/Component.js +2 -1
  133. package/modern/Component.responsive.js +4 -3
  134. package/modern/components/arrow/Component.js +1 -1
  135. package/modern/components/arrow/index.css +3 -3
  136. package/modern/components/base-checkmark/Component.js +1 -1
  137. package/modern/components/base-checkmark/index.css +4 -4
  138. package/modern/components/base-option/Component.js +1 -1
  139. package/modern/components/base-option/index.css +13 -13
  140. package/modern/components/base-select/Component.js +2 -2
  141. package/modern/components/base-select/index.css +8 -8
  142. package/modern/components/base-select/index.js +1 -1
  143. package/modern/components/base-select-mobile/Component.js +3 -2
  144. package/modern/components/base-select-mobile/footer/Component.js +1 -1
  145. package/modern/components/base-select-mobile/footer/index.css +5 -5
  146. package/modern/components/base-select-mobile/index.css +10 -10
  147. package/modern/components/base-select-mobile/index.js +2 -1
  148. package/modern/components/checkmark/Component.js +1 -1
  149. package/modern/components/checkmark/index.css +10 -10
  150. package/modern/components/checkmark-mobile/Component.js +1 -1
  151. package/modern/components/checkmark-mobile/index.css +6 -6
  152. package/modern/components/field/Component.js +1 -1
  153. package/modern/components/field/index.css +9 -9
  154. package/modern/components/index.js +4 -3
  155. package/modern/components/optgroup/Component.js +1 -1
  156. package/modern/components/optgroup/index.css +6 -6
  157. package/modern/components/option/Component.js +1 -1
  158. package/modern/components/option/index.css +20 -20
  159. package/modern/components/options-list/Component.js +3 -2
  160. package/modern/components/options-list/index.css +9 -9
  161. package/modern/components/options-list/index.js +1 -0
  162. package/modern/components/select-mobile/Component.js +4 -3
  163. package/modern/components/select-mobile/index.d.ts +1 -1
  164. package/modern/components/select-mobile/index.js +4 -3
  165. package/modern/components/select-modal-mobile/Component.js +4 -3
  166. package/modern/components/select-modal-mobile/index.d.ts +1 -1
  167. package/modern/components/select-modal-mobile/index.js +4 -3
  168. package/modern/components/virtual-options-list/Component.js +3 -2
  169. package/modern/components/virtual-options-list/index.css +15 -15
  170. package/modern/components/virtual-options-list/index.js +1 -0
  171. package/modern/consts.d.ts +2 -0
  172. package/modern/consts.js +3 -0
  173. package/modern/hook-4b555174.d.ts +3 -1
  174. package/modern/index-3885b0d7.d.ts +1 -1
  175. package/modern/index.js +4 -3
  176. package/modern/presets/index.js +4 -3
  177. package/modern/presets/useLazyLoading/hook.js +2 -2
  178. package/modern/presets/useLazyLoading/index.css +2 -2
  179. package/modern/presets/useSelectWithApply/hook.js +4 -3
  180. package/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +4 -3
  181. package/modern/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
  182. package/modern/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -3
  183. package/modern/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  184. package/modern/presets/useSelectWithApply/options-list-with-apply/index.js +4 -3
  185. package/modern/presets/useSelectWithLoading/hook.js +1 -1
  186. package/modern/presets/useSelectWithLoading/index.css +2 -2
  187. package/modern/responsive.js +4 -3
  188. package/modern/utils.js +7 -3
  189. package/package.json +5 -5
  190. package/presets/index.js +4 -3
  191. package/presets/useLazyLoading/hook.js +2 -2
  192. package/presets/useLazyLoading/index.css +2 -2
  193. package/presets/useSelectWithApply/hook.js +4 -3
  194. package/presets/useSelectWithApply/options-list-with-apply/Component.js +4 -3
  195. package/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
  196. package/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -3
  197. package/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  198. package/presets/useSelectWithApply/options-list-with-apply/index.js +4 -3
  199. package/presets/useSelectWithLoading/hook.js +1 -1
  200. package/presets/useSelectWithLoading/index.css +2 -2
  201. package/responsive.js +4 -3
  202. package/utils.js +7 -3
  203. /package/{Component-d7aff1fb.d.ts → Component-bc321a4f.d.ts} +0 -0
  204. /package/cssm/{Component-d168a54e.d.ts → Component-f86f43e3.d.ts} +0 -0
  205. /package/esm/{Component-9ca76807.d.ts → Component-9c34d6d9.d.ts} +0 -0
  206. /package/esm/{getDataTestId-3d3897c4.d.ts → getDataTestId-5cf85f5f.d.ts} +0 -0
  207. /package/esm/{getDataTestId-3d3897c4.js → getDataTestId-5cf85f5f.js} +0 -0
  208. /package/esm/{intersection-observer-39fb9555.d.ts → intersection-observer-6454a00a.d.ts} +0 -0
  209. /package/esm/{intersection-observer-39fb9555.js → intersection-observer-6454a00a.js} +0 -0
  210. /package/{getDataTestId-8b7a873e.d.ts → getDataTestId-71b2faac.d.ts} +0 -0
  211. /package/{getDataTestId-8b7a873e.js → getDataTestId-71b2faac.js} +0 -0
  212. /package/{intersection-observer-3942f19b.d.ts → intersection-observer-493fce75.d.ts} +0 -0
  213. /package/{intersection-observer-3942f19b.js → intersection-observer-493fce75.js} +0 -0
  214. /package/modern/{Component-c3c5c3d4.d.ts → Component-2b8439ea.d.ts} +0 -0
  215. /package/modern/{getDataTestId-47f59f1b.d.ts → getDataTestId-93dd9487.d.ts} +0 -0
  216. /package/modern/{getDataTestId-47f59f1b.js → getDataTestId-93dd9487.js} +0 -0
  217. /package/modern/{intersection-observer-39fb9555.d.ts → intersection-observer-6454a00a.d.ts} +0 -0
  218. /package/modern/{intersection-observer-39fb9555.js → intersection-observer-6454a00a.js} +0 -0
@@ -1,4 +1,4 @@
1
- /* hash: w3seg */
1
+ /* hash: m3xmu */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-border-primary: #dcdcdd;
@@ -35,34 +35,34 @@
35
35
  /* checkmark */
36
36
 
37
37
  /* optgroup */
38
- } .select__virtualOptionsList_q18mo {
38
+ } .select__virtualOptionsList_1a305 {
39
39
  width: 100%;
40
40
  outline: none;
41
41
  box-sizing: border-box;
42
42
  position: sticky;
43
- } .select__virtualOptionsListHeader_q18mo {
43
+ } .select__virtualOptionsListHeader_1a305 {
44
44
  box-sizing: border-box;
45
45
  border-bottom: 1px solid var(--color-light-border-secondary);
46
- } .select__virtualOptionsListFooter_q18mo {
46
+ } .select__virtualOptionsListFooter_1a305 {
47
47
  position: sticky;
48
48
  bottom: 0;
49
49
  box-sizing: border-box;
50
50
  border-top: 1px solid transparent
51
- } .select__virtualOptionsListFooter_q18mo.select__withBorder_q18mo {
51
+ } .select__virtualOptionsListFooter_1a305.select__withBorder_1a305 {
52
52
  border-top: 1px solid var(--color-light-border-secondary);
53
- } .select__scrollable_q18mo {
53
+ } .select__scrollable_1a305 {
54
54
  position: relative;
55
55
  overflow: auto;
56
56
  width: 100%;
57
- } .select__inner_q18mo {
57
+ } .select__inner_1a305 {
58
58
  position: relative;
59
59
  width: 100%;
60
- } .select__virtualRow_q18mo {
60
+ } .select__virtualRow_1a305 {
61
61
  position: absolute;
62
62
  top: 0;
63
63
  left: 0;
64
64
  width: 100%
65
- } .select__virtualRow_q18mo:before {
65
+ } .select__virtualRow_1a305:before {
66
66
  content: '';
67
67
  position: absolute;
68
68
  z-index: 1;
@@ -72,15 +72,15 @@
72
72
  height: 1px;
73
73
  background: var(--select-option-divider-background);
74
74
  display: var(--select-option-divider-display);
75
- } .select__virtualRow_q18mo:first-child:before {
75
+ } .select__virtualRow_1a305:first-child:before {
76
76
  display: none;
77
- } .select__highlighted_q18mo:before,
78
- .select__highlighted_q18mo + .select__virtualRow_q18mo:before {
77
+ } .select__highlighted_1a305:before,
78
+ .select__highlighted_1a305 + .select__virtualRow_1a305:before {
79
79
  display: none;
80
- } .select__emptyPlaceholder_q18mo {
80
+ } .select__emptyPlaceholder_1a305 {
81
81
  padding: var(--gap-m) var(--gap-s);
82
82
  color: var(--select-options-list-empty-placeholder-color);
83
- } .select__l_q18mo .select__emptyPlaceholder_q18mo,
84
- .select__xl_q18mo .select__emptyPlaceholder_q18mo {
83
+ } .select__l_1a305 .select__emptyPlaceholder_1a305,
84
+ .select__xl_1a305 .select__emptyPlaceholder_1a305 {
85
85
  padding: var(--gap-xl) var(--gap-m);
86
86
  }
@@ -6,5 +6,6 @@ import 'react-virtual';
6
6
  import 'classnames';
7
7
  import '@alfalab/core-components-scrollbar/esm';
8
8
  import '@alfalab/hooks';
9
+ import '../../consts.js';
9
10
  import '../../utils.js';
10
11
  import '../optgroup/Component.js';
@@ -0,0 +1,2 @@
1
+ declare const DEFAULT_VISIBLE_OPTIONS = 5;
2
+ export { DEFAULT_VISIBLE_OPTIONS };
package/esm/consts.js ADDED
@@ -0,0 +1,3 @@
1
+ var DEFAULT_VISIBLE_OPTIONS = 5;
2
+
3
+ export { DEFAULT_VISIBLE_OPTIONS };
@@ -36,7 +36,9 @@ declare function useSelectWithApply({ options, selected, onChange, OptionsList,
36
36
  showClear?: boolean | undefined;
37
37
  onClose?: (() => void) | undefined;
38
38
  selectedDraft?: OptionShape[] | undefined;
39
- OptionsList?: import("react").FC<import("./index").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
39
+ OptionsList?: import("react").FC<import("./index").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined; /**
40
+ * Пропсы, которые будут прокинуты в компонент списка
41
+ */
40
42
  Footer?: import("react").FC<import("./presets/useSelectWithApply/options-list-with-apply/footer/Component").FooterProps> | undefined;
41
43
  } & import("react").RefAttributes<HTMLDivElement>>;
42
44
  optionsListProps: {
@@ -1,3 +1,3 @@
1
1
  declare const isClient: () => boolean;
2
2
  export { isClient };
3
- export * from "./getDataTestId-3d3897c4";
3
+ export * from "./getDataTestId-5cf85f5f";
package/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export { Select } from './Component.js';
2
2
  export { Arrow } from './components/arrow/Component.js';
3
3
  export { BaseSelect } from './components/base-select/Component.js';
4
- export { b as SELECT_ALL_KEY, S as SelectMobile, a as SelectModalMobile, u as useSelectWithApply } from './Component-9ca76807.js';
4
+ export { b as SELECT_ALL_KEY, S as SelectMobile, a as SelectModalMobile, u as useSelectWithApply } from './Component-9c34d6d9.js';
5
5
  export { Field } from './components/field/Component.js';
6
6
  export { Optgroup } from './components/optgroup/Component.js';
7
7
  export { Option } from './components/option/Component.js';
@@ -20,7 +20,7 @@ import '@juggle/resize-observer';
20
20
  import 'downshift';
21
21
  import '@alfalab/core-components-popover/esm';
22
22
  import '@alfalab/hooks';
23
- import './getDataTestId-3d3897c4.js';
23
+ import './getDataTestId-5cf85f5f.js';
24
24
  import './components/native-select/Component.js';
25
25
  import './components/base-select-mobile/Component.js';
26
26
  import '@alfalab/core-components-bottom-sheet/esm';
@@ -34,7 +34,8 @@ import '@alfalab/core-components-checkbox/esm';
34
34
  import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
35
35
  import '@alfalab/icons-glyph/CheckmarkMIcon';
36
36
  import '@alfalab/core-components-skeleton/esm';
37
- import './intersection-observer-39fb9555.js';
37
+ import './intersection-observer-6454a00a.js';
38
+ import './consts.js';
38
39
  import './presets/useSelectWithApply/options-list-with-apply/footer/Component.js';
39
40
  import './components/checkmark/Component.js';
40
41
  import './components/checkmark-mobile/Component.js';
@@ -1,6 +1,6 @@
1
1
  export { useSelectWithLoading } from './useSelectWithLoading/hook.js';
2
2
  export { useLazyLoading } from './useLazyLoading/hook.js';
3
- export { b as SELECT_ALL_KEY, u as useSelectWithApply } from '../Component-9ca76807.js';
3
+ export { b as SELECT_ALL_KEY, u as useSelectWithApply } from '../Component-9c34d6d9.js';
4
4
  import 'tslib';
5
5
  import 'react';
6
6
  import '@alfalab/core-components-skeleton/esm';
@@ -12,7 +12,7 @@ import '@alfalab/core-components-checkbox/esm';
12
12
  import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
13
13
  import '@alfalab/icons-glyph/CheckmarkMIcon';
14
14
  import '../components/checkmark-mobile/Component.js';
15
- import '../intersection-observer-39fb9555.js';
15
+ import '../intersection-observer-6454a00a.js';
16
16
  import '../Component.js';
17
17
  import '../components/arrow/Component.js';
18
18
  import '@alfalab/icons-glyph/ChevronDownMIcon';
@@ -22,7 +22,7 @@ import '@juggle/resize-observer';
22
22
  import 'downshift';
23
23
  import '@alfalab/core-components-popover/esm';
24
24
  import '@alfalab/hooks';
25
- import '../getDataTestId-3d3897c4.js';
25
+ import '../getDataTestId-5cf85f5f.js';
26
26
  import '../utils.js';
27
27
  import '../components/native-select/Component.js';
28
28
  import '../components/field/Component.js';
@@ -30,6 +30,7 @@ import '@alfalab/core-components-form-control/esm';
30
30
  import '../components/optgroup/Component.js';
31
31
  import '../components/options-list/Component.js';
32
32
  import '@alfalab/core-components-scrollbar/esm';
33
+ import '../consts.js';
33
34
  import '../components/base-select-mobile/Component.js';
34
35
  import '@alfalab/core-components-bottom-sheet/esm';
35
36
  import '@alfalab/core-components-modal/esm/mobile';
@@ -2,7 +2,7 @@ import { __spreadArray, __assign } from 'tslib';
2
2
  import React, { useReducer, useRef, useCallback, useEffect, useMemo } from 'react';
3
3
  import { Skeleton } from '@alfalab/core-components-skeleton/esm';
4
4
  import { Option } from '../../components/option/Component.js';
5
- import '../../intersection-observer-39fb9555.js';
5
+ import '../../intersection-observer-6454a00a.js';
6
6
  import 'classnames';
7
7
  import '../../components/checkmark/Component.js';
8
8
  import '@alfalab/core-components-badge/esm';
@@ -11,7 +11,7 @@ import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
11
11
  import '@alfalab/icons-glyph/CheckmarkMIcon';
12
12
  import '../../components/checkmark-mobile/Component.js';
13
13
 
14
- var styles = {"skeleton":"select__skeleton_sal6w"};
14
+ var styles = {"skeleton":"select__skeleton_11vb6"};
15
15
  require('./index.css')
16
16
 
17
17
  var DEBOUNCE_TIMEOUT = 300;
@@ -1,5 +1,5 @@
1
- /* hash: jci6t */
2
- .select__skeleton_sal6w {
1
+ /* hash: 1i142 */
2
+ .select__skeleton_11vb6 {
3
3
  position: absolute;
4
4
  top: 50%;
5
5
  transform: translateY(-50%);
@@ -4,7 +4,7 @@ import '../../Component.js';
4
4
  import 'classnames';
5
5
  import '@alfalab/icons-glyph/ChevronDownMIcon';
6
6
  import '../../components/base-select/Component.js';
7
- export { b as SELECT_ALL_KEY, u as useSelectWithApply } from '../../Component-9ca76807.js';
7
+ export { b as SELECT_ALL_KEY, u as useSelectWithApply } from '../../Component-9c34d6d9.js';
8
8
  import '@alfalab/core-components-form-control/esm';
9
9
  import '@alfalab/hooks';
10
10
  import '../../utils.js';
@@ -15,7 +15,7 @@ import '@alfalab/icons-glyph/CheckmarkMIcon';
15
15
  import '../../components/options-list/Component.js';
16
16
  import '../../components/virtual-options-list/Component.js';
17
17
  import '@alfalab/core-components-skeleton/esm';
18
- import '../../intersection-observer-39fb9555.js';
18
+ import '../../intersection-observer-6454a00a.js';
19
19
  import '../../components/arrow/Component.js';
20
20
  import '../../components/field/Component.js';
21
21
  import '../../components/optgroup/Component.js';
@@ -26,9 +26,10 @@ import 'react-merge-refs';
26
26
  import '@juggle/resize-observer';
27
27
  import 'downshift';
28
28
  import '@alfalab/core-components-popover/esm';
29
- import '../../getDataTestId-3d3897c4.js';
29
+ import '../../getDataTestId-5cf85f5f.js';
30
30
  import '../../components/native-select/Component.js';
31
31
  import '@alfalab/core-components-scrollbar/esm';
32
+ import '../../consts.js';
32
33
  import '../../components/base-select-mobile/Component.js';
33
34
  import '@alfalab/core-components-bottom-sheet/esm';
34
35
  import '@alfalab/core-components-modal/esm/mobile';
@@ -1,7 +1,8 @@
1
1
  import 'tslib';
2
2
  import 'react';
3
3
  import '../../../components/options-list/Component.js';
4
- export { O as OptionsListWithApply } from '../../../Component-9ca76807.js';
4
+ import '../../../consts.js';
5
+ export { O as OptionsListWithApply } from '../../../Component-9c34d6d9.js';
5
6
  import './footer/Component.js';
6
7
  import 'react-merge-refs';
7
8
  import 'classnames';
@@ -16,7 +17,7 @@ import '../../../components/base-select/Component.js';
16
17
  import '@juggle/resize-observer';
17
18
  import 'downshift';
18
19
  import '@alfalab/core-components-popover/esm';
19
- import '../../../getDataTestId-3d3897c4.js';
20
+ import '../../../getDataTestId-5cf85f5f.js';
20
21
  import '../../../components/native-select/Component.js';
21
22
  import '../../../components/field/Component.js';
22
23
  import '@alfalab/core-components-form-control/esm';
@@ -36,4 +37,4 @@ import '@alfalab/core-components-button/esm';
36
37
  import '../../../components/virtual-options-list/Component.js';
37
38
  import 'react-virtual';
38
39
  import '@alfalab/core-components-skeleton/esm';
39
- import '../../../intersection-observer-39fb9555.js';
40
+ import '../../../intersection-observer-6454a00a.js';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Button } from '@alfalab/core-components-button/esm';
3
3
 
4
- var styles = {"footer":"select__footer_1j5yk"};
4
+ var styles = {"footer":"select__footer_46m1o"};
5
5
  require('./index.css')
6
6
 
7
7
  var Footer = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 1p8ic */
1
+ /* hash: 1f8nl */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-bg-primary: #fff; /* 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 */
@@ -26,10 +26,10 @@
26
26
  /* checkmark */
27
27
 
28
28
  /* optgroup */
29
- } .select__footer_1j5yk {
29
+ } .select__footer_46m1o {
30
30
  background-color: var(--color-light-bg-primary);
31
31
  padding: var(--gap-s);
32
32
  outline: none
33
- } .select__footer_1j5yk > * + * {
33
+ } .select__footer_46m1o > * + * {
34
34
  margin-left: var(--gap-xs);
35
35
  }
@@ -1 +1 @@
1
- export * from "../../../Component-9ca76807";
1
+ export * from "../../../Component-9c34d6d9";
@@ -1,4 +1,4 @@
1
- export { O as OptionsListWithApply } from '../../../Component-9ca76807.js';
1
+ export { O as OptionsListWithApply } from '../../../Component-9c34d6d9.js';
2
2
  import 'tslib';
3
3
  import 'react';
4
4
  import '../../../Component.js';
@@ -11,7 +11,7 @@ import '@juggle/resize-observer';
11
11
  import 'downshift';
12
12
  import '@alfalab/core-components-popover/esm';
13
13
  import '@alfalab/hooks';
14
- import '../../../getDataTestId-3d3897c4.js';
14
+ import '../../../getDataTestId-5cf85f5f.js';
15
15
  import '../../../utils.js';
16
16
  import '../../../components/native-select/Component.js';
17
17
  import '../../../components/field/Component.js';
@@ -26,6 +26,7 @@ import '@alfalab/icons-glyph/CheckmarkMIcon';
26
26
  import '../../../components/checkmark-mobile/Component.js';
27
27
  import '../../../components/options-list/Component.js';
28
28
  import '@alfalab/core-components-scrollbar/esm';
29
+ import '../../../consts.js';
29
30
  import '../../../components/base-select-mobile/Component.js';
30
31
  import '@alfalab/core-components-bottom-sheet/esm';
31
32
  import '@alfalab/core-components-modal/esm/mobile';
@@ -35,5 +36,5 @@ import '@alfalab/core-components-button/esm';
35
36
  import '../../../components/virtual-options-list/Component.js';
36
37
  import 'react-virtual';
37
38
  import '@alfalab/core-components-skeleton/esm';
38
- import '../../../intersection-observer-39fb9555.js';
39
+ import '../../../intersection-observer-6454a00a.js';
39
40
  import './footer/Component.js';
@@ -10,7 +10,7 @@ import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
10
10
  import '@alfalab/icons-glyph/CheckmarkMIcon';
11
11
  import '../../components/checkmark-mobile/Component.js';
12
12
 
13
- var styles = {"skeleton":"select__skeleton_97xb3"};
13
+ var styles = {"skeleton":"select__skeleton_k4ygj"};
14
14
  require('./index.css')
15
15
 
16
16
  function useSelectWithLoading(_a) {
@@ -1,5 +1,5 @@
1
- /* hash: 3azpe */
2
- .select__skeleton_97xb3 {
1
+ /* hash: 1wxmv */
2
+ .select__skeleton_k4ygj {
3
3
  position: absolute;
4
4
  top: 50%;
5
5
  transform: translateY(-50%);
package/esm/responsive.js CHANGED
@@ -11,7 +11,7 @@ import 'react-merge-refs';
11
11
  import '@juggle/resize-observer';
12
12
  import 'downshift';
13
13
  import '@alfalab/core-components-popover/esm';
14
- import './getDataTestId-3d3897c4.js';
14
+ import './getDataTestId-5cf85f5f.js';
15
15
  import './utils.js';
16
16
  import './components/native-select/Component.js';
17
17
  import './components/field/Component.js';
@@ -26,7 +26,8 @@ import '@alfalab/icons-glyph/CheckmarkMIcon';
26
26
  import './components/checkmark-mobile/Component.js';
27
27
  import './components/options-list/Component.js';
28
28
  import '@alfalab/core-components-scrollbar/esm';
29
- import './Component-9ca76807.js';
29
+ import './consts.js';
30
+ import './Component-9c34d6d9.js';
30
31
  import './components/base-select-mobile/Component.js';
31
32
  import '@alfalab/core-components-bottom-sheet/esm';
32
33
  import '@alfalab/core-components-modal/esm/mobile';
@@ -36,5 +37,5 @@ import '@alfalab/core-components-button/esm';
36
37
  import './components/virtual-options-list/Component.js';
37
38
  import 'react-virtual';
38
39
  import '@alfalab/core-components-skeleton/esm';
39
- import './intersection-observer-39fb9555.js';
40
+ import './intersection-observer-6454a00a.js';
40
41
  import './presets/useSelectWithApply/options-list-with-apply/footer/Component.js';
package/esm/utils.js CHANGED
@@ -53,13 +53,17 @@ function useVisibleOptions(_a) {
53
53
  var list = listRef.current;
54
54
  var styleTarget = styleTargetRef.current;
55
55
  if (open && list && styleTarget && visibleOptions > 0) {
56
+ var childCount = list.children.length;
56
57
  var optionsNodes = [].slice.call(list.children, 0, visibleOptions + 1);
57
58
  var height = optionsNodes
58
59
  .slice(0, visibleOptions)
59
60
  .reduce(function (acc, child) { return acc + child.clientHeight; }, 0);
60
- if (visibleOptions < list.children.length) {
61
- // Добавляем половинку
62
- height += Math.round(optionsNodes[optionsNodes.length - 1].clientHeight / 2);
61
+ if (visibleOptions < childCount) {
62
+ var lastVisibleOptionHeight = optionsNodes[optionsNodes.length - 1].clientHeight;
63
+ // Если кол-во опций больше visibleOptions на 1, то показываем все опции, иначе добавляем половинку
64
+ height += Math.round(childCount - visibleOptions === 1
65
+ ? lastVisibleOptionHeight
66
+ : lastVisibleOptionHeight / 2);
63
67
  }
64
68
  styleTarget.style.height = "".concat(height, "px");
65
69
  }
@@ -36,7 +36,9 @@ declare function useSelectWithApply({ options, selected, onChange, OptionsList,
36
36
  showClear?: boolean | undefined;
37
37
  onClose?: (() => void) | undefined;
38
38
  selectedDraft?: OptionShape[] | undefined;
39
- OptionsList?: import("react").FC<import("./index").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
39
+ OptionsList?: import("react").FC<import("./index").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined; /**
40
+ * Пропсы, которые будут прокинуты в компонент списка
41
+ */
40
42
  Footer?: import("react").FC<import("./presets/useSelectWithApply/options-list-with-apply/footer/Component").FooterProps> | undefined;
41
43
  } & import("react").RefAttributes<HTMLDivElement>>;
42
44
  optionsListProps: {
@@ -1,3 +1,3 @@
1
1
  declare const isClient: () => boolean;
2
2
  export { isClient };
3
- export * from "./getDataTestId-8b7a873e";
3
+ export * from "./getDataTestId-71b2faac";
package/index.js CHANGED
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var Component = require('./Component.js');
6
6
  var components_arrow_Component = require('./components/arrow/Component.js');
7
7
  var components_baseSelect_Component = require('./components/base-select/Component.js');
8
- var presets_useSelectWithApply_optionsListWithApply_Component = require('./Component-d7aff1fb.js');
8
+ var presets_useSelectWithApply_optionsListWithApply_Component = require('./Component-bc321a4f.js');
9
9
  var components_field_Component = require('./components/field/Component.js');
10
10
  var components_optgroup_Component = require('./components/optgroup/Component.js');
11
11
  var components_option_Component = require('./components/option/Component.js');
@@ -24,7 +24,7 @@ require('@juggle/resize-observer');
24
24
  require('downshift');
25
25
  require('@alfalab/core-components-popover');
26
26
  require('@alfalab/hooks');
27
- require('./getDataTestId-8b7a873e.js');
27
+ require('./getDataTestId-71b2faac.js');
28
28
  require('./components/native-select/Component.js');
29
29
  require('./components/base-select-mobile/Component.js');
30
30
  require('@alfalab/core-components-bottom-sheet');
@@ -38,7 +38,8 @@ require('@alfalab/core-components-checkbox');
38
38
  require('@alfalab/icons-glyph/CheckmarkCircleMIcon');
39
39
  require('@alfalab/icons-glyph/CheckmarkMIcon');
40
40
  require('@alfalab/core-components-skeleton');
41
- require('./intersection-observer-3942f19b.js');
41
+ require('./intersection-observer-493fce75.js');
42
+ require('./consts.js');
42
43
  require('./presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
43
44
  require('./components/checkmark/Component.js');
44
45
  require('./components/checkmark-mobile/Component.js');
@@ -19,10 +19,11 @@ import '@alfalab/core-components-checkbox/modern';
19
19
  import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
20
20
  import '@alfalab/icons-glyph/CheckmarkMIcon';
21
21
  import '@alfalab/core-components-skeleton/modern';
22
- import './intersection-observer-39fb9555.js';
22
+ import './intersection-observer-6454a00a.js';
23
+ import { DEFAULT_VISIBLE_OPTIONS } from './consts.js';
23
24
  import { Footer } from './presets/useSelectWithApply/options-list-with-apply/footer/Component.js';
24
25
 
25
- const OptionsListWithApply = forwardRef(({ toggleMenu, getOptionProps: defaultGetOptionProps, showClear = true, selectedDraft = [], flatOptions = [], OptionsList: OptionsList$1 = OptionsList, onApply = () => null, onClear = () => null, onClose = () => null, visibleOptions = 5, Footer: Footer$1 = Footer, ...restProps }, ref) => {
26
+ const OptionsListWithApply = forwardRef(({ toggleMenu, getOptionProps: defaultGetOptionProps, showClear = true, selectedDraft = [], flatOptions = [], OptionsList: OptionsList$1 = OptionsList, onApply = () => null, onClear = () => null, onClose = () => null, visibleOptions = DEFAULT_VISIBLE_OPTIONS, Footer: Footer$1 = Footer, ...restProps }, ref) => {
26
27
  const getOptionProps = useCallback((option, index) => {
27
28
  const optionProps = defaultGetOptionProps(option, index);
28
29
  const selected = option.key === SELECT_ALL_KEY
@@ -12,7 +12,7 @@ import '@juggle/resize-observer';
12
12
  import 'downshift';
13
13
  import '@alfalab/core-components-popover/modern';
14
14
  import '@alfalab/hooks';
15
- import './getDataTestId-47f59f1b.js';
15
+ import './getDataTestId-93dd9487.js';
16
16
  import './utils.js';
17
17
  import './components/native-select/Component.js';
18
18
  import '@alfalab/core-components-form-control/modern';
@@ -23,6 +23,7 @@ import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
23
23
  import '@alfalab/icons-glyph/CheckmarkMIcon';
24
24
  import './components/checkmark-mobile/Component.js';
25
25
  import '@alfalab/core-components-scrollbar/modern';
26
+ import './consts.js';
26
27
 
27
28
  const Select = forwardRef(({ Arrow: Arrow$1 = Arrow, Field: Field$1 = Field, OptionsList: OptionsList$1 = OptionsList, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, ...restProps }, ref) => (React.createElement(BaseSelect, { ref: ref, Option: Option$1, Field: Field$1, Optgroup: Optgroup$1, OptionsList: OptionsList$1, Arrow: Arrow$1, ...restProps })));
28
29
 
@@ -4,7 +4,7 @@ import { Select } from './Component.js';
4
4
  import 'classnames';
5
5
  import '@alfalab/icons-glyph/ChevronDownMIcon';
6
6
  import './components/base-select/Component.js';
7
- import { S as SelectMobile } from './Component-c3c5c3d4.js';
7
+ import { S as SelectMobile } from './Component-2b8439ea.js';
8
8
  import '@alfalab/core-components-form-control/modern';
9
9
  import '@alfalab/core-components-badge/modern';
10
10
  import '@alfalab/core-components-checkbox/modern';
@@ -23,7 +23,7 @@ import 'react-merge-refs';
23
23
  import '@juggle/resize-observer';
24
24
  import 'downshift';
25
25
  import '@alfalab/core-components-popover/modern';
26
- import './getDataTestId-47f59f1b.js';
26
+ import './getDataTestId-93dd9487.js';
27
27
  import './components/native-select/Component.js';
28
28
  import './components/base-select-mobile/Component.js';
29
29
  import '@alfalab/core-components-bottom-sheet/modern';
@@ -32,7 +32,8 @@ import './components/base-select-mobile/footer/Component.js';
32
32
  import '@alfalab/core-components-base-modal/modern';
33
33
  import '@alfalab/core-components-button/modern';
34
34
  import '@alfalab/core-components-skeleton/modern';
35
- import './intersection-observer-39fb9555.js';
35
+ import './intersection-observer-6454a00a.js';
36
+ import './consts.js';
36
37
  import './presets/useSelectWithApply/options-list-with-apply/footer/Component.js';
37
38
  import '@alfalab/core-components-scrollbar/modern';
38
39
  import 'react-virtual';
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import cn from 'classnames';
3
3
  import { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';
4
4
 
5
- const styles = {"arrow":"select__arrow_j2yld","open":"select__open_j2yld"};
5
+ const styles = {"arrow":"select__arrow_snokt","open":"select__open_snokt"};
6
6
  require('./index.css')
7
7
 
8
8
  const Arrow = ({ open, className }) => (React.createElement(ChevronDownMIcon, { className: cn(styles.arrow, className, { [styles.open]: open }) }));
@@ -1,4 +1,4 @@
1
- /* hash: a4vla */
1
+ /* hash: 18thg */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-graphic-primary: #0e0e0e; /* 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 */
@@ -26,13 +26,13 @@
26
26
  /* checkmark */
27
27
 
28
28
  /* optgroup */
29
- } .select__arrow_j2yld {
29
+ } .select__arrow_snokt {
30
30
  display: block;
31
31
  width: 24px;
32
32
  height: 24px;
33
33
  color: var(--select-arrow-color);
34
34
 
35
35
  transition: transform 0.15s ease-in-out, opacity 0.2s ease;
36
- } .select__open_j2yld {
36
+ } .select__open_snokt {
37
37
  transform: var(--arrow-transform);
38
38
  }
@@ -3,7 +3,7 @@ import cn from 'classnames';
3
3
  import { Checkbox } from '@alfalab/core-components-checkbox/modern';
4
4
  import { CheckmarkMIcon } from '@alfalab/icons-glyph/CheckmarkMIcon';
5
5
 
6
- const styles = {"checkmark":"select__checkmark_g6eph","single":"select__single_g6eph","selected":"select__selected_g6eph"};
6
+ const styles = {"checkmark":"select__checkmark_108xm","single":"select__single_108xm","selected":"select__selected_108xm"};
7
7
  require('./index.css')
8
8
 
9
9
  const BaseCheckmark = ({ selected, disabled = false, className, multiple, }) => {
@@ -1,4 +1,4 @@
1
- /* hash: fazty */
1
+ /* hash: 1gdz4 */
2
2
  :root {
3
3
  } /* deprecated */ :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 */
4
4
  } :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 */
@@ -23,14 +23,14 @@
23
23
  /* checkmark */
24
24
 
25
25
  /* optgroup */
26
- } .select__checkmark_g6eph {
26
+ } .select__checkmark_108xm {
27
27
  flex-shrink: 0;
28
28
  box-sizing: border-box;
29
- } .select__single_g6eph {
29
+ } .select__single_108xm {
30
30
  display: flex;
31
31
  align-items: center;
32
32
  justify-content: center;
33
33
  opacity: 0
34
- } .select__single_g6eph.select__selected_g6eph {
34
+ } .select__single_108xm.select__selected_108xm {
35
35
  opacity: 1;
36
36
  }
@@ -4,7 +4,7 @@ import { BaseCheckmark } from '../base-checkmark/Component.js';
4
4
  import '@alfalab/core-components-checkbox/modern';
5
5
  import '@alfalab/icons-glyph/CheckmarkMIcon';
6
6
 
7
- const styles = {"option":"select__option_1axz9","disabled":"select__disabled_1axz9","checkmarkBefore":"select__checkmarkBefore_1axz9","mobile":"select__mobile_1axz9","checkmarkAfter":"select__checkmarkAfter_1axz9","textContent":"select__textContent_1axz9","selected":"select__selected_1axz9","highlighted":"select__highlighted_1axz9","content":"select__content_1axz9"};
7
+ const styles = {"option":"select__option_1uzqs","disabled":"select__disabled_1uzqs","checkmarkBefore":"select__checkmarkBefore_1uzqs","mobile":"select__mobile_1uzqs","checkmarkAfter":"select__checkmarkAfter_1uzqs","textContent":"select__textContent_1uzqs","selected":"select__selected_1uzqs","highlighted":"select__highlighted_1uzqs","content":"select__content_1uzqs"};
8
8
  require('./index.css')
9
9
 
10
10
  const BaseOption = ({ className, option, children, selected, highlighted, disabled, multiple, Checkmark = BaseCheckmark, checkmarkPosition = multiple ? 'before' : 'after', innerProps, dataTestId, mobile = false, }) => {