@alfalab/core-components-select 14.2.0 → 14.3.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 (216) hide show
  1. package/{Component-3b7dfcdb.d.ts → Component-3eb05f44.d.ts} +23 -1
  2. package/{Component-3b7dfcdb.js → Component-3eb05f44.js} +27 -22
  3. package/Component.js +1 -1
  4. package/Component.responsive.js +4 -3
  5. package/components/arrow/Component.js +1 -1
  6. package/components/arrow/index.css +3 -3
  7. package/components/base-checkmark/Component.js +1 -1
  8. package/components/base-checkmark/index.css +4 -4
  9. package/components/base-option/Component.js +2 -2
  10. package/components/base-option/index.css +13 -13
  11. package/components/base-select/Component.js +2 -2
  12. package/components/base-select/index.css +8 -8
  13. package/components/base-select/index.js +1 -1
  14. package/components/base-select-mobile/Component.js +2 -2
  15. package/components/base-select-mobile/footer/Component.js +1 -1
  16. package/components/base-select-mobile/footer/index.css +5 -5
  17. package/components/base-select-mobile/index.css +10 -10
  18. package/components/base-select-mobile/index.js +1 -1
  19. package/components/checkmark/Component.js +1 -1
  20. package/components/checkmark/index.css +10 -10
  21. package/components/checkmark-mobile/Component.js +1 -1
  22. package/components/checkmark-mobile/index.css +6 -6
  23. package/components/field/Component.js +1 -1
  24. package/components/field/index.css +9 -9
  25. package/components/index.js +5 -4
  26. package/components/optgroup/Component.js +1 -1
  27. package/components/optgroup/index.css +6 -6
  28. package/components/option/Component.js +2 -2
  29. package/components/option/index.css +20 -20
  30. package/components/options-list/Component.js +1 -1
  31. package/components/options-list/index.css +9 -9
  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 +1 -1
  39. package/components/virtual-options-list/index.css +15 -15
  40. package/{modern/Component-8dc39be2.d.ts → cssm/Component-4727d474.d.ts} +23 -1
  41. package/cssm/{Component-75d13e23.js → Component-4727d474.js} +26 -21
  42. package/cssm/Component.responsive.js +3 -1
  43. package/cssm/components/base-option/Component.js +1 -1
  44. package/cssm/components/index.js +4 -2
  45. package/cssm/components/option/Component.js +1 -1
  46. package/cssm/components/select-mobile/Component.js +3 -1
  47. package/cssm/components/select-mobile/index.d.ts +1 -1
  48. package/cssm/components/select-mobile/index.js +3 -1
  49. package/cssm/components/select-modal-mobile/Component.js +3 -1
  50. package/cssm/components/select-modal-mobile/index.d.ts +1 -1
  51. package/cssm/components/select-modal-mobile/index.js +3 -1
  52. package/{esm/hook-4b555174.d.ts → cssm/hook-b4e70cb0.d.ts} +15 -4
  53. package/cssm/index.js +4 -2
  54. package/cssm/mobile.js +3 -1
  55. package/cssm/presets/index.d.ts +1 -1
  56. package/cssm/presets/index.js +3 -1
  57. package/cssm/presets/useSelectWithApply/hook.js +3 -1
  58. package/cssm/presets/useSelectWithApply/options-list-with-apply/Component.js +3 -1
  59. package/cssm/presets/useSelectWithApply/options-list-with-apply/footer/index.module.css +0 -9
  60. package/cssm/presets/useSelectWithApply/options-list-with-apply/header/Component.d.ts +11 -0
  61. package/cssm/presets/useSelectWithApply/options-list-with-apply/header/Component.js +23 -0
  62. package/cssm/presets/useSelectWithApply/options-list-with-apply/header/index.module.css +22 -0
  63. package/cssm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  64. package/cssm/presets/useSelectWithApply/options-list-with-apply/index.js +3 -1
  65. package/cssm/responsive.js +3 -1
  66. package/{cssm/Component-75d13e23.d.ts → esm/Component-b436aedf.d.ts} +23 -1
  67. package/esm/{Component-06bb5812.js → Component-b436aedf.js} +27 -22
  68. package/esm/Component.js +1 -1
  69. package/esm/Component.responsive.js +4 -3
  70. package/esm/components/arrow/Component.js +1 -1
  71. package/esm/components/arrow/index.css +3 -3
  72. package/esm/components/base-checkmark/Component.js +1 -1
  73. package/esm/components/base-checkmark/index.css +4 -4
  74. package/esm/components/base-option/Component.js +2 -2
  75. package/esm/components/base-option/index.css +13 -13
  76. package/esm/components/base-select/Component.js +2 -2
  77. package/esm/components/base-select/index.css +8 -8
  78. package/esm/components/base-select/index.js +1 -1
  79. package/esm/components/base-select-mobile/Component.js +2 -2
  80. package/esm/components/base-select-mobile/footer/Component.js +1 -1
  81. package/esm/components/base-select-mobile/footer/index.css +5 -5
  82. package/esm/components/base-select-mobile/index.css +10 -10
  83. package/esm/components/base-select-mobile/index.js +1 -1
  84. package/esm/components/checkmark/Component.js +1 -1
  85. package/esm/components/checkmark/index.css +10 -10
  86. package/esm/components/checkmark-mobile/Component.js +1 -1
  87. package/esm/components/checkmark-mobile/index.css +6 -6
  88. package/esm/components/field/Component.js +1 -1
  89. package/esm/components/field/index.css +9 -9
  90. package/esm/components/index.js +5 -4
  91. package/esm/components/optgroup/Component.js +1 -1
  92. package/esm/components/optgroup/index.css +6 -6
  93. package/esm/components/option/Component.js +2 -2
  94. package/esm/components/option/index.css +20 -20
  95. package/esm/components/options-list/Component.js +1 -1
  96. package/esm/components/options-list/index.css +9 -9
  97. package/esm/components/select-mobile/Component.js +4 -3
  98. package/esm/components/select-mobile/index.d.ts +1 -1
  99. package/esm/components/select-mobile/index.js +4 -3
  100. package/esm/components/select-modal-mobile/Component.js +4 -3
  101. package/esm/components/select-modal-mobile/index.d.ts +1 -1
  102. package/esm/components/select-modal-mobile/index.js +4 -3
  103. package/esm/components/virtual-options-list/Component.js +1 -1
  104. package/esm/components/virtual-options-list/index.css +15 -15
  105. package/{cssm/hook-4b555174.d.ts → esm/hook-b4e70cb0.d.ts} +15 -4
  106. package/esm/index-3885b0d7.d.ts +1 -1
  107. package/esm/index.js +5 -4
  108. package/esm/mobile.js +4 -3
  109. package/esm/presets/index.d.ts +1 -1
  110. package/esm/presets/index.js +4 -3
  111. package/esm/presets/useLazyLoading/hook.js +2 -2
  112. package/esm/presets/useLazyLoading/index.css +2 -2
  113. package/esm/presets/useSelectWithApply/hook.js +4 -3
  114. package/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +4 -3
  115. package/esm/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
  116. package/esm/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -12
  117. package/esm/presets/useSelectWithApply/options-list-with-apply/header/Component.d.ts +11 -0
  118. package/esm/presets/useSelectWithApply/options-list-with-apply/header/Component.js +15 -0
  119. package/esm/presets/useSelectWithApply/options-list-with-apply/header/index.css +23 -0
  120. package/esm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  121. package/esm/presets/useSelectWithApply/options-list-with-apply/index.js +4 -3
  122. package/esm/presets/useSelectWithLoading/hook.js +1 -1
  123. package/esm/presets/useSelectWithLoading/index.css +2 -2
  124. package/esm/responsive.js +4 -3
  125. package/{hook-4b555174.d.ts → hook-b4e70cb0.d.ts} +15 -4
  126. package/index-3885b0d7.d.ts +1 -1
  127. package/index.js +5 -4
  128. package/mobile.js +4 -3
  129. package/{esm/Component-06bb5812.d.ts → modern/Component-c22703bb.d.ts} +23 -1
  130. package/modern/{Component-8dc39be2.js → Component-c22703bb.js} +31 -17
  131. package/modern/Component.js +1 -1
  132. package/modern/Component.responsive.js +4 -3
  133. package/modern/components/arrow/Component.js +1 -1
  134. package/modern/components/arrow/index.css +3 -3
  135. package/modern/components/base-checkmark/Component.js +1 -1
  136. package/modern/components/base-checkmark/index.css +4 -4
  137. package/modern/components/base-option/Component.js +2 -2
  138. package/modern/components/base-option/index.css +13 -13
  139. package/modern/components/base-select/Component.js +2 -2
  140. package/modern/components/base-select/index.css +8 -8
  141. package/modern/components/base-select/index.js +1 -1
  142. package/modern/components/base-select-mobile/Component.js +2 -2
  143. package/modern/components/base-select-mobile/footer/Component.js +1 -1
  144. package/modern/components/base-select-mobile/footer/index.css +5 -5
  145. package/modern/components/base-select-mobile/index.css +10 -10
  146. package/modern/components/base-select-mobile/index.js +1 -1
  147. package/modern/components/checkmark/Component.js +1 -1
  148. package/modern/components/checkmark/index.css +10 -10
  149. package/modern/components/checkmark-mobile/Component.js +1 -1
  150. package/modern/components/checkmark-mobile/index.css +6 -6
  151. package/modern/components/field/Component.js +1 -1
  152. package/modern/components/field/index.css +9 -9
  153. package/modern/components/index.js +5 -4
  154. package/modern/components/optgroup/Component.js +1 -1
  155. package/modern/components/optgroup/index.css +6 -6
  156. package/modern/components/option/Component.js +2 -2
  157. package/modern/components/option/index.css +20 -20
  158. package/modern/components/options-list/Component.js +1 -1
  159. package/modern/components/options-list/index.css +9 -9
  160. package/modern/components/select-mobile/Component.js +4 -3
  161. package/modern/components/select-mobile/index.d.ts +1 -1
  162. package/modern/components/select-mobile/index.js +4 -3
  163. package/modern/components/select-modal-mobile/Component.js +4 -3
  164. package/modern/components/select-modal-mobile/index.d.ts +1 -1
  165. package/modern/components/select-modal-mobile/index.js +4 -3
  166. package/modern/components/virtual-options-list/Component.js +1 -1
  167. package/modern/components/virtual-options-list/index.css +15 -15
  168. package/modern/{hook-4b555174.d.ts → hook-b4e70cb0.d.ts} +15 -4
  169. package/modern/index-3885b0d7.d.ts +1 -1
  170. package/modern/index.js +5 -4
  171. package/modern/mobile.js +4 -3
  172. package/modern/presets/index.d.ts +1 -1
  173. package/modern/presets/index.js +4 -3
  174. package/modern/presets/useLazyLoading/hook.js +2 -2
  175. package/modern/presets/useLazyLoading/index.css +2 -2
  176. package/modern/presets/useSelectWithApply/hook.js +4 -3
  177. package/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +4 -3
  178. package/modern/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
  179. package/modern/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -12
  180. package/modern/presets/useSelectWithApply/options-list-with-apply/header/Component.d.ts +11 -0
  181. package/modern/presets/useSelectWithApply/options-list-with-apply/header/Component.js +11 -0
  182. package/modern/presets/useSelectWithApply/options-list-with-apply/header/index.css +23 -0
  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/package.json +1 -1
  189. package/presets/index.d.ts +1 -1
  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 -12
  197. package/presets/useSelectWithApply/options-list-with-apply/header/Component.d.ts +11 -0
  198. package/presets/useSelectWithApply/options-list-with-apply/header/Component.js +24 -0
  199. package/presets/useSelectWithApply/options-list-with-apply/header/index.css +23 -0
  200. package/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  201. package/presets/useSelectWithApply/options-list-with-apply/index.js +4 -3
  202. package/presets/useSelectWithLoading/hook.js +1 -1
  203. package/presets/useSelectWithLoading/index.css +2 -2
  204. package/responsive.js +4 -3
  205. /package/esm/{getDataTestId-8aabb6b6.d.ts → getDataTestId-416fe68c.d.ts} +0 -0
  206. /package/esm/{getDataTestId-8aabb6b6.js → getDataTestId-416fe68c.js} +0 -0
  207. /package/esm/{intersection-observer-6b92b662.d.ts → intersection-observer-71fc11ef.d.ts} +0 -0
  208. /package/esm/{intersection-observer-6b92b662.js → intersection-observer-71fc11ef.js} +0 -0
  209. /package/{getDataTestId-1bda9cae.d.ts → getDataTestId-e8d9eb23.d.ts} +0 -0
  210. /package/{getDataTestId-1bda9cae.js → getDataTestId-e8d9eb23.js} +0 -0
  211. /package/{intersection-observer-38296236.d.ts → intersection-observer-c227d471.d.ts} +0 -0
  212. /package/{intersection-observer-38296236.js → intersection-observer-c227d471.js} +0 -0
  213. /package/modern/{getDataTestId-59fdb29b.d.ts → getDataTestId-03736ddc.d.ts} +0 -0
  214. /package/modern/{getDataTestId-59fdb29b.js → getDataTestId-03736ddc.js} +0 -0
  215. /package/modern/{intersection-observer-6b92b662.d.ts → intersection-observer-71fc11ef.d.ts} +0 -0
  216. /package/modern/{intersection-observer-6b92b662.js → intersection-observer-71fc11ef.js} +0 -0
