@alfalab/core-components-select 12.4.6 → 13.0.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/{Component-0adcc33f.d.ts → Component-395c666f.d.ts} +0 -0
- package/{Component-0adcc33f.js → Component-395c666f.js} +8 -13
- package/{cssm/Component-77d7e4fc.d.ts → Component-6cb15433.d.ts} +5 -5
- package/{Component-c9860dd6.js → Component-6cb15433.js} +28 -43
- package/Component-db573794.d.ts +73 -0
- package/Component.d.ts +10 -3
- package/Component.js +12 -12
- package/components/arrow/Component.js +1 -1
- package/components/arrow/index.css +3 -3
- package/components/base-select/Component.js +5 -5
- package/components/base-select/index.css +15 -9
- package/components/base-select/index.d.ts +1 -1
- package/components/base-select/index.js +5 -5
- package/components/base-select-mobile/Component.js +15 -15
- package/components/base-select-mobile/checkmark/Component.js +1 -1
- package/components/base-select-mobile/checkmark/index.css +4 -4
- package/components/base-select-mobile/index.css +12 -12
- package/components/base-select-mobile/index.d.ts +1 -1
- package/components/base-select-mobile/index.js +15 -15
- package/components/base-select-mobile/options-list/Component.js +2 -2
- package/components/base-select-mobile/options-list/index.css +9 -9
- package/components/base-select-mobile/options-list/index.js +1 -1
- package/components/checkmark/Component.js +1 -1
- package/components/checkmark/index.css +7 -7
- package/components/field/Component.d.ts +2 -22
- package/components/field/Component.js +3 -3
- package/components/field/index.css +9 -9
- package/components/field/index.js +2 -2
- package/components/index.js +18 -18
- package/components/native-select/Component.d.ts +2 -2
- package/components/native-select/Component.js +1 -1
- package/components/native-select/index.js +1 -1
- package/components/optgroup/Component.js +1 -1
- package/components/optgroup/index.css +6 -6
- package/components/option/Component.js +2 -2
- package/components/option/index.css +20 -20
- package/components/option/index.js +1 -1
- package/components/options-list/Component.js +13 -19
- package/components/options-list/index.css +6 -6
- package/components/options-list/index.js +3 -3
- package/components/select-mobile/Component.js +15 -15
- package/components/select-mobile/index.d.ts +1 -1
- package/components/select-mobile/index.js +15 -15
- package/components/select-modal-mobile/Component.js +15 -15
- package/components/select-modal-mobile/index.d.ts +1 -1
- package/components/select-modal-mobile/index.js +15 -15
- package/components/virtual-options-list/Component.js +7 -10
- package/components/virtual-options-list/index.css +12 -12
- package/components/virtual-options-list/index.js +2 -2
- package/{esm/Component-7abd68e3.d.ts → cssm/Component-095a346d.d.ts} +5 -5
- package/cssm/{Component-77d7e4fc.js → Component-095a346d.js} +28 -43
- package/cssm/Component-db573794.d.ts +73 -0
- package/cssm/{Component-4bd2b7ec.d.ts → Component-f4dd589a.d.ts} +0 -0
- package/cssm/{Component-4bd2b7ec.js → Component-f4dd589a.js} +7 -12
- package/cssm/Component.d.ts +10 -3
- package/cssm/Component.js +15 -15
- package/cssm/components/base-select/Component.js +5 -5
- package/cssm/components/base-select/index.d.ts +1 -1
- package/cssm/components/base-select/index.js +5 -5
- package/cssm/components/base-select/index.module.css +8 -2
- package/cssm/components/base-select-mobile/Component.js +20 -20
- package/cssm/components/base-select-mobile/index.d.ts +1 -1
- package/cssm/components/base-select-mobile/index.js +20 -20
- package/cssm/components/base-select-mobile/index.module.css +1 -1
- package/cssm/components/base-select-mobile/options-list/Component.js +1 -1
- package/cssm/components/base-select-mobile/options-list/index.js +1 -1
- package/cssm/components/field/Component.d.ts +2 -22
- package/cssm/components/field/Component.js +2 -2
- package/cssm/components/field/index.js +2 -2
- package/cssm/components/index.js +23 -23
- package/cssm/components/native-select/Component.d.ts +2 -2
- package/cssm/components/native-select/Component.js +1 -1
- package/cssm/components/native-select/index.js +1 -1
- package/cssm/components/option/Component.js +1 -1
- package/cssm/components/option/index.js +1 -1
- package/cssm/components/options-list/Component.js +12 -18
- package/cssm/components/options-list/index.js +3 -3
- package/cssm/components/select-mobile/Component.js +20 -20
- package/cssm/components/select-mobile/index.d.ts +1 -1
- package/cssm/components/select-mobile/index.js +20 -20
- package/cssm/components/select-modal-mobile/Component.js +20 -20
- package/cssm/components/select-modal-mobile/index.d.ts +1 -1
- package/cssm/components/select-modal-mobile/index.js +20 -20
- package/cssm/components/virtual-options-list/Component.js +6 -9
- package/cssm/components/virtual-options-list/index.js +2 -2
- package/cssm/{hook-f5b8fe4f.d.ts → hook-edac5428.d.ts} +2 -4
- package/cssm/index.js +23 -23
- package/cssm/presets/index.d.ts +1 -1
- package/cssm/presets/index.js +20 -20
- package/cssm/presets/useLazyLoading/hook.d.ts +2 -2
- package/cssm/presets/useLazyLoading/hook.js +4 -4
- package/cssm/presets/useSelectWithApply/hook.js +20 -20
- package/cssm/presets/useSelectWithApply/options-list-with-apply/Component.js +20 -20
- package/cssm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/cssm/presets/useSelectWithApply/options-list-with-apply/index.js +20 -20
- package/cssm/presets/useSelectWithLoading/hook.js +1 -1
- package/{esm/tslib.es6-babe1c35.d.ts → cssm/tslib.es6-0857346e.d.ts} +8 -4
- package/{tslib.es6-820c70b7.js → cssm/tslib.es6-0857346e.js} +12 -9
- package/cssm/typings.d.ts +2 -2
- package/cssm/utils.d.ts +2 -2
- package/{modern/Component-7a4219aa.d.ts → esm/Component-2cf53a63.d.ts} +5 -5
- package/esm/{Component-7abd68e3.js → Component-2cf53a63.js} +28 -43
- package/esm/{Component-4cadb402.d.ts → Component-878fd5fa.d.ts} +0 -0
- package/esm/{Component-4cadb402.js → Component-878fd5fa.js} +8 -13
- package/esm/Component-db573794.d.ts +73 -0
- package/esm/Component.d.ts +10 -3
- package/esm/Component.js +12 -12
- package/esm/components/arrow/Component.js +1 -1
- package/esm/components/arrow/index.css +3 -3
- package/esm/components/base-select/Component.js +5 -5
- package/esm/components/base-select/index.css +15 -9
- package/esm/components/base-select/index.d.ts +1 -1
- package/esm/components/base-select/index.js +5 -5
- package/esm/components/base-select-mobile/Component.js +15 -15
- package/esm/components/base-select-mobile/checkmark/Component.js +1 -1
- package/esm/components/base-select-mobile/checkmark/index.css +4 -4
- package/esm/components/base-select-mobile/index.css +12 -12
- package/esm/components/base-select-mobile/index.d.ts +1 -1
- package/esm/components/base-select-mobile/index.js +15 -15
- package/esm/components/base-select-mobile/options-list/Component.js +2 -2
- package/esm/components/base-select-mobile/options-list/index.css +9 -9
- package/esm/components/base-select-mobile/options-list/index.js +1 -1
- package/esm/components/checkmark/Component.js +1 -1
- package/esm/components/checkmark/index.css +7 -7
- package/esm/components/field/Component.d.ts +2 -22
- package/esm/components/field/Component.js +3 -3
- package/esm/components/field/index.css +9 -9
- package/esm/components/field/index.js +2 -2
- package/esm/components/index.js +15 -15
- package/esm/components/native-select/Component.d.ts +2 -2
- package/esm/components/native-select/Component.js +1 -1
- package/esm/components/native-select/index.js +1 -1
- package/esm/components/optgroup/Component.js +1 -1
- package/esm/components/optgroup/index.css +6 -6
- package/esm/components/option/Component.js +2 -2
- package/esm/components/option/index.css +20 -20
- package/esm/components/option/index.js +1 -1
- package/esm/components/options-list/Component.js +14 -20
- package/esm/components/options-list/index.css +6 -6
- package/esm/components/options-list/index.js +3 -3
- package/esm/components/select-mobile/Component.js +15 -15
- package/esm/components/select-mobile/index.d.ts +1 -1
- package/esm/components/select-mobile/index.js +15 -15
- package/esm/components/select-modal-mobile/Component.js +15 -15
- package/esm/components/select-modal-mobile/index.d.ts +1 -1
- package/esm/components/select-modal-mobile/index.js +15 -15
- package/esm/components/virtual-options-list/Component.js +7 -10
- package/esm/components/virtual-options-list/index.css +12 -12
- package/esm/components/virtual-options-list/index.js +2 -2
- package/{modern/hook-f5b8fe4f.d.ts → esm/hook-edac5428.d.ts} +2 -4
- package/esm/index.js +15 -15
- package/esm/{intersection-observer-47ac1624.d.ts → intersection-observer-5cff2265.d.ts} +0 -0
- package/esm/{intersection-observer-47ac1624.js → intersection-observer-5cff2265.js} +0 -0
- package/esm/presets/index.d.ts +1 -1
- package/esm/presets/index.js +15 -15
- package/esm/presets/useLazyLoading/hook.d.ts +2 -2
- package/esm/presets/useLazyLoading/hook.js +5 -5
- package/esm/presets/useLazyLoading/index.css +2 -2
- package/esm/presets/useSelectWithApply/hook.js +15 -15
- package/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +15 -15
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.css +4 -4
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.js +15 -15
- package/esm/presets/useSelectWithLoading/hook.js +2 -2
- package/esm/presets/useSelectWithLoading/index.css +2 -2
- package/{cssm/tslib.es6-f8106a15.d.ts → esm/tslib.es6-8ce25143.d.ts} +8 -4
- package/esm/{tslib.es6-babe1c35.js → tslib.es6-8ce25143.js} +12 -9
- package/esm/typings.d.ts +2 -2
- package/esm/utils.d.ts +2 -2
- package/{hook-f5b8fe4f.d.ts → hook-edac5428.d.ts} +2 -4
- package/index.js +18 -18
- package/{intersection-observer-f9d37e0f.d.ts → intersection-observer-ecb8338a.d.ts} +0 -0
- package/{intersection-observer-f9d37e0f.js → intersection-observer-ecb8338a.js} +0 -0
- package/modern/{Component-f424e3c6.d.ts → Component-42762c09.d.ts} +0 -0
- package/modern/{Component-f424e3c6.js → Component-42762c09.js} +19 -22
- package/{Component-c9860dd6.d.ts → modern/Component-afb04bfc.d.ts} +5 -5
- package/modern/{Component-7a4219aa.js → Component-afb04bfc.js} +43 -61
- package/modern/Component-db573794.d.ts +73 -0
- package/modern/Component.d.ts +10 -3
- package/modern/Component.js +12 -12
- package/modern/components/arrow/Component.js +1 -1
- package/modern/components/arrow/index.css +3 -3
- package/modern/components/base-select/Component.js +4 -4
- package/modern/components/base-select/index.css +15 -9
- package/modern/components/base-select/index.d.ts +1 -1
- package/modern/components/base-select/index.js +4 -4
- package/modern/components/base-select-mobile/Component.js +14 -14
- package/modern/components/base-select-mobile/checkmark/Component.js +1 -1
- package/modern/components/base-select-mobile/checkmark/index.css +4 -4
- package/modern/components/base-select-mobile/index.css +12 -12
- package/modern/components/base-select-mobile/index.d.ts +1 -1
- package/modern/components/base-select-mobile/index.js +14 -14
- package/modern/components/base-select-mobile/options-list/Component.js +2 -2
- package/modern/components/base-select-mobile/options-list/index.css +9 -9
- package/modern/components/checkmark/Component.js +1 -1
- package/modern/components/checkmark/index.css +7 -7
- package/modern/components/field/Component.d.ts +2 -22
- package/modern/components/field/Component.js +4 -4
- package/modern/components/field/index.css +9 -9
- package/modern/components/field/index.js +1 -1
- package/modern/components/index.js +14 -14
- package/modern/components/native-select/Component.d.ts +2 -2
- package/modern/components/native-select/Component.js +1 -1
- package/modern/components/optgroup/Component.js +1 -1
- package/modern/components/optgroup/index.css +6 -6
- package/modern/components/option/Component.js +3 -3
- package/modern/components/option/index.css +20 -20
- package/modern/components/options-list/Component.js +11 -15
- package/modern/components/options-list/index.css +6 -6
- package/modern/components/options-list/index.js +2 -2
- package/modern/components/select-mobile/Component.js +14 -14
- package/modern/components/select-mobile/index.d.ts +1 -1
- package/modern/components/select-mobile/index.js +14 -14
- package/modern/components/select-modal-mobile/Component.js +14 -14
- package/modern/components/select-modal-mobile/index.d.ts +1 -1
- package/modern/components/select-modal-mobile/index.js +14 -14
- package/modern/components/virtual-options-list/Component.js +18 -23
- package/modern/components/virtual-options-list/index.css +12 -12
- package/modern/components/virtual-options-list/index.js +1 -1
- package/{esm/hook-f5b8fe4f.d.ts → modern/hook-edac5428.d.ts} +2 -4
- package/modern/index.js +14 -14
- package/modern/{intersection-observer-47ac1624.d.ts → intersection-observer-5cff2265.d.ts} +0 -0
- package/modern/{intersection-observer-47ac1624.js → intersection-observer-5cff2265.js} +0 -0
- package/modern/presets/index.d.ts +1 -1
- package/modern/presets/index.js +14 -14
- package/modern/presets/useLazyLoading/hook.d.ts +2 -2
- package/modern/presets/useLazyLoading/hook.js +13 -15
- package/modern/presets/useLazyLoading/index.css +2 -2
- package/modern/presets/useSelectWithApply/hook.js +14 -14
- package/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +14 -14
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.css +4 -4
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.js +14 -14
- package/modern/presets/useSelectWithLoading/hook.js +2 -2
- package/modern/presets/useSelectWithLoading/index.css +2 -2
- package/modern/typings.d.ts +2 -2
- package/modern/utils.d.ts +2 -2
- package/modern/utils.js +1 -1
- package/package.json +8 -8
- package/presets/index.d.ts +1 -1
- package/presets/index.js +15 -15
- package/presets/useLazyLoading/hook.d.ts +2 -2
- package/presets/useLazyLoading/hook.js +5 -5
- package/presets/useLazyLoading/index.css +2 -2
- package/presets/useSelectWithApply/hook.js +15 -15
- package/presets/useSelectWithApply/options-list-with-apply/Component.js +15 -15
- package/presets/useSelectWithApply/options-list-with-apply/index.css +4 -4
- package/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/index.js +15 -15
- package/presets/useSelectWithLoading/hook.js +2 -2
- package/presets/useSelectWithLoading/index.css +2 -2
- package/{tslib.es6-820c70b7.d.ts → tslib.es6-401ce1ea.d.ts} +8 -4
- package/{cssm/tslib.es6-f8106a15.js → tslib.es6-401ce1ea.js} +12 -9
- package/typings.d.ts +2 -2
- package/utils.d.ts +2 -2
- package/Component-afce40e0.d.ts +0 -73
- package/cssm/Component-afce40e0.d.ts +0 -73
- package/esm/Component-afce40e0.d.ts +0 -73
- package/modern/Component-afce40e0.d.ts +0 -73
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { a as __assign } from '../../tslib.es6-
|
|
2
|
-
import React, { forwardRef,
|
|
1
|
+
import { a as __assign } from '../../tslib.es6-8ce25143.js';
|
|
2
|
+
import React, { forwardRef, useRef } from 'react';
|
|
3
3
|
import cn from 'classnames';
|
|
4
|
+
import mergeRefs from 'react-merge-refs';
|
|
4
5
|
import { useMedia } from '@alfalab/hooks';
|
|
5
6
|
import { useVisibleOptions, isGroup } from '../../utils.js';
|
|
6
|
-
import mergeRefs from 'react-merge-refs';
|
|
7
|
-
import { Scrollbar } from '@alfalab/core-components-scrollbar/esm';
|
|
8
7
|
import { Optgroup } from '../optgroup/Component.js';
|
|
8
|
+
import { Scrollbar } from '@alfalab/core-components-scrollbar/esm';
|
|
9
9
|
|
|
10
|
-
var styles = {"optionsList":"
|
|
10
|
+
var styles = {"optionsList":"select__optionsList_13ww0","scrollable":"select__scrollable_13ww0","emptyPlaceholder":"select__emptyPlaceholder_13ww0","l":"select__l_13ww0","xl":"select__xl_13ww0"};
|
|
11
11
|
require('./index.css')
|
|
12
12
|
|
|
13
13
|
var createCounter = function () {
|
|
@@ -19,24 +19,20 @@ var OptionsList = forwardRef(function (_a, ref) {
|
|
|
19
19
|
var _b = _a.size, size = _b === void 0 ? 's' : _b, className = _a.className, optionGroupClassName = _a.optionGroupClassName, Option = _a.Option, getOptionProps = _a.getOptionProps, _c = _a.options, options = _c === void 0 ? [] : _c, _d = _a.Optgroup, Optgroup$1 = _d === void 0 ? Optgroup : _d, dataTestId = _a.dataTestId, emptyPlaceholder = _a.emptyPlaceholder, _e = _a.visibleOptions, visibleOptions = _e === void 0 ? 5 : _e, onScroll = _a.onScroll, open = _a.open, header = _a.header, footer = _a.footer, optionsListWidth = _a.optionsListWidth, nativeScrollbarProp = _a.nativeScrollbar;
|
|
20
20
|
var nativeScrollbar = useMedia([[true, '(max-width: 1023px)']], false)[0];
|
|
21
21
|
nativeScrollbar = Boolean(nativeScrollbarProp !== null && nativeScrollbarProp !== void 0 ? nativeScrollbarProp : nativeScrollbar);
|
|
22
|
-
var renderOption =
|
|
22
|
+
var renderOption = function (option, index) { return (React.createElement(Option, __assign({ key: option.key }, getOptionProps(option, index)))); };
|
|
23
23
|
var listRef = useRef(null);
|
|
24
24
|
var scrollbarRef = useRef(null);
|
|
25
25
|
var counter = createCounter();
|
|
26
|
-
var renderGroup =
|
|
27
|
-
useVisibleOptions(__assign(__assign({}, (!nativeScrollbar && { styleTargetRef: scrollbarRef })), { visibleOptions: visibleOptions,
|
|
28
|
-
listRef: listRef,
|
|
29
|
-
open: open, invalidate: options }));
|
|
26
|
+
var renderGroup = function (group) { return (React.createElement(Optgroup$1, { className: optionGroupClassName, label: group.label, key: group.label, size: size }, group.options.map(function (option) { return renderOption(option, counter()); }))); };
|
|
27
|
+
useVisibleOptions(__assign(__assign({}, (!nativeScrollbar && { styleTargetRef: scrollbarRef })), { visibleOptions: visibleOptions, listRef: listRef, open: open, invalidate: options }));
|
|
30
28
|
if (options.length === 0 && !emptyPlaceholder) {
|
|
31
29
|
return null;
|
|
32
30
|
}
|
|
33
|
-
var renderListItems = function () {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
emptyPlaceholder && options.length === 0 && (React.createElement("div", { className: styles.emptyPlaceholder }, emptyPlaceholder))));
|
|
39
|
-
};
|
|
31
|
+
var renderListItems = function () { return (React.createElement(React.Fragment, null,
|
|
32
|
+
options.map(function (option) {
|
|
33
|
+
return isGroup(option) ? renderGroup(option) : renderOption(option, counter());
|
|
34
|
+
}),
|
|
35
|
+
emptyPlaceholder && options.length === 0 && (React.createElement("div", { className: styles.emptyPlaceholder }, emptyPlaceholder)))); };
|
|
40
36
|
var renderWithCustomScrollbar = function () {
|
|
41
37
|
var scrollableNodeProps = {
|
|
42
38
|
onScroll: onScroll,
|
|
@@ -45,9 +41,7 @@ var OptionsList = forwardRef(function (_a, ref) {
|
|
|
45
41
|
};
|
|
46
42
|
return (React.createElement(Scrollbar, { className: styles.scrollable, ref: scrollbarRef, horizontalAutoStretch: optionsListWidth === 'content', scrollableNodeProps: scrollableNodeProps, contentNodeProps: { ref: listRef } }, renderListItems()));
|
|
47
43
|
};
|
|
48
|
-
var renderWithNativeScrollbar = function () {
|
|
49
|
-
return (React.createElement("div", { className: styles.scrollable, ref: mergeRefs([listRef, ref]), onScroll: onScroll }, renderListItems()));
|
|
50
|
-
};
|
|
44
|
+
var renderWithNativeScrollbar = function () { return (React.createElement("div", { className: styles.scrollable, ref: mergeRefs([listRef, ref]), onScroll: onScroll }, renderListItems())); };
|
|
51
45
|
return (React.createElement("div", __assign({}, (nativeScrollbar && { 'data-test-id': dataTestId }), { className: cn(styles.optionsList, styles[size], className) }),
|
|
52
46
|
header,
|
|
53
47
|
nativeScrollbar ? renderWithNativeScrollbar() : renderWithCustomScrollbar(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1pxgv */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-text-secondary: rgba(11, 31, 53, 0.7);
|
|
4
4
|
}
|
|
@@ -26,21 +26,21 @@
|
|
|
26
26
|
|
|
27
27
|
/* optgroup */
|
|
28
28
|
}
|
|
29
|
-
.
|
|
29
|
+
.select__optionsList_13ww0 {
|
|
30
30
|
overflow: auto;
|
|
31
31
|
width: 100%;
|
|
32
32
|
outline: none;
|
|
33
33
|
box-sizing: border-box;
|
|
34
34
|
}
|
|
35
|
-
.
|
|
35
|
+
.select__scrollable_13ww0 {
|
|
36
36
|
overflow: auto;
|
|
37
37
|
width: 100%;
|
|
38
38
|
}
|
|
39
|
-
.
|
|
39
|
+
.select__emptyPlaceholder_13ww0 {
|
|
40
40
|
padding: var(--gap-m) var(--gap-s);
|
|
41
41
|
color: var(--select-options-list-empty-placeholder-color);
|
|
42
42
|
}
|
|
43
|
-
.
|
|
44
|
-
.
|
|
43
|
+
.select__l_13ww0 .select__emptyPlaceholder_13ww0,
|
|
44
|
+
.select__xl_13ww0 .select__emptyPlaceholder_13ww0 {
|
|
45
45
|
padding: var(--gap-xl) var(--gap-m);
|
|
46
46
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import '../../tslib.es6-
|
|
1
|
+
import '../../tslib.es6-8ce25143.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
|
+
import 'react-merge-refs';
|
|
4
5
|
import '@alfalab/hooks';
|
|
5
6
|
import '../../utils.js';
|
|
6
|
-
import 'react-merge-refs';
|
|
7
|
-
import '@alfalab/core-components-scrollbar/esm';
|
|
8
7
|
import '../optgroup/Component.js';
|
|
8
|
+
import '@alfalab/core-components-scrollbar/esm';
|
|
9
9
|
export { OptionsList } from './Component.js';
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import '../../tslib.es6-
|
|
1
|
+
import '../../tslib.es6-8ce25143.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
|
-
import '@alfalab/hooks';
|
|
5
|
-
import '@alfalab/core-components-form-control/esm';
|
|
6
|
-
import '../../utils.js';
|
|
7
|
-
import '../field/Component.js';
|
|
8
4
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
9
5
|
import '../arrow/Component.js';
|
|
10
6
|
import 'react-merge-refs';
|
|
11
|
-
import '@
|
|
7
|
+
import '@juggle/resize-observer';
|
|
8
|
+
import 'downshift';
|
|
9
|
+
import '@alfalab/core-components-popover/esm';
|
|
10
|
+
import '@alfalab/hooks';
|
|
11
|
+
import '../../Component-878fd5fa.js';
|
|
12
|
+
import '../../utils.js';
|
|
13
|
+
import '../native-select/Component.js';
|
|
14
|
+
import '@alfalab/core-components-form-control/esm';
|
|
15
|
+
import '../field/Component.js';
|
|
12
16
|
import '../optgroup/Component.js';
|
|
13
|
-
import '../options-list/Component.js';
|
|
14
17
|
import '@alfalab/core-components-checkbox/esm';
|
|
15
18
|
import '../checkmark/Component.js';
|
|
16
19
|
import '../option/Component.js';
|
|
17
|
-
import '@
|
|
18
|
-
import '
|
|
19
|
-
import 'downshift';
|
|
20
|
-
import '../native-select/Component.js';
|
|
21
|
-
import '../../Component-4cadb402.js';
|
|
20
|
+
import '@alfalab/core-components-scrollbar/esm';
|
|
21
|
+
import '../options-list/Component.js';
|
|
22
22
|
import '../../Component.js';
|
|
23
23
|
import '@alfalab/core-components-bottom-sheet/esm';
|
|
24
24
|
import '@alfalab/core-components-modal/esm/mobile';
|
|
25
25
|
import '@alfalab/core-components-button/esm';
|
|
26
|
+
export { S as SelectMobile } from '../../Component-2cf53a63.js';
|
|
27
|
+
import '../base-select-mobile/checkmark/Component.js';
|
|
26
28
|
import '@alfalab/core-components-base-modal/esm';
|
|
27
29
|
import '../base-select-mobile/options-list/Component.js';
|
|
28
|
-
import '../base-select-mobile/checkmark/Component.js';
|
|
29
|
-
export { S as SelectMobile } from '../../Component-7abd68e3.js';
|
|
30
30
|
import 'react-virtual';
|
|
31
31
|
import '@alfalab/core-components-skeleton/esm';
|
|
32
|
-
import '../../intersection-observer-
|
|
32
|
+
import '../../intersection-observer-5cff2265.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../../Component-
|
|
1
|
+
export * from "../../Component-2cf53a63";
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import '../../tslib.es6-
|
|
1
|
+
import '../../tslib.es6-8ce25143.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
|
-
import '@alfalab/hooks';
|
|
5
|
-
import '@alfalab/core-components-form-control/esm';
|
|
6
|
-
import '../../utils.js';
|
|
7
|
-
import '../field/Component.js';
|
|
8
4
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
9
5
|
import '../arrow/Component.js';
|
|
10
6
|
import 'react-merge-refs';
|
|
11
|
-
import '@
|
|
7
|
+
import '@juggle/resize-observer';
|
|
8
|
+
import 'downshift';
|
|
9
|
+
import '@alfalab/core-components-popover/esm';
|
|
10
|
+
import '@alfalab/hooks';
|
|
11
|
+
import '../../Component-878fd5fa.js';
|
|
12
|
+
import '../../utils.js';
|
|
13
|
+
import '../native-select/Component.js';
|
|
14
|
+
import '@alfalab/core-components-form-control/esm';
|
|
15
|
+
import '../field/Component.js';
|
|
12
16
|
import '../optgroup/Component.js';
|
|
13
|
-
import '../options-list/Component.js';
|
|
14
17
|
import '@alfalab/core-components-checkbox/esm';
|
|
15
18
|
import '../checkmark/Component.js';
|
|
16
19
|
import '../option/Component.js';
|
|
17
|
-
import '@
|
|
18
|
-
import '
|
|
19
|
-
import 'downshift';
|
|
20
|
-
import '../native-select/Component.js';
|
|
21
|
-
import '../../Component-4cadb402.js';
|
|
20
|
+
import '@alfalab/core-components-scrollbar/esm';
|
|
21
|
+
import '../options-list/Component.js';
|
|
22
22
|
import '../../Component.js';
|
|
23
23
|
import '@alfalab/core-components-bottom-sheet/esm';
|
|
24
24
|
import '@alfalab/core-components-modal/esm/mobile';
|
|
25
25
|
import '@alfalab/core-components-button/esm';
|
|
26
|
+
export { S as SelectMobile } from '../../Component-2cf53a63.js';
|
|
27
|
+
import '../base-select-mobile/checkmark/Component.js';
|
|
26
28
|
import '@alfalab/core-components-base-modal/esm';
|
|
27
29
|
import '../base-select-mobile/options-list/Component.js';
|
|
28
|
-
import '../base-select-mobile/checkmark/Component.js';
|
|
29
|
-
export { S as SelectMobile } from '../../Component-7abd68e3.js';
|
|
30
30
|
import 'react-virtual';
|
|
31
31
|
import '@alfalab/core-components-skeleton/esm';
|
|
32
|
-
import '../../intersection-observer-
|
|
32
|
+
import '../../intersection-observer-5cff2265.js';
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import '../../tslib.es6-
|
|
1
|
+
import '../../tslib.es6-8ce25143.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
|
-
import '@alfalab/hooks';
|
|
5
|
-
import '@alfalab/core-components-form-control/esm';
|
|
6
|
-
import '../../utils.js';
|
|
7
|
-
import '../field/Component.js';
|
|
8
4
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
9
5
|
import '../arrow/Component.js';
|
|
10
6
|
import 'react-merge-refs';
|
|
11
|
-
import '@
|
|
7
|
+
import '@juggle/resize-observer';
|
|
8
|
+
import 'downshift';
|
|
9
|
+
import '@alfalab/core-components-popover/esm';
|
|
10
|
+
import '@alfalab/hooks';
|
|
11
|
+
import '../../Component-878fd5fa.js';
|
|
12
|
+
import '../../utils.js';
|
|
13
|
+
import '../native-select/Component.js';
|
|
14
|
+
import '@alfalab/core-components-form-control/esm';
|
|
15
|
+
import '../field/Component.js';
|
|
12
16
|
import '../optgroup/Component.js';
|
|
13
|
-
import '../options-list/Component.js';
|
|
14
17
|
import '@alfalab/core-components-checkbox/esm';
|
|
15
18
|
import '../checkmark/Component.js';
|
|
16
19
|
import '../option/Component.js';
|
|
17
|
-
import '@
|
|
18
|
-
import '
|
|
19
|
-
import 'downshift';
|
|
20
|
-
import '../native-select/Component.js';
|
|
21
|
-
import '../../Component-4cadb402.js';
|
|
20
|
+
import '@alfalab/core-components-scrollbar/esm';
|
|
21
|
+
import '../options-list/Component.js';
|
|
22
22
|
import '../../Component.js';
|
|
23
23
|
import '@alfalab/core-components-bottom-sheet/esm';
|
|
24
24
|
import '@alfalab/core-components-modal/esm/mobile';
|
|
25
25
|
import '@alfalab/core-components-button/esm';
|
|
26
|
+
export { a as SelectModalMobile } from '../../Component-2cf53a63.js';
|
|
27
|
+
import '../base-select-mobile/checkmark/Component.js';
|
|
26
28
|
import '@alfalab/core-components-base-modal/esm';
|
|
27
29
|
import '../base-select-mobile/options-list/Component.js';
|
|
28
|
-
import '../base-select-mobile/checkmark/Component.js';
|
|
29
|
-
export { a as SelectModalMobile } from '../../Component-7abd68e3.js';
|
|
30
30
|
import 'react-virtual';
|
|
31
31
|
import '@alfalab/core-components-skeleton/esm';
|
|
32
|
-
import '../../intersection-observer-
|
|
32
|
+
import '../../intersection-observer-5cff2265.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../../Component-
|
|
1
|
+
export * from "../../Component-2cf53a63";
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import '../../tslib.es6-
|
|
1
|
+
import '../../tslib.es6-8ce25143.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
|
-
import '@alfalab/hooks';
|
|
5
|
-
import '@alfalab/core-components-form-control/esm';
|
|
6
|
-
import '../../utils.js';
|
|
7
|
-
import '../field/Component.js';
|
|
8
4
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
9
5
|
import '../arrow/Component.js';
|
|
10
6
|
import 'react-merge-refs';
|
|
11
|
-
import '@
|
|
7
|
+
import '@juggle/resize-observer';
|
|
8
|
+
import 'downshift';
|
|
9
|
+
import '@alfalab/core-components-popover/esm';
|
|
10
|
+
import '@alfalab/hooks';
|
|
11
|
+
import '../../Component-878fd5fa.js';
|
|
12
|
+
import '../../utils.js';
|
|
13
|
+
import '../native-select/Component.js';
|
|
14
|
+
import '@alfalab/core-components-form-control/esm';
|
|
15
|
+
import '../field/Component.js';
|
|
12
16
|
import '../optgroup/Component.js';
|
|
13
|
-
import '../options-list/Component.js';
|
|
14
17
|
import '@alfalab/core-components-checkbox/esm';
|
|
15
18
|
import '../checkmark/Component.js';
|
|
16
19
|
import '../option/Component.js';
|
|
17
|
-
import '@
|
|
18
|
-
import '
|
|
19
|
-
import 'downshift';
|
|
20
|
-
import '../native-select/Component.js';
|
|
21
|
-
import '../../Component-4cadb402.js';
|
|
20
|
+
import '@alfalab/core-components-scrollbar/esm';
|
|
21
|
+
import '../options-list/Component.js';
|
|
22
22
|
import '../../Component.js';
|
|
23
23
|
import '@alfalab/core-components-bottom-sheet/esm';
|
|
24
24
|
import '@alfalab/core-components-modal/esm/mobile';
|
|
25
25
|
import '@alfalab/core-components-button/esm';
|
|
26
|
+
export { a as SelectModalMobile } from '../../Component-2cf53a63.js';
|
|
27
|
+
import '../base-select-mobile/checkmark/Component.js';
|
|
26
28
|
import '@alfalab/core-components-base-modal/esm';
|
|
27
29
|
import '../base-select-mobile/options-list/Component.js';
|
|
28
|
-
import '../base-select-mobile/checkmark/Component.js';
|
|
29
|
-
export { a as SelectModalMobile } from '../../Component-7abd68e3.js';
|
|
30
30
|
import 'react-virtual';
|
|
31
31
|
import '@alfalab/core-components-skeleton/esm';
|
|
32
|
-
import '../../intersection-observer-
|
|
32
|
+
import '../../intersection-observer-5cff2265.js';
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { a as __assign } from '../../tslib.es6-
|
|
1
|
+
import { a as __assign } from '../../tslib.es6-8ce25143.js';
|
|
2
2
|
import React, { useRef, useState, useEffect, useMemo } from 'react';
|
|
3
3
|
import cn from 'classnames';
|
|
4
4
|
import { useMedia } from '@alfalab/hooks';
|
|
5
5
|
import { usePrevious, lastIndexOf, useVisibleOptions, isGroup } from '../../utils.js';
|
|
6
|
-
import { Scrollbar } from '@alfalab/core-components-scrollbar/esm';
|
|
7
6
|
import { Optgroup } from '../optgroup/Component.js';
|
|
7
|
+
import { Scrollbar } from '@alfalab/core-components-scrollbar/esm';
|
|
8
8
|
import { useVirtual } from 'react-virtual';
|
|
9
9
|
|
|
10
|
-
var styles = {"virtualOptionsList":"
|
|
10
|
+
var styles = {"virtualOptionsList":"select__virtualOptionsList_bkmps","scrollable":"select__scrollable_bkmps","inner":"select__inner_bkmps","virtualRow":"select__virtualRow_bkmps","highlighted":"select__highlighted_bkmps","emptyPlaceholder":"select__emptyPlaceholder_bkmps","l":"select__l_bkmps","xl":"select__xl_bkmps"};
|
|
11
11
|
require('./index.css')
|
|
12
12
|
|
|
13
13
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
14
15
|
var VirtualOptionsList = function (_a) {
|
|
15
16
|
var _b = _a.size, size = _b === void 0 ? 's' : _b, _c = _a.flatOptions, flatOptions = _c === void 0 ? [] : _c, _d = _a.highlightedIndex, highlightedIndex = _d === void 0 ? -1 : _d, className = _a.className, getOptionProps = _a.getOptionProps, Option = _a.Option, open = _a.open, _e = _a.options, options = _e === void 0 ? [] : _e, _f = _a.overscan, overscan = _f === void 0 ? 10 : _f, _g = _a.Optgroup, Optgroup$1 = _g === void 0 ? Optgroup : _g, dataTestId = _a.dataTestId, emptyPlaceholder = _a.emptyPlaceholder, _h = _a.visibleOptions, visibleOptions = _h === void 0 ? 5 : _h, onScroll = _a.onScroll, header = _a.header, footer = _a.footer, nativeScrollbarProp = _a.nativeScrollbar;
|
|
16
17
|
var listRef = useRef(null);
|
|
@@ -101,13 +102,9 @@ var VirtualOptionsList = function (_a) {
|
|
|
101
102
|
!isGroup(option) && React.createElement(Option, __assign({}, getOptionProps(option, virtualRow.index)))));
|
|
102
103
|
});
|
|
103
104
|
};
|
|
104
|
-
var renderWithCustomScrollbar = function () {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
var renderWithNativeScrollbar = function () {
|
|
108
|
-
return (React.createElement("div", { className: styles.scrollable, ref: parentRef, onScroll: onScroll },
|
|
109
|
-
React.createElement("div", __assign({}, contentNodeProps), renderList())));
|
|
110
|
-
};
|
|
105
|
+
var renderWithCustomScrollbar = function () { return (React.createElement(Scrollbar, { className: styles.scrollable, ref: scrollbarRef, scrollableNodeProps: { onScroll: onScroll, ref: parentRef }, contentNodeProps: contentNodeProps }, renderList())); };
|
|
106
|
+
var renderWithNativeScrollbar = function () { return (React.createElement("div", { className: styles.scrollable, ref: parentRef, onScroll: onScroll },
|
|
107
|
+
React.createElement("div", __assign({}, contentNodeProps), renderList()))); };
|
|
111
108
|
return (React.createElement("div", { className: cn(styles.virtualOptionsList, styles[size], className), "data-test-id": dataTestId },
|
|
112
109
|
header,
|
|
113
110
|
nativeScrollbar ? renderWithNativeScrollbar() : renderWithCustomScrollbar(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1dvgm */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-border-primary: #dbdee1;
|
|
4
4
|
--color-light-text-secondary: rgba(11, 31, 53, 0.7);
|
|
@@ -32,27 +32,27 @@
|
|
|
32
32
|
|
|
33
33
|
/* optgroup */
|
|
34
34
|
}
|
|
35
|
-
.
|
|
35
|
+
.select__virtualOptionsList_bkmps {
|
|
36
36
|
width: 100%;
|
|
37
37
|
outline: none;
|
|
38
38
|
box-sizing: border-box;
|
|
39
39
|
position: relative;
|
|
40
40
|
}
|
|
41
|
-
.
|
|
41
|
+
.select__scrollable_bkmps {
|
|
42
42
|
overflow: auto;
|
|
43
43
|
width: 100%;
|
|
44
44
|
}
|
|
45
|
-
.
|
|
45
|
+
.select__inner_bkmps {
|
|
46
46
|
position: relative;
|
|
47
47
|
width: 100%;
|
|
48
48
|
}
|
|
49
|
-
.
|
|
49
|
+
.select__virtualRow_bkmps {
|
|
50
50
|
position: absolute;
|
|
51
51
|
top: 0;
|
|
52
52
|
left: 0;
|
|
53
53
|
width: 100%
|
|
54
54
|
}
|
|
55
|
-
.
|
|
55
|
+
.select__virtualRow_bkmps:before {
|
|
56
56
|
content: '';
|
|
57
57
|
position: absolute;
|
|
58
58
|
z-index: 1;
|
|
@@ -63,18 +63,18 @@
|
|
|
63
63
|
background: var(--select-option-divider-background);
|
|
64
64
|
display: var(--select-option-divider-display);
|
|
65
65
|
}
|
|
66
|
-
.
|
|
66
|
+
.select__virtualRow_bkmps:first-child:before {
|
|
67
67
|
display: none;
|
|
68
68
|
}
|
|
69
|
-
.
|
|
70
|
-
.
|
|
69
|
+
.select__highlighted_bkmps:before,
|
|
70
|
+
.select__highlighted_bkmps + .select__virtualRow_bkmps:before {
|
|
71
71
|
display: none;
|
|
72
72
|
}
|
|
73
|
-
.
|
|
73
|
+
.select__emptyPlaceholder_bkmps {
|
|
74
74
|
padding: var(--gap-m) var(--gap-s);
|
|
75
75
|
color: var(--select-options-list-empty-placeholder-color);
|
|
76
76
|
}
|
|
77
|
-
.
|
|
78
|
-
.
|
|
77
|
+
.select__l_bkmps .select__emptyPlaceholder_bkmps,
|
|
78
|
+
.select__xl_bkmps .select__emptyPlaceholder_bkmps {
|
|
79
79
|
padding: var(--gap-xl) var(--gap-m);
|
|
80
80
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import '../../tslib.es6-
|
|
1
|
+
import '../../tslib.es6-8ce25143.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import '@alfalab/hooks';
|
|
5
5
|
import '../../utils.js';
|
|
6
|
-
import '@alfalab/core-components-scrollbar/esm';
|
|
7
6
|
import '../optgroup/Component.js';
|
|
7
|
+
import '@alfalab/core-components-scrollbar/esm';
|
|
8
8
|
import 'react-virtual';
|
|
9
9
|
export { VirtualOptionsList } from './Component.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { BaseSelectProps, OptionShape } from "./index";
|
|
3
3
|
type useSelectWithApplyProps = {
|
|
4
4
|
/**
|
|
5
5
|
* Список выбранных пунктов
|
|
@@ -32,9 +32,7 @@ declare function useSelectWithApply({ options, selected, onChange, OptionsList,
|
|
|
32
32
|
showClear?: boolean | undefined;
|
|
33
33
|
onClose?: (() => void) | undefined;
|
|
34
34
|
selectedDraft?: OptionShape[] | undefined;
|
|
35
|
-
OptionsList?: import("react").FC<import("./index").OptionsListProps & import("react").RefAttributes<unknown>> | undefined;
|
|
36
|
-
* Показывать кнопку очистки
|
|
37
|
-
*/
|
|
35
|
+
OptionsList?: import("react").FC<import("./index").OptionsListProps & import("react").RefAttributes<unknown>> | undefined;
|
|
38
36
|
} & import("react").RefAttributes<unknown>>;
|
|
39
37
|
optionsListProps: {
|
|
40
38
|
OptionsList: import("react").FC<import("./index").OptionsListProps> | undefined;
|
package/esm/index.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import './tslib.es6-
|
|
1
|
+
import './tslib.es6-8ce25143.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
|
-
import '@alfalab/hooks';
|
|
5
|
-
import '@alfalab/core-components-form-control/esm';
|
|
6
|
-
export { isGroup, isOptionShape, joinOptions, lastIndexOf, processOptions, usePrevious, useVisibleOptions } from './utils.js';
|
|
7
|
-
export { Field } from './components/field/Component.js';
|
|
8
4
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
9
5
|
export { Arrow } from './components/arrow/Component.js';
|
|
10
6
|
import 'react-merge-refs';
|
|
11
|
-
import '@
|
|
7
|
+
import '@juggle/resize-observer';
|
|
8
|
+
import 'downshift';
|
|
9
|
+
import '@alfalab/core-components-popover/esm';
|
|
10
|
+
import '@alfalab/hooks';
|
|
11
|
+
export { B as BaseSelect } from './Component-878fd5fa.js';
|
|
12
|
+
export { isGroup, isOptionShape, joinOptions, lastIndexOf, processOptions, usePrevious, useVisibleOptions } from './utils.js';
|
|
13
|
+
import './components/native-select/Component.js';
|
|
14
|
+
import '@alfalab/core-components-form-control/esm';
|
|
15
|
+
export { Field } from './components/field/Component.js';
|
|
12
16
|
export { Optgroup } from './components/optgroup/Component.js';
|
|
13
|
-
export { OptionsList } from './components/options-list/Component.js';
|
|
14
17
|
import '@alfalab/core-components-checkbox/esm';
|
|
15
18
|
import './components/checkmark/Component.js';
|
|
16
19
|
export { Option } from './components/option/Component.js';
|
|
17
|
-
import '@
|
|
18
|
-
|
|
19
|
-
import 'downshift';
|
|
20
|
-
import './components/native-select/Component.js';
|
|
21
|
-
export { B as BaseSelect } from './Component-4cadb402.js';
|
|
20
|
+
import '@alfalab/core-components-scrollbar/esm';
|
|
21
|
+
export { OptionsList } from './components/options-list/Component.js';
|
|
22
22
|
export { Select } from './Component.js';
|
|
23
23
|
import '@alfalab/core-components-bottom-sheet/esm';
|
|
24
24
|
import '@alfalab/core-components-modal/esm/mobile';
|
|
25
25
|
import '@alfalab/core-components-button/esm';
|
|
26
|
+
export { b as SELECT_ALL_KEY, S as SelectMobile, a as SelectModalMobile, u as useSelectWithApply } from './Component-2cf53a63.js';
|
|
27
|
+
import './components/base-select-mobile/checkmark/Component.js';
|
|
26
28
|
import '@alfalab/core-components-base-modal/esm';
|
|
27
29
|
import './components/base-select-mobile/options-list/Component.js';
|
|
28
|
-
import './components/base-select-mobile/checkmark/Component.js';
|
|
29
|
-
export { b as SELECT_ALL_KEY, S as SelectMobile, a as SelectModalMobile, u as useSelectWithApply } from './Component-7abd68e3.js';
|
|
30
30
|
import 'react-virtual';
|
|
31
31
|
export { VirtualOptionsList } from './components/virtual-options-list/Component.js';
|
|
32
32
|
import '@alfalab/core-components-skeleton/esm';
|
|
33
33
|
export { useSelectWithLoading } from './presets/useSelectWithLoading/hook.js';
|
|
34
|
-
import './intersection-observer-47ac1624.js';
|
|
35
34
|
export { useLazyLoading } from './presets/useLazyLoading/hook.js';
|
|
35
|
+
import './intersection-observer-5cff2265.js';
|
|
File without changes
|
|
File without changes
|
package/esm/presets/index.d.ts
CHANGED
package/esm/presets/index.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import '../tslib.es6-
|
|
1
|
+
import '../tslib.es6-8ce25143.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
|
-
import '@alfalab/hooks';
|
|
5
|
-
import '@alfalab/core-components-form-control/esm';
|
|
6
|
-
import '../utils.js';
|
|
7
|
-
import '../components/field/Component.js';
|
|
8
4
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
9
5
|
import '../components/arrow/Component.js';
|
|
10
6
|
import 'react-merge-refs';
|
|
11
|
-
import '@
|
|
7
|
+
import '@juggle/resize-observer';
|
|
8
|
+
import 'downshift';
|
|
9
|
+
import '@alfalab/core-components-popover/esm';
|
|
10
|
+
import '@alfalab/hooks';
|
|
11
|
+
import '../Component-878fd5fa.js';
|
|
12
|
+
import '../utils.js';
|
|
13
|
+
import '../components/native-select/Component.js';
|
|
14
|
+
import '@alfalab/core-components-form-control/esm';
|
|
15
|
+
import '../components/field/Component.js';
|
|
12
16
|
import '../components/optgroup/Component.js';
|
|
13
|
-
import '../components/options-list/Component.js';
|
|
14
17
|
import '@alfalab/core-components-checkbox/esm';
|
|
15
18
|
import '../components/checkmark/Component.js';
|
|
16
19
|
import '../components/option/Component.js';
|
|
17
|
-
import '@
|
|
18
|
-
import '
|
|
19
|
-
import 'downshift';
|
|
20
|
-
import '../components/native-select/Component.js';
|
|
21
|
-
import '../Component-4cadb402.js';
|
|
20
|
+
import '@alfalab/core-components-scrollbar/esm';
|
|
21
|
+
import '../components/options-list/Component.js';
|
|
22
22
|
import '../Component.js';
|
|
23
23
|
import '@alfalab/core-components-bottom-sheet/esm';
|
|
24
24
|
import '@alfalab/core-components-modal/esm/mobile';
|
|
25
25
|
import '@alfalab/core-components-button/esm';
|
|
26
|
+
export { b as SELECT_ALL_KEY, u as useSelectWithApply } from '../Component-2cf53a63.js';
|
|
27
|
+
import '../components/base-select-mobile/checkmark/Component.js';
|
|
26
28
|
import '@alfalab/core-components-base-modal/esm';
|
|
27
29
|
import '../components/base-select-mobile/options-list/Component.js';
|
|
28
|
-
import '../components/base-select-mobile/checkmark/Component.js';
|
|
29
|
-
export { b as SELECT_ALL_KEY, u as useSelectWithApply } from '../Component-7abd68e3.js';
|
|
30
30
|
import 'react-virtual';
|
|
31
31
|
import '@alfalab/core-components-skeleton/esm';
|
|
32
32
|
export { useSelectWithLoading } from './useSelectWithLoading/hook.js';
|
|
33
|
-
import '../intersection-observer-47ac1624.js';
|
|
34
33
|
export { useLazyLoading } from './useLazyLoading/hook.js';
|
|
34
|
+
import '../intersection-observer-5cff2265.js';
|
|
@@ -22,7 +22,7 @@ type useLazyLoadingProps = {
|
|
|
22
22
|
* hasMore - указывает, есть ли еще незагруженные элементы (в случае false перестает загружать "следующую страницу")
|
|
23
23
|
* }>
|
|
24
24
|
*/
|
|
25
|
-
optionsFetcher
|
|
25
|
+
optionsFetcher(offset: number, limit: number, queryString?: string): Promise<OptionsFetcherResponse>;
|
|
26
26
|
};
|
|
27
27
|
declare function useLazyLoading({ limit, initialOffset, optionsFetcher, skeleton, }: useLazyLoadingProps): {
|
|
28
28
|
optionsProps: {
|
|
@@ -38,7 +38,7 @@ declare function useLazyLoading({ limit, initialOffset, optionsFetcher, skeleton
|
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
onOpen: (payload: {
|
|
41
|
-
open?: boolean
|
|
41
|
+
open?: boolean;
|
|
42
42
|
}) => void;
|
|
43
43
|
};
|
|
44
44
|
reset: () => void;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { a as __assign, b as
|
|
1
|
+
import { a as __assign, b as __spreadArray } from '../../tslib.es6-8ce25143.js';
|
|
2
2
|
import React, { useReducer, useRef, useCallback, useEffect, useMemo } from 'react';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import '@alfalab/core-components-checkbox/esm';
|
|
5
5
|
import '../../components/checkmark/Component.js';
|
|
6
6
|
import { Option } from '../../components/option/Component.js';
|
|
7
7
|
import { Skeleton } from '@alfalab/core-components-skeleton/esm';
|
|
8
|
-
import '../../intersection-observer-
|
|
8
|
+
import '../../intersection-observer-5cff2265.js';
|
|
9
9
|
|
|
10
|
-
var styles = {"skeleton":"
|
|
10
|
+
var styles = {"skeleton":"select__skeleton_1uz0l"};
|
|
11
11
|
require('./index.css')
|
|
12
12
|
|
|
13
13
|
var DEBOUNCE_TIMEOUT = 300;
|
|
@@ -52,7 +52,7 @@ function useLazyLoading(_a) {
|
|
|
52
52
|
return __assign(__assign({}, state), { loading: false });
|
|
53
53
|
}
|
|
54
54
|
case 'FETCH_OPTIONS_SUCCESS': {
|
|
55
|
-
return __assign(__assign({}, state), { options:
|
|
55
|
+
return __assign(__assign({}, state), { options: __spreadArray(__spreadArray([], state.options, true), action.payload.options, true), offset: state.offset + (action.payload.options.length ? 1 : 0), allOptionsLoaded: !action.payload.hasMore, loading: false });
|
|
56
56
|
}
|
|
57
57
|
case 'SET_IS_OPENED': {
|
|
58
58
|
return __assign(__assign({}, state), { opened: action.payload });
|
|
@@ -184,7 +184,7 @@ function useLazyLoading(_a) {
|
|
|
184
184
|
return {
|
|
185
185
|
optionsProps: {
|
|
186
186
|
Option: renderOption,
|
|
187
|
-
options:
|
|
187
|
+
options: __spreadArray(__spreadArray([], options, true), skeletonOptions, true),
|
|
188
188
|
optionsListProps: {
|
|
189
189
|
ref: listRef,
|
|
190
190
|
inputProps: {
|