@alfalab/core-components-select 17.7.2 → 17.8.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 (145) hide show
  1. package/components/arrow/Component.js +1 -1
  2. package/components/arrow/index.css +3 -3
  3. package/components/base-checkmark/Component.js +1 -1
  4. package/components/base-checkmark/index.css +6 -6
  5. package/components/base-option/Component.js +1 -1
  6. package/components/base-option/index.css +15 -15
  7. package/components/base-select/Component.js +4 -4
  8. package/components/base-select/index.css +11 -11
  9. package/components/base-select/mobile.css +12 -12
  10. package/components/checkmark/Component.js +1 -1
  11. package/components/checkmark/index.css +10 -10
  12. package/components/checkmark-mobile/Component.js +1 -1
  13. package/components/checkmark-mobile/index.css +6 -6
  14. package/components/field/Component.js +1 -1
  15. package/components/field/index.css +12 -12
  16. package/components/footer/Component.js +1 -1
  17. package/components/footer/index.css +5 -5
  18. package/components/optgroup/Component.js +1 -1
  19. package/components/optgroup/index.css +6 -6
  20. package/components/option/Component.js +1 -1
  21. package/components/option/index.css +19 -19
  22. package/components/options-list/Component.js +14 -5
  23. package/components/options-list/index.css +10 -10
  24. package/components/search/Component.js +1 -1
  25. package/components/search/index.css +2 -2
  26. package/components/virtual-options-list/Component.js +1 -1
  27. package/components/virtual-options-list/index.css +15 -15
  28. package/cssm/components/base-select/Component.js +2 -2
  29. package/cssm/components/options-list/Component.js +13 -4
  30. package/cssm/typings.d.ts +8 -0
  31. package/cssm/utils.d.ts +14 -2
  32. package/cssm/utils.js +26 -4
  33. package/esm/components/arrow/Component.js +1 -1
  34. package/esm/components/arrow/index.css +3 -3
  35. package/esm/components/base-checkmark/Component.js +1 -1
  36. package/esm/components/base-checkmark/index.css +6 -6
  37. package/esm/components/base-option/Component.js +1 -1
  38. package/esm/components/base-option/index.css +15 -15
  39. package/esm/components/base-select/Component.js +4 -4
  40. package/esm/components/base-select/index.css +11 -11
  41. package/esm/components/base-select/mobile.css +12 -12
  42. package/esm/components/checkmark/Component.js +1 -1
  43. package/esm/components/checkmark/index.css +10 -10
  44. package/esm/components/checkmark-mobile/Component.js +1 -1
  45. package/esm/components/checkmark-mobile/index.css +6 -6
  46. package/esm/components/field/Component.js +1 -1
  47. package/esm/components/field/index.css +12 -12
  48. package/esm/components/footer/Component.js +1 -1
  49. package/esm/components/footer/index.css +5 -5
  50. package/esm/components/optgroup/Component.js +1 -1
  51. package/esm/components/optgroup/index.css +6 -6
  52. package/esm/components/option/Component.js +1 -1
  53. package/esm/components/option/index.css +19 -19
  54. package/esm/components/options-list/Component.js +14 -5
  55. package/esm/components/options-list/index.css +10 -10
  56. package/esm/components/search/Component.js +1 -1
  57. package/esm/components/search/index.css +2 -2
  58. package/esm/components/virtual-options-list/Component.js +1 -1
  59. package/esm/components/virtual-options-list/index.css +15 -15
  60. package/esm/mobile/Component.mobile.js +1 -1
  61. package/esm/presets/index.js +1 -1
  62. package/esm/presets/useSelectWithApply/hook.js +1 -1
  63. package/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
  64. package/esm/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
  65. package/esm/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -3
  66. package/esm/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
  67. package/esm/presets/useSelectWithApply/options-list-with-apply/header/index.css +3 -3
  68. package/esm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  69. package/esm/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
  70. package/esm/presets/useSelectWithLoading/hook.js +1 -1
  71. package/esm/presets/useSelectWithLoading/index.css +2 -2
  72. package/esm/shared/index.js +1 -1
  73. package/esm/typings.d.ts +8 -0
  74. package/esm/utils.d.ts +14 -2
  75. package/esm/utils.js +26 -4
  76. package/mobile/Component.mobile.js +1 -1
  77. package/modern/components/arrow/Component.js +1 -1
  78. package/modern/components/arrow/index.css +3 -3
  79. package/modern/components/base-checkmark/Component.js +1 -1
  80. package/modern/components/base-checkmark/index.css +6 -6
  81. package/modern/components/base-option/Component.js +1 -1
  82. package/modern/components/base-option/index.css +15 -15
  83. package/modern/components/base-select/Component.js +4 -4
  84. package/modern/components/base-select/index.css +11 -11
  85. package/modern/components/base-select/mobile.css +12 -12
  86. package/modern/components/checkmark/Component.js +1 -1
  87. package/modern/components/checkmark/index.css +10 -10
  88. package/modern/components/checkmark-mobile/Component.js +1 -1
  89. package/modern/components/checkmark-mobile/index.css +6 -6
  90. package/modern/components/field/Component.js +1 -1
  91. package/modern/components/field/index.css +12 -12
  92. package/modern/components/footer/Component.js +1 -1
  93. package/modern/components/footer/index.css +5 -5
  94. package/modern/components/optgroup/Component.js +1 -1
  95. package/modern/components/optgroup/index.css +6 -6
  96. package/modern/components/option/Component.js +1 -1
  97. package/modern/components/option/index.css +19 -19
  98. package/modern/components/options-list/Component.js +14 -3
  99. package/modern/components/options-list/index.css +10 -10
  100. package/modern/components/search/Component.js +1 -1
  101. package/modern/components/search/index.css +2 -2
  102. package/modern/components/virtual-options-list/Component.js +1 -1
  103. package/modern/components/virtual-options-list/index.css +15 -15
  104. package/modern/mobile/Component.mobile.js +1 -1
  105. package/modern/presets/index.js +1 -1
  106. package/modern/presets/useSelectWithApply/hook.js +1 -1
  107. package/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
  108. package/modern/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
  109. package/modern/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -3
  110. package/modern/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
  111. package/modern/presets/useSelectWithApply/options-list-with-apply/header/index.css +3 -3
  112. package/modern/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  113. package/modern/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
  114. package/modern/presets/useSelectWithLoading/hook.js +1 -1
  115. package/modern/presets/useSelectWithLoading/index.css +2 -2
  116. package/modern/shared/index.js +1 -1
  117. package/modern/typings.d.ts +8 -0
  118. package/modern/utils.d.ts +14 -2
  119. package/modern/utils.js +24 -4
  120. package/package.json +1 -1
  121. package/presets/index.js +1 -1
  122. package/presets/useSelectWithApply/hook.js +1 -1
  123. package/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
  124. package/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
  125. package/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -3
  126. package/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
  127. package/presets/useSelectWithApply/options-list-with-apply/header/index.css +3 -3
  128. package/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
  129. package/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
  130. package/presets/useSelectWithLoading/hook.js +1 -1
  131. package/presets/useSelectWithLoading/index.css +2 -2
  132. package/shared/index.js +1 -1
  133. package/src/components/base-select/Component.tsx +2 -0
  134. package/src/components/options-list/Component.tsx +15 -1
  135. package/src/typings.ts +10 -0
  136. package/src/utils.ts +55 -4
  137. package/typings.d.ts +8 -0
  138. package/utils.d.ts +14 -2
  139. package/utils.js +26 -4
  140. /package/esm/{hook-2fdebc58.d.ts → hook-b42228ca.d.ts} +0 -0
  141. /package/esm/{hook-2fdebc58.js → hook-b42228ca.js} +0 -0
  142. /package/{hook-d6f8155c.d.ts → hook-444814cb.d.ts} +0 -0
  143. /package/{hook-d6f8155c.js → hook-444814cb.js} +0 -0
  144. /package/modern/{hook-2da7ff47.d.ts → hook-73b8c736.d.ts} +0 -0
  145. /package/modern/{hook-2da7ff47.js → hook-73b8c736.js} +0 -0
