@alfalab/core-components-select 15.2.0 → 15.2.1
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-89f0cb07.d.ts +38 -0
- package/Component.mobile-ebda875c.d.ts +4 -4
- package/Component.mobile-f1f15074.d.ts +1 -1
- package/Component.mobile.js +2 -2
- package/Component.modal.mobile.js +2 -2
- package/Component.responsive.js +1 -1
- package/components/arrow/Component.js +1 -1
- package/components/arrow/index.css +3 -3
- package/components/base-checkmark/Component.js +1 -1
- package/components/base-checkmark/index.css +4 -4
- package/components/base-option/Component.js +1 -1
- package/components/base-option/index.css +13 -13
- package/components/base-select/Component.js +7 -4
- package/components/base-select/index.css +11 -11
- package/components/base-select-mobile/Component.js +8 -3
- package/components/base-select-mobile/footer/Component.js +1 -1
- package/components/base-select-mobile/footer/index.css +5 -5
- package/components/base-select-mobile/index.css +17 -18
- 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/field/Component.js +1 -1
- package/components/field/index.css +12 -12
- package/components/optgroup/Component.js +1 -1
- package/components/optgroup/index.css +6 -6
- package/components/option/Component.js +1 -1
- package/components/option/index.css +20 -20
- package/components/options-list/Component.js +5 -4
- package/components/options-list/index.css +9 -9
- package/components/search/Component.js +1 -1
- package/components/search/index.css +2 -2
- package/components/virtual-options-list/Component.js +5 -4
- package/components/virtual-options-list/index.css +15 -15
- package/cssm/Component-89f0cb07.d.ts +38 -0
- package/cssm/Component.mobile-ebda875c.d.ts +4 -4
- package/cssm/Component.mobile.js +2 -2
- package/cssm/Component.modal.mobile.js +2 -2
- package/cssm/Component.responsive.js +1 -1
- package/cssm/components/base-select/Component.js +6 -3
- package/cssm/components/base-select-mobile/Component.js +7 -2
- package/cssm/components/base-select-mobile/index.module.css +1 -2
- package/cssm/components/options-list/Component.js +4 -3
- package/cssm/components/virtual-options-list/Component.js +4 -3
- package/cssm/desktop-69921c40.d.ts +6 -0
- package/{hook-45ab0a9c.js → cssm/hook-244c8d6e.js} +4 -1
- package/cssm/index-ebda875c.d.ts +1 -37
- package/cssm/index.js +1 -1
- package/cssm/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/index.d.ts +1 -1
- package/cssm/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
- package/cssm/shared.js +1 -1
- package/{esm/typings-9211a437.d.ts → cssm/typings-89f0cb07.d.ts} +5 -7
- package/cssm/typings.d.ts +4 -0
- package/desktop-69921c40.d.ts +6 -0
- package/esm/Component-89f0cb07.d.ts +38 -0
- package/esm/Component.mobile-ebda875c.d.ts +4 -4
- package/esm/Component.mobile.js +2 -2
- package/esm/Component.modal.mobile.js +2 -2
- package/esm/Component.responsive.js +1 -1
- package/esm/components/arrow/Component.js +1 -1
- package/esm/components/arrow/index.css +3 -3
- package/esm/components/base-checkmark/Component.js +1 -1
- package/esm/components/base-checkmark/index.css +4 -4
- package/esm/components/base-option/Component.js +1 -1
- package/esm/components/base-option/index.css +13 -13
- package/esm/components/base-select/Component.js +7 -4
- package/esm/components/base-select/index.css +11 -11
- package/esm/components/base-select-mobile/Component.js +8 -3
- package/esm/components/base-select-mobile/footer/Component.js +1 -1
- package/esm/components/base-select-mobile/footer/index.css +5 -5
- package/esm/components/base-select-mobile/index.css +17 -18
- 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/field/Component.js +1 -1
- package/esm/components/field/index.css +12 -12
- package/esm/components/optgroup/Component.js +1 -1
- package/esm/components/optgroup/index.css +6 -6
- package/esm/components/option/Component.js +1 -1
- package/esm/components/option/index.css +20 -20
- package/esm/components/options-list/Component.js +5 -4
- package/esm/components/options-list/index.css +9 -9
- package/esm/components/search/Component.js +1 -1
- package/esm/components/search/index.css +2 -2
- package/esm/components/virtual-options-list/Component.js +5 -4
- package/esm/components/virtual-options-list/index.css +15 -15
- package/esm/desktop-69921c40.d.ts +6 -0
- package/esm/{hook-3fd6d6d4.js → hook-fd09603a.js} +4 -1
- package/esm/index-ebda875c.d.ts +1 -37
- package/esm/index.js +1 -1
- package/esm/mobile.js +1 -1
- 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.js +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -3
- package/esm/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/header/index.css +3 -3
- 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.js +1 -1
- package/{modern/typings-9211a437.d.ts → esm/typings-89f0cb07.d.ts} +5 -7
- package/esm/typings.d.ts +4 -0
- package/{cssm/hook-d1f5dd40.js → hook-38a2e173.js} +4 -1
- package/index-ebda875c.d.ts +1 -37
- package/index.js +1 -1
- package/mobile.js +1 -1
- package/modern/Component-89f0cb07.d.ts +38 -0
- package/modern/Component.mobile-ebda875c.d.ts +4 -4
- package/modern/Component.mobile.js +2 -2
- package/modern/Component.modal.mobile.js +2 -2
- package/modern/Component.responsive.js +1 -1
- package/modern/components/arrow/Component.js +1 -1
- package/modern/components/arrow/index.css +3 -3
- package/modern/components/base-checkmark/Component.js +1 -1
- package/modern/components/base-checkmark/index.css +4 -4
- package/modern/components/base-option/Component.js +1 -1
- package/modern/components/base-option/index.css +13 -13
- package/modern/components/base-select/Component.js +4 -4
- package/modern/components/base-select/index.css +11 -11
- package/modern/components/base-select-mobile/Component.js +5 -3
- package/modern/components/base-select-mobile/footer/Component.js +1 -1
- package/modern/components/base-select-mobile/footer/index.css +5 -5
- package/modern/components/base-select-mobile/index.css +17 -18
- 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/field/Component.js +1 -1
- package/modern/components/field/index.css +12 -12
- package/modern/components/optgroup/Component.js +1 -1
- package/modern/components/optgroup/index.css +6 -6
- package/modern/components/option/Component.js +1 -1
- package/modern/components/option/index.css +20 -20
- package/modern/components/options-list/Component.js +5 -4
- package/modern/components/options-list/index.css +9 -9
- package/modern/components/search/Component.js +1 -1
- package/modern/components/search/index.css +2 -2
- package/modern/components/virtual-options-list/Component.js +5 -4
- package/modern/components/virtual-options-list/index.css +15 -15
- package/modern/desktop-69921c40.d.ts +6 -0
- package/modern/{hook-5dd83d48.js → hook-ba0e806d.js} +1 -1
- package/modern/index-ebda875c.d.ts +1 -37
- package/modern/index.js +1 -1
- package/modern/mobile.js +1 -1
- 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.js +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -3
- package/modern/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/header/index.css +3 -3
- 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.js +1 -1
- package/{typings-9211a437.d.ts → modern/typings-89f0cb07.d.ts} +5 -7
- package/modern/typings.d.ts +4 -0
- package/package.json +7 -7
- 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.js +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -3
- package/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/header/index.css +3 -3
- 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.js +1 -1
- package/src/Component.mobile.tsx +2 -0
- package/src/Component.modal.mobile.tsx +2 -0
- package/src/components/base-select/Component.tsx +3 -1
- package/src/components/base-select-mobile/Component.tsx +7 -2
- package/src/components/base-select-mobile/index.module.css +1 -1
- package/src/components/options-list/Component.tsx +9 -1
- package/src/components/virtual-options-list/Component.tsx +12 -1
- package/src/presets/useSelectWithApply/options-list-with-apply/Component.tsx +1 -1
- package/src/typings.ts +5 -0
- package/{cssm/typings-9211a437.d.ts → typings-89f0cb07.d.ts} +5 -7
- package/typings.d.ts +4 -0
- package/cssm/desktop-63dec22f.d.ts +0 -6
- package/desktop-63dec22f.d.ts +0 -6
- package/esm/desktop-63dec22f.d.ts +0 -6
- package/modern/desktop-63dec22f.d.ts +0 -6
- /package/cssm/{hook-d1f5dd40.d.ts → hook-244c8d6e.d.ts} +0 -0
- /package/esm/{hook-3fd6d6d4.d.ts → hook-fd09603a.d.ts} +0 -0
- /package/{hook-45ab0a9c.d.ts → hook-38a2e173.d.ts} +0 -0
- /package/modern/{hook-5dd83d48.d.ts → hook-ba0e806d.d.ts} +0 -0
|
@@ -28,7 +28,7 @@ var createCounter = function () {
|
|
|
28
28
|
};
|
|
29
29
|
var OptionsList = React.forwardRef(function (_a, ref) {
|
|
30
30
|
var _b;
|
|
31
|
-
var _c = _a.size, size = _c === void 0 ? 's' : _c, className = _a.className, optionGroupClassName = _a.optionGroupClassName, scrollbarClassName = _a.scrollbarClassName, Option = _a.Option, getOptionProps = _a.getOptionProps, _d = _a.options, options = _d === void 0 ? [] : _d, _e = _a.Optgroup, Optgroup = _e === void 0 ? components_optgroup_Component.Optgroup : _e, dataTestId = _a.dataTestId, emptyPlaceholder = _a.emptyPlaceholder, _f = _a.visibleOptions, visibleOptions = _f === void 0 ? consts.DEFAULT_VISIBLE_OPTIONS : _f, onScroll = _a.onScroll, open = _a.open, header = _a.header, footer = _a.footer, _g = _a.showFooter, showFooter = _g === void 0 ? true : _g, optionsListWidth = _a.optionsListWidth, nativeScrollbarProp = _a.nativeScrollbar, _h = _a.flatOptions, flatOptions = _h === void 0 ? [] : _h;
|
|
31
|
+
var _c = _a.size, size = _c === void 0 ? 's' : _c, className = _a.className, optionGroupClassName = _a.optionGroupClassName, scrollbarClassName = _a.scrollbarClassName, Option = _a.Option, getOptionProps = _a.getOptionProps, _d = _a.options, options = _d === void 0 ? [] : _d, _e = _a.Optgroup, Optgroup = _e === void 0 ? components_optgroup_Component.Optgroup : _e, dataTestId = _a.dataTestId, emptyPlaceholder = _a.emptyPlaceholder, _f = _a.visibleOptions, visibleOptions = _f === void 0 ? consts.DEFAULT_VISIBLE_OPTIONS : _f, onScroll = _a.onScroll, open = _a.open, header = _a.header, footer = _a.footer, _g = _a.showFooter, showFooter = _g === void 0 ? true : _g, optionsListWidth = _a.optionsListWidth, nativeScrollbarProp = _a.nativeScrollbar, _h = _a.flatOptions, flatOptions = _h === void 0 ? [] : _h, setHighlightedIndex = _a.setHighlightedIndex;
|
|
32
32
|
var nativeScrollbar = hooks.useMedia([[true, '(max-width: 1023px)']], false)[0];
|
|
33
33
|
nativeScrollbar = Boolean(nativeScrollbarProp !== null && nativeScrollbarProp !== void 0 ? nativeScrollbarProp : nativeScrollbar);
|
|
34
34
|
var renderOption = function (option, index) { return (React__default.default.createElement(Option, tslib.__assign({ key: option.key }, getOptionProps(option, index)))); };
|
|
@@ -54,10 +54,11 @@ var OptionsList = React.forwardRef(function (_a, ref) {
|
|
|
54
54
|
return (React__default.default.createElement(coreComponentsScrollbar.Scrollbar, { className: cn__default.default(styles__default.default.scrollable, scrollbarClassName), ref: scrollbarRef, horizontalAutoStretch: optionsListWidth === 'content', scrollableNodeProps: scrollableNodeProps, contentNodeProps: { ref: listRef } }, renderListItems()));
|
|
55
55
|
};
|
|
56
56
|
var renderWithNativeScrollbar = function () { return (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.scrollable, scrollbarClassName), ref: mergeRefs__default.default([listRef, ref]), onScroll: onScroll }, renderListItems())); };
|
|
57
|
+
var resetHighlightedIndex = function () { return setHighlightedIndex === null || setHighlightedIndex === void 0 ? void 0 : setHighlightedIndex(-1); };
|
|
57
58
|
return (React__default.default.createElement("div", tslib.__assign({}, (nativeScrollbar && { 'data-test-id': dataTestId }), { className: cn__default.default(styles__default.default.optionsList, styles__default.default[size], className) }),
|
|
58
|
-
header && React__default.default.createElement("div", { className: styles__default.default.optionsListHeader }, header),
|
|
59
|
+
header && (React__default.default.createElement("div", { className: styles__default.default.optionsListHeader, onMouseEnter: resetHighlightedIndex }, header)),
|
|
59
60
|
nativeScrollbar ? renderWithNativeScrollbar() : renderWithCustomScrollbar(),
|
|
60
|
-
showFooter && footer && (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.optionsListFooter, (_b = {},
|
|
61
|
+
showFooter && footer && (React__default.default.createElement("div", { onMouseEnter: resetHighlightedIndex, className: cn__default.default(styles__default.default.optionsListFooter, (_b = {},
|
|
61
62
|
_b[styles__default.default.withBorder] = visibleOptions && flatOptions.length > visibleOptions,
|
|
62
63
|
_b)) }, footer))));
|
|
63
64
|
});
|
|
@@ -24,7 +24,7 @@ var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
|
|
|
24
24
|
|
|
25
25
|
var VirtualOptionsList = React.forwardRef(function (_a, ref) {
|
|
26
26
|
var _b;
|
|
27
|
-
var _c = _a.size, size = _c === void 0 ? 's' : _c, _d = _a.flatOptions, flatOptions = _d === void 0 ? [] : _d, _e = _a.highlightedIndex, highlightedIndex = _e === void 0 ? -1 : _e, className = _a.className, getOptionProps = _a.getOptionProps, Option = _a.Option, open = _a.open, _f = _a.options, options = _f === void 0 ? [] : _f, _g = _a.Optgroup, Optgroup = _g === void 0 ? components_optgroup_Component.Optgroup : _g, dataTestId = _a.dataTestId, emptyPlaceholder = _a.emptyPlaceholder, _h = _a.visibleOptions, visibleOptions = _h === void 0 ? consts.DEFAULT_VISIBLE_OPTIONS : _h, header = _a.header, footer = _a.footer, _j = _a.showFooter, showFooter = _j === void 0 ? true : _j, optionsListWidth = _a.optionsListWidth, onScroll = _a.onScroll, nativeScrollbarProp = _a.nativeScrollbar;
|
|
27
|
+
var _c = _a.size, size = _c === void 0 ? 's' : _c, _d = _a.flatOptions, flatOptions = _d === void 0 ? [] : _d, _e = _a.highlightedIndex, highlightedIndex = _e === void 0 ? -1 : _e, className = _a.className, getOptionProps = _a.getOptionProps, Option = _a.Option, open = _a.open, _f = _a.options, options = _f === void 0 ? [] : _f, _g = _a.Optgroup, Optgroup = _g === void 0 ? components_optgroup_Component.Optgroup : _g, dataTestId = _a.dataTestId, emptyPlaceholder = _a.emptyPlaceholder, _h = _a.visibleOptions, visibleOptions = _h === void 0 ? consts.DEFAULT_VISIBLE_OPTIONS : _h, header = _a.header, footer = _a.footer, _j = _a.showFooter, showFooter = _j === void 0 ? true : _j, optionsListWidth = _a.optionsListWidth, onScroll = _a.onScroll, nativeScrollbarProp = _a.nativeScrollbar, setHighlightedIndex = _a.setHighlightedIndex;
|
|
28
28
|
var listRef = React.useRef(null);
|
|
29
29
|
var parentRef = React.useRef(null);
|
|
30
30
|
var scrollbarRef = React.useRef(null);
|
|
@@ -125,14 +125,15 @@ var VirtualOptionsList = React.forwardRef(function (_a, ref) {
|
|
|
125
125
|
}
|
|
126
126
|
return React__default.default.createElement("div", tslib.__assign({}, contentNodeProps), renderList());
|
|
127
127
|
};
|
|
128
|
+
var resetHighlightedIndex = function () { return setHighlightedIndex === null || setHighlightedIndex === void 0 ? void 0 : setHighlightedIndex(-1); };
|
|
128
129
|
if (options.length === 0 && !emptyPlaceholder) {
|
|
129
130
|
return null;
|
|
130
131
|
}
|
|
131
132
|
return (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.virtualOptionsList, styles__default.default[size], className), "data-test-id": dataTestId },
|
|
132
|
-
header && React__default.default.createElement("div", { className: styles__default.default.virtualOptionsListHeader }, header),
|
|
133
|
+
header && (React__default.default.createElement("div", { className: styles__default.default.virtualOptionsListHeader, onMouseEnter: resetHighlightedIndex }, header)),
|
|
133
134
|
nativeScrollbar ? renderWithNativeScrollbar() : renderWithCustomScrollbar(),
|
|
134
135
|
emptyPlaceholder && options.length === 0 && (React__default.default.createElement("div", { className: styles__default.default.emptyPlaceholder }, emptyPlaceholder)),
|
|
135
|
-
showFooter && footer && (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.virtualOptionsListFooter, (_b = {},
|
|
136
|
+
showFooter && footer && (React__default.default.createElement("div", { onMouseEnter: resetHighlightedIndex, className: cn__default.default(styles__default.default.virtualOptionsListFooter, (_b = {},
|
|
136
137
|
_b[styles__default.default.withBorder] = visibleOptions && flatOptions.length > visibleOptions,
|
|
137
138
|
_b)) }, footer))));
|
|
138
139
|
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { CommonButtonProps } from "./typings-89f0cb07";
|
|
4
|
+
declare const ButtonDesktop: React.ForwardRefExoticComponent<CommonButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
5
|
+
export { ButtonDesktop };
|
|
6
|
+
export type { CommonButtonProps as ButtonDesktopProps } from "./typings-89f0cb07";
|
|
@@ -18,7 +18,10 @@ var OptionsListWithApply = React.forwardRef(function (_a, ref) {
|
|
|
18
18
|
var optionProps = defaultGetOptionProps(option, index);
|
|
19
19
|
var selected = option.key === SELECT_ALL_KEY
|
|
20
20
|
? selectedDraft.length === flatOptions.length - 1
|
|
21
|
-
: selectedDraft.
|
|
21
|
+
: selectedDraft.some(function (_a) {
|
|
22
|
+
var key = _a.key;
|
|
23
|
+
return key === option.key;
|
|
24
|
+
});
|
|
22
25
|
return tslib.__assign(tslib.__assign({}, optionProps), { selected: selected });
|
|
23
26
|
}, [defaultGetOptionProps, flatOptions.length, selectedDraft]);
|
|
24
27
|
var handleApply = React.useCallback(function () {
|
package/cssm/index-ebda875c.d.ts
CHANGED
|
@@ -1,38 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
import { FC } from "react";
|
|
4
|
-
import { BaseButtonProps } from "./typings-9211a437";
|
|
5
|
-
/**
|
|
6
|
-
* Минимальное время отображения лоадера - 500мс,
|
|
7
|
-
* чтобы при быстрых ответах от сервера кнопка не «моргала».
|
|
8
|
-
*/
|
|
9
|
-
declare const LOADER_MIN_DISPLAY_INTERVAL = 500;
|
|
10
|
-
declare const BaseButton: React.ForwardRefExoticComponent<BaseButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
11
|
-
type SpinnerProps = {
|
|
12
|
-
/**
|
|
13
|
-
* Управление видимостью компонента
|
|
14
|
-
*/
|
|
15
|
-
visible?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Размер компонента
|
|
18
|
-
*/
|
|
19
|
-
size?: "xs" | "s" | "m";
|
|
20
|
-
/**
|
|
21
|
-
* Дополнительный класс
|
|
22
|
-
*/
|
|
23
|
-
className?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Идентификатор компонента в DOM
|
|
26
|
-
*/
|
|
27
|
-
id?: string;
|
|
28
|
-
/**
|
|
29
|
-
* Идентификатор для систем автоматизированного тестирования
|
|
30
|
-
*/
|
|
31
|
-
dataTestId?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Палитра, в контексте которой используется спиннер
|
|
34
|
-
*/
|
|
35
|
-
colors?: "default" | "inverted";
|
|
36
|
-
};
|
|
37
|
-
declare const Spinner: FC<SpinnerProps>;
|
|
38
|
-
export { LOADER_MIN_DISPLAY_INTERVAL, BaseButton, SpinnerProps, Spinner };
|
|
2
|
+
export * from "./Component-89f0cb07";
|
package/cssm/index.js
CHANGED
|
@@ -56,7 +56,7 @@ require('./components/base-select-mobile/footer/index.module.css');
|
|
|
56
56
|
require('./components/virtual-options-list/Component.js');
|
|
57
57
|
require('react-virtual');
|
|
58
58
|
require('./components/virtual-options-list/index.module.css');
|
|
59
|
-
require('./hook-
|
|
59
|
+
require('./hook-244c8d6e.js');
|
|
60
60
|
require('./presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
|
|
61
61
|
require('@alfalab/core-components-button/cssm/desktop');
|
|
62
62
|
require('./presets/useSelectWithApply/options-list-with-apply/footer/index.module.css');
|
package/cssm/mobile.js
CHANGED
|
@@ -49,7 +49,7 @@ require('./components/base-select-mobile/footer/index.module.css');
|
|
|
49
49
|
require('./components/virtual-options-list/Component.js');
|
|
50
50
|
require('react-virtual');
|
|
51
51
|
require('./components/virtual-options-list/index.module.css');
|
|
52
|
-
require('./hook-
|
|
52
|
+
require('./hook-244c8d6e.js');
|
|
53
53
|
require('./presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
|
|
54
54
|
require('@alfalab/core-components-button/cssm/desktop');
|
|
55
55
|
require('./presets/useSelectWithApply/options-list-with-apply/footer/index.module.css');
|
package/cssm/presets/index.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var presets_useSelectWithLoading_hook = require('./useSelectWithLoading/hook.js');
|
|
6
6
|
var presets_useLazyLoading_hook = require('./useLazyLoading/hook.js');
|
|
7
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('../hook-
|
|
7
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('../hook-244c8d6e.js');
|
|
8
8
|
require('tslib');
|
|
9
9
|
require('react');
|
|
10
10
|
require('@alfalab/core-components-skeleton/cssm');
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
require('tslib');
|
|
6
6
|
require('react');
|
|
7
7
|
require('../../utils.js');
|
|
8
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../hook-
|
|
8
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../hook-244c8d6e.js');
|
|
9
9
|
require('../../components/options-list/Component.js');
|
|
10
10
|
require('react-merge-refs');
|
|
11
11
|
require('classnames');
|
|
@@ -6,7 +6,7 @@ require('tslib');
|
|
|
6
6
|
require('react');
|
|
7
7
|
require('../../../components/options-list/Component.js');
|
|
8
8
|
require('../../../consts.js');
|
|
9
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../../hook-
|
|
9
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../../hook-244c8d6e.js');
|
|
10
10
|
require('./footer/Component.js');
|
|
11
11
|
require('./header/Component.js');
|
|
12
12
|
require('react-merge-refs');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../../../hook-
|
|
1
|
+
export * from "../../../hook-244c8d6e";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../../hook-
|
|
5
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../../hook-244c8d6e.js');
|
|
6
6
|
require('tslib');
|
|
7
7
|
require('react');
|
|
8
8
|
require('../../../utils.js');
|
package/cssm/shared.js
CHANGED
|
@@ -13,7 +13,7 @@ var components_baseOption_Component = require('./components/base-option/Componen
|
|
|
13
13
|
var components_search_Component = require('./components/search/Component.js');
|
|
14
14
|
var presets_useSelectWithLoading_hook = require('./presets/useSelectWithLoading/hook.js');
|
|
15
15
|
var presets_useLazyLoading_hook = require('./presets/useLazyLoading/hook.js');
|
|
16
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('./hook-
|
|
16
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('./hook-244c8d6e.js');
|
|
17
17
|
var utils = require('./utils.js');
|
|
18
18
|
require('react');
|
|
19
19
|
require('classnames');
|
|
@@ -69,6 +69,8 @@ type ComponentProps = {
|
|
|
69
69
|
* Дочерние элементы.
|
|
70
70
|
*/
|
|
71
71
|
children?: ReactNode;
|
|
72
|
+
};
|
|
73
|
+
type PrivateButtonProps = {
|
|
72
74
|
/**
|
|
73
75
|
* Основные стили компонента.
|
|
74
76
|
*/
|
|
@@ -80,16 +82,12 @@ type ComponentProps = {
|
|
|
80
82
|
*/
|
|
81
83
|
colorStylesMap: StyleColors;
|
|
82
84
|
};
|
|
83
|
-
type
|
|
84
|
-
type
|
|
85
|
-
type BaseButtonProps = Partial<AnchorBaseButtonProps | NativeBaseButtonProps>;
|
|
86
|
-
type AnchorButtonProps = Omit<BaseButtonProps, 'styles' | 'colorStylesMap'> & AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
87
|
-
type NativeButtonProps = Omit<BaseButtonProps, 'styles' | 'colorStylesMap'> & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
88
|
-
type ButtonProps = Partial<AnchorButtonProps | NativeButtonProps> & {
|
|
85
|
+
type CommonButtonProps = ComponentProps & Partial<AnchorHTMLAttributes<HTMLAnchorElement> | ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
86
|
+
type ButtonProps = CommonButtonProps & {
|
|
89
87
|
/**
|
|
90
88
|
* Контрольная точка, с нее начинается desktop версия
|
|
91
89
|
* @default 1024
|
|
92
90
|
*/
|
|
93
91
|
breakpoint?: number;
|
|
94
92
|
};
|
|
95
|
-
export { StyleColors, ComponentProps,
|
|
93
|
+
export { StyleColors, ComponentProps, PrivateButtonProps, CommonButtonProps, ButtonProps };
|
package/cssm/typings.d.ts
CHANGED
|
@@ -459,6 +459,10 @@ type OptionsListProps = {
|
|
|
459
459
|
* Обработчик отмены изменений
|
|
460
460
|
*/
|
|
461
461
|
onClear?: () => void;
|
|
462
|
+
/**
|
|
463
|
+
* Указать индекс пункта для hover состояния
|
|
464
|
+
*/
|
|
465
|
+
setHighlightedIndex?: (index: number) => void;
|
|
462
466
|
};
|
|
463
467
|
type OptgroupProps = {
|
|
464
468
|
/**
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { CommonButtonProps } from "./typings-89f0cb07";
|
|
4
|
+
declare const ButtonDesktop: React.ForwardRefExoticComponent<CommonButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
5
|
+
export { ButtonDesktop };
|
|
6
|
+
export type { CommonButtonProps as ButtonDesktopProps } from "./typings-89f0cb07";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FC } from "react";
|
|
4
|
+
import { CommonButtonProps, PrivateButtonProps } from "./typings-89f0cb07";
|
|
5
|
+
type SpinnerProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Управление видимостью компонента
|
|
8
|
+
*/
|
|
9
|
+
visible?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Размер компонента
|
|
12
|
+
*/
|
|
13
|
+
size?: "xs" | "s" | "m";
|
|
14
|
+
/**
|
|
15
|
+
* Дополнительный класс
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Идентификатор компонента в DOM
|
|
20
|
+
*/
|
|
21
|
+
id?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
24
|
+
*/
|
|
25
|
+
dataTestId?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Палитра, в контексте которой используется спиннер
|
|
28
|
+
*/
|
|
29
|
+
colors?: "default" | "inverted";
|
|
30
|
+
};
|
|
31
|
+
declare const Spinner: FC<SpinnerProps>;
|
|
32
|
+
/**
|
|
33
|
+
* Минимальное время отображения лоадера - 500мс,
|
|
34
|
+
* чтобы при быстрых ответах от сервера кнопка не «моргала».
|
|
35
|
+
*/
|
|
36
|
+
declare const LOADER_MIN_DISPLAY_INTERVAL = 500;
|
|
37
|
+
declare const BaseButton: React.ForwardRefExoticComponent<(CommonButtonProps & PrivateButtonProps) & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
38
|
+
export { SpinnerProps, Spinner, LOADER_MIN_DISPLAY_INTERVAL, BaseButton };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
type
|
|
5
|
-
declare const
|
|
6
|
-
export {
|
|
3
|
+
import { BaseFormControlProps } from "./index-ebda875c";
|
|
4
|
+
type FormControlMobileProps = Omit<BaseFormControlProps, 'styles' | 'colorStyles'>;
|
|
5
|
+
declare const FormControlMobile: React.ForwardRefExoticComponent<FormControlMobileProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { FormControlMobileProps, FormControlMobile };
|
package/esm/Component.mobile.js
CHANGED
|
@@ -10,7 +10,7 @@ import { Option } from './components/option/Component.js';
|
|
|
10
10
|
import { OptionsList } from './components/options-list/Component.js';
|
|
11
11
|
import { Search } from './components/search/Component.js';
|
|
12
12
|
import { VirtualOptionsList } from './components/virtual-options-list/Component.js';
|
|
13
|
-
import { u as useSelectWithApply } from './hook-
|
|
13
|
+
import { u as useSelectWithApply } from './hook-fd09603a.js';
|
|
14
14
|
import { Header } from './presets/useSelectWithApply/options-list-with-apply/header/Component.js';
|
|
15
15
|
import 'classnames';
|
|
16
16
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
@@ -53,7 +53,7 @@ var SelectMobile = forwardRef(function (_a, ref) {
|
|
|
53
53
|
showClear: showClear,
|
|
54
54
|
showSelectAll: showSelectAll,
|
|
55
55
|
});
|
|
56
|
-
return (React.createElement(BaseSelectMobile, __assign({ ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: __assign({ FormControlComponent: FormControlMobile }, fieldProps), optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, Search: Search$1, isBottomSheet: true, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList$1, bottomSheetProps: __assign({ bottomAddons: useWithApplyHook && showHeaderWithSelectAll && (React.createElement(Header, __assign({}, applyProps.optionsListProps.headerProps, { mobile: true }))) }, bottomSheetProps), optionsListProps: optionsListProps }, restProps, (useWithApplyHook && applyProps))));
|
|
56
|
+
return (React.createElement(BaseSelectMobile, __assign({ ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: __assign({ FormControlComponent: FormControlMobile }, fieldProps), optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, Search: Search$1, isBottomSheet: true, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList$1, showSearch: showSearch, searchProps: searchProps, bottomSheetProps: __assign({ bottomAddons: useWithApplyHook && showHeaderWithSelectAll && (React.createElement(Header, __assign({}, applyProps.optionsListProps.headerProps, { mobile: true }))) }, bottomSheetProps), optionsListProps: optionsListProps }, restProps, (useWithApplyHook && applyProps))));
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
export { SelectMobile };
|
|
@@ -9,7 +9,7 @@ import { Optgroup } from './components/optgroup/Component.js';
|
|
|
9
9
|
import { Option } from './components/option/Component.js';
|
|
10
10
|
import { OptionsList } from './components/options-list/Component.js';
|
|
11
11
|
import { VirtualOptionsList } from './components/virtual-options-list/Component.js';
|
|
12
|
-
import { u as useSelectWithApply } from './hook-
|
|
12
|
+
import { u as useSelectWithApply } from './hook-fd09603a.js';
|
|
13
13
|
import { Header } from './presets/useSelectWithApply/options-list-with-apply/header/Component.js';
|
|
14
14
|
import 'classnames';
|
|
15
15
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
@@ -53,7 +53,7 @@ var SelectModalMobile = forwardRef(function (_a, ref) {
|
|
|
53
53
|
showClear: showClear,
|
|
54
54
|
showSelectAll: showSelectAll,
|
|
55
55
|
});
|
|
56
|
-
return (React.createElement(BaseSelectMobile, __assign({ ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: __assign({ FormControlComponent: FormControlMobile }, fieldProps), optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, isBottomSheet: false, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList$1, optionsListProps: optionsListProps, modalHeaderProps: __assign({ bottomAddons: useWithApplyHook && showHeaderWithSelectAll && (React.createElement(Header, __assign({}, applyProps.optionsListProps.headerProps, { mobile: true }))) }, modalHeaderProps) }, restProps, (useWithApplyHook && applyProps))));
|
|
56
|
+
return (React.createElement(BaseSelectMobile, __assign({ ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: __assign({ FormControlComponent: FormControlMobile }, fieldProps), optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, isBottomSheet: false, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList$1, optionsListProps: optionsListProps, showSearch: showSearch, searchProps: searchProps, modalHeaderProps: __assign({ bottomAddons: useWithApplyHook && showHeaderWithSelectAll && (React.createElement(Header, __assign({}, applyProps.optionsListProps.headerProps, { mobile: true }))) }, modalHeaderProps) }, restProps, (useWithApplyHook && applyProps))));
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
export { SelectModalMobile };
|
|
@@ -39,7 +39,7 @@ import '@alfalab/core-components-base-modal/esm';
|
|
|
39
39
|
import '@alfalab/core-components-button/esm/mobile';
|
|
40
40
|
import './components/virtual-options-list/Component.js';
|
|
41
41
|
import 'react-virtual';
|
|
42
|
-
import './hook-
|
|
42
|
+
import './hook-fd09603a.js';
|
|
43
43
|
import './presets/useSelectWithApply/options-list-with-apply/footer/Component.js';
|
|
44
44
|
import '@alfalab/core-components-button/esm/desktop';
|
|
45
45
|
import './presets/useSelectWithApply/options-list-with-apply/header/Component.js';
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
4
4
|
|
|
5
|
-
var styles = {"arrow":"
|
|
5
|
+
var styles = {"arrow":"select__arrow_1auoj","open":"select__open_1auoj"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
var Arrow = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1o7y2 */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-graphic-primary: #0e0e0e; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
/* checkmark */
|
|
27
27
|
|
|
28
28
|
/* optgroup */
|
|
29
|
-
} .
|
|
29
|
+
} .select__arrow_1auoj {
|
|
30
30
|
display: block;
|
|
31
31
|
width: 24px;
|
|
32
32
|
height: 24px;
|
|
33
33
|
color: var(--select-arrow-color);
|
|
34
34
|
|
|
35
35
|
transition: transform 0.15s ease-in-out, opacity 0.2s ease;
|
|
36
|
-
} .
|
|
36
|
+
} .select__open_1auoj {
|
|
37
37
|
transform: var(--arrow-transform);
|
|
38
38
|
}
|
|
@@ -3,7 +3,7 @@ import cn from 'classnames';
|
|
|
3
3
|
import { Checkbox } from '@alfalab/core-components-checkbox/esm';
|
|
4
4
|
import { CheckmarkMIcon } from '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
5
5
|
|
|
6
|
-
var styles = {"checkmark":"
|
|
6
|
+
var styles = {"checkmark":"select__checkmark_w0puj","single":"select__single_w0puj","selected":"select__selected_w0puj"};
|
|
7
7
|
require('./index.css')
|
|
8
8
|
|
|
9
9
|
var BaseCheckmark = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1lc5k */
|
|
2
2
|
:root {
|
|
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 */
|
|
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 */
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
/* checkmark */
|
|
24
24
|
|
|
25
25
|
/* optgroup */
|
|
26
|
-
} .
|
|
26
|
+
} .select__checkmark_w0puj {
|
|
27
27
|
flex-shrink: 0;
|
|
28
28
|
box-sizing: border-box;
|
|
29
|
-
} .
|
|
29
|
+
} .select__single_w0puj {
|
|
30
30
|
display: flex;
|
|
31
31
|
align-items: center;
|
|
32
32
|
justify-content: center;
|
|
33
33
|
opacity: 0
|
|
34
|
-
} .
|
|
34
|
+
} .select__single_w0puj.select__selected_w0puj {
|
|
35
35
|
opacity: 1;
|
|
36
36
|
}
|
|
@@ -5,7 +5,7 @@ import { BaseCheckmark } from '../base-checkmark/Component.js';
|
|
|
5
5
|
import '@alfalab/core-components-checkbox/esm';
|
|
6
6
|
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
7
7
|
|
|
8
|
-
var styles = {"option":"
|
|
8
|
+
var styles = {"option":"select__option_xjoaa","disabled":"select__disabled_xjoaa","checkmarkBefore":"select__checkmarkBefore_xjoaa","mobile":"select__mobile_xjoaa","checkmarkAfter":"select__checkmarkAfter_xjoaa","textContent":"select__textContent_xjoaa","selected":"select__selected_xjoaa","highlighted":"select__highlighted_xjoaa","content":"select__content_xjoaa"};
|
|
9
9
|
require('./index.css')
|
|
10
10
|
|
|
11
11
|
var BaseOption = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: fs4mc */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-bg-primary: #fff;
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
/* checkmark */
|
|
44
44
|
|
|
45
45
|
/* optgroup */
|
|
46
|
-
} .
|
|
46
|
+
} .select__option_xjoaa {
|
|
47
47
|
font-size: 16px;
|
|
48
48
|
line-height: 20px;
|
|
49
49
|
font-weight: 400;
|
|
@@ -60,32 +60,32 @@
|
|
|
60
60
|
position: relative;
|
|
61
61
|
cursor: pointer;
|
|
62
62
|
min-height: var(--size-s-height)
|
|
63
|
-
} .
|
|
63
|
+
} .select__option_xjoaa:not(.select__disabled_xjoaa):active {
|
|
64
64
|
background: var(--select-option-active-background);
|
|
65
65
|
color: var(--select-option-active-color);
|
|
66
|
-
} .
|
|
66
|
+
} .select__option_xjoaa.select__checkmarkBefore_xjoaa {
|
|
67
67
|
padding: 0 0 0 var(--gap-s)
|
|
68
|
-
} .
|
|
68
|
+
} .select__option_xjoaa.select__checkmarkBefore_xjoaa.select__mobile_xjoaa {
|
|
69
69
|
padding-left: var(--gap-m);
|
|
70
|
-
} .
|
|
70
|
+
} .select__option_xjoaa.select__checkmarkAfter_xjoaa {
|
|
71
71
|
padding: 0 var(--gap-s) 0 0
|
|
72
|
-
} .
|
|
72
|
+
} .select__option_xjoaa.select__checkmarkAfter_xjoaa.select__mobile_xjoaa {
|
|
73
73
|
padding-right: var(--gap-l);
|
|
74
|
-
} .
|
|
74
|
+
} .select__option_xjoaa.select__textContent_xjoaa {
|
|
75
75
|
padding: var(--gap-s)
|
|
76
|
-
} .
|
|
76
|
+
} .select__option_xjoaa.select__textContent_xjoaa.select__mobile_xjoaa {
|
|
77
77
|
padding: var(--gap-m) var(--gap-l) var(--gap-m) var(--gap-m);
|
|
78
|
-
} .
|
|
78
|
+
} .select__selected_xjoaa {
|
|
79
79
|
background: var(--select-option-selected-background);
|
|
80
80
|
color: var(--select-option-selected-color);
|
|
81
81
|
cursor: default;
|
|
82
|
-
} .
|
|
82
|
+
} .select__highlighted_xjoaa {
|
|
83
83
|
background: var(--select-option-hover-background);
|
|
84
84
|
color: var(--select-option-hover-color);
|
|
85
|
-
} .
|
|
85
|
+
} .select__disabled_xjoaa {
|
|
86
86
|
cursor: var(--disabled-cursor);
|
|
87
87
|
background: var(--select-option-disabled-background);
|
|
88
88
|
color: var(--select-option-disabled-color);
|
|
89
|
-
} .
|
|
89
|
+
} .select__content_xjoaa {
|
|
90
90
|
flex: 1;
|
|
91
91
|
}
|
|
@@ -10,7 +10,7 @@ import { useLayoutEffect_SAFE_FOR_SSR } from '@alfalab/hooks';
|
|
|
10
10
|
import { defaultAccessor, processOptions, defaultFilterFn } from '../../utils.js';
|
|
11
11
|
import { NativeSelect } from '../native-select/Component.js';
|
|
12
12
|
|
|
13
|
-
var styles = {"component":"
|
|
13
|
+
var styles = {"component":"select__component_1c54p","popoverInner":"select__popoverInner_1c54p","optionsList":"select__optionsList_1c54p","optionsListBorder":"select__optionsListBorder_1c54p","nativeSelect":"select__nativeSelect_1c54p","block":"select__block_1c54p","emptySearchPlaceholder":"select__emptySearchPlaceholder_1c54p","search":"select__search_1c54p"};
|
|
14
14
|
require('./index.css')
|
|
15
15
|
|
|
16
16
|
var BaseSelect = forwardRef(
|
|
@@ -127,7 +127,7 @@ function (_a, ref) {
|
|
|
127
127
|
return changes;
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
|
-
}), open = _6.isOpen, getMenuProps = _6.getMenuProps, getInputProps = _6.getInputProps, getItemProps = _6.getItemProps, getComboboxProps = _6.getComboboxProps, getLabelProps = _6.getLabelProps, highlightedIndex = _6.highlightedIndex, toggleMenu = _6.toggleMenu, openMenu = _6.openMenu;
|
|
130
|
+
}), open = _6.isOpen, getMenuProps = _6.getMenuProps, getInputProps = _6.getInputProps, getItemProps = _6.getItemProps, getComboboxProps = _6.getComboboxProps, getLabelProps = _6.getLabelProps, highlightedIndex = _6.highlightedIndex, toggleMenu = _6.toggleMenu, openMenu = _6.openMenu, setHighlightedIndex = _6.setHighlightedIndex;
|
|
131
131
|
var menuProps = getMenuProps({ ref: listRef }, { suppressRefError: true });
|
|
132
132
|
var inputProps = getInputProps(getDropdownProps({ ref: mergeRefs([ref, fieldRef]) }));
|
|
133
133
|
var handleFieldFocus = function (event) {
|
|
@@ -183,7 +183,10 @@ function (_a, ref) {
|
|
|
183
183
|
item: option,
|
|
184
184
|
disabled: option.disabled,
|
|
185
185
|
onMouseDown: function (event) { return event.preventDefault(); },
|
|
186
|
-
}), multiple: multiple, index: index, option: option, size: optionsSize, disabled: option.disabled, highlighted: index === highlightedIndex, selected: selectedItems.
|
|
186
|
+
}), multiple: multiple, index: index, option: option, size: optionsSize, disabled: option.disabled, highlighted: index === highlightedIndex, selected: selectedItems.some(function (_a) {
|
|
187
|
+
var key = _a.key;
|
|
188
|
+
return key === option.key;
|
|
189
|
+
}), dataTestId: getDataTestId(dataTestId, 'option') })); }, [
|
|
187
190
|
dataTestId,
|
|
188
191
|
getItemProps,
|
|
189
192
|
highlightedIndex,
|
|
@@ -293,7 +296,7 @@ function (_a, ref) {
|
|
|
293
296
|
}, dataTestId: getDataTestId(dataTestId, 'field') }, fieldProps)),
|
|
294
297
|
name && !nativeSelect && renderValue(),
|
|
295
298
|
!nativeSelect && (React.createElement(Popover, { open: open, withTransition: false, anchorElement: fieldRef.current, position: popoverPosition, preventFlip: preventFlip, popperClassName: cn(styles.popoverInner, popperClassName), update: updatePopover, zIndex: zIndexPopover }, needRenderOptionsList && (React.createElement("div", __assign({}, menuProps, { className: cn(optionsListClassName, styles.optionsList) }),
|
|
296
|
-
React.createElement(OptionsList, __assign({}, optionsListProps, { optionsListWidth: optionsListWidth, flatOptions: flatOptions, highlightedIndex: highlightedIndex, open: open, size: size, options: filteredOptions, Optgroup: Optgroup, Option: Option, selectedItems: selectedItems, setSelectedItems: setSelectedItems, toggleMenu: toggleMenu, getOptionProps: getOptionProps, visibleOptions: visibleOptions, onScroll: onScroll, dataTestId: getDataTestId(dataTestId, 'options-list'), header: renderOptionsListHeader(), emptyPlaceholder: renderEmptyPlaceholder() })),
|
|
299
|
+
React.createElement(OptionsList, __assign({}, optionsListProps, { setHighlightedIndex: setHighlightedIndex, optionsListWidth: optionsListWidth, flatOptions: flatOptions, highlightedIndex: highlightedIndex, open: open, size: size, options: filteredOptions, Optgroup: Optgroup, Option: Option, selectedItems: selectedItems, setSelectedItems: setSelectedItems, toggleMenu: toggleMenu, getOptionProps: getOptionProps, visibleOptions: visibleOptions, onScroll: onScroll, dataTestId: getDataTestId(dataTestId, 'options-list'), header: renderOptionsListHeader(), emptyPlaceholder: renderEmptyPlaceholder() })),
|
|
297
300
|
React.createElement("div", { className: styles.optionsListBorder })))))));
|
|
298
301
|
});
|
|
299
302
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: vma3q */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-bg-primary: #fff;
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
/* checkmark */
|
|
38
38
|
|
|
39
39
|
/* optgroup */
|
|
40
|
-
} .
|
|
40
|
+
} .select__component_1c54p {
|
|
41
41
|
width: max-content;
|
|
42
42
|
position: relative;
|
|
43
43
|
outline: 0;
|
|
44
44
|
max-width: 100%;
|
|
45
|
-
} .
|
|
45
|
+
} .select__popoverInner_1c54p {
|
|
46
46
|
padding-top: var(--select-options-list-offset);
|
|
47
47
|
padding-bottom: var(--select-options-list-offset);
|
|
48
48
|
box-shadow: none;
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
background: transparent;
|
|
51
51
|
border-radius: 0;
|
|
52
52
|
position: relative;
|
|
53
|
-
} .
|
|
53
|
+
} .select__optionsList_1c54p {
|
|
54
54
|
position: relative;
|
|
55
55
|
padding-top: var(--select-options-list-top-padding);
|
|
56
56
|
padding-bottom: var(--select-options-list-bottom-padding);
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
background: var(--select-option-background);
|
|
60
60
|
overflow: hidden;
|
|
61
61
|
will-change: transform;
|
|
62
|
-
} .
|
|
62
|
+
} .select__optionsListBorder_1c54p {
|
|
63
63
|
position: absolute;
|
|
64
64
|
top: 0;
|
|
65
65
|
right: 0;
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
box-shadow: inset 0 0 0 1px var(--color-light-border-secondary);
|
|
69
69
|
border-radius: inherit;
|
|
70
70
|
pointer-events: none;
|
|
71
|
-
} .
|
|
71
|
+
} .select__nativeSelect_1c54p {
|
|
72
72
|
opacity: 0;
|
|
73
73
|
overflow: hidden;
|
|
74
74
|
position: absolute;
|
|
@@ -81,16 +81,16 @@
|
|
|
81
81
|
height: 100%;
|
|
82
82
|
cursor: pointer;
|
|
83
83
|
z-index: 1;
|
|
84
|
-
} .
|
|
84
|
+
} .select__block_1c54p {
|
|
85
85
|
width: 100%;
|
|
86
|
-
} .
|
|
86
|
+
} .select__emptySearchPlaceholder_1c54p {
|
|
87
87
|
text-align: center;
|
|
88
|
-
} .
|
|
88
|
+
} .select__search_1c54p {
|
|
89
89
|
margin: var(--gap-s) var(--gap-s) 0
|
|
90
|
-
} .
|
|
90
|
+
} .select__search_1c54p:last-child {
|
|
91
91
|
margin-bottom: var(--gap-s);
|
|
92
92
|
} /* width: max-content; fix for IE */ @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
|
|
93
|
-
.
|
|
93
|
+
.select__component_1c54p {
|
|
94
94
|
float: left;
|
|
95
95
|
clear: left;
|
|
96
96
|
}
|