@alfalab/core-components-select 10.2.2 → 10.4.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.
- package/CHANGELOG.md +42 -0
- package/dist/Component.d.ts +1 -1
- package/dist/Component.js +2 -1
- package/dist/components/arrow/Component.js +1 -1
- package/dist/components/arrow/index.css +3 -3
- package/dist/components/base-select/Component.js +25 -22
- package/dist/components/base-select/index.css +7 -7
- package/dist/components/base-select/index.js +1 -1
- package/dist/components/checkmark/Component.d.ts +1 -1
- package/dist/components/checkmark/Component.js +11 -5
- package/dist/components/checkmark/index.css +21 -9
- package/dist/components/checkmark/index.js +1 -0
- package/dist/components/field/Component.d.ts +1 -1
- package/dist/components/field/Component.js +3 -3
- package/dist/components/field/index.css +9 -9
- package/dist/components/field/index.js +1 -1
- package/dist/components/index.js +2 -1
- package/dist/components/native-select/Component.js +1 -1
- package/dist/components/native-select/index.js +1 -1
- package/dist/components/optgroup/Component.js +1 -1
- package/dist/components/optgroup/index.css +6 -6
- package/dist/components/option/Component.js +7 -5
- package/dist/components/option/index.css +20 -20
- package/dist/components/option/index.js +2 -1
- package/dist/components/options-list/Component.js +13 -8
- package/dist/components/options-list/index.css +9 -5
- package/dist/components/options-list/index.js +1 -0
- package/dist/components/virtual-options-list/Component.d.ts +1 -1
- package/dist/components/virtual-options-list/Component.js +22 -18
- package/dist/components/virtual-options-list/index.css +15 -12
- package/dist/components/virtual-options-list/index.js +1 -0
- package/dist/cssm/Component.d.ts +1 -1
- package/dist/cssm/Component.js +1 -0
- package/dist/cssm/components/base-select/Component.js +23 -20
- package/dist/cssm/components/checkmark/Component.d.ts +1 -1
- package/dist/cssm/components/checkmark/Component.js +10 -4
- package/dist/cssm/components/checkmark/index.js +1 -0
- package/dist/cssm/components/checkmark/index.module.css +19 -7
- package/dist/cssm/components/field/Component.d.ts +1 -1
- package/dist/cssm/components/field/Component.js +1 -1
- package/dist/cssm/components/index.js +1 -0
- package/dist/cssm/components/option/Component.js +5 -3
- package/dist/cssm/components/option/index.js +1 -0
- package/dist/cssm/components/options-list/Component.js +12 -7
- package/dist/cssm/components/options-list/index.js +1 -0
- package/dist/cssm/components/options-list/index.module.css +4 -0
- package/dist/cssm/components/virtual-options-list/Component.d.ts +1 -1
- package/dist/cssm/components/virtual-options-list/Component.js +21 -17
- package/dist/cssm/components/virtual-options-list/index.js +1 -0
- package/dist/cssm/components/virtual-options-list/index.module.css +4 -1
- package/dist/cssm/hook-45e5f3a8.d.ts +12 -0
- package/dist/cssm/hook-45e5f3a8.js +147 -0
- package/dist/cssm/hook-f5b8fe4f.d.ts +61 -0
- package/dist/cssm/index.js +8 -1
- package/dist/cssm/intersection-observer-8c55e13a.d.ts +1 -0
- package/dist/cssm/intersection-observer-8c55e13a.js +893 -0
- package/dist/cssm/presets/index.d.ts +1 -0
- package/dist/cssm/presets/index.js +30 -1
- package/dist/cssm/presets/useLazyLoading/hook.js +2 -892
- package/dist/cssm/presets/useSelectWithApply/hook.d.ts +0 -0
- package/dist/cssm/presets/useSelectWithApply/hook.js +46 -0
- package/dist/cssm/presets/useSelectWithApply/options-list-with-apply/Component.d.ts +0 -0
- package/dist/cssm/presets/useSelectWithApply/options-list-with-apply/Component.js +45 -0
- package/dist/cssm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -0
- package/dist/cssm/presets/useSelectWithApply/options-list-with-apply/index.js +45 -0
- package/dist/cssm/presets/useSelectWithApply/options-list-with-apply/index.module.css +38 -0
- package/dist/cssm/presets/useSelectWithLoading/hook.js +1 -0
- package/dist/cssm/typings.d.ts +55 -6
- package/dist/esm/Component.d.ts +1 -1
- package/dist/esm/Component.js +2 -1
- package/dist/esm/components/arrow/Component.js +1 -1
- package/dist/esm/components/arrow/index.css +3 -3
- package/dist/esm/components/base-select/Component.js +25 -22
- package/dist/esm/components/base-select/index.css +7 -7
- package/dist/esm/components/base-select/index.js +1 -1
- package/dist/esm/components/checkmark/Component.d.ts +1 -1
- package/dist/esm/components/checkmark/Component.js +12 -6
- package/dist/esm/components/checkmark/index.css +21 -9
- package/dist/esm/components/checkmark/index.js +1 -0
- package/dist/esm/components/field/Component.d.ts +1 -1
- package/dist/esm/components/field/Component.js +3 -3
- package/dist/esm/components/field/index.css +9 -9
- package/dist/esm/components/field/index.js +1 -1
- package/dist/esm/components/index.js +2 -1
- package/dist/esm/components/native-select/Component.js +1 -1
- package/dist/esm/components/native-select/index.js +1 -1
- package/dist/esm/components/optgroup/Component.js +1 -1
- package/dist/esm/components/optgroup/index.css +6 -6
- package/dist/esm/components/option/Component.js +7 -5
- package/dist/esm/components/option/index.css +20 -20
- package/dist/esm/components/option/index.js +2 -1
- package/dist/esm/components/options-list/Component.js +14 -9
- package/dist/esm/components/options-list/index.css +9 -5
- package/dist/esm/components/options-list/index.js +1 -0
- package/dist/esm/components/virtual-options-list/Component.d.ts +1 -1
- package/dist/esm/components/virtual-options-list/Component.js +22 -18
- package/dist/esm/components/virtual-options-list/index.css +15 -12
- package/dist/esm/components/virtual-options-list/index.js +1 -0
- package/dist/esm/hook-a01ac265.d.ts +12 -0
- package/dist/esm/hook-a01ac265.js +131 -0
- package/dist/esm/hook-f5b8fe4f.d.ts +61 -0
- package/dist/esm/index.js +5 -1
- package/dist/esm/intersection-observer-2080f60e.d.ts +1 -0
- package/dist/esm/intersection-observer-2080f60e.js +891 -0
- package/dist/esm/presets/index.d.ts +1 -0
- package/dist/esm/presets/index.js +21 -1
- package/dist/esm/presets/useLazyLoading/hook.js +4 -894
- package/dist/esm/presets/useLazyLoading/index.css +2 -2
- package/dist/esm/presets/useSelectWithApply/hook.d.ts +0 -0
- package/dist/esm/presets/useSelectWithApply/hook.js +26 -0
- package/dist/esm/presets/useSelectWithApply/options-list-with-apply/Component.d.ts +0 -0
- package/dist/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +26 -0
- package/dist/esm/presets/useSelectWithApply/options-list-with-apply/index.css +39 -0
- package/dist/esm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -0
- package/dist/esm/presets/useSelectWithApply/options-list-with-apply/index.js +26 -0
- package/dist/esm/presets/useSelectWithLoading/hook.js +3 -2
- package/dist/esm/presets/useSelectWithLoading/index.css +2 -2
- package/dist/esm/{tslib.es6-e134354f.d.ts → tslib.es6-11a0bbd3.d.ts} +0 -0
- package/dist/esm/{tslib.es6-e134354f.js → tslib.es6-11a0bbd3.js} +0 -0
- package/dist/esm/typings.d.ts +55 -6
- package/dist/hook-4f9a90b8.d.ts +12 -0
- package/dist/hook-4f9a90b8.js +140 -0
- package/dist/hook-f5b8fe4f.d.ts +61 -0
- package/dist/index.js +7 -1
- package/dist/intersection-observer-c983b2d1.d.ts +1 -0
- package/dist/intersection-observer-c983b2d1.js +893 -0
- package/dist/modern/Component.d.ts +1 -1
- package/dist/modern/Component.js +1 -0
- package/dist/modern/components/arrow/Component.js +1 -1
- package/dist/modern/components/arrow/index.css +3 -3
- package/dist/modern/components/base-select/Component.js +19 -14
- package/dist/modern/components/base-select/index.css +7 -7
- package/dist/modern/components/checkmark/Component.d.ts +1 -1
- package/dist/modern/components/checkmark/Component.js +12 -4
- package/dist/modern/components/checkmark/index.css +21 -9
- package/dist/modern/components/checkmark/index.js +1 -0
- package/dist/modern/components/field/Component.d.ts +1 -1
- package/dist/modern/components/field/Component.js +2 -2
- package/dist/modern/components/field/index.css +9 -9
- package/dist/modern/components/index.js +1 -0
- package/dist/modern/components/optgroup/Component.js +1 -1
- package/dist/modern/components/optgroup/index.css +6 -6
- package/dist/modern/components/option/Component.js +6 -4
- package/dist/modern/components/option/index.css +20 -20
- package/dist/modern/components/option/index.js +1 -0
- package/dist/modern/components/options-list/Component.js +11 -7
- package/dist/modern/components/options-list/index.css +9 -5
- package/dist/modern/components/virtual-options-list/Component.d.ts +1 -1
- package/dist/modern/components/virtual-options-list/Component.js +20 -17
- package/dist/modern/components/virtual-options-list/index.css +15 -12
- package/dist/modern/hook-cdda7a62.d.ts +12 -0
- package/dist/modern/hook-cdda7a62.js +132 -0
- package/dist/modern/hook-f5b8fe4f.d.ts +61 -0
- package/dist/modern/index.js +4 -0
- package/dist/modern/intersection-observer-2080f60e.d.ts +1 -0
- package/dist/modern/intersection-observer-2080f60e.js +891 -0
- package/dist/modern/presets/index.d.ts +1 -0
- package/dist/modern/presets/index.js +20 -0
- package/dist/modern/presets/useLazyLoading/hook.js +3 -893
- package/dist/modern/presets/useLazyLoading/index.css +2 -2
- package/dist/modern/presets/useSelectWithApply/hook.d.ts +0 -0
- package/dist/modern/presets/useSelectWithApply/hook.js +25 -0
- package/dist/modern/presets/useSelectWithApply/options-list-with-apply/Component.d.ts +0 -0
- package/dist/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +25 -0
- package/dist/modern/presets/useSelectWithApply/options-list-with-apply/index.css +39 -0
- package/dist/modern/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -0
- package/dist/modern/presets/useSelectWithApply/options-list-with-apply/index.js +25 -0
- package/dist/modern/presets/useSelectWithLoading/hook.js +2 -1
- package/dist/modern/presets/useSelectWithLoading/index.css +2 -2
- package/dist/modern/typings.d.ts +55 -6
- package/dist/presets/index.d.ts +1 -0
- package/dist/presets/index.js +23 -1
- package/dist/presets/useLazyLoading/hook.js +4 -894
- package/dist/presets/useLazyLoading/index.css +2 -2
- package/dist/presets/useSelectWithApply/hook.d.ts +0 -0
- package/dist/presets/useSelectWithApply/hook.js +35 -0
- package/dist/presets/useSelectWithApply/options-list-with-apply/Component.d.ts +0 -0
- package/dist/presets/useSelectWithApply/options-list-with-apply/Component.js +34 -0
- package/dist/presets/useSelectWithApply/options-list-with-apply/index.css +39 -0
- package/dist/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -0
- package/dist/presets/useSelectWithApply/options-list-with-apply/index.js +34 -0
- package/dist/presets/useSelectWithLoading/hook.js +3 -2
- package/dist/presets/useSelectWithLoading/index.css +2 -2
- package/dist/{tslib.es6-b50d38c9.d.ts → tslib.es6-edfcd771.d.ts} +0 -0
- package/dist/{tslib.es6-b50d38c9.js → tslib.es6-edfcd771.js} +0 -0
- package/dist/typings.d.ts +55 -6
- package/package.json +5 -3
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { _ as __rest, a as __assign, b as __spreadArrays } from './tslib.es6-11a0bbd3.js';
|
|
2
|
+
import React, { forwardRef, useRef, useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import cn from 'classnames';
|
|
4
|
+
import '@alfalab/hooks';
|
|
5
|
+
import '@alfalab/core-components-form-control/dist/esm';
|
|
6
|
+
import { processOptions } from './utils.js';
|
|
7
|
+
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
8
|
+
import { OptionsList } from './components/options-list/Component.js';
|
|
9
|
+
import '@alfalab/core-components-checkbox/dist/esm';
|
|
10
|
+
import './components/base-select/Component.js';
|
|
11
|
+
import './Component.js';
|
|
12
|
+
import 'react-virtual';
|
|
13
|
+
import '@alfalab/core-components-skeleton/dist/esm';
|
|
14
|
+
import './intersection-observer-2080f60e.js';
|
|
15
|
+
import { Button } from '@alfalab/core-components-button/dist/esm';
|
|
16
|
+
|
|
17
|
+
var styles = {"footer":"select__footer_1lf9t","withBorder":"select__withBorder_1lf9t"};
|
|
18
|
+
require('./presets/useSelectWithApply/options-list-with-apply/index.css')
|
|
19
|
+
|
|
20
|
+
var OptionsListWithApply = forwardRef(function (_a, ref) {
|
|
21
|
+
var _b;
|
|
22
|
+
var toggleMenu = _a.toggleMenu, _c = _a.OptionsList, OptionsList$1 = _c === void 0 ? OptionsList : _c, defaultGetOptionProps = _a.getOptionProps, _d = _a.showClear, showClear = _d === void 0 ? true : _d, _e = _a.selectedDraft, selectedDraft = _e === void 0 ? [] : _e, _f = _a.flatOptions, flatOptions = _f === void 0 ? [] : _f, _g = _a.onApply, onApply = _g === void 0 ? function () { return null; } : _g, _h = _a.onClear, onClear = _h === void 0 ? function () { return null; } : _h, _j = _a.onClose, onClose = _j === void 0 ? function () { return null; } : _j, _k = _a.visibleOptions, visibleOptions = _k === void 0 ? 5 : _k, restProps = __rest(_a, ["toggleMenu", "OptionsList", "getOptionProps", "showClear", "selectedDraft", "flatOptions", "onApply", "onClear", "onClose", "visibleOptions"]);
|
|
23
|
+
var footerRef = useRef(null);
|
|
24
|
+
var getOptionProps = useCallback(function (option, index) {
|
|
25
|
+
var optionProps = defaultGetOptionProps(option, index);
|
|
26
|
+
var selected = option.key === SELECT_ALL_KEY
|
|
27
|
+
? selectedDraft.length === flatOptions.length - 1
|
|
28
|
+
: selectedDraft.includes(option);
|
|
29
|
+
return __assign(__assign({}, optionProps), { selected: selected });
|
|
30
|
+
}, [defaultGetOptionProps, flatOptions.length, selectedDraft]);
|
|
31
|
+
var handleApply = useCallback(function () {
|
|
32
|
+
onApply();
|
|
33
|
+
toggleMenu();
|
|
34
|
+
}, [onApply, toggleMenu]);
|
|
35
|
+
var handleClear = useCallback(function () {
|
|
36
|
+
onClear();
|
|
37
|
+
toggleMenu();
|
|
38
|
+
}, [onClear, toggleMenu]);
|
|
39
|
+
useEffect(function () {
|
|
40
|
+
var activeElement = document.activeElement;
|
|
41
|
+
setTimeout(function () {
|
|
42
|
+
if (footerRef.current) {
|
|
43
|
+
footerRef.current.focus();
|
|
44
|
+
}
|
|
45
|
+
}, 0);
|
|
46
|
+
return function () {
|
|
47
|
+
onClose();
|
|
48
|
+
if (activeElement) {
|
|
49
|
+
activeElement.focus();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
53
|
+
}, []);
|
|
54
|
+
return (React.createElement(OptionsList$1, __assign({}, restProps, { ref: ref, visibleOptions: visibleOptions, toggleMenu: toggleMenu, flatOptions: flatOptions, getOptionProps: getOptionProps, footer: React.createElement("div", {
|
|
55
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
56
|
+
tabIndex: 0, className: cn(styles.footer, (_b = {},
|
|
57
|
+
_b[styles.withBorder] = visibleOptions && flatOptions.length > visibleOptions,
|
|
58
|
+
_b)), ref: footerRef },
|
|
59
|
+
React.createElement(Button, { size: 'xxs', view: 'primary', onClick: handleApply }, "\u041F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C"),
|
|
60
|
+
showClear && (React.createElement(Button, { size: 'xxs', view: 'secondary', onClick: handleClear }, "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C"))) })));
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
var SELECT_ALL_KEY = 'select_all';
|
|
64
|
+
var selectAllOption = { key: SELECT_ALL_KEY, content: 'Выбрать все' };
|
|
65
|
+
function useSelectWithApply(_a) {
|
|
66
|
+
var options = _a.options, selected = _a.selected, _b = _a.onChange, onChange = _b === void 0 ? function () { return null; } : _b, OptionsList = _a.OptionsList, _c = _a.showClear, showClear = _c === void 0 ? true : _c, _d = _a.showSelectAll, showSelectAll = _d === void 0 ? false : _d;
|
|
67
|
+
var _e = useMemo(function () { return processOptions(options, selected); }, [
|
|
68
|
+
options,
|
|
69
|
+
selected,
|
|
70
|
+
]), flatOptions = _e.flatOptions, selectedOptions = _e.selectedOptions;
|
|
71
|
+
var _f = useState(selectedOptions), selectedDraft = _f[0], setSelectedDraft = _f[1];
|
|
72
|
+
var selectedOptionsRef = useRef(selectedOptions);
|
|
73
|
+
var handleApply = useCallback(function () {
|
|
74
|
+
onChange({
|
|
75
|
+
selected: selectedDraft[0],
|
|
76
|
+
selectedMultiple: selectedDraft,
|
|
77
|
+
initiator: null,
|
|
78
|
+
});
|
|
79
|
+
}, [onChange, selectedDraft]);
|
|
80
|
+
var handleClear = useCallback(function () {
|
|
81
|
+
setSelectedDraft([]);
|
|
82
|
+
onChange({
|
|
83
|
+
selected: null,
|
|
84
|
+
selectedMultiple: [],
|
|
85
|
+
initiator: null,
|
|
86
|
+
});
|
|
87
|
+
}, [onChange]);
|
|
88
|
+
var handleChange = useCallback(function (_a) {
|
|
89
|
+
var initiator = _a.initiator, restArgs = __rest(_a, ["initiator"]);
|
|
90
|
+
if (!initiator) {
|
|
91
|
+
onChange(__assign({ initiator: null }, restArgs));
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
var initiatorSelected = selectedDraft.includes(initiator) ||
|
|
95
|
+
(initiator.key === SELECT_ALL_KEY && selectedDraft.length === flatOptions.length);
|
|
96
|
+
if (initiator.key === SELECT_ALL_KEY) {
|
|
97
|
+
setSelectedDraft(initiatorSelected ? [] : flatOptions);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
setSelectedDraft(initiatorSelected
|
|
101
|
+
? selectedDraft.filter(function (o) { return o !== initiator; })
|
|
102
|
+
: selectedDraft.concat(initiator));
|
|
103
|
+
}
|
|
104
|
+
}, [flatOptions, onChange, selectedDraft]);
|
|
105
|
+
var handleClose = useCallback(function () {
|
|
106
|
+
setSelectedDraft(selectedOptionsRef.current);
|
|
107
|
+
}, []);
|
|
108
|
+
useEffect(function () {
|
|
109
|
+
setSelectedDraft(selectedOptions);
|
|
110
|
+
selectedOptionsRef.current = selectedOptions;
|
|
111
|
+
}, [selectedOptions]);
|
|
112
|
+
var memoizedOptions = useMemo(function () { return (showSelectAll ? __spreadArrays([selectAllOption], options) : options); }, [options, showSelectAll]);
|
|
113
|
+
return {
|
|
114
|
+
OptionsList: OptionsListWithApply,
|
|
115
|
+
optionsListProps: {
|
|
116
|
+
OptionsList: OptionsList,
|
|
117
|
+
showClear: showClear && (selectedDraft.length > 0 || selectedOptions.length > 0),
|
|
118
|
+
onClear: handleClear,
|
|
119
|
+
onApply: handleApply,
|
|
120
|
+
onClose: handleClose,
|
|
121
|
+
selectedDraft: selectedDraft,
|
|
122
|
+
},
|
|
123
|
+
allowUnselect: true,
|
|
124
|
+
multiple: true,
|
|
125
|
+
options: memoizedOptions,
|
|
126
|
+
onChange: handleChange,
|
|
127
|
+
selected: selected,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export { OptionsListWithApply as O, SELECT_ALL_KEY as S, useSelectWithApply as u };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { OptionShape, BaseSelectProps } from "./index";
|
|
3
|
+
type useSelectWithApplyProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Список выбранных пунктов
|
|
6
|
+
*/
|
|
7
|
+
selected: BaseSelectProps['selected'];
|
|
8
|
+
/**
|
|
9
|
+
* Список вариантов выбора
|
|
10
|
+
*/
|
|
11
|
+
options: BaseSelectProps['options'];
|
|
12
|
+
/**
|
|
13
|
+
* Обработчик выбора
|
|
14
|
+
*/
|
|
15
|
+
onChange: BaseSelectProps['onChange'];
|
|
16
|
+
/**
|
|
17
|
+
* Компонент выпадающего меню
|
|
18
|
+
*/
|
|
19
|
+
OptionsList?: BaseSelectProps['OptionsList'];
|
|
20
|
+
/**
|
|
21
|
+
* Показывать кнопку очистки
|
|
22
|
+
*/
|
|
23
|
+
showClear?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Показывать пункт "Выбрать все"
|
|
26
|
+
*/
|
|
27
|
+
showSelectAll?: boolean;
|
|
28
|
+
};
|
|
29
|
+
declare const SELECT_ALL_KEY = "select_all";
|
|
30
|
+
declare function useSelectWithApply({ options, selected, onChange, OptionsList, showClear, showSelectAll, }: useSelectWithApplyProps): {
|
|
31
|
+
OptionsList: import("react").ForwardRefExoticComponent<import("./index").OptionsListProps & {
|
|
32
|
+
showClear?: boolean | undefined;
|
|
33
|
+
onApply?: (() => void) | undefined;
|
|
34
|
+
onClear?: (() => void) | undefined;
|
|
35
|
+
onClose?: (() => void) | undefined;
|
|
36
|
+
selectedDraft?: OptionShape[] | undefined;
|
|
37
|
+
OptionsList?: import("react").FC<import("./index").OptionsListProps & import("react").RefAttributes<unknown>> | undefined;
|
|
38
|
+
} & import("react").RefAttributes<unknown>>;
|
|
39
|
+
optionsListProps: {
|
|
40
|
+
OptionsList: import("react").FC<import("./index").OptionsListProps> | undefined;
|
|
41
|
+
showClear: boolean;
|
|
42
|
+
onClear: () => void;
|
|
43
|
+
onApply: () => void;
|
|
44
|
+
onClose: () => void;
|
|
45
|
+
selectedDraft: OptionShape[];
|
|
46
|
+
};
|
|
47
|
+
allowUnselect: boolean;
|
|
48
|
+
multiple: boolean;
|
|
49
|
+
options: (OptionShape | import("./index").GroupShape | {
|
|
50
|
+
key: string;
|
|
51
|
+
content: string;
|
|
52
|
+
})[];
|
|
53
|
+
onChange: (payload: {
|
|
54
|
+
selected: OptionShape | null;
|
|
55
|
+
selectedMultiple: OptionShape[];
|
|
56
|
+
initiator: OptionShape | null;
|
|
57
|
+
name?: string | undefined;
|
|
58
|
+
}) => void;
|
|
59
|
+
selected: string | OptionShape | (string | OptionShape)[] | null | undefined;
|
|
60
|
+
};
|
|
61
|
+
export { SELECT_ALL_KEY, useSelectWithApply };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './tslib.es6-
|
|
1
|
+
import './tslib.es6-11a0bbd3.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import '@alfalab/hooks';
|
|
@@ -10,6 +10,7 @@ export { Arrow } from './components/arrow/Component.js';
|
|
|
10
10
|
import 'react-merge-refs';
|
|
11
11
|
export { Optgroup } from './components/optgroup/Component.js';
|
|
12
12
|
export { OptionsList } from './components/options-list/Component.js';
|
|
13
|
+
import '@alfalab/core-components-checkbox/dist/esm';
|
|
13
14
|
import './components/checkmark/Component.js';
|
|
14
15
|
export { Option } from './components/option/Component.js';
|
|
15
16
|
import 'resize-observer';
|
|
@@ -22,4 +23,7 @@ import 'react-virtual';
|
|
|
22
23
|
export { VirtualOptionsList } from './components/virtual-options-list/Component.js';
|
|
23
24
|
import '@alfalab/core-components-skeleton/dist/esm';
|
|
24
25
|
export { useSelectWithLoading } from './presets/useSelectWithLoading/hook.js';
|
|
26
|
+
import './intersection-observer-2080f60e.js';
|
|
25
27
|
export { useLazyLoading } from './presets/useLazyLoading/hook.js';
|
|
28
|
+
import '@alfalab/core-components-button/dist/esm';
|
|
29
|
+
export { S as SELECT_ALL_KEY, u as useSelectWithApply } from './hook-a01ac265.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|