@alfalab/core-components-select 15.0.3 → 15.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/Component.desktop.js +5 -2
  2. package/Component.mobile.d.ts +1 -1
  3. package/Component.mobile.js +9 -4
  4. package/Component.modal.mobile.d.ts +1 -1
  5. package/Component.modal.mobile.js +7 -2
  6. package/Component.responsive.js +4 -1
  7. package/components/arrow/Component.js +1 -1
  8. package/components/arrow/index.css +3 -3
  9. package/components/base-checkmark/Component.js +1 -1
  10. package/components/base-checkmark/index.css +4 -4
  11. package/components/base-option/Component.js +1 -1
  12. package/components/base-option/index.css +13 -13
  13. package/components/base-select/Component.js +73 -12
  14. package/components/base-select/index.css +16 -9
  15. package/components/base-select-mobile/Component.js +57 -15
  16. package/components/base-select-mobile/footer/Component.js +1 -1
  17. package/components/base-select-mobile/footer/index.css +5 -5
  18. package/components/base-select-mobile/index.css +26 -11
  19. package/components/base-select-mobile/index.js +3 -0
  20. package/components/checkmark/Component.js +1 -1
  21. package/components/checkmark/index.css +10 -10
  22. package/components/checkmark-mobile/Component.js +1 -1
  23. package/components/checkmark-mobile/index.css +6 -6
  24. package/components/field/Component.js +1 -1
  25. package/components/field/index.css +12 -12
  26. package/components/index.d.ts +1 -0
  27. package/components/index.js +4 -0
  28. package/components/optgroup/Component.js +1 -1
  29. package/components/optgroup/index.css +6 -6
  30. package/components/option/Component.js +1 -1
  31. package/components/option/index.css +20 -20
  32. package/components/options-list/Component.js +5 -5
  33. package/components/options-list/index.css +9 -9
  34. package/components/search/Component.d.ts +7 -0
  35. package/components/search/Component.js +24 -0
  36. package/components/search/index.css +28 -0
  37. package/components/search/index.d.ts +1 -0
  38. package/components/search/index.js +14 -0
  39. package/components/virtual-options-list/Component.js +1 -1
  40. package/components/virtual-options-list/index.css +15 -15
  41. package/cssm/Component.desktop.js +6 -2
  42. package/cssm/Component.mobile.d.ts +1 -1
  43. package/cssm/Component.mobile.js +10 -4
  44. package/cssm/Component.modal.mobile.d.ts +1 -1
  45. package/cssm/Component.modal.mobile.js +8 -2
  46. package/cssm/Component.responsive.js +5 -1
  47. package/cssm/components/base-select/Component.js +72 -11
  48. package/cssm/components/base-select/index.module.css +8 -1
  49. package/cssm/components/base-select-mobile/Component.js +57 -14
  50. package/cssm/components/base-select-mobile/index.js +4 -0
  51. package/cssm/components/base-select-mobile/index.module.css +15 -0
  52. package/cssm/components/index.d.ts +1 -0
  53. package/cssm/components/index.js +5 -0
  54. package/cssm/components/options-list/Component.js +4 -4
  55. package/cssm/components/search/Component.d.ts +7 -0
  56. package/cssm/components/search/Component.js +23 -0
  57. package/cssm/components/search/index.d.ts +1 -0
  58. package/cssm/components/search/index.js +15 -0
  59. package/cssm/components/search/index.module.css +27 -0
  60. package/cssm/desktop.js +4 -0
  61. package/{modern/hook-9ea9e32c.d.ts → cssm/hook-8abfea97.d.ts} +20 -5
  62. package/cssm/{hook-97e6e688.js → hook-d1f5dd40.js} +19 -5
  63. package/cssm/index.js +5 -1
  64. package/cssm/mobile.js +5 -1
  65. package/cssm/presets/index.d.ts +1 -1
  66. package/cssm/presets/index.js +1 -1
  67. package/cssm/presets/useSelectWithApply/hook.js +1 -1
  68. package/cssm/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
  69. package/cssm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  70. package/cssm/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
  71. package/cssm/shared.js +8 -1
  72. package/cssm/typings.d.ts +23 -1
  73. package/cssm/utils.d.ts +5 -2
  74. package/cssm/utils.js +34 -5
  75. package/desktop.js +3 -0
  76. package/esm/Component.desktop.js +5 -2
  77. package/esm/Component.mobile.d.ts +1 -1
  78. package/esm/Component.mobile.js +9 -4
  79. package/esm/Component.modal.mobile.d.ts +1 -1
  80. package/esm/Component.modal.mobile.js +7 -2
  81. package/esm/Component.responsive.js +4 -1
  82. package/esm/components/arrow/Component.js +1 -1
  83. package/esm/components/arrow/index.css +3 -3
  84. package/esm/components/base-checkmark/Component.js +1 -1
  85. package/esm/components/base-checkmark/index.css +4 -4
  86. package/esm/components/base-option/Component.js +1 -1
  87. package/esm/components/base-option/index.css +13 -13
  88. package/esm/components/base-select/Component.js +74 -13
  89. package/esm/components/base-select/index.css +16 -9
  90. package/esm/components/base-select-mobile/Component.js +58 -16
  91. package/esm/components/base-select-mobile/footer/Component.js +1 -1
  92. package/esm/components/base-select-mobile/footer/index.css +5 -5
  93. package/esm/components/base-select-mobile/index.css +26 -11
  94. package/esm/components/base-select-mobile/index.js +3 -0
  95. package/esm/components/checkmark/Component.js +1 -1
  96. package/esm/components/checkmark/index.css +10 -10
  97. package/esm/components/checkmark-mobile/Component.js +1 -1
  98. package/esm/components/checkmark-mobile/index.css +6 -6
  99. package/esm/components/field/Component.js +1 -1
  100. package/esm/components/field/index.css +12 -12
  101. package/esm/components/index.d.ts +1 -0
  102. package/esm/components/index.js +3 -0
  103. package/esm/components/optgroup/Component.js +1 -1
  104. package/esm/components/optgroup/index.css +6 -6
  105. package/esm/components/option/Component.js +1 -1
  106. package/esm/components/option/index.css +20 -20
  107. package/esm/components/options-list/Component.js +5 -5
  108. package/esm/components/options-list/index.css +9 -9
  109. package/esm/components/search/Component.d.ts +7 -0
  110. package/esm/components/search/Component.js +15 -0
  111. package/esm/components/search/index.css +28 -0
  112. package/esm/components/search/index.d.ts +1 -0
  113. package/esm/components/search/index.js +6 -0
  114. package/esm/components/virtual-options-list/Component.js +1 -1
  115. package/esm/components/virtual-options-list/index.css +15 -15
  116. package/esm/desktop.js +3 -0
  117. package/{hook-9ea9e32c.d.ts → esm/hook-8abfea97.d.ts} +20 -5
  118. package/esm/{hook-d40b4e10.js → hook-990a584e.js} +21 -7
  119. package/esm/index.js +4 -1
  120. package/esm/mobile.js +4 -1
  121. package/esm/presets/index.d.ts +1 -1
  122. package/esm/presets/index.js +1 -1
  123. package/esm/presets/useSelectWithApply/hook.js +1 -1
  124. package/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
  125. package/esm/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
  126. package/esm/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -3
  127. package/esm/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
  128. package/esm/presets/useSelectWithApply/options-list-with-apply/header/index.css +3 -3
  129. package/esm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  130. package/esm/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
  131. package/esm/presets/useSelectWithLoading/hook.js +1 -1
  132. package/esm/presets/useSelectWithLoading/index.css +2 -2
  133. package/esm/shared.js +5 -2
  134. package/esm/typings.d.ts +23 -1
  135. package/esm/utils.d.ts +5 -2
  136. package/esm/utils.js +33 -6
  137. package/{cssm/hook-9ea9e32c.d.ts → hook-8abfea97.d.ts} +20 -5
  138. package/{hook-43a35a80.js → hook-c0d8bff3.js} +19 -5
  139. package/index.js +4 -1
  140. package/mobile.js +4 -1
  141. package/modern/Component.desktop.js +5 -2
  142. package/modern/Component.mobile.d.ts +1 -1
  143. package/modern/Component.mobile.js +9 -4
  144. package/modern/Component.modal.mobile.d.ts +1 -1
  145. package/modern/Component.modal.mobile.js +7 -2
  146. package/modern/Component.responsive.js +4 -1
  147. package/modern/components/arrow/Component.js +1 -1
  148. package/modern/components/arrow/index.css +3 -3
  149. package/modern/components/base-checkmark/Component.js +1 -1
  150. package/modern/components/base-checkmark/index.css +4 -4
  151. package/modern/components/base-option/Component.js +1 -1
  152. package/modern/components/base-option/index.css +13 -13
  153. package/modern/components/base-select/Component.js +62 -9
  154. package/modern/components/base-select/index.css +16 -9
  155. package/modern/components/base-select-mobile/Component.js +48 -13
  156. package/modern/components/base-select-mobile/footer/Component.js +1 -1
  157. package/modern/components/base-select-mobile/footer/index.css +5 -5
  158. package/modern/components/base-select-mobile/index.css +26 -11
  159. package/modern/components/base-select-mobile/index.js +3 -0
  160. package/modern/components/checkmark/Component.js +1 -1
  161. package/modern/components/checkmark/index.css +10 -10
  162. package/modern/components/checkmark-mobile/Component.js +1 -1
  163. package/modern/components/checkmark-mobile/index.css +6 -6
  164. package/modern/components/field/Component.js +1 -1
  165. package/modern/components/field/index.css +12 -12
  166. package/modern/components/index.d.ts +1 -0
  167. package/modern/components/index.js +3 -0
  168. package/modern/components/optgroup/Component.js +1 -1
  169. package/modern/components/optgroup/index.css +6 -6
  170. package/modern/components/option/Component.js +1 -1
  171. package/modern/components/option/index.css +20 -20
  172. package/modern/components/options-list/Component.js +5 -5
  173. package/modern/components/options-list/index.css +9 -9
  174. package/modern/components/search/Component.d.ts +7 -0
  175. package/modern/components/search/Component.js +11 -0
  176. package/modern/components/search/index.css +28 -0
  177. package/modern/components/search/index.d.ts +1 -0
  178. package/modern/components/search/index.js +5 -0
  179. package/modern/components/virtual-options-list/Component.js +1 -1
  180. package/modern/components/virtual-options-list/index.css +15 -15
  181. package/modern/desktop.js +3 -0
  182. package/modern/{hook-d771f2ed.js → hook-101e5d49.js} +23 -6
  183. package/{esm/hook-9ea9e32c.d.ts → modern/hook-8abfea97.d.ts} +20 -5
  184. package/modern/index.js +4 -1
  185. package/modern/mobile.js +4 -1
  186. package/modern/presets/index.d.ts +1 -1
  187. package/modern/presets/index.js +1 -1
  188. package/modern/presets/useSelectWithApply/hook.js +1 -1
  189. package/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
  190. package/modern/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
  191. package/modern/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -3
  192. package/modern/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
  193. package/modern/presets/useSelectWithApply/options-list-with-apply/header/index.css +3 -3
  194. package/modern/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  195. package/modern/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
  196. package/modern/presets/useSelectWithLoading/hook.js +1 -1
  197. package/modern/presets/useSelectWithLoading/index.css +2 -2
  198. package/modern/shared.js +5 -2
  199. package/modern/typings.d.ts +23 -1
  200. package/modern/utils.d.ts +5 -2
  201. package/modern/utils.js +34 -6
  202. package/package.json +6 -6
  203. package/presets/index.d.ts +1 -1
  204. package/presets/index.js +1 -1
  205. package/presets/useSelectWithApply/hook.js +1 -1
  206. package/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
  207. package/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
  208. package/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -3
  209. package/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
  210. package/presets/useSelectWithApply/options-list-with-apply/header/index.css +3 -3
  211. package/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  212. package/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
  213. package/presets/useSelectWithLoading/hook.js +1 -1
  214. package/presets/useSelectWithLoading/index.css +2 -2
  215. package/shared.js +7 -1
  216. package/src/Component.desktop.tsx +4 -1
  217. package/src/Component.mobile.tsx +7 -0
  218. package/src/Component.modal.mobile.tsx +4 -0
  219. package/src/components/base-select/Component.tsx +101 -10
  220. package/src/components/base-select/index.module.css +12 -0
  221. package/src/components/base-select-mobile/Component.tsx +84 -12
  222. package/src/components/base-select-mobile/index.module.css +24 -0
  223. package/src/components/index.ts +1 -0
  224. package/src/components/options-list/Component.tsx +8 -3
  225. package/src/components/search/Component.tsx +31 -0
  226. package/src/components/search/index.module.css +6 -0
  227. package/src/components/search/index.ts +1 -0
  228. package/src/presets/useSelectWithApply/hook.tsx +32 -3
  229. package/src/presets/useSelectWithApply/options-list-with-apply/Component.tsx +13 -1
  230. package/src/typings.ts +27 -0
  231. package/src/utils.ts +37 -5
  232. package/typings.d.ts +23 -1
  233. package/utils.d.ts +5 -2
  234. package/utils.js +34 -5
  235. /package/cssm/{hook-97e6e688.d.ts → hook-d1f5dd40.d.ts} +0 -0
  236. /package/esm/{hook-d40b4e10.d.ts → hook-990a584e.d.ts} +0 -0
  237. /package/{hook-43a35a80.d.ts → hook-c0d8bff3.d.ts} +0 -0
  238. /package/modern/{hook-d771f2ed.d.ts → hook-101e5d49.d.ts} +0 -0