@@ -2,9 +2,10 @@
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-4b555174";
5
+ import { UseSelectWithApplyProps } from "./hook-b4e70cb0";
6
6
  import { BaseSelectProps, OptionShape, OptionsListProps } from "./typings";
7
7
  import { FooterProps } from "./presets/useSelectWithApply/options-list-with-apply/footer/Component";
8
+ import { HeaderProps } from "./presets/useSelectWithApply/options-list-with-apply/header/Component";
8
9
  import { ModalMobile } from "./Component.mobile-b2c0420d";
9
10
  type AdditionalMobileProps = {
10
11
  /**
@@ -29,6 +30,14 @@ type AdditionalMobileProps = {
29
30
  * Показывать пункт "Выбрать все"
30
31
  */
31
32
  showSelectAll?: UseSelectWithApplyProps["showSelectAll"];
33
+ /**
34
+ * Показывать пункт "Выбрать все" в заголовке списка
35
+ */
36
+ showHeaderWithSelectAll?: UseSelectWithApplyProps["showHeaderWithSelectAll"];
37
+ /**
38
+ * Использовать ли хук useSelectWithApply
39
+ */
40
+ useWithApplyHook?: boolean;
32
41
  };
33
42
  type SelectMobileProps = Omit<BaseSelectProps, "Checkmark" | "onScroll"> & AdditionalMobileProps;