@@ -11,7 +11,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
11
11
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
12
12
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
13
13
 
14
- var styles = {"desktop":"select__desktop_g5yh6","mobile":"select__mobile_g5yh6"};
14
+ var styles = {"desktop":"select__desktop_1fek2","mobile":"select__mobile_1fek2"};
15
15
  require('./index.css')
16
16
 
17
17
  var Header = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 1y4tx */
1
+ /* hash: 15sk7 */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* 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 */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* 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 */
@@ -16,8 +16,8 @@
16
16
  --gap-s: 12px;
17
17
  } :root {
18
18
  } :root {
19
- } .select__desktop_g5yh6 {
19
+ } .select__desktop_1fek2 {
20
20
  padding: var(--gap-s);
21
- } .select__mobile_g5yh6 {
21
+ } .select__mobile_1fek2 {
22
22
  padding: var(--gap-s) var(--gap-xs);
23
23
  }
@@ -1 +1 @@
1
- export * from "../../../hook-d6f8155c";
1
+ export * from "../../../hook-444814cb";
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var presets_useSelectWithApply_optionsListWithApply_Component = require('../../../hook-d6f8155c.js');
5
+ var presets_useSelectWithApply_optionsListWithApply_Component = require('../../../hook-444814cb.js');
6
6
 