package/esm/shared.js CHANGED
@@ -6,10 +6,11 @@ export { Option } from './components/option/Component.js';
6
6
  export { OptionsList } from './components/options-list/Component.js';
7
7
  export { VirtualOptionsList } from './components/virtual-options-list/Component.js';
8
8
  export { BaseOption } from './components/base-option/Component.js';
9
+ export { Search } from './components/search/Component.js';
9
10
  export { useSelectWithLoading } from './presets/useSelectWithLoading/hook.js';
10
11
  export { useLazyLoading } from './presets/useLazyLoading/hook.js';
11
- export { S as SELECT_ALL_KEY, u as useSelectWithApply } from './hook-d40b4e10.js';
12
- export { isGroup, isOptionShape, joinOptions, lastIndexOf, processOptions, usePrevious, useVisibleOptions } from './utils.js';
12
+ export { S as SELECT_ALL_KEY, u as useSelectWithApply } from './hook-990a584e.js';
13
+ export { defaultAccessor, defaultFilterFn, isGroup, isOptionShape, joinOptions, lastIndexOf, processOptions, usePrevious, useVisibleOptions } from './utils.js';
13
14
  import 'react';
14
15
  import 'classnames';
15
16
  import '@alfalab/icons-glyph/ChevronDownMIcon';