34
43
  declare const SelectMobile: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "onScroll" | "Checkmark"> & AdditionalMobileProps & React.RefAttributes<unknown>>;
@@ -38,6 +47,9 @@ declare const OptionsListWithApply: React.ForwardRefExoticComponent<OptionsListP
38
47
  selectedDraft?: OptionShape[] | undefined;
39
48
  OptionsList?: React.FC<OptionsListProps & React.RefAttributes<HTMLDivElement>> | undefined;
40
49
  Footer?: React.FC<FooterProps> | undefined;
50
+ Header?: React.FC<HeaderProps> | undefined;
51
+ headerProps?: HeaderProps | undefined;
52
+ showHeaderWithSelectAll?: boolean | undefined;
41
53
  } & React.RefAttributes<HTMLDivElement>>;
42
54
  type SelectModalMobileProps = Omit<BaseSelectProps, 'Checkmark' | 'onScroll'> & {
43
55
  /**
@@ -60,6 +72,11 @@ type SelectModalMobileProps = Omit<BaseSelectProps, 'Checkmark' | 'onScroll'> &
60
72
  * Дополнительные пропсы футера модалки
61
73
  */
62
74
  modalFooterProps?: Partial<React.ComponentProps<typeof ModalMobile.Footer>>;
75
+ showHeaderWithSelectAll?: UseSelectWithApplyProps['showHeaderWithSelectAll'];
76
+ /**
77
+ * Использовать ли хук useSelectWithApply
78
+ */
79
+ useWithApplyHook?: boolean;
63
80
  };
64
81
  declare const SelectModalMobile: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "onScroll" | "Checkmark"> & {
65
82
  /**
@@ -82,5 +99,10 @@ declare const SelectModalMobile: React.ForwardRefExoticComponent<Omit<BaseSelect
82
99
  * Дополнительные пропсы футера модалки
83
100
  */
84
101
  modalFooterProps?: Partial<import("./Component.mobile-b2c0420d").FooterProps> | undefined;
102
+ showHeaderWithSelectAll?: UseSelectWithApplyProps['showHeaderWithSelectAll'];
103
+ /**
104
+ * Использовать ли хук useSelectWithApply
105
+ */
106
+ useWithApplyHook?: boolean | undefined;
85
107
  } & React.RefAttributes<unknown>>;
86
108
  export { AdditionalMobileProps, SelectMobileProps, SelectMobile, OptionsListWithApply, SelectModalMobileProps, SelectModalMobile };
@@ -7,6 +7,7 @@ require('classnames');
7
7
  require('@alfalab/icons-glyph/ChevronDownMIcon');
8
8
  require('./components/arrow/index.module.css');
9
9
  require('./components/base-select/Component.js');
10
+ var presets_useSelectWithApply_optionsListWithApply_header_Component = require('./presets/useSelectWithApply/options-list-with-apply/header/Component.js');
10
11
  var components_arrow_Component = require('./components/arrow/Component.js');
11
12
  var components_baseSelectMobile_Component = require('./components/base-select-mobile/Component.js');
12
13
  var components_baseSelectMobile_footer_Component = require('./components/base-select-mobile/footer/Component.js');
@@ -41,7 +42,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
41
42
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
42
43
 
43
44
  var OptionsListWithApply = React.forwardRef(function (_a, ref) {
44
- var toggleMenu = _a.toggleMenu, defaultGetOptionProps = _a.getOptionProps, _b = _a.showClear, showClear = _b === void 0 ? true : _b, _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, restProps = tslib.__rest(_a, ["toggleMenu", "getOptionProps", "showClear", "selectedDraft", "flatOptions", "OptionsList", "onApply", "onClear", "onClose", "visibleOptions", "Footer"]);
45
+ 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"]);
45
46
  var getOptionProps = React.useCallback(function (option, index) {
46
47
  var optionProps = defaultGetOptionProps(option, index);
47
48
  var selected = option.key === SELECT_ALL_KEY
@@ -67,32 +68,35 @@ var OptionsListWithApply = React.forwardRef(function (_a, ref) {
67
68
  };
68
69
  // eslint-disable-next-line react-hooks/exhaustive-deps
69
70
  }, []);
70
- return (React__default.default.createElement(OptionsList, tslib.__assign({}, restProps, { ref: ref, visibleOptions: visibleOptions, toggleMenu: toggleMenu, flatOptions: flatOptions, getOptionProps: getOptionProps, onApply: handleApply, onClear: handleClear, footer: React__default.default.createElement(Footer, { handleApply: handleApply, handleClear: handleClear, showClear: showClear, selectedDraft: selectedDraft }) })));
71
+ 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 }) })));
71
72
  });
72
73
 
73
74
  var SELECT_ALL_KEY = 'select_all';
74
75
  var selectAllOption = { key: SELECT_ALL_KEY, content: 'Выбрать все' };
75
76
  function useSelectWithApply(_a) {
76
- 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;
77
- var _f = React.useMemo(function () { return utils.processOptions(options, selected); }, [options, selected]), flatOptions = _f.flatOptions, selectedOptions = _f.selectedOptions;
78
- var _g = React.useState(selectedOptions), selectedDraft = _g[0], setSelectedDraft = _g[1];
77
+ 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;
78
+ var _g = React.useMemo(function () { return utils.processOptions(options, selected); }, [options, selected]), flatOptions = _g.flatOptions, selectedOptions = _g.selectedOptions;
79
+ var _h = React.useState(selectedOptions), selectedDraft = _h[0], setSelectedDraft = _h[1];
79
80
  var selectedOptionsRef = React.useRef(selectedOptions);
80
- var handleApply = React.useCallback(function () {
81
+ var handleApply = function () {
81
82
  onChange({
82
83
  selected: selectedDraft[0],
83
84
  selectedMultiple: selectedDraft,
84
85
  initiator: null,
85
86
  });
86
- }, [onChange, selectedDraft]);
87
- var handleClear = React.useCallback(function () {
87
+ };
88
+ var handleClear = function () {
88
89
  setSelectedDraft([]);
89
90
  onChange({
90
91
  selected: null,
91
92
  selectedMultiple: [],
92
93
  initiator: null,
93
94
  });
94
- }, [onChange]);
95
- var handleChange = React.useCallback(function (_a) {
95
+ };
96
+ var handleToggleAll = function () {
97
+ setSelectedDraft(flatOptions.length === selectedDraft.length ? [] : flatOptions);
98
+ };
99
+ var handleChange = function (_a) {
96
100
  var initiator = _a.initiator, restArgs = tslib.__rest(_a, ["initiator"]);
97
101
  if (!initiator) {
98
102
  onChange(tslib.__assign({ initiator: null }, restArgs));
@@ -108,10 +112,8 @@ function useSelectWithApply(_a) {
108
112
  ? selectedDraft.filter(function (o) { return o !== initiator; })
109
113
  : selectedDraft.concat(initiator));
110
114
  }
111
- }, [flatOptions, onChange, selectedDraft]);
112
- var handleClose = React.useCallback(function () {
113
- setSelectedDraft(selectedOptionsRef.current);
114
- }, []);
115
+ };
116
+ var handleClose = function () { return setSelectedDraft(selectedOptionsRef.current); };
115
117
  React.useEffect(function () {
116
118
  setSelectedDraft(selectedOptions);
117
119
  selectedOptionsRef.current = selectedOptions;
@@ -119,7 +121,11 @@ function useSelectWithApply(_a) {
119
121
  var memoizedOptions = React.useMemo(function () { return (showSelectAll ? tslib.__spreadArray([selectAllOption], options, true) : options); }, [options, showSelectAll]);
120
122
  return {
121
123
  OptionsList: OptionsListWithApply,
122
- optionsListProps: tslib.__assign(tslib.__assign({}, optionsListProps), { OptionsList: OptionsList, showClear: showClear, onClear: handleClear, onApply: handleApply, onClose: handleClose, selectedDraft: selectedDraft }),
124
+ optionsListProps: tslib.__assign(tslib.__assign({}, optionsListProps), { OptionsList: OptionsList, showClear: showClear, onClear: handleClear, onApply: handleApply, onClose: handleClose, selectedDraft: selectedDraft, showHeaderWithSelectAll: showHeaderWithSelectAll, headerProps: {
125
+ indeterminate: !!selectedDraft.length && selectedDraft.length < flatOptions.length,
126
+ checked: selectedDraft.length === flatOptions.length,
127
+ onChange: handleToggleAll,
128
+ } }),
123
129
  allowUnselect: true,
124
130
  multiple: true,
125
131
  options: memoizedOptions,
@@ -132,7 +138,7 @@ var VIRTUAL_OPTIONS_LIST_THRESHOLD$1 = 30;
132
138
  var SelectMobile = React.forwardRef(function (_a, ref) {
133
139
  var _b = _a.autocomplete, autocomplete = _b === void 0 ? false : _b, _c = _a.multiple, multiple = _c === void 0 ? false : _c, _d = _a.allowUnselect, allowUnselect = _d === void 0 ? false : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.closeOnSelect, closeOnSelect = _f === void 0 ? !multiple : _f, _g = _a.circularNavigation, circularNavigation = _g === void 0 ? false : _g, _h = _a.defaultOpen, defaultOpen = _h === void 0 ? false : _h, openProp = _a.open, _j = _a.size, size = _j === void 0 ? 'm' : _j, _k = _a.optionsSize, optionsSize = _k === void 0 ? 'm' : _k, _l = _a.fieldProps, fieldProps = _l === void 0 ? {} : _l, _m = _a.optionProps, optionProps = _m === void 0 ? {} : _m, _o = _a.optionsListProps, optionsListProps = _o === void 0 ? {} : _o, _p = _a.Arrow, Arrow = _p === void 0 ? components_arrow_Component.Arrow : _p, _q = _a.Field, Field = _q === void 0 ? components_field_Component.Field : _q, _r = _a.Optgroup, Optgroup = _r === void 0 ? components_optgroup_Component.Optgroup : _r, _s = _a.Option, Option = _s === void 0 ? components_option_Component.Option : _s, selected = _a.selected, options = _a.options, _t = _a.OptionsList, OptionsList = _t === void 0 ? options.length > VIRTUAL_OPTIONS_LIST_THRESHOLD$1
134
140
  ? components_virtualOptionsList_Component.VirtualOptionsList
135
- : components_optionsList_Component.OptionsList : _t, onChange = _a.onChange, bottomSheetProps = _a.bottomSheetProps, _u = _a.showClear, showClear = _u === void 0 ? true : _u, showSelectAll = _a.showSelectAll, restProps = tslib.__rest(_a, ["autocomplete", "multiple", "allowUnselect", "disabled", "closeOnSelect", "circularNavigation", "defaultOpen", "open", "size", "optionsSize", "fieldProps", "optionProps", "optionsListProps", "Arrow", "Field", "Optgroup", "Option", "selected", "options", "OptionsList", "onChange", "bottomSheetProps", "showClear", "showSelectAll"]);
141
+ : components_optionsList_Component.OptionsList : _t, onChange = _a.onChange, bottomSheetProps = _a.bottomSheetProps, _u = _a.showClear, showClear = _u === void 0 ? true : _u, showSelectAll = _a.showSelectAll, showHeaderWithSelectAll = _a.showHeaderWithSelectAll, _v = _a.useWithApplyHook, useWithApplyHook = _v === void 0 ? multiple : _v, restProps = tslib.__rest(_a, ["autocomplete", "multiple", "allowUnselect", "disabled", "closeOnSelect", "circularNavigation", "defaultOpen", "open", "size", "optionsSize", "fieldProps", "optionProps", "optionsListProps", "Arrow", "Field", "Optgroup", "Option", "selected", "options", "OptionsList", "onChange", "bottomSheetProps", "showClear", "showSelectAll", "showHeaderWithSelectAll", "useWithApplyHook"]);
136
142
  var applyProps = useSelectWithApply({
137
143
  optionsListProps: tslib.__assign(tslib.__assign({}, optionsListProps), { Footer: components_baseSelectMobile_footer_Component.Footer }),
138
144
  OptionsList: OptionsList,
@@ -142,15 +148,14 @@ var SelectMobile = React.forwardRef(function (_a, ref) {
142
148
  showClear: showClear,
143
149
  showSelectAll: showSelectAll,
144
150
  });
145
- return (React__default.default.createElement(components_baseSelectMobile_Component.BaseSelectMobile, tslib.__assign({ ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: fieldProps, optionProps: optionProps, Arrow: Arrow, Field: Field, Optgroup: Optgroup, Option: Option, isBottomSheet: true, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList, bottomSheetProps: bottomSheetProps, optionsListProps: optionsListProps }, restProps, (multiple && !(bottomSheetProps === null || bottomSheetProps === void 0 ? void 0 : bottomSheetProps.actionButton) && applyProps))));
151
+ return (React__default.default.createElement(components_baseSelectMobile_Component.BaseSelectMobile, tslib.__assign({ ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: fieldProps, optionProps: optionProps, Arrow: Arrow, Field: Field, Optgroup: Optgroup, Option: Option, isBottomSheet: true, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList, bottomSheetProps: tslib.__assign({ bottomAddons: useWithApplyHook && showHeaderWithSelectAll && (React__default.default.createElement(presets_useSelectWithApply_optionsListWithApply_header_Component.Header, tslib.__assign({}, applyProps.optionsListProps.headerProps, { mobile: true }))) }, bottomSheetProps), optionsListProps: optionsListProps }, restProps, (useWithApplyHook && applyProps))));
146
152
  });
147
153
 
148
154
  var VIRTUAL_OPTIONS_LIST_THRESHOLD = 30;
149
155
  var SelectModalMobile = React.forwardRef(function (_a, ref) {
150
- var _b;
151
- var _c = _a.autocomplete, autocomplete = _c === void 0 ? false : _c, _d = _a.multiple, multiple = _d === void 0 ? false : _d, _e = _a.allowUnselect, allowUnselect = _e === void 0 ? false : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.closeOnSelect, closeOnSelect = _g === void 0 ? !multiple : _g, _h = _a.circularNavigation, circularNavigation = _h === void 0 ? false : _h, _j = _a.defaultOpen, defaultOpen = _j === void 0 ? false : _j, openProp = _a.open, _k = _a.size, size = _k === void 0 ? 'm' : _k, _l = _a.optionsSize, optionsSize = _l === void 0 ? 'm' : _l, _m = _a.fieldProps, fieldProps = _m === void 0 ? {} : _m, _o = _a.optionProps, optionProps = _o === void 0 ? {} : _o, _p = _a.optionsListProps, optionsListProps = _p === void 0 ? {} : _p, _q = _a.Arrow, Arrow = _q === void 0 ? components_arrow_Component.Arrow : _q, _r = _a.Field, Field = _r === void 0 ? components_field_Component.Field : _r, _s = _a.Optgroup, Optgroup = _s === void 0 ? components_optgroup_Component.Optgroup : _s, _t = _a.Option, Option = _t === void 0 ? components_option_Component.Option : _t, selected = _a.selected, options = _a.options, _u = _a.OptionsList, OptionsList = _u === void 0 ? options.length > VIRTUAL_OPTIONS_LIST_THRESHOLD
156
+ var _b = _a.autocomplete, autocomplete = _b === void 0 ? false : _b, _c = _a.multiple, multiple = _c === void 0 ? false : _c, _d = _a.allowUnselect, allowUnselect = _d === void 0 ? false : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.closeOnSelect, closeOnSelect = _f === void 0 ? !multiple : _f, _g = _a.circularNavigation, circularNavigation = _g === void 0 ? false : _g, _h = _a.defaultOpen, defaultOpen = _h === void 0 ? false : _h, openProp = _a.open, _j = _a.size, size = _j === void 0 ? 'm' : _j, _k = _a.optionsSize, optionsSize = _k === void 0 ? 'm' : _k, _l = _a.fieldProps, fieldProps = _l === void 0 ? {} : _l, _m = _a.optionProps, optionProps = _m === void 0 ? {} : _m, _o = _a.optionsListProps, optionsListProps = _o === void 0 ? {} : _o, _p = _a.Arrow, Arrow = _p === void 0 ? components_arrow_Component.Arrow : _p, _q = _a.Field, Field = _q === void 0 ? components_field_Component.Field : _q, _r = _a.Optgroup, Optgroup = _r === void 0 ? components_optgroup_Component.Optgroup : _r, _s = _a.Option, Option = _s === void 0 ? components_option_Component.Option : _s, selected = _a.selected, options = _a.options, _t = _a.OptionsList, OptionsList = _t === void 0 ? options.length > VIRTUAL_OPTIONS_LIST_THRESHOLD
152
157
  ? components_virtualOptionsList_Component.VirtualOptionsList
153
- : components_optionsList_Component.OptionsList : _u, onChange = _a.onChange, _v = _a.showClear, showClear = _v === void 0 ? true : _v, showSelectAll = _a.showSelectAll, restProps = tslib.__rest(_a, ["autocomplete", "multiple", "allowUnselect", "disabled", "closeOnSelect", "circularNavigation", "defaultOpen", "open", "size", "optionsSize", "fieldProps", "optionProps", "optionsListProps", "Arrow", "Field", "Optgroup", "Option", "selected", "options", "OptionsList", "onChange", "showClear", "showSelectAll"]);
158
+ : components_optionsList_Component.OptionsList : _t, onChange = _a.onChange, _u = _a.showClear, showClear = _u === void 0 ? true : _u, showSelectAll = _a.showSelectAll, _v = _a.useWithApplyHook, useWithApplyHook = _v === void 0 ? multiple : _v, modalHeaderProps = _a.modalHeaderProps, showHeaderWithSelectAll = _a.showHeaderWithSelectAll, restProps = tslib.__rest(_a, ["autocomplete", "multiple", "allowUnselect", "disabled", "closeOnSelect", "circularNavigation", "defaultOpen", "open", "size", "optionsSize", "fieldProps", "optionProps", "optionsListProps", "Arrow", "Field", "Optgroup", "Option", "selected", "options", "OptionsList", "onChange", "showClear", "showSelectAll", "useWithApplyHook", "modalHeaderProps", "showHeaderWithSelectAll"]);
154
159
  var applyProps = useSelectWithApply({
155
160
  optionsListProps: tslib.__assign(tslib.__assign({}, optionsListProps), { Footer: components_baseSelectMobile_footer_Component.Footer }),
156
161
  OptionsList: OptionsList,
@@ -160,7 +165,7 @@ var SelectModalMobile = React.forwardRef(function (_a, ref) {
160
165
  showClear: showClear,
161
166
  showSelectAll: showSelectAll,
162
167
  });
163
- return (React__default.default.createElement(components_baseSelectMobile_Component.BaseSelectMobile, tslib.__assign({ ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: fieldProps, optionProps: optionProps, Arrow: Arrow, Field: Field, Optgroup: Optgroup, Option: Option, isBottomSheet: false, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList, optionsListProps: optionsListProps }, restProps, (multiple && !((_b = restProps.modalFooterProps) === null || _b === void 0 ? void 0 : _b.children) && applyProps))));
168
+ return (React__default.default.createElement(components_baseSelectMobile_Component.BaseSelectMobile, tslib.__assign({ ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: fieldProps, optionProps: optionProps, Arrow: Arrow, Field: Field, Optgroup: Optgroup, Option: Option, isBottomSheet: false, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList, optionsListProps: optionsListProps, modalHeaderProps: tslib.__assign({ bottomAddons: useWithApplyHook && showHeaderWithSelectAll && (React__default.default.createElement(presets_useSelectWithApply_optionsListWithApply_header_Component.Header, tslib.__assign({}, applyProps.optionsListProps.headerProps, { mobile: true }))) }, modalHeaderProps) }, restProps, (useWithApplyHook && applyProps))));
164
169
  });
165
170
 
166
171
  exports.OptionsListWithApply = OptionsListWithApply;
@@ -10,7 +10,7 @@ require('classnames');
10
10
  require('@alfalab/icons-glyph/ChevronDownMIcon');
11
11
  require('./components/arrow/index.module.css');
12
12
  require('./components/base-select/Component.js');
13
- var presets_useSelectWithApply_optionsListWithApply_Component = require('./Component-75d13e23.js');
13
+ var presets_useSelectWithApply_optionsListWithApply_Component = require('./Component-4727d474.js');
14
14
  require('@alfalab/core-components-form-control/cssm');
15
15
  require('./components/field/index.module.css');
16
16
  require('./components/optgroup/index.module.css');
@@ -39,6 +39,8 @@ require('@alfalab/core-components-popover/cssm');
39
39
  require('./getDataTestId-5c876d98.js');
40
40
  require('./components/native-select/Component.js');
41
41
  require('./components/base-select/index.module.css');
42
+ require('./presets/useSelectWithApply/options-list-with-apply/header/Component.js');
43
+ require('./presets/useSelectWithApply/options-list-with-apply/header/index.module.css');
42
44
  require('./components/base-select-mobile/Component.js');
43
45
  require('@alfalab/core-components-bottom-sheet/cssm');
44
46
  require('@alfalab/core-components-modal/cssm/mobile');
@@ -30,7 +30,7 @@ var BaseOption = function (_a) {
30
30
  return null;
31
31
  };
32
32
  return (React__default.default.createElement("div", tslib.__assign({}, innerProps, { className: cn__default.default(styles__default.default.option, className, (_b = {},
33
- _b[styles__default.default.highlighted] = highlighted,
33
+ _b[styles__default.default.highlighted] = !mobile && highlighted,
34
34
  _b[styles__default.default.selected] = selected,
35
35
  _b[styles__default.default.disabled] = disabled,
36
36
  _b[styles__default.default.textContent] = isTextContent,
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var components_arrow_Component = require('./arrow/Component.js');
6
6
  var components_baseSelect_Component = require('./base-select/Component.js');
7
- var presets_useSelectWithApply_optionsListWithApply_Component = require('../Component-75d13e23.js');
7
+ var presets_useSelectWithApply_optionsListWithApply_Component = require('../Component-4727d474.js');
8
8
  var components_field_Component = require('./field/Component.js');
9
9
  var components_optgroup_Component = require('./optgroup/Component.js');
10
10
  var components_option_Component = require('./option/Component.js');
@@ -26,6 +26,9 @@ require('../utils.js');
26
26
  require('./native-select/Component.js');
27
27
  require('./base-select/index.module.css');
28
28
  require('../Component.js');
29
+ require('../presets/useSelectWithApply/options-list-with-apply/header/Component.js');
30
+ require('@alfalab/core-components-checkbox/cssm');
31
+ require('../presets/useSelectWithApply/options-list-with-apply/header/index.module.css');
29
32
  require('./base-select-mobile/Component.js');
30
33
  require('@alfalab/core-components-bottom-sheet/cssm');
31
34
  require('@alfalab/core-components-modal/cssm/mobile');
@@ -38,7 +41,6 @@ require('@alfalab/core-components-form-control/cssm');
38
41
  require('./field/index.module.css');
39
42
  require('./optgroup/index.module.css');
40
43
  require('@alfalab/core-components-badge/cssm');
41
- require('@alfalab/core-components-checkbox/cssm');
42
44
  require('@alfalab/icons-glyph/CheckmarkCircleMIcon');
43
45
  require('@alfalab/icons-glyph/CheckmarkMIcon');
44
46
  require('./checkmark/index.module.css');
@@ -27,7 +27,7 @@ var Option = function (_a) {
27
27
  var content = children || option.content || option.key;
28
28
  var _f = option.showCheckMark, showCheckMark = _f === void 0 ? true : _f;
29
29
  return (React__default.default.createElement("div", tslib.__assign({}, innerProps, { className: cn__default.default(styles__default.default.option, styles__default.default[size], className, (_b = {},
30
- _b[styles__default.default.highlighted] = highlighted,
30
+ _b[styles__default.default.highlighted] = !mobile && highlighted,
31
31
  _b[styles__default.default.selected] = selected,
32
32
  _b[styles__default.default.disabled] = disabled,
33
33
  _b)), "data-test-id": dataTestId }),
@@ -4,7 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('tslib');
6
6
  require('react');
7
- var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-75d13e23.js');
7
+ var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-4727d474.js');
8
+ require('../../presets/useSelectWithApply/options-list-with-apply/header/Component.js');
8
9
  require('../arrow/Component.js');
9
10
  require('../base-select-mobile/Component.js');
10
11
  require('../base-select-mobile/footer/Component.js');
@@ -51,6 +52,7 @@ require('../../intersection-observer-9ec5cf59.js');
51
52
  require('../../presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
52
53
  require('@alfalab/core-components-button/cssm');
53
54
  require('../../presets/useSelectWithApply/options-list-with-apply/footer/index.module.css');
55
+ require('../../presets/useSelectWithApply/options-list-with-apply/header/index.module.css');
54
56
  require('@alfalab/core-components-bottom-sheet/cssm');
55
57
  require('@alfalab/core-components-modal/cssm/mobile');
56
58
  require('../base-select-mobile/index.module.css');
@@ -1 +1 @@
1
- export * from "../../Component-75d13e23";
1
+ export * from "../../Component-4727d474";
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-75d13e23.js');
5
+ var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-4727d474.js');
6
6
  require('tslib');
7
7
  require('react');
8
8
  require('../../Component.js');
@@ -39,6 +39,8 @@ require('../options-list/Component.js');
39
39
  require('@alfalab/core-components-scrollbar/cssm');
40
40
  require('../../consts.js');
41
41
  require('../options-list/index.module.css');
42
+ require('../../presets/useSelectWithApply/options-list-with-apply/header/Component.js');
43
+ require('../../presets/useSelectWithApply/options-list-with-apply/header/index.module.css');
42
44
  require('../base-select-mobile/Component.js');
43
45
  require('@alfalab/core-components-bottom-sheet/cssm');
44
46
  require('@alfalab/core-components-modal/cssm/mobile');
@@ -4,7 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('tslib');
6
6
  require('react');
7
- var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-75d13e23.js');
7
+ var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-4727d474.js');
8
+ require('../../presets/useSelectWithApply/options-list-with-apply/header/Component.js');
8
9
  require('../arrow/Component.js');
9
10
  require('../base-select-mobile/Component.js');
10
11
  require('../base-select-mobile/footer/Component.js');
@@ -51,6 +52,7 @@ require('../../intersection-observer-9ec5cf59.js');
51
52
  require('../../presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
52
53
  require('@alfalab/core-components-button/cssm');
53
54
  require('../../presets/useSelectWithApply/options-list-with-apply/footer/index.module.css');
55
+ require('../../presets/useSelectWithApply/options-list-with-apply/header/index.module.css');
54
56
  require('@alfalab/core-components-bottom-sheet/cssm');
55
57
  require('@alfalab/core-components-modal/cssm/mobile');
56
58
  require('../base-select-mobile/index.module.css');
@@ -1 +1 @@
1
- export * from "../../Component-75d13e23";
1
+ export * from "../../Component-4727d474";
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-75d13e23.js');
5
+ var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-4727d474.js');
6
6
  require('tslib');
7
7
  require('react');
8
8
  require('../../Component.js');
@@ -39,6 +39,8 @@ require('../options-list/Component.js');
39
39
  require('@alfalab/core-components-scrollbar/cssm');
40
40
  require('../../consts.js');
41
41
  require('../options-list/index.module.css');
42
+ require('../../presets/useSelectWithApply/options-list-with-apply/header/Component.js');
43
+ require('../../presets/useSelectWithApply/options-list-with-apply/header/index.module.css');
42
44
  require('../base-select-mobile/Component.js');
43
45
  require('@alfalab/core-components-bottom-sheet/cssm');
44
46
  require('@alfalab/core-components-modal/cssm/mobile');
@@ -29,17 +29,22 @@ type UseSelectWithApplyProps = {
29
29
  * Показывать пункт "Выбрать все"
30
30
  */
31
31
  showSelectAll?: boolean;
32
+ /**
33
+ * Показывать пункт "Выбрать все" в заголовке списка
34
+ */
35
+ showHeaderWithSelectAll?: boolean;
32
36
  };
33
37
  declare const SELECT_ALL_KEY = "select_all";
34
- declare function useSelectWithApply({ options, selected, onChange, OptionsList, optionsListProps, showClear, showSelectAll, }: UseSelectWithApplyProps): {
38
+ declare function useSelectWithApply({ options, selected, onChange, OptionsList, optionsListProps, showClear, showSelectAll, showHeaderWithSelectAll, }: UseSelectWithApplyProps): {
35
39
  OptionsList: import("react").ForwardRefExoticComponent<import("./index").OptionsListProps & {
36
40
  showClear?: boolean | undefined;
37
41
  onClose?: (() => void) | undefined;
38
42
  selectedDraft?: OptionShape[] | undefined;
39
- OptionsList?: import("react").FC<import("./index").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined; /**
40
- * Пропсы, которые будут прокинуты в компонент списка
41
- */
43
+ OptionsList?: import("react").FC<import("./index").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
42
44
  Footer?: import("react").FC<import("./presets/useSelectWithApply/options-list-with-apply/footer/Component").FooterProps> | undefined;
45
+ 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
+ showHeaderWithSelectAll?: boolean | undefined;
43
48
  } & import("react").RefAttributes<HTMLDivElement>>;
44
49
  optionsListProps: {
45
50
  OptionsList: import("react").FC<import("./index").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
@@ -48,6 +53,12 @@ declare function useSelectWithApply({ options, selected, onChange, OptionsList,
48
53
  onApply: () => void;
49
54
  onClose: () => void;
50
55
  selectedDraft: OptionShape[];
56
+ showHeaderWithSelectAll: boolean;
57
+ headerProps: {
58
+ indeterminate: boolean;
59
+ checked: boolean;
60
+ onChange: () => void;
61
+ };
51
62
  };
52
63
  allowUnselect: boolean;
53
64
  multiple: boolean;
package/cssm/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-75d13e23.js');
8
+ var presets_useSelectWithApply_optionsListWithApply_Component = require('./Component-4727d474.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');
@@ -28,6 +28,9 @@ require('@alfalab/hooks');
28
28
  require('./getDataTestId-5c876d98.js');
29
29
  require('./components/native-select/Component.js');
30
30
  require('./components/base-select/index.module.css');
31
+ require('./presets/useSelectWithApply/options-list-with-apply/header/Component.js');
32
+ require('@alfalab/core-components-checkbox/cssm');
33
+ require('./presets/useSelectWithApply/options-list-with-apply/header/index.module.css');
31
34
  require('./components/base-select-mobile/Component.js');
32
35
  require('@alfalab/core-components-bottom-sheet/cssm');
33
36
  require('@alfalab/core-components-modal/cssm/mobile');
@@ -40,7 +43,6 @@ require('@alfalab/core-components-form-control/cssm');
40
43
  require('./components/field/index.module.css');
41
44
  require('./components/optgroup/index.module.css');
42
45
  require('@alfalab/core-components-badge/cssm');
43
- require('@alfalab/core-components-checkbox/cssm');
44
46
  require('@alfalab/icons-glyph/CheckmarkCircleMIcon');
45
47
  require('@alfalab/icons-glyph/CheckmarkMIcon');
46
48
  require('./components/checkmark/index.module.css');
package/cssm/mobile.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var presets_useSelectWithApply_optionsListWithApply_Component = require('./Component-75d13e23.js');
5
+ var presets_useSelectWithApply_optionsListWithApply_Component = require('./Component-4727d474.js');
6
6
  require('tslib');
7
7
  require('react');
8
8
  require('./Component.js');
@@ -39,6 +39,8 @@ require('./components/options-list/Component.js');
39
39
  require('@alfalab/core-components-scrollbar/cssm');
40
40
  require('./consts.js');
41
41
  require('./components/options-list/index.module.css');
42
+ require('./presets/useSelectWithApply/options-list-with-apply/header/Component.js');
43
+ require('./presets/useSelectWithApply/options-list-with-apply/header/index.module.css');
42
44
  require('./components/base-select-mobile/Component.js');
43
45
  require('@alfalab/core-components-bottom-sheet/cssm');
44
46
  require('@alfalab/core-components-modal/cssm/mobile');
@@ -1,3 +1,3 @@
1
1
  export * from "./useSelectWithLoading/hook";
2
2
  export * from "./useLazyLoading/hook";
3
- export * from "../hook-4b555174";
3
+ export * from "../hook-b4e70cb0";
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var presets_useSelectWithLoading_hook = require('./useSelectWithLoading/hook.js');
6
6
  var presets_useLazyLoading_hook = require('./useLazyLoading/hook.js');
7
- var presets_useSelectWithApply_optionsListWithApply_Component = require('../Component-75d13e23.js');
7
+ var presets_useSelectWithApply_optionsListWithApply_Component = require('../Component-4727d474.js');
8
8
  require('tslib');
9
9
  require('react');
10
10
  require('@alfalab/core-components-skeleton/cssm');
@@ -45,6 +45,8 @@ require('../components/options-list/Component.js');
45
45
  require('@alfalab/core-components-scrollbar/cssm');
46
46
  require('../consts.js');
47
47
  require('../components/options-list/index.module.css');
48
+ require('./useSelectWithApply/options-list-with-apply/header/Component.js');
49
+ require('./useSelectWithApply/options-list-with-apply/header/index.module.css');
48
50
  require('../components/base-select-mobile/Component.js');
49
51
  require('@alfalab/core-components-bottom-sheet/cssm');
50
52
  require('@alfalab/core-components-modal/cssm/mobile');
@@ -9,7 +9,7 @@ require('classnames');
9
9
  require('@alfalab/icons-glyph/ChevronDownMIcon');
10
10
  require('../../components/arrow/index.module.css');
11
11
  require('../../components/base-select/Component.js');
12
- var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-75d13e23.js');
12
+ var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-4727d474.js');
13
13
  require('@alfalab/core-components-form-control/cssm');
14
14
  require('@alfalab/hooks');
15
15
  require('../../utils.js');
@@ -46,6 +46,8 @@ require('../../components/base-select/index.module.css');
46
46
  require('@alfalab/core-components-scrollbar/cssm');
47
47
  require('../../consts.js');
48
48
  require('../../components/options-list/index.module.css');
49
+ require('./options-list-with-apply/header/Component.js');
50
+ require('./options-list-with-apply/header/index.module.css');
49
51
  require('../../components/base-select-mobile/Component.js');
50
52
  require('@alfalab/core-components-bottom-sheet/cssm');
51
53
  require('@alfalab/core-components-modal/cssm/mobile');
@@ -6,8 +6,9 @@ require('tslib');
6
6
  require('react');
7
7
  require('../../../components/options-list/Component.js');
8
8
  require('../../../consts.js');
9
- var presets_useSelectWithApply_optionsListWithApply_Component = require('../../../Component-75d13e23.js');
9
+ var presets_useSelectWithApply_optionsListWithApply_Component = require('../../../Component-4727d474.js');
10
10
  require('./footer/Component.js');
11
+ require('./header/Component.js');
11
12
  require('react-merge-refs');
12
13
  require('classnames');
13
14
  require('@alfalab/core-components-scrollbar/cssm');
@@ -58,6 +59,7 @@ require('../../useSelectWithLoading/index.module.css');
58
59
  require('../../useLazyLoading/index.module.css');
59
60
  require('../../../intersection-observer-9ec5cf59.js');
60
61
  require('./footer/index.module.css');
62
+ require('./header/index.module.css');
61
63
 
62
64
 
63
65
 
@@ -16,15 +16,6 @@
16
16
  --gap-s: 12px;
17
17
  } :root {
18
18
  } :root {
19
- } :root {
20
-
21
- /* options list */
22
-
23
- /* option */
24
-
25
- /* checkmark */
26
-
27
- /* optgroup */
28
19
  } .footer {
29
20
  background-color: var(--color-light-bg-primary);
30
21
  padding: var(--gap-s);
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { CheckboxProps } from "@alfalab/core-components-checkbox";
4
+ type HeaderProps = {
5
+ checked?: boolean;
6
+ indeterminate?: boolean;
7
+ onChange?: CheckboxProps['onChange'];
8
+ mobile?: boolean;
9
+ };
10
+ declare const Header: React.FC<HeaderProps>;
11
+ export { HeaderProps, Header };
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var cn = require('classnames');
7
+ var coreComponentsCheckbox = require('@alfalab/core-components-checkbox/cssm');
8
+ var styles = require('./index.module.css');
9
+
10
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
11
+
12
+ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
13
+ var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
14
+ var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
15
+
16
+ var Header = function (_a) {
17
+ var _b;
18
+ var onChange = _a.onChange, checked = _a.checked, indeterminate = _a.indeterminate, mobile = _a.mobile;
19
+ return (React__default.default.createElement("div", { className: cn__default.default((_b = {}, _b[styles__default.default.desktop] = !mobile, _b[styles__default.default.mobile] = mobile, _b)) },
20
+ React__default.default.createElement(coreComponentsCheckbox.Checkbox, { block: true, indeterminate: indeterminate, size: 'm', onChange: onChange, checked: checked, label: '\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435' })));
21
+ };
22
+
23
+ exports.Header = Header;
@@ -0,0 +1,22 @@
1
+ :root {
2
+ } /* 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 */
3
+ } :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 */
4
+ } :root {
5
+ } :root {
6
+
7
+ /* Hard */
8
+
9
+ /* Up */
10
+
11
+ /* Hard up */
12
+ } :root {
13
+ } :root {
14
+ --gap-xs: 8px;
15
+ --gap-s: 12px;
16
+ } :root {
17
+ } :root {
18
+ } .desktop {
19
+ padding: var(--gap-s);
20
+ } .mobile {
21
+ padding: var(--gap-s) var(--gap-xs);
22
+ }
@@ -1 +1 @@
1
- export * from "../../../Component-75d13e23";
1
+ export * from "../../../Component-4727d474";
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var presets_useSelectWithApply_optionsListWithApply_Component = require('../../../Component-75d13e23.js');
5
+ var presets_useSelectWithApply_optionsListWithApply_Component = require('../../../Component-4727d474.js');
6
6
  require('tslib');
7
7
  require('react');
8
8
  require('../../../Component.js');
@@ -39,6 +39,8 @@ require('../../../components/options-list/Component.js');
39
39
  require('@alfalab/core-components-scrollbar/cssm');
40
40
  require('../../../consts.js');
41
41
  require('../../../components/options-list/index.module.css');
42
+ require('./header/Component.js');
43
+ require('./header/index.module.css');
42
44
  require('../../../components/base-select-mobile/Component.js');
43
45
  require('@alfalab/core-components-bottom-sheet/cssm');
44
46
  require('@alfalab/core-components-modal/cssm/mobile');