@alfalab/core-components-select 17.21.2 → 17.21.4
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.
- package/components/arrow/Component.js +1 -1
- package/components/arrow/index.css +5 -5
- package/components/base-checkmark/Component.js +1 -1
- package/components/base-checkmark/index.css +6 -6
- package/components/base-option/Component.js +4 -3
- package/components/base-option/index.css +20 -15
- package/components/base-select/Component.js +4 -3
- package/components/base-select/components/list-desktop/list-popover-desktop.js +1 -1
- package/components/base-select/components/list-mobile/list-bottom-sheet-mobile.js +1 -1
- package/components/base-select/components/list-mobile/list-modal-mobile.js +1 -1
- package/components/base-select/index.css +17 -12
- package/components/base-select/mobile.css +12 -12
- package/components/checkmark/Component.js +1 -1
- package/components/checkmark/index.css +10 -10
- package/components/checkmark-mobile/Component.js +1 -1
- package/components/checkmark-mobile/index.css +6 -6
- package/components/clear-button/Component.js +1 -1
- package/components/clear-button/index.css +5 -5
- package/components/field/Component.js +1 -1
- package/components/field/index.css +14 -14
- package/components/footer/Component.js +1 -1
- package/components/footer/index.css +5 -5
- package/components/optgroup/Component.js +1 -1
- package/components/optgroup/index.css +5 -6
- package/components/option/desktop/Component.js +1 -1
- package/components/option/desktop/index.css +21 -22
- package/components/option/mobile/Component.js +1 -1
- package/components/option/mobile/index.css +18 -19
- package/components/options-list/Component.js +12 -5
- package/components/options-list/index.css +10 -11
- package/components/search/Component.js +1 -1
- package/components/search/index.css +2 -2
- package/components/virtual-options-list/Component.js +1 -1
- package/components/virtual-options-list/index.css +14 -15
- package/cssm/components/base-option/Component.js +3 -2
- package/cssm/components/base-option/index.module.css +7 -2
- package/cssm/components/base-select/Component.js +2 -1
- package/cssm/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.d.ts +1 -1
- package/cssm/components/base-select/index.module.css +7 -2
- package/cssm/components/optgroup/index.module.css +1 -2
- package/cssm/components/option/desktop/index.module.css +2 -3
- package/cssm/components/option/index.module.css +2 -3
- package/cssm/components/option/mobile/index.module.css +2 -3
- package/cssm/components/options-list/Component.js +11 -4
- package/cssm/components/options-list/index.module.css +1 -2
- package/cssm/components/virtual-options-list/index.module.css +1 -2
- package/{hook-5412b662.js → cssm/hook-7f1b6f47.js} +3 -3
- package/cssm/mobile/Component.mobile.js +1 -1
- package/cssm/presets/index.js +1 -1
- package/cssm/presets/useSelectWithApply/hook.js +1 -1
- package/cssm/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
- package/cssm/presets/useSelectWithApply/options-list-with-apply/footer/Component.d.ts +3 -2
- package/cssm/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +5 -2
- package/cssm/presets/useSelectWithApply/options-list-with-apply/footer/index.module.css +6 -2
- package/cssm/presets/useSelectWithApply/options-list-with-apply/header/Component.d.ts +2 -0
- package/cssm/presets/useSelectWithApply/options-list-with-apply/header/Component.js +6 -2
- package/cssm/presets/useSelectWithApply/options-list-with-apply/header/index.module.css +7 -3
- package/cssm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/cssm/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
- package/cssm/shared/index.js +1 -1
- package/cssm/utils.d.ts +1 -1
- package/cssm/utils.js +12 -24
- package/esm/components/arrow/Component.js +1 -1
- package/esm/components/arrow/index.css +5 -5
- package/esm/components/base-checkmark/Component.js +1 -1
- package/esm/components/base-checkmark/index.css +6 -6
- package/esm/components/base-option/Component.js +4 -3
- package/esm/components/base-option/index.css +20 -15
- package/esm/components/base-select/Component.js +4 -3
- package/esm/components/base-select/components/list-desktop/list-popover-desktop.js +1 -1
- package/esm/components/base-select/components/list-mobile/list-bottom-sheet-mobile.js +1 -1
- package/esm/components/base-select/components/list-mobile/list-modal-mobile.js +1 -1
- package/esm/components/base-select/index.css +17 -12
- package/esm/components/base-select/mobile.css +12 -12
- package/esm/components/checkmark/Component.js +1 -1
- package/esm/components/checkmark/index.css +10 -10
- package/esm/components/checkmark-mobile/Component.js +1 -1
- package/esm/components/checkmark-mobile/index.css +6 -6
- package/esm/components/clear-button/Component.js +1 -1
- package/esm/components/clear-button/index.css +5 -5
- package/esm/components/field/Component.js +1 -1
- package/esm/components/field/index.css +14 -14
- package/esm/components/footer/Component.js +1 -1
- package/esm/components/footer/index.css +5 -5
- package/esm/components/optgroup/Component.js +1 -1
- package/esm/components/optgroup/index.css +5 -6
- package/esm/components/option/desktop/Component.js +1 -1
- package/esm/components/option/desktop/index.css +21 -22
- package/esm/components/option/mobile/Component.js +1 -1
- package/esm/components/option/mobile/index.css +18 -19
- package/esm/components/options-list/Component.js +12 -5
- package/esm/components/options-list/index.css +10 -11
- package/esm/components/search/Component.js +1 -1
- package/esm/components/search/index.css +2 -2
- package/esm/components/virtual-options-list/Component.js +1 -1
- package/esm/components/virtual-options-list/index.css +14 -15
- package/esm/{hook-e9905b00.js → hook-56374bc2.js} +3 -3
- package/esm/{list-popover-desktop-d8567402.js → list-popover-desktop-d897cee0.js} +1 -1
- package/esm/mobile/Component.mobile.js +1 -1
- package/esm/mobile.module-ebe00eaa.js +4 -0
- package/esm/presets/index.js +1 -1
- package/esm/presets/useSelectWithApply/hook.js +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/footer/Component.d.ts +3 -2
- package/esm/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +5 -3
- package/esm/presets/useSelectWithApply/options-list-with-apply/footer/index.css +8 -4
- package/esm/presets/useSelectWithApply/options-list-with-apply/header/Component.d.ts +2 -0
- package/esm/presets/useSelectWithApply/options-list-with-apply/header/Component.js +7 -3
- package/esm/presets/useSelectWithApply/options-list-with-apply/header/index.css +9 -5
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
- package/esm/presets/useSelectWithLoading/hook.js +1 -1
- package/esm/presets/useSelectWithLoading/index.css +2 -2
- package/esm/shared/index.js +1 -1
- package/esm/utils.d.ts +1 -1
- package/esm/utils.js +12 -24
- package/{cssm/hook-42ec365f.js → hook-7eb4a9bb.js} +3 -3
- package/{list-popover-desktop-d6bb8493.js → list-popover-desktop-b51713d2.js} +1 -1
- package/mobile/Component.mobile.js +1 -1
- package/mobile.module-a01cc277.js +6 -0
- package/modern/components/arrow/Component.js +1 -1
- package/modern/components/arrow/index.css +5 -5
- package/modern/components/base-checkmark/Component.js +1 -1
- package/modern/components/base-checkmark/index.css +6 -6
- package/modern/components/base-option/Component.js +4 -3
- package/modern/components/base-option/index.css +20 -15
- package/modern/components/base-select/Component.js +4 -3
- package/modern/components/base-select/components/list-desktop/list-popover-desktop.js +1 -1
- package/modern/components/base-select/components/list-mobile/list-bottom-sheet-mobile.js +1 -1
- package/modern/components/base-select/components/list-mobile/list-modal-mobile.js +1 -1
- package/modern/components/base-select/index.css +17 -12
- package/modern/components/base-select/mobile.css +12 -12
- package/modern/components/checkmark/Component.js +1 -1
- package/modern/components/checkmark/index.css +10 -10
- package/modern/components/checkmark-mobile/Component.js +1 -1
- package/modern/components/checkmark-mobile/index.css +6 -6
- package/modern/components/clear-button/Component.js +1 -1
- package/modern/components/clear-button/index.css +5 -5
- package/modern/components/field/Component.js +1 -1
- package/modern/components/field/index.css +14 -14
- package/modern/components/footer/Component.js +1 -1
- package/modern/components/footer/index.css +5 -5
- package/modern/components/optgroup/Component.js +1 -1
- package/modern/components/optgroup/index.css +5 -6
- package/modern/components/option/desktop/Component.js +1 -1
- package/modern/components/option/desktop/index.css +21 -22
- package/modern/components/option/mobile/Component.js +1 -1
- package/modern/components/option/mobile/index.css +18 -19
- package/modern/components/options-list/Component.js +4 -5
- package/modern/components/options-list/index.css +10 -11
- package/modern/components/search/Component.js +1 -1
- package/modern/components/search/index.css +2 -2
- package/modern/components/virtual-options-list/Component.js +1 -1
- package/modern/components/virtual-options-list/index.css +14 -15
- package/{moderncssm/hook-54090d24.js → modern/hook-2f7a71de.js} +3 -3
- package/modern/{list-popover-desktop-92897a4e.js → list-popover-desktop-6e43d72c.js} +1 -1
- package/modern/mobile/Component.mobile.js +1 -1
- package/modern/mobile.module-208550e0.js +4 -0
- package/modern/presets/index.js +1 -1
- package/modern/presets/useSelectWithApply/hook.js +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/footer/Component.d.ts +3 -2
- package/modern/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +5 -3
- package/modern/presets/useSelectWithApply/options-list-with-apply/footer/index.css +8 -4
- package/modern/presets/useSelectWithApply/options-list-with-apply/header/Component.d.ts +2 -0
- package/modern/presets/useSelectWithApply/options-list-with-apply/header/Component.js +6 -2
- package/modern/presets/useSelectWithApply/options-list-with-apply/header/index.css +9 -5
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
- package/modern/presets/useSelectWithLoading/hook.js +1 -1
- package/modern/presets/useSelectWithLoading/index.css +2 -2
- package/modern/shared/index.js +1 -1
- package/modern/utils.d.ts +1 -1
- package/modern/utils.js +10 -22
- package/moderncssm/components/base-option/Component.js +3 -2
- package/moderncssm/components/base-option/index.module.css +7 -0
- package/moderncssm/components/base-select/Component.js +2 -1
- package/moderncssm/components/base-select/index.module.css +4 -0
- package/moderncssm/components/optgroup/index.module.css +0 -1
- package/moderncssm/components/option/desktop/index.module.css +1 -2
- package/moderncssm/components/option/index.module.css +1 -2
- package/moderncssm/components/option/mobile/index.module.css +1 -2
- package/moderncssm/components/options-list/Component.js +3 -4
- package/moderncssm/components/options-list/index.module.css +0 -1
- package/moderncssm/components/virtual-options-list/index.module.css +0 -1
- package/{modern/hook-433ed72d.js → moderncssm/hook-4849257f.js} +3 -3
- package/moderncssm/mobile/Component.mobile.js +1 -1
- package/moderncssm/presets/index.js +1 -1
- package/moderncssm/presets/useSelectWithApply/hook.js +1 -1
- package/moderncssm/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
- package/moderncssm/presets/useSelectWithApply/options-list-with-apply/footer/Component.d.ts +3 -2
- package/moderncssm/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +4 -2
- package/moderncssm/presets/useSelectWithApply/options-list-with-apply/footer/index.module.css +3 -0
- package/moderncssm/presets/useSelectWithApply/options-list-with-apply/header/Component.d.ts +2 -0
- package/moderncssm/presets/useSelectWithApply/options-list-with-apply/header/Component.js +5 -1
- package/moderncssm/presets/useSelectWithApply/options-list-with-apply/header/index.module.css +5 -1
- package/moderncssm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/moderncssm/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
- package/moderncssm/shared/index.js +1 -1
- package/moderncssm/utils.d.ts +1 -1
- package/moderncssm/utils.js +10 -22
- package/package.json +13 -13
- package/presets/index.js +1 -1
- package/presets/useSelectWithApply/hook.js +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/footer/Component.d.ts +3 -2
- package/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +6 -3
- package/presets/useSelectWithApply/options-list-with-apply/footer/index.css +8 -4
- package/presets/useSelectWithApply/options-list-with-apply/header/Component.d.ts +2 -0
- package/presets/useSelectWithApply/options-list-with-apply/header/Component.js +7 -3
- package/presets/useSelectWithApply/options-list-with-apply/header/index.css +9 -5
- package/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
- package/presets/useSelectWithLoading/hook.js +1 -1
- package/presets/useSelectWithLoading/index.css +2 -2
- package/shared/index.js +1 -1
- package/src/components/base-option/Component.tsx +3 -1
- package/src/components/base-option/index.module.css +9 -0
- package/src/components/base-select/Component.tsx +9 -4
- package/src/components/base-select/index.module.css +5 -0
- package/src/components/optgroup/index.module.css +0 -1
- package/src/components/option/index.module.css +0 -1
- package/src/components/options-list/Component.tsx +3 -2
- package/src/components/options-list/index.module.css +0 -1
- package/src/components/virtual-options-list/index.module.css +0 -1
- package/src/presets/useSelectWithApply/options-list-with-apply/Component.tsx +4 -1
- package/src/presets/useSelectWithApply/options-list-with-apply/footer/Component.tsx +6 -2
- package/src/presets/useSelectWithApply/options-list-with-apply/footer/index.module.css +4 -0
- package/src/presets/useSelectWithApply/options-list-with-apply/header/Component.tsx +11 -1
- package/src/presets/useSelectWithApply/options-list-with-apply/header/index.module.css +3 -0
- package/src/utils.ts +9 -24
- package/utils.d.ts +1 -1
- package/utils.js +12 -24
- package/esm/mobile.module-17a9a022.js +0 -4
- package/mobile.module-abcf78b8.js +0 -6
- package/modern/mobile.module-dae5cd65.js +0 -4
- /package/cssm/{hook-42ec365f.d.ts → hook-7f1b6f47.d.ts} +0 -0
- /package/esm/{hook-e9905b00.d.ts → hook-56374bc2.d.ts} +0 -0
- /package/esm/{list-popover-desktop-d8567402.d.ts → list-popover-desktop-d897cee0.d.ts} +0 -0
- /package/{hook-5412b662.d.ts → hook-7eb4a9bb.d.ts} +0 -0
- /package/{list-popover-desktop-d6bb8493.d.ts → list-popover-desktop-b51713d2.d.ts} +0 -0
- /package/modern/{hook-433ed72d.d.ts → hook-2f7a71de.d.ts} +0 -0
- /package/modern/{list-popover-desktop-92897a4e.d.ts → list-popover-desktop-6e43d72c.d.ts} +0 -0
- /package/moderncssm/{hook-54090d24.d.ts → hook-4849257f.d.ts} +0 -0
|
@@ -6,7 +6,7 @@ import { DEFAULT_VISIBLE_OPTIONS } from './consts.js';
|
|
|
6
6
|
import { Footer } from './presets/useSelectWithApply/options-list-with-apply/footer/Component.js';
|
|
7
7
|
import { Header } from './presets/useSelectWithApply/options-list-with-apply/header/Component.js';
|
|
8
8
|
|
|
9
|
-
const OptionsListWithApply = forwardRef(({ toggleMenu, getOptionProps: defaultGetOptionProps, showClear = true, showHeaderWithSelectAll, selectedDraft = [], flatOptions = [], OptionsList: OptionsList$1 = OptionsList, onApply = () => null, onClear = () => null, onClose = () => null, visibleOptions = DEFAULT_VISIBLE_OPTIONS, Footer: Footer$1 = Footer, Header: Header$1 = Header, header, headerProps, setSelectedDraft, ...restProps }, ref) => {
|
|
9
|
+
const OptionsListWithApply = forwardRef(({ toggleMenu, getOptionProps: defaultGetOptionProps, showClear = true, showHeaderWithSelectAll, selectedDraft = [], flatOptions = [], OptionsList: OptionsList$1 = OptionsList, onApply = () => null, onClear = () => null, onClose = () => null, visibleOptions = DEFAULT_VISIBLE_OPTIONS, Footer: Footer$1 = Footer, Header: Header$1 = Header, header, headerProps, setSelectedDraft, size, ...restProps }, ref) => {
|
|
10
10
|
const getOptionProps = useCallback((option, index) => {
|
|
11
11
|
const optionProps = defaultGetOptionProps(option, index);
|
|
12
12
|
const selected = option.key === SELECT_ALL_KEY
|
|
@@ -43,9 +43,9 @@ const OptionsListWithApply = forwardRef(({ toggleMenu, getOptionProps: defaultGe
|
|
|
43
43
|
return undefined;
|
|
44
44
|
return (React.createElement(React.Fragment, null,
|
|
45
45
|
header,
|
|
46
|
-
showHeaderWithSelectAll && flatOptions.length > 0 && (React.createElement(Header$1, { ...headerProps }))));
|
|
46
|
+
showHeaderWithSelectAll && flatOptions.length > 0 && (React.createElement(Header$1, { ...headerProps, size: size }))));
|
|
47
47
|
};
|
|
48
|
-
return (React.createElement(OptionsList$1, { ...restProps, ref: ref, visibleOptions: visibleOptions, toggleMenu: toggleMenu, flatOptions: flatOptions, getOptionProps: getOptionProps, onApply: handleApply, onClear: handleClear, header: renderHeader(), selectedItems: selectedDraft, setSelectedItems: handleSelectedItems, footer: React.createElement(Footer$1, { handleApply: handleApply, handleClear: handleClear, showClear: showClear, selectedDraft: selectedDraft, dataTestId: restProps?.dataTestId }) }));
|
|
48
|
+
return (React.createElement(OptionsList$1, { ...restProps, size: size, ref: ref, visibleOptions: visibleOptions, toggleMenu: toggleMenu, flatOptions: flatOptions, getOptionProps: getOptionProps, onApply: handleApply, onClear: handleClear, header: renderHeader(), selectedItems: selectedDraft, setSelectedItems: handleSelectedItems, footer: React.createElement(Footer$1, { handleApply: handleApply, handleClear: handleClear, showClear: showClear, selectedDraft: selectedDraft, dataTestId: restProps?.dataTestId, size: size }) }));
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
const SELECT_ALL_KEY = 'select_all';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
|
|
4
|
-
const styles = {"component":"
|
|
4
|
+
const styles = {"component":"select__component_1bajr","popoverInner":"select__popoverInner_1bajr","optionsListWrapper":"select__optionsListWrapper_1bajr","optionsListBorder":"select__optionsListBorder_1bajr","nativeSelect":"select__nativeSelect_1bajr","block":"select__block_1bajr","emptySearchPlaceholder":"select__emptySearchPlaceholder_1bajr","search":"select__search_1bajr","size-72":"select__size-72_1bajr"};
|
|
5
5
|
require('./components/base-select/index.css')
|
|
6
6
|
|
|
7
7
|
const ListPopoverDesktop = (props) => {
|
|
@@ -16,7 +16,7 @@ import { OptionResponsive } from '../components/option/Component.responsive.js';
|
|
|
16
16
|
import { OptionsList } from '../components/options-list/Component.js';
|
|
17
17
|
import { Search } from '../components/search/Component.js';
|
|
18
18
|
import { VirtualOptionsList } from '../components/virtual-options-list/Component.js';
|
|
19
|
-
import { u as useSelectWithApply } from '../hook-
|
|
19
|
+
import { u as useSelectWithApply } from '../hook-2f7a71de.js';
|
|
20
20
|
import { Header } from '../presets/useSelectWithApply/options-list-with-apply/header/Component.js';
|
|
21
21
|
|
|
22
22
|
const VIRTUAL_OPTIONS_LIST_THRESHOLD = 30;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const mobileStyles = {"sheet":"select__sheet_1osqr","sheetContent":"select__sheetContent_1osqr","modalContent":"select__modalContent_1osqr","sheetContainer":"select__sheetContainer_1osqr","optionsListWrapper":"select__optionsListWrapper_1osqr","optionsList":"select__optionsList_1osqr","scrollbar":"select__scrollbar_1osqr","search":"select__search_1osqr","option":"select__option_1osqr","optionGroup":"select__optionGroup_1osqr"};
|
|
2
|
+
require('./components/base-select/mobile.css')
|
|
3
|
+
|
|
4
|
+
export { mobileStyles as m };
|
package/modern/presets/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { useSelectWithLoading } from './useSelectWithLoading/hook.js';
|
|
2
2
|
export { useLazyLoading } from './useLazyLoading/hook.js';
|
|
3
|
-
export { S as SELECT_ALL_KEY, u as useSelectWithApply } from '../hook-
|
|
3
|
+
export { S as SELECT_ALL_KEY, u as useSelectWithApply } from '../hook-2f7a71de.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'react';
|
|
2
2
|
import '../../../components/options-list/Component.js';
|
|
3
3
|
import '../../../consts.js';
|
|
4
|
-
export { O as OptionsListWithApply } from '../../../hook-
|
|
4
|
+
export { O as OptionsListWithApply } from '../../../hook-2f7a71de.js';
|
|
5
5
|
import './footer/Component.js';
|
|
6
6
|
import './header/Component.js';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { OptionShape } from "../../../../typings";
|
|
3
|
+
import { OptionShape, OptionsListProps } from "../../../../typings";
|
|
4
4
|
type FooterProps = {
|
|
5
5
|
handleClear?: () => void;
|
|
6
6
|
handleApply?: () => void;
|
|
7
7
|
showClear?: boolean;
|
|
8
8
|
selectedDraft?: OptionShape[];
|
|
9
9
|
dataTestId?: string;
|
|
10
|
+
size?: OptionsListProps['size'];
|
|
10
11
|
};
|
|
11
|
-
declare const Footer: ({ handleApply, handleClear, showClear, selectedDraft, dataTestId, }: FooterProps) => React.JSX.Element;
|
|
12
|
+
declare const Footer: ({ handleApply, handleClear, showClear, selectedDraft, dataTestId, size, }: FooterProps) => React.JSX.Element;
|
|
12
13
|
export { FooterProps, Footer };
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
2
3
|
import { ButtonDesktop } from '@alfalab/core-components-button/modern/desktop';
|
|
3
4
|
import { getDataTestId } from '@alfalab/core-components-shared/modern';
|
|
5
|
+
import { SIZE_TO_CLASSNAME_MAP } from '../../../../consts.js';
|
|
4
6
|
|
|
5
|
-
const styles = {"footer":"
|
|
7
|
+
const styles = {"footer":"select__footer_4hp3o","size-72":"select__size-72_4hp3o","button":"select__button_4hp3o"};
|
|
6
8
|
require('./index.css')
|
|
7
9
|
|
|
8
|
-
const Footer = ({ handleApply, handleClear, showClear, selectedDraft = [], dataTestId, }) => (React.createElement("div", {
|
|
10
|
+
const Footer = ({ handleApply, handleClear, showClear, selectedDraft = [], dataTestId, size, }) => (React.createElement("div", {
|
|
9
11
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
10
|
-
tabIndex: 0, className: styles.footer },
|
|
12
|
+
tabIndex: 0, className: cn(styles.footer, size && styles[SIZE_TO_CLASSNAME_MAP[size]]) },
|
|
11
13
|
React.createElement(ButtonDesktop, { size: 32, view: 'primary', onClick: handleApply, dataTestId: getDataTestId(dataTestId, 'apply'), className: styles.button }, "\u041F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C"),
|
|
12
14
|
showClear && selectedDraft.length > 0 && (React.createElement(ButtonDesktop, { size: 32, view: 'secondary', onClick: handleClear, dataTestId: getDataTestId(dataTestId, 'clear'), className: styles.button }, "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C"))));
|
|
13
15
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 4moj2 */
|
|
2
2
|
:root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-base-bg-primary: #fff; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* 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,7 +16,8 @@
|
|
|
16
16
|
/* новые значения, используйте их */
|
|
17
17
|
} :root { /* deprecated */ /* deprecated */
|
|
18
18
|
--gap-xs: 8px; /* deprecated */
|
|
19
|
-
--gap-s: 12px; /* deprecated */ /* deprecated */
|
|
19
|
+
--gap-s: 12px; /* deprecated */ /* deprecated */
|
|
20
|
+
--gap-m: 16px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
20
21
|
|
|
21
22
|
/* новые значения, используйте их */
|
|
22
23
|
|
|
@@ -24,14 +25,17 @@
|
|
|
24
25
|
/* stylelint-disable-next-line length-zero-no-unit */
|
|
25
26
|
--gap-8: var(--gap-xs);
|
|
26
27
|
--gap-12: var(--gap-s);
|
|
28
|
+
--gap-16: var(--gap-m);
|
|
27
29
|
} :root {
|
|
28
30
|
} /* @deprecated */ /* @deprecated */ /* @deprecated */ /* @deprecated */ /* @deprecated */ :root {
|
|
29
31
|
} /* сбрасывает синюю подсветку при нажатии */ :root {
|
|
30
32
|
--select-option-list-footer-button-gap: var(--gap-8);
|
|
31
|
-
} .
|
|
33
|
+
} .select__footer_4hp3o {
|
|
32
34
|
background-color: var(--color-light-base-bg-primary);
|
|
33
35
|
padding: var(--gap-12);
|
|
34
36
|
outline: none
|
|
35
|
-
} .
|
|
37
|
+
} .select__footer_4hp3o.select__size-72_4hp3o {
|
|
38
|
+
padding: var(--gap-12) var(--gap-16);
|
|
39
|
+
} .select__footer_4hp3o > .select__button_4hp3o + .select__button_4hp3o {
|
|
36
40
|
margin-left: var(--select-option-list-footer-button-gap);
|
|
37
41
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { CheckboxProps } from "@alfalab/core-components-checkbox";
|
|
4
|
+
import { OptionsListProps } from "../../../../typings";
|
|
4
5
|
type HeaderProps = {
|
|
5
6
|
checked?: boolean;
|
|
6
7
|
indeterminate?: boolean;
|
|
7
8
|
onChange?: CheckboxProps['onChange'];
|
|
8
9
|
mobile?: boolean;
|
|
9
10
|
dataTestId?: string;
|
|
11
|
+
size?: OptionsListProps['size'];
|
|
10
12
|
};
|
|
11
13
|
declare const Header: React.FC<HeaderProps>;
|
|
12
14
|
export { HeaderProps, Header };
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { Checkbox } from '@alfalab/core-components-checkbox/modern';
|
|
4
|
+
import { SIZE_TO_CLASSNAME_MAP } from '../../../../consts.js';
|
|
4
5
|
|
|
5
|
-
const styles = {"desktop":"
|
|
6
|
+
const styles = {"desktop":"select__desktop_12rwi","size-72":"select__size-72_12rwi","mobile":"select__mobile_12rwi"};
|
|
6
7
|
require('./index.css')
|
|
7
8
|
|
|
8
|
-
const Header = ({ onChange, checked, indeterminate, mobile, dataTestId, }) => (React.createElement("div", { className: cn(
|
|
9
|
+
const Header = ({ onChange, checked, indeterminate, mobile, dataTestId, size, }) => (React.createElement("div", { className: cn(size && styles[SIZE_TO_CLASSNAME_MAP[size]], {
|
|
10
|
+
[styles.desktop]: !mobile,
|
|
11
|
+
[styles.mobile]: mobile,
|
|
12
|
+
}) },
|
|
9
13
|
React.createElement(Checkbox, { block: true, indeterminate: indeterminate, size: 'm', onChange: onChange, checked: checked, label: '\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435', dataTestId: dataTestId })));
|
|
10
14
|
|
|
11
15
|
export { Header };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 18pvg */
|
|
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 */
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
/* новые значения, используйте их */
|
|
16
16
|
} :root { /* deprecated */ /* deprecated */
|
|
17
17
|
--gap-xs: 8px; /* deprecated */
|
|
18
|
-
--gap-s: 12px; /* deprecated */ /* deprecated */
|
|
18
|
+
--gap-s: 12px; /* deprecated */ /* deprecated */
|
|
19
|
+
--gap-m: 16px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
19
20
|
|
|
20
21
|
/* новые значения, используйте их */
|
|
21
22
|
|
|
@@ -23,10 +24,13 @@
|
|
|
23
24
|
/* stylelint-disable-next-line length-zero-no-unit */
|
|
24
25
|
--gap-8: var(--gap-xs);
|
|
25
26
|
--gap-12: var(--gap-s);
|
|
27
|
+
--gap-16: var(--gap-m);
|
|
26
28
|
} :root {
|
|
27
29
|
} /* @deprecated */ /* @deprecated */ /* @deprecated */ /* @deprecated */ /* @deprecated */ :root {
|
|
28
|
-
} /* сбрасывает синюю подсветку при нажатии */ .
|
|
29
|
-
padding: var(--gap-12)
|
|
30
|
-
} .
|
|
30
|
+
} /* сбрасывает синюю подсветку при нажатии */ .select__desktop_12rwi {
|
|
31
|
+
padding: var(--gap-12)
|
|
32
|
+
} .select__desktop_12rwi.select__size-72_12rwi {
|
|
33
|
+
padding-left: var(--gap-16);
|
|
34
|
+
} .select__mobile_12rwi {
|
|
31
35
|
padding: var(--gap-12) var(--gap-8);
|
|
32
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../../../hook-
|
|
1
|
+
export * from "../../../hook-2f7a71de";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { O as OptionsListWithApply } from '../../../hook-
|
|
1
|
+
export { O as OptionsListWithApply } from '../../../hook-2f7a71de.js';
|
|
@@ -7,7 +7,7 @@ import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
|
7
7
|
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
8
8
|
import { OptionResponsive } from '../../components/option/Component.responsive.js';
|
|
9
9
|
|
|
10
|
-
const styles = {"skeleton":"
|
|
10
|
+
const styles = {"skeleton":"select__skeleton_9yd30"};
|
|
11
11
|
require('./index.css')
|
|
12
12
|
|
|
13
13
|
function useSelectWithLoading({ loading = false, visibleOptions = 6, Option = OptionResponsive, }) {
|
package/modern/shared/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { useSelectWithLoading } from '../presets/useSelectWithLoading/hook.js';
|
|
2
2
|
export { useLazyLoading } from '../presets/useLazyLoading/hook.js';
|
|
3
|
-
export { S as SELECT_ALL_KEY, u as useSelectWithApply } from '../hook-
|
|
3
|
+
export { S as SELECT_ALL_KEY, u as useSelectWithApply } from '../hook-2f7a71de.js';
|
|
4
4
|
export { defaultAccessor, defaultFilterFn, defaultGroupAccessor, getSelectTestIds, isGroup, isOptionShape, joinOptions, lastIndexOf, processOptions, usePrevious, useVirtualVisibleOptions, useVisibleOptions } from '../utils.js';
|
|
5
5
|
export { OptionDesktop } from '../components/option/desktop/Component.js';
|
|
6
6
|
export { OptionMobile } from '../components/option/mobile/Component.js';
|
package/modern/utils.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ type useVisibleOptionsArgs = {
|
|
|
46
46
|
actualOptionsCount?: boolean;
|
|
47
47
|
};
|
|
48
48
|
declare function useVirtualVisibleOptions({ visibleOptions, listRef, styleTargetRef, open, invalidate, options, size, actualOptionsCount, }: useVisibleOptionsArgs): void;
|
|
49
|
-
declare function useVisibleOptions({ visibleOptions, listRef,
|
|
49
|
+
declare function useVisibleOptions({ visibleOptions, listRef, open, options, size, actualOptionsCount, }: useVisibleOptionsArgs): readonly [boolean, number | undefined];
|
|
50
50
|
declare function defaultFilterFn(optionText: string, search: string): boolean;
|
|
51
51
|
declare function defaultGroupAccessor(option: GroupShape): string | undefined;
|
|
52
52
|
declare function defaultAccessor(option: OptionShape): string;
|
package/modern/utils.js
CHANGED
|
@@ -110,23 +110,23 @@ function useVirtualVisibleOptions({ visibleOptions, listRef, styleTargetRef = li
|
|
|
110
110
|
invalidate,
|
|
111
111
|
]);
|
|
112
112
|
}
|
|
113
|
-
function useVisibleOptions({ visibleOptions, listRef,
|
|
113
|
+
function useVisibleOptions({ visibleOptions, listRef, open, options, size, actualOptionsCount, }) {
|
|
114
114
|
const [, runIfMounted] = useIsMounted();
|
|
115
115
|
const [measured, setMeasured] = useState(false);
|
|
116
|
+
const [height, setHeight] = useState();
|
|
116
117
|
useEffect(() => {
|
|
117
118
|
const measureOptionHeight = (element) => typeof size === 'number' ? Math.min(element.clientHeight, size) : element.clientHeight;
|
|
118
119
|
const list = listRef.current;
|
|
119
|
-
|
|
120
|
-
if (open && list && styleTarget && visibleOptions > 0) {
|
|
120
|
+
if (open && list && visibleOptions > 0) {
|
|
121
121
|
const childCount = list.children.length;
|
|
122
122
|
const optionsNodes = [].slice.call(list.children, 0, visibleOptions + 1);
|
|
123
|
-
let
|
|
123
|
+
let measuredHeight = optionsNodes
|
|
124
124
|
.slice(0, visibleOptions)
|
|
125
125
|
.reduce((acc, child) => acc + measureOptionHeight(child), 0);
|
|
126
126
|
if (visibleOptions < childCount) {
|
|
127
127
|
const lastVisibleOptionHeight = measureOptionHeight(optionsNodes[optionsNodes.length - 1]);
|
|
128
128
|
// Если кол-во опций больше visibleOptions на 1, то показываем все опции, иначе добавляем половинку
|
|
129
|
-
|
|
129
|
+
measuredHeight += Math.round(childCount - visibleOptions === 1
|
|
130
130
|
? lastVisibleOptionHeight
|
|
131
131
|
: lastVisibleOptionHeight / 2);
|
|
132
132
|
}
|
|
@@ -134,33 +134,21 @@ function useVisibleOptions({ visibleOptions, listRef, styleTargetRef = listRef,
|
|
|
134
134
|
actualOptionsCount &&
|
|
135
135
|
typeof size === 'number') {
|
|
136
136
|
const actualCount = (options ?? []).reduce((sum, option) => sum + 1 + (isGroup(option) ? option.options.length : 0), 0);
|
|
137
|
-
|
|
137
|
+
measuredHeight =
|
|
138
138
|
Math.min(actualCount === 0 ? /** empty placeholder */ 1 : actualCount, visibleOptions) * size;
|
|
139
139
|
if (visibleOptions < actualCount) {
|
|
140
|
-
|
|
140
|
+
measuredHeight += size / 2;
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
|
|
144
|
-
styleTarget.style.height = `${height}px`;
|
|
143
|
+
setHeight(measuredHeight);
|
|
145
144
|
setMeasured(true);
|
|
146
145
|
return () => {
|
|
147
|
-
styleTarget.style.height = prevHeight;
|
|
148
146
|
runIfMounted(() => setMeasured(false));
|
|
149
147
|
};
|
|
150
148
|
}
|
|
151
149
|
return fnUtils.noop;
|
|
152
|
-
}, [
|
|
153
|
-
|
|
154
|
-
listRef,
|
|
155
|
-
open,
|
|
156
|
-
options,
|
|
157
|
-
size,
|
|
158
|
-
styleTargetRef,
|
|
159
|
-
visibleOptions,
|
|
160
|
-
invalidate,
|
|
161
|
-
runIfMounted,
|
|
162
|
-
]);
|
|
163
|
-
return measured;
|
|
150
|
+
}, [actualOptionsCount, listRef, open, options, size, visibleOptions, runIfMounted]);
|
|
151
|
+
return [measured, height];
|
|
164
152
|
}
|
|
165
153
|
function defaultFilterFn(optionText, search) {
|
|
166
154
|
if (!search)
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { isValidElement } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
|
+
import { SIZE_TO_CLASSNAME_MAP } from '../../consts.js';
|
|
3
4
|
import { BaseCheckmark } from '../base-checkmark/Component.js';
|
|
4
5
|
import styles from './index.module.css';
|
|
5
6
|
|
|
6
|
-
const BaseOption = ({ className, option, children, selected, highlighted, disabled, multiple, Checkmark = BaseCheckmark, checkmarkPosition = multiple ? 'before' : 'after', align = 'center', innerProps, dataTestId, mobile = false, }) => {
|
|
7
|
+
const BaseOption = ({ className, option, children, selected, highlighted, disabled, multiple, Checkmark = BaseCheckmark, checkmarkPosition = multiple ? 'before' : 'after', align = 'center', innerProps, dataTestId, mobile = false, size, }) => {
|
|
7
8
|
const content = children || option.content || option.key;
|
|
8
9
|
const { showCheckMark = true } = option;
|
|
9
10
|
const isTextContent = !isValidElement(content);
|
|
@@ -16,7 +17,7 @@ const BaseOption = ({ className, option, children, selected, highlighted, disabl
|
|
|
16
17
|
}
|
|
17
18
|
return null;
|
|
18
19
|
};
|
|
19
|
-
return (React.createElement("div", { ...innerProps, className: cn(styles.option, className, {
|
|
20
|
+
return (React.createElement("div", { ...innerProps, className: cn(styles.option, size && styles[SIZE_TO_CLASSNAME_MAP[size]], className, {
|
|
20
21
|
[styles.highlighted]: !mobile && highlighted,
|
|
21
22
|
[styles.selected]: selected,
|
|
22
23
|
[styles.disabled]: disabled,
|
|
@@ -47,12 +47,19 @@
|
|
|
47
47
|
.option.checkmarkAfter.checkmarkAfter {
|
|
48
48
|
padding: var(--gap-0) var(--gap-12) var(--gap-0) var(--gap-0)
|
|
49
49
|
}
|
|
50
|
+
.option.checkmarkAfter.checkmarkAfter.size-72 {
|
|
51
|
+
padding-right: var(--gap-16);
|
|
52
|
+
}
|
|
50
53
|
.option.checkmarkAfter.checkmarkAfter.mobile {
|
|
51
54
|
padding-right: var(--gap-20);
|
|
52
55
|
}
|
|
53
56
|
.option.textContent {
|
|
54
57
|
padding: var(--gap-12)
|
|
55
58
|
}
|
|
59
|
+
.option.textContent.size-72 {
|
|
60
|
+
padding-left: var(--gap-16);
|
|
61
|
+
padding-right: var(--gap-16);
|
|
62
|
+
}
|
|
56
63
|
.option.textContent.mobile {
|
|
57
64
|
padding: var(--gap-16) var(--gap-20) var(--gap-16) var(--gap-16);
|
|
58
65
|
}
|
|
@@ -6,6 +6,7 @@ import { compute } from 'compute-scroll-into-view';
|
|
|
6
6
|
import { useMultipleSelection, useCombobox } from 'downshift';
|
|
7
7
|
import { fnUtils, getDataTestId } from '@alfalab/core-components-shared/moderncssm';
|
|
8
8
|
import { useLayoutEffect_SAFE_FOR_SSR } from '@alfalab/hooks';
|
|
9
|
+
import { SIZE_TO_CLASSNAME_MAP } from '../../consts.js';
|
|
9
10
|
import { defaultAccessor, defaultFilterFn, defaultGroupAccessor, processOptions, isGroup } from '../../utils.js';
|
|
10
11
|
import { NativeSelect } from '../native-select/Component.js';
|
|
11
12
|
import { getListPopoverDesktopProps } from './components/list-desktop/helpers/get-list-popover-desktop-props.js';
|
|
@@ -355,7 +356,7 @@ const BaseSelect = forwardRef(
|
|
|
355
356
|
return (React.createElement(Search, { ...searchProps?.componentProps, onBlur: handleBlur, value: search, onChange: handleChange, dataTestId: getDataTestId(dataTestId, 'search'), onClear: handleClear, className: cn(searchProps?.componentProps?.className, {
|
|
356
357
|
[styles.search]: view === 'desktop',
|
|
357
358
|
[mobileStyles.search]: view === 'mobile',
|
|
358
|
-
}), ref: mergeRefs([searchRef, searchProps?.componentProps?.ref || null]) }));
|
|
359
|
+
}, size && styles[SIZE_TO_CLASSNAME_MAP[size]]), ref: mergeRefs([searchRef, searchProps?.componentProps?.ref || null]) }));
|
|
359
360
|
};
|
|
360
361
|
const { header, emptyPlaceholder } = optionsListProps;
|
|
361
362
|
const renderOptionsListHeader = () => {
|
|
@@ -72,12 +72,11 @@
|
|
|
72
72
|
.size-72 {
|
|
73
73
|
min-height: var(--size-xl-height);
|
|
74
74
|
}
|
|
75
|
-
.size-64,
|
|
76
75
|
.size-72 {
|
|
77
76
|
padding-left: var(--select-option-l-left-padding);
|
|
78
77
|
padding-right: var(--select-option-l-right-padding)
|
|
79
78
|
}
|
|
80
|
-
.size-
|
|
79
|
+
.size-72:before {
|
|
81
80
|
left: var(--select-option-l-left-padding);
|
|
82
81
|
right: var(--select-option-l-right-padding);
|
|
83
82
|
}
|
|
@@ -72,12 +72,11 @@
|
|
|
72
72
|
.size-72 {
|
|
73
73
|
min-height: var(--size-xl-height);
|
|
74
74
|
}
|
|
75
|
-
.size-64,
|
|
76
75
|
.size-72 {
|
|
77
76
|
padding-left: var(--select-option-l-left-padding);
|
|
78
77
|
padding-right: var(--select-option-l-right-padding)
|
|
79
78
|
}
|
|
80
|
-
.size-
|
|
79
|
+
.size-72:before {
|
|
81
80
|
left: var(--select-option-l-left-padding);
|
|
82
81
|
right: var(--select-option-l-right-padding);
|
|
83
82
|
}
|
|
@@ -72,12 +72,11 @@
|
|
|
72
72
|
.size-72 {
|
|
73
73
|
min-height: var(--size-xl-height);
|
|
74
74
|
}
|
|
75
|
-
.size-64,
|
|
76
75
|
.size-72 {
|
|
77
76
|
padding-left: var(--select-option-l-left-padding);
|
|
78
77
|
padding-right: var(--select-option-l-right-padding)
|
|
79
78
|
}
|
|
80
|
-
.size-
|
|
79
|
+
.size-72:before {
|
|
81
80
|
left: var(--select-option-l-left-padding);
|
|
82
81
|
right: var(--select-option-l-right-padding);
|
|
83
82
|
}
|
|
@@ -40,8 +40,7 @@ const OptionsList = forwardRef(({ size = 48, className, optionGroupClassName, fo
|
|
|
40
40
|
return (React.createElement(Optgroup$1, { className: optionGroupClassName, label: group.label, key: group.label, size: size, options: group.options, selectedItems: groupSelectedItems, setSelectedItems: handleSelectedItems, search: search, multiple: multiple, ...groupOptionProps }, group.options.map((option) => renderOption(option, counter()))));
|
|
41
41
|
};
|
|
42
42
|
const actualOptionsCount = limitDynamicOptionGroupSize && options.length > 0;
|
|
43
|
-
const measured = useVisibleOptions({
|
|
44
|
-
...(!nativeScrollbar && { styleTargetRef: scrollbarRef }),
|
|
43
|
+
const [measured, height] = useVisibleOptions({
|
|
45
44
|
visibleOptions,
|
|
46
45
|
listRef,
|
|
47
46
|
open,
|
|
@@ -70,7 +69,7 @@ const OptionsList = forwardRef(({ size = 48, className, optionGroupClassName, fo
|
|
|
70
69
|
'data-test-id': dataTestId,
|
|
71
70
|
ref: ref,
|
|
72
71
|
};
|
|
73
|
-
return (React.createElement(Scrollbar, { className: cn(styles.scrollable, scrollbarClassName), ref: scrollbarRef, horizontalAutoStretch: optionsListWidth === 'content', scrollableNodeProps: scrollableNodeProps, contentNodeProps: { ref: listRef }, maskProps: {
|
|
72
|
+
return (React.createElement(Scrollbar, { className: cn(styles.scrollable, scrollbarClassName), ref: scrollbarRef, style: { height }, horizontalAutoStretch: optionsListWidth === 'content', scrollableNodeProps: scrollableNodeProps, contentNodeProps: { ref: listRef }, maskProps: {
|
|
74
73
|
/*
|
|
75
74
|
* Для корректного подсчета высоты опций(иначе для optionsListWidth: 'field'
|
|
76
75
|
* высота опции всегда будет равна высоте одной строчки)
|
|
@@ -80,7 +79,7 @@ const OptionsList = forwardRef(({ size = 48, className, optionGroupClassName, fo
|
|
|
80
79
|
}),
|
|
81
80
|
} }, renderListItems()));
|
|
82
81
|
};
|
|
83
|
-
const renderWithNativeScrollbar = () => (React.createElement("div", { className: cn(styles.scrollable, scrollbarClassName), ref: mergeRefs([listRef, ref]), onScroll: handleScroll }, renderListItems()));
|
|
82
|
+
const renderWithNativeScrollbar = () => (React.createElement("div", { className: cn(styles.scrollable, scrollbarClassName), ref: mergeRefs([listRef, ref]), onScroll: handleScroll, style: { height } }, renderListItems()));
|
|
84
83
|
const resetHighlightedIndex = () => setHighlightedIndex?.(-1);
|
|
85
84
|
return (React.createElement("div", { ...(nativeScrollbar && { 'data-test-id': dataTestId }), className: cn(styles.optionsList, styles[SIZE_TO_CLASSNAME_MAP[size]], className) },
|
|
86
85
|
header && (React.createElement("div", { className: cn(styles.optionsListHeader, {
|
|
@@ -6,7 +6,7 @@ import { DEFAULT_VISIBLE_OPTIONS } from './consts.js';
|
|
|
6
6
|
import { Footer } from './presets/useSelectWithApply/options-list-with-apply/footer/Component.js';
|
|
7
7
|
import { Header } from './presets/useSelectWithApply/options-list-with-apply/header/Component.js';
|
|
8
8
|
|
|
9
|
-
const OptionsListWithApply = forwardRef(({ toggleMenu, getOptionProps: defaultGetOptionProps, showClear = true, showHeaderWithSelectAll, selectedDraft = [], flatOptions = [], OptionsList: OptionsList$1 = OptionsList, onApply = () => null, onClear = () => null, onClose = () => null, visibleOptions = DEFAULT_VISIBLE_OPTIONS, Footer: Footer$1 = Footer, Header: Header$1 = Header, header, headerProps, setSelectedDraft, ...restProps }, ref) => {
|
|
9
|
+
const OptionsListWithApply = forwardRef(({ toggleMenu, getOptionProps: defaultGetOptionProps, showClear = true, showHeaderWithSelectAll, selectedDraft = [], flatOptions = [], OptionsList: OptionsList$1 = OptionsList, onApply = () => null, onClear = () => null, onClose = () => null, visibleOptions = DEFAULT_VISIBLE_OPTIONS, Footer: Footer$1 = Footer, Header: Header$1 = Header, header, headerProps, setSelectedDraft, size, ...restProps }, ref) => {
|
|
10
10
|
const getOptionProps = useCallback((option, index) => {
|
|
11
11
|
const optionProps = defaultGetOptionProps(option, index);
|
|
12
12
|
const selected = option.key === SELECT_ALL_KEY
|
|
@@ -43,9 +43,9 @@ const OptionsListWithApply = forwardRef(({ toggleMenu, getOptionProps: defaultGe
|
|
|
43
43
|
return undefined;
|
|
44
44
|
return (React.createElement(React.Fragment, null,
|
|
45
45
|
header,
|
|
46
|
-
showHeaderWithSelectAll && flatOptions.length > 0 && (React.createElement(Header$1, { ...headerProps }))));
|
|
46
|
+
showHeaderWithSelectAll && flatOptions.length > 0 && (React.createElement(Header$1, { ...headerProps, size: size }))));
|
|
47
47
|
};
|
|
48
|
-
return (React.createElement(OptionsList$1, { ...restProps, ref: ref, visibleOptions: visibleOptions, toggleMenu: toggleMenu, flatOptions: flatOptions, getOptionProps: getOptionProps, onApply: handleApply, onClear: handleClear, header: renderHeader(), selectedItems: selectedDraft, setSelectedItems: handleSelectedItems, footer: React.createElement(Footer$1, { handleApply: handleApply, handleClear: handleClear, showClear: showClear, selectedDraft: selectedDraft, dataTestId: restProps?.dataTestId }) }));
|
|
48
|
+
return (React.createElement(OptionsList$1, { ...restProps, size: size, ref: ref, visibleOptions: visibleOptions, toggleMenu: toggleMenu, flatOptions: flatOptions, getOptionProps: getOptionProps, onApply: handleApply, onClear: handleClear, header: renderHeader(), selectedItems: selectedDraft, setSelectedItems: handleSelectedItems, footer: React.createElement(Footer$1, { handleApply: handleApply, handleClear: handleClear, showClear: showClear, selectedDraft: selectedDraft, dataTestId: restProps?.dataTestId, size: size }) }));
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
const SELECT_ALL_KEY = 'select_all';
|