@@ -31,6 +32,8 @@ import '@alfalab/core-components-scrollbar/esm';
31
32
  import './consts.js';
32
33
  import 'react-virtual';
33
34
  import './components/base-checkmark/Component.js';
35
+ import '@alfalab/core-components-input/esm';
36
+ import '@alfalab/icons-glyph/MagnifierMIcon';
34
37
  import '@alfalab/core-components-skeleton/esm';
35
38
  import 'intersection-observer';
36
39
  import './presets/useSelectWithApply/options-list-with-apply/footer/Component.js';
package/esm/typings.d.ts CHANGED
@@ -210,6 +210,23 @@ type BaseSelectProps = {
210
210
  * Компонент пункта меню
211
211
  */
212
212
  Option?: FC<OptionProps>;
213
+ /**
214
+ * Включает отображение поиска
215
+ */
216
+ showSearch?: boolean;
217
+ /**
218
+ * Компонент поиска
219
+ */
220
+ Search?: FC<SearchProps & RefAttributes<HTMLInputElement>>;
221
+ /**
222
+ * Настройки поиска
223
+ */
224
+ searchProps?: {
225
+ componentProps?: SearchProps;
226
+ accessor?: (option: OptionShape) => string;
227
+ value?: string;
228
+ onChange?: (value: string) => void;
229
+ };
213
230
  /**
214
231
  * Обработчик выбора
215
232
  */
@@ -345,6 +362,10 @@ type OptionsListProps = {
345
362
  * Дополнительный класс для компонента группы пунктов
346
363
  */
347
364
  optionGroupClassName?: string;
365
+ /**
366
+ * Дополнительный класс для скроллбара
367
+ */
368
+ scrollbarClassName?: string;
348
369
  /**
349
370
  * Размер компонента
350
371
  */
@@ -547,4 +568,5 @@ type CheckmarkProps = {
547
568
  */
548
569
  icon?: FC<SVGProps<SVGSVGElement>>;
549
570
  };
550
- export { AnyObject, OptionShape, GroupShape, BaseSelectChangePayload, BaseSelectProps, FieldProps, ArrowProps, OptionsListProps, OptgroupProps, OptionProps, CheckmarkProps };
571
+ type SearchProps = InputProps;
572
+ export { AnyObject, OptionShape, GroupShape, BaseSelectChangePayload, BaseSelectProps, FieldProps, ArrowProps, OptionsListProps, OptgroupProps, OptionProps, CheckmarkProps, SearchProps };
package/esm/utils.d.ts CHANGED
@@ -6,7 +6,8 @@ declare const joinOptions: ({ selected, selectedMultiple, }: {
6
6
  selected?: OptionShape | undefined;
7
7
  selectedMultiple?: OptionShape[] | undefined;
8
8
  }) => ReactNode[] | null;
9
- declare function processOptions(options: BaseSelectProps['options'], selected?: BaseSelectProps['selected']): {
9
+ declare function processOptions(options: BaseSelectProps['options'], selected?: BaseSelectProps['selected'], filterFn?: (option: OptionShape) => boolean): {
10
+ filteredOptions: (OptionShape | GroupShape)[];
10
11
  flatOptions: OptionShape[];
11
12
  selectedOptions: OptionShape[];
12
13
  };
@@ -33,6 +34,8 @@ type useVisibleOptionsArgs = {
33
34
  invalidate?: unknown;
34
35
  };
35
36
  declare function useVisibleOptions({ visibleOptions, listRef, styleTargetRef, open, invalidate, }: useVisibleOptionsArgs): void;
37
+ declare function defaultFilterFn(optionText: string, search: string): boolean;
38
+ declare function defaultAccessor(option: OptionShape): string;
36
39
  declare function usePrevious<T>(value: T): T | undefined;
37
40
  declare const lastIndexOf: <T>(array: T[], predicate: (item: T) => boolean) => number;
38
- export { isGroup, isOptionShape, joinOptions, processOptions, useVisibleOptions, usePrevious, lastIndexOf };
41
+ export { isGroup, isOptionShape, joinOptions, processOptions, useVisibleOptions, defaultFilterFn, defaultAccessor, usePrevious, lastIndexOf };
package/esm/utils.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { __assign } from 'tslib';
1
2
  import { isValidElement, cloneElement, useEffect, useRef } from 'react';
2
3
 
3
4
  var isGroup = function (item) {
@@ -24,28 +25,42 @@ var joinOptions = function (_a) {
24
25
  }, []);
25
26
  };
26
27
  // За один проход делает список пунктов меню плоским и находит выбранные пункты по ключу
27
- function processOptions(options, selected) {
28
+ function processOptions(options, selected, filterFn) {
28
29
  if (selected === void 0) { selected = []; }
30
+ if (filterFn === void 0) { filterFn = function () { return true; }; }
29
31
  var flatOptions = [];
32
+ var filteredOptions = [];
30
33
  var selectedArray = Array.isArray(selected) ? selected : [selected];
31
34
  var selectedOptions = selectedArray.filter(isOptionShape);
32
35
  var selectedKeys = selectedArray.filter(function (option) { return typeof option === 'string'; });
33
36
  var isSelected = function (option) { return selectedKeys.includes(option.key); };
34
37
  var process = function (option) {
35
- flatOptions.push(option);
36
38
  if (isSelected(option)) {
37
39
  selectedOptions.push(option);
38
40
  }
41
+ if (!filterFn(option))
42
+ return false;
43
+ flatOptions.push(option);
44
+ return true;
39
45
  };
40
46
  options.forEach(function (option) {
41
47
  if (isGroup(option)) {
42
- option.options.forEach(process);
48
+ var group_1 = __assign(__assign({}, option), { options: [] });
49
+ option.options.forEach(function (groupOption) {
50
+ var matched = process(groupOption);
51
+ if (matched)
52
+ group_1.options.push(groupOption);
53
+ });
54
+ if (group_1.options.length)
55
+ filteredOptions.push(group_1);
43
56
  }
44
57
  else {
45
- process(option);
58
+ var matched = process(option);
59
+ if (matched)
60
+ filteredOptions.push(option);
46
61
  }
47
62
  });
48
- return { flatOptions: flatOptions, selectedOptions: selectedOptions };
63
+ return { filteredOptions: filteredOptions, flatOptions: flatOptions, selectedOptions: selectedOptions };
49
64
  }
50
65
  function useVisibleOptions(_a) {
51
66
  var visibleOptions = _a.visibleOptions, listRef = _a.listRef, _b = _a.styleTargetRef, styleTargetRef = _b === void 0 ? listRef : _b, open = _a.open, invalidate = _a.invalidate;
@@ -69,6 +84,18 @@ function useVisibleOptions(_a) {
69
84
  }
70
85
  }, [listRef, open, styleTargetRef, visibleOptions, invalidate]);
71
86
  }
87
+ function defaultFilterFn(optionText, search) {
88
+ if (!search)
89
+ return true;
90
+ return optionText.toLowerCase().includes(search.toLowerCase());
91
+ }
92
+ function defaultAccessor(option) {
93
+ if (typeof option.content === 'string')
94
+ return option.content;
95
+ if (typeof option.value === 'string')
96
+ return option.value;
97
+ return option.key;
98
+ }
72
99
  // TODO: перенести
73
100
  function usePrevious(value) {
74
101
  var ref = useRef();
@@ -86,4 +113,4 @@ var lastIndexOf = function (array, predicate) {
86
113
  return -1;
87
114
  };
88
115
 
89
- export { isGroup, isOptionShape, joinOptions, lastIndexOf, processOptions, usePrevious, useVisibleOptions };
116
+ export { defaultAccessor, defaultFilterFn, isGroup, isOptionShape, joinOptions, lastIndexOf, processOptions, usePrevious, useVisibleOptions };
@@ -21,6 +21,14 @@ type UseSelectWithApplyProps = {
21
21
  * Пропсы, которые будут прокинуты в компонент списка
22
22
  */
23
23
  optionsListProps?: BaseSelectProps['optionsListProps'];
24
+ /**
25
+ * Включает отображение поиска
26
+ */
27
+ showSearch?: BaseSelectProps['showSearch'];
28
+ /**
29
+ * Настройки поиска
30
+ */
31
+ searchProps?: BaseSelectProps['searchProps'];
24
32
  /**
25
33
  * Показывать кнопку очистки
26
34
  */
@@ -35,17 +43,17 @@ type UseSelectWithApplyProps = {
35
43
  showHeaderWithSelectAll?: boolean;
36
44
  };
37
45
  declare const SELECT_ALL_KEY = "select_all";
38
- declare function useSelectWithApply({ options, selected, onChange, OptionsList, optionsListProps, showClear, showSelectAll, showHeaderWithSelectAll, }: UseSelectWithApplyProps): {
46
+ declare function useSelectWithApply({ options, selected, onChange, OptionsList, optionsListProps, showClear, showSelectAll, showHeaderWithSelectAll, showSearch, searchProps, }: UseSelectWithApplyProps): {
39
47
  OptionsList: import("react").ForwardRefExoticComponent<import("./typings").OptionsListProps & {
40
48
  showClear?: boolean | undefined;
41
- onClose?: (() => void) | undefined;
49
+ onClose?: (() => void) | undefined; /**
50
+ * Компонент выпадающего меню
51
+ */
42
52
  selectedDraft?: OptionShape[] | undefined;
43
53
  OptionsList?: import("react").FC<import("./typings").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
44
54
  Footer?: import("react").FC<import("./presets/useSelectWithApply/options-list-with-apply/footer/Component").FooterProps> | undefined;
45
55
  Header?: import("react").FC<import("./presets/useSelectWithApply/options-list-with-apply/header/Component").HeaderProps> | undefined;
46
- headerProps?: import("./presets/useSelectWithApply/options-list-with-apply/header/Component").HeaderProps | undefined; /**
47
- * Показывать кнопку очистки
48
- */
56
+ headerProps?: import("./presets/useSelectWithApply/options-list-with-apply/header/Component").HeaderProps | undefined;
49
57
  showHeaderWithSelectAll?: boolean | undefined;
50
58
  } & import("react").RefAttributes<HTMLDivElement>>;
51
59
  optionsListProps: {
@@ -70,5 +78,12 @@ declare function useSelectWithApply({ options, selected, onChange, OptionsList,
70
78
  })[];
71
79
  onChange: (payload: import("./typings").BaseSelectChangePayload) => void;
72
80
  selected: string | OptionShape | (string | OptionShape)[] | null | undefined;
81
+ showSearch: boolean | undefined;
82
+ searchProps: {
83
+ value: string;
84
+ onChange: import("react").Dispatch<import("react").SetStateAction<string>>;
85
+ componentProps?: import("packages/input/src").InputProps | undefined;
86
+ accessor?: ((option: OptionShape) => string) | undefined;
87
+ } | undefined;
73
88
  };
74
89
  export { UseSelectWithApplyProps, SELECT_ALL_KEY, useSelectWithApply };
@@ -13,7 +13,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
13
13
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
14
14
 
15
15
  var OptionsListWithApply = React.forwardRef(function (_a, ref) {
16
- var toggleMenu = _a.toggleMenu, defaultGetOptionProps = _a.getOptionProps, _b = _a.showClear, showClear = _b === void 0 ? true : _b, showHeaderWithSelectAll = _a.showHeaderWithSelectAll, _c = _a.selectedDraft, selectedDraft = _c === void 0 ? [] : _c, _d = _a.flatOptions, flatOptions = _d === void 0 ? [] : _d, _e = _a.OptionsList, OptionsList = _e === void 0 ? components_optionsList_Component.OptionsList : _e, _f = _a.onApply, onApply = _f === void 0 ? function () { return null; } : _f, _g = _a.onClear, onClear = _g === void 0 ? function () { return null; } : _g, _h = _a.onClose, onClose = _h === void 0 ? function () { return null; } : _h, _j = _a.visibleOptions, visibleOptions = _j === void 0 ? consts.DEFAULT_VISIBLE_OPTIONS : _j, _k = _a.Footer, Footer = _k === void 0 ? presets_useSelectWithApply_optionsListWithApply_footer_Component.Footer : _k, _l = _a.Header, Header = _l === void 0 ? presets_useSelectWithApply_optionsListWithApply_header_Component.Header : _l, headerProps = _a.headerProps, restProps = tslib.__rest(_a, ["toggleMenu", "getOptionProps", "showClear", "showHeaderWithSelectAll", "selectedDraft", "flatOptions", "OptionsList", "onApply", "onClear", "onClose", "visibleOptions", "Footer", "Header", "headerProps"]);
16
+ var toggleMenu = _a.toggleMenu, defaultGetOptionProps = _a.getOptionProps, _b = _a.showClear, showClear = _b === void 0 ? true : _b, showHeaderWithSelectAll = _a.showHeaderWithSelectAll, _c = _a.selectedDraft, selectedDraft = _c === void 0 ? [] : _c, _d = _a.flatOptions, flatOptions = _d === void 0 ? [] : _d, _e = _a.OptionsList, OptionsList = _e === void 0 ? components_optionsList_Component.OptionsList : _e, _f = _a.onApply, onApply = _f === void 0 ? function () { return null; } : _f, _g = _a.onClear, onClear = _g === void 0 ? function () { return null; } : _g, _h = _a.onClose, onClose = _h === void 0 ? function () { return null; } : _h, _j = _a.visibleOptions, visibleOptions = _j === void 0 ? consts.DEFAULT_VISIBLE_OPTIONS : _j, _k = _a.Footer, Footer = _k === void 0 ? presets_useSelectWithApply_optionsListWithApply_footer_Component.Footer : _k, _l = _a.Header, Header = _l === void 0 ? presets_useSelectWithApply_optionsListWithApply_header_Component.Header : _l, header = _a.header, headerProps = _a.headerProps, restProps = tslib.__rest(_a, ["toggleMenu", "getOptionProps", "showClear", "showHeaderWithSelectAll", "selectedDraft", "flatOptions", "OptionsList", "onApply", "onClear", "onClose", "visibleOptions", "Footer", "Header", "header", "headerProps"]);
17
17
  var getOptionProps = React.useCallback(function (option, index) {
18
18
  var optionProps = defaultGetOptionProps(option, index);
19
19
  var selected = option.key === SELECT_ALL_KEY
@@ -39,15 +39,26 @@ var OptionsListWithApply = React.forwardRef(function (_a, ref) {
39
39
  };
40
40
  // eslint-disable-next-line react-hooks/exhaustive-deps
41
41
  }, []);
42
- return (React__default.default.createElement(OptionsList, tslib.__assign({}, restProps, { ref: ref, visibleOptions: visibleOptions, toggleMenu: toggleMenu, flatOptions: flatOptions, getOptionProps: getOptionProps, onApply: handleApply, onClear: handleClear, header: showHeaderWithSelectAll ? React__default.default.createElement(Header, tslib.__assign({}, headerProps)) : undefined, footer: React__default.default.createElement(Footer, { handleApply: handleApply, handleClear: handleClear, showClear: showClear, selectedDraft: selectedDraft }) })));
42
+ var renderHeader = function () {
43
+ if (!showHeaderWithSelectAll && !header)
44
+ return undefined;
45
+ return (React__default.default.createElement(React__default.default.Fragment, null,
46
+ header,
47
+ showHeaderWithSelectAll && React__default.default.createElement(Header, tslib.__assign({}, headerProps))));
48
+ };
49
+ return (React__default.default.createElement(OptionsList, tslib.__assign({}, restProps, { ref: ref, visibleOptions: visibleOptions, toggleMenu: toggleMenu, flatOptions: flatOptions, getOptionProps: getOptionProps, onApply: handleApply, onClear: handleClear, header: renderHeader(), footer: React__default.default.createElement(Footer, { handleApply: handleApply, handleClear: handleClear, showClear: showClear, selectedDraft: selectedDraft }) })));
43
50
  });
44
51
 
45
52
  var SELECT_ALL_KEY = 'select_all';
46
53
  var selectAllOption = { key: SELECT_ALL_KEY, content: 'Выбрать все' };
47
54
  function useSelectWithApply(_a) {
48
- var options = _a.options, selected = _a.selected, _b = _a.onChange, onChange = _b === void 0 ? function () { return null; } : _b, OptionsList = _a.OptionsList, _c = _a.optionsListProps, optionsListProps = _c === void 0 ? {} : _c, _d = _a.showClear, showClear = _d === void 0 ? true : _d, _e = _a.showSelectAll, showSelectAll = _e === void 0 ? false : _e, _f = _a.showHeaderWithSelectAll, showHeaderWithSelectAll = _f === void 0 ? false : _f;
49
- var _g = React.useMemo(function () { return utils.processOptions(options, selected); }, [options, selected]), flatOptions = _g.flatOptions, selectedOptions = _g.selectedOptions;
50
- var _h = React.useState(selectedOptions), selectedDraft = _h[0], setSelectedDraft = _h[1];
55
+ var options = _a.options, selected = _a.selected, _b = _a.onChange, onChange = _b === void 0 ? function () { return null; } : _b, OptionsList = _a.OptionsList, _c = _a.optionsListProps, optionsListProps = _c === void 0 ? {} : _c, _d = _a.showClear, showClear = _d === void 0 ? true : _d, _e = _a.showSelectAll, showSelectAll = _e === void 0 ? false : _e, _f = _a.showHeaderWithSelectAll, showHeaderWithSelectAll = _f === void 0 ? false : _f, showSearch = _a.showSearch, _g = _a.searchProps, searchProps = _g === void 0 ? {} : _g;
56
+ var _h = React.useState(''), search = _h[0], setSearch = _h[1];
57
+ var accessor = searchProps.accessor || utils.defaultAccessor;
58
+ var _j = React.useMemo(function () {
59
+ return utils.processOptions(options, selected, showSearch ? function (option) { return utils.defaultFilterFn(accessor(option), search); } : undefined);
60
+ }, [accessor, options, search, selected, showSearch]), flatOptions = _j.flatOptions, selectedOptions = _j.selectedOptions;
61
+ var _k = React.useState(selectedOptions), selectedDraft = _k[0], setSelectedDraft = _k[1];
51
62
  var selectedOptionsRef = React.useRef(selectedOptions);
52
63
  var handleApply = function () {
53
64
  onChange({
@@ -102,6 +113,9 @@ function useSelectWithApply(_a) {
102
113
  options: memoizedOptions,
103
114
  onChange: handleChange,
104
115
  selected: selected,
116
+ showSearch: showSearch,
117
+ searchProps: showSearch
118
+ ? tslib.__assign(tslib.__assign({}, searchProps), { value: search, onChange: setSearch }) : undefined,
105
119
  };
106
120
  }
107
121
 
package/index.js CHANGED
@@ -31,6 +31,9 @@ require('./components/checkmark-mobile/Component.js');
31
31
  require('./components/options-list/Component.js');
32
32
  require('@alfalab/core-components-scrollbar');
33
33
  require('./consts.js');
34
+ require('./components/search/Component.js');
35
+ require('@alfalab/core-components-input');
36
+ require('@alfalab/icons-glyph/MagnifierMIcon');
34
37
  require('./Component.mobile.js');
35
38
  require('@alfalab/core-components-form-control/mobile');
36
39
  require('./components/base-select-mobile/Component.js');
@@ -41,7 +44,7 @@ require('@alfalab/core-components-base-modal');
41
44
  require('@alfalab/core-components-button/mobile');
42
45
  require('./components/virtual-options-list/Component.js');
43
46
  require('react-virtual');
44
- require('./hook-43a35a80.js');
47
+ require('./hook-c0d8bff3.js');
45
48
  require('./presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
46
49
  require('@alfalab/core-components-button/desktop');
47
50
  require('./presets/useSelectWithApply/options-list-with-apply/header/Component.js');
package/mobile.js CHANGED
@@ -30,12 +30,15 @@ require('./components/checkmark-mobile/Component.js');
30
30
  require('./components/options-list/Component.js');
31
31
  require('@alfalab/core-components-scrollbar');
32
32
  require('./consts.js');
33
+ require('./components/search/Component.js');
34
+ require('@alfalab/core-components-input');
35
+ require('@alfalab/icons-glyph/MagnifierMIcon');
33
36
  require('./components/base-select-mobile/footer/Component.js');
34
37
  require('@alfalab/core-components-base-modal');
35
38
  require('@alfalab/core-components-button/mobile');
36
39
  require('./components/virtual-options-list/Component.js');
37
40
  require('react-virtual');
38
- require('./hook-43a35a80.js');
41
+ require('./hook-c0d8bff3.js');
39
42
  require('./presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
40
43
  require('@alfalab/core-components-button/desktop');
41
44
  require('./presets/useSelectWithApply/options-list-with-apply/header/Component.js');
@@ -6,6 +6,7 @@ import { Field } from './components/field/Component.js';
6
6
  import { Optgroup } from './components/optgroup/Component.js';
7
7
  import { Option } from './components/option/Component.js';
8
8
  import { OptionsList } from './components/options-list/Component.js';
9
+ import { Search } from './components/search/Component.js';
9
10
  import 'classnames';
10
11
  import '@alfalab/icons-glyph/ChevronDownMIcon';
11
12
  import 'react-merge-refs';
@@ -24,10 +25,12 @@ import '@alfalab/icons-glyph/CheckmarkMIcon';
24
25
  import './components/checkmark-mobile/Component.js';
25
26
  import '@alfalab/core-components-scrollbar/modern';
26
27
  import './consts.js';
28
+ import '@alfalab/core-components-input/modern';
29
+ import '@alfalab/icons-glyph/MagnifierMIcon';
27
30
 
28
- const SelectDesktop = forwardRef(({ Arrow: Arrow$1 = Arrow, Field: Field$1 = Field, OptionsList: OptionsList$1 = OptionsList, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, fieldProps = {}, ...restProps }, ref) => (React.createElement(BaseSelect, { ref: ref, Option: Option$1, Field: Field$1, fieldProps: {
31
+ const SelectDesktop = forwardRef(({ Arrow: Arrow$1 = Arrow, Field: Field$1 = Field, OptionsList: OptionsList$1 = OptionsList, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, Search: Search$1 = Search, fieldProps = {}, ...restProps }, ref) => (React.createElement(BaseSelect, { ref: ref, Option: Option$1, Field: Field$1, fieldProps: {
29
32
  FormControlComponent: FormControlDesktop,
30
33
  ...fieldProps,
31
- }, Optgroup: Optgroup$1, OptionsList: OptionsList$1, Arrow: Arrow$1, ...restProps })));
34
+ }, Search: Search$1, Optgroup: Optgroup$1, OptionsList: OptionsList$1, Arrow: Arrow$1, ...restProps })));
32
35
 
33
36
  export { SelectDesktop };
@@ -2,7 +2,7 @@
2
2
  import React from 'react';
3
3
  import { ReactNode } from "react";
4
4
  import { BottomSheetProps } from "@alfalab/core-components-bottom-sheet";
5
- import { UseSelectWithApplyProps } from "./hook-9ea9e32c";
5
+ import { UseSelectWithApplyProps } from "./hook-8abfea97";
6
6
  import { BaseSelectProps } from "./typings";
7
7
  type AdditionalMobileProps = {
8
8
  /**
@@ -7,8 +7,9 @@ import { Field } from './components/field/Component.js';
7
7
  import { Optgroup } from './components/optgroup/Component.js';
8
8
  import { Option } from './components/option/Component.js';
9
9
  import { OptionsList } from './components/options-list/Component.js';
10
+ import { Search } from './components/search/Component.js';
10
11
  import { VirtualOptionsList } from './components/virtual-options-list/Component.js';
11
- import { u as useSelectWithApply } from './hook-d771f2ed.js';
12
+ import { u as useSelectWithApply } from './hook-101e5d49.js';
12
13
  import { Header } from './presets/useSelectWithApply/options-list-with-apply/header/Component.js';
13
14
  import 'classnames';
14
15
  import '@alfalab/icons-glyph/ChevronDownMIcon';
@@ -29,20 +30,24 @@ import '@alfalab/icons-glyph/CheckmarkMIcon';
29
30
  import './components/checkmark-mobile/Component.js';
30
31
  import '@alfalab/core-components-scrollbar/modern';
31
32
  import './consts.js';
33
+ import '@alfalab/core-components-input/modern';
34
+ import '@alfalab/icons-glyph/MagnifierMIcon';
32
35
  import 'react-virtual';
33
36
  import './presets/useSelectWithApply/options-list-with-apply/footer/Component.js';
34
37
  import '@alfalab/core-components-button/modern/desktop';
35
38
 
36
39
  const VIRTUAL_OPTIONS_LIST_THRESHOLD = 30;
37
- const SelectMobile = forwardRef(({ autocomplete = false, multiple = false, allowUnselect = false, disabled = false, closeOnSelect = !multiple, circularNavigation = false, defaultOpen = false, open: openProp, size = 'm', optionsSize = 'm', fieldProps = {}, optionProps = {}, optionsListProps = {}, Arrow: Arrow$1 = Arrow, Field: Field$1 = Field, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, selected, options, OptionsList: OptionsList$1 = options.length > VIRTUAL_OPTIONS_LIST_THRESHOLD
40
+ const SelectMobile = forwardRef(({ autocomplete = false, multiple = false, allowUnselect = false, disabled = false, closeOnSelect = !multiple, circularNavigation = false, defaultOpen = false, open: openProp, size = 'm', optionsSize = 'm', fieldProps = {}, optionProps = {}, optionsListProps = {}, Arrow: Arrow$1 = Arrow, Field: Field$1 = Field, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, Search: Search$1 = Search, selected, options, OptionsList: OptionsList$1 = options.length > VIRTUAL_OPTIONS_LIST_THRESHOLD
38
41
  ? VirtualOptionsList
39
- : OptionsList, onChange, bottomSheetProps, showClear = true, showSelectAll, showHeaderWithSelectAll, useWithApplyHook = multiple, ...restProps }, ref) => {
42
+ : OptionsList, onChange, bottomSheetProps, showClear = true, showSelectAll, showHeaderWithSelectAll, useWithApplyHook = multiple, showSearch, searchProps, ...restProps }, ref) => {
40
43
  const applyProps = useSelectWithApply({
41
44
  optionsListProps: {
42
45
  ...optionsListProps,
43
46
  Footer,
44
47
  },
45
48
  OptionsList: OptionsList$1,
49
+ showSearch,
50
+ searchProps,
46
51
  selected,
47
52
  options,
48
53
  onChange,
@@ -52,7 +57,7 @@ const SelectMobile = forwardRef(({ autocomplete = false, multiple = false, allow
52
57
  return (React.createElement(BaseSelectMobile, { ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: {
53
58
  FormControlComponent: FormControlMobile,
54
59
  ...fieldProps,
55
- }, optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, isBottomSheet: true, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList$1, bottomSheetProps: {
60
+ }, optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, Search: Search$1, isBottomSheet: true, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList$1, bottomSheetProps: {
56
61
  bottomAddons: useWithApplyHook && showHeaderWithSelectAll && (React.createElement(Header, { ...applyProps.optionsListProps.headerProps, mobile: true })),
57
62
  ...bottomSheetProps,
58
63
  }, optionsListProps: optionsListProps, ...restProps, ...(useWithApplyHook && applyProps) }));
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
3
  import { ModalMobile } from "./Component.mobile-f1f15074";
4
- import { UseSelectWithApplyProps } from "./hook-9ea9e32c";
4
+ import { UseSelectWithApplyProps } from "./hook-8abfea97";
5
5
  import { BaseSelectProps } from "./typings";
6
6
  type SelectModalMobileProps = Omit<BaseSelectProps, 'Checkmark' | 'onScroll'> & {
7
7
  /**
@@ -8,7 +8,7 @@ import { Optgroup } from './components/optgroup/Component.js';
8
8
  import { Option } from './components/option/Component.js';
9
9
  import { OptionsList } from './components/options-list/Component.js';
10
10
  import { VirtualOptionsList } from './components/virtual-options-list/Component.js';
11
- import { u as useSelectWithApply } from './hook-d771f2ed.js';
11
+ import { u as useSelectWithApply } from './hook-101e5d49.js';
12
12
  import { Header } from './presets/useSelectWithApply/options-list-with-apply/header/Component.js';
13
13
  import 'classnames';
14
14
  import '@alfalab/icons-glyph/ChevronDownMIcon';
@@ -18,6 +18,9 @@ import '@alfalab/core-components-bottom-sheet/modern';
18
18
  import '@alfalab/core-components-modal/modern/mobile';
19
19
  import '@alfalab/core-components-shared/modern';
20
20
  import './utils.js';
21
+ import './components/search/Component.js';
22
+ import '@alfalab/core-components-input/modern';
23
+ import '@alfalab/icons-glyph/MagnifierMIcon';
21
24
  import '@alfalab/core-components-base-modal/modern';
22
25
  import '@alfalab/core-components-button/modern/mobile';
23
26
  import '@alfalab/hooks';
@@ -36,7 +39,7 @@ import '@alfalab/core-components-button/modern/desktop';
36
39
  const VIRTUAL_OPTIONS_LIST_THRESHOLD = 30;
37
40
  const SelectModalMobile = forwardRef(({ autocomplete = false, multiple = false, allowUnselect = false, disabled = false, closeOnSelect = !multiple, circularNavigation = false, defaultOpen = false, open: openProp, size = 'm', optionsSize = 'm', fieldProps = {}, optionProps = {}, optionsListProps = {}, Arrow: Arrow$1 = Arrow, Field: Field$1 = Field, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, selected, options, OptionsList: OptionsList$1 = options.length > VIRTUAL_OPTIONS_LIST_THRESHOLD
38
41
  ? VirtualOptionsList
39
- : OptionsList, onChange, showClear = true, showSelectAll, useWithApplyHook = multiple, modalHeaderProps, showHeaderWithSelectAll, ...restProps }, ref) => {
42
+ : OptionsList, onChange, showClear = true, showSelectAll, useWithApplyHook = multiple, modalHeaderProps, showHeaderWithSelectAll, showSearch, searchProps, ...restProps }, ref) => {
40
43
  const applyProps = useSelectWithApply({
41
44
  optionsListProps: {
42
45
  ...optionsListProps,
@@ -46,6 +49,8 @@ const SelectModalMobile = forwardRef(({ autocomplete = false, multiple = false,
46
49
  selected,
47
50
  options,
48
51
  onChange,
52
+ showSearch,
53
+ searchProps,
49
54
  showClear,
50
55
  showSelectAll,
51
56
  });
@@ -26,6 +26,9 @@ import './components/checkmark-mobile/Component.js';
26
26
  import './components/options-list/Component.js';
27
27
  import '@alfalab/core-components-scrollbar/modern';
28
28
  import './consts.js';
29
+ import './components/search/Component.js';
30
+ import '@alfalab/core-components-input/modern';
31
+ import '@alfalab/icons-glyph/MagnifierMIcon';
29
32
  import '@alfalab/core-components-form-control/modern/mobile';
30
33
  import './components/base-select-mobile/Component.js';
31
34
  import '@alfalab/core-components-bottom-sheet/modern';
@@ -35,7 +38,7 @@ import '@alfalab/core-components-base-modal/modern';
35
38
  import '@alfalab/core-components-button/modern/mobile';
36
39
  import './components/virtual-options-list/Component.js';
37
40
  import 'react-virtual';
38
- import './hook-d771f2ed.js';
41
+ import './hook-101e5d49.js';
39
42
  import './presets/useSelectWithApply/options-list-with-apply/footer/Component.js';
40
43
  import '@alfalab/core-components-button/modern/desktop';
41
44
  import './presets/useSelectWithApply/options-list-with-apply/header/Component.js';
@@ -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_lab3k","open":"select__open_lab3k"};
5
+ const styles = {"arrow":"select__arrow_7z2ye","open":"select__open_7z2ye"};
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: kofo9 */
1
+ /* hash: 1qeb7 */
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_lab3k {
29
+ } .select__arrow_7z2ye {
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_lab3k {
36
+ } .select__open_7z2ye {
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_rp0yl","single":"select__single_rp0yl","selected":"select__selected_rp0yl"};
6
+ const styles = {"checkmark":"select__checkmark_6928o","single":"select__single_6928o","selected":"select__selected_6928o"};
7
7
  require('./index.css')
8
8
 
9
9
  const BaseCheckmark = ({ selected, disabled = false, className, multiple, }) => {
@@ -1,4 +1,4 @@
1
- /* hash: pujww */
1
+ /* hash: 1xysu */
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_rp0yl {
26
+ } .select__checkmark_6928o {
27
27
  flex-shrink: 0;
28
28
  box-sizing: border-box;
29
- } .select__single_rp0yl {
29
+ } .select__single_6928o {
30
30
  display: flex;
31
31
  align-items: center;
32
32
  justify-content: center;
33
33
  opacity: 0
34
- } .select__single_rp0yl.select__selected_rp0yl {
34
+ } .select__single_6928o.select__selected_6928o {
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_1tgd3","disabled":"select__disabled_1tgd3","checkmarkBefore":"select__checkmarkBefore_1tgd3","mobile":"select__mobile_1tgd3","checkmarkAfter":"select__checkmarkAfter_1tgd3","textContent":"select__textContent_1tgd3","selected":"select__selected_1tgd3","highlighted":"select__highlighted_1tgd3","content":"select__content_1tgd3"};
7
+ const styles = {"option":"select__option_18w82","disabled":"select__disabled_18w82","checkmarkBefore":"select__checkmarkBefore_18w82","mobile":"select__mobile_18w82","checkmarkAfter":"select__checkmarkAfter_18w82","textContent":"select__textContent_18w82","selected":"select__selected_18w82","highlighted":"select__highlighted_18w82","content":"select__content_18w82"};
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, }) => {
@@ -1,4 +1,4 @@
1
- /* hash: 1jbn0 */
1
+ /* hash: 1wh3a */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-bg-primary: #fff;
@@ -43,7 +43,7 @@
43
43
  /* checkmark */
44
44
 
45
45
  /* optgroup */
46
- } .select__option_1tgd3 {
46
+ } .select__option_18w82 {
47
47
  font-size: 16px;
48
48
  line-height: 20px;
49
49
  font-weight: 400;
@@ -60,32 +60,32 @@
60
60
  position: relative;
61
61
  cursor: pointer;
62
62
  min-height: var(--size-s-height)
63
- } .select__option_1tgd3:not(.select__disabled_1tgd3):active {
63
+ } .select__option_18w82:not(.select__disabled_18w82):active {
64
64
  background: var(--select-option-active-background);
65
65
  color: var(--select-option-active-color);
66
- } .select__option_1tgd3.select__checkmarkBefore_1tgd3 {
66
+ } .select__option_18w82.select__checkmarkBefore_18w82 {
67
67
  padding: 0 0 0 var(--gap-s)
68
- } .select__option_1tgd3.select__checkmarkBefore_1tgd3.select__mobile_1tgd3 {
68
+ } .select__option_18w82.select__checkmarkBefore_18w82.select__mobile_18w82 {
69
69
  padding-left: var(--gap-m);
70
- } .select__option_1tgd3.select__checkmarkAfter_1tgd3 {
70
+ } .select__option_18w82.select__checkmarkAfter_18w82 {
71
71
  padding: 0 var(--gap-s) 0 0
72
- } .select__option_1tgd3.select__checkmarkAfter_1tgd3.select__mobile_1tgd3 {
72
+ } .select__option_18w82.select__checkmarkAfter_18w82.select__mobile_18w82 {
73
73
  padding-right: var(--gap-l);
74
- } .select__option_1tgd3.select__textContent_1tgd3 {
74
+ } .select__option_18w82.select__textContent_18w82 {
75
75
  padding: var(--gap-s)
76
- } .select__option_1tgd3.select__textContent_1tgd3.select__mobile_1tgd3 {
76
+ } .select__option_18w82.select__textContent_18w82.select__mobile_18w82 {
77
77
  padding: var(--gap-m) var(--gap-l) var(--gap-m) var(--gap-m);
78
- } .select__selected_1tgd3 {
78
+ } .select__selected_18w82 {
79
79
  background: var(--select-option-selected-background);
80
80
  color: var(--select-option-selected-color);
81
81
  cursor: default;
82
- } .select__highlighted_1tgd3 {
82
+ } .select__highlighted_18w82 {
83
83
  background: var(--select-option-hover-background);
84
84
  color: var(--select-option-hover-color);
85
- } .select__disabled_1tgd3 {
85
+ } .select__disabled_18w82 {
86
86
  cursor: var(--disabled-cursor);
87
87
  background: var(--select-option-disabled-background);
88
88
  color: var(--select-option-disabled-color);
89
- } .select__content_1tgd3 {
89
+ } .select__content_18w82 {
90
90
  flex: 1;
91
91
  }