7
7
 
8
8
 
@@ -11,7 +11,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
11
11
 
12
12
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
13
13
 
14
- var styles = {"skeleton":"select__skeleton_1x68k"};
14
+ var styles = {"skeleton":"select__skeleton_1q5vb"};
15
15
  require('./index.css')
16
16
 
17
17
  function useSelectWithLoading(_a) {
@@ -1,5 +1,5 @@
1
- /* hash: 8y9x1 */
2
- .select__skeleton_1x68k {
1
+ /* hash: 1c1ti */
2
+ .select__skeleton_1q5vb {
3
3
  position: absolute;
4
4
  top: 50%;
5
5
  transform: translateY(-50%);
package/shared/index.js CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var presets_useSelectWithLoading_hook = require('../presets/useSelectWithLoading/hook.js');
6
6
  var presets_useLazyLoading_hook = require('../presets/useLazyLoading/hook.js');
7
- var presets_useSelectWithApply_optionsListWithApply_Component = require('../hook-d6f8155c.js');
7
+ var presets_useSelectWithApply_optionsListWithApply_Component = require('../hook-444814cb.js');
8
8
  var utils = require('../utils.js');
9
9
  var components_option_Component = require('../components/option/Component.js');
10
10
  var components_baseOption_Component = require('../components/base-option/Component.js');
@@ -148,6 +148,7 @@ export const BaseSelect = forwardRef(
148
148
  Popover,
149
149
  ModalMobile,
150
150
  BottomSheet,
151
+ limitDynamicOptionGroupSize,
151
152
  }: ComponentProps,
152
153
  ref,
153
154
  ) => {
@@ -660,6 +661,7 @@ export const BaseSelect = forwardRef(
660
661
  onScroll={onScroll}
661
662
  search={search}
662
663
  multiple={multiple}
664
+ limitDynamicOptionGroupSize={limitDynamicOptionGroupSize}
663
665
  />
664
666
  {view === 'desktop' && <div className={styles.optionsListBorder} />}
665
667
  </div>
@@ -47,6 +47,7 @@ export const OptionsList = forwardRef<HTMLDivElement, OptionsListProps>(
47
47
  search,
48
48
  setSelectedItems,
49
49
  multiple,
50
+ limitDynamicOptionGroupSize = false,
50
51
  },
51
52
  ref,
52
53
  ) => {
@@ -116,7 +117,20 @@ export const OptionsList = forwardRef<HTMLDivElement, OptionsListProps>(
116
117
  visibleOptions,
117
118
  listRef,
118
119
  open,
119
- invalidate: options,
120
+ options,
121
+ actualOptionsCount: limitDynamicOptionGroupSize,
122
+ size: limitDynamicOptionGroupSize
123
+ ? (() => {
124
+ switch (typeof size) {
125
+ case 'string':
126
+ throw new Error(
127
+ 'OptionsList with `limitDynamicOptionGroupSize` enabled needs a `size` with number type',
128
+ );
129
+ default:
130
+ return size;
131
+ }
132
+ })()
133
+ : undefined,
120
134
  });
121
135
 
122
136
  if (options.length === 0 && !emptyPlaceholder && !header && !footer) {
package/src/typings.ts CHANGED
@@ -365,6 +365,11 @@ export type BaseSelectProps = {
365
365
  | 'preventFlip'
366
366
  | 'dataTestId'
367
367
  >;
368
+
369
+ /**
370
+ * Ограничение динамического размера группы вариантов выбора
371
+ */
372
+ limitDynamicOptionGroupSize?: boolean;
368
373
  };
369
374
 
370
375
  // TODO: использовать InputProps
@@ -626,6 +631,11 @@ export type OptionsListProps = {
626
631
  * Возможность выбрать несколько значений
627
632
  */
628
633
  multiple?: boolean;
634
+
635
+ /**
636
+ * Ограничение динамического размера группы вариантов выбора
637
+ */
638
+ limitDynamicOptionGroupSize?: BaseSelectProps['limitDynamicOptionGroupSize'];
629
639
  };
630
640
 
631
641
  export type OptgroupProps = {
package/src/utils.ts CHANGED
@@ -2,7 +2,7 @@ import { cloneElement, isValidElement, ReactNode, RefObject, useEffect, useRef }
2
2
 
3
3
  import { getDataTestId } from '@alfalab/core-components-shared';
4
4
 
5
- import { BaseSelectProps, GroupShape, OptionShape } from './typings';
5
+ import { BaseSelectProps, GroupShape, OptionShape, OptionsListProps } from './typings';
6
6
 
7
7
  export const isGroup = (item: OptionShape | GroupShape): item is GroupShape =>
8
8
  Object.prototype.hasOwnProperty.call(item, 'options');
@@ -127,6 +127,21 @@ type useVisibleOptionsArgs = {
127
127
  * Позволяет вызвать пересчет высоты
128
128
  */
129
129
  invalidate?: unknown;
130
+
131
+ /**
132
+ * Список вариантов выбора
133
+ */
134
+ options?: Array<OptionShape | GroupShape>;
135
+
136
+ /**
137
+ * Максимальный размер варианта выбора
138
+ */
139
+ size?: Extract<OptionsListProps['size'], number>;
140
+
141
+ /**
142
+ * Учитывать действительное число вариантов выбора
143
+ */
144
+ actualOptionsCount?: boolean;
130
145
  };
131
146
 
132
147
  export function useVisibleOptions({
@@ -135,8 +150,14 @@ export function useVisibleOptions({
135
150
  styleTargetRef = listRef,
136
151
  open,
137
152
  invalidate,
153
+ options,
154
+ size,
155
+ actualOptionsCount,
138
156
  }: useVisibleOptionsArgs) {
139
157
  useEffect(() => {
158
+ const measureOptionHeight = (element: HTMLElement) =>
159
+ typeof size === 'number' ? Math.min(element.clientHeight, size) : element.clientHeight;
160
+
140
161
  const list = listRef.current;
141
162
  const styleTarget = styleTargetRef.current;
142
163
 
@@ -150,10 +171,12 @@ export function useVisibleOptions({
150
171
 
151
172
  let height = optionsNodes
152
173
  .slice(0, visibleOptions)
153
- .reduce((acc, child) => acc + child.clientHeight, 0);
174
+ .reduce((acc, child) => acc + measureOptionHeight(child), 0);
154
175
 
155
176
  if (visibleOptions < childCount) {
156
- const lastVisibleOptionHeight = optionsNodes[optionsNodes.length - 1].clientHeight;
177
+ const lastVisibleOptionHeight = measureOptionHeight(
178
+ optionsNodes[optionsNodes.length - 1],
179
+ );
157
180
 
158
181
  // Если кол-во опций больше visibleOptions на 1, то показываем все опции, иначе добавляем половинку
159
182
  height += Math.round(
@@ -161,11 +184,39 @@ export function useVisibleOptions({
161
184
  ? lastVisibleOptionHeight
162
185
  : lastVisibleOptionHeight / 2,
163
186
  );
187
+ } else if (
188
+ visibleOptions > childCount &&
189
+ actualOptionsCount &&
190
+ typeof size === 'number'
191
+ ) {
192
+ const actualCount = (options ?? []).reduce(
193
+ (sum, option) => sum + 1 + (isGroup(option) ? option.options.length : 0),
194
+ 0,
195
+ );
196
+
197
+ height =
198
+ Math.min(
199
+ actualCount === 0 ? /** empty placeholder */ 1 : actualCount,
200
+ visibleOptions,
201
+ ) * size;
202
+
203
+ if (visibleOptions < actualCount) {
204
+ height += size / 2;
205
+ }
164
206
  }
165
207
 
166
208
  styleTarget.style.height = `${height}px`;
167
209
  }
168
- }, [listRef, open, styleTargetRef, visibleOptions, invalidate]);
210
+ }, [
211
+ actualOptionsCount,
212
+ listRef,
213
+ open,
214
+ options,
215
+ size,
216
+ styleTargetRef,
217
+ visibleOptions,
218
+ invalidate,
219
+ ]);
169
220
  }
170
221
 
171
222
  export function defaultFilterFn(optionText: string, search: string) {
package/typings.d.ts CHANGED
@@ -279,6 +279,10 @@ type BaseSelectProps = {
279
279
  * Дополнительные пропсы для Popover
280
280
  */
281
281
  popoverProps?: Omit<PopoverProps, 'update' | 'zIndex' | 'position' | 'className' | 'open' | 'anchorElement' | 'preventFlip' | 'dataTestId'>;
282
+ /**
283
+ * Ограничение динамического размера группы вариантов выбора
284
+ */
285
+ limitDynamicOptionGroupSize?: boolean;
282
286
  };
283
287
  type FieldProps = {
284
288
  /**
@@ -489,6 +493,10 @@ type OptionsListProps = {
489
493
  * Возможность выбрать несколько значений
490
494
  */
491
495
  multiple?: boolean;
496
+ /**
497
+ * Ограничение динамического размера группы вариантов выбора
498
+ */
499
+ limitDynamicOptionGroupSize?: BaseSelectProps['limitDynamicOptionGroupSize'];
492
500
  };
493
501
  type OptgroupProps = {
494
502
  /**
package/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ReactNode, RefObject } from 'react';
2
- import { BaseSelectProps, GroupShape, OptionShape } from "./typings";
2
+ import { BaseSelectProps, GroupShape, OptionShape, OptionsListProps } from "./typings";
3
3
  declare const isGroup: (item: OptionShape | GroupShape) => item is GroupShape;
4
4
  declare const isOptionShape: (item: OptionShape | string | null) => item is OptionShape;
5
5
  declare const joinOptions: ({ selected, selectedMultiple, }: {
@@ -32,8 +32,20 @@ type useVisibleOptionsArgs = {
32
32
  * Позволяет вызвать пересчет высоты
33
33
  */
34
34
  invalidate?: unknown;
35
+ /**
36
+ * Список вариантов выбора
37
+ */
38
+ options?: Array<OptionShape | GroupShape>;
39
+ /**
40
+ * Максимальный размер варианта выбора
41
+ */
42
+ size?: Extract<OptionsListProps['size'], number>;
43
+ /**
44
+ * Учитывать действительное число вариантов выбора
45
+ */
46
+ actualOptionsCount?: boolean;
35
47
  };
36
- declare function useVisibleOptions({ visibleOptions, listRef, styleTargetRef, open, invalidate, }: useVisibleOptionsArgs): void;
48
+ declare function useVisibleOptions({ visibleOptions, listRef, styleTargetRef, open, invalidate, options, size, actualOptionsCount, }: useVisibleOptionsArgs): void;
37
49
  declare function defaultFilterFn(optionText: string, search: string): boolean;
38
50
  declare function defaultGroupAccessor(option: GroupShape): string | undefined;
39
51
  declare function defaultAccessor(option: OptionShape): string;
package/utils.js CHANGED
@@ -79,8 +79,11 @@ function processOptions(options, selected, filterFn, filterGroup) {
79
79
  return { filteredOptions: filteredOptions, flatOptions: flatOptions, selectedOptions: selectedOptions };
80
80
  }
81
81
  function useVisibleOptions(_a) {
82
- var visibleOptions = _a.visibleOptions, listRef = _a.listRef, _b = _a.styleTargetRef, styleTargetRef = _b === void 0 ? listRef : _b, open = _a.open, invalidate = _a.invalidate;
82
+ var visibleOptions = _a.visibleOptions, listRef = _a.listRef, _b = _a.styleTargetRef, styleTargetRef = _b === void 0 ? listRef : _b, open = _a.open, invalidate = _a.invalidate, options = _a.options, size = _a.size, actualOptionsCount = _a.actualOptionsCount;
83
83
  React.useEffect(function () {
84
+ var measureOptionHeight = function (element) {
85
+ return typeof size === 'number' ? Math.min(element.clientHeight, size) : element.clientHeight;
86
+ };
84
87
  var list = listRef.current;
85
88
  var styleTarget = styleTargetRef.current;
86
89
  if (open && list && styleTarget && visibleOptions > 0) {
@@ -88,17 +91,36 @@ function useVisibleOptions(_a) {
88
91
  var optionsNodes = [].slice.call(list.children, 0, visibleOptions + 1);
89
92
  var height = optionsNodes
90
93
  .slice(0, visibleOptions)
91
- .reduce(function (acc, child) { return acc + child.clientHeight; }, 0);
94
+ .reduce(function (acc, child) { return acc + measureOptionHeight(child); }, 0);
92
95
  if (visibleOptions < childCount) {
93
- var lastVisibleOptionHeight = optionsNodes[optionsNodes.length - 1].clientHeight;
96
+ var lastVisibleOptionHeight = measureOptionHeight(optionsNodes[optionsNodes.length - 1]);
94
97
  // Если кол-во опций больше visibleOptions на 1, то показываем все опции, иначе добавляем половинку
95
98
  height += Math.round(childCount - visibleOptions === 1
96
99
  ? lastVisibleOptionHeight
97
100
  : lastVisibleOptionHeight / 2);
98
101
  }
102
+ else if (visibleOptions > childCount &&
103
+ actualOptionsCount &&
104
+ typeof size === 'number') {
105
+ var actualCount = (options !== null && options !== void 0 ? options : []).reduce(function (sum, option) { return sum + 1 + (isGroup(option) ? option.options.length : 0); }, 0);
106
+ height =
107
+ Math.min(actualCount === 0 ? /** empty placeholder */ 1 : actualCount, visibleOptions) * size;
108
+ if (visibleOptions < actualCount) {
109
+ height += size / 2;
110
+ }
111
+ }
99
112
  styleTarget.style.height = "".concat(height, "px");
100
113
  }
101
- }, [listRef, open, styleTargetRef, visibleOptions, invalidate]);
114
+ }, [
115
+ actualOptionsCount,
116
+ listRef,
117
+ open,
118
+ options,
119
+ size,
120
+ styleTargetRef,
121
+ visibleOptions,
122
+ invalidate,
123
+ ]);
102
124
  }
103
125
  function defaultFilterFn(optionText, search) {
104
126
  if (!search)
File without changes
File without changes
File without changes
File without changes
File without